/* Gravity Escape: Shuttle flight deck.
   You sit on the flight deck. The flight is the view through a big forward window
   (drawn by js/scene.js); you fly it from a Space Shuttle style dashboard: a black
   multi-function display (MFD) with edge keys, an attitude ball, tape meters for
   altitude and fuel, caution-and-warning style grade lights, and backlit throttle
   push-buttons. Deliberately single (dark) theme. */
:root {
  color-scheme: dark;
  /* flight deck panels */
  --panel: #4b5257;
  --panel-hi: #5d656b;
  --panel-dk: #2e3337;
  --bezel: #1d2023;
  --screw: #8b9399;
  --frame: #2b3034;
  --label: #e8eaea;
  --muted: #b8bfc4;
  --ink: #0d0f11;
  /* MFD screen (Shuttle glass-cockpit colours) */
  --screen: #05080a;
  --scr-white: #f2f5f7;
  --scr-green: #6dff9c;
  --scr-cyan: #5fe3ff;
  --scr-magenta: #ff6ad5;
  --scr-yellow: #ffd23f;
  --alert: #ff6b4a;
  /* accents */
  --red: #b13e53;
  --orange: #ef7d57;
  --yellow: #ffd166;
  --lime: #a7f070;
  --sky: #8fd3ff;
  --blue: #4f8fe0;
  --grey: #94b0c2;
  --white: #f4f4f4;

  --win-h: clamp(200px, 37vh, 480px);          /* forward window height */
  --font-label: "Silkscreen", "Courier New", monospace;
  --font-display: "Jersey 10", "Courier New", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--panel);
  color: var(--label);
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.1;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.hidden { display: none !important; }
button { font-family: var(--font-label); }
:focus-visible { outline: 3px solid var(--scr-yellow); outline-offset: 2px; }
@keyframes blink { 50% { opacity: .35; } }

/* ───────── Flight deck layout ───────── */
/* The deck is sized to the *visible* viewport (js keeps --app-h/--app-top in step with
   the on-screen keyboard), and the window grows to fill whatever the dashboard leaves. */
