/* ════════════════════════════════════════════════════════
   Dive — descend by knowing
   Layout: iPad landscape first (1194×834), works portrait.
   The world is a single water column; the stage (prompt +
   sub + gates) floats over it. On a correct answer the
   world streams upward — the sub "descends" while holding
   still on screen.
   ════════════════════════════════════════════════════════ */

* { margin: 0; padding: 0; box-sizing: border-box; }

/* Author display values (grid/flex) on overlays/banners would otherwise
   beat the UA's [hidden]{display:none} — keep `hidden` meaning hidden. */
[hidden] { display: none !important; }

:root {
  --font: 'Fredoka', system-ui, sans-serif;
  --hud-h: 56px;
  --gate-size: clamp(118px, 16vmin, 168px);
  --ink: #f4fbff;
  --ink-dim: rgba(244, 251, 255, 0.72);
  --card-glass: rgba(4, 26, 44, 0.55);
  --card-glass-edge: rgba(160, 220, 255, 0.28);
  --good: #7dffc8;
  --swift: #ffe27d;
  --current: #8dd6ff;
  /* Set by JS as the dive deepens (0 → 1 within the whole run). */
  --depth-frac: 0;
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: var(--font);
  color: var(--ink);
  background: #0a3a5c;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* ─── The water column ───────────────────────────────── */
.sea {
  position: fixed; inset: 0;
  overflow: hidden;
  z-index: 0;
}
.zone-layer {
  position: absolute; inset: 0;
  transition: opacity 600ms linear;
}
/* Sun shafts — only meaningful near the surface; JS fades the wrap. */
.sun-shafts { position: absolute; inset: 0; transition: opacity 900ms linear; }
.shaft {
  position: absolute; top: -12%;
  width: 14vw; height: 80vh;
  background: linear-gradient(to bottom, rgba(255,255,230,0.32), rgba(255,255,230,0));
  transform: rotate(13deg);
  filter: blur(6px);
  animation: shaft-sway 9s ease-in-out infinite alternate;
}
.shaft-1 { left: 12%; animation-delay: 0s; }
.shaft-2 { left: 38%; width: 9vw; animation-delay: -3s; opacity: 0.8; }
.shaft-3 { left: 67%; width: 16vw; animation-delay: -6s; opacity: 0.65; }
@keyframes shaft-sway {
  from { transform: rotate(11deg) translateX(-1.5vw); }
  to   { transform: rotate(15deg) translateX(1.5vw); }
}

/* Ambient swimmers: sprite-sheet fish near the surface, soft silhouette
   blobs deeper. JS positions them; the whole layer shifts up on descent
   so the world visibly travels. */
.ambient-layer {
  position: absolute; inset: 0;
  pointer-events: none;
  transition: transform 620ms cubic-bezier(.25, .6, .25, 1);
}
.swimmer {
  position: absolute;
  background-repeat: no-repeat;
  background-size: calc(var(--frames) * 100%) 100%;
  animation: swim-frames var(--frame-dur, 900ms) steps(var(--frames)) infinite,
             swimmer-drift var(--drift-dur, 26s) linear infinite;
  opacity: var(--swimmer-opacity, 0.5);
  will-change: transform;
}
.swimmer--flip { transform: scaleX(-1); }
@keyframes swim-frames { from { background-position-x: 0; } to { background-position-x: calc(-100% * var(--frames)); } }
@keyframes swimmer-drift {
  from { translate: var(--from-x) var(--y); }
  to   { translate: var(--to-x) var(--y); }
}
.silhouette {
  position: absolute;
  border-radius: 48% 52% 55% 45% / 60% 55% 45% 40%;
  background: rgba(2, 8, 16, 0.55);
  filter: blur(2px);
  animation: swimmer-drift var(--drift-dur, 40s) linear infinite;
}
.silhouette::after {           /* little tail nub */
  content: '';
  position: absolute; right: -12%; top: 32%;
  width: 26%; height: 36%;
  background: inherit;
  border-radius: 50% 70% 70% 50%;
}

/* Bioluminescent motes — deep zones only (JS toggles count/visibility). */
.mote-layer { position: absolute; inset: 0; pointer-events: none; }
.mote {
  position: absolute;
  width: var(--size, 5px); height: var(--size, 5px);
  border-radius: 50%;
  background: var(--mote-color, #7df2ff);
  box-shadow: 0 0 calc(var(--size, 5px) * 2.2) var(--mote-color, #7df2ff);
  opacity: 0;
  animation: mote-pulse var(--pulse-dur, 4s) ease-in-out infinite;
  animation-delay: var(--pulse-delay, 0s);
}
@keyframes mote-pulse {
  0%, 100% { opacity: 0; transform: translateY(0); }
  50% { opacity: var(--mote-max, 0.85); transform: translateY(-14px); }
}

/* Bubble streams during a descent. */
.stream-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.stream-bubble {
  position: absolute;
  bottom: -30px;
  width: var(--size, 10px); height: var(--size, 10px);
  border-radius: 50%;
  border: 2px solid rgba(220, 245, 255, 0.75);
  background: rgba(220, 245, 255, 0.12);
  animation: stream-up var(--dur, 700ms) linear forwards;
}
@keyframes stream-up {
  from { transform: translateY(0); opacity: 0.9; }
  to   { transform: translateY(calc(-100vh - 60px)); opacity: 0; }
}

/* Speed lines while a current is active. */
body[data-current] .sea::after {
  content: '';
  position: absolute; inset: -10%;
  background: repeating-linear-gradient(
    to bottom,
    rgba(180, 230, 255, 0.0) 0px,
    rgba(180, 230, 255, 0.10) 2px,
    rgba(180, 230, 255, 0.0) 4px,
    rgba(180, 230, 255, 0.0) 64px
  );
  animation: speed-lines 600ms linear infinite;
  pointer-events: none;
}
@keyframes speed-lines {
  from { transform: translateY(0); }
  to   { transform: translateY(-64px); }   /* streaks sweep UP = we move down */
}

/* ─── HUD ────────────────────────────────────────────── */
.hud {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--hud-h);
  padding: 8px 12px;
  padding-top: max(8px, env(safe-area-inset-top));
  display: flex; align-items: center; justify-content: space-between;
  z-index: 30;
  pointer-events: none;
}
.hud-side { display: flex; align-items: center; gap: 10px; pointer-events: auto; }
.hud-back {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--card-glass);
  border: 1.5px solid var(--card-glass-edge);
  color: var(--ink);
  font-size: 20px;
  text-decoration: none;
  backdrop-filter: blur(4px);
}
.prompt-pill {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--card-glass);
  border: 1.5px solid var(--card-glass-edge);
  font-weight: 600; font-size: 17px;
  backdrop-filter: blur(4px);
}

