/* Ember Glider — interface
   Warm glass over a sunset scene. No web fonts, no network assets. */

:root {
  color-scheme: dark;
  --ink: #2a1610;
  --cream: #ffe9d2;
  --cream-soft: rgba(255, 233, 210, 0.72);
  --cream-dim: rgba(255, 233, 210, 0.45);
  --ember: #ff9a58;
  --ember-soft: #ffc46e;
  --gold: #ffe0a2;
  --panel: rgba(28, 15, 20, 0.56);
  --panel-strong: rgba(24, 12, 17, 0.86);
  --line: rgba(255, 206, 164, 0.22);
  --line-strong: rgba(255, 206, 164, 0.38);
  --good: #ffd08a;
  --bad: #ff9d76;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --hud-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --start-card: rgba(24, 13, 18, 0.66);
  --start-card-border: rgba(255, 206, 164, 0.18);
  --start-card-shadow: 0 26px 80px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #120a10;
  color: var(--cream);
  font-family: var(--sans);
  font-size: 16px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
}

#app {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  isolation: isolate;
}

#scene {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  cursor: grab;
  touch-action: none;
}
#scene.dragging { cursor: grabbing; }

.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(140% 100% at 50% 42%, rgba(0, 0, 0, 0) 48%, rgba(16, 7, 10, 0.42) 100%),
    linear-gradient(180deg, rgba(14, 7, 10, 0.28) 0%, rgba(14, 7, 10, 0) 26%, rgba(14, 7, 10, 0) 72%, rgba(14, 7, 10, 0.4) 100%);
  z-index: 1;
}

[hidden] { display: none !important; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.pause-glyph {
  display: inline-block;
  width: 12px;
  height: 14px;
  border-left: 4px solid currentColor;
  border-right: 4px solid currentColor;
}

/* ------------------------------------------------------------------ HUD */

.hud {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
.hud.hidden-hud { opacity: 0; }
.hud { transition: opacity 0.4s ease; }

.hud-top {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(260px, 1.6fr) minmax(190px, 1fr);
  align-items: start;
  gap: 18px;
  padding: 22px 28px 0;
}

.hud-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 16px;
  box-shadow: var(--hud-shadow);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.hud-card.journey { justify-self: start; }
.hud-card.timing { justify-self: end; text-align: right; min-width: 208px; }

.eyebrow {
  font-size: 9.5px;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--cream-dim);
  font-weight: 600;
}

.hud-card strong {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: 0.005em;
  color: var(--cream);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35);
}

.journey .ring-count {
  font-size: 12px;
  color: var(--cream-soft);
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 1px;
}
.journey .ring-count b {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--gold);
}
.dim { color: var(--cream-dim); font-weight: 400; }

.timing strong {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.timing .sub { font-size: 11px; color: var(--cream-soft); }
.timing .sub.beat { color: var(--gold); }

.compass-wrap {
  align-self: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
  padding-top: 2px;
}
#compass {
  display: block;
  width: 100%;
  max-width: 560px;
  height: 62px;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.35));
}
.compass-caption {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--cream-dim);
  font-weight: 600;
}

.hud-left {
  position: absolute;
  left: 28px;
  bottom: 96px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}
.alt-readout {
  font-family: var(--mono);
  font-size: 40px;
  line-height: 0.95;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--cream);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.5);
}
.alt-readout .unit {
  font-size: 14px;
  margin-left: 4px;
  color: var(--cream-soft);
  letter-spacing: 0;
}
.alt-caption {
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cream-dim);
  font-weight: 600;
  margin: 4px 0 8px;
}
#altTape {
  width: 96px;
  height: 264px;
  display: block;
  opacity: 0.92;
}

.hud-bottom {
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 22px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}
.speed-block {
  display: flex;
  align-items: baseline;
  gap: 5px;
  flex-wrap: wrap;
  max-width: 150px;
}
#speedVal {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--cream);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
}
.speed-block .unit { font-size: 12px; color: var(--cream-soft); }
.speed-block .eyebrow { display: block; flex-basis: 100%; }

.lift {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(20, 11, 15, 0.46);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 12px;
  color: var(--cream-soft);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.lift-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8e7b6a;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}