#cockpit {
  position: fixed; left: 0; right: 0; top: var(--app-top, 0px); height: var(--app-h, 100dvh);
  overflow-x: hidden; overflow-y: auto;
  display: flex; flex-direction: column; align-items: center;
  background: var(--panel);
  padding: 0 0 calc(10px + env(safe-area-inset-bottom, 0px));
}
#cockpit > #hud, #cockpit > .title-console { padding-left: max(10px, env(safe-area-inset-left, 0px)); padding-right: max(10px, env(safe-area-inset-right, 0px)); }
.bulkhead {
  position: relative; flex: 1 0 auto; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: var(--panel-hi); border-bottom: 5px solid var(--panel-dk);
  padding: calc(6px + env(safe-area-inset-top, 0px)) max(10px, env(safe-area-inset-right, 0px)) 10px max(10px, env(safe-area-inset-left, 0px));
}
/* Strip above the window: caution lights, the ship's plate, pause and sound */
.deck-strip { width: 100%; max-width: 760px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plate-top { margin: 0; font-family: var(--font-label); font-size: 9px; letter-spacing: .1em; color: var(--label); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.anns { display: flex; gap: 3px; flex: none; }
.ann {
  font-family: var(--font-label); font-size: 7px; line-height: 1; padding: 3px 4px; white-space: nowrap;
  color: #6b7378; background: var(--bezel); border: 1px solid var(--ink);
}
.ann.on.warn { color: var(--white); background: #d6323a; box-shadow: 0 0 8px #ff4a4a; animation: pulse 1.4s ease-in-out infinite; }
.ann.on.go { color: var(--ink); background: var(--scr-green); box-shadow: 0 0 6px rgba(109,255,156,.6); }
.ann.on.amber { color: var(--ink); background: var(--scr-yellow); }
.ann.on-dim { color: #2f8a52; }
.deck-keys { display: flex; gap: 6px; flex: none; }
.deck-keys .icon-btn { padding: 4px 7px; min-width: 34px; font-size: 9px; }
@keyframes pulse { 50% { opacity: .55; } }

/* The forward window: a wide, slightly tapered Shuttle-style window in a bolted frame */
.window {
  position: relative; width: 100%; max-width: 760px; flex: 1 1 0; min-height: 150px; max-height: 72vh;
  background: var(--frame); padding: 9px; border-radius: 6px;
  box-shadow: inset 0 0 0 1px #3a4045, 0 3px 0 rgba(0,0,0,.3);
}
.bolt { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--screw); }
.b1 { left: 2px; top: 2px; } .b2 { left: 50%; top: 2px; } .b3 { right: 2px; top: 2px; } .b4 { left: 2px; top: 50%; }
.b5 { right: 2px; top: 50%; } .b6 { left: 2px; bottom: 2px; } .b7 { left: 50%; bottom: 2px; } .b8 { right: 2px; bottom: 2px; }
#glass {
  position: relative; width: 100%; height: 100%; overflow: hidden; background: #a8cbe6; border-radius: 3px;
}
#sky { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
/* stencilled labels on the window frame */
.wlabel { position: absolute; z-index: 2; font-style: normal; font-family: var(--font-label); font-size: 6px; line-height: 1; color: #9aa2a8; letter-spacing: .08em; }
.wl1 { left: 4%; bottom: 1px; }
.wl2 { left: 14%; top: 1px; color: var(--scr-yellow); opacity: .7; }
/* the glass: darker toward the edges, a faint reflection of the dash lights along the bottom */
#glass::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to top, rgba(255,210,63,.07), rgba(255,210,63,0) 14%),
    radial-gradient(ellipse 75% 85% at 50% 45%, rgba(0,0,0,0) 62%, rgba(0,0,0,.28) 100%);
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.45);
}
.glare {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(118deg, rgba(255,255,255,.07) 0%, rgba(255,255,255,.02) 22%, rgba(255,255,255,0) 40%);
}
#crack { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.window.alarm { animation: alarm 1.2s ease-in-out infinite; }
@keyframes alarm { 50% { background: #a3262c; } }

/* Emergency: a big master-alarm style button that appears on the glass when fuel is critical */
.emergency {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 7;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-family: var(--font-label); font-size: 15px; letter-spacing: .08em; color: var(--white); cursor: pointer;
  background: #c0262d; border: 3px solid #ffd2cf; padding: 12px 18px;
  box-shadow: 0 0 0 3px var(--ink), 0 0 18px rgba(255,60,50,.8);
  animation: emerg 1.1s ease-in-out infinite;
}
.emergency small { font-size: 8px; letter-spacing: .04em; color: #ffe1de; }
.emergency:active { transform: translate(-50%, -48%); }
@keyframes emerg { 50% { background: #e8424a; box-shadow: 0 0 0 3px var(--ink), 0 0 34px rgba(255,80,70,1); } }

/* CCTV picture-in-picture: an external camera on the rocket, shown at flight events */
.cctv {
  position: absolute; left: 14px; top: 12px; width: 27%; max-width: 200px; aspect-ratio: 4 / 3; z-index: 4;
  background: var(--bezel); padding: 4px; border: 2px solid var(--screw); box-shadow: 0 4px 0 rgba(0,0,0,.35);
}
.cctv canvas { display: block; width: 100%; height: 100%; }

/* Big call-outs float over the window */
#banner {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-family: var(--font-label); font-size: clamp(20px, 6vw, 32px); text-align: center; line-height: 1.2;
  opacity: 0; pointer-events: none; z-index: 5; width: max-content; max-width: 92%;
  text-shadow: 3px 3px 0 var(--ink), -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink);
}
#banner.show { opacity: 1; animation: pop .3s steps(3); }
@keyframes pop { from { transform: translate(-50%, -50%) scale(.6); } to { transform: translate(-50%, -50%) scale(1); } }
#banner small { display: block; font-size: .42em; margin-top: 8px; }

/* Flight events: a compact hazard-striped label along the bottom of the window */
#ribbon {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); width: max-content; max-width: 92%;
  z-index: 6; pointer-events: none; opacity: 0; transition: opacity .3s ease;
}
#ribbon.show { opacity: 1; }
#ribbon::before, #ribbon::after {
  content: ""; display: block; height: 5px;
  background: repeating-linear-gradient(45deg, var(--scr-yellow) 0 8px, var(--ink) 8px 16px);
}
.rb-in { background: rgba(13,15,17,.88); padding: 5px 14px 4px; display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; }
.rb-title { font-family: var(--font-label); font-size: clamp(13px, 4vw, 17px); }
.rb-sub { font-family: var(--font-label); font-size: 8px; color: var(--white); }

/* ───────── Dashboard: one multi-function display ───────── */
#hud, .title-console { width: 100%; max-width: 480px; }
.console { display: flex; flex-direction: column; gap: 10px; padding-top: 10px; }
#question-panel.shake { animation: shake .25s ease-out; }
@keyframes shake { 30% { transform: translateX(-4px); } 65% { transform: translateX(3px); } }
#question-panel.done #answer-form, #question-panel.done .ovr,
#question-panel.done .event, #question-panel.done .combo { visibility: hidden; }

.mfd {
  background: var(--bezel); padding: 6px 12px 8px; border: 2px solid var(--ink); box-shadow: inset 0 0 0 2px var(--panel-dk);
  /* four screws in the bezel corners */
  --scr: radial-gradient(circle, #8b9399 0 1.6px, #3a4045 2px, transparent 2.6px);
  background-image: var(--scr), var(--scr), var(--scr), var(--scr);
  background-size: 10px 10px; background-repeat: no-repeat;
  background-position: 1px 1px, calc(100% - 1px) 1px, 1px calc(100% - 1px), calc(100% - 1px) calc(100% - 1px);
}
.mfd-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-family: var(--font-label); font-size: 9px; color: var(--muted); padding: 0 2px 5px; }
.d-score { color: var(--muted); }
.d-score b { color: var(--scr-white); font-weight: 400; }
/* Every row of the display has a fixed height, so nothing jumps about as the text changes. */
.display {
  background: var(--screen); border: 2px solid var(--ink); padding: 8px 10px;
  color: var(--scr-white); display: flex; flex-direction: column; gap: 6px;
}
.sputter .display { box-shadow: inset 0 0 0 2px var(--alert); }
.d-meta { display: flex; align-items: center; gap: 6px; height: 22px; min-width: 0; }
.chip { font-family: var(--font-label); font-size: 9px; color: var(--ink); background: var(--scr-magenta); padding: 3px 5px; white-space: nowrap; flex: none; }
.chip.event { background: var(--scr-yellow); flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.chip.event.calm { background: var(--scr-cyan); }
.chip.combo { background: var(--scr-cyan); }
.lv { display: inline-flex; gap: 2px; margin-left: 3px; }
.lv i { width: 5px; height: 5px; background: rgba(13,15,17,.3); }
.lv i.on { background: var(--ink); }
/* Overdrive: one optional switch instead of a row of throttle buttons */
.ovr {
  margin-left: auto; flex: none; font-size: 9px; letter-spacing: .06em; cursor: pointer;
  color: #ff8a52; background: transparent; border: 2px solid #ff8a52; padding: 3px 7px;
}
.ovr[aria-pressed="true"] { color: var(--ink); background: #ff8a52; box-shadow: 0 0 12px rgba(255,138,82,.7); }
.ovr:disabled { opacity: .4; cursor: default; }
#q-text {
  font-family: var(--font-display); font-weight: 400; font-size: clamp(25px, 6.8vw, 32px); line-height: .95; margin: 0;
  text-transform: uppercase; text-wrap: balance; height: 1.9em; display: flex; align-items: center; overflow: hidden;
}
#answer-form { display: flex; gap: 6px; align-items: center; height: 40px; }
.prompt { font-size: 30px; color: var(--scr-green); }
#answer-input {
  flex: 1; min-width: 0; font-family: var(--font-display); font-size: 30px; color: var(--scr-green); text-transform: uppercase;
  background: transparent; border: 0; border-bottom: 2px dashed #2f6b44; padding: 0 4px; outline: none; border-radius: 0; caret-color: var(--scr-green);
}
#answer-input::placeholder { color: #3f7f57; text-transform: none; }
#answer-input:focus { border-bottom-color: var(--scr-green); }
#answer-input:disabled { opacity: .5; }
.fire-btn, .scan-btn { flex: none; height: 38px; cursor: pointer; font-family: var(--font-label); letter-spacing: .06em; border: 2px solid var(--ink); }
.fire-btn { font-size: 13px; padding: 0 14px; color: var(--ink); background: var(--scr-green); box-shadow: inset 0 -3px 0 rgba(0,0,0,.25); }
.fire-btn.armed { background: #ff8a52; }
.scan-btn { font-size: 10px; padding: 0 9px; color: var(--scr-cyan); background: transparent; border-color: var(--scr-cyan); }
.fire-btn:disabled, .scan-btn:disabled { opacity: .4; cursor: default; }

#feedback { height: 2.1em; font-size: 19px; line-height: 1.05; overflow: hidden; color: var(--scr-cyan); }
#feedback.bad { color: var(--alert); }
#feedback.good { color: var(--scr-green); }
#feedback.hint { color: var(--scr-yellow); }
#feedback b { font-weight: 400; color: var(--scr-white); }
.fb-grade { font-family: var(--font-label); font-size: 13px; }
.fb-pts { color: var(--scr-green); }
.tier { font-family: var(--font-label); font-size: 9px; padding: 2px 5px; color: var(--ink); }
.t-fumes { background: var(--grey); } .t-kerosene { background: var(--sky); }
.t-hydrogen { background: var(--lime); } .t-plasma { background: var(--yellow); }
.t-antimatter { background: var(--orange); box-shadow: 0 0 0 2px var(--red); }
.g-fumes { color: var(--grey); } .g-kerosene { color: var(--sky); } .g-hydrogen { color: var(--lime); }
.g-plasma { color: var(--yellow); } .g-antimatter { color: var(--orange); }

.icon-btn {
  font-size: 10px; color: var(--label); background: var(--panel-dk); cursor: pointer;
  border: 2px solid var(--ink); padding: 7px 6px; box-shadow: inset 0 -3px 0 rgba(0,0,0,.4), inset 0 2px 0 rgba(255,255,255,.08);
}
.icon-btn:hover { color: var(--white); }

/* ───────── Title: the MFD set up for launch ───────── */
.title-console .display { align-items: center; text-align: center; padding: 14px 12px; min-height: 0; border: 4px solid var(--bezel); }
.eyebrow { margin: 0; font-family: var(--font-label); font-size: 10px; color: var(--scr-cyan); letter-spacing: .06em; }
.logo { margin: 4px 0 0; font-family: var(--font-label); font-weight: 400; font-size: clamp(26px, 8vw, 38px); line-height: 1.1; color: var(--scr-white); }
.tagline { margin: 0; font-size: 24px; color: var(--scr-green); }
#title-panel { display: flex; flex-direction: column; gap: 10px; }
.select-label { margin: 0; font-family: var(--font-label); font-size: 10px; color: var(--label); }
.difficulty { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.diff {
  font-size: 10px; color: var(--label); background: var(--panel-dk); cursor: pointer;
  border: 3px solid var(--ink); padding: 8px 4px; box-shadow: inset 0 -4px 0 rgba(0,0,0,.4);
  display: flex; flex-direction: column; align-items: center; gap: 5px;
}
.diff svg { width: 26px; height: 26px; }
.diff small { font-family: var(--font-display); font-size: 17px; color: var(--muted); }
.diff.active { color: var(--ink); background: var(--scr-yellow); box-shadow: 0 0 14px rgba(255,210,63,.5); }
.diff.active small { color: var(--ink); }
.title-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.link-btn { background: none; border: 0; color: var(--scr-cyan); font-size: 10px; cursor: pointer; padding: 6px 0; text-decoration: underline; }
.link-btn:hover { color: var(--scr-yellow); }
.title-scores { font-family: var(--font-label); font-size: 10px; color: var(--scr-yellow); }

/* ───────── Buttons ───────── */
.pix-btn {
  font-size: 13px; letter-spacing: .04em; color: var(--ink); cursor: pointer;
  background: #ff7a3d; border: 3px solid var(--ink);
  box-shadow: inset 0 -5px 0 rgba(0,0,0,.25), inset 0 3px 0 rgba(255,255,255,.3);
  padding: 10px 14px;
}
.pix-btn:hover { filter: brightness(1.08); }
.pix-btn:active { transform: translateY(2px); box-shadow: inset 0 3px 0 rgba(0,0,0,.25); }
.pix-btn.big { width: 100%; font-size: 17px; padding: 15px; }
.pix-btn.ghost { width: 100%; margin-top: 10px; background: var(--panel-dk); color: var(--label); box-shadow: none; }
.pix-btn.ghost:hover { color: var(--white); }

/* ───────── Training tips: speech bubble from the mission patch ───────── */
.tip { position: fixed; z-index: 20; display: flex; gap: 8px; align-items: flex-start; --arrow-x: 50%; }
.tip .patch { width: 44px; height: 44px; flex: none; }
.tip-bubble { flex: 1; min-width: 0; background: var(--white); color: var(--ink); padding: 10px 12px; box-shadow: 4px 4px 0 var(--ink); }
.tip::before {
  content: ""; position: absolute; left: var(--arrow-x); top: -14px; transform: translateX(-50%);
  border: 8px solid transparent; border-bottom-color: var(--white);
}
.tip.above::before { top: auto; bottom: -14px; border-bottom-color: transparent; border-top-color: var(--white); transform: translate(-50%, 2px); }
.tip-step { margin: 0 0 8px; font-family: var(--font-label); font-size: 9px; color: var(--red); }
.tip-text { font-size: 22px; line-height: 1.05; color: var(--ink); }
.tip-text b { font-weight: 400; background: var(--lime); padding: 0 3px; }
.tip-text .tier { display: inline-block; margin: 2px 0; }
.tip-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; }
.tip-skip { background: none; border: 0; color: #5a5f69; font-size: 9px; cursor: pointer; padding: 6px 0; text-decoration: underline; }
.tip-skip:hover { color: var(--ink); }
.tip-target { outline: 3px solid var(--scr-yellow); outline-offset: 2px; position: relative; z-index: 15; }

/* ───────── Overlay screens (pause, results) ───────── */
.screen {
  position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center;
  padding: calc(20px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  overflow-y: auto; background: rgba(13, 15, 17, .55);
}
.card { width: 100%; max-width: 520px; margin: auto; }
.card.small { max-width: 380px; text-align: center; }
.card.wide { max-width: 600px; }
.plate-card { background: var(--bezel); padding: 4px; box-shadow: 0 8px 0 rgba(0,0,0,.35); }
.plate-in { background: var(--panel); padding: 22px 18px; border: 2px solid var(--panel-hi); }
.screen-title { font-family: var(--font-label); font-weight: 400; font-size: 22px; margin: 4px 0 12px; color: var(--scr-yellow); }
.screen-title.huge { font-size: clamp(24px, 7vw, 34px); line-height: 1.15; text-wrap: balance; }
.screen-title.win { color: var(--scr-green); }
.lead { color: var(--label); margin: 0 0 14px; font-size: 23px; }
.lead em, .lead b { font-style: normal; font-weight: 400; color: var(--scr-yellow); }

#result-screen { flex-direction: column; justify-content: flex-start; }
#result-screen .card { margin: 0 auto; }
.result-patch {
  flex: none; width: 110px; height: 110px; margin: 0 auto -44px; position: relative; z-index: 2;
  background: var(--yellow); clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
  display: flex; align-items: center; justify-content: center;
}
.rp-in {
  width: 98px; height: 98px; background: #29366f;
  clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  font-family: var(--font-label); text-align: center;
}
.rp-top { font-size: 7px; color: var(--yellow); }
.rp-name { font-size: 9px; line-height: 1.4; color: var(--white); max-width: 84px; overflow-wrap: anywhere; }
.rp-stars { font-size: 9px; color: var(--lime); min-height: 9px; }
.result-patch.lost { background: var(--alert); }
.result-patch.lost .rp-in { background: var(--ink); }
.result-card .plate-in { padding-top: 52px; }

.score-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 16px; }
.score-cell { background: var(--screen); border: 2px solid var(--ink); padding: 7px 9px; color: var(--scr-white); }
.score-cell .k { font-family: var(--font-label); font-size: 8px; color: var(--muted); }
.score-cell .v { font-family: var(--font-display); font-size: 26px; margin-top: 4px; font-variant-numeric: tabular-nums; color: var(--scr-green); }
.score-cell.total { box-shadow: 0 0 0 2px var(--scr-yellow); }
.score-cell.total .v { color: var(--scr-yellow); }

.section-title, #result-board h3 { font-family: var(--font-label); font-weight: 400; font-size: 11px; color: var(--scr-yellow); margin: 6px 0 10px; }
.hiscore { margin-bottom: 14px; }
#hiscore-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-family: var(--font-label); font-size: 12px; }
#hiscore-list li { display: grid; grid-template-columns: 40px 60px 1fr; gap: 8px; color: var(--label); font-variant-numeric: tabular-nums; }
#hiscore-list li.me { color: var(--scr-yellow); animation: blink .6s steps(1) 6; }
#initials-form { margin-bottom: 12px; }
#initials-form label { display: block; font-family: var(--font-label); font-size: 10px; color: var(--scr-green); margin-bottom: 8px; line-height: 1.6; }
.initials-row { display: flex; gap: 8px; }
#initials-input {
  width: 120px; font-family: var(--font-display); font-size: 30px; text-transform: uppercase; letter-spacing: .25em;
  color: var(--scr-green); background: var(--screen); border: 3px solid var(--scr-green); padding: 2px 8px; border-radius: 0;
}
.board-q { margin: 0 0 8px; color: var(--white); }
.board { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; max-height: 190px; overflow-y: auto; }
.pill { font-size: 19px; padding: 0 6px; border: 2px solid var(--panel-hi); color: var(--label); }
.pill b { font-weight: 400; color: var(--muted); margin-left: 4px; }
.pill.deep { border-color: var(--orange); color: var(--yellow); }
#flight-log { margin: 0 0 18px; padding-left: 26px; display: grid; gap: 4px; font-size: 20px; color: var(--label); max-height: 320px; overflow-y: auto; }
#flight-log li b { color: var(--white); font-weight: 400; }
#flight-log li { margin-bottom: 6px; }
#flight-log .lq, #flight-log .la, #flight-log .lt { display: block; }
#flight-log .lq { font-size: 17px; color: var(--muted); }
#flight-log .lt { font-size: 17px; color: var(--scr-cyan); }
#flight-log .tier { font-size: 8px; padding: 1px 4px; margin: 0 4px; vertical-align: 2px; }

/* Wide screens: big window on the left, dashboard on the right */
@media (min-width: 960px) and (min-aspect-ratio: 5/4) {
  :root { --win-h: min(66vh, 620px); }
  #cockpit { flex-direction: row; justify-content: center; align-items: center; gap: 36px; padding: 24px; }
  .bulkhead { flex: none; width: min(56vw, 900px); background: none; border: 0; padding: 0; }
  .window, .deck-strip { max-width: none; }
  .window { flex: none; height: var(--win-h); max-height: none; }
  #hud, .title-console { max-width: 450px; }
  #cockpit > #hud, #cockpit > .title-console { padding-left: 0; padding-right: 0; }
  .console { padding-top: 0; }
}
@media (max-height: 700px) {
  .console { gap: 7px; padding-top: 7px; }
  .display { padding: 6px 9px; gap: 4px; }
}
/* On-screen keyboard open: keep the window, the question and the fire button in view. */
body.kb .bulkhead { gap: 4px; padding-top: calc(4px + env(safe-area-inset-top, 0px)); padding-bottom: 6px; border-bottom-width: 3px; }
body.kb .deck-strip, body.kb .mfd-head { display: none; }
body.kb .window { min-height: 110px; max-height: none; }
body.kb .cctv { width: 22%; }
body.kb .console { gap: 6px; padding-top: 6px; }
body.kb .mfd { padding-top: 6px; }
body.kb .display { padding: 6px 9px; gap: 3px; }
body.kb #q-text { font-size: 24px; }
body.kb #cockpit { padding-bottom: 6px; }

@media (prefers-reduced-motion: reduce) {
  .ann.on.warn, .emergency { animation: none; }
  #question-panel.shake, .window.alarm, #banner.show, #hiscore-list li.me { animation: none; }
  #ribbon { transition: none; }
}