/* ─── Depth rail ─────────────────────────────────────── */
.depth-rail {
  position: fixed;
  right: max(10px, env(safe-area-inset-right));
  top: calc(var(--hud-h) + 14px);
  bottom: 18px;
  width: 74px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  z-index: 20;
}
.rail-track {
  position: relative;
  flex: 1;
  width: 14px;
  border-radius: 999px;
  background: linear-gradient(
    to bottom,
    #8fdcf6 0%,        /* sunlight */
    #2e86b8 10%,
    #14507e 35%,       /* twilight */
    #0a2c52 60%,       /* midnight */
    #041427 82%,       /* abyss */
    #01060d 100%       /* trench */
  );
  border: 2px solid rgba(190, 230, 250, 0.35);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.35);
}
.rail-sub {
  position: absolute;
  left: 50%;
  top: 0%;
  transform: translate(-50%, -50%);
  font-size: 22px;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.5));
  transition: top 600ms cubic-bezier(.25, .6, .25, 1);
}
.rail-best {
  position: absolute;
  left: -10px; right: -10px;
  height: 0;
  border-top: 2.5px dashed rgba(255, 226, 125, 0.9);
  filter: drop-shadow(0 0 4px rgba(255, 226, 125, 0.5));
}
.rail-best-tag {
  position: absolute;
  right: 100%; top: -9px;
  margin-right: 4px;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.04em;
  color: #ffe27d;
  text-transform: uppercase;
}
.depth-readout {
  font-weight: 700; font-size: 21px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.55);
  display: flex; align-items: baseline; gap: 2px;
}
.depth-unit { font-size: 13px; font-weight: 600; opacity: 0.8; }
.zone-name {
  font-size: 11.5px; font-weight: 600;
  text-align: center;
  line-height: 1.15;
  opacity: 0.85;
  text-shadow: 0 1px 4px rgba(0,0,0,0.55);
  max-width: 80px;
}

