@font-face { font-family: "IBM Plex Mono"; src: url("./brand/fonts/IBMPlexMono-Regular.ttf") format("truetype"); font-weight: 100 900; font-style: normal; font-display: swap; }
/* Flight console: compact, flat and readable. No layered glass or glow. */
:root {
  color-scheme: dark;
  --safe-left: env(safe-area-inset-left, 0px); --safe-right: env(safe-area-inset-right, 0px);
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
  --cyan: #5ddfff; --accent: #5ddfff; --ink: #05090e; --dim: #9bb0c6;
  --panel: #080f19; --edge: #344555;
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, ui-monospace, monospace;
  color: #e8f0f7; background: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; overscroll-behavior: none; }
body { font-size: 13px; touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
input[type=text] { font-size: 16px; -webkit-touch-callout: default; user-select: text; -webkit-user-select: text; touch-action: manipulation; }
button, input { font: inherit; }
button { min-height: 44px; position: relative; padding: 10px 14px; border: 1px solid var(--edge); border-radius: 4px; color: #e8f0f7; background: #111c28; cursor: pointer; letter-spacing: .025em; touch-action: manipulation; -webkit-tap-highlight-color: transparent; transition: background .12s, border-color .12s; }
@media (hover: hover) and (pointer: fine) { button:hover:not(:disabled) { background: #1b2c3b; border-color: #80a6bd; } }
button.primary { border-color: #559caf; background: #163341; color: #e8fbff; }
@media (hover: hover) and (pointer: fine) { button.primary:hover:not(:disabled) { background: #214758; border-color: var(--cyan); } }
button:disabled { opacity: .45; cursor: default; }
button:focus, input:focus, [role=option]:focus { outline: none; }
.keyboard-navigation button:focus-visible { background-color: #1c3547; }
input[type=checkbox] { appearance: auto; accent-color: var(--cyan); width: 20px; height: 20px; flex-shrink: 0; margin: 0; cursor: pointer; }
input[type=range] { appearance: none; -webkit-appearance: none; height: 44px; min-height: 44px; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; background: #344d60; border-radius: 0; }
input[type=range]::-moz-range-track { height: 4px; background: #344d60; border-radius: 0; }
input[type=range]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 12px; height: 20px; margin-top: -8px; border: 1px solid #b9effa; border-radius: 4px; background: var(--cyan); }
input[type=range]::-moz-range-thumb { width: 10px; height: 18px; border: 1px solid #b9effa; border-radius: 4px; background: var(--cyan); }
canvas { display: block; width: 100%; height: 100%; touch-action: none; outline: none; }
.vignette, .brand { display: none; }
#status { position: absolute; top: max(16px, var(--safe-top)); right: max(18px, var(--safe-right)); color: var(--dim); font-size: 10px; letter-spacing: .04em; }
.screen { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; padding: max(12px, var(--safe-top)) max(16px, var(--safe-right)) max(12px, var(--safe-bottom)) max(16px, var(--safe-left)); }
.home-copy { pointer-events: auto; width: min(360px, 100%); padding: 22px; background: var(--panel); border: 1px solid var(--edge); border-radius: 6px; }
.home-copy h1 { display: flex; align-items: baseline; justify-content: center; margin: 0 0 22px; white-space: nowrap; font-size: clamp(20px, 3.6vw, 27px); font-weight: 500; letter-spacing: .09em; color: #c8f2fa; }
.title-triangle { display: inline-block; width: .77em; height: .79em; margin: 0 calc(.08em + var(--ui-wordmark-triangle-shift) * 1em) 0 calc(var(--ui-wordmark-triangle-shift) * -1em); fill: none; stroke: var(--cyan); stroke-width: 7; overflow: visible; flex-shrink: 0; transform: translateY(calc(var(--ui-wordmark-triangle-drop) * 1em)); }
.home-actions { display: grid; gap: 8px; }
.launch-button { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 50px; font-size: 16px; text-align: center; }
.button-icon, .chevron { display: none; }
.player-name { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; text-align: left; }
.player-name > span { color: var(--dim); font-size: 12px; }
.player-name input, .dialog input[type=text] { width: 100%; min-width: 0; min-height: 44px; border: 1px solid var(--edge); border-radius: 4px; background: #070d14; color: #edf7ff; padding: 9px 11px; font-size: 16px; }
input::placeholder { color: #8395a5; }
.sub-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.sub-actions button { background: transparent; font-size: 11px; padding: 8px 4px; color: #b9c9d6; }
.sub-actions span { display: none; }
.scrim { position: absolute; inset: 0; display: grid; place-items: center; background: #02060bbf; z-index: 5; padding: max(12px, var(--safe-top)) max(16px, var(--safe-right)) max(12px, var(--safe-bottom)) max(16px, var(--safe-left)); }
.dialog, #training, #layout-editor { border: 1px solid var(--edge); border-radius: 6px; background: var(--panel); }
.dialog { position: relative; width: min(460px, 100%); max-height: calc(100dvh - 24px - var(--safe-top) - var(--safe-bottom)); overflow: visible; padding: 22px; }
.dialog h2 { margin: 0 36px 18px 0; font-size: 20px; line-height: 1.25; font-weight: 500; letter-spacing: .025em; color: #d4f5fc; }
.dialog p { line-height: 1.5; color: var(--dim); }
.close { position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; padding: 0; border-color: transparent; background: transparent; display: grid; place-items: center; font-size: 25px; line-height: 1; color: #b6cad9; }
.dialog label, .setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 8px 0; min-height: 44px; }
.dialog label input[type=text] { max-width: 64%; }
.settings-tabs { display: flex; gap: 0; margin-bottom: 12px; border-bottom: 1px solid var(--edge); }
.settings-tabs button { flex: 1; padding: 9px 6px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: var(--dim); }
.settings-tabs button[aria-selected=true] { border-bottom-color: var(--cyan); color: #d4f5fc; background: #14232e; }
.settings-page > :first-child { margin-top: 0; }
.settings-page > :last-child { margin-bottom: 0; }
.control-options { display: grid; gap: 0; }
.control-options label { margin: 0; border-bottom: 1px solid #22323f; }
.dialog .volume-setting { display: grid; grid-template-columns: 116px minmax(40px, 1fr) 36px; align-items: center; gap: 12px; margin: 4px 0; }
.volume-setting input { grid-column: 2; grid-row: 1; width: 100%; margin: 0; }
.volume-setting output { grid-column: 3; grid-row: 1; text-align: right; font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; }
.wide-button { width: 100%; }
.stack { display: grid; gap: 8px; margin-top: 12px; }
.stack button { min-height: 44px; }
.pause-modal .dialog { width: min(300px, 100%); }
.disconnected-modal .dialog { text-align: center; }
.disconnected-modal .dialog h2 { margin-right: 0; }
.disconnected-modal .dialog p { margin: 0 auto 20px; max-width: 36ch; }
.hint { font-size: 11px; }
.dropdown { position: relative; min-width: 170px; max-width: 64%; }
.dropdown-trigger { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; font-size: 12px; }
.dropdown-trigger::after { content: "⌄"; color: var(--cyan); }
.dropdown-trigger[aria-expanded=true] { border-color: var(--cyan); }
.dropdown-list { position: fixed; z-index: 12; padding: 4px; margin: 0; background: #0b1620; border: 1px solid #7196ad; border-radius: 4px; list-style: none; }
.dropdown-list [role=option] { display: flex; align-items: center; min-height: 44px; padding: 10px; cursor: pointer; white-space: nowrap; color: #dbe8f2; }
.dropdown-list [role=option]:hover, .dropdown-list [role=option]:focus { background: #1c3547; outline: 0; }
.dropdown-list [role=option]:focus-visible { background: #1c3547; }
.dropdown-list [aria-selected=true] { color: #c3f3ff; background: #142938; }
.dropdown-list [aria-selected=true]::after { content: " ✓"; margin-left: auto; padding-left: 15px; }
.flight-controls { margin: 0 0 16px; }
.flight-controls p { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 0; padding: 10px 0; border-bottom: 1px solid #22323f; text-align: right; font-size: 11px; }
.flight-controls strong { color: #e1edf5; font-weight: 500; text-align: left; }
#hud { pointer-events: none; }
.hud-left { position: absolute; top: 18px; left: max(18px, var(--safe-left)); width: 130px; display: flex; flex-direction: column; gap: 6px; }
.instrument { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: center; }
.instrument-icon { display: grid; place-items: center; width: 28px; height: 28px; color: var(--ui-shield); }
.instrument svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.health-instrument .instrument-icon { color: var(--ui-health); }
.weapon .instrument-icon { color: #ff4058; }
.weapon .fighter { fill: currentColor; stroke: none; }
.meter { height: 10px; border: 1px solid #344555; border-radius: 1px; overflow: hidden; background: #0a1721; }
.meter i { display: block; height: 100%; transition: width .12s ease-out; }
.health i { background: var(--ui-health); }
.shield i { background: var(--ui-shield); }
.health, .shield { mask-image: linear-gradient(to right, #000 calc(50% - 2px), transparent calc(50% - 2px), transparent calc(50% + 2px), #000 calc(50% + 2px)); }
.heat i { background: #fff; width: 0; transition: none; }
.weapon.overheated .instrument-icon { color: #ff555b; }
.buff-active .instrument-icon { color: #3ac7ff; }
.buff-active .shield i { background: #30baff; }
.buff-expiring { animation: shield-expiry .65s ease-in-out infinite; }
@keyframes shield-expiry { 50% { opacity: .35; } }
#power { padding-left: 38px; color: var(--cyan); font-size: 9px; }
#power:empty { display: none; }
#pause-button { position: absolute; right: max(12px, var(--safe-right)); top: 12px; width: 44px; height: 44px; padding: 0; pointer-events: auto; font-size: 24px; line-height: 1; background: #0b121be6; }
.reticle { position: absolute; left: 50%; top: 50%; width: 28px; height: 28px; transform: translate(-50%, -50%); border: 1px solid #c7f3ff70; border-radius: 50%; }
.reticle i { position: absolute; left: 12px; top: 12px; width: 2px; height: 2px; background: #dbfaff; }
.reticle.firing { border-color: #fff; }
.reticle.hit { border-color: #ffbd80; }
.reticle.shield-hit { border-color: #38bfff; }
.leaderboard-panel { position: absolute; right: max(12px, var(--safe-right)); top: 66px; width: 188px; padding: 9px 12px; background: #0b121be6; border: 1px solid #344555; border-radius: 4px; }
.leaderboard-heading { display: flex; justify-content: space-between; font-size: 8px; color: var(--dim); letter-spacing: .04em; padding-bottom: 6px; }
#leaderboard { list-style: none; padding: 0; margin: 0; font-size: 11px; color: #c3d5df; }
#leaderboard li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
#leaderboard li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#leaderboard li span:last-child { flex-shrink: 0; }
#leaderboard li.local { color: #a1faff; }
#leaderboard li.match-point { color: #ffde8a; }
#notice { position: absolute; top: 14%; left: 50%; transform: translateX(-50%); width: max-content; max-width: 70%; padding: 10px 18px; border: 1px solid #465e70; background: #0b121be6; text-align: center; white-space: pre-line; font-size: clamp(16px, 2vw, 24px); line-height: 1.5; color: #fff; }
#notice:empty { display: none; }
#touch { position: absolute; inset: 0; overflow: hidden; pointer-events: none; touch-action: none; }
.stick { position: absolute; width: 124px; height: 124px; border: 1px solid #82e4ff50; border-radius: 50%; background: #0b2b4133; pointer-events: auto; touch-action: none; }
.stick span { position: absolute; left: 33%; top: 33%; width: 34%; height: 34%; border-radius: 50%; border: 1px solid #b1eeff70; background: #3a748b40; pointer-events: none; }
.stick.engaged { border-color: #a1f6ff; }
.touch-action { position: absolute; width: 60px; height: 60px; display: flex; align-items: center; justify-content: center; border-radius: 50%; padding: 0; background: #341c17c9; border-color: #d69278; color: #ffd0a0; pointer-events: auto; touch-action: none; }
.touch-action svg { width: 70%; height: 70%; pointer-events: none; }
.touch-action.engaged { background: #6a3427; }
#touch.arranging { z-index: 7; background: #02071155; }
.arranging .stick, .arranging .touch-action { cursor: move; border-style: dashed; background: #16435788; }
.arranging .layout-selected { border-color: #b1ffff; outline: 2px solid #83ddff; outline-offset: 3px; }
#training { position: fixed; z-index: 4; top: 25%; left: max(18px, var(--safe-left)); width: min(290px, 33vw); padding: 16px; }
.training-heading { color: var(--cyan); font-size: 9px; letter-spacing: .12em; }
#training h2 { margin: 12px 0 8px; font-size: 19px; line-height: 1.25; font-weight: 500; }
#training-hint { margin: 0 0 12px; font-size: 11px; line-height: 1.5; color: var(--dim); }
.training-task { margin: 0; padding-top: 10px; border-top: 1px solid var(--edge); font-size: 11px; line-height: 1.5; }
#training.complete h2, #training.complete .training-task { color: #80ebac; }
body.training .leaderboard-panel { display: none; }
#layout-editor { position: absolute; z-index: 8; top: max(12px, var(--safe-top)); left: 50%; transform: translateX(-50%); width: min(510px, calc(100vw - 32px - var(--safe-left) - var(--safe-right))); padding: 12px 16px; }
.layout-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.layout-heading strong { font-size: 14px; font-weight: 500; }
#layout-editor button { padding: 8px 12px; font-size: 11px; }
#layout-editor p { margin: 8px 0; color: var(--dim); font-size: 11px; }
.layout-size { display: flex; align-items: center; gap: 12px; }
.layout-size label { flex-shrink: 0; font-size: 11px; width: 100px; }
.layout-size input { min-width: 40px; width: 100%; }
#error { position: absolute; bottom: max(20px, var(--safe-bottom)); left: 50%; transform: translateX(-50%); z-index: 10; background: #29151c; border: 1px solid #ba7281; border-radius: 4px; color: #ffe2e8; padding: 12px 18px; max-width: min(650px, calc(100vw - 32px)); line-height: 1.5; }
/* Transparent aperture preserves the live WebGL result fighter. */
.results-modal { background: transparent; }
.results-modal .dialog { --fighter-space: 140px; --result-pad: 12px; width: min(470px, 100%); text-align: center; background: none; border-color: transparent; padding: var(--result-pad) 24px 20px; isolation: isolate; }
.results-modal .dialog::before { content: ""; position: absolute; z-index: -1; inset: calc(var(--fighter-space) + var(--result-pad)) 0 0; border: 1px solid var(--edge); border-radius: 6px; background: var(--panel); }
#result-fighter { height: var(--fighter-space, 140px); width: 100%; pointer-events: none; }
.results-modal h2 { margin: 14px 0; font-size: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#result-leaders { list-style: none; margin: 0; padding: 0; text-align: left; }
#result-leaders li { display: grid; grid-template-columns: 24px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; margin: 0; font-size: 13px; border-bottom: 1px solid #263744; }
#result-leaders li > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#result-leaders li:first-child { color: #ecfaff; }
#result-leaders li.local { color: #9af3ff; }
.result-rank { color: var(--dim); text-align: center; font-size: 11px; }
.results-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; margin-top: 14px; }
.results-footer button { padding: 9px 12px; font-size: 11px; }
body.playing { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
[hidden] { display: none !important; }
/* Flash state comes from the gameplay frame, not a CSS clock. */
.weapon.overheated .heat i { background: #fff !important; }
.weapon.heat-flash .heat i { background: #ff3546 !important; }
.weapon.heat-flash .instrument-icon { color: #ff3546; }
@media (pointer: coarse), (max-width: 700px) {
  .hud-left { left: max(12px, var(--safe-left)); top: 12px; width: 100px; gap: 5px; }
  .instrument { grid-template-columns: 25px 1fr; gap: 7px; }
  .instrument-icon { width: 25px; height: 25px; }
  .instrument svg { width: 20px; height: 20px; }
  .meter { height: 9px; }
  #power { padding-left: 32px; font-size: 8px; }
  .leaderboard-panel { width: 138px; padding: 7px 9px; }
  .leaderboard-heading { font-size: 6px; padding-bottom: 4px; }
  #leaderboard { font-size: 9px; }
  #leaderboard li { padding: 3px 0; }
  #leaderboard li:nth-child(n + 4):not(.local) { display: none; }
  #notice { top: 25%; max-width: 65%; font-size: 17px; padding: 9px 14px; }
}
@media (max-height: 600px) {
  .home-copy { padding: 18px; width: min(340px, 100%); }
  .home-copy h1 { font-size: 25px; margin-bottom: 16px; }
  .results-modal .dialog { --fighter-space: 90px; }
}
@media (max-height: 450px) {
  #status { top: max(8px, var(--safe-top)); right: max(12px, var(--safe-right)); font-size: 9px; }
  .home-copy { width: min(330px, 100%); padding: 14px 18px; }
  .home-copy h1 { font-size: 24px; margin-bottom: 12px; }
  .player-name { margin-bottom: 8px; }
  .launch-button { min-height: 46px; }
  .dialog { padding: 14px 20px; }
  .dialog h2 { font-size: 19px; margin-bottom: 10px; }
  .settings-modal .dialog { width: min(560px, 100%); }
  .settings-tabs { margin-bottom: 8px; }
  .control-options { display: flex; gap: 16px; }
  .control-options label { flex: 1; gap: 8px; font-size: 11px; border: 0; }
  .dialog .volume-setting { margin: 4px 0; }
  .tutorial-modal .dialog { width: min(620px, 100%); }
  .flight-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; margin-bottom: 12px; }
  .flight-controls p { padding: 8px 0; gap: 10px; font-size: 10px; }
  #training { top: 68px; left: 50%; transform: translateX(-50%); width: min(290px, 43vw); padding: 12px 14px; }
  #training h2 { font-size: 16px; margin: 8px 0; }
  #training-hint { font-size: 10px; margin-bottom: 8px; }
  .training-task { font-size: 10px; padding-top: 8px; }
  #layout-editor { top: max(8px, var(--safe-top)); padding: 10px 16px; }
  .results-modal .dialog { --fighter-space: 58px; --result-pad: 6px; width: min(450px, 100%); padding: var(--result-pad) 20px 12px; }
  .results-modal h2 { font-size: 20px; margin: 9px 0; }
  #result-leaders li { padding: 7px 0; font-size: 11px; }
  .results-footer { margin-top: 10px; }
}
@media (max-height: 340px) {
  .home-copy { padding: 10px 16px; }
  .home-copy h1 { font-size: 22px; margin-bottom: 8px; }
  .results-modal .dialog { --fighter-space: 40px; }
}
@media (max-width: 380px) {
  .dialog { padding: 16px; }
  .dialog .volume-setting { grid-template-columns: 100px minmax(40px, 1fr) 32px; gap: 8px; }
  .dropdown { min-width: 150px; }
}
@media (prefers-reduced-motion: reduce) {
  button, input, .meter i { transition: none; }
  .buff-expiring { animation: none; }
}

.training-actions { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }

#online-presence { margin-top: 18px; justify-content: center; font-size: 10px; color: var(--ui-text-muted); display: flex; align-items: center; gap: 7px; }
#online-presence::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
#online-presence[data-state="live"]::before { background: var(--ui-health); box-shadow: 0 0 7px var(--ui-health); }
