/* Contrail: The Understudy — cold navy glass over the fjords, condensed
   uppercase type, ice-blue instruments and orange for targets. No serif. */
:root {
  --ink: #eef8fb; --muted: #9fb6c2; --faint: #6b8290; --line: rgba(160, 220, 240, .18); --panel: rgba(8, 22, 32, .62); --panel-strong: rgba(6, 17, 25, .9);
  --hud: #8ce8ff; --hud-dim: rgba(140, 232, 255, .55); --amber: #ffa24a; --red: #ff4d5e; --blue: #d4f6ff;
  --cond: "DIN Alternate", "Bahnschrift", "Roboto Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: var(--cond);
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px); --safe-right: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; overflow: hidden; background: #0b1620; color: var(--ink); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; touch-action: none; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, canvas:focus-visible, [role="slider"]:focus-visible { outline: 2px solid var(--hud); outline-offset: 3px; }
kbd { display: inline-block; min-width: 22px; padding: 2px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: rgba(255,255,255,.05); color: var(--ink); font: 600 10px/1.4 var(--mono); text-align: center; }
body[data-input="touch"] .keys-only, body:not([data-input="touch"]) .touch-only { display: none !important; }
.sky { position: fixed; inset: 0; overflow: hidden; background: linear-gradient(180deg, #2c4a72 0%, #b9cde0 60%, #3c4a58 100%); }
#dogfight-webgl, #dogfight-canvas, #dogfight-hud { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#dogfight-webgl { z-index: 1; }
#dogfight-canvas { z-index: 2; outline: none; touch-action: none; cursor: none; }
body[data-controls="realistic"] #dogfight-canvas { cursor: crosshair; }
body:not([data-screen="flying"]) #dogfight-canvas { cursor: default; }
#dogfight-hud { z-index: 3; pointer-events: none; }
.vignette { position: absolute; inset: 0; z-index: 4; pointer-events: none; background: radial-gradient(ellipse at 50% 50%, transparent 58%, rgba(0,0,0,.42) 100%); }
body[data-screen="home"] .vignette { background: linear-gradient(0deg, rgba(4,12,18,.9) 0%, rgba(4,12,18,.55) 38%, transparent 70%), linear-gradient(90deg, rgba(4,12,18,.55) 0%, transparent 55%); }
.flash { position: absolute; inset: 0; z-index: 5; pointer-events: none; background: #fff6e0; opacity: 0; }

/* ---- Masthead and home. */
.masthead { position: absolute; z-index: 20; top: calc(14px + var(--safe-top)); left: calc(18px + var(--safe-left)); right: calc(18px + var(--safe-right)); display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.masthead > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 700 15px var(--sans); }
.brand img { border-radius: 9px; }
.brand span span { color: var(--amber); font-weight: 400; }
.brand small { margin-left: 8px; color: var(--muted); font: 700 8px var(--sans); letter-spacing: 2px; }
.header-actions { display: flex; gap: 8px; }
.quiet { padding: 8px 13px; border: 1px solid var(--line); border-radius: 999px; background: rgba(16,18,22,.5); color: var(--ink); font: 600 11px var(--sans); text-decoration: none; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.quiet:hover { border-color: rgba(200,236,248,.45); }
body:not([data-screen="home"]) .masthead { display: none; }
.home { position: absolute; z-index: 10; left: calc(clamp(22px, 6vw, 96px) + var(--safe-left)); top: 50%; transform: translateY(-50%); width: min(560px, calc(100vw - 44px)); }
body:not([data-screen="home"]) .home, body:not([data-screen="home"]) .home-footer { display: none; }
.eyebrow { margin: 0 0 18px; color: var(--muted); font: 700 10px var(--sans); letter-spacing: 2.4px; display: flex; align-items: center; gap: 10px; }
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--hud); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(140,232,255,.55); } 70% { box-shadow: 0 0 0 10px rgba(140,232,255,0); } 100% { box-shadow: 0 0 0 0 rgba(140,232,255,0); } }
.home h1 { margin: 0; font: 400 clamp(58px, 9vw, 116px)/.92 var(--serif); letter-spacing: -2px; color: #f2fbff; text-shadow: 0 6px 40px rgba(0,0,0,.55); }
.home h1 span { display: block; margin-top: 14px; font: italic 400 clamp(20px, 2.6vw, 30px)/1.1 var(--serif); letter-spacing: 0; color: #c9dde6; }
.home h1 em { color: var(--amber); }
.home-copy { margin: 22px 0 0; max-width: 480px; color: #d7e8ef; font-size: 15px; line-height: 1.65; text-shadow: 0 2px 18px rgba(0,0,0,.8); }
.home-facts { display: flex; gap: 26px; margin: 26px 0 0; }
.home-facts div { display: flex; flex-direction: column; }
.home-facts b { font: 400 26px var(--serif); color: #fff; }
.home-facts span { color: var(--muted); font: 700 8.5px var(--sans); letter-spacing: 1.6px; }
.home-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 22px; margin-top: 30px; }
.primary { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 48px; padding: 0 24px; border: 1px solid rgba(255,244,220,.7); border-radius: 999px; background: linear-gradient(180deg, #fbf3df, #e7d9b8); color: #1d1a14; font: 700 13px var(--sans); letter-spacing: .3px; box-shadow: 0 10px 34px rgba(0,0,0,.35); }
.primary:hover { filter: brightness(1.05); }
.secondary { display: block; width: 100%; min-height: 44px; margin-top: 10px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.05); color: var(--ink); font: 600 12px var(--sans); }
.secondary:hover { border-color: rgba(200,236,248,.45); }
.text-button { border: 0; background: none; color: #c9dde6; font: 600 12px var(--sans); padding: 10px 2px; }
.text-button:hover { color: #fff; }
.home-note { margin: 22px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; text-shadow: 0 1px 10px rgba(0,0,0,.7); }
.home-footer { position: absolute; z-index: 10; left: calc(clamp(22px, 6vw, 96px) + var(--safe-left)); right: calc(18px + var(--safe-right)); bottom: calc(14px + var(--safe-bottom)); display: flex; align-items: center; gap: 18px; color: var(--muted); font: 700 9px var(--sans); letter-spacing: 1.8px; }
.home-footer span { margin-right: auto; }

/* ---- Flight HUD. */
.hud { position: absolute; inset: 0; z-index: 8; pointer-events: none; }
.hud button { pointer-events: auto; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.kicker { color: var(--muted); font: 700 9px var(--sans); letter-spacing: 1.9px; }
.hud-top { position: absolute; top: calc(12px + var(--safe-top)); left: calc(12px + var(--safe-left)); right: calc(12px + var(--safe-right)); display: flex; align-items: flex-start; gap: 12px; }
.objective-card { position: relative; width: min(320px, 42vw); padding: 11px 14px 12px; }
.time-left { position: absolute; top: 9px; right: 14px; color: var(--ink); font: 600 13px var(--mono); letter-spacing: .5px; }
.time-left::before { content: "TIME "; color: var(--muted); font: 700 9px var(--sans); letter-spacing: 1.9px; }
.time-left[data-state="warn"] { color: var(--amber); }
.time-left[data-state="critical"] { color: var(--red); }
.objective-card b { display: block; font: 400 19px/1.2 var(--serif); margin-top: 2px; }
.objective-text { margin: 6px 0 8px; font-size: 12.5px; line-height: 1.4; color: #dcecf2; }
.objective-bars { display: flex; flex-direction: column; gap: 4px; }
.bar { display: block; height: 3px; border-radius: 2px; background: rgba(200,236,248,.14); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--hud); transition: width .2s linear; }
.bar.meter i { background: var(--amber); }
.bar.meter[data-state="danger"] i { background: var(--red); }
.objective-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.objective-list li { font-size: 10.5px; color: var(--muted); padding-left: 14px; position: relative; }
.objective-list li::before { content: '○'; position: absolute; left: 0; top: -1px; font-size: 9px; }
.objective-list li[data-state="done"] { color: var(--hud-dim); text-decoration: line-through; }
.objective-list li[data-state="done"]::before { content: '●'; color: var(--hud); }
.objective-list li[data-state="failed"] { color: var(--red); }
.objective-list li[data-optional="true"] { font-style: italic; }
.radio { flex: 1; min-width: 0; display: flex; justify-content: center; }
.radio ol { list-style: none; margin: 0; padding: 0; width: min(480px, 100%); display: flex; flex-direction: column; gap: 6px; }
.radio li { padding: 8px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-size: 12.5px; line-height: 1.4; animation: radio-in .25s ease-out; }
.radio li b { margin-right: 8px; font: 700 10px var(--sans); letter-spacing: 1.2px; text-transform: uppercase; }
.radio li[data-old="true"] { opacity: .55; }
@keyframes radio-in { from { transform: translateY(-6px); opacity: 0; } to { transform: none; opacity: 1; } }
.flight-buttons { display: flex; gap: 8px; }
.circle { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: 600 15px var(--sans); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.warnings { position: absolute; left: 50%; top: 24%; transform: translateX(-50%); display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; width: min(92vw, 640px); }
.warnings span { padding: 6px 12px; border-radius: 8px; font: 700 12px var(--mono); letter-spacing: 2px; background: rgba(20,8,6,.55); border: 1px solid rgba(255,91,71,.6); color: var(--red); }
.warnings span[data-tone="amber"] { border-color: rgba(255,162,74,.6); color: var(--amber); background: rgba(20,14,4,.5); }
.warnings span[data-blink="true"] { animation: blink .5s steps(2) infinite; }
@keyframes blink { 50% { opacity: .25; } }
.messages { position: absolute; left: 50%; bottom: calc(150px + var(--safe-bottom)); transform: translateX(-50%); width: min(560px, 92vw); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.coach, .toast { margin: 0; padding: 10px 16px; border-radius: 14px; background: var(--panel-strong); border: 1px solid rgba(140,232,255,.35); color: #e8f9ff; font-size: 13.5px; line-height: 1.45; text-align: center; }
.toast { border-color: var(--line); font-weight: 600; }
.gate { width: 100%; padding: 12px 16px; border-radius: 16px; background: var(--panel-strong); border: 1px solid rgba(140,232,255,.55); box-shadow: 0 0 0 1px rgba(140,232,255,.15), 0 14px 40px rgba(0,0,0,.35); }
.gate-kicker { color: var(--hud); font: 700 9px var(--sans); letter-spacing: 2px; }
.gate-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; }
.gate-row b { font: 400 22px var(--serif); }
.gate-keys { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; color: var(--muted); font-size: 11px; }
.gate-keys .glyph { padding: 3px 9px; border-radius: 999px; border: 1px solid var(--hud-dim); color: var(--hud); font-weight: 700; }
.gate-text { margin: 6px 0 8px; font-size: 13px; color: #d6e7ee; }
.gate-meter { display: block; height: 3px; border-radius: 2px; background: rgba(200,236,248,.14); overflow: hidden; }
.gate-meter i { display: block; height: 100%; width: 0; background: var(--hud); }
.corner { position: absolute; bottom: calc(22px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 1px; text-shadow: 0 1px 8px rgba(0,0,0,.65); }
.corner-left { left: calc(26px + var(--safe-left)); align-items: flex-start; }
.corner-right { right: calc(26px + var(--safe-right)); align-items: flex-end; }
.numeral { font: 400 38px/1 var(--serif); color: #f2fbff; font-variant-numeric: tabular-nums; }
.numeral.small { font-size: 22px; margin-top: 8px; }
.corner small { color: var(--muted); font: 600 9.5px var(--mono); letter-spacing: 1.4px; }
.throttle { position: relative; display: block; width: 110px; height: 3px; margin: 9px 0 3px; background: rgba(200,236,248,.22); }
.throttle i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--ink); }
.throttle i[data-ab="true"] { background: var(--amber); box-shadow: 0 0 8px rgba(255,162,74,.7); }
.ab-mark { position: absolute; left: 92%; top: -4px; width: 1px; height: 11px; background: var(--amber); }
.state-line { margin-top: 6px; }
.attitude { position: relative; display: block; width: 46px; height: 46px; margin-bottom: 8px; border-radius: 50%; border: 1px solid rgba(200,236,248,.6); overflow: hidden; }
.attitude i { position: absolute; left: -30%; right: -30%; top: 50%; height: 1px; background: var(--ink); transform-origin: 50% 50%; }
.attitude em { position: absolute; left: 25%; right: 25%; top: 50%; height: 0; border-top: 2px solid var(--amber); }
.weapons { position: absolute; left: 50%; bottom: calc(26px + var(--safe-bottom)); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--hud); font: 600 14px var(--mono); letter-spacing: 1.5px; text-shadow: 0 0 8px rgba(40,170,255,.45), 0 1px 3px rgba(0,0,0,.6); white-space: nowrap; }
.weapons small { color: var(--hud-dim); font-size: 11px; }
.desktop-keys { position: absolute; left: 50%; bottom: calc(66px + var(--safe-bottom)); transform: translateX(-50%); margin: 0; color: rgba(200,236,248,.6); font-size: 10.5px; white-space: nowrap; display: flex; gap: 5px; align-items: center; transition: opacity 1s; }
body[data-input="touch"] .desktop-keys { display: none; }
.replay-banner { position: absolute; left: 50%; top: calc(18px + var(--safe-top)); transform: translateX(-50%); display: flex; gap: 12px; align-items: baseline; padding: 8px 16px; border-radius: 999px; background: var(--panel-strong); border: 1px solid rgba(255,162,74,.5); }
.replay-banner b { color: var(--amber); font: 700 12px var(--mono); letter-spacing: 3px; }
.replay-banner span { color: var(--muted); font-size: 11px; }
body[data-replay="true"] .hud-top, body[data-replay="true"] .corner, body[data-replay="true"] .weapons, body[data-replay="true"] .warnings, body[data-replay="true"] .messages, body[data-replay="true"] .desktop-keys, body[data-replay="true"] .touch-controls { visibility: hidden; }
[data-focus="true"] { animation: focus-pulse 1.1s ease-in-out infinite; border-radius: 10px; }
@keyframes focus-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(140,232,255,0); } 50% { box-shadow: 0 0 0 4px rgba(140,232,255,.55); } }
body[data-camera="cockpit"] .weapons { display: none; }

/* ---- Touch controls. */
.touch-controls { position: absolute; inset: 0; z-index: 9; pointer-events: none; --small: 54px; --big: 78px; }
.touch-left, .touch-right { position: absolute; bottom: calc(18px + var(--safe-bottom)); display: flex; gap: 10px; align-items: flex-end; pointer-events: none; }
.touch-left { left: calc(14px + var(--safe-left)); }
.touch-right { right: calc(14px + var(--safe-right)); display: grid; grid-template-columns: var(--small) var(--big); grid-template-rows: repeat(3, var(--small)); gap: 8px 10px; align-items: center; justify-items: center; }
.touch-right [data-action="camera"] { grid-column: 1; grid-row: 1; }
.touch-right [data-hold="look"] { grid-column: 1; grid-row: 2; }
.touch-right [data-action="target"] { grid-column: 1; grid-row: 3; }
.touch-right .gun { grid-column: 2; grid-row: 2 / span 2; align-self: end; }
.touch-left > *, .touch-right > * { pointer-events: auto; }
.touch-big, .touch-small { display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 50%; border: 1px solid rgba(200,236,248,.35); background: rgba(8,22,32,.6); color: var(--ink); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); touch-action: none; user-select: none; -webkit-user-select: none; }
.touch-big { width: var(--big); height: var(--big); font-size: 22px; }
.touch-small { width: var(--small); height: var(--small); font-size: 15px; }
.touch-big small, .touch-small small { font: 700 8px var(--sans); letter-spacing: 1.2px; margin-top: 2px; }
.touch-big.gun { border-color: rgba(140,232,255,.6); color: var(--hud); }
.touch-big.fox { border-color: rgba(255,162,74,.6); color: var(--amber); }
[data-active="true"] { background: rgba(140,232,255,.22) !important; }
[data-cue="true"] { animation: focus-pulse 1.1s ease-in-out infinite; }
.throttle-slider { position: relative; width: 54px; height: 168px; border-radius: 27px; border: 1px solid rgba(200,236,248,.35); background: rgba(8,22,32,.6); touch-action: none; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.slider-track { position: absolute; left: 50%; top: 14px; bottom: 14px; width: 4px; transform: translateX(-50%); border-radius: 2px; background: rgba(200,236,248,.2); }
.slider-track i { position: absolute; left: 0; right: 0; bottom: 0; height: 0; border-radius: 2px; background: var(--ink); }
.slider-ab { position: absolute; left: 10px; top: -2px; color: var(--amber); font: 700 8px var(--sans); font-style: normal; }
.throttle-slider b { position: absolute; left: 50%; width: 34px; height: 14px; margin-left: -17px; border-radius: 7px; background: var(--ink); box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.touch-hint { position: absolute; left: 50%; top: 47%; transform: translateX(-50%); margin: 0; color: rgba(200,236,248,.7); font-size: 12px; transition: opacity 1s; white-space: nowrap; }

/* ---- Overlays and cards. */
.overlay { position: absolute; inset: 0; z-index: 15; display: flex; align-items: center; justify-content: center; padding: calc(18px + var(--safe-top)) calc(18px + var(--safe-right)) calc(18px + var(--safe-bottom)) calc(18px + var(--safe-left)); background: rgba(10,11,14,.42); }
.card { width: min(980px, 100%); max-height: 100%; display: flex; flex-direction: column; background: var(--panel-strong); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.45); overflow: hidden; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.card.compact { width: min(400px, 100%); padding: 26px 26px 18px; }
.card.compact .primary { width: 100%; margin-top: 8px; }
.card h2 { margin: 6px 0 10px; font: 400 clamp(26px, 3.2vw, 38px)/1.1 var(--serif); }
.card h3 { margin: 18px 0 8px; color: var(--muted); font: 700 9.5px var(--sans); letter-spacing: 1.8px; text-transform: uppercase; }
.story { color: #d6e7ee; font-size: 14px; line-height: 1.65; }
.card.split { width: min(760px, 100%); }
.card-scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; touch-action: pan-y; padding: 26px 28px 8px; }
.card-scroll[data-more="true"], .brief-scroll[data-more="true"] { -webkit-mask-image: linear-gradient(180deg, #000 85%, transparent); mask-image: linear-gradient(180deg, #000 85%, transparent); }
.card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 14px 28px 18px; border-top: 1px solid var(--line); }
.card-actions .secondary { width: auto; margin: 0; padding: 0 20px; }
.cast { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.cast li { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; }
.cast li b { font: 400 16px var(--serif); }
.cast li small { color: var(--muted); font-size: 11px; }
.cast li span { font: 700 9px var(--sans); letter-spacing: 1.4px; }
.brief-card { flex-direction: row; width: min(1080px, 100%); height: min(640px, 100%); }
.brief-chart { position: relative; flex: 1 1 46%; min-width: 0; background: #0c1820; }
.brief-chart canvas { width: 100%; height: 100%; display: block; }
.chart-key { position: absolute; left: 12px; bottom: 10px; display: flex; gap: 10px; align-items: center; color: var(--muted); font: 600 10px var(--sans); background: rgba(14,16,19,.7); padding: 5px 9px; border-radius: 8px; }
.chart-key i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: -4px; }
.key-you { background: #f2fbff; } .key-friend { background: var(--blue); } .key-hostile { background: var(--red); } .key-gate { background: var(--hud); }
.brief-body { flex: 1 1 54%; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.brief-body header { padding: 22px 26px 6px; }
.brief-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tag { padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font: 700 9px var(--sans); letter-spacing: 1.4px; text-transform: uppercase; }
.tag[data-kind="live"] { color: var(--amber); border-color: rgba(255,162,74,.45); }
.brief-place { margin: 0; color: var(--muted); font-size: 12px; }
.brief-scroll { flex: 1; min-height: 0; overflow: auto; touch-action: pan-y; padding: 4px 26px 8px; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; }
.scene { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.scene li { padding: 9px 12px; border-left: 2px solid var(--line); background: rgba(255,255,255,.03); border-radius: 0 10px 10px 0; }
.scene li span { display: flex; gap: 8px; align-items: baseline; font: 700 10px var(--sans); letter-spacing: 1.2px; text-transform: uppercase; }
.scene li span small { color: var(--muted); font-weight: 600; letter-spacing: 0; text-transform: none; }
.scene li p { margin: 3px 0 0; font: 14px/1.5 var(--sans); color: #dcecf2; }
.brief-block p { margin: 0; color: #c9dde6; font-size: 12.5px; line-height: 1.9; }
.pill { padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); font-size: 11px; }
.goals { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.goals li { position: relative; padding-left: 20px; font-size: 12.5px; color: #c9dde6; }
.goals li::before { content: '✦'; position: absolute; left: 0; color: var(--faint); }
.goals li[data-met="true"]::before { color: var(--amber); }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 18px 0 10px; }
.facts div { display: flex; flex-direction: column; gap: 2px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 12px; }
.facts span { color: var(--muted); font: 700 8.5px var(--sans); letter-spacing: 1.4px; }
.facts b { font: 400 15px var(--serif); }
.brief-body footer { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; padding: 14px 26px 18px; border-top: 1px solid var(--line); }
.brief-body footer .secondary { width: auto; margin: 0; padding: 0 18px; }
.result-body { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 24px; }
.result-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.result-stars { display: flex; gap: 6px; font-size: 22px; color: var(--faint); }
.result-stars b { color: var(--amber); font-weight: 400; }
.result-card[data-outcome="lost"] .kicker { color: var(--red); }
.result-quote { margin: 14px 0; padding: 12px 16px; border-left: 2px solid var(--amber); background: rgba(255,162,74,.06); border-radius: 0 12px 12px 0; }
.result-quote p { margin: 0; font: 15px/1.5 var(--sans); }
.result-quote cite { display: block; margin-top: 6px; color: var(--muted); font: 700 9px var(--sans); letter-spacing: 1.4px; font-style: normal; text-transform: uppercase; }
.result-tip { display: flex; gap: 10px; align-items: baseline; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; font-size: 12.5px; }
.result-tip b { color: var(--hud); font: 700 9px var(--sans); letter-spacing: 1.6px; }
.log-card { margin: 14px 0 6px; padding: 14px 16px; border: 1px solid rgba(200,236,248,.22); border-radius: 14px; background: rgba(200,236,248,.04); }
.log-card b { display: block; margin: 4px 0 6px; font: 400 17px var(--serif); }
.log-card p { margin: 0; font-size: 13px; line-height: 1.6; color: #c9dde6; }
.result-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 6px; }
.result-stats div { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; }
.result-stats b { font: 400 24px var(--serif); }
.result-stats span { color: var(--muted); font: 700 8.5px var(--sans); letter-spacing: 1.4px; }
.result-goals { margin-top: 14px; }
.result-score { color: var(--muted); font-size: 12px; }

/* ---- Dialogs. */
dialog { width: min(640px, calc(100vw - 28px)); max-height: calc(100vh - 28px); padding: 22px 24px 20px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel-strong); color: var(--ink); box-shadow: 0 30px 80px rgba(0,0,0,.5); overflow: auto; overscroll-behavior: contain; touch-action: pan-y; }
dialog::backdrop { background: rgba(8,9,11,.55); backdrop-filter: blur(4px); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; }
dialog h2 { margin: 4px 0 12px; font: 400 30px var(--serif); }
.dialog-copy { color: #c9dde6; font-size: 13px; }
.tabs { display: flex; gap: 6px; margin: 0 0 12px; border-bottom: 1px solid var(--line); }
.tabs button { padding: 9px 14px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font: 700 11px var(--sans); letter-spacing: 1px; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--hud); }
.mission-list, .log-list, .settings-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.mission-list button { width: 100%; display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.03); text-align: left; }
.mission-list button:disabled { opacity: .45; cursor: not-allowed; }
.mission-list button:not(:disabled):hover { border-color: rgba(200,236,248,.45); }
.mission-list .number { font: 400 22px var(--serif); color: var(--muted); width: 32px; }
.mission-list .name { flex: 1; display: flex; flex-direction: column; }
.mission-list .name b { font: 400 17px var(--serif); }
.mission-list .name small { color: var(--muted); font-size: 11px; }
.mission-list .stars { color: var(--faint); letter-spacing: 2px; }
.mission-list .stars b { color: var(--amber); font-weight: 400; }
.log-list li { padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; }
.log-list li[data-state="locked"] { opacity: .5; }
.log-list .entry-head { display: flex; gap: 10px; align-items: baseline; }
.log-list .entry-head b { font: 400 16px var(--serif); }
.log-list .number { color: var(--muted); font: 400 16px var(--serif); }
.log-list p { margin: 6px 0 0; font-size: 12.5px; color: #c9dde6; line-height: 1.6; }
.settings-list li { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; }
.settings-list span { flex: 1; display: flex; flex-direction: column; }
.settings-list b { font: 400 16px var(--serif); }
.settings-list small { color: var(--muted); font-size: 11.5px; }
.settings-list .secondary { width: 110px; margin: 0; }
.manual { display: flex; flex-direction: column; gap: 12px; margin: 10px 0 14px; }
.manual > div { display: flex; gap: 14px; align-items: flex-start; }
.manual kbd { flex: none; min-width: 64px; padding: 6px; }
.manual p { margin: 0; font-size: 13px; color: #c9dde6; line-height: 1.55; }
.advanced summary { cursor: pointer; color: var(--muted); font: 700 11px var(--sans); letter-spacing: 1px; margin-bottom: 8px; }
dialog > .primary { width: 100%; margin-top: 10px; }
.storage-note { position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 30; margin: 0; padding: 8px 14px; border-radius: 999px; background: var(--panel-strong); color: var(--amber); font-size: 12px; }
.no-script { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; background: #0b1620; color: var(--ink); z-index: 40; }
.no-script a { color: var(--amber); }

/* ---- Touch screens: only what a thumb pilot needs. Speed and height, the
   task and the clock, the latest radio call. The radar, boxes and buttons do the rest. */
body[data-input="touch"] #mission-name, body[data-input="touch"] #gload, body[data-input="touch"] #heading,
body[data-input="touch"] .attitude, body[data-input="touch"] .corner small { display: none; }
body[data-input="touch"] #speed::after { content: " km/h"; font: 700 11px var(--cond); color: var(--muted); }
body[data-input="touch"] #altitude::after { content: " m"; font: 700 11px var(--cond); color: var(--muted); }
body[data-input="touch"] .corner .inst-label { display: none; }
body[data-input="touch"] .numeral { font-size: 24px; }
body[data-input="touch"] .objective-text { margin-top: 6px; }
body[data-input="touch"] .radio li:not(:last-child) { display: none; }
body[data-input="touch"] .weapons small { display: none; }
.home-actions .secondary.quick { display: inline-flex; align-items: center; gap: 8px; width: auto; min-height: 48px; margin: 0; padding: 0 20px; font-size: 13px; }
.quick small { color: var(--muted); font: 600 10px var(--mono); letter-spacing: .6px; }

/* ---- Small screens. */
@media (max-width: 760px) {
  .objective-card { width: min(250px, 56vw); padding: 9px 11px 10px; }
  .objective-card b { font-size: 16px; }
  .objective-text { font-size: 11.5px; margin: 4px 0 6px; }
  .objective-list { display: none; }
  .radio { position: absolute; left: 0; right: 0; top: calc(164px + var(--safe-top)); justify-content: center; padding: 0 10px; }
  .radio li { font-size: 11.5px; padding: 6px 10px; }
  .flight-buttons { margin-left: auto; }
  .circle { width: 36px; height: 36px; font-size: 13px; }
  .numeral { font-size: 28px; }
  .numeral.small { font-size: 18px; margin-top: 4px; }
  /* The throttle slider shows the throttle; the corners keep to speed, load, height and heading. */
  .corner { bottom: calc(216px + var(--safe-bottom)); }
  .corner-left { left: calc(16px + var(--safe-left)); }
  .corner-right { right: calc(16px + var(--safe-right)); }
  .corner .throttle, #throttle-label, .state-line { display: none; }
  .attitude { width: 34px; height: 34px; margin-bottom: 4px; }
  .weapons { top: calc(136px + var(--safe-top)); bottom: auto; font-size: 12px; left: calc(12px + var(--safe-left)); transform: none; align-items: flex-start; }
  .weapons small { display: none; }
  .messages { top: 36%; bottom: auto; }
  .warnings { top: 30%; }
  /* The details shrink and scroll so Take off always stays on screen. */
  .brief-card { flex-direction: column; height: auto; max-height: 100%; }
  .brief-chart { flex: 0 0 auto; height: 24vh; min-height: 120px; }
  .brief-body { flex: 1 1 auto; }
  .brief-body header { padding: 16px 20px 4px; }
  .brief-scroll { padding: 4px 20px 8px; overscroll-behavior: contain; }
  .brief-body footer { padding: 12px 20px 14px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-body { grid-template-columns: 1fr; gap: 6px; }
  .card-scroll { padding: 20px 20px 6px; }
  .card-actions { padding: 12px 20px 14px; }
  .home { top: auto; bottom: calc(70px + var(--safe-bottom)); transform: none; }
  .home h1 { font-size: 60px; }
  .home-copy { font-size: 13.5px; }
  .home-facts { margin-top: 16px; }
  .home-actions { margin-top: 20px; gap: 12px 16px; }
  .home-note { display: none; }
  body[data-screen="home"] .vignette { background: linear-gradient(0deg, rgba(4,12,18,.92) 0%, rgba(4,12,18,.5) 55%, transparent 80%); }
  .home h1 { letter-spacing: 8px; }
}
/* Phones held sideways: short screens keep the instruments small and low. */
@media (max-height: 500px) {
  .objective-list { display: none; }
  .objective-card { width: min(250px, 34vw); padding: 7px 10px; }
  .objective-card b { font-size: 14px; }
  .objective-text { font-size: 11px; margin: 2px 0 4px; }
  .radio li { font-size: 11px; padding: 5px 9px; }
  .radio ol { width: min(380px, 100%); }
  .numeral { font-size: 24px; }
  .numeral.small { font-size: 16px; margin-top: 2px; }
  .corner { bottom: calc(10px + var(--safe-bottom)); }
  .corner-left { left: calc(208px + var(--safe-left)); }
  .corner-right { right: calc(150px + var(--safe-right)); }
  .corner .throttle, #throttle-label { display: none; }
  .attitude { width: 34px; height: 34px; }
  .weapons { bottom: calc(78px + var(--safe-bottom)); font-size: 11px; }
  .messages { top: 34%; bottom: auto; width: min(440px, 56vw); }
  .throttle-slider { height: 130px; }
  .touch-controls { --small: 46px; --big: 64px; }
  .home { top: 50%; bottom: auto; transform: translateY(-50%); }
  .home h1 { font-size: 46px; }
  .home-copy, .home-note, .home-facts { display: none; }
  .home h1 { margin-top: 18px; }
  .home-actions { margin-top: 16px; }
  .brief-card { flex-direction: row; height: 100%; }
  .brief-chart { flex: 0 0 38%; height: auto; min-height: 0; }
  .brief-body header { padding: 10px 18px 2px; }
  .brief-body footer { padding: 8px 18px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .pulse-dot, .warnings span[data-blink="true"], [data-focus="true"], [data-cue="true"], .radio li { animation: none; }
  .bar i { transition: none; }
}

/* ---- The strike look: a lower-left title block on a cold gradient, instrument
   panels instead of corner numerals, and weapon chips. */
.home { top: auto; bottom: calc(70px + var(--safe-bottom)); transform: none; width: min(620px, calc(100vw - 44px)); }
.home h1 { display: flex; flex-direction: column; gap: 6px; font: 800 clamp(52px, 8.4vw, 108px)/.9 var(--cond); letter-spacing: clamp(6px, 1.4vw, 18px); text-transform: uppercase; color: #f2fbff; text-shadow: 0 4px 30px rgba(0,10,20,.6); }
.home h1 .title-word { display: block; margin: 0; font: inherit; letter-spacing: inherit; color: inherit; }
.home h1 .title-sub { display: inline-flex; align-self: flex-start; margin-top: 10px; padding: 5px 12px 5px 14px; border-left: 3px solid var(--amber); background: rgba(8,22,32,.55); font: 700 clamp(12px, 1.5vw, 15px)/1.2 var(--cond); letter-spacing: 6px; color: var(--hud); }
.eyebrow { color: var(--hud); }
.pulse-dot { border-radius: 2px; transform: rotate(45deg); background: var(--amber); }
.home-facts { gap: 0; border: 1px solid var(--line); border-radius: 4px; width: max-content; background: rgba(8,22,32,.45); }
.home-facts div { padding: 8px 18px; border-right: 1px solid var(--line); }
.home-facts div:last-child { border-right: 0; }
.home-facts b { font: 700 22px var(--cond); letter-spacing: 1px; }
.home-facts span { text-transform: uppercase; }
.primary { border-radius: 4px; border: 1px solid rgba(140,232,255,.8); background: linear-gradient(180deg, #8ce8ff, #4fb9e0); color: #04121b; letter-spacing: 1.6px; text-transform: uppercase; font: 800 13px var(--cond); }
.secondary { border-radius: 4px; }
.quiet { border-radius: 4px; }
.circle { border-radius: 6px; }
.panel, .radio li, .coach, .toast, .gate, .card, dialog { border-radius: 6px !important; }
.objective-card { border-left: 3px solid var(--hud); }
.objective-card b, .gate-row b, .card h2, dialog h2 { font-family: var(--cond) !important; font-weight: 700 !important; letter-spacing: .5px; text-transform: uppercase; }
/* Instruments: two framed glass panels, label above the value. */
.corner { padding: 10px 14px 12px; min-width: 150px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); text-shadow: none; }
.corner-left { border-left: 3px solid var(--hud); }
.corner-right { border-right: 3px solid var(--hud); }
.corner .inst-label { color: var(--hud); font: 700 9px var(--cond); letter-spacing: 2px; }
.numeral { font: 700 34px/1.05 var(--cond); letter-spacing: 1px; color: #f2fbff; }
.numeral.small { font-size: 20px; margin-top: 0; }
.corner small:not(.inst-label) { font-family: var(--cond); }
.corner .inst-label:not(:first-child) { margin-top: 8px; }
.throttle i { background: var(--hud); }
.attitude { position: absolute; top: 10px; right: 12px; width: 34px; height: 34px; margin: 0; border-color: var(--hud-dim); }
.corner-right .attitude { right: auto; left: 12px; }
.weapons { font-family: var(--cond); text-shadow: none; }
.chips { display: flex; gap: 6px; }
.chip { padding: 5px 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); color: var(--muted); font: 700 11px var(--cond); letter-spacing: 1.5px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.chip b { margin-left: 4px; color: var(--hud); font-size: 14px; }
.chip#wpn-bomb { border-color: rgba(255,162,74,.55); }
.chip#wpn-bomb b { color: var(--amber); }
.chip[data-empty="true"] { opacity: .45; }
.weapons small { margin-top: 4px; padding: 3px 10px; border-radius: 4px; background: rgba(8,22,32,.6); color: var(--amber); font: 700 11px var(--cond); letter-spacing: 1.4px; }
.warnings span { border-radius: 4px; font-family: var(--cond); letter-spacing: 3px; }
.touch-big.bomb { border-color: rgba(255,162,74,.7); color: var(--amber); }
.touch-right .bomb { grid-column: 2; grid-row: 1 / span 2; align-self: start; }
@media (max-width: 640px), (max-height: 460px) {
  .corner { min-width: 0; padding: 7px 10px 8px; }
  .numeral { font-size: 24px; }
  .numeral.small { font-size: 15px; }
  .chip { padding: 4px 7px; font-size: 10px; }
  .chip b { font-size: 12px; }
}

/* Quick flights: one objective, one action, room to see the fjord. */
.home-actions .story-play { width: auto; margin: 0; padding: 0 18px; min-height: 48px; }
.quick-record { margin: 12px 0 0; color: var(--hud); font: 600 11px var(--mono); }
.home-copy { max-width: 460px; }
.strike-score { margin: 8px 0 0; font: 700 10px var(--mono); letter-spacing: .6px; color: var(--amber); }
.weapons { bottom: calc(18px + var(--safe-bottom)); max-width: min(480px, calc(100vw - 32px)); white-space: normal; }
.action-hint { margin: 5px 0 0; padding: 7px 12px; max-width: 100%; border: 1px solid var(--line); border-radius: 4px; background: var(--panel-strong); color: var(--ink); font: 500 12px/1.4 var(--sans); letter-spacing: 0; text-align: center; }
.desktop-keys { bottom: calc(118px + var(--safe-bottom)); }
.chip[data-reloading="true"] { opacity: 1; border-color: var(--hud-dim); }
.chip[data-reloading="true"] b { color: var(--hud); font-size: 12px; }
.chip[data-locked="true"] { border-color: var(--amber); color: var(--amber); }
.touch-big.bomb[data-locked="true"] { background: rgba(67, 43, 15, .85); border: 2px solid var(--amber); }
.touch-big.bomb small { max-width: 58px; font-size: 8px; line-height: 1.35; letter-spacing: .8px; }
.guided-note { border-left: 2px solid var(--amber); padding: 8px 10px; margin-bottom: 10px !important; background: rgba(255,162,74,.07); }
body[data-mode="quick"] .corner, body[data-mode="quick"] .radio, body[data-mode="quick"] .objective-list,
body[data-mode="quick"] .desktop-keys, body[data-mode="quick"] #wpn-ir, body[data-mode="quick"] #wpn-flare, body[data-mode="quick"] #pause-controls, body[data-mode="quick"] #pause-easy,
body[data-mode="quick"] #pause-hints, body[data-mode="quick"] #camera { display: none; }
body[data-mode="quick"] .flight-buttons { margin-left: auto; }
body[data-mode="quick"] .circle { width: 44px; height: 44px; }
body[data-mode="quick"] .objective-card { width: min(310px, calc(100vw - 132px)); }
body[data-mode="quick"] .objective-text { font-size: 12px; }
body[data-mode="quick"] .messages { bottom: calc(130px + var(--safe-bottom)); width: min(520px, 75vw); }
body[data-mode="quick"] .warnings { top: 24%; }
body[data-mode="quick"] .touch-left [data-action], body[data-mode="quick"] .touch-right [data-action="target"],
body[data-mode="quick"] .touch-hint { display: none; }
body[data-mode="quick"] .touch-right { grid-template-rows: repeat(2, var(--big)); }
body[data-mode="quick"] .touch-right .bomb { grid-column: 2; grid-row: 1; }
body[data-mode="quick"] .touch-right .gun { grid-column: 2; grid-row: 2; }
body[data-mode="quick"] .touch-right [data-hold="look"] { grid-column: 1; grid-row: 2; }
.card.compact { overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; }
.card.compact > * { flex-shrink: 0; }
body[data-comfort="true"] .pulse-dot, body[data-comfort="true"] [data-focus="true"],
body[data-comfort="true"] [data-cue="true"], body[data-comfort="true"] .radio li { animation: none; }
body[data-comfort="true"] .bar i, body[data-comfort="true"] .desktop-keys { transition: none; }

@media (max-width: 760px) {
  .home-actions { gap: 10px; }
  .home-actions .primary { padding: 0 16px; font-size: 12px; }
  .home-actions .story-play { padding: 0 14px; }
  .home h1 { font-size: clamp(38px, 10.2vw, 70px); letter-spacing: clamp(3px, 1.4vw, 8px); }
  .home { width: calc(100vw - 44px - var(--safe-left) - var(--safe-right)); }
  .home-facts div { padding: 7px 15px; }
  .weapons { top: calc(134px + var(--safe-top)); bottom: auto; left: calc(12px + var(--safe-left)); transform: none; max-width: calc(100vw - 30px); align-items: flex-start; }
  .weapons .action-hint { display: block; font-size: 11px; max-width: min(340px, calc(100vw - 30px)); text-align: left; }
  body[data-mode="quick"] .objective-card { width: min(250px, calc(100vw - 126px)); }
  body[data-mode="quick"] #mission-name { display: none; }
  body[data-mode="quick"] .time-left { position: absolute; top: 9px; right: 10px; display: block; margin: 0; font-size: 13px; }
  body[data-mode="quick"] .time-left::before { display: none; }
  body[data-mode="quick"] .objective-text { font-size: 11px; }
  body[data-mode="quick"] .strike-score { font-size: 8px; letter-spacing: 0; }
  body[data-mode="quick"] .weapons { top: calc(124px + var(--safe-top)); }
  body[data-mode="quick"] .messages { top: auto; bottom: calc(196px + var(--safe-bottom)); width: calc(100vw - 30px); }
  body[data-mode="quick"] .messages .coach { font-size: 11px; padding: 7px 10px; }
  body[data-mode="quick"] .warnings { top: 28%; }
}
@media (max-height: 500px) {
  .home { top: auto; bottom: calc(70px + var(--safe-bottom)); transform: none; }
  .home .eyebrow { margin-bottom: 10px; font-size: 8px; }
  .home h1 { font-size: 42px; }
  .home-actions { margin-top: 12px; }
  .quick-record { margin-top: 8px; font-size: 10px; }
  body[data-mode="quick"] .objective-card { width: min(280px, 38vw); }
  body[data-mode="quick"] .time-left { position: absolute; top: 8px; right: 10px; margin: 0; font-size: 14px; }
  body[data-mode="quick"] .objective-text { margin-top: 7px; }
  body[data-mode="quick"] .weapons { top: auto; bottom: calc(14px + var(--safe-bottom)); left: calc(88px + var(--safe-left)); transform: none; max-width: calc(100vw - 280px); }
  body[data-mode="quick"] .messages { top: calc(12px + var(--safe-top)); bottom: auto; left: 41%; transform: none; width: min(320px, 38vw); }
  body[data-mode="quick"] .messages .coach { font-size: 11px; }
  body[data-mode="quick"] .touch-controls { --small: 46px; --big: 64px; }
  body[data-mode="quick"] .warnings { top: 27%; }
}
@media (max-width: 400px) and (min-height: 501px) and (max-height: 700px) {
  body[data-mode="quick"] .weapons .action-hint { position: fixed; left: calc(12px + var(--safe-left)); right: calc(12px + var(--safe-right)); bottom: calc(196px + var(--safe-bottom)); max-width: none; margin: 0; }
}

/* Challenges: the board on the home screen and easy touch controls. */
.home-actions .challenges-open { width: auto; margin: 0; padding: 0 18px; min-height: 48px; border-color: rgba(255,162,74,.55); color: #ffd7ae; }
.challenge-list button { position: relative; overflow: hidden; }
.challenge-list button::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--time, #7fb6e0); }
.challenge-list button[data-time="noon"] { --time: #9fd4ff; }
.challenge-list button[data-time="dusk"] { --time: #ff9a62; }
.challenge-list button[data-time="golden"] { --time: #ffc46b; }
.challenge-list button[data-time="afternoon"] { --time: #b9c6d2; }
.challenge-list button[data-time="night"] { --time: #6f7cff; background: rgba(40,48,110,.18); }
.challenge-list .number { font-size: 18px; }
.challenge-list .name small { margin-top: 2px; line-height: 1.4; }
.challenge-list .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.challenge-list .tags i { font: 700 9px var(--sans); font-style: normal; letter-spacing: 1px; text-transform: uppercase; padding: 3px 7px; border-radius: 999px; border: 1px solid rgba(200,236,248,.25); color: #c9dde6; }
.challenge-list .tags i.length { color: var(--muted); border-style: dashed; }
/* Easy controls in Quick Strike and the challenges: one FIRE button does the
   bombs and missiles, flares fire themselves and the target is picked for you. */
body[data-mode="quick"][data-easy="true"] .touch-controls [data-action="missile"],
body[data-mode="quick"][data-easy="true"] .touch-controls [data-action="target"],
body[data-mode="quick"][data-easy="true"] .touch-controls [data-action="flare"] { display: none; }
body[data-easy="true"] .touch-big.bomb { --big: 88px; }
body[data-easy="true"] .touch-big.bomb[data-fire="missile"] { border-color: var(--hud); color: var(--hud); background: rgba(16,48,64,.85); }
@media (max-width: 720px), (max-height: 520px) { body[data-easy="true"] .touch-big.bomb { --big: 74px; } }

/* Phones: lessons, radio and hints stay out of the middle of the view, where
   the jet and the aim ring are. The lesson card is compact, sits low in
   portrait and up between the objective card and the buttons sideways; the
   radio and the action hint get their own rows so nothing stacks. */
body[data-input="touch"][data-mode="story"] .touch-hint { display: none; }
body[data-input="touch"] .gate { padding: 8px 12px 9px; }
body[data-input="touch"] .gate-kicker { font-size: 8px; letter-spacing: 1.6px; }
body[data-input="touch"] .gate-row { margin-top: 2px; }
body[data-input="touch"] .gate-row b { font-size: 17px; }
body[data-input="touch"] .gate-keys { font-size: 10px; }
body[data-input="touch"] .gate-keys .glyph { padding: 2px 8px; }
body[data-input="touch"] .gate-text { margin: 3px 0 6px; font-size: 12px; line-height: 1.35; }
body[data-input="touch"] .coach, body[data-input="touch"] .toast { padding: 7px 11px; font-size: 12px; line-height: 1.35; }
@media (max-width: 760px) {
  body[data-input="touch"] .radio { top: calc(216px + var(--safe-top)); }
  body[data-input="touch"]:not([data-mode="quick"]) .messages { top: auto; bottom: calc(268px + var(--safe-bottom)); width: calc(100vw - 24px); }
  body[data-input="touch"]:not([data-mode="quick"]) .warnings { top: calc(286px + var(--safe-top)); }
}
@media (max-height: 500px) {
  body[data-input="touch"] .radio { position: absolute; top: calc(88px + var(--safe-top)); left: calc(12px + var(--safe-left)); right: auto; width: min(250px, 34vw); padding: 0; justify-content: flex-start; }
  body[data-input="touch"]:not([data-mode="quick"]) .messages { top: calc(10px + var(--safe-top)); bottom: auto; left: calc(min(250px, 34vw) + 24px + var(--safe-left)); right: calc(150px + var(--safe-right)); width: auto; transform: none; }
  body[data-input="touch"]:not([data-mode="quick"]) .corner { bottom: calc(84px + var(--safe-bottom)); }
  body[data-input="touch"]:not([data-mode="quick"]) .weapons { top: auto; bottom: calc(10px + var(--safe-bottom)); left: 50%; transform: translateX(-50%); align-items: center; max-width: max(260px, calc(100vw - 440px - var(--safe-left) - var(--safe-right))); }
  body[data-input="touch"]:not([data-mode="quick"]) .weapons .action-hint { text-align: center; max-width: 100%; }
  body[data-input="touch"] .weapons .action-hint { font-size: 11px; padding: 5px 10px; }
}

/* ---- Home fit: the title block sits between the masthead and the footer at
   every window size. It scales with height as well as width, sheds the
   supporting lines on short windows, and the colon stays for screen readers. */
.title-colon { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (min-width: 761px) and (min-height: 501px) {
  .home h1 { font-size: clamp(44px, min(8.4vw, 13vh), 104px); letter-spacing: clamp(6px, min(1.3vw, 1.9vh), 14px); }
}
.header-actions .quiet { white-space: nowrap; }
@media (min-height: 501px) and (max-height: 760px) {
  .home .eyebrow { margin-bottom: 12px; }
  .home-copy { margin-top: 14px; }
  .home-facts { margin-top: 16px; }
  .home-actions { margin-top: 18px; }
  .home-note { display: none; }
}
@media (min-height: 501px) and (max-height: 560px) {
  .home-copy { display: none; }
}
@media (max-width: 480px) {
  .brand small { display: none; }
  .home-footer > span { display: none; }
  .home-footer { justify-content: flex-end; }
}

/* Phones in a story sortie: one message at a time. A lesson card hides the
   radio, the coach line and the action hint; the coach line hides the radio;
   the fly-to-the-ring hint that repeats the objective card is dropped; radio
   lines go once they are old. The lesson card is its title, the gesture and
   the progress bar. Sideways it sits below the flight buttons, not over them. */
@media (max-width: 760px), (max-height: 500px) {
  body[data-input="touch"] .gate-kicker,
  body[data-input="touch"] .gate-text,
  body[data-input="touch"] #mission-name,
  body[data-input="touch"] .radio li[data-old="true"],
  body[data-input="touch"] .action-hint[data-routine="true"],
  body[data-input="touch"] .hud:has(#gate:not([hidden])) .radio,
  body[data-input="touch"] .hud:has(#gate:not([hidden])) .action-hint,
  body[data-input="touch"] .hud:has(#gate:not([hidden])) #coach,
  body[data-input="touch"] .hud:has(#coach:not([hidden])) .radio { display: none; }
  body[data-input="touch"] .gate-row { margin-top: 0; }
  body[data-input="touch"] .gate-meter { margin-top: 7px; }
}
@media (max-height: 500px) {
  body[data-input="touch"]:not([data-mode="quick"]) .messages { top: calc(58px + var(--safe-top)); }
}