/* ─── Stage ──────────────────────────────────────────── */
.stage {
  position: fixed;
  inset: var(--hud-h) 96px 0 8px;   /* leave the rail clear on the right */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 1vh 0 max(2.2vh, env(safe-area-inset-bottom));
  z-index: 10;
}

/* Prompt card — dark glass so it reads over every zone palette. */
.prompt-card {
  margin-top: 0.5vh;
  padding: 1.2vh 4.5vw 1.5vh;
  border-radius: 26px;
  background: var(--card-glass);
  border: 2px solid var(--card-glass-edge);
  backdrop-filter: blur(6px);
  text-align: center;
  box-shadow: 0 8px 28px rgba(0, 10, 20, 0.35);
}
.prompt-label {
  font-size: clamp(13px, 1.9vmin, 17px);
  font-weight: 600;
  color: var(--ink-dim);
  margin-bottom: 0.2vh;
}
.prompt-math {
  font-size: clamp(44px, 8.5vmin, 78px);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.05;
  text-shadow: 0 3px 10px rgba(0, 10, 20, 0.45);
}
.prompt-math--pop { animation: prompt-pop 420ms cubic-bezier(.2, 1.6, .4, 1); }
@keyframes prompt-pop {
  0% { transform: scale(0.7); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* ─── The submersible ────────────────────────────────── */
.sub-wrap {
  position: relative;
  display: grid; place-items: center;
  animation: sub-bob 3.2s ease-in-out infinite;
}
@keyframes sub-bob {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  50% { transform: translateY(-9px) rotate(1.5deg); }
}
.sub {
  position: relative;
  width: clamp(96px, 13vmin, 132px);
  aspect-ratio: 13 / 9;
  filter: drop-shadow(0 6px 14px rgba(0, 10, 20, 0.4));
  transition: transform 400ms ease;
}
.sub-body {
  position: absolute; inset: 12% 0 8% 8%;
  border-radius: 48% 52% 50% 50% / 58% 58% 46% 46%;
  background: linear-gradient(145deg, #ffd24d 8%, #f5a623 55%, #cc7a14 100%);
  box-shadow:
    inset -6px -8px 14px rgba(140, 70, 0, 0.35),
    inset 5px 6px 10px rgba(255, 240, 190, 0.65);
}
.sub-porthole {
  position: absolute; left: 52%; top: 26%;
  width: 38%; aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #cdf3ff 0%, #5db9e8 45%, #1c6fa3 100%);
  border: 4px solid #b06a10;
  box-shadow: inset 0 3px 6px rgba(255,255,255,0.5), inset 0 -3px 6px rgba(6, 50, 90, 0.55);
}
.sub-rivet {
  position: absolute;
  width: 7%; aspect-ratio: 1;
  border-radius: 50%;
  background: #b06a10;
  box-shadow: inset 0 1.5px 2px rgba(255, 230, 170, 0.7);
}
.sub-rivet-1 { left: 24%; top: 30%; }
.sub-rivet-2 { left: 32%; top: 58%; }
.sub-fin {
  position: absolute; left: 34%; top: -6%;
  width: 22%; height: 26%;
  border-radius: 60% 60% 20% 20% / 90% 90% 10% 10%;
  background: linear-gradient(160deg, #ff8b66, #e05a35);
  box-shadow: inset 0 2px 4px rgba(255, 220, 200, 0.55);
}
.sub-prop {
  position: absolute; left: -7%; top: 38%;
  width: 14%; height: 30%;
  display: grid; place-items: center;
}
.sub-prop-blade {
  width: 100%; height: 100%;
  border-radius: 40% / 50%;
  background: linear-gradient(90deg, #9fd9f2, #5fb3d9);
  animation: prop-spin 600ms linear infinite;
  transform-origin: 60% 50%;
}
body[data-descending] .sub-prop-blade,
body[data-current] .sub-prop-blade { animation-duration: 180ms; }
@keyframes prop-spin {
  0% { transform: scaleY(1); }
  25% { transform: scaleY(0.25); }
  50% { transform: scaleY(1); }
  75% { transform: scaleY(0.25); }
  100% { transform: scaleY(1); }
}
.sub-lamp {
  position: absolute; right: -4%; bottom: 10%;
  width: 13%; aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #fffbe0, #ffd24d 70%);
  box-shadow: 0 0 10px rgba(255, 240, 160, 0.8);
}
/* Headlamp cone — JS reveals it in Midnight and deeper. */
.sub-beam {
  position: absolute;
  left: 88%; bottom: -64%;
  width: 150%; height: 110%;
  background: linear-gradient(100deg, rgba(255, 248, 200, 0.30), rgba(255, 248, 200, 0));
  clip-path: polygon(0 12%, 100% 55%, 100% 100%, 0 28%);
  filter: blur(3px);
  pointer-events: none;
}
.sub--bonk { animation: sub-bonk 480ms cubic-bezier(.3, 2, .4, 1) !important; }
@keyframes sub-bonk {
  0% { transform: rotate(0); }
  30% { transform: rotate(-7deg) translateX(-7px); }
  60% { transform: rotate(5deg) translateX(5px); }
  100% { transform: rotate(0); }
}
body[data-descending] .sub { transform: rotate(10deg) translateY(6px); }

.current-aura {
  position: absolute; inset: -26%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(141, 214, 255, 0.32) 0%, rgba(141, 214, 255, 0) 68%);
  animation: aura-breathe 1.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes aura-breathe {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.18); opacity: 1; }
}

/* ─── Gates ──────────────────────────────────────────── */
.gates {
  display: flex;
  gap: clamp(14px, 4vw, 56px);
  align-items: center;
  justify-content: center;
  min-height: calc(var(--gate-size) + 24px);
}
.gates--enter { animation: gates-enter 460ms cubic-bezier(.2, .9, .3, 1.05); }
@keyframes gates-enter {
  from { transform: translateY(36vh) scale(0.82); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}
.gates--exit { animation: gates-exit 540ms cubic-bezier(.5, 0, .8, .4) forwards; }
@keyframes gates-exit {
  to { transform: translateY(calc(-58vh)) scale(1.22); opacity: 0; }
}

.gate {
  position: relative;
  width: var(--gate-size);
  height: var(--gate-size);
  border: none;
  border-radius: 50%;
  background: transparent;
  font-family: var(--font);
  cursor: pointer;
  -webkit-touch-callout: none;
}
/* Ring — a clay porthole into darker water. */
.gate-ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 42%,
    rgba(8, 46, 80, 0.92) 0%,
    rgba(5, 30, 56, 0.95) 58%,
    rgba(3, 18, 36, 0.98) 100%);
  border: calc(var(--gate-size) * 0.075) solid #f5b73a;
  box-shadow:
    inset 0 5px 14px rgba(0, 0, 0, 0.6),
    inset 0 -3px 8px rgba(120, 200, 255, 0.18),
    0 7px 20px rgba(0, 12, 24, 0.45);
  transition: transform 140ms ease, border-color 200ms ease, filter 200ms ease;
}
/* Swift-window glow: opacity transitions linearly to 0 across the window
   (duration set inline by JS). Answering while visibly glowing = swift. */
.gate-glow {
  position: absolute; inset: -14%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 226, 125, 0) 52%, rgba(255, 226, 125, 0.45) 66%, rgba(255, 226, 125, 0) 78%);
  opacity: 1;
  pointer-events: none;
}
.gate-glow.is-fading { transition-property: opacity; transition-timing-function: linear; opacity: 0; }
.gate-num {
  position: relative;
  z-index: 2;
  font-size: calc(var(--gate-size) * 0.42);
  font-weight: 700;
  color: var(--ink);
  text-shadow: 0 3px 8px rgba(0, 8, 18, 0.65);
}
.gate:active .gate-ring { transform: scale(0.94); }

