:root {
  color-scheme: dark;
  --page: #0c1510;
  --surface: #132019;
  --surface-hover: #1d3023;
  --line: #2c3f30;
  --ink: #d3dfbe;
  --muted: #829276;
  --green: #b8d879;
  --lcd: #a8bb78;
  --lcd-ink: #26351b;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --game-scale: 10;
  font-family: var(--mono);
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { min-width: 280px; min-height: 100%; background: var(--page); }
body { margin: 0; min-width: 280px; min-height: 100dvh; color: var(--ink); background: radial-gradient(ellipse at 50% 28%, #15241a, var(--page) 68%); }
button, select, input { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button, select, input, canvas { outline-offset: 4px; }
:focus-visible { outline: 2px solid #e2f2b7; }
button:disabled { cursor: default; color: #5e705a; border-color: #223427; background: #101b14; }
.arcade { width: 100%; padding: 31px 28px 25px; margin: 0 auto; }
.game-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.game-identity { display: flex; gap: 13px; align-items: center; white-space: nowrap; }
.identity-mark { display: inline-block; color: var(--green); font-size: 27px; font-weight: 700; line-height: 1; }
h1 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: .055em; line-height: 1.2; }
.game-actions { display: flex; align-items: center; gap: 6px; }
.action-button { min-height: 44px; padding: 0 13px; border: 1px solid var(--line); border-radius: 3px; background: var(--surface); color: #acbc9d; font-size: 10px; white-space: nowrap; }
.action-button:hover:not(:disabled) { background: var(--surface-hover); border-color: #5e7750; color: #e1ebd3; }
.action-primary { background: var(--green); color: #1a2c13; border-color: var(--green); padding-inline: 19px; font-weight: 700; }
.action-primary:hover:not(:disabled) { background: #d0e69f; color: #1a2c13; border-color: #d0e69f; }
.game-shell { width: 100%; min-width: 0; margin: 0 auto; }
.flight-hud { display: grid; grid-template-columns: 1fr auto auto; gap: 43px; width: min(calc(84px * var(--game-scale)), 100%); margin: 0 auto 12px; align-items: end; }
.flight-hud > div { display: flex; align-items: baseline; gap: 13px; font-size: 12px; font-variant-numeric: tabular-nums; }
.flight-hud .hud-score, .flight-hud .hud-best { justify-content: flex-end; }
.hud-label { font-size: 9px; letter-spacing: .08em; color: var(--muted); }
#stage-label { font-size: 10px; }
#score-label, #best-label { min-width: 40px; text-align: right; }
.screen-wrap { width: 100%; display: flex; justify-content: center; align-items: center; overflow: hidden; }
#game { display: block; flex-shrink: 0; width: calc(84px * var(--game-scale)); height: calc(48px * var(--game-scale)); background: var(--lcd); image-rendering: crisp-edges; image-rendering: pixelated; touch-action: none; }
#game:focus-visible { outline: 2px solid #d3ee9d; outline-offset: -2px; }
.flight-bar { width: min(calc(84px * var(--game-scale)), 100%); display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 12px auto 0; min-height: 37px; }
.status-message { margin: 0; min-height: 15px; font-size: 10px; line-height: 1.6; color: #8caa75; }
.flight-options { display: flex; gap: 21px; align-items: center; flex-shrink: 0; }
.mode-option { display: flex; align-items: center; gap: 8px; }
.option-label { font-size: 8px; letter-spacing: .08em; color: #667e5f; }
#mode-select { min-height: 36px; border: 1px solid var(--line); border-radius: 3px; background: var(--surface); color: #bbccaa; padding: 0 23px 0 9px; font-size: 10px; }
.assist-option { display: flex; align-items: center; gap: 7px; font-size: 9px; white-space: nowrap; color: #91a383; cursor: pointer; min-height: 36px; }
.assist-option input { appearance: none; width: 13px; height: 13px; margin: 0; border: 1px solid #557348; border-radius: 2px; background: #142219; cursor: pointer; }
.assist-option input:checked { background: var(--green); border-color: var(--green); box-shadow: inset 0 0 0 3px #142219; }
.player-controls { width: min(calc(84px * var(--game-scale)), 100%); display: flex; align-items: center; justify-content: space-between; gap: 25px; margin: 19px auto 0; padding-top: 20px; border-top: 1px solid #223427; }
.direction-pad { display: grid; grid-template-columns: repeat(3, 46px); grid-template-rows: repeat(3, 44px); gap: 4px; }
.control-key { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 44px; padding: 0; border: 1px solid #405539; border-radius: 4px; background: #17261b; color: #afc599; box-shadow: 0 2px 0 #080f0a; touch-action: none; user-select: none; -webkit-user-select: none; }
.control-key:hover { background: #223725; color: #d9ebc5; border-color: #7b9b60; }
.control-key:active, .control-key.is-pressed { background: #3b5630; color: #e2f2cc; transform: translateY(1px); box-shadow: none; }
.direction-pad .control-key { min-height: 0; font-size: 19px; }
.direction-up { grid-column: 2; grid-row: 1; }
.direction-left { grid-column: 1; grid-row: 2; }
.direction-right { grid-column: 3; grid-row: 2; }
.direction-down { grid-column: 2; grid-row: 3; }
.direction-center { grid-column: 2; grid-row: 2; align-self: center; justify-self: center; width: 5px; height: 5px; background: #4b6440; }
.keyboard-guide { display: flex; flex-direction: column; gap: 10px; }
.keyboard-guide p { display: flex; align-items: center; gap: 4px; margin: 0; font-size: 9px; color: #6d8364; }
.keyboard-guide p span { margin: 0 8px 0 5px; }
.keyboard-guide p span:last-child { margin-right: 0; }
kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 19px; min-height: 20px; padding: 1px 4px; border: 1px solid #30472e; border-bottom-width: 2px; border-radius: 2px; color: #819b70; background: #142117; font: 9px var(--mono); }
.weapon-controls { display: flex; gap: 12px; align-items: center; }
.weapon-controls .control-key { width: 80px; height: 80px; gap: 9px; font-size: 8px; letter-spacing: .1em; }
.control-symbol { font-size: 22px; line-height: 1; }
.weapon-controls .fire-key { width: 92px; height: 92px; color: #c7e89b; border-color: #64894a; background: #263d21; }
.weapon-controls .fire-key:active, .weapon-controls .fire-key.is-pressed { background: #4c6e37; }
.arcade:fullscreen { width: 100vw; height: 100dvh; min-height: 0; background: var(--page); }
.arcade:fullscreen .screen-wrap { min-height: 0; }
dialog { width: min(450px, calc(100vw - 32px)); padding: 24px 28px 27px; border: 1px solid #415a37; border-radius: 5px; background: #122017; color: var(--ink); box-shadow: 0 24px 80px #0008; }
dialog::backdrop { background: #050c08c9; }
.dialog-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
dialog h2 { font-size: 18px; font-weight: 500; letter-spacing: -.025em; margin: 0; }
.dialog-close { width: 44px; height: 44px; padding: 0; border: 0; background: transparent; color: #b2c79e; font-size: 28px; }
dialog p { font-size: 11px; line-height: 1.8; color: #90a77f; }
.help-controls { font: 10px/1.6 var(--mono); margin: 19px 0; padding: 13px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.help-controls > div { display: flex; justify-content: space-between; gap: 20px; margin: 7px 0; }
.help-controls dt { color: #7c9570; }
.help-controls dd { margin: 0; text-align: right; }
.help-note { margin: 20px 0 0; padding-top: 15px; border-top: 1px solid var(--line); font-size: 9px; }
@media (max-width: 880px) { :root { --game-scale: 8; } .arcade { padding-inline: 20px; } .game-header { align-items: flex-start; } .game-identity { padding-top: 13px; gap: 10px; } h1 { font-size: 16px; } .game-actions { gap: 5px; } .action-button { padding-inline: 10px; font-size: 9px; } .game-actions .action-primary { padding-inline: 15px; } }
@media (max-width: 720px) { :root { --game-scale: 6; } .arcade { padding-top: 21px; } .game-header { flex-direction: column; gap: 18px; margin-bottom: 24px; } .game-identity { padding-top: 0; } h1 { font-size: 19px; } .game-actions { width: 100%; justify-content: center; } .action-button { flex: 1; padding-inline: 8px; } .flight-hud { gap: 20px; } .flight-hud > div { gap: 8px; } .flight-bar { flex-wrap: wrap; gap: 10px; } .status-message { flex-basis: 100%; } .flight-options { width: 100%; justify-content: space-between; gap: 15px; } .player-controls { gap: 15px; padding-top: 17px; margin-top: 15px; } .keyboard-guide { display: none; } }
@media (max-width: 560px) { :root { --game-scale: 5; } .arcade { padding-inline: 16px; } .flight-hud { gap: 16px; } .flight-hud > div { flex-direction: column; align-items: flex-start; gap: 5px; font-size: 12px; } .flight-hud .hud-score, .flight-hud .hud-best { align-items: flex-end; } .hud-label { font-size: 8px; } #stage-label { font-size: 9px; } }
@media (max-width: 460px) { :root { --game-scale: 4; } .arcade { padding: 20px 12px 24px; } .game-header { gap: 19px; margin-bottom: 21px; } .game-actions { gap: 4px; } .action-button { min-height: 44px; font-size: 8px; padding-inline: 6px; } .game-actions .action-primary { padding-inline: 10px; } .flight-hud { margin-bottom: 11px; gap: 16px; } .flight-bar { margin-top: 11px; } .status-message { font-size: 9px; } .player-controls { gap: 15px; padding-top: 16px; } .direction-pad { grid-template-columns: repeat(3, 44px); grid-template-rows: repeat(3, 44px); gap: 3px; } .weapon-controls { gap: 9px; } .weapon-controls .control-key { width: 65px; height: 70px; font-size: 7px; gap: 8px; } .weapon-controls .fire-key { width: 73px; height: 80px; } .control-symbol { font-size: 19px; } .game-shell:fullscreen { padding: 10px; } }
@media (max-width: 355px) { :root { --game-scale: 3; } .arcade { padding-inline: 10px; } .game-actions { flex-wrap: wrap; } .game-actions .action-button { flex: 1 1 16%; padding-inline: 4px; } h1 { font-size: 17px; } .game-header { margin-bottom: 19px; } .flight-hud { gap: 12px; } #stage-label { max-width: 90px; line-height: 1.5; } .player-controls { gap: 10px; } .direction-pad { grid-template-columns: repeat(3, 44px); grid-template-rows: repeat(3, 44px); } .weapon-controls { gap: 6px; flex-direction: column; } .weapon-controls .control-key, .weapon-controls .fire-key { width: 73px; height: 53px; gap: 3px; } .control-symbol { font-size: 17px; } .option-label { display: none; } .flight-options { gap: 8px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; } }
@media (hover: hover) and (pointer: fine) {
  .direction-pad, .weapon-controls { display: none; }
  .player-controls { justify-content: center; padding-top: 16px; margin-top: 15px; }
  .keyboard-guide { display: flex; flex-direction: row; justify-content: center; flex-wrap: wrap; gap: 12px 26px; }
  .keyboard-guide p { font-size: 11px; color: #a8bf95; }
  .keyboard-guide kbd { font-size: 11px; min-height: 26px; min-width: 25px; color: #c5dfa9; }
}
/* On a PC, reserve the viewport for play and fit the HUD around the screen. */
@media (min-width: 721px) and (hover: hover) and (pointer: fine) {
  html, body { height: 100%; overflow: hidden; }
  .arcade { height: 100dvh; min-height: 0; display: grid; grid-template-rows: 44px minmax(0, 1fr); gap: 8px; padding: 10px 16px; }
  .game-header { min-height: 0; margin: 0; align-items: center; gap: 16px; }
  .game-identity { padding: 0; }
  h1 { font-size: 16px; }
  .game-shell { min-height: 0; display: grid; grid-template-rows: 24px minmax(0, 1fr) 36px 24px; row-gap: 6px; }
  .flight-hud { height: 24px; min-height: 0; margin: 0 auto; align-items: center; }
  .screen-wrap { height: 100%; min-height: 0; }
  .flight-bar { min-height: 0; height: 36px; margin: 0 auto; gap: 16px; flex-wrap: nowrap; }
  .status-message { min-width: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .flight-options { width: auto; gap: 16px; }
  .player-controls { min-height: 0; height: 24px; margin: 0 auto; padding: 0; border: 0; }
  .keyboard-guide { flex-wrap: nowrap; gap: 22px; }
  .keyboard-guide p { font-size: 10px; }
  .keyboard-guide kbd { min-height: 21px; min-width: 22px; font-size: 10px; }
  .arcade:fullscreen { padding: 10px 16px; }
}
/* Pilot accounts and public rankings. Game controls remain outside the dialogs. */
.account-action[data-signed-in="true"] { color: var(--green); border-color: #729557; }
.account-dialog, .rankings-dialog { width: min(500px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); padding: 22px 26px 25px; overflow: auto; }
.account-dialog [hidden], .rankings-dialog [hidden], .account-notice[hidden] { display: none !important; }
.account-dialog .dialog-top, .rankings-dialog .dialog-top { margin-bottom: 8px; }
.account-dialog h2, .rankings-dialog h2 { font-size: 20px; line-height: 1.3; }
.account-dialog p, .rankings-dialog p { font-size: 13px; line-height: 1.6; }
.account-dialog .account-intro { margin: 4px 0 20px; color: #afc59b; }
.account-intro strong { color: #dcebc9; overflow-wrap: anywhere; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; margin: 0 0 22px; gap: 4px; border-bottom: 1px solid var(--line); }
.auth-tab { min-height: 44px; padding: 10px 8px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #92a87f; font-size: 14px; }
.auth-tab[aria-selected="true"] { border-color: var(--green); color: #d8edb6; }
.account-form { display: grid; gap: 17px; margin: 0; }
.form-field { display: grid; gap: 7px; }
.form-field label { font-size: 14px; color: #ccdfb8; line-height: 1.4; }
.optional-label { font-size: 12px; font-weight: 400; color: #8ca27b; margin-left: 4px; }
.form-field input { width: 100%; min-width: 0; min-height: 46px; padding: 10px 12px; border: 1px solid #506a42; border-radius: 3px; background: #0b170f; color: #e1eed2; font-size: 16px; line-height: 1.4; }
.form-field input::placeholder { color: #829775; opacity: 1; }
.form-field input:focus-visible { border-color: #b8d879; outline-color: #b8d879; }
.field-hint { font-size: 12px; line-height: 1.5; color: #9ab388; }
.account-dialog .form-message { min-height: 20px; margin: -3px 0 -6px; color: #e9b79e; font-size: 13px; }
.account-dialog .form-message[data-kind="success"] { color: #badc8e; }
.form-submit, .account-signout, .rankings-refresh, .rankings-signin { min-height: 44px; padding: 10px 14px; border: 1px solid #698b4f; border-radius: 3px; background: #b8d879; color: #172710; font-size: 14px; line-height: 1.4; font-weight: 600; }
.form-submit:hover:not(:disabled), .rankings-signin:hover:not(:disabled) { background: #d0e69f; }
.form-submit:disabled, .account-signout:disabled, .rankings-refresh:disabled { cursor: wait; }
.password-details { margin-top: 25px; border-top: 1px solid var(--line); padding-top: 9px; }
.password-details summary { display: list-item; min-height: 44px; padding: 12px 0; cursor: pointer; font-size: 14px; color: #bfd5a8; }
.password-details[open] summary { margin-bottom: 10px; }
.account-signout { display: block; width: 100%; margin-top: 22px; background: #14251a; color: #bed1ab; border-color: #45613a; font-weight: 400; }
.account-signout:hover:not(:disabled) { background: #203724; }
.account-dialog .account-service-note { margin: 16px 0 0; color: #e9b79e; }
.account-dialog .account-service-note:empty { display: none; }
.rankings-dialog { width: min(620px, calc(100vw - 28px)); }
.rankings-tools { display: flex; gap: 15px; align-items: end; justify-content: space-between; margin-top: 10px; }
.rankings-tools label { display: grid; gap: 7px; font-size: 13px; color: #a8be94; }
#rankings-mode { min-height: 44px; min-width: 150px; padding: 9px 28px 9px 11px; border: 1px solid #506a42; border-radius: 3px; background: #0b170f; color: #e1eed2; font-size: 16px; }
.rankings-refresh { background: #14251a; color: #bed1ab; border-color: #45613a; font-weight: 400; }
.rankings-dialog .rankings-caption { margin: 20px 0 12px; color: #a0b58d; }
.rankings-dialog .rankings-message { min-height: 21px; margin: 12px 0; color: #bed79f; }
.rankings-message[data-kind="error"] { color: #e9b79e; }
.rankings-message:empty { display: none; }
.rankings-table-wrap { max-height: min(47dvh, 480px); overflow: auto; border: 1px solid #354d2e; }
.rankings-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13px; font-variant-numeric: tabular-nums; }
.rankings-table th, .rankings-table td { padding: 12px 10px; text-align: left; vertical-align: top; line-height: 1.45; }
.rankings-table thead th { position: sticky; top: 0; z-index: 1; background: #1b2e1d; color: #a8bf94; font-weight: 400; font-size: 11px; }
.rankings-table th:first-child { width: 52px; }
.rankings-table th:nth-child(3) { width: 105px; }
.rankings-table th:last-child { width: 56px; }
.rankings-table th:nth-child(n+3), .rankings-table td:nth-child(n+3) { text-align: right; }
.rankings-table tbody tr + tr { border-top: 1px solid #233a25; }
.rankings-table tbody tr.is-you { background: #213c20; }
.rankings-table .rank-pilot { overflow-wrap: anywhere; color: #d2e3bd; }
.rank-you { display: inline-block; margin-left: 7px; color: #b8d879; font-size: 10px; }
.rankings-dialog .rankings-personal { margin: 18px 0 0; color: #afca97; }
.rankings-signin { width: 100%; margin-top: 18px; }
.account-notice { position: fixed; right: 18px; top: 64px; z-index: 30; max-width: min(390px, calc(100vw - 36px)); margin: 0; padding: 13px 17px; border: 1px solid #5d7d46; border-radius: 3px; background: #15291a; color: #d3e9ba; font: 13px/1.5 var(--mono); box-shadow: 0 8px 28px #0005; }
@media (min-width: 721px) and (max-width: 1100px) {
  .game-actions { gap: 4px; min-width: 0; }
  .game-actions .action-button { padding-inline: 7px; font-size: 9px; }
  .game-actions .action-primary { padding-inline: 11px; }
  .game-identity { gap: 7px; }
  .identity-mark { font-size: 23px; }
  h1 { font-size: 14px; }
}
@media (max-width: 720px) {
  .game-actions { flex-wrap: wrap; }
  .game-actions .action-button { flex: 1 1 calc(25% - 6px); }
}
@media (max-width: 460px) {
  .account-dialog, .rankings-dialog { padding: 15px 17px 20px; }
  .account-dialog h2, .rankings-dialog h2 { font-size: 18px; }
  .rankings-table { font-size: 12px; }
  .rankings-table th, .rankings-table td { padding: 11px 7px; }
  .rankings-table th:first-child { width: 44px; }
  .rankings-table th:nth-child(3) { width: 81px; }
  .rankings-table th:last-child { width: 47px; }
  .account-notice { top: auto; bottom: 12px; right: 12px; left: 12px; max-width: none; }
}
