:root {
  --paper: #f5f3ed;
  --ink: #243b31;
  --muted: #737d6f;
  --red: #e34e3c;
  --border: #d9dfd0;
  --mono: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); font-family: var(--sans); color-scheme: light; }
body { margin: 0; -webkit-text-size-adjust: 100%; background: radial-gradient(ellipse at 50% 0, #fffdf6 0, transparent 65%); }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, canvas:focus-visible { outline: 3px solid #f07443; outline-offset: 3px; }
button:disabled { opacity: .32; cursor: default; }
button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
.app-shell { max-width: 1456px; margin: auto; padding: 0 40px; }
.site-header { height: 64px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 21px; letter-spacing: -1px; font-weight: 800; }
.brand-mark { width: 32px; height: 32px; display: grid; place-items: center; background: var(--red); color: #fff; border: 1px solid #cc3d2d; box-shadow: inset 0 1px 0 #ffbaa4; border-radius: 10px; font-size: 30px; font-weight: 400; line-height: 1; }
.brand-light { font-weight: 400; margin-left: 3px; }
.brand-period { color: var(--red); }
.header-note, .version, .eyebrow, .location, .panel-tag, .launch-hint, .hud-label, .hud-best, .telemetry, .gas-status, .world-caption, .game-bottom, .manual-number, footer, .mode-picker, .about-links, .new-record { font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: 1px; }
.header-note { display: flex; gap: 9px; align-items: center; color: var(--muted); font-size: 9px; }
.live-dot { display: inline-block; width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: #709379; box-shadow: 0 0 0 3px #71987a14; }
.version { display: flex; align-items: center; gap: 9px; color: #859080; font-size: 8px; }
.version-index { display: grid; place-items: center; width: 25px; height: 25px; color: #58725e; border: 1px solid #d5ddcc; border-radius: 50%; font-size: 9px; letter-spacing: 0; }
.intro { display: flex; align-items: center; justify-content: space-between; min-height: 90px; padding: 16px 0; gap: 28px; }
.eyebrow { font-size: 8px; letter-spacing: 1.4px; margin: 0 0 7px; color: var(--muted); }
h1 { font-size: clamp(29px, 2.6vw, 38px); line-height: 1.08; font-weight: 550; letter-spacing: -1.7px; margin: 0; }
h1 span { color: #88917f; }
.intro-copy { color: var(--muted); line-height: 1.5; font-size: 12px; margin: 0; }

/* The viewport owns the stage size. State changes never move the playing field. */
.game-wrap { border: 1px solid #d0d6c7; border-radius: 20px; overflow: hidden; background: #e4e8dc; box-shadow: 0 20px 60px -22px #233c3440, 0 2px 5px #233c340a; }
.game-toolbar { height: 52px; padding: 0 12px 0 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #263c32; border-bottom: 1px solid #182f25; touch-action: manipulation; }
.location { min-width: 0; font-size: 9px; display: flex; align-items: center; gap: 9px; color: #e3ebd8; letter-spacing: .7px; white-space: nowrap; }
.location .live-dot { background: #c1dd9c; box-shadow: 0 0 0 4px #bddc9c12; }
.location-separator { color: #688273; margin: 0 2px; }
#flight-status { color: #a2b5a2; }
.toolbar-controls { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.icon-button { border: 1px solid transparent; background: transparent; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; color: #bbccb3; }
.icon-button[aria-pressed='true'] { color: #ecf4df; background: #405b47; border-color: #577058; }
.game-stage { --speech-space: 0px; position: relative; height: clamp(360px, calc(100svh - 280px), 650px); overflow: hidden; background: #ebccad; isolation: isolate; touch-action: none; }
.flight-viewport { position: absolute; inset: var(--speech-space) 0 0; overflow: hidden; }
.speech-bay { display: none; }
canvas { display: block; width: 100%; height: 100%; touch-action: none; outline: none; }
#game { position: absolute; inset: 0; width: 100%; height: 100%; }
.game-hud { position: absolute; inset: 20px 22px auto; pointer-events: none; display: flex; align-items: flex-start; justify-content: space-between; color: #2d4838; gap: 12px; }
.hud-left { display: grid; grid-template-columns: auto auto; align-items: center; gap: 0 11px; min-width: 88px; padding: 9px 12px; background: #fffdf0e8; border: 1px solid #fffff3e6; border-radius: 13px; box-shadow: 0 3px 12px #3149300c; }
.hud-left > .hud-label { grid-column: 2; grid-row: 1; align-self: end; }
.hud-left > strong { grid-column: 1; grid-row: 1 / span 2; }
.hud-left > .hud-best { grid-column: 2; grid-row: 2; align-self: start; }
.hud-label { font-size: 8px; letter-spacing: 1.1px; color: #6a7e67; }
.hud-left strong { font-size: 37px; font-variant-numeric: tabular-nums; font-weight: 550; letter-spacing: -2px; line-height: 1.12; }
.hud-best { font-size: 8px; margin-top: 5px; color: #78866c; letter-spacing: .4px; }
.hud-best b { font-weight: 700; margin-left: 4px; color: #52664d; }
.hud-right { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; padding: 10px 12px; border: 1px solid #fffff3c2; background: #fffdf0d9; border-radius: 12px; }
.telemetry { font-size: 10px; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 11px; letter-spacing: .5px; }
.telemetry-divider { height: 10px; width: 1px; background: #76867555; }
.gas-status { font-size: 7px; letter-spacing: .6px; color: #7b8b6d; display: flex; gap: 5px; align-items: center; }
.gas-status i { width: 4px; height: 4px; background: #5d8666; border-radius: 50%; }

/* Controls and overlays use the same card treatment across input types. */
.overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 3; pointer-events: none; }
.launch-panel { position: relative; margin-left: 34%; pointer-events: auto; width: 365px; max-width: calc(100% - 32px); padding: 27px; text-align: left; background: #fffcf1f5; border: 1px solid #fffff7; border-radius: 22px; box-shadow: 0 18px 44px -12px #2f48394a, 0 2px 0 #fff9 inset; }
.launch-panel::before { content: ''; position: absolute; top: -1px; left: 27px; width: 44px; height: 3px; background: var(--red); border-radius: 0 0 2px 2px; }
.panel-tag { display: flex; align-items: center; gap: 7px; color: #728365; font-size: 8px; line-height: 1.4; letter-spacing: 1px; margin: 0; }
.panel-tag > span { width: 5px; height: 5px; border-radius: 50%; background: #78946e; }
h2 { font-size: 36px; letter-spacing: -1.7px; line-height: 1.08; font-weight: 600; margin: 18px 0 12px; }
h2 em { font-style: normal; color: #7d8d70; }
.launch-panel > p:not(.panel-tag), .result-panel > p:not(.panel-tag):not(.new-record) { font-size: 13px; line-height: 1.5; color: #6d7c63; }
.mode-picker { display: flex; gap: 4px; background: #e8ecde; padding: 4px; border: 1px solid #dce2cf; border-radius: 12px; margin: 20px 0 12px; font-size: 11px; letter-spacing: .1px; }
.mode-picker button { min-height: 44px; background: transparent; border: 1px solid transparent; border-radius: 7px; flex: 1; padding: 8px 6px; font: inherit; white-space: nowrap; color: #74816a; }
.mode-picker button.selected { background: #fffdf4; border-color: #e1e4d6; box-shadow: 0 2px 5px #33482b0b; color: #304d34; font-weight: 650; }
.mode-picker span { color: #da4a38; }
.mode-picker .mode-detail { display: block; margin-top: 5px; font-size: 6px; line-height: 1; font-weight: 500; letter-spacing: .4px; color: #829275; }
.mode-picker .selected .mode-detail { color: #76886b; }
.primary-button { border: 1px solid #ce412f; display: flex; align-items: center; justify-content: space-between; min-height: 52px; background: var(--red); box-shadow: inset 0 1px 0 #ffb38b80, 0 4px 0 #bd302818, 0 5px 12px #ca3b3515; color: #fffdf4; font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: 1.3px; padding: 15px 18px; width: 100%; border-radius: 11px; transition: background .15s, box-shadow .15s; }
.primary-button span { font-size: 25px; line-height: .6; font-weight: 400; }
.primary-button:active { background: #c82e29; box-shadow: 0 1px 0 #bd302824; }
.launch-hint { display: block; text-align: center; font-size: 7px; letter-spacing: .9px; color: #8d987f; margin-top: 15px; }
.scrim { background: #ecf0e3c9; pointer-events: auto; }
.result-panel { text-align: center; width: 380px; max-width: calc(100% - 32px); padding: 26px; background: #fffbf0f5; border: 1px solid #fffff8; border-radius: 20px; box-shadow: 0 16px 50px #314a2824; }
.result-panel .panel-tag { justify-content: center; color: #76826a; }
.result-panel h2 { font-size: 36px; margin: 14px 0 10px; }
.result-panel h2 em { color: #7a8b6c; }
.results { display: flex; justify-content: space-around; gap: 7px; margin: 20px 0; padding: 0; }
.results > div { display: flex; flex: 1; flex-direction: column; align-items: center; gap: 6px; padding: 13px 4px; border: 1px solid #e1e6d5; background: #edf1e5; border-radius: 11px; }
.results span { font-family: var(--mono); font-size: 8px; letter-spacing: .6px; color: #819071; }
.results strong { font-size: 32px; font-variant-numeric: tabular-nums; font-weight: 550; letter-spacing: -1px; }
.text-button { border: 0; background: none; min-height: 44px; font-family: var(--mono); font-size: 10px; letter-spacing: .2px; color: #708061; padding: 12px; text-decoration: underline; text-underline-offset: 4px; }
.new-record { font-size: 8px; color: #b94a35; background: #f9e6d8; border: 1px solid #f0cdb9; border-radius: 7px; padding: 8px; margin: 0 0 15px; line-height: 1.5; }
.world-caption { position: absolute; bottom: 13px; left: 22px; right: 22px; display: flex; justify-content: space-between; color: #e3dfc7; font-size: 7px; letter-spacing: .8px; pointer-events: none; }
.toast { position: absolute; z-index: 2; top: 22%; left: 50%; transform: translate(-50%, -8px); color: #fffbed; background: #304b3eeb; box-shadow: 0 3px 12px #2233; border: 1px solid #fff2; padding: 11px 17px; border-radius: 30px; font-family: var(--mono); font-size: 11px; letter-spacing: .3px; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; width: max-content; max-width: calc(100% - 32px); text-align: center; line-height: 1.4; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.flight-cue { position: absolute; bottom: 10%; left: 50%; transform: translateX(-50%); z-index: 1; display: flex; align-items: center; gap: 10px; padding: 11px 15px; color: #f9f7e9; background: #2d493ee0; border: 1px solid #ffffff36; border-radius: 13px; pointer-events: none; white-space: nowrap; }
.flight-cue > span:last-child { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: #d1ddca; }
.flight-cue strong { font: 600 9px var(--mono); letter-spacing: 1px; color: #fffbed; }
.cue-mark { font-size: 25px; line-height: 1; }
body:not([data-game-state='playing']) .flight-cue { display: none; }
.game-bottom { height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 20px; font-size: 8px; letter-spacing: .6px; color: #738368; background: #f5f7ec; border-top: 1px solid #d4ddc8; }
.game-bottom > span, .control-legend .desktop-input { display: flex; align-items: center; gap: 7px; }
.keycap { display: inline-block; border: 1px solid #d3dcc8; border-bottom-width: 2px; padding: 4px 5px; border-radius: 4px; font-size: 8px; background: #fffef4; color: #6a7c5f; line-height: 1; }
.or { color: #9da88f; font-family: var(--sans); text-transform: lowercase; }
.tap-icon { font-size: 17px; color: #6a865e; }
.bottom-note { font-size: 8px; color: #94a085; }
.bottom-note > span { width: 5px; height: 5px; border-radius: 50%; background: #94ab7c; }
.bottom-divider { height: 12px; width: 1px; background: #d3dcc9; margin: 0 5px; }
.touch-input { display: none !important; }

/* Native text pauses at whole pixels; the leader moves without moving the words. */
.speech-balloon { position: absolute; z-index: 2; display: flex; align-items: flex-start; width: 400px; max-width: calc(100% - 28px); gap: 11px; padding: 14px 16px; background: #fffbef; border: 1px solid #ffffff; border-radius: 16px; box-shadow: 0 7px 24px #243e3225; pointer-events: none; user-select: none; transform: none !important; transition: none !important; animation: none !important; contain: layout style; }
.radio-avatar { position: relative; flex: 0 0 42px; width: 42px; height: 42px; margin-top: 1px; background: #dce6d6; border: 1px solid #c2d1b9; border-radius: 50%; box-shadow: 0 2px 5px #354a3010; }
.radio-avatar canvas { width: 100%; height: 100%; border-radius: 50%; overflow: hidden; }
.radio-live, .radio-context { display: none; }
.radio-copy { flex: 1; min-width: 0; }
.radio-heading { display: flex; gap: 8px; align-items: center; font: 600 9px var(--mono); letter-spacing: .9px; color: #6b7a61; }
.parody-tag { font-size: 6px; letter-spacing: .6px; padding: 2px 4px; border: 1px solid #d9decd; border-radius: 3px; color: #9ca38c; }
.speech-page { margin-left: auto; padding-right: 22px; font-size: 8px; font-variant-numeric: tabular-nums; color: #738566; }
.radio-copy p { color: #23392c; font-size: 17px; font-weight: 500; line-height: 1.4; margin: 5px 0 0; letter-spacing: -.2px; transform: none !important; animation: none !important; transition: none !important; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
.wisdom-button { position: absolute; top: 0; right: 0; width: 44px; height: 44px; padding: 0; border: 0; background: transparent; font-size: 0; pointer-events: auto; color: #7a8b6a; border-radius: 0 15px 0 10px; }
.wisdom-button span { font-size: 18px; }
.speech-leader { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; overflow: hidden; pointer-events: none; }

.flight-manual { padding: 24px 0; }
.manual-heading { display: flex; align-items: center; gap: 16px; }
.manual-heading .eyebrow { font-size: 8px; white-space: nowrap; margin: 0; color: #8b967e; letter-spacing: 1px; }
.manual-line { height: 1px; flex: 1; background: #dce2d3; }
.manual-items { display: grid; grid-template-columns: repeat(3, 1fr); gap: 25px; margin-top: 18px; }
.manual-item { display: flex; gap: 12px; }
.manual-number { font-size: 10px; color: #a6b297; padding-top: 3px; }
.manual-item h3 { font-size: 12px; font-weight: 650; margin: 0 0 5px; letter-spacing: -.2px; }
.manual-item p { color: #839175; font-size: 11px; line-height: 1.5; margin: 0; max-width: 300px; }
footer { border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 64px; padding: 10px 0; font-size: 7px; letter-spacing: .7px; color: #8b987d; }
footer button { background: transparent; border: 0; min-height: 44px; padding: 8px; font: inherit; color: #718361; }
.footer-heart { color: #d96c56; margin: 0 4px; }
.creator-credit { display: inline-flex; align-items: center; min-height: 44px; font-family: var(--sans); font-size: 12px; letter-spacing: 0; color: #718361; gap: 4px; }
.creator-credit strong { color: #395636; font-weight: 650; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: #b3c0a5; }
.creator-credit > span { color: #cc5144; font-size: 19px; margin-left: 4px; }
dialog { border: 1px solid #d9dfce; background: var(--paper); color: var(--ink); width: 510px; max-width: calc(100% - 28px); max-height: calc(100svh - 32px); padding: 32px; border-radius: 20px; box-shadow: 0 30px 140px #19281760; }
dialog::backdrop { background: #1b2e2880; }
dialog h2 { font-size: 40px; margin: 15px 0 20px; }
dialog p { font-size: 13px; line-height: 1.7; color: #738367; }
.dialog-close { position: absolute; right: 8px; top: 8px; width: 44px; height: 44px; border: 0; background: none; border-radius: 10px; font-size: 27px; color: #7f8e72; }
.about-links { display: flex; gap: 18px; margin: 20px 0; font-size: 8px; color: #ae5141; }
.about-links a { display: flex; align-items: center; min-height: 44px; }
.small { font-size: 10px !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (hover: hover) {
  .icon-button:hover:not(:disabled) { background: #3c5844; border-color: #567058; color: #f2f5e8; }
  .primary-button:hover { background: #d53f2f; }
  .mode-picker button:hover:not(.selected) { background: #f3f5e9; color: #476342; }
  .wisdom-button:hover { background: #e9eede; color: #395e39; }
  .creator-credit:hover strong { color: #ce4037; text-decoration-color: #ce4037; }
}
@media (max-width: 1000px) {
  .app-shell { padding: 0 22px; }
  .header-note { font-size: 8px; }
  .intro-copy { font-size: 11px; }
  .launch-panel { margin-left: 32%; width: 330px; padding: 23px; }
  .launch-panel h2 { font-size: 33px; }
  .bottom-note { display: none !important; }
  .manual-items { gap: 18px; }
  footer > span:first-child { max-width: 250px; line-height: 1.6; }
}
@media (max-width: 650px) {
  .app-shell { padding: 0 max(10px, env(safe-area-inset-right)) 0 max(10px, env(safe-area-inset-left)); }
  .site-header { height: 54px; gap: 10px; }
  .brand { font-size: 19px; gap: 8px; }
  .brand-mark { width: 29px; height: 29px; font-size: 27px; border-radius: 8px; }
  .header-note { display: none; }
  .version { font-size: 7px; letter-spacing: .8px; }
  .intro { min-height: 61px; padding: 13px 2px; }
  .intro .eyebrow, .intro-copy { display: none; }
  h1 { font-size: 28px; letter-spacing: -1.2px; }
  .game-wrap { border-radius: 15px; }
  .game-toolbar { padding: 0 5px 0 12px; height: 50px; gap: 4px; }
  .location { font-size: 8px; gap: 6px; letter-spacing: .3px; }
  .location-separator, #flight-status { display: none; }
  .toolbar-controls { gap: 0; }
  .game-stage { height: clamp(320px, calc(100svh - 220px), 720px); }
  .game-hud { inset: 13px 12px auto; gap: 8px; }
  .hud-left { min-width: 68px; padding: 8px 10px 9px; border-radius: 10px; }
  .hud-label { font-size: 7px; letter-spacing: .7px; }
  .hud-left strong { font-size: 32px; letter-spacing: -1.3px; }
  .hud-best { font-size: 7px; margin-top: 4px; }
  .hud-right { gap: 7px; padding: 9px 10px; border-radius: 10px; }
  .hud-right .hud-label { font-size: 6px; }
  .telemetry { font-size: 9px; gap: 8px; }
  .gas-status { display: none; }
  body[data-game-state='ready'] .hud-right { visibility: hidden; }
  .ready-overlay { align-items: flex-end; }
  .launch-panel { margin: 0 0 40px; padding: 22px; width: 330px; max-width: calc(100% - 32px); border-radius: 17px; }
  .launch-panel h2 { font-size: 33px; margin: 13px 0 10px; }
  .launch-panel > p:not(.panel-tag) { font-size: 13px; margin: 10px 0 0; }
  .panel-tag { font-size: 7px; letter-spacing: .8px; }
  .mode-picker { margin: 16px 0 11px; }
  .launch-hint { font-size: 7px; margin-top: 13px; }
  .world-caption { bottom: 12px; left: 14px; right: 14px; font-size: 6px; }
  .world-caption > span:last-child { display: none; }
  .result-panel { padding: 23px; border-radius: 17px; }
  .result-panel h2 { font-size: 32px; }
  .results { margin: 17px 0; padding: 13px 0; }
  .results span { font-size: 7px; }
  .results strong { font-size: 30px; }
  .game-bottom { padding: 0 12px; height: 36px; font-size: 7px; letter-spacing: .2px; gap: 7px; }
  .game-bottom > span { gap: 5px; }
  .secondary-legend { display: none !important; }
  .speech-balloon { width: 340px; gap: 9px; padding: 12px; border-radius: 13px; }
  .radio-avatar { flex-basis: 34px; width: 34px; height: 34px; }
  .radio-copy p { font-size: 15px; line-height: 1.4; letter-spacing: -.1px; }
  .radio-heading { font-size: 8px; letter-spacing: .7px; }
  .parody-tag { font-size: 6px; }
  .toast { font-size: 10px; padding: 10px 14px; top: 21%; }
  .flight-cue { padding: 10px 13px; bottom: 9%; }
  .flight-manual { padding: 20px 4px; }
  .manual-heading .eyebrow { font-size: 7px; }
  .manual-items { grid-template-columns: 1fr; gap: 15px; margin-top: 18px; }
  .manual-item { gap: 12px; }
  .manual-item h3 { font-size: 12px; margin-bottom: 3px; }
  .manual-item p { font-size: 11px; max-width: none; }
  footer { flex-wrap: wrap; justify-content: space-between; gap: 0 8px; padding: 6px 4px max(8px, env(safe-area-inset-bottom)); }
  footer > span:first-child { display: none; }
  footer button { font-size: 7px; letter-spacing: .4px; padding-left: 0; }
  .creator-credit { font-size: 11px; white-space: nowrap; }
  dialog { padding: 25px; }
}
@media (pointer: coarse) {
  .desktop-input { display: none !important; }
  .touch-input { display: inline !important; }
  .control-legend .touch-input { display: flex !important; align-items: center; gap: 6px; }
  .secondary-legend { display: none !important; }
  .mobile-roll-note { color: #96a284; font-size: 6px; }
  .launch-hint { display: none; }
}
@media (max-width: 650px) and (max-height: 700px) {
  .launch-panel { margin-bottom: 27px; padding: 18px; }
  .launch-panel .panel-tag { display: none; }
  .launch-panel h2 { font-size: 30px; margin: 0 0 9px; }
  .launch-panel > p:not(.panel-tag) { font-size: 12px; line-height: 1.4; }
  .mode-picker { margin-top: 12px; }
  .result-panel { padding: 18px; }
  .result-panel h2 { font-size: 29px; margin: 10px 0; }
  .result-panel > p:not(.panel-tag):not(.new-record) { font-size: 12px; margin: 8px 0; }
  .results { margin: 12px 0; padding: 10px 0; }
  .results strong { font-size: 26px; }
  .new-record { margin-bottom: 9px; }
}
@media (max-width: 650px) and (max-height: 590px) {
  .site-header { height: 49px; }
  .intro { min-height: 51px; padding: 11px 2px; }
  h1 { font-size: 25px; }
  .game-stage { height: max(320px, calc(100svh - 205px)); }
  .launch-panel { margin-bottom: 12px; padding: 14px 17px; }
  .launch-panel h2 { font-size: 26px; }
  .launch-panel > p:not(.panel-tag), .launch-hint { display: none; }
  .mode-picker { margin: 13px 0 10px; }
  .primary-button { min-height: 48px; }
  .result-panel h2 { font-size: 26px; }
  .result-panel > p:not(.panel-tag):not(.new-record) { line-height: 1.35; font-size: 11px; }
  .result-panel .panel-tag { font-size: 6px; }
  .result-panel .text-button { min-height: 44px; padding: 9px; }
  .results { margin: 10px 0; padding: 9px 0; }
  .results span { font-size: 6px; }
  .new-record { font-size: 7px; }
}
@media (max-width: 360px) {
  .version { display: none; }
  .location { font-size: 7px; }
  .location .live-dot { display: none; }
  .game-toolbar { padding-left: 10px; }
  .hud-right { padding: 8px; }
  .hud-right .hud-label { font-size: 5px; letter-spacing: .6px; }
  .telemetry { gap: 6px; font-size: 8px; }
  .mobile-roll-note { display: none !important; }
  .speech-balloon { gap: 8px; padding: 10px 11px; }
  .radio-avatar { flex-basis: 30px; width: 30px; height: 30px; }
  .radio-copy p { font-size: 14px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .app-shell { padding: 0 max(8px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left)); max-width: none; }
  .site-header, .intro, .flight-manual, footer { display: none; }
  .game-wrap { border: 0; border-radius: 0; }
  .game-toolbar { height: 48px; padding: 0 12px; }
  .game-stage { height: calc(100svh - 78px); min-height: 200px; }
  .game-bottom { height: 30px; }
  .game-hud { inset: 10px 14px auto; }
  .hud-left { padding: 7px 10px; min-width: 65px; }
  .hud-left strong { font-size: 28px; }
  .hud-label, .hud-best { font-size: 6px; }
  .hud-right { padding: 8px 10px; gap: 6px; }
  .gas-status { display: none; }
  .launch-panel { margin: 0 0 0 34%; padding: 17px; width: 300px; border-radius: 14px; }
  .launch-panel .panel-tag, .launch-panel > p:not(.panel-tag), .launch-hint { display: none; }
  .launch-panel h2 { font-size: 29px; margin: 0 0 12px; }
  .mode-picker { margin: 0 0 10px; }
  .primary-button { min-height: 46px; padding: 12px 16px; }
  .result-panel { padding: 16px 20px; width: 510px; max-width: calc(100% - 130px); display: grid; grid-template-columns: 1fr 1fr; column-gap: 22px; align-items: center; }
  .result-panel .panel-tag { grid-column: 1; font-size: 7px; }
  .result-panel h2 { grid-column: 1; font-size: 27px; margin: 8px 0; }
  .result-panel > p:not(.panel-tag):not(.new-record) { grid-column: 1; font-size: 11px; margin: 0; line-height: 1.4; }
  .result-panel .results { grid-column: 2; grid-row: 1 / span 2; margin: 0 0 8px; padding: 12px 0; }
  .results strong { font-size: 25px; }
  .results span { font-size: 6px; }
  .result-panel .primary-button { grid-column: 2; grid-row: 3; font-size: 9px; }
  .result-panel .text-button { grid-column: 2; grid-row: 4; padding: 8px; }
  .new-record { grid-column: 1; grid-row: 4; font-size: 7px; margin: 7px 0; }
  #pause-overlay .result-panel { display: block; width: 330px; }
  #pause-overlay .result-panel > p:not(.panel-tag) { display: none; }
  #pause-overlay h2 { font-size: 28px; margin: 10px 0 16px; }
  .speech-balloon { width: 350px; padding: 10px 12px; gap: 9px; }
  .radio-copy p { font-size: 14px; line-height: 1.35; }
  .radio-avatar { flex-basis: 34px; width: 34px; height: 34px; }
  .world-caption { bottom: 9px; font-size: 6px; }
  .flight-cue { bottom: 12%; padding: 8px 12px; }
}
.game-wrap:fullscreen { width: 100%; height: 100%; display: flex; flex-direction: column; border: 0; border-radius: 0; }
.game-wrap:fullscreen .game-stage { flex: 1; height: auto; min-height: 0; max-height: none; }
.game-wrap:fullscreen .game-toolbar, .game-wrap:fullscreen .game-bottom { flex-shrink: 0; }

/* A reserved comms bay keeps every word outside the flight path on touch screens. */
@media (max-width: 650px), (pointer: coarse) {
  .game-stage { --speech-space: 96px; }
  .speech-bay { position: absolute; display: flex; align-items: center; justify-content: space-between; gap: 14px; inset: 0 0 auto; height: var(--speech-space); padding: 12px 19px; background: #e8edde; border-bottom: 1px solid #cbd6be; color: #78906c; }
  .bay-frequency { display: flex; align-items: center; gap: 7px; font: 500 8px var(--mono); letter-spacing: 1px; white-space: nowrap; }
  .bay-frequency > i { width: 5px; height: 5px; border-radius: 50%; background: #e57d59; }
  .bay-frequency > span { display: none; color: #8b9b7d; }
  .bay-idle { display: none; font-size: 11px; line-height: 1.6; color: #8c9b80; }
  .bay-idle strong { font-weight: 500; color: #69815c; }
  .bay-wave { display: flex; align-items: center; gap: 3px; height: 20px; }
  .bay-wave i { width: 3px; height: 7px; border-radius: 3px; background: #9bad8d; }
  .bay-wave i:nth-child(2n) { height: 13px; }
  .bay-wave i:nth-child(3) { height: 20px; }
  body:not([data-game-state='ready']) .bay-frequency, body:not([data-game-state='ready']) .bay-wave { visibility: hidden; }
  .speech-leader { display: none !important; }
  .speech-balloon { width: min(calc(100% - 20px), 560px); max-width: calc(100% - 20px); min-height: 74px; max-height: calc(var(--speech-space) - 12px); gap: 10px; padding: 6px 10px; background: #fbfcf3; border: 1px solid #d4ddc8; border-radius: 13px; box-shadow: 0 2px 5px #36522e08; }
  .speech-balloon::before { content: ''; position: absolute; top: 28px; left: 44px; width: 8px; height: 8px; background: #fbfcf3; border-left: 1px solid #d4ddc8; border-bottom: 1px solid #d4ddc8; transform: rotate(45deg); }
  .radio-avatar { flex-basis: 34px; width: 34px; height: 34px; margin-top: 5px; background: #e0e9d7; border-color: #c6d5bb; }
  .radio-heading { min-height: 12px; padding-right: 6px; font-size: 8px; line-height: 12px; letter-spacing: .8px; color: #5d7951; }
  .radio-copy p { margin-top: 2px; font-size: 14px; line-height: 1.3; font-weight: 500; letter-spacing: 0; color: #2c4432; overflow-wrap: anywhere; }
  .speech-page { padding-right: 0; font-size: 8px; }
  .parody-tag { padding: 0 4px; font-size: 6px; line-height: 10px; color: #8a997c; border-color: #d8e0ce; }
  .wisdom-button { display: none; }
  .game-hud { inset: 8px 9px auto; gap: 8px; }
  .hud-left { min-width: 0; padding: 5px 8px; gap: 0 7px; border-radius: 10px; background: #fffdf0e6; }
  .hud-left strong { font-size: 27px; letter-spacing: -1px; }
  .hud-left > .hud-label, .hud-best { font-size: 6px; letter-spacing: .5px; }
  .hud-best { margin-top: 3px; }
  .hud-right { padding: 8px 9px; border-radius: 10px; background: #fffdf0e6; }
  .hud-right .hud-label, .gas-status, #altitude, .telemetry-divider { display: none; }
  .telemetry { font-size: 10px; gap: 10px; }
  .world-caption { font-size: 6px; }
  .mode-picker .mode-detail { font-size: 6px; }
}
@media (pointer: coarse) and (min-width: 651px) {
  .bay-frequency > span { display: inline; }
  .bay-idle { display: block; }
  body:not([data-game-state='ready']) .bay-idle { visibility: hidden; }
}
@media (max-height: 500px) and (pointer: coarse), (max-width: 650px) and (max-height: 500px) {
  .game-stage { --speech-space: 80px; }
  .speech-balloon { min-height: 62px; padding: 6px 10px; }
  .radio-avatar { flex-basis: 32px; width: 32px; height: 32px; margin-top: 3px; }
  .radio-copy p { margin-top: 2px; }
  .hud-left { padding: 3px 7px; }
  .hud-left strong { font-size: 23px; }
  .hud-right { padding: 6px 8px; }
  .mode-picker .mode-detail { display: none; }
  .ready-overlay { align-items: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