/* A wrong gate shuts: cap irises in, ring dims, no longer tappable. */
.gate--shut { pointer-events: none; }
.gate--shut .gate-ring {
  filter: grayscale(0.7) brightness(0.55);
  animation: gate-shake 420ms ease;
}
.gate--shut .gate-num { opacity: 0.35; }
.gate--shut .gate-cap { transform: scale(1); opacity: 1; }
.gate-cap {
  position: absolute; inset: 6%;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, #27425c 0deg 30deg, #1d3349 30deg 60deg);
  border: 3px solid rgba(150, 190, 220, 0.3);
  opacity: 0;
  transform: scale(0.2);
  transition: transform 260ms cubic-bezier(.2, 1.4, .4, 1), opacity 200ms ease;
  z-index: 1;
}
@keyframes gate-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  45% { transform: translateX(6px); }
  70% { transform: translateX(-4px); }
}
/* The chosen correct gate flares as the world sweeps it past. */
.gate--passed .gate-ring {
  border-color: var(--good);
  box-shadow: 0 0 34px rgba(125, 255, 200, 0.55), inset 0 5px 14px rgba(0,0,0,0.6);
}

/* ─── Floating feedback text ─────────────────────────── */
.float-layer { position: fixed; inset: 0; pointer-events: none; z-index: 40; }
.float-text {
  position: absolute;
  font-weight: 700;
  font-size: clamp(22px, 3.6vmin, 34px);
  text-shadow: 0 2px 8px rgba(0, 8, 18, 0.6);
  animation: float-rise 1.1s ease-out forwards;
  white-space: nowrap;
  transform: translateX(-50%);
}
.float-text--good { color: var(--good); }
.float-text--swift { color: var(--swift); }
.float-text--soft { color: var(--ink-dim); font-size: clamp(17px, 2.6vmin, 24px); }
@keyframes float-rise {
  0% { opacity: 0; margin-top: 12px; }
  18% { opacity: 1; }
  100% { opacity: 0; margin-top: -64px; }
}

