/* Hoverslam: a recovery console. Graphite plates, machined keys, one signal orange.
   Layout: the flight scene on the left, a control panel on the right; a start screen covers both. */
:root {
  --hull: #0d1117;
  --console: #131820;
  --plate: #181e27;
  --plate-hi: #222a37;
  --seam: #2c3648;
  --ink: #e8ecf1;
  --dim: #8d99ab;
  --signal: #ff6a28;
  --signal-hi: #ff8a54;
  --pad: #4fe0a0;
  --alarm: #ff5148;
  --fuel: #8fd3ff;
  --display: "Big Shoulders Display", "Arial Narrow", "Helvetica Neue", sans-serif;
  --body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--hull); color: var(--ink); font: 15px/1.5 var(--body); }
body { touch-action: manipulation; }
.hidden { display: none !important; }
.app { display: grid; grid-template-columns: minmax(0, 1fr) 372px; height: 100%; }
.stage-wrap { position: relative; overflow: hidden; background: var(--hull); }
#stage { width: 100%; height: 100%; display: block; }
/* the scene gets a lens: a soft vignette and a little film grain */
.stage-wrap::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 46%, transparent 52%, rgba(2, 4, 8, 0.5) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light; opacity: 0.9;
}

/* ---------- keys and buttons ---------- */
button, select { font: 600 14px var(--body); color: var(--ink); }
button {
  background: linear-gradient(#2c3546, #232b39); border: 1px solid #3b4659; border-bottom-color: #151a22;
  border-radius: 5px; padding: 8px 15px; cursor: pointer; letter-spacing: 0.01em;
  box-shadow: 0 2px 0 #0a0d12, inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transition: transform 0.06s ease, box-shadow 0.06s ease, background 0.12s ease;
}
button:hover:not(:disabled) { background: linear-gradient(#364156, #2a3344); }
button:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 0 0 #0a0d12, inset 0 2px 4px rgba(0, 0, 0, 0.45); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible, .lvl-card:focus-visible { outline: 2px solid var(--signal-hi); outline-offset: 3px; }
button.primary {
  background: linear-gradient(#ff7b3b, #ec5c18); color: #1c0c04; border-color: #ff9d68; border-bottom-color: #a23a0b;
  box-shadow: 0 2px 0 #7a2906, inset 0 1px 0 rgba(255, 255, 255, 0.4); font-weight: 700;
}
button.primary:hover:not(:disabled) { background: linear-gradient(#ff8d53, #f26a28); }
button.primary:active:not(:disabled) { box-shadow: 0 0 0 #7a2906, inset 0 2px 4px rgba(90, 25, 0, 0.5); }
button.ghost { background: transparent; box-shadow: none; border-color: var(--seam); }
button.ghost:hover:not(:disabled) { background: var(--plate-hi); }
button.ghost:active:not(:disabled) { box-shadow: none; }
button.big { font-size: 17px; padding: 12px 28px; }
button.small { font-size: 13px; padding: 5px 12px; box-shadow: 0 1px 0 #0a0d12, inset 0 1px 0 rgba(255, 255, 255, 0.07); }
.textlink { background: none; border: none; box-shadow: none; padding: 4px 0; color: var(--dim); font-weight: 500; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--seam); }
.textlink:hover:not(:disabled) { background: none; color: var(--ink); text-decoration-color: var(--signal); }
.textlink:active:not(:disabled) { transform: none; box-shadow: none; }
select { background: var(--plate); border: 1px solid var(--seam); border-radius: 5px; padding: 6px 10px; }
kbd, .cap {
  display: inline-block; min-width: 28px; text-align: center; padding: 2px 8px 3px; margin-right: 4px;
  border: 1px solid #3b4659; border-bottom: 3px solid #121720; border-radius: 5px;
  font: 600 13px/1.2 var(--body); background: linear-gradient(#2e3748, #252d3b); color: var(--ink);
}
.cap.wide { min-width: 76px; }

/* ---------- readouts over the scene ---------- */
.hud { position: absolute; pointer-events: none; text-shadow: 0 1px 8px rgba(3, 5, 9, 0.8); }
.top-left { top: 18px; left: 22px; }
.top-right { top: 18px; right: 22px; text-align: right; }
.tele { display: grid; grid-template-columns: repeat(3, 112px); gap: 10px 14px; }
.tele div { display: flex; flex-direction: column; }
.tele label, .bar label { font-size: 12px; color: var(--dim); }
.tele b { font: 700 32px/1.02 var(--display); letter-spacing: 0.01em; font-variant-numeric: tabular-nums; }
.tele i { font-style: normal; font-size: 12px; color: var(--dim); }
.tele b.warn { color: var(--alarm); }
.tele b.ok { color: var(--pad); }
.bars { margin-top: 14px; display: grid; gap: 8px; width: 364px; }
.bar { display: grid; grid-template-columns: 60px 1fr 78px; align-items: center; gap: 10px; }
.bar span { position: relative; height: 6px; background: rgba(141, 153, 171, 0.2); border-radius: 1px; }
.bar em { display: block; height: 100%; width: 0; background: var(--signal); transition: width 0.08s linear; }
.bar.fuel em { background: var(--fuel); }
.bar.fuel.leaking em { background: var(--alarm); animation: pulse 0.5s ease-in-out infinite alternate; }
.bar b { font: 700 16px var(--display); font-variant-numeric: tabular-nums; text-align: right; }
.hover-mark { position: absolute; top: -4px; width: 2px; height: 14px; margin-left: -1px; background: var(--ink); }
.faults { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; max-width: 380px; }
.fault { font-size: 12px; padding: 3px 9px; border-radius: 3px; border: 1px solid rgba(255, 81, 72, 0.6); color: #ffcfca; background: rgba(70, 14, 12, 0.6); }
.fault.warn { border-color: rgba(255, 106, 40, 0.65); color: #ffd8c2; background: rgba(66, 28, 8, 0.6); }
.flags { margin-top: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.flag { font-size: 12px; padding: 2px 9px; border: 1px solid var(--seam); border-radius: 3px; color: var(--dim); background: rgba(13, 17, 23, 0.55); }
.flag.on { color: #ffd8c2; border-color: rgba(255, 106, 40, 0.7); }
.flag.good { color: #c9f7e0; border-color: rgba(79, 224, 160, 0.65); }
.flag.auto { color: #d2e5ff; border-color: rgba(143, 211, 255, 0.55); }
.clock { font: 700 32px/1 var(--display); font-variant-numeric: tabular-nums; }
.wind { color: var(--dim); margin-top: 6px; }
.wind b { color: var(--ink); font-variant-numeric: tabular-nums; }
#wind-arrow { display: inline-block; color: var(--fuel); transition: transform 0.3s; }
.level-tag { margin-top: 4px; color: var(--dim); font-size: 13px; }

.cue { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); font: 800 38px/1 var(--display); letter-spacing: 0.02em; color: var(--signal-hi); pointer-events: none; text-shadow: 0 2px 14px rgba(3, 5, 9, 0.8); animation: pulse 0.6s ease-in-out infinite alternate; }
.caption { position: absolute; left: 50%; top: 24%; transform: translateX(-50%); font: 900 84px/1 var(--display); letter-spacing: 0.01em; color: var(--pad); pointer-events: none; text-shadow: 0 2px 18px rgba(3, 5, 9, 0.75); opacity: 0; }
.caption.warn { color: var(--signal-hi); }
.caption.pop { animation: pop 1.5s ease-out forwards; }
@keyframes pop { 0% { opacity: 0; transform: translateX(-50%) scale(1.5); } 14% { opacity: 1; transform: translateX(-50%) scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translateX(-50%) scale(0.98); } }
@keyframes pulse { from { opacity: 0.55; } to { opacity: 1; } }
#minimap { position: absolute; left: 22px; bottom: 22px; width: 180px; height: 110px; border: 1px solid var(--seam); border-radius: 3px; background: rgba(13, 17, 23, 0.62); }

/* ---------- plates over the scene: the briefing and the result ---------- */
.outcome, .intro {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center;
  width: min(560px, calc(100% - 32px)); padding: 28px 34px;
  background: rgba(16, 20, 28, 0.95); border: 1px solid var(--seam);
  clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px));
}
.outcome { left: 58%; top: 45%; padding: 22px 30px; animation: rise 0.3s ease-out; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, -46%); } to { opacity: 1; transform: translate(-50%, -50%); } }
.o-title, .i-title { font: 800 56px/0.95 var(--display); letter-spacing: 0.005em; text-wrap: balance; }
.outcome .o-title { font-size: 50px; }
.o-title.good { color: var(--pad); }
.o-title.bad { color: var(--alarm); }
.o-sub, .i-sub { color: var(--dim); margin: 12px auto 10px; max-width: 46ch; }
.o-sub { margin-bottom: 16px; }
.i-kicker, .o-scn { font-size: 13px; color: var(--dim); margin-bottom: 8px; }
.i-faults { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 18px 0 0; }
.i-faults:empty { display: none; }
.i-rule { color: var(--dim); font-size: 13px; margin: 0 auto 18px; max-width: 46ch; }
.i-hint { color: var(--dim); font-size: 12.5px; margin-top: 14px; }
.o-stats { display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: center; margin-bottom: 18px; }
.o-stats div { display: flex; flex-direction: column; }
.o-stats label { font-size: 12px; color: var(--dim); }
.o-stats b { font: 700 24px var(--display); font-variant-numeric: tabular-nums; }
.o-stats b.ok { color: var(--pad); }
.o-stats b.warn { color: var(--alarm); }
.o-actions { display: flex; gap: 12px; justify-content: center; }

/* ---------- the control panel ---------- */
.panel { background: var(--console); border-left: 1px solid var(--seam); padding: 18px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; }
.wm { font: 900 26px/1 var(--display); letter-spacing: 0.01em; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row label, .check { color: var(--dim); display: inline-flex; align-items: center; gap: 8px; }
.controls { padding: 14px 0 6px; border-top: 2px dashed var(--seam); position: sticky; bottom: -18px; margin-top: auto; background: var(--console); z-index: 2; } /* painted deck line, always in reach */
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; background: #0a0d12; padding: 4px; border-radius: 6px; border: 1px solid #1c2330; }
.tab { border: none; background: transparent; box-shadow: none; padding: 8px 6px; color: var(--dim); border-radius: 4px; }
.tab:hover:not(:disabled) { background: #161c26; }
.tab.active { background: linear-gradient(#2e3748, #252d3b); color: var(--ink); box-shadow: 0 1px 0 #05070a, inset 0 1px 0 rgba(255, 255, 255, 0.08); }
.pane p { margin: 0 0 10px; }
.muted { color: var(--dim); font-size: 14px; }
.levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.level { font: 800 20px var(--display); padding: 9px 0 10px; letter-spacing: 0.02em; }
.level.active { background: linear-gradient(#ff7b3b, #ec5c18); color: #1c0c04; border-color: #ff9d68; border-bottom-color: #a23a0b; box-shadow: 0 2px 0 #7a2906, inset 0 1px 0 rgba(255, 255, 255, 0.4); }
.keys { list-style: none; padding: 0; margin: 4px 0 12px; display: grid; gap: 8px; }
.keys li { display: grid; grid-template-columns: 104px 1fr; gap: 10px; align-items: center; color: var(--ink); }
.keys .caps { display: flex; }
.check { font-size: 14px; margin-bottom: 10px; align-items: flex-start; }
.check input { margin-top: 4px; accent-color: var(--signal); }
.best { font-size: 14px; color: #c9f7e0; }

.run-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.group { font: 800 20px var(--display); letter-spacing: 0.02em; margin: 18px 0 8px; }
.slider { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 0; border-top: 1px solid var(--seam); }
.slider label { font-weight: 600; }
.slider output { text-align: right; font: 700 19px var(--display); font-variant-numeric: tabular-nums; color: var(--signal-hi); }
.slider input { grid-column: 1 / -1; width: 100%; accent-color: var(--signal); margin: 6px 0 4px; }
.slider .what { grid-column: 1 / -1; color: var(--dim); font-size: 14px; margin: 0; }
.slider details { grid-column: 1 / -1; font-size: 14px; color: var(--dim); margin-top: 4px; }
.slider summary { cursor: pointer; color: #c3cedd; }
.slider details p { margin: 6px 0 0; }
.slider.flash { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: rgba(255, 106, 40, 0.22); } to { background: transparent; } }

.report:empty, .result:empty { display: none; }
.report { border: 1px solid var(--seam); border-radius: 3px; padding: 14px; background: #0f131a; }
.report-head { display: flex; justify-content: space-between; align-items: baseline; }
.report-head b { font: 800 28px var(--display); }
.report-head.good b { color: var(--pad); }
.report-head.bad b { color: var(--alarm); }
.report-head span { color: var(--dim); }
.report .group { margin-top: 12px; }
.finding { padding: 10px 0; border-top: 1px solid var(--seam); }
.finding h4 { margin: 0 0 4px; font-size: 15px; }
.finding.main h4 { color: var(--signal-hi); }
.finding p { margin: 0; color: #c3cedd; font-size: 14px; }
.fixes { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.fix { font-size: 13px; padding: 5px 10px; }
.events { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 14px; color: #c3cedd; }
.events li { display: grid; grid-template-columns: 76px 1fr; gap: 6px; }
.events .t { color: var(--dim); font-variant-numeric: tabular-nums; }
.result { display: grid; gap: 6px; }
.summary { font-weight: 700; }
.flight-chip { display: grid; grid-template-columns: 64px 1fr auto; gap: 8px; text-align: left; padding: 7px 10px; font-size: 14px; font-weight: 500; }
.flight-chip.good { border-bottom-color: rgba(79, 224, 160, 0.7); }
.flight-chip.bad { border-bottom-color: rgba(255, 81, 72, 0.6); }
.flight-chip b { font-variant-numeric: tabular-nums; }
.foot { margin-top: auto; color: var(--dim); font-size: 12.5px; }

/* ---------- the start screen: a live landing behind, three views over it ---------- */
.start[data-view="how"], .start[data-view="levels"] { background: rgba(8, 11, 16, 0.93); } /* the live landing fades back behind the reading screens */
.vhead { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; max-width: 1180px; margin-bottom: 26px; }
.vhead .lede { margin-bottom: 0; }
.vhead .nav { margin: 0; }
.start { position: fixed; inset: 0; z-index: 40; overflow-y: auto; color: var(--ink); transition: background 0.3s ease; background: linear-gradient(90deg, rgba(8, 11, 16, 0.94) 0%, rgba(8, 11, 16, 0.78) 38%, rgba(8, 11, 16, 0.12) 72%, transparent 100%); }
.view { min-height: 100%; padding: clamp(24px, 5vw, 64px); display: flex; flex-direction: column; justify-content: center; }
.view[data-view="welcome"] { justify-content: space-between; }
.welcome { max-width: 600px; margin: auto 0; }
.wordmark { margin: 0; font: 900 clamp(80px, 13vw, 168px)/0.82 var(--display); letter-spacing: -0.005em; }
.pitch { font-size: 20px; line-height: 1.45; color: #cfd6e0; max-width: 34ch; margin: 28px 0 32px; }
.menu-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.fine { color: var(--dim); font-size: 12.5px; max-width: 70ch; margin: 0; }
.view h2 { font: 900 clamp(40px, 5vw, 64px)/0.95 var(--display); margin: 0 0 6px; }
.view .lede { color: var(--dim); margin: 0 0 28px; max-width: 58ch; }
.how { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 36px; align-items: start; max-width: 1180px; }
.how .plate, .how-figs { min-width: 0; }
.how-figs { display: grid; gap: 18px; }
figure { margin: 0; }
figcaption { color: var(--dim); font-size: 13px; margin-top: 6px; }
.diagram { width: 100%; height: auto; display: block; background: #0f131a; border: 1px solid var(--seam); }
.d-fall { stroke: #c9d3e2; stroke-width: 2; stroke-dasharray: 5 6; fill: none; }
.d-burn { stroke: var(--signal-hi); stroke-width: 3; fill: none; }
.d-pad { fill: var(--pad); }
.d-mark circle { fill: #10141c; stroke: var(--ink); stroke-width: 1.5; }
.d-mark text { fill: var(--ink); font: 800 15px var(--display); }
.d-rocket rect { fill: #eef1f6; }
.d-flame { fill: var(--signal-hi); }
.d-leg { stroke: #eef1f6; stroke-width: 2; fill: none; }
.d-axis, .g-tick, .g-axis, .g-note { fill: #aab5c6; font: 500 12px var(--body); }
.g-note { paint-order: stroke; stroke: #0f131a; stroke-width: 4px; stroke-linejoin: round; }
.g-grid { stroke: #232c3b; stroke-width: 1; }
.g-aim { stroke: var(--fuel); stroke-width: 2; fill: none; stroke-dasharray: 2 5; }
.g-pilot { stroke: var(--signal-hi); stroke-width: 3; fill: none; }
.g-dot { fill: var(--signal-hi); stroke: #0f131a; stroke-width: 2; }
.g-safe { fill: rgba(79, 224, 160, 0.28); }
.g-aimnote { fill: var(--fuel); }
.g-safenote { fill: var(--pad); }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0 0 22px; display: grid; gap: 16px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 38px 1fr; gap: 12px; }
.steps li::before { content: counter(s); font: 800 22px/34px var(--display); width: 34px; height: 34px; text-align: center; border: 1.5px solid var(--ink); border-radius: 50%; }
.steps b { display: block; font: 800 22px/1.1 var(--display); letter-spacing: 0.01em; margin-bottom: 2px; }
.steps span { color: #c3cedd; }
.how .keys { margin: 0 0 18px; }
.limits { border-top: 2px dashed var(--seam); padding-top: 14px; color: #c3cedd; }
.limits b { color: var(--pad); font-weight: 600; }
.nav { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; align-items: center; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 380px)); gap: 26px; margin-top: 8px; }
.lvl-card {
  display: flex; flex-direction: column; text-align: left; padding: 0; background: var(--plate); border: 1px solid var(--seam); border-radius: 0; box-shadow: none; color: var(--ink);
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 0 100%); transition: transform 0.12s ease, background 0.12s ease;
}
.lvl-card:hover:not(:disabled) { background: var(--plate-hi); transform: translateY(-5px); }
.lvl-card:active:not(:disabled) { transform: translateY(-1px); box-shadow: none; }
.lvl-card .thumb { display: block; width: 100%; height: auto; }
.lvl-card .body { padding: 16px 18px 18px; display: grid; gap: 6px; }
.lvl-card .nm { font: 900 38px/0.95 var(--display); letter-spacing: 0.01em; }
.lvl-card .tg { font-weight: 600; font-size: 15px; line-height: 1.35; }
.lvl-card .dt { color: var(--dim); font-weight: 400; font-size: 14px; line-height: 1.4; }
.lvl-card .pr { margin-top: 6px; padding-top: 10px; border-top: 1px dashed var(--seam); color: var(--dim); font-size: 13px; font-weight: 500; }
.lvl-card .pr b { color: var(--pad); font-weight: 600; }
.lvl-card:hover .nm { color: var(--signal-hi); }
body.in-menu .app { grid-template-columns: minmax(0, 1fr); }
body.in-menu .panel, body.in-menu .hud, body.in-menu #minimap, body.in-menu .touch, body.in-menu #intro, body.in-menu .outcome, body.in-menu .caption, body.in-menu .cue { display: none !important; }

/* ---------- phones and tablets: the game fills the screen, thumbs get two clusters ---------- */
.touch { display: none; position: absolute; left: max(12px, env(safe-area-inset-left)); right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); justify-content: space-between; align-items: flex-end; pointer-events: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.touch .pad { display: flex; gap: 10px; pointer-events: auto; }
.touch button { width: 78px; height: 78px; padding: 0; font-size: 15px; line-height: 1.15; border-radius: 8px; touch-action: none; -webkit-tap-highlight-color: transparent; opacity: 0.94; }
.touch button.engine { width: 96px; font-weight: 700; background: linear-gradient(#ff7b3b, #ec5c18); color: #1c0c04; border-color: #ff9d68; border-bottom-color: #a23a0b; box-shadow: 0 2px 0 #7a2906, inset 0 1px 0 rgba(255, 255, 255, 0.4); }
@media (pointer: coarse) { .touch { display: flex; } }
@media (max-width: 1100px) {
  .how { grid-template-columns: minmax(0, 1fr); }
  .cards { grid-template-columns: minmax(0, 1fr); max-width: 420px; }
}
@media (max-width: 900px), (pointer: coarse) and (max-height: 540px) {
  .app { grid-template-columns: 1fr; height: auto; }
  .stage-wrap { height: 70vh; height: 70dvh; min-height: 460px; }
  .top-left { left: 14px; top: 10px; }
  .top-right { right: 14px; top: 10px; }
  .tele { grid-template-columns: repeat(3, 76px); gap: 2px 8px; }
  .tele label, .tele i { font-size: 11px; }
  .tele b { font-size: 22px; }
  .bars { width: 250px; margin-top: 6px; gap: 4px; }
  .bar { grid-template-columns: 50px 1fr 62px; }
  .bar label { font-size: 11px; }
  .bar b { font-size: 14px; }
  .flags { display: none; }
  .clock { font-size: 22px; }
  .wind, .level-tag { font-size: 12px; margin-top: 2px; }
  .cue { top: 30%; font-size: 28px; text-align: center; width: 90%; }
  #minimap { display: none; }
  .panel { border-left: none; border-top: 1px solid var(--seam); padding: 16px; }
  .o-title, .i-title { font-size: 40px; }
  .outcome, .intro { padding: 20px 22px; top: 44%; }
  .outcome { left: 50%; }
  .o-stats { gap: 6px 14px; }
  .start { background: linear-gradient(180deg, rgba(8, 11, 16, 0.9), rgba(8, 11, 16, 0.7)); }
}
@media (max-width: 480px) {
  .touch .pad { gap: 8px; }
  .touch button { width: 60px; height: 70px; padding: 0 4px; font-size: 12px; line-height: 1.2; white-space: normal; }
  .touch button.engine { width: 78px; }
  .keys li { grid-template-columns: 92px 1fr; }
}
@media (pointer: coarse) and (max-height: 540px) {
  .stage-wrap { height: 100vh; height: 100dvh; min-height: 0; }
  .touch button { width: 64px; height: 64px; font-size: 13px; }
  .touch button.engine { width: 82px; }
  .tele { grid-template-columns: repeat(6, 64px); }
  .tele b { font-size: 19px; }
  .bars { width: 220px; }
  .outcome, .intro { top: 50%; padding: 14px 20px; }
  .i-sub, .o-sub { margin: 6px auto 10px; font-size: 13px; }
  .o-title, .i-title { font-size: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .cue, .outcome, .slider.flash, .caption.pop, .bar.fuel.leaking em { animation: none; }
  .caption.pop { opacity: 1; }
  .lvl-card, button { transition: none; }
}

/* ---------- entry: the page opens inside fog, which thins out and clears to show the welcome ---------- */
.fog { position: fixed; inset: 0; z-index: 60; pointer-events: none; overflow: hidden; }
.fog-base { position: absolute; inset: 0; background: rgba(240, 244, 250, 0.5); }
.fog svg { position: absolute; top: -5%; height: 110%; width: 150%; will-change: transform, opacity; }
.fog-a { left: -25%; }
.fog-b { left: -25%; }
.fog-a, .fog-b { filter: none; }
body.go .fog { animation: fog-out 1.4s ease-in 0.8s forwards; }
body.go .fog-base { animation: fog-thin 1.8s ease-out 0.3s forwards; }
body.go .fog-a { animation: drift-a 2.4s cubic-bezier(0.3, 0.1, 0.3, 1) forwards; }
body.go .fog-b { animation: drift-b 2.4s cubic-bezier(0.3, 0.1, 0.3, 1) forwards; }
@keyframes fog-out { to { opacity: 0; visibility: hidden; } }
@keyframes fog-thin { to { opacity: 0; } }
@keyframes drift-a { to { transform: translateX(-22%) scale(1.25); } }
@keyframes drift-b { to { transform: translateX(22%) scale(1.3); } }
body.boot .welcome > *, body.boot .fine { opacity: 0; }
body.boot.go .welcome > *, body.boot.go .fine { animation: rise-in 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }
body.boot.go .welcome > :nth-child(1) { animation-delay: 0.7s; }
body.boot.go .welcome > :nth-child(2) { animation-delay: 0.85s; }
body.boot.go .welcome > :nth-child(3) { animation-delay: 1s; }
body.boot.go .welcome > :nth-child(4) { animation-delay: 1.1s; }
body.boot.go .fine { animation-delay: 1.3s; }
@keyframes rise-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .fog { display: none; } body.boot .welcome > *, body.boot .fine { opacity: 1; } }

/* ---------- bug-report link ---------- */
.bugs { color: var(--dim); font-size: 13px; text-decoration: none; }
.bugs u { color: var(--ink); text-decoration-color: var(--signal); text-underline-offset: 3px; }
.bugs:hover u { color: var(--signal); }
.bugs.corner { position: fixed; right: 22px; bottom: 18px; z-index: 50; display: none; }
body.in-menu .bugs.corner { display: block; }
@media (max-width: 700px) { .bugs.corner { right: 14px; bottom: 12px; font-size: 12px; } }

/* sound and music toggles: icon buttons. Top left of the start screen, in line with its text; beside the minimap in a flight */
.sound { position: fixed; left: clamp(24px, 5vw, 64px); top: 22px; z-index: 55; display: flex; gap: 8px; }
.sound button { width: 38px; height: 34px; padding: 0; display: grid; place-items: center; }
.sound svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sound button[aria-pressed="false"] { color: var(--dim); }
body:not(.in-menu) .sound { left: 218px; top: auto; bottom: 22px; }
@media (max-width: 700px) {
  .sound { left: auto; right: 12px; top: 12px; }
  body:not(.in-menu) .sound { right: 12px; top: 78px; bottom: auto; flex-direction: column; align-items: flex-end; }
}