.lift.up { color: var(--gold); border-color: rgba(255, 196, 110, 0.45); }
.lift.up .lift-dot { background: var(--ember-soft); box-shadow: 0 0 12px rgba(255, 196, 110, 0.85); }
.lift.down .lift-dot { background: #9d8b7c; }

.hint {
  font-size: 11px;
  color: var(--cream-dim);
  letter-spacing: 0.02em;
  margin-left: auto;
  margin-right: 12px;
  align-self: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.icon-btn {
  pointer-events: auto;
  appearance: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(20, 11, 15, 0.5);
  color: var(--cream);
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.icon-btn:hover { background: rgba(46, 24, 28, 0.7); border-color: var(--line-strong); }
.icon-btn:active { transform: scale(0.96); }
.icon-btn:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.warn {
  position: absolute;
  top: 104px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(88, 38, 18, 0.78);
  border: 1px solid rgba(255, 158, 100, 0.55);
  color: #ffe3c6;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  animation: warn-pulse 0.9s ease-in-out infinite alternate;
}
@keyframes warn-pulse {
  from { opacity: 0.72; }
  to { opacity: 1; }
}

/* Next-ring cue at the screen edge */
.cue {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 10px;
  border-radius: 999px;
  background: rgba(26, 13, 16, 0.7);
  border: 1px solid rgba(255, 196, 110, 0.4);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
  color: var(--cream);
  font-size: 11px;
  pointer-events: none;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 3;
}
.cue.is-behind { border-color: rgba(255, 196, 110, 0.26); }
.cue-arrow {
  display: inline-block;
  color: var(--ember-soft);
  font-size: 12px;
  line-height: 1;
  transform-origin: 50% 50%;
  filter: drop-shadow(0 0 6px rgba(255, 160, 90, 0.7));
}
.cue-label { display: flex; flex-direction: column; line-height: 1.2; }
.cue-label b { font-weight: 600; font-size: 11px; color: var(--cream); }
.cue-label span { color: var(--cream-dim); font-size: 10px; font-variant-numeric: tabular-nums; }

/* ----------------------------------------------------------------- toast */

.toast {
  position: absolute;
  top: 92px;
  left: 50%;
  transform: translate(-50%, -8px);
  z-index: 6;
  padding: 9px 18px;
  border-radius: 999px;
  background: rgba(28, 14, 18, 0.82);
  border: 1px solid rgba(255, 196, 110, 0.35);
  color: var(--cream);
  font-size: 12.5px;
  letter-spacing: 0.02em;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  white-space: nowrap;
  max-width: 92vw;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.penalty { color: #ffd7b8; border-color: rgba(255, 146, 96, 0.55); }

.crash-flash {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(70% 60% at 50% 62%, rgba(255, 236, 210, 0.55) 0%, rgba(255, 172, 120, 0.12) 40%, rgba(30, 12, 14, 0) 72%);
  transition: opacity 0.5s ease;
}
.crash-flash.flash { opacity: 1; transition: opacity 0.06s ease; }

.fade {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: #120a0d;
  opacity: 0;
  transition: opacity 0.32s ease;
}

/* --------------------------------------------------------------- screens */

.screen {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: grid;
  padding: 42px 48px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.start-screen {
  align-items: center;
  justify-items: start;
  background:
    linear-gradient(96deg, rgba(14, 7, 10, 0.9) 0%, rgba(16, 8, 11, 0.72) 30%, rgba(18, 9, 12, 0.32) 58%, rgba(18, 9, 12, 0) 80%);
}

.start-panel {
  width: min(560px, 100%);
  padding: 6px 0 18px;
  animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.kicker {
  margin: 0 0 14px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-weight: 600;
  color: var(--ember-soft);
}
.kicker::before {
  content: "";
  display: inline-block;
  width: 26px;
  height: 1px;
  background: linear-gradient(90deg, var(--ember), rgba(255, 154, 88, 0));
  vertical-align: middle;
  margin-right: 12px;
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(48px, 6.6vw, 78px);
  line-height: 0.94;
  letter-spacing: -0.025em;
  color: #ffefd9;
  text-shadow: 0 2px 40px rgba(255, 122, 60, 0.25), 0 10px 40px rgba(0, 0, 0, 0.4);
  background: linear-gradient(172deg, #fff4e2 8%, #ffd9ad 58%, #ff9f65 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.goal {
  margin: 18px 0 0;
  max-width: 36ch;
  font-family: var(--serif);
  font-size: 19.5px;
  line-height: 1.45;
  color: rgba(255, 236, 216, 0.9);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.5);
}

.run-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 32px;
  margin: 26px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--line);
}
.run-facts div { display: flex; flex-direction: column; gap: 4px; }
.run-facts dt {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--cream-dim);
  font-weight: 600;
}
.run-facts dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 20px;
  letter-spacing: -0.01em;
  color: var(--cream);
}
.run-facts dd.medal-earned { color: var(--gold); }

.controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 22px;
  margin: 24px 0 0;
  max-width: 500px;
}
.control-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.keys {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}
.keys-gap { width: 6px; }
.or { font-size: 9px; color: var(--cream-dim); letter-spacing: 0.06em; }
kbd {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 5px;
  border-radius: 6px;
  border: 1px solid rgba(255, 214, 176, 0.26);
  border-bottom-color: rgba(255, 214, 176, 0.16);
  background: rgba(255, 244, 232, 0.07);
  color: rgba(255, 238, 218, 0.92);
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.control-text {
  font-size: 11.5px;
  color: var(--cream-soft);
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.launch-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 28px;
  flex-wrap: wrap;
}
.launch-note {
  font-size: 11px;
  line-height: 1.45;
  color: var(--cream-dim);
  max-width: 24ch;
}
.persist-note {
  margin: 20px 0 0;
  font-size: 11px;
  line-height: 1.55;
  color: var(--cream-dim);
  max-width: 46ch;
}

.btn {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: rgba(255, 244, 232, 0.08);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 13px 22px;
  min-height: 46px;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.btn:hover { background: rgba(255, 244, 232, 0.14); border-color: rgba(255, 214, 176, 0.52); }
.btn:active { transform: translateY(1px); }

.btn.primary {
  background: linear-gradient(178deg, #ffd38c 0%, #ffb066 46%, #ff8f4c 100%);
  border-color: rgba(255, 226, 176, 0.9);
  color: #31180b;
  box-shadow: 0 10px 34px rgba(255, 120, 50, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.btn.primary:hover {
  background: linear-gradient(178deg, #ffdf9f 0%, #ffbd78 46%, #ff9d5c 100%);
  box-shadow: 0 14px 40px rgba(255, 130, 60, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.btn-key {
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 6px;
  border-radius: 4px;
  border: 1px solid rgba(49, 24, 11, 0.28);
  color: rgba(49, 24, 11, 0.7);
  font-weight: 700;
}

.overlay-screen {
  place-items: center;
  background: rgba(11, 6, 9, 0.56);
  backdrop-filter: blur(7px) saturate(0.9);
  -webkit-backdrop-filter: blur(7px) saturate(0.9);
  animation: overlay-in 0.26s ease both;
}
@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }

.panel {
  width: min(540px, 100%);
  padding: 34px 36px 30px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  text-align: left;
  animation: rise 0.34s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.panel h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(34px, 5vw, 46px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: #fff0dc;
}
.panel-copy { margin: 12px 0 0; font-size: 13.5px; line-height: 1.55; color: var(--cream-soft); max-width: 38ch; }

.button-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

.finish-panel { width: min(600px, 100%); }
.finish-goal { margin: 10px 0 0; font-size: 13.5px; color: var(--cream-soft); }

.medal-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0 4px;
}
.medal {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 30%, #fff2c8, #ffcf7c 38%, #c96f33 78%, #6d3418 100%);
  box-shadow: 0 0 0 1px rgba(255, 226, 176, 0.55), 0 10px 30px rgba(255, 150, 70, 0.3), inset 0 2px 6px rgba(255, 255, 255, 0.5);
}
.medal span {
  display: block;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(112, 52, 20, 0.5);
  background: radial-gradient(circle at 40% 35%, #ffe9b6, #ffb45e 55%, #d5763a 100%);
  box-shadow: inset 0 1px 4px rgba(255, 255, 255, 0.6);
}
.medal.missed {
  background: radial-gradient(circle at 35% 30%, #8d8178, #5d544e 55%, #37302c 100%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), inset 0 2px 6px rgba(255, 255, 255, 0.12);
}
.medal.missed span {
  background: radial-gradient(circle at 40% 35%, #bdb2a6, #786d64 60%, #4a413b 100%);
  border-color: rgba(0, 0, 0, 0.25);
  box-shadow: none;
}
.medal-row strong {
  display: block;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  color: var(--cream);
}
.medal-row .sub { font-size: 11px; color: var(--cream-dim); letter-spacing: 0.04em; }

.results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 22px 0 0;
  padding: 1px;
  background: var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.results div {
  background: rgba(20, 10, 14, 0.92);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.results dt {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--cream-dim);
  font-weight: 600;
}
.results dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 20px;
  color: var(--cream);
  letter-spacing: -0.01em;
}
.results dd.good { color: var(--gold); }
.best-note { margin: 16px 0 0; font-size: 11.5px; color: var(--cream-dim); }
.best-note.beat { color: var(--gold); }

.noscript {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #120a10;
  color: #ffe9d2;
  font-size: 16px;
  z-index: 50;
}

/* --------------------------------------------------------- light scheme */

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --cream: #33211a;
    --cream-soft: rgba(51, 33, 26, 0.78);
    --cream-dim: rgba(51, 33, 26, 0.6);
    --panel: rgba(255, 244, 230, 0.82);
    --panel-strong: rgba(255, 246, 234, 0.96);
    --line: rgba(104, 62, 42, 0.22);
    --line-strong: rgba(104, 62, 42, 0.36);
    --ink: #2a1610;
    --gold: #a8551f;
    --hud-shadow: 0 14px 40px rgba(74, 38, 22, 0.18);
    --start-card: rgba(255, 246, 234, 0.92);
    --start-card-border: rgba(104, 62, 42, 0.18);
    --start-card-shadow: 0 26px 80px rgba(80, 40, 20, 0.2);
  }
  html, body { background: #f6e6d4; }
  .start-screen {
    background:
      linear-gradient(96deg, rgba(255, 247, 236, 0.42) 0%, rgba(255, 244, 230, 0.12) 44%, rgba(255, 240, 224, 0) 62%);
  }
  .start-panel {
    width: min(600px, 100%);
    padding: 34px 36px 30px;
    border-radius: 20px;
    border: 1px solid rgba(104, 62, 42, 0.18);
    background: rgba(255, 246, 234, 0.9);
    box-shadow: 0 26px 80px rgba(80, 40, 20, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }
  h1 {
    background: linear-gradient(172deg, #46281c 6%, #8f3c1c 62%, #c25a26 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
  }
  .goal { color: rgba(61, 37, 27, 0.9); text-shadow: none; }
  .kicker { color: #a8551f; }
  .hud-card, .icon-btn, .lift, .cue, .toast {
    background: var(--panel);
    color: var(--cream);
  }
  .icon-btn:hover { background: rgba(255, 236, 214, 0.95); }
  .lift, .cue { border-color: rgba(168, 85, 31, 0.28); }
  .hud-card strong, #speedVal, .alt-readout { color: #33211a; text-shadow: none; }
  .cue-label b { color: #33211a; }
  .cue-arrow { color: #b4581f; }
  .speed-block .unit, .alt-readout .unit { color: rgba(51, 33, 26, 0.6); }
  .hint { color: rgba(51, 33, 26, 0.55); }
  .warn { background: rgba(255, 233, 206, 0.9); border-color: rgba(169, 85, 31, 0.4); color: #7c3410; }
  .panel-copy, .finish-goal, .best-note, .persist-note, .launch-note { color: rgba(51, 33, 26, 0.68); }
  kbd { background: rgba(51, 33, 26, 0.06); border-color: rgba(104, 62, 42, 0.28); color: #3b261d; box-shadow: none; }
  .control-text { color: rgba(51, 33, 26, 0.76); }
  .btn { border-color: rgba(104, 62, 42, 0.3); background: rgba(51, 33, 26, 0.06); color: #3b261d; }
  .btn:hover { background: rgba(51, 33, 26, 0.11); }
  .btn.primary { color: #31180b; border-color: #e7a45f; }
  .results div { background: rgba(255, 249, 240, 0.96); }
  .overlay-screen { background: rgba(248, 232, 216, 0.55); }
  .toast.penalty { color: #a8481c; }
  .fade { background: #f2dfcb; }
  .crash-flash { background: radial-gradient(70% 60% at 50% 62%, rgba(255, 255, 255, 0.7) 0%, rgba(255, 214, 180, 0.24) 42%, rgba(255, 240, 224, 0) 72%); }
  .vignette {
    background:
      radial-gradient(140% 100% at 50% 42%, rgba(0, 0, 0, 0) 52%, rgba(90, 50, 30, 0.2) 100%),
      linear-gradient(180deg, rgba(90, 50, 30, 0.12) 0%, rgba(90, 50, 30, 0) 26%, rgba(90, 50, 30, 0) 72%, rgba(90, 50, 30, 0.18) 100%);
  }
  #compass { filter: drop-shadow(0 3px 10px rgba(90, 50, 30, 0.25)); }
}

/* ------------------------------------------------------------- responsive */

@media (max-width: 1080px) {
  .hint { display: none; }
  .alt-readout { font-size: 34px; }
  #altTape { width: 84px; height: 232px; }
}

@media (max-width: 900px) {
  .hud-top {
    grid-template-columns: minmax(160px, 1fr) minmax(170px, 1fr);
    padding: 16px 18px 0;
    gap: 10px;
  }
  .compass-wrap { display: none; }
  .hud-left { left: 18px; bottom: 84px; }
  .hud-bottom { left: 18px; right: 18px; bottom: 16px; }
  .screen { padding: 30px 28px; }
  .start-panel {
    background: var(--start-card);
    border: 1px solid var(--start-card-border);
    box-shadow: var(--start-card-shadow);
    padding: 28px 26px;
    border-radius: 18px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }
  .goal { font-size: 18px; }
  .controls { grid-template-columns: 1fr; gap: 8px; }
  .run-facts { gap: 8px 24px; }
  .launch-row { margin-top: 22px; }
  .launch-note { max-width: 40ch; }
}

@media (max-width: 640px) {
  .screen { padding: 22px 18px; }
  .hud-top { padding: 12px 12px 0; }
  .hud-card { padding: 9px 12px; border-radius: 11px; }
  .hud-card strong { font-size: 18px; }
  .hud-card.timing { min-width: 0; }
  .timing strong { font-size: 17px; }
  .hud-left { left: 12px; bottom: 76px; }
  .alt-readout { font-size: 28px; }
  .alt-caption { margin-bottom: 4px; }
  #altTape { width: 66px; height: 178px; }
  .hud-bottom { left: 12px; right: 12px; bottom: 12px; gap: 10px; }
  #speedVal { font-size: 22px; }
  .speed-block { max-width: 92px; }
  .lift { font-size: 10.5px; padding: 6px 10px; }
  .icon-btn { width: 38px; height: 38px; border-radius: 10px; }
  .start-panel { width: 100%; padding-bottom: 26px; }
  h1 { font-size: clamp(42px, 13vw, 58px); }
  .goal { font-size: 17px; max-width: none; }
  .run-facts { gap: 8px 20px; padding-top: 12px; margin-top: 20px; }
  .run-facts dd { font-size: 17px; }
  .controls { margin-top: 18px; }
  .control-text { font-size: 11px; }
  .btn { width: 100%; }
  .launch-row { gap: 12px; }
  .launch-note { max-width: none; }
  .panel { padding: 26px 22px 24px; border-radius: 16px; }
  .medal-row { gap: 12px; margin-top: 18px; }
  .medal { width: 48px; height: 48px; }
  .medal span { width: 28px; height: 28px; }
  .results dd { font-size: 17px; }
  .toast { top: 78px; font-size: 11.5px; }
  .cue { font-size: 10px; padding: 6px 9px; }
}

@media (max-height: 700px) and (min-width: 900px) {
  .screen { padding-top: 26px; padding-bottom: 26px; }
  h1 { font-size: clamp(44px, 5.4vw, 62px); }
  .run-facts { margin-top: 18px; padding-top: 12px; }
  .controls { margin-top: 18px; gap: 8px 20px; }
  .launch-row { margin-top: 20px; }
  .persist-note { margin-top: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .start-panel, .panel { animation: none !important; }
  .warn { animation: none !important; }
  .crash-flash { transition: none !important; }
}