/* ─── Current banner ─────────────────────────────────── */
.current-banner {
  position: fixed;
  top: 19%; left: 50%;
  transform: translateX(-50%);
  z-index: 45;
  padding: 12px 26px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(40, 120, 190, 0.92), rgba(90, 180, 240, 0.92));
  border: 2.5px solid rgba(200, 240, 255, 0.75);
  box-shadow: 0 8px 30px rgba(20, 80, 140, 0.5);
  font-weight: 700;
  font-size: clamp(19px, 2.8vmin, 26px);
  animation: banner-in 380ms cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes banner-in {
  from { transform: translateX(-50%) scale(0.6); opacity: 0; }
  to   { transform: translateX(-50%) scale(1); opacity: 1; }
}
.current-banner--leaving { transition: opacity 300ms ease, transform 300ms ease; opacity: 0; transform: translateX(-50%) translateY(-18px); }

/* Zone toast (repeat crossings) — below the prompt card so it never
   covers the equation (portrait stacks them closer than landscape). */
.zone-toast {
  position: fixed;
  top: 26%; left: 50%;
  transform: translateX(-50%);
  z-index: 45;
  padding: 9px 22px;
  border-radius: 999px;
  background: var(--card-glass);
  border: 1.5px solid var(--card-glass-edge);
  font-weight: 600;
  font-size: clamp(15px, 2.2vmin, 20px);
  animation: banner-in 320ms ease;
  backdrop-filter: blur(4px);
}

/* ─── Overlays ───────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  background: rgba(2, 14, 26, 0.62);
  backdrop-filter: blur(5px);
  z-index: 60;
  animation: overlay-in 240ms ease;
}
@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }
.overlay--leaving { transition: opacity 200ms ease; opacity: 0; }
.overlay-card {
  width: min(86vw, 480px);
  border-radius: 30px;
  padding: 26px 30px 28px;
  background: linear-gradient(170deg, #0d3a5e, #07223e);
  border: 2.5px solid rgba(160, 220, 255, 0.35);
  box-shadow: 0 18px 60px rgba(0, 8, 18, 0.6);
  text-align: center;
}
.overlay-emoji { font-size: 44px; margin-bottom: 6px; }
.overlay-title {
  font-size: clamp(24px, 4vmin, 32px);
  font-weight: 700;
  margin-bottom: 12px;
}
.big-btn {
  margin-top: 16px;
  padding: 14px 34px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(160deg, #ffd24d, #f5a623);
  color: #5b3a05;
  font-family: var(--font);
  font-size: 21px; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 0 #c87f12, 0 10px 24px rgba(0, 10, 20, 0.4);
}
.big-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #c87f12, 0 6px 14px rgba(0, 10, 20, 0.4); }

/* Discovery card */
.discovery-kicker {
  font-size: 15px; font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--swift);
  margin-bottom: 4px;
}
.discovery-title { font-size: clamp(26px, 4.4vmin, 34px); font-weight: 700; }
.discovery-stage {
  margin: 14px auto 10px;
  height: 130px;
  display: grid; place-items: center;
}
.discovery-sprite {
  width: var(--ds-w, 170px); height: var(--ds-h, 124px);
  background-image: var(--ds-sheet);
  background-repeat: no-repeat;
  background-size: calc(var(--ds-frames, 8) * 100%) 100%;
  animation: swim-frames var(--ds-dur, 900ms) steps(var(--ds-frames, 8)) infinite,
             sub-bob 3s ease-in-out infinite;
}
.discovery-flavor {
  font-size: clamp(15px, 2.3vmin, 19px);
  color: var(--ink-dim);
  line-height: 1.35;
}

/* Scorecard */
.scorecard-headline {
  display: flex; align-items: baseline; justify-content: center; gap: 4px;
  margin: 2px 0 0;
}
.sh-num { font-size: clamp(52px, 9vmin, 76px); font-weight: 700; color: var(--swift); }
.sh-unit { font-size: clamp(22px, 3.6vmin, 30px); font-weight: 700; color: var(--swift); opacity: 0.85; }
.scorecard-zone {
  font-size: clamp(16px, 2.6vmin, 21px);
  font-weight: 600;
  color: var(--current);
  margin-bottom: 14px;
}
.scorecard-breakdown {
  margin: 0 auto;
  max-width: 320px;
  display: grid; gap: 7px;
}
.sb-row {
  display: flex; justify-content: space-between;
  padding: 8px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 16.5px; font-weight: 600;
}
.sb-row--hidden { display: none; }
.sb-row--hidden.is-shown { display: flex; background: rgba(255, 226, 125, 0.14); color: var(--swift); }
.sb-val { font-weight: 700; }
.best-banner {
  margin-top: 14px;
  font-size: clamp(18px, 3vmin, 24px);
  font-weight: 700;
  color: var(--swift);
  animation: banner-in 420ms cubic-bezier(.2, 1.4, .4, 1);
}
.best-line { margin-top: 8px; font-size: 14.5px; color: var(--ink-dim); }

/* ─── Portrait ───────────────────────────────────────── */
@media (orientation: portrait) {
  .stage { inset: var(--hud-h) 84px 0 6px; }
  .gates { gap: clamp(10px, 3vw, 26px); }
  :root { --gate-size: clamp(104px, 24vw, 150px); }
}

/* Narrow phones (not the target device, but don't break) */
@media (max-width: 480px) {
  .depth-rail { width: 60px; }
  .stage { inset: var(--hud-h) 66px 0 4px; }
}
