@font-face {
  font-family: 'Anton';
  src: url('./fonts/Anton-Regular.ttf') format('truetype');
  font-display: swap;
}
@font-face { /* the VICEFALL wordmark (OFL — fonts/Monoton-OFL.txt), as on the landing page */
  font-family: 'Monoton';
  src: url('./fonts/Monoton-Regular.ttf') format('truetype');
  font-display: swap;
}

html, body {
  margin: 0;
  padding: 0;
  background: #000;
  height: 100%;
  overflow: hidden;
  font-family: 'Anton', sans-serif;
}

#game {
  display: block;
  width: 100vw;
  height: 100vh;
}

#ui {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden; /* edge HUD elements/labels must never grow the page */
}

/* The labels' own layer (labels.js): first in #ui, below every overlay. */
#labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* Projected actor labels — positioned via translate3d by labels.js.
   The translate(-50%,-100%) in here centres them above the anchor point. */
.label {
  position: absolute;
  top: 0;
  left: 0;
  transform: translate3d(-100px, -100px, 0) translate(-50%, -100%);
  color: #cfd6e4;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  white-space: pre-line; /* fat-target labels carry a second $ line (02-05) */
  text-align: center;
  will-change: transform;
}

.label.me {
  color: #35d0a0; /* accent */
}

.label.bot {
  font-size: 11px; /* slightly smaller than a player's name */
  opacity: 0.72;   /* and dimmer — bots are tellable at a glance (03-03) */
}

.label.cop {
  color: #ff5566; /* police red — readable as threat at a glance (03-04) */
  font-size: 11px;
  letter-spacing: 0.18em;
}

.label.site {
  color: #d6b8ff; /* vault violet — matches the ready ring */
  font-size: 14px;
  letter-spacing: 0.16em;
  padding: 2px 8px;
  background: rgba(12, 8, 26, 0.7);
  border: 1px solid rgba(185, 140, 255, 0.55);
  border-radius: 4px;
}
.label.site.crack { /* someone is cracking it — everyone sees */
  color: #ff8a6a;
  border-color: rgba(255, 106, 60, 0.75);
  animation: site-crack 0.6s ease-in-out infinite alternate;
}
@keyframes site-crack { from { opacity: 1; } to { opacity: 0.55; } }
.label.site.pot { /* a vault that has drawn cash in: what is waiting inside */
  color: #ffd060;
  border-color: rgba(255, 208, 96, 0.75);
  font-size: 15px;
  box-shadow: 0 0 12px rgba(255, 190, 60, 0.35);
}
.label.site.cd { /* cooling: when it reopens */
  color: #b4bccc;
  border-color: rgba(139, 147, 167, 0.5);
  font-size: 13px;
}

/* Centre-screen contextual hint (03-01): HOLD TO CRACK inside a ready ring.
   Below #aimhint (CLICK TO AIM, at 18%), which covered it — and not above
   it, where it sat on our own character (2026-10-06). */
#hint {
  position: absolute;
  bottom: calc(18% - 46px);
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 16px;
  color: #ffd94d;
  font-size: 18px;
  letter-spacing: 0.18em;
  background: rgba(10, 10, 18, 0.7);
  border: 1px solid rgba(255, 217, 77, 0.35);
  border-radius: 4px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

#banner {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 14px;
  color: #e8ecf4;
  background: rgba(10, 10, 18, 0.82);
  border: 1px solid #2a3040;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.2; /* 12 + ~31 px: clear of the timer at top:44 */
  letter-spacing: 0.05em;
}

#debug {
  position: absolute;
  bottom: 8px;
  left: 8px;
  padding: 4px 8px;
  color: #8f8;
  background: rgba(0, 0, 0, 0.6);
  font: 12px monospace;
  white-space: pre;
}

/* Master volume pill (07-02) — top-right, out of the pad arrow's way. */
#volbtn {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 5px 12px;
  color: #8fa0b8;
  background: rgba(10, 10, 18, 0.82);
  border: 1px solid #2a3040;
  border-radius: 4px;
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.12em;
  cursor: pointer;
}
#volbtn:hover { color: #e8ecf4; border-color: #35d0a0; }

/* ------------------------------------------------- run HUD (02-05) ------ */

#timer {
  position: absolute;
  top: 44px;
  left: 50%;
  transform: translateX(-50%);
  color: #e8ecf4;
  font-size: 34px;
  letter-spacing: 0.08em;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
}

/* DETECTED (police-packs): pulses while the police know where you are,
   fades out when the timer runs out. */
#detected {
  position: absolute;
  top: 176px; /* its own lane under the city news (top:138 → ~167); 2026-10-14: at 150 the two overlapped */
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 14px;
  border: 2px solid #ff3b4a;
  border-radius: 4px;
  background: rgba(40, 0, 6, 0.55);
  color: #ff3b4a;
  font-size: 22px;
  letter-spacing: 0.12em;
  text-shadow: 0 0 8px rgba(255, 59, 74, 0.8);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.9s ease-out;
}
#detected.on { opacity: 1; transition: none; animation: detected-pulse 0.6s ease-in-out infinite alternate; }
@keyframes detected-pulse { from { opacity: 1; box-shadow: 0 0 14px rgba(255, 59, 74, 0.7); } to { opacity: 0.45; box-shadow: none; } }
@media (prefers-reduced-motion: reduce) { #detected.on { animation: none; } }

#timer.sudden {
  color: #ff5040;
  animation: sudden-pulse 0.5s infinite;
}

@keyframes sudden-pulse {
  50% { transform: translateX(-50%) scale(1.12); }
}

#runhud {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 8px 12px;
  color: #e8ecf4;
  background: rgba(10, 10, 18, 0.72);
  border: 1px solid #2a3040;
  border-radius: 4px;
  font-size: 15px;
  letter-spacing: 0.05em;
  line-height: 1.5;
}

#carry { color: #ffd94d; }
#mult  { color: #66d9ff; }
#banked { color: #35d0a0; }
#heat  { color: #ff7040; min-height: 1em; }
/* Heat for hurting police (ev wanted): outlasts a bank, so it says so. */
#heat.assault { color: #ff3b4a; animation: heat-assault 0.7s ease-in-out infinite alternate; }
@keyframes heat-assault { from { opacity: 1; text-shadow: 0 0 6px #ff3b4a; } to { opacity: 0.55; text-shadow: none; } }
@media (prefers-reduced-motion: reduce) { #heat.assault { animation: none; } }

/* Combat (phase 08): health bar, weapon line, death card, kill feed. */
#hpbar {
  width: 120px;
  height: 7px;
  margin: 2px 0 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
#hpbar-fill { height: 100%; width: 100%; background: #35d07a; transition: width 0.12s linear; }
#weapon { display: flex; gap: 6px; color: #e8ecf4; font-size: 13px; }
#weapon .w-slot {
  padding: 2px 7px;
  border: 1px solid rgba(120, 140, 170, 0.35);
  border-radius: 4px;
  background: rgba(8, 12, 24, 0.55);
  letter-spacing: 1px;
  white-space: nowrap;
  opacity: 0.85;
}
#weapon .w-slot.on { border-color: rgba(255, 210, 60, 0.85); color: #ffd23c; opacity: 1; box-shadow: 0 0 10px rgba(255, 200, 60, 0.25); }
#weapon .w-slot.none { opacity: 0.3; }
#deathcard {
  position: absolute;
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 10px 22px;
  border-radius: 6px;
  background: rgba(10, 10, 18, 0.82);
  border: 1px solid rgba(255, 74, 74, 0.6);
  color: #ff6a6a;
  font-size: 22px;
  letter-spacing: 0.08em;
  pointer-events: none;
}
#killfeed {
  position: absolute;
  top: 56px;
  right: 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  pointer-events: none;
}
#killfeed .kf {
  padding: 2px 8px;
  border-radius: 3px;
  background: rgba(10, 10, 18, 0.7);
  color: #e8ecf4;
  font-size: 13px;
  letter-spacing: 0.04em;
}
#killfeed .kf.mine { color: #ffd94d; border: 1px solid rgba(255, 217, 77, 0.5); }

/* Dash cooldown ring (03-02): conic fill beside the carry readout —
   full cyan = dash ready. */
#dashring {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  margin: 2px 0 4px;
  background: conic-gradient(#35d0e0 360deg, rgba(255, 255, 255, 0.10) 0deg);
}
#dashring.ready {
  box-shadow: 0 0 6px rgba(53, 208, 224, 0.8);
}
#dashring-in {
  width: 12px;
  height: 12px;
  margin: 4px;
  border-radius: 50%;
  background: #14161d;
}

/* Screen-edge compass arrow — clip-path triangle pointing UP at rotate(0);
   hud.js adds the +π/2 offset so rotate(a) tracks the screen-space angle. */
#padarrow {
  position: absolute;
  top: 0;
  left: 0;
  width: 22px;
  height: 30px;
  background: #35d0a0;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.8));
  will-change: transform, opacity; /* moved every frame (hud.js updatePadArrow) */
}

#bankflash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(ellipse at center, rgba(53, 208, 160, 0) 55%, rgba(53, 208, 160, 0.4) 100%);
}

#bankflash.on { animation: bankflash 0.55s ease-out; }

@keyframes bankflash {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

/* Red edge flash when the local player is tackled (03-02). */
#hitflash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(ellipse at center, rgba(255, 64, 64, 0) 50%, rgba(255, 64, 64, 0.45) 100%);
}

#hitflash.on { animation: hitflash 0.45s ease-out; }

@keyframes hitflash {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

/* BUSTED banner — the exact loss, centre screen (03-04). */
#bustflash {
  position: absolute;
  top: 22%;
  left: 0;
  right: 0;
  pointer-events: none;
  opacity: 0;
  text-align: center;
  font-family: 'Anton', sans-serif;
  font-size: 44px;
  letter-spacing: 0.08em;
  color: #ff5566;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9);
}

#bustflash.on { animation: bustflash 1.4s ease-out; }

@keyframes bustflash {
  0% { opacity: 0; transform: scale(1.25); }
  12% { opacity: 1; transform: scale(1); }
  70% { opacity: 1; }
  100% { opacity: 0; }
}

/* Danger vignette — opacity is driven per frame by cop proximity (03-04). */
#danger {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(ellipse at center, rgba(255, 47, 69, 0) 55%, rgba(255, 47, 69, 0.5) 100%);
  transition: opacity 0.18s linear;
}

/* Corner minimap (03-05) — bottom-right, clear of the run HUD (top-left),
   the round strip area (top), the hint (bottom-centre) and debug (bottom-left). */
#minimap {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 160px;
  height: 160px;
  background: transparent; /* the canvas paints its own backdrop — see below */
  border: 1px solid #2a3040;
  border-radius: 6px;
  /* NOT element opacity. The panel should sit in the scene rather than on top of
     it (the project lead's call), but `opacity` here fades the arrow, pads and
     sites along with the backdrop — dimming the one thing you have to find at a
     glance. The canvas draws its BACKDROP at CONFIG.minimap.baseAlpha and every
     marker at full strength, so the city shows faintly through the map while
     you stay crisp on it. */
  opacity: 1;
}

@media (max-width: 600px) {
  #minimap { width: 120px; height: 120px; }
}

/* ------------------------------------------------- round strip (04-03) --
   One line under the run timer. Layout is pinned: banner top:12 center,
   runhud top:12 left, timer top:44 center (~51px + pulse), minimap
   bottom-right — the strip owns the free band at top:104. */
#roundstrip {
  position: absolute;
  top: 104px; /* timer box ends ~95px; the sudden pulse adds ~3px */
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 12px;
  color: #cfd6e4;
  background: rgba(10, 10, 18, 0.72);
  border: 1px solid #2a3040;
  border-radius: 4px;
  font-size: 13px;
  letter-spacing: 0.05em;
  white-space: nowrap;
  cursor: pointer;
}

@media (max-width: 600px) {
  #roundstrip {
    font-size: 11px;
    padding: 4px 8px;
    max-width: 96vw;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* ------------------------------------------------- leaderboard (04-03) --
   Translucent card like the title: the arena stays alive behind it. */
#lb {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 45;
}
#lb .lb-card {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  width: min(480px, 94vw);
  max-height: 80vh;
  padding: 20px 22px 16px;
  background: rgba(8, 12, 24, 0.9);
  border: 1px solid rgba(64, 200, 255, 0.35);
  border-radius: 10px;
  box-shadow: 0 0 40px rgba(0, 170, 255, 0.18);
  color: #e8ecf4;
  font-size: 13px;
  letter-spacing: 0.04em;
}
#lb .lb-head { display: flex; align-items: center; justify-content: space-between; }
#lb .lb-title {
  font-family: 'Anton', sans-serif;
  font-size: 20px;
  letter-spacing: 0.08em;
  color: #7fd4ff;
  text-shadow: 0 0 12px rgba(64, 200, 255, 0.5);
}
#lb .lb-close {
  background: none; border: none; color: #8a93a8;
  font-size: 22px; cursor: pointer; padding: 0 4px;
}
#lb .lb-close:hover { color: #e8ecf4; }
#lb .lb-tabs { display: flex; gap: 6px; margin: 12px 0 10px; }
#lb .lb-tabs button {
  flex: 1;
  padding: 6px 0;
  background: rgba(20, 28, 44, 0.6);
  border: 1px solid #2a3040;
  border-radius: 4px;
  color: #8a93a8;
  font: inherit;
  letter-spacing: 0.08em;
  cursor: pointer;
}
#lb .lb-tabs button.on {
  color: #ffd76a;
  border-color: rgba(255, 200, 60, 0.5);
  background: rgba(50, 38, 10, 0.55);
}
#lb .lb-body { overflow-y: auto; min-height: 120px; }
#lb .lb-sub { color: #9fb3d8; padding: 4px 0; }
#lb .lb-sec {
  margin-top: 12px; padding: 4px 0;
  color: #7fd4ff; border-bottom: 1px solid #2a3040;
}
#lb .lb-empty { color: #8a93a8; padding: 14px 0; text-align: center; }
#lb .lb-row {
  display: flex; gap: 10px; align-items: baseline;
  padding: 3px 0;
}
#lb .lb-rank { color: #ffd76a; min-width: 30px; }
#lb .lb-alias { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#lb .lb-wallet { color: #8a93a8; font-size: 11px; }
#lb .lb-score { color: #7fe08a; }
#lb .lb-prize { color: #ffd76a; }
#lb .lb-payout { padding: 0 0 6px 40px; color: #8a93a8; font-size: 11px; }
#lb .lb-payout a { color: #7fd4ff; }
#lb .lb-foot { color: #8a93a8; font-size: 11px; min-height: 16px; padding-top: 8px; }
#lb .lb-rules { display: block; text-align: center; margin-top: 10px; color: #7fd4ff; font-size: 12px; text-decoration: none; }
#lb .lb-rules:hover { text-decoration: underline; }

/* ------------------------------------------------- 04-04: round end --
   BANK NOW flashes during the intermission window while a run is still
   live; the intermission card is the closed-round winner board. */
#banknow {
  position: absolute;
  top: 150px; /* below the round strip, above gameplay focus */
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 22px;
  color: #0a0a12;
  background: #ff4455;
  border-radius: 4px;
  font-size: 17px;
  font-weight: bold;
  letter-spacing: 0.08em;
  animation: banknowpulse 0.6s infinite alternate;
  /* display is inline-controlled by intermission.js — a stylesheet
     display:none here would win over style.display='' forever */
}
@keyframes banknowpulse {
  from { opacity: 1; }
  to { opacity: 0.55; }
}

#intermission {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 8, 15, 0.72);
  pointer-events: none;
  z-index: 46; /* above the leaderboard card */
}
#intermission .im-card {
  pointer-events: auto;
  min-width: 320px;
  max-width: 560px;
  padding: 26px 34px;
  color: #e8ecf4;
  background: rgba(10, 10, 18, 0.94);
  border: 1px solid rgba(64, 200, 255, 0.35);
  border-radius: 10px;
  text-align: center;
  letter-spacing: 0.05em;
}
#intermission .im-title { font-size: 22px; letter-spacing: 0.12em; color: #ffd76a; }
#intermission .im-sub { margin-top: 8px; font-size: 13px; color: #8b93a7; }
#intermission .im-row {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 6px 12px; margin-top: 6px; font-size: 14px;
  background: rgba(28, 34, 52, 0.6); border-radius: 4px;
}
#intermission .im-row.top { border: 1px solid rgba(255, 215, 106, 0.3); }
#intermission .im-rank { color: #8a93a8; }
#intermission .im-alias { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; }
#intermission .im-wallet { color: #8a93a8; font-size: 11px; }
#intermission .im-score { color: #7fe08a; }
#intermission .im-prize { color: #ffd76a; }
#intermission .im-mine { margin-top: 12px; font-size: 13px; color: #ffb84d; }
#intermission .im-play {
  margin-top: 14px; padding: 8px 24px; font-family: inherit; font-size: 15px;
  letter-spacing: 0.08em; color: #0a0a12; background: #35d0a0;
  border: none; border-radius: 4px; cursor: pointer;
}
#intermission .im-play:hover:not(:disabled) { background: #4be0b0; }
#intermission .im-play:disabled { opacity: 0.45; cursor: default; }
#intermission .im-foot { margin-top: 12px; font-size: 13px; color: #8b93a7; }
#intermission .im-rules {
  display: inline-block; margin-top: 10px; color: #7fd4ff;
  font-size: 12px; text-decoration: none;
}
#intermission .im-rules:hover { text-decoration: underline; }

/* -------------------------------------------------------------- title --
   04-01: translucent neon card over the live arena (the spectator socket
   renders behind it). Pointer events only on the card — the arena stays
   alive underneath. */
#title {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 40;
}
#title .t-card {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 34px 44px 30px;
  background: rgba(8, 12, 24, 0.82);
  border: 1px solid rgba(64, 200, 255, 0.35);
  border-radius: 10px;
  box-shadow: 0 0 40px rgba(0, 170, 255, 0.18), inset 0 0 60px rgba(0, 60, 120, 0.15);
  backdrop-filter: blur(3px);
}
/* The VICEFALL wordmark — the landing page's neon logo: a white core in
   cyan and magenta glow, a magenta copy (top) and a cyan copy (bottom)
   offset behind it that jump now and then, a slow breathe and a flicker. */
#title .t-name {
  position: relative;
  z-index: 0;
  font-family: 'Monoton', 'Anton', sans-serif;
  font-size: 64px;
  line-height: 1.05;
  letter-spacing: 0.04em;
  color: #f2feff;
  text-shadow:
    0 0 6px rgba(255, 255, 255, 0.9),
    0 0 16px #00e5ff,
    0 0 36px #00e5ff,
    0 0 70px rgba(255, 46, 166, 0.8),
    0 0 120px rgba(255, 46, 166, 0.55);
  white-space: nowrap;
  animation: t-logo-breathe 5s ease-in-out infinite, t-logo-outage 9s linear infinite;
}
#title .t-name::before,
#title .t-name::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.85;
  text-shadow: none; /* the glow is the core's: inherited, the band clip cut it into hard boxes */
}
#title .t-name::before {
  color: #ff2ea6;
  transform: translate(0.035em, 0.02em);
  clip-path: polygon(0 0, 100% 0, 100% 38%, 0 42%);
  animation: t-logo-glitch-a 3.7s infinite steps(1);
}
#title .t-name::after {
  color: #00e5ff;
  transform: translate(-0.035em, -0.015em);
  clip-path: polygon(0 62%, 100% 58%, 100% 100%, 0 100%);
  animation: t-logo-glitch-b 4.3s infinite steps(1);
}
@keyframes t-logo-glitch-a {
  0%, 88%, 100% { transform: translate(0.035em, 0.02em); }
  90% { transform: translate(0.11em, 0.02em); }
  92% { transform: translate(-0.06em, 0.05em); }
  94% { transform: translate(0.035em, 0.02em); }
}
@keyframes t-logo-glitch-b {
  0%, 82%, 100% { transform: translate(-0.035em, -0.015em); }
  84% { transform: translate(-0.12em, -0.03em); }
  86% { transform: translate(0.07em, 0em); }
  88% { transform: translate(-0.035em, -0.015em); }
}
@keyframes t-logo-breathe {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.14); }
}
@keyframes t-logo-outage {
  0%, 91%, 94.5%, 96%, 100% { opacity: 1; }
  92%, 95% { opacity: 0.55; }
}
#title .t-tag {
  font-size: 13px;
  color: #9fb4d0;
  letter-spacing: 0.5px;
  margin-top: -6px;
}
#title .t-account {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
#title .t-who {
  font-family: 'Anton', sans-serif;
  font-size: 22px;
  letter-spacing: 1.5px;
  color: #5ce8c8;
  text-shadow: 0 0 12px rgba(92, 232, 200, 0.4);
}
#title .t-addr {
  font-size: 12px;
  color: #7f93ad;
  font-family: monospace;
  letter-spacing: 1px;
}
#title .t-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 260px;
}
#title .t-btn {
  font-family: 'Anton', sans-serif;
  font-size: 17px;
  letter-spacing: 2px;
  padding: 11px 22px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid rgba(64, 200, 255, 0.5);
  background: rgba(16, 32, 56, 0.9);
  color: #d8ecff;
  text-shadow: 0 0 8px rgba(120, 210, 255, 0.35);
  transition: background 0.12s, box-shadow 0.12s;
}
#title .t-btn:hover { background: rgba(28, 56, 92, 0.95); box-shadow: 0 0 16px rgba(64, 200, 255, 0.3); }
#title .t-btn.primary {
  border-color: rgba(255, 200, 60, 0.65);
  color: #ffd23c;
  text-shadow: 0 0 10px rgba(255, 200, 60, 0.4);
}
#title .t-btn.primary:hover { background: rgba(70, 52, 12, 0.9); box-shadow: 0 0 16px rgba(255, 200, 60, 0.3); }
#title .t-btn.dim {
  border-color: rgba(120, 140, 170, 0.35);
  color: #9fb4d0;
  font-size: 14px;
  text-shadow: none;
}
#title .t-err {
  font-size: 12px;
  color: #ff8d7a;
  max-width: 300px;
  text-align: center;
}
#title .t-pitch {
  font-size: 13px;
  color: #ffb84d;
  max-width: 320px;
  text-align: center;
  min-height: 16px;
}
#title .t-rules {
  font-size: 12px;
  color: #7fd4ff;
  text-decoration: none;
}
#title .t-rules:hover { text-decoration: underline; }
@media (max-width: 600px) {
  #title .t-card { padding: 24px 22px 20px; }
  #title .t-name { font-size: 40px; }
}

/* ------------------------------ title: character panel (player-menu) --- */

#title { gap: 28px; }
#title .t-row { display: flex; gap: 10px; min-width: 260px; }
#title .t-row .t-btn { flex: 1; }
#title .t-hero {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 18px 14px;
  background: rgba(8, 12, 24, 0.76);
  border: 1px solid rgba(64, 200, 255, 0.28);
  border-radius: 10px;
  box-shadow: 0 0 40px rgba(0, 170, 255, 0.14), inset 0 0 60px rgba(0, 60, 120, 0.12);
  backdrop-filter: blur(3px);
}
#title .t-hero-head { font-size: 13px; letter-spacing: 3px; color: #7fd4ff; }

/* Roster (left) · pedestal (right). The roster is as tall as the stage and
   scrolls when there are more heroes than fit. */
#title .t-hero-body { display: flex; gap: 14px; align-items: flex-start; }
#title .t-roster {
  display: flex;
  flex-direction: column;
  gap: 6px;             /* 4 tiles × 100 + 3 × 6 + 2 = the stage's 420 */
  max-height: 420px;
  overflow-y: auto;
  padding: 1px 6px 1px 1px;
  scrollbar-width: thin;
  scrollbar-color: rgba(64, 200, 255, 0.35) transparent;
}
#title .t-tile {
  position: relative;
  flex: none;
  width: 100px;
  height: 100px;
  padding: 0;
  border: 2px solid rgba(120, 140, 170, 0.35);
  border-radius: 6px;
  overflow: hidden;
  background: #070b16;
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s, transform 0.12s;
}
#title .t-tile .pt-img { filter: saturate(0.55) brightness(0.72); transition: filter 0.15s; }
#title .t-tile:hover { border-color: rgba(64, 200, 255, 0.8); transform: translateY(-1px); }
#title .t-tile:hover .pt-img { filter: none; }
#title .t-tile:focus-visible { outline: 2px solid #7fd4ff; outline-offset: 2px; }
#title .t-tile.on {
  border-color: #ffd23c;
  box-shadow: 0 0 16px rgba(255, 200, 60, 0.45), inset 0 0 0 1px rgba(255, 230, 150, 0.5);
}
#title .t-tile.on .pt-img { filter: none; }
#title .t-tile-name {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 10px 0 3px;
  font-family: 'Anton', sans-serif;
  font-size: 13px;
  letter-spacing: 2px;
  color: #cfe0f4;
  background: linear-gradient(transparent, rgba(4, 6, 14, 0.92) 55%);
  text-align: center;
  pointer-events: none;
}
#title .t-tile.on .t-tile-name { color: #ffd23c; }

#title .t-podium { display: flex; flex-direction: column; gap: 8px; width: 280px; }
/* The 3D character is drawn into this box (showcase.js): a frame, a backdrop
   and the name plate on top — keep the middle free. */
#title .t-stage {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 420px;
  border-radius: 8px;
  cursor: grab;
  touch-action: none;
  background:
    radial-gradient(ellipse 60% 16% at 50% 90%, rgba(64, 200, 255, 0.24), transparent 70%),
    radial-gradient(ellipse 70% 60% at 50% 45%, rgba(40, 70, 130, 0.35), transparent 75%),
    linear-gradient(180deg, rgba(10, 16, 32, 0.9), rgba(4, 6, 14, 0.95));
  box-shadow: inset 0 0 0 1px rgba(64, 200, 255, 0.12), inset 0 -30px 60px rgba(0, 0, 0, 0.5);
}
#title .t-stage:active { cursor: grabbing; }
#title .t-stage-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#title .t-plate {
  position: absolute;
  top: 12px; left: 0; right: 0;
  text-align: center;
  pointer-events: none;
  z-index: 1;
}
#title .t-skin {
  font-size: 30px;
  letter-spacing: 4px;
  line-height: 1;
  color: #ffd23c;
  text-shadow: 0 0 14px rgba(255, 190, 40, 0.45), 0 2px 0 #6b4a00;
}
#title .t-callsign {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  font-size: 12px;
  letter-spacing: 2px;
  color: #7fd4ff;
}
#title .t-callsign input {
  font-family: 'Anton', sans-serif;
  font-size: 20px;
  letter-spacing: 2px;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid rgba(64, 200, 255, 0.45);
  background: rgba(4, 10, 22, 0.9);
  color: #eaf6ff;
  outline: none;
  text-transform: none;
}
#title .t-callsign input:focus { border-color: rgba(255, 210, 60, 0.8); box-shadow: 0 0 14px rgba(255, 200, 60, 0.25); }
#title .t-callsign input::placeholder { color: #4d6380; }
#title .t-namenote {
  width: 100%;
  min-height: 16px;
  font-size: 12px;
  color: #8fa6c2;
  letter-spacing: 0.5px;
}
#title .t-namenote.bad { color: #ff8d7a; }
/* A guest pressed play with no call sign (title.js needName): the field flashes red and shakes. */
#title .t-callsign.need { color: #ff6b6b; }
#title .t-callsign.need input { border-color: #ff4d4d; box-shadow: 0 0 0 2px rgba(255, 77, 77, 0.35), 0 0 18px rgba(255, 60, 60, 0.45); animation: t-need 0.5s ease-in-out 2; }
@keyframes t-need {
  0%, 100% { transform: translateX(0); background: rgba(4, 10, 22, 0.9); }
  20% { transform: translateX(-6px); background: rgba(90, 10, 16, 0.9); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); background: rgba(90, 10, 16, 0.9); }
  80% { transform: translateX(4px); }
}
/* Medium widths: hero select + card side by side only fit with a slimmer
   stage and card. */
@media (max-width: 1060px) and (min-width: 861px) {
  #title { gap: 16px; }
  #title .t-podium { width: 230px; }
  #title .t-card { padding: 26px 24px 22px; }
  #title .t-name { font-size: 38px; letter-spacing: 2px; }
  #title .t-tag { max-width: 300px; text-align: center; }
}
/* Short windows: a shorter stage (and roster) so the panel fits. */
@media (max-height: 700px) {
  #title .t-stage { height: 340px; }
  #title .t-roster { max-height: 340px; }
}
/* Narrow: the panel stacks above the card; the roster becomes a strip of
   48 px portraits (the hand-reduced take — never a smeared 96) over the stage. */
@media (max-width: 860px) {
  #title { flex-direction: column; gap: 12px; overflow-y: auto; justify-content: flex-start; padding: 16px 0; }
  #title .t-hero { width: min(340px, calc(100vw - 32px)); padding: 12px 14px; box-sizing: border-box; }
  #title .t-hero-body { flex-direction: column; gap: 10px; }
  #title .t-roster { flex-direction: row; max-height: none; max-width: 100%; overflow-x: auto; overflow-y: hidden; padding: 2px; }
  #title .t-tile { width: 52px; height: 52px; }
  #title .t-tile .pt-96 { width: 48px; height: 48px; }
  #title .t-tile .pt-96 .pt-img { width: 48px; height: 48px; }
  #title .t-tile picture { display: block; }
  #title .t-tile-name { display: none; }
  #title .t-podium { width: 100%; }
  #title .t-stage { height: 220px; }
  #title .t-skin { font-size: 24px; }
}

/* Phones (2026-10-13, docs/TOUCH-CONTROLS.md §8): the call sign and the two
   PLAY buttons show without scrolling. Portrait: a shorter stage and a tight card. */
@media (max-width: 600px) {
  #title { gap: 10px; padding: calc(env(safe-area-inset-top, 0px) + 10px) 0 calc(env(safe-area-inset-bottom, 0px) + 10px); }
  #title .t-hero { gap: 6px; padding: 10px 12px; }
  #title .t-stage { height: clamp(140px, 24vh, 220px); }
  #title .t-card { width: min(340px, calc(100vw - 32px)); box-sizing: border-box; padding: 14px 16px; gap: 10px; }
  #title .t-name { font-size: 32px; }
  #title .t-tag { display: none; }
  #title .t-buttons { min-width: 0; width: 100%; gap: 8px; }
  #title .t-row { min-width: 0; }
  #title .t-btn { padding: 9px 16px; font-size: 15px; }
}
/* Short landscape (a phone on its side, a folded Fold): hero and card side by
   side, everything at the screen's height. */
@media (max-height: 520px) and (min-width: 560px) {
  #title { flex-direction: row; align-items: center; justify-content: center; overflow-y: auto; gap: 12px;
    padding: calc(env(safe-area-inset-top, 0px) + 8px) calc(env(safe-area-inset-right, 0px) + 8px) calc(env(safe-area-inset-bottom, 0px) + 8px) calc(env(safe-area-inset-left, 0px) + 8px); }
  #title .t-hero { width: auto; padding: 8px 10px; gap: 5px; }
  #title .t-hero-head { font-size: 11px; letter-spacing: 2px; }
  #title .t-hero-body { flex-direction: row; gap: 8px; }
  #title .t-roster { flex-direction: column; max-height: calc(100vh - 140px); max-width: none; overflow-x: hidden; overflow-y: auto; }
  #title .t-tile { width: 46px; height: 46px; }
  #title .t-tile .pt-96, #title .t-tile .pt-96 .pt-img { width: 42px; height: 42px; }
  #title .t-podium { width: clamp(150px, 26vw, 230px); }
  #title .t-stage { height: calc(100vh - 140px); min-height: 120px; }
  #title .t-skin { font-size: 20px; }
  #title .t-callsign { font-size: 10px; gap: 2px; }
  #title .t-callsign input { font-size: 16px; padding: 5px 10px; } /* ≥ 16 px: iOS zooms into smaller fields */
  #title .t-namenote { font-size: 10px; min-height: 12px; }
  #title .t-card { padding: 12px 16px; gap: 8px; max-height: calc(100vh - 16px); overflow-y: auto; box-sizing: border-box; }
  #title .t-name { font-size: 30px; }
  #title .t-tag { display: none; }
  #title .t-buttons { gap: 6px; min-width: 220px; }
  #title .t-btn { padding: 7px 14px; font-size: 14px; }
}

/* Phones, 2026-10-13 ("the mobile menus are not well laid out"): the title is
   one full-screen layout, not two floating cards (title.js place() adds .phone
   at CONFIG.heroSelect.phoneMedia, .portrait when taller than wide, and moves
   the call sign in with the controls). Portrait: the logo, the hero filling
   the middle, the hero chips across, then the call sign and PLAY in the
   thumb's reach. Landscape: the hero on the left, the controls on the right.
   Everything a thumb presses is at least 44 px. */
#title.phone {
  pointer-events: auto;
  box-sizing: border-box;
  overflow: hidden;
  gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) calc(env(safe-area-inset-right, 0px) + 14px)
    calc(env(safe-area-inset-bottom, 0px) + 12px) calc(env(safe-area-inset-left, 0px) + 14px);
  background: linear-gradient(180deg, rgba(4, 7, 16, 0.5), rgba(4, 7, 16, 0.8) 55%, rgba(4, 7, 16, 0.92));
}
#title.phone .t-hero, #title.phone .t-card {
  background: none; border: 0; border-radius: 0; box-shadow: none; backdrop-filter: none;
  padding: 0; width: auto; max-height: none; overflow: visible; min-width: 0; min-height: 0; box-sizing: border-box;
}
#title.phone .t-hero-head, #title.phone .t-tag { display: none; }
#title.phone .t-hero { display: flex; flex-direction: column; gap: 0; }
#title.phone .t-hero-body { flex: 1 1 auto; min-height: 0; display: flex; gap: 8px; align-items: stretch; }
#title.phone .t-podium { flex: 1 1 auto; width: auto; min-width: 0; min-height: 0; display: flex; }
#title.phone .t-stage { flex: 1 1 auto; height: auto; min-height: 150px; }
#title.phone .t-skin { font-size: 24px; }
#title.phone .t-outfit-step { width: 40px; height: 40px; font-size: 22px; }
#title.phone .t-roster { max-height: none; max-width: none; padding: 2px; gap: 8px; scrollbar-width: none; }
#title.phone .t-tile { flex: 0 0 auto; width: auto; height: auto; aspect-ratio: 1; }
#title.phone .t-tile picture, #title.phone .t-tile .pt-96, #title.phone .t-tile .pt-96 .pt-img { display: block; width: 100%; height: 100%; }
#title.phone .t-tile-name { display: none; }
/* The controls: a six-column grid — the two PLAY buttons half each, the small
   ones sharing a row (title.js sets --t-sec-span), the rest full width. */
#title.phone .t-card { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px 8px; align-content: center; }
#title.phone .t-card > * { grid-column: 1 / -1; }
#title.phone .t-buttons, #title.phone .t-row { display: contents; }
#title.phone .t-btn { min-height: 44px; padding: 4px 8px; font-size: 13px; letter-spacing: 1.5px; line-height: 1.1; }
#title.phone .t-btn.t-play { grid-column: span 3; min-height: 56px; font-size: clamp(14px, 4.4vw, 18px); }
#title.phone .t-btn.primary:not(.t-play) { min-height: 52px; font-size: 17px; }
#title.phone .t-btn.t-sec, #title.phone .t-row .t-btn { grid-column: span var(--t-sec-span, 2); }
#title.phone .t-callsign { gap: 4px; font-size: 11px; }
#title.phone .t-callsign input { font-size: 18px; min-height: 46px; padding: 6px 12px; box-sizing: border-box; } /* ≥ 16 px: iOS zooms into smaller fields */
#title.phone .t-namenote { font-size: 11px; min-height: 13px; margin-top: -4px; }
#title.phone .t-rules { justify-self: center; display: flex; align-items: center; min-height: 44px; padding: 0 16px; font-size: 13px; margin: -8px 0 -10px; }
#title.phone .t-account, #title.phone .t-pitch, #title.phone .t-err { justify-self: center; text-align: center; }

#title.phone.portrait { flex-direction: column; align-items: stretch; justify-content: flex-start; }
#title.phone.portrait .t-name { flex: none; align-self: center; font-size: clamp(26px, 8.4vw, 36px); margin-top: 2px; }
#title.phone.portrait .t-hero { flex: 1 1 auto; }
#title.phone.portrait .t-hero-body { flex-direction: column; gap: 10px; }
#title.phone.portrait .t-roster { order: 1; flex: none; flex-direction: row; justify-content: center; overflow-x: auto; overflow-y: hidden; }
#title.phone.portrait .t-tile { width: clamp(52px, 17vw, 76px); }
#title.phone.portrait .t-card { flex: none; width: 100%; max-width: 480px; align-self: center; }

#title.phone:not(.portrait) { flex-direction: row; align-items: stretch; justify-content: center; gap: 18px; }
#title.phone:not(.portrait) .t-hero { flex: 1 1 0; max-width: 560px; }
#title.phone:not(.portrait) .t-hero-body { flex-direction: row; }
#title.phone:not(.portrait) .t-roster { flex: none; flex-direction: column; justify-content: center; overflow-x: hidden; overflow-y: auto; width: clamp(48px, 14vh, 68px); }
#title.phone:not(.portrait) .t-tile { width: 100%; }
#title.phone:not(.portrait) .t-stage { min-height: 0; }
#title.phone:not(.portrait) .t-card { flex: 0 1 360px; min-width: 260px; overflow-y: auto; align-content: center; gap: 8px;
  padding: 10px 14px; border-radius: 10px; background: rgba(8, 12, 24, 0.72); border: 1px solid rgba(64, 200, 255, 0.22); }
#title.phone:not(.portrait) .t-name { font-size: clamp(26px, 7vh, 34px); justify-self: center; }
@media (max-height: 400px) {
  #title.phone:not(.portrait) .t-btn.t-play { min-height: 48px; }
}
/* On the phone title the in-play HUD steps aside; VOL stays in its corner, above the title. */
@media (max-width: 600px), (max-height: 520px) {
  body.title-on #minimap { display: none !important; }
  html body.title-on #volbtn { z-index: 41; top: calc(env(safe-area-inset-top, 0px) + 8px); right: calc(env(safe-area-inset-right, 0px) + 8px); }
}

/* Phones: the leaderboard and MY PRIZES as sheets with a 44 px close and tabs. */
@media (max-width: 600px), (max-height: 520px) {
  #lb { pointer-events: auto; background: rgba(2, 4, 10, 0.6); }
  #lb .lb-card { background: rgba(8, 12, 24, 0.97); width: min(640px, calc(100vw - 16px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
    max-height: calc(100vh - 16px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); padding: 12px 14px 8px; box-sizing: border-box; }
  #lb .lb-close, #prizes .pz-close { min-width: 44px; min-height: 44px; margin: -8px -8px -8px 0; font-size: 26px; }
  #lb .lb-tabs { margin: 8px 0 8px; }
  #lb .lb-tabs button { min-height: 44px; padding: 2px 4px; line-height: 1.15; }
  #lb .lb-body { flex: 1 1 auto; min-height: 0; overscroll-behavior: contain; }
  #lb .lb-rules { display: flex; align-items: center; justify-content: center; min-height: 44px; }
}
@media (max-width: 600px) and (orientation: portrait) {
  #lb .lb-card { height: calc(100vh - 16px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); }
}

/* ----------------------------------------- menu + settings (player-menu) --- */

#menu {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  background: rgba(3, 5, 12, 0.55);
  backdrop-filter: blur(4px);
}
#menu .m-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(460px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 26px 30px 24px;
  background: rgba(8, 12, 24, 0.92);
  border: 1px solid rgba(64, 200, 255, 0.35);
  border-radius: 10px;
  box-shadow: 0 0 40px rgba(0, 170, 255, 0.18), inset 0 0 60px rgba(0, 60, 120, 0.15);
  color: #d8ecff;
  box-sizing: border-box;
}
#menu .m-title { font-size: 32px; letter-spacing: 3px; color: #ffd23c; text-shadow: 0 0 14px rgba(255, 190, 40, 0.4), 0 2px 0 #6b4a00; }
#menu .m-sub, #menu .m-note, #menu .m-hint { font-family: system-ui, sans-serif; font-size: 12px; color: #8fa6c2; letter-spacing: 0.3px; }
#menu .m-hint { text-align: center; color: #5f7896; }
#menu .m-col { display: flex; flex-direction: column; gap: 10px; }
#menu .m-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
#menu .m-tabs { display: flex; gap: 6px; }
#menu .m-btn {
  font-family: 'Anton', sans-serif;
  font-size: 16px;
  letter-spacing: 2px;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid rgba(64, 200, 255, 0.5);
  background: rgba(16, 32, 56, 0.9);
  color: #d8ecff;
  transition: background 0.12s, box-shadow 0.12s;
}
#menu .m-btn:hover { background: rgba(28, 56, 92, 0.95); box-shadow: 0 0 16px rgba(64, 200, 255, 0.3); }
#menu .m-btn.primary { border-color: rgba(255, 200, 60, 0.65); color: #ffd23c; }
/* EXIT TO SKYDECK (menu.js, 2026-10-12): carrying cash, the first press arms it (red) and says what it costs. */
#menu .m-btn.m-exit.armed { border-color: rgba(255, 90, 90, 0.8); color: #ff8d7a; box-shadow: 0 0 14px rgba(255, 70, 70, 0.3); }
#menu .m-exitnote { min-height: 0; font-size: 12px; color: #ff8d7a; text-align: center; letter-spacing: 0.04em; }
#menu .m-exitnote:empty { display: none; }
#menu .m-btn.primary:hover { background: rgba(70, 52, 12, 0.9); box-shadow: 0 0 16px rgba(255, 200, 60, 0.3); }
#menu .m-btn.dim { border-color: rgba(120, 140, 170, 0.35); color: #9fb4d0; font-size: 13px; align-self: flex-start; }
#menu .m-tab { font-size: 13px; padding: 7px 14px; border-color: rgba(120, 140, 170, 0.35); color: #8fa6c2; }
#menu .m-tab.on { border-color: rgba(64, 200, 255, 0.8); color: #eaf6ff; background: rgba(28, 56, 92, 0.95); }
#menu .m-body { display: flex; flex-direction: column; gap: 10px; }
#menu .m-binds { display: flex; flex-direction: column; gap: 6px; }
#menu .m-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: system-ui, sans-serif;
  font-size: 14px;
  color: #cfe0f4;
}
#menu .m-label { flex: 1; }
#menu .m-key {
  min-width: 118px;
  font-size: 14px;
  padding: 6px 12px;
  text-align: center;
}
#menu .m-choice .m-key { min-width: 0; flex: 0 1 auto; padding: 6px 10px; } /* TOUCH: two or three options share a row */
#menu .m-key.on { border-color: #40c8ff; color: #9fe2ff; box-shadow: 0 0 10px rgba(64, 200, 255, 0.35); }
#menu .m-key.wait { border-color: rgba(255, 210, 60, 0.9); color: #ffd23c; animation: m-blink 0.9s ease-in-out infinite; }
@keyframes m-blink { 50% { box-shadow: 0 0 18px rgba(255, 200, 60, 0.45); } }
#menu .m-slider input[type=range] { flex: 1.3; accent-color: #40c8ff; }
#menu .m-val { min-width: 52px; text-align: right; font-family: 'Anton', sans-serif; letter-spacing: 1px; color: #7fd4ff; }
#menu .m-foot { display: flex; justify-content: flex-end; }

/* Phones (2026-10-13): settings is a sheet — the title and tabs on top, DONE
   always on screen at the bottom, the rows scrolling between; every control
   at least 44 px for a thumb, and sliders with a thumb-sized track. */
@media (max-width: 600px), (max-height: 520px) {
  #menu .m-card { width: min(560px, calc(100vw - 16px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
    max-height: calc(100vh - 16px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    overflow: hidden; padding: 14px 16px 12px; gap: 10px; }
  #menu .m-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-right: 2px; }
  #menu .m-head, #menu .m-foot { flex: none; }
  #menu .m-title { font-size: 30px; }
  #menu .m-tabs { flex: 1 1 auto; }
  #menu .m-tab { flex: 1 1 0; min-height: 44px; padding: 0 10px; }
  #menu .m-btn { min-height: 46px; }
  #menu .m-key { min-height: 44px; }
  #menu .m-row { min-height: 44px; }
  #menu .m-slider input[type=range] { height: 40px; }
  #menu .m-choice { flex-wrap: wrap; row-gap: 6px; }
  #menu .m-choice .m-label { flex: 1 0 100%; }
  #menu .m-choice .m-key { flex: 1 1 0; }
  #menu .m-foot .m-btn { min-width: 140px; }
}
@media (max-height: 520px) {
  #menu .m-title { font-size: 24px; }
  #menu .m-head { flex-wrap: nowrap; }
  #menu .m-choice .m-label { flex: 0 0 34%; }
}

/* --------------------------------------------- results screen (02-05) --- */

#results {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 8, 15, 0.55);
}

.r-card {
  min-width: 260px;
  padding: 26px 34px;
  color: #e8ecf4;
  background: rgba(10, 10, 18, 0.92);
  border: 1px solid #2a3040;
  border-radius: 6px;
  text-align: center;
  letter-spacing: 0.06em;
}

.r-title {
  font-size: 30px;
  margin-bottom: 14px;
}

.r-row {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  font-size: 15px;
  line-height: 1.9;
}

.r-row span { color: #8b93a7; }
.r-row b { color: #ffd94d; }

#r-again {
  margin-top: 18px;
  padding: 10px 30px;
  font-family: inherit;
  font-size: 17px;
  letter-spacing: 0.08em;
  color: #0a0a12;
  background: #35d0a0;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  pointer-events: auto; /* #ui is pointer-events:none */
}

#r-again:hover { background: #4be0b0; }

#r-menu {
  display: block;
  margin: 10px auto 0;
  padding: 7px 26px;
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 0.08em;
  color: #e8ecf4;
  background: transparent;
  border: 1px solid rgba(232, 236, 244, 0.35);
  border-radius: 4px;
  cursor: pointer;
  pointer-events: auto;
}
#r-menu:hover { background: rgba(255, 255, 255, 0.08); }

.r-hint {
  margin-top: 8px;
  font-size: 12px;
  color: #8b93a7;
}

.r-pitch {
  margin-top: 10px;
  font-size: 13px;
  color: #ffb84d;
}

#r-claim {
  margin-top: 10px;
  padding: 7px 20px;
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 0.08em;
  color: #e8ecf4;
  background: transparent;
  border: 1px solid rgba(64, 200, 255, 0.5);
  border-radius: 4px;
  cursor: pointer;
  pointer-events: auto;
}
#r-claim:hover { background: rgba(28, 56, 92, 0.9); }

/* Aim controls (branch aim-controls): shown during a run while the pointer is free. */
#aimhint {
  position: absolute;
  left: 50%;
  bottom: 18%;
  transform: translateX(-50%);
  padding: 8px 16px;
  border: 1px solid #35d0a0;
  border-radius: 6px;
  background: rgba(8, 10, 18, 0.72);
  color: #35d0a0;
  font: 15px/1 'Anton', sans-serif;
  letter-spacing: 0.12em;
  white-space: nowrap;
  pointer-events: none;
}

/* ------------------------------- round board in play (more-skins) --- */

/* Hold Tab: the full board over the game — input carries on underneath. */
#scoreboard {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start; /* under the round strip: you keep playing, so the centre (you) stays clear as long as the board fits */
  justify-content: center;
  padding-top: 138px;
  box-sizing: border-box;
  pointer-events: none;
  z-index: 30;
}
#scoreboard .sb-card {
  width: min(540px, calc(100vw - 32px));
  max-height: calc(100vh - 150px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 14px 20px 12px;
  background: rgba(6, 10, 20, 0.86);
  border: 1px solid rgba(64, 200, 255, 0.35);
  border-radius: 10px;
  box-shadow: 0 0 40px rgba(0, 170, 255, 0.18);
  box-sizing: border-box;
  color: #d8ecff;
}
#scoreboard .sb-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 14px; margin-bottom: 10px; }
#scoreboard .sb-title { font-size: 22px; letter-spacing: 3px; color: #ffd23c; text-shadow: 0 0 14px rgba(255, 190, 40, 0.4); }
#scoreboard .sb-meta { display: flex; gap: 14px; font-size: 14px; letter-spacing: 1.5px; color: #9fb4d0; }
#scoreboard .sb-pool { color: #5ce8c8; }
#scoreboard .sb-prizes { width: 100%; display: flex; gap: 14px; font-size: 12px; letter-spacing: 1.5px; color: #ffd23c; opacity: 0.85; }
#scoreboard .sb-body { display: flex; flex-direction: column; gap: 2px; min-height: 0; flex: 1 1 auto; }
#scoreboard .sb-top { display: flex; flex-direction: column; gap: 2px; min-height: 0; flex: 0 1 auto; overflow: hidden; }
#scoreboard .sb-head, #scoreboard .sb-foot, #scoreboard .sb-row, #scoreboard .sb-gap { flex: none; }
#scoreboard .sb-row {
  display: grid;
  grid-template-columns: 34px 1fr 110px 90px;
  align-items: center;
  gap: 8px;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 15px;
  letter-spacing: 1px;
  background: rgba(20, 30, 50, 0.55);
}
#scoreboard .sb-colhead { background: none; font-size: 11px; letter-spacing: 2px; color: #6f86a6; padding-top: 0; padding-bottom: 2px; }
#scoreboard .sb-row.podium .sb-rank { color: #ffd23c; }
#scoreboard .sb-row.me { background: rgba(53, 208, 160, 0.18); box-shadow: inset 0 0 0 1px rgba(92, 232, 200, 0.6); color: #eafff8; }
#scoreboard .sb-rank { text-align: right; color: #9fb4d0; }
#scoreboard .sb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: system-ui, sans-serif; font-weight: 600; font-size: 14px; }
#scoreboard .sb-score { text-align: right; color: #5ce8c8; }
#scoreboard .sb-prize { text-align: right; font-size: 13px; color: #ffd23c; }
#scoreboard .sb-gap, #scoreboard .sb-empty { text-align: center; color: #6f86a6; font-size: 13px; padding: 1px 4px; line-height: 1; font-family: system-ui, sans-serif; }
#scoreboard .sb-foot { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; font-family: system-ui, sans-serif; font-size: 12px; color: #9fb4d0; }
#scoreboard .sb-note { color: #ffb84d; }
#scoreboard .sb-hint { color: #5f7896; }

/* The mini board: bottom-right above the minimap, the top 3 and you. */
#miniboard {
  position: absolute;
  right: 12px;
  bottom: 186px;
  width: 190px;
  padding: 7px 9px 6px;
  background: rgba(8, 12, 24, 0.7);
  border: 1px solid rgba(120, 140, 170, 0.3);
  border-radius: 7px;
  pointer-events: none;
  color: #cfe0f4;
  transition: box-shadow 0.25s, border-color 0.25s;
}
#miniboard.up { border-color: rgba(92, 232, 160, 0.9); box-shadow: 0 0 16px rgba(92, 232, 160, 0.45); }
#miniboard.down { border-color: rgba(255, 110, 90, 0.9); box-shadow: 0 0 16px rgba(255, 110, 90, 0.4); }
#miniboard .mb-title { font-size: 10px; letter-spacing: 2px; color: #6f86a6; margin-bottom: 3px; }
#miniboard .mb-row { display: grid; grid-template-columns: 18px 1fr auto; gap: 6px; font-size: 13px; letter-spacing: 0.5px; padding: 1px 0; }
#miniboard .mb-row.me { color: #5ce8c8; }
#miniboard .mb-rank { text-align: right; color: #ffd23c; }
#miniboard .mb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: system-ui, sans-serif; font-size: 12px; font-weight: 600; grid-column: auto; }
#miniboard .mb-row.me .mb-name:only-child { grid-column: 1 / -1; }
#miniboard .mb-score { color: #9fe8d4; }
#miniboard .mb-note { font-family: system-ui, sans-serif; font-size: 11px; color: #6f86a6; }
#miniboard .mb-hint { margin-top: 3px; font-size: 9px; letter-spacing: 1.5px; color: #7890ad; }
@media (max-width: 600px) { #miniboard { display: none !important; } }

/* The results card's short board. */
#results .r-board { width: 100%; display: flex; flex-direction: column; gap: 3px; margin: 4px 0 6px; }
#results .r-board:empty { display: none; }
#results .r-board-title { font-size: 11px; letter-spacing: 2px; color: #6f86a6; }
#results .r-board-row { display: grid; grid-template-columns: 38px 1fr auto; gap: 8px; font-size: 14px; padding: 3px 8px; border-radius: 4px; background: rgba(20, 30, 50, 0.5); }
#results .r-board-row.me { background: rgba(53, 208, 160, 0.18); box-shadow: inset 0 0 0 1px rgba(92, 232, 200, 0.6); color: #eafff8; }
#results .r-board-row .rk { color: #ffd23c; }
#results .r-board-row .nm { font-family: system-ui, sans-serif; font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#results .r-board-row .sc { color: #5ce8c8; }
#results .r-board-gap { text-align: center; color: #6f86a6; font-size: 12px; }
#results .r-board-note { font-family: system-ui, sans-serif; font-size: 12px; color: #ffb84d; }

/* --------------------------------------------- demo mode: prize codes --- */

/* ev prize: you placed — the code, big. Above the intermission overlay. */
#prizecard, #prizes {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  z-index: 48;
  pointer-events: auto; /* #ui is pointer-events:none — without this no button here could be clicked */
}
#prizecard { background: rgba(4, 6, 12, 0.72); }
#prizecard .pz-card, #prizes .pz-panel {
  width: min(460px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  box-sizing: border-box;
  padding: 22px 24px 18px;
  background: rgba(8, 12, 24, 0.95);
  border: 1px solid rgba(255, 200, 60, 0.55);
  border-radius: 12px;
  box-shadow: 0 0 60px rgba(255, 190, 40, 0.22);
  color: #e8ecf4;
  text-align: center;
}
#prizecard .pz-kicker { font-size: 12px; letter-spacing: 2px; color: #7fd4ff; }
#prizecard .pz-big {
  font-family: 'Anton', sans-serif;
  font-size: 34px;
  letter-spacing: 3px;
  color: #ffd23c;
  text-shadow: 0 0 18px rgba(255, 190, 40, 0.5);
  margin: 4px 0 2px;
}
#prizecard .pz-score { font-size: 13px; color: #9fe8d4; }
#prizecard .pz-label { margin-top: 18px; font-size: 11px; letter-spacing: 2px; color: #8a93a8; }
#prizecard .pz-code {
  margin: 6px auto 0;
  padding: 12px 10px;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 4px;
  color: #eafff8;
  background: rgba(53, 208, 160, 0.12);
  border: 1px dashed rgba(92, 232, 200, 0.7);
  border-radius: 8px;
  user-select: all;
  -webkit-user-select: all;
  outline: none;
}
#prizecard .pz-warn { margin-top: 12px; font-size: 13px; line-height: 1.5; color: #ffb84d; }
#prizecard .pz-note, #prizes .pz-note { margin-top: 12px; font-size: 12px; color: #6f86a6; }
#prizecard .pz-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }

.pz-btn {
  font-family: 'Anton', sans-serif;
  font-size: 15px;
  letter-spacing: 2px;
  padding: 9px 18px;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  border: 1px solid rgba(120, 140, 170, 0.45);
  background: rgba(16, 32, 56, 0.9);
  color: #9fb4d0;
}
.pz-btn.primary { border-color: rgba(255, 200, 60, 0.7); color: #ffd23c; }
.pz-btn:hover { background: rgba(28, 56, 92, 0.95); }
.pz-btn.small { font-size: 12px; padding: 5px 10px; letter-spacing: 1.5px; }

/* MY PRIZES (the title). */
#prizes { background: rgba(4, 6, 12, 0.55); }
#prizes .pz-panel { text-align: left; border-color: rgba(64, 200, 255, 0.4); box-shadow: 0 0 40px rgba(0, 170, 255, 0.18); }
#prizes .pz-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
#prizes .pz-title { font-family: 'Anton', sans-serif; font-size: 22px; letter-spacing: 3px; color: #ffd23c; }
#prizes .pz-close { background: none; border: none; font-family: system-ui, sans-serif; font-size: 24px; padding: 0 4px; color: #8a93a8; }
#prizes .pz-list { display: flex; flex-direction: column; gap: 6px; }
#prizes .pz-item {
  display: block;
  padding: 9px 12px; border-radius: 6px; background: rgba(20, 30, 50, 0.6);
}
#prizes .pz-item-meta { font-size: 13px; color: #cfd6e4; }
#prizes .pz-status { font-size: 11px; letter-spacing: 1.5px; color: #9fb4d0; }
#prizes .pz-status.claimed { color: #7fd4ff; }
#prizes .pz-status.paid { color: #5ce8a0; }
#prizes .pz-status.rejected { color: #ff8d7a; }
#prizes .pz-empty { font-size: 13px; line-height: 1.6; color: #9fb4d0; padding: 8px 0; }

/* ------------------------------------------ portraits (portraits.js) --- */

/* Pixel art: always at an exact multiple of its 48/96 px source, nearest-neighbour. */
.pt { display: inline-block; flex: none; position: relative; overflow: hidden; border-radius: 3px; background: #0b1020; vertical-align: middle; }
.pt-img { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.pt-24 { width: 24px; height: 24px; }
.pt-48 { width: 48px; height: 48px; }
.pt-96 { width: 96px; height: 96px; }
/* No portrait for this skin: a quiet silhouette. */
.pt-none {
  background:
    radial-gradient(circle at 50% 38%, rgba(120, 140, 170, 0.45) 0 18%, transparent 19%),
    radial-gradient(ellipse 36% 30% at 50% 100%, rgba(120, 140, 170, 0.35) 0 98%, transparent 100%),
    #0b1020;
}

/* The podium: 2nd · 1st (raised) · 3rd, gold / silver / bronze. */
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 14px; margin: 4px 0 10px; }
.pd-slot { display: flex; flex-direction: column; align-items: center; width: 132px; min-width: 0; text-align: center; }
.pd-1 { order: 2; }
.pd-2 { order: 1; }
.pd-3 { order: 3; }
.pd-1 .pd-frame { margin-bottom: 18px; } /* the winner stands higher */
.pd-frame { position: relative; padding: 2px; border-radius: 6px; line-height: 0; --pd: #c9d3e0; background: var(--pd); box-shadow: 0 0 14px color-mix(in srgb, var(--pd) 45%, transparent); }
.pd-1 .pd-frame { --pd: #ffd23c; }
.pd-2 .pd-frame { --pd: #c9d3e0; }
.pd-3 .pd-frame { --pd: #d08a4a; }
.pd-frame .pt { border-radius: 4px; }
.pd-place {
  position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%);
  padding: 3px 7px 2px; border-radius: 4px; line-height: 1;
  font-family: 'Anton', sans-serif; font-size: 11px; letter-spacing: 1.5px;
  background: var(--pd); color: #140e00;
}
.pd-name { margin-top: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: system-ui, sans-serif; font-weight: 700; font-size: 13px; color: #e8ecf4; }
.pd-score { font-size: 14px; color: #5ce8c8; letter-spacing: 0.5px; }
.pd-prize { font-size: 11px; letter-spacing: 1.5px; color: #ffd23c; }
.pd-bot { font-size: 10px; letter-spacing: 1.5px; color: #8a93a8; }
.pd-slot.me .pd-name { color: #5ce8c8; }
.pd-open { opacity: 0.4; }
.pd-open .pd-frame { --pd: rgba(120, 140, 170, 0.5); box-shadow: none; }
@media (max-width: 600px) {
  .podium { gap: 6px; }
  .pd-slot { width: 100px; }
}

/* Inline top-3 portraits (24 px): mini board, results card, past rounds. */
#miniboard { width: 210px; }
#miniboard .mb-row { align-items: center; }
#miniboard .mb-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
#miniboard .mb-alias { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#results .r-board-row { align-items: center; }
#results .r-board-row .nm { display: flex; align-items: center; gap: 6px; }
#lb .lb-alias .pt { display: inline-block; vertical-align: middle; width: 32px; height: 32px; margin-right: 8px; border-radius: 4px; overflow: hidden; }
#lb .lb-alias .pt .pt-img { width: 32px; height: 32px; }
#lb .lb-row { align-items: center; }
#lb .lb-pt-slot { padding-left: 40px; }
/* Today / All time (2026-10-11): the day, the countdown, you. */
#lb .lb-tabs { flex-wrap: wrap; }
#lb .lb-board-head { display: flex; align-items: center; gap: 8px; padding: 2px 0 4px; }
#lb .lb-board-title { font-family: 'Anton', sans-serif; letter-spacing: 0.12em; color: #e8ecf4; font-size: 15px; }
#lb .lb-board-when { margin-left: auto; color: #ffd76a; font-size: 12px; letter-spacing: 0.06em; font-variant-numeric: tabular-nums; }
#lb .lb-daynav { background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(159, 179, 216, 0.25); color: #cfd6e4; border-radius: 6px; width: 26px; height: 24px; cursor: pointer; font-size: 15px; line-height: 1; }
#lb .lb-daynav:hover:not(:disabled) { border-color: #7fd4ff; color: #fff; }
#lb .lb-daynav:disabled { opacity: 0.3; cursor: default; }
#lb .lb-board-note { color: #8a93a8; font-size: 11px; padding-bottom: 6px; }
#lb .lb-row.me { background: rgba(53, 208, 160, 0.12); border-radius: 6px; box-shadow: inset 2px 0 0 #35d0a0; }
#lb .lb-row.me .lb-alias { color: #35d0a0; }
#lb .lb-gap { text-align: center; color: #8a93a8; padding: 2px 0; letter-spacing: 0.3em; }
#scoreboard .podium { flex: none; margin: 2px 0 12px; }
#intermission .podium { margin: 6px 0 12px; }

/* Outfits: a stepper in the stage's name plate (title.js) — ‹ OUTFIT ›, then
   n / N and dots. Overlaid on the stage, so every hero's panel is one size. */
#title .t-outfit-row {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 6px; pointer-events: auto;
}
#title .t-outfit-step {
  width: 26px; height: 26px; padding: 0; min-width: 0;
  font-family: system-ui, sans-serif; font-size: 18px; line-height: 1;
  border-radius: 50%; background: rgba(6, 10, 20, 0.72);
}
#title .t-outfit-step:hover { border-color: rgba(255, 210, 60, 0.8); color: #ffd23c; }
#title .t-outfit-mid { width: 150px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
#title .t-outfit {
  width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12px; letter-spacing: 2.5px; line-height: 14px; color: #e6f0ff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
}
#title .t-outfit-count {
  display: flex; align-items: center; justify-content: center; height: 7px;
  font-size: 9px; letter-spacing: 1.5px; line-height: 7px; color: #9fb4d0;
}
#title .t-outfit-dots { display: inline-flex; gap: 4px; }
#title .t-outfit-dots i { width: 5px; height: 5px; border-radius: 50%; background: rgba(160, 180, 210, 0.35); }
#title .t-outfit-dots i.on { background: #ffd23c; box-shadow: 0 0 6px rgba(255, 200, 60, 0.6); }
@media (max-width: 860px) {
  #title .t-outfit-mid { width: 130px; }
}

/* Claim form (prizes.js): paste a wallet, SUBMIT. */
.pz-claim { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pz-claim .pz-wallet {
  flex: 1 1 220px; min-width: 0; box-sizing: border-box; padding: 10px 12px;
  background: #0d1220; color: #eafff8; border: 1px solid #2a3450; border-radius: 6px;
  font-family: ui-monospace, Menlo, monospace; font-size: 13px; letter-spacing: 0.02em;
}
.pz-claim .pz-wallet:focus { outline: none; border-color: #35d0a0; }
.pz-claim.small .pz-wallet { padding: 6px 8px; font-size: 12px; }
.pz-claim .pz-msg { flex-basis: 100%; }
.pz-msg { margin-top: 8px; font-size: 13px; line-height: 1.5; }
.pz-msg:empty { display: none; }
.pz-msg.ok { color: #9fe8d4; }
.pz-msg.err { color: #ffb0a0; }
#prizes .pz-item-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* ---- the Skydeck (docs/SKYDECK.md, deck.js) ---- */
#deckprompt {
  position: absolute; left: 50%; bottom: 7%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px;
  padding: 10px 20px 10px 12px; border-radius: 30px;
  background: rgba(14, 8, 30, 0.72); border: 2px solid #37e6ff;
  color: #fff; font-family: 'Anton', sans-serif; font-size: 22px; letter-spacing: 1px;
  pointer-events: none; text-shadow: 0 0 10px rgba(55, 230, 255, 0.6);
}
#deckprompt .dp-ring {
  --p: 0; width: 38px; height: 38px; border-radius: 50%;
  background: conic-gradient(#37e6ff calc(var(--p) * 1%), rgba(255, 255, 255, 0.15) 0);
  -webkit-mask: radial-gradient(circle, transparent 11px, #000 12px);
  mask: radial-gradient(circle, transparent 11px, #000 12px);
}
#deckprompt.dp-warn { border-color: #ffa53a; text-shadow: 0 0 10px rgba(255, 165, 58, 0.6); }
#deckprompt.dp-warn .dp-ring { background: conic-gradient(#ffa53a calc(var(--p) * 1%), rgba(255, 255, 255, 0.15) 0); }
#deckprompt.dp-locked { border-color: #8a2a4a; color: #e8b8c8; }
#runcard {
  position: absolute; left: 50%; top: 18%; transform: translateX(-50%);
  min-width: 280px; padding: 14px 22px; border-radius: 10px;
  background: rgba(14, 8, 30, 0.82); border: 2px solid #ff3fd2;
  color: #fff; font-family: 'Anton', sans-serif; pointer-events: none;
  box-shadow: 0 0 24px rgba(255, 63, 210, 0.35);
}
#runcard .rc-title { font-size: 24px; color: #ff3fd2; margin-bottom: 8px; letter-spacing: 1px; }
#runcard .rc-row { display: flex; justify-content: space-between; gap: 30px; font-size: 20px; line-height: 1.5; }
#runcard .rc-good span:last-child { color: #35d07a; }
#runcard .rc-bad span:last-child { color: #ff6a6a; }
#beamflash {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse 18% 100% at 50% 50%, rgba(255, 255, 255, 0.95), rgba(120, 230, 255, 0.35) 55%, transparent 80%);
}
#beamflash.on { animation: beamflash 0.9s ease-out; }
@keyframes beamflash { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }

/* ---- the Skydeck, phase 2 (deck.js hint, deckui.js overlays) ---- */
#deckhint {
  position: absolute; left: 50%; bottom: 16%; transform: translateX(-50%);
  padding: 6px 16px; border-radius: 6px; background: rgba(14, 8, 30, 0.75);
  border: 1px solid #ff3fd2; color: #fff; font-family: 'Anton', sans-serif; font-size: 18px;
  letter-spacing: 1px; pointer-events: none;
}
#deckui {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  pointer-events: auto; /* #ui ignores the mouse: an overlay must take it back or nothing is clickable */
  background: rgba(6, 3, 16, 0.55); z-index: 30; font-family: 'Anton', sans-serif; color: #fff;
}
#deckui .du-panel {
  background: rgba(16, 10, 34, 0.94); border: 2px solid #37e6ff; border-radius: 12px;
  box-shadow: 0 0 30px rgba(55, 230, 255, 0.25); padding: 22px 26px; max-width: 92vw;
}
#deckui .du-armory { display: flex; gap: 24px; align-items: stretch; }
#deckui .du-stage { position: relative; width: min(520px, 50vw); min-height: 380px;
  background: radial-gradient(circle at 50% 45%, #2a1d52, #0d0820 70%); border-radius: 8px; }
#deckui .du-canvas { width: 100%; height: 100%; display: block; cursor: grab; }
#deckui .du-hint { position: absolute; bottom: 10px; width: 100%; text-align: center; font-size: 13px; color: #8f96c8; letter-spacing: 1px; pointer-events: none; }
#deckui .du-card { width: 330px; display: flex; flex-direction: column; gap: 8px; }
#deckui .du-maker { color: #37e6ff; font-size: 14px; letter-spacing: 2px; }
#deckui .du-name { color: #ffd060; font-size: 32px; line-height: 1.1; margin-bottom: 6px; }
#deckui .du-stat { display: grid; grid-template-columns: 90px 1fr 56px; align-items: center; gap: 10px; font-size: 15px; }
#deckui .du-track { height: 8px; background: rgba(255, 255, 255, 0.12); border-radius: 4px; overflow: hidden; }
#deckui .du-fill { display: block; height: 100%; background: linear-gradient(90deg, #37e6ff, #ff3fd2); }
#deckui .du-sv { text-align: right; color: #e8e8ff; }
#deckui .du-found { font-family: system-ui, sans-serif; font-size: 14px; color: #c8cdf0; }
#deckui .du-lore { font-family: system-ui, sans-serif; font-size: 14px; line-height: 1.45; color: #b6bbe0; margin-top: 6px; }
#deckui .du-notsold { margin-top: auto; color: #ff3fd2; font-size: 15px; letter-spacing: 1px; }
#deckui .du-close, #deckui .du-hero, #deckui .du-emote {
  font-family: 'Anton', sans-serif; color: #fff; background: #1c1438; border: 1px solid #37e6ff;
  border-radius: 6px; cursor: pointer; letter-spacing: 1px;
}
#deckui .du-close { padding: 8px; font-size: 16px; }
#deckui .du-title { font-size: 30px; color: #ff3fd2; letter-spacing: 2px; text-align: center; }
#deckui .du-sub { font-family: system-ui, sans-serif; font-size: 14px; color: #b6bbe0; text-align: center; margin: 6px 0 14px; }
#deckui .du-grid { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
#deckui .du-hero { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px; width: 120px; font-size: 16px; }
#deckui .du-hero img { width: 96px; height: 96px; border-radius: 6px; }
#deckui .du-hero.on { border-color: #ffd060; box-shadow: 0 0 12px rgba(255, 208, 96, 0.5); }
#deckui .du-wheel { position: relative; width: min(340px, 58vh); height: min(340px, 58vh); margin: 10px auto 0;
  border-radius: 50%; border: 2px dashed rgba(55, 230, 255, 0.35); }
#deckui .du-emote { position: absolute; transform: translate(-50%, -50%); padding: 10px 14px; font-size: 16px; display: flex; gap: 8px; align-items: center; }
#deckui .du-key { color: #ffd060; }
#deckui .du-citymap { display: block; margin: 10px auto 6px; border-radius: 8px; border: 1px solid #2a1d52; }
#deckui .du-legend { display: flex; gap: 8px 14px; flex-wrap: wrap; justify-content: center; align-items: center; font-size: 14px; letter-spacing: 1px; }
#deckui .du-lg { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
#deckui .lg-vault { background: #ffd060; } #deckui .lg-pad { border: 2px solid #35d07a; width: 9px; height: 9px; }
#deckui .lg-heat { background: rgba(255, 60, 80, 0.7); } #deckui .lg-top { background: #ffd060; border-radius: 2px; }

/* the Skydeck's winners on the podium (main.js updatePodium) */
.label.podium { color: #ffd060; font-size: 12px; letter-spacing: 0.04em; }
#deckui .du-citymap { cursor: crosshair; }
#deckui .du-row { display: flex; gap: 12px; justify-content: center; margin-top: 4px; }
#deckui .du-row .du-close { padding: 8px 18px; }

/* ---------------------------------------------- in-game chat (CHAT.md) --- */

#chat {
  position: absolute;
  left: 14px;
  bottom: 14px;
  width: min(380px, calc(100vw - 28px));
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: none;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; /* chat is read, not shouted: no display face */
  font-size: 13px;
  line-height: 1.35;
  z-index: 6;
}
#chat .c-tab {
  font-family: 'Anton', sans-serif;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: rgba(159, 180, 208, 0.75);
}
#chat .c-log {
  max-height: 7.2em;             /* about five lines when closed */
  overflow-y: hidden;
  display: flex;
  flex-direction: column;
  gap: 1px;
  pointer-events: auto;
  transition: opacity 0.6s;
}
#chat.quiet .c-log, #chat.quiet .c-tab { opacity: 0; }
#chat.open .c-log {
  max-height: 16em;
  overflow-y: auto;
  padding: 6px 8px;
  background: rgba(8, 10, 18, 0.72);
  border: 1px solid rgba(64, 200, 255, 0.25);
  border-radius: 6px;
}
#chat .c-line {
  color: #e8eef8;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95), 0 0 6px rgba(0, 0, 0, 0.6);
  overflow-wrap: anywhere;
}
#chat .c-line.muted { display: none; }
#chat .c-name { font-weight: 700; margin-right: 6px; cursor: pointer; }
#chat .c-name::after { content: ':'; color: rgba(232, 238, 248, 0.6); }
#chat .c-sys { color: #9fb4d0; font-style: italic; }
#chat .c-input {
  pointer-events: auto;
  font: inherit;
  color: #fff;
  background: rgba(8, 10, 18, 0.88);
  border: 1px solid #35d0e0;
  border-radius: 6px;
  padding: 7px 10px;
  outline: none;
}

/* A speech bubble over the speaker's head (main.js drawBubbles): a HUD
   readout, not a cartoon balloon — dark glass, a neon edge and glow, an accent
   bar, and a signal line down to a dot over the speaker. Ours in our green. */
.label.bubble {
  --b-neon: 55, 230, 255;          /* cyan; .me overrides */
  max-width: 230px;
  white-space: normal;
  padding: 5px 10px 5px 11px;
  margin-bottom: 11px;              /* room for the signal line */
  background: linear-gradient(135deg, rgba(10, 18, 36, 0.9), rgba(18, 10, 36, 0.9));
  border: 1px solid rgba(var(--b-neon), 0.7);
  border-left: 3px solid rgb(var(--b-neon));
  border-radius: 2px 7px 2px 7px;
  box-shadow: 0 0 12px rgba(var(--b-neon), 0.35), inset 0 0 14px rgba(var(--b-neon), 0.1);
  color: #e8f6ff;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.02em;
  text-shadow: 0 0 6px rgba(var(--b-neon), 0.45);
  overflow-wrap: anywhere;
  animation: bubble-in 0.22s steps(4, end);
}
.label.bubble.me { --b-neon: 53, 208, 160; }
.label.bubble::after { /* the signal line, down to the speaker */
  content: '';
  position: absolute;
  left: 50%;
  bottom: -9px;
  width: 1px;
  height: 7px;
  background: linear-gradient(rgba(var(--b-neon), 0.9), rgba(var(--b-neon), 0.2));
}
.label.bubble::before { /* … ending in a dot */
  content: '';
  position: absolute;
  left: 50%;
  bottom: -11px;
  width: 3px;
  height: 3px;
  margin-left: -1px;
  border-radius: 50%;
  background: rgb(var(--b-neon));
  box-shadow: 0 0 6px rgb(var(--b-neon));
}
@keyframes bubble-in { /* a quick flicker on, like a display waking */
  0% { opacity: 0; filter: brightness(2.2); }
  50% { opacity: 0.6; }
  100% { opacity: 1; filter: brightness(1); }
}

/* ------------------------------------------- city news (vaultnews.js) --
   One line under the round strip (top:104 → ~130): vault cracks, blows and
   fat pots, told to the whole city. Gold like the vault's pot label. */
#vaultnews {
  position: absolute;
  top: 138px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 14px;
  color: #ffd060;
  background: rgba(10, 10, 18, 0.78);
  border: 1px solid rgba(255, 208, 96, 0.6);
  border-radius: 4px;
  box-shadow: 0 0 12px rgba(255, 190, 60, 0.25);
  font-size: 14px;
  letter-spacing: 0.08em;
  white-space: nowrap;
  pointer-events: none;
}
#vaultnews.in { animation: vaultnews-in 260ms ease-out; }
@keyframes vaultnews-in {
  from { opacity: 0; transform: translate(-50%, -8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
@media (max-width: 600px) {
  #vaultnews { top: 128px; font-size: 11px; max-width: 96vw; overflow: hidden; text-overflow: ellipsis; }
}

/* Share your best moment on X (shots.js, 2026-10-12): after a run, up on the deck. */
#share {
  position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%);
  box-sizing: border-box; width: min(460px, calc(100vw - 24px)); padding: 12px 14px 12px;
  background: rgba(8, 11, 22, 0.94); border: 1px solid rgba(51, 214, 255, 0.35);
  border-radius: 12px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55), 0 0 24px rgba(51, 214, 255, 0.12);
  color: #cfd6e4; font-family: 'Anton', sans-serif; z-index: 30; pointer-events: auto;
}
#share .sh-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
#share .sh-title { letter-spacing: 0.12em; color: #7fe6ff; font-size: 15px; }
#share .sh-close { background: none; border: 0; color: #8a93a8; font-size: 22px; cursor: pointer; line-height: 1; }
#share .sh-close:hover { color: #e8ecf4; }
#share .sh-pic { position: relative; border-radius: 8px; overflow: hidden; background: #05070e; aspect-ratio: 16 / 9; }
#share .sh-img { display: block; width: 100%; height: 100%; object-fit: cover; }
#share .sh-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 30px; height: 44px; border: 0; border-radius: 6px;
  background: rgba(5, 7, 14, 0.55); color: #e8ecf4; font-size: 24px; cursor: pointer; }
#share .sh-nav:hover { background: rgba(5, 7, 14, 0.8); }
#share .sh-prev { left: 6px; } #share .sh-next { right: 6px; }
#share .sh-acts { display: flex; gap: 8px; margin: 10px 0 8px; }
#share .sh-btn { flex: 1; font-family: 'Anton', sans-serif; letter-spacing: 0.08em; font-size: 14px; padding: 9px 10px; border-radius: 8px; cursor: pointer;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(159, 179, 216, 0.3); color: #e8ecf4; }
#share .sh-btn:hover { border-color: #7fd4ff; }
#share .sh-x { background: #e8ecf4; color: #05070e; border-color: #e8ecf4; }
#share .sh-x:hover { background: #fff; }
#share .sh-lab { font-size: 12px; color: #9fb3d8; letter-spacing: 0.04em; margin-bottom: 4px; }
#share .sh-row { display: flex; gap: 8px; }
#share .sh-input { flex: 1; min-width: 0; padding: 8px 10px; border-radius: 8px; border: 1px solid rgba(159, 179, 216, 0.3);
  background: rgba(0, 0, 0, 0.35); color: #e8ecf4; font: 13px ui-monospace, Menlo, monospace; }
#share .sh-input:focus { outline: none; border-color: #35d0a0; }
#share .sh-send { flex: 0 0 auto; }
#share .sh-msg { min-height: 16px; margin-top: 8px; font-size: 12px; color: #ffd76a; letter-spacing: 0.03em; }
#share .sh-paste { display: block; width: 100%; margin-bottom: 8px; background: rgba(53, 208, 160, 0.16); border-color: rgba(53, 208, 160, 0.7); color: #9ff0d4; }
#share .sh-paste[hidden] { display: none; }
#share .sh-claim.next .sh-lab { color: #ffd76a; }
#share .sh-claim.next .sh-paste { box-shadow: 0 0 14px rgba(53, 208, 160, 0.45); }
/* Phones: thumb-sized buttons, the panel above the safe area, never taller than the screen. */
@media (max-width: 600px), (max-height: 520px) {
  #share { bottom: calc(env(safe-area-inset-bottom, 0px) + 8px); max-height: calc(100vh - 16px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); overflow-y: auto; }
  #share .sh-btn { min-height: 46px; font-size: 15px; }
  #share .sh-input { min-height: 44px; font-size: 16px; box-sizing: border-box; } /* ≥ 16 px: iOS zooms into smaller fields */
  #share .sh-close { min-width: 44px; min-height: 44px; margin: -10px -10px -10px 0; font-size: 26px; }
  #share .sh-nav { width: 44px; }
}
@media (max-height: 520px) {
  #share { width: min(560px, calc(100vw - 24px)); padding: 8px 12px; }
  #share .sh-pic { max-height: 34vh; aspect-ratio: auto; height: 34vh; }
  #share .sh-acts { margin: 6px 0 6px; }
}

/* ------------------------------------------------ touch controls (2026-10-13) --
   touch.js, docs/TOUCH-CONTROLS.md. The layer covers the screen in play; its
   zones and buttons take touches, everything else lets them through. Sizes
   come from the shorter side (vmin) so a thumb meets the same size on a phone
   and a tablet; every edge keeps clear of the notch and the home bar. */
html, body { overscroll-behavior: none; }
body.touch-on { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.touch-on canvas { touch-action: none; }
#touch {
  --t-scale: 1; --t-opacity: 0.85; --t-edge: 24px;
  --sa-t: env(safe-area-inset-top, 0px); --sa-r: env(safe-area-inset-right, 0px);
  --sa-b: env(safe-area-inset-bottom, 0px); --sa-l: env(safe-area-inset-left, 0px);
  position: fixed; inset: 0; z-index: 20; pointer-events: none; display: none;
  font-family: 'Anton', sans-serif; letter-spacing: 1px;
}
#touch.show { display: block; }
#touch .tz { position: absolute; pointer-events: auto; touch-action: none; }
/* Phone, landscape: the left 45 % walks, the right 55 % aims — below the top bar. */
/* The outer --t-edge (CONFIG.touch.edgePx) is left alone: the system's back swipe starts there. */
#touch .tz-move { left: calc(var(--sa-l) + var(--t-edge)); width: 45%; top: calc(var(--sa-t) + 64px); bottom: 0; }
#touch .tz-aim { right: calc(var(--sa-r) + var(--t-edge)); width: 55%; top: calc(var(--sa-t) + 64px); bottom: 0; }
/* Portrait: the bottom of the screen; tablets: the lower outer corners (thumbs rest at the edges). */
#touch.portrait .tz { top: 45%; }
#touch.tablet .tz-move { width: 40%; top: 40%; }
#touch.tablet .tz-aim { width: 40%; top: 40%; }
#touch.swap .tz-move { left: auto; right: calc(var(--sa-r) + var(--t-edge)); }
#touch.swap .tz-aim { right: auto; left: calc(var(--sa-l) + var(--t-edge)); }
/* A stick: drawn only while a thumb holds it. */
#touch .ts-base {
  position: absolute; left: 0; top: 0; border-radius: 50%; pointer-events: none; opacity: 0;
  transition: opacity 150ms ease-out;
  background: radial-gradient(circle, rgba(10, 16, 30, 0.25) 0%, rgba(10, 16, 30, 0.45) 70%);
  border: 2px solid rgba(127, 212, 255, 0.45); box-shadow: 0 0 18px rgba(64, 200, 255, 0.18) inset;
}
#touch .ts-base.on { opacity: var(--t-opacity); transition-duration: 100ms; }
#touch .ts-base.fire { border-color: rgba(255, 80, 80, 0.9); box-shadow: 0 0 22px rgba(255, 60, 60, 0.55), 0 0 18px rgba(255, 60, 60, 0.25) inset; }
#touch .ts-base.fire .ts-knob { background: radial-gradient(circle at 40% 35%, #ffe2e2, #ff5a5a); box-shadow: 0 0 16px rgba(255, 70, 70, 0.8); }
#touch .ts-knob {
  position: absolute; left: 50%; top: 50%; width: 42%; height: 42%; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, rgba(232, 248, 255, 0.95), rgba(127, 212, 255, 0.75));
  box-shadow: 0 0 14px rgba(127, 212, 255, 0.55);
}
/* The buttons. */
#touch .tb {
  position: absolute; pointer-events: auto; touch-action: none; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; color: #e8f6ff; background: rgba(10, 16, 30, 0.55); border: 2px solid rgba(127, 212, 255, 0.5);
  opacity: var(--t-opacity); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8); transition: transform 60ms ease-out, background 60ms;
  font-size: calc(clamp(11px, 2.6vmin, 15px) * var(--t-scale));
  width: calc(clamp(48px, 12vmin, 60px) * var(--t-scale)); height: calc(clamp(48px, 12vmin, 60px) * var(--t-scale));
}
#touch .tb.down { transform: scale(0.94); background: rgba(53, 208, 160, 0.45); border-color: #5ce8c8; }
#touch .tb[hidden] { display: none; }
#touch .tb-dash {
  right: calc(var(--sa-r) + 4vmin); bottom: calc(var(--sa-b) + 26vmin);
  width: calc(clamp(64px, 16vmin, 96px) * var(--t-scale)); height: calc(clamp(64px, 16vmin, 96px) * var(--t-scale));
  font-size: calc(clamp(14px, 3.4vmin, 20px) * var(--t-scale)); border-color: rgba(255, 210, 60, 0.75); color: #ffe48a;
}
/* The look camera: FIRE takes DASH's place (the thumb's rest), DASH moves in beside it. */
#touch .tb-fire {
  right: calc(var(--sa-r) + 4vmin); bottom: calc(var(--sa-b) + 26vmin);
  width: calc(clamp(72px, 19vmin, 112px) * var(--t-scale)); height: calc(clamp(72px, 19vmin, 112px) * var(--t-scale));
  font-size: calc(clamp(15px, 3.6vmin, 22px) * var(--t-scale)); border-color: rgba(255, 90, 90, 0.8); color: #ffb0b0;
}
#touch .tb-fire.down { background: rgba(255, 70, 70, 0.4); border-color: #ff7070; }
#touch.fire-on .tb-dash { right: calc(var(--sa-r) + 4vmin + (clamp(72px, 19vmin, 112px) + 2vmin) * var(--t-scale)); bottom: calc(var(--sa-b) + 22vmin); }
#touch.fire-on.swap .tb-dash { right: auto; left: calc(var(--sa-l) + 4vmin + (clamp(72px, 19vmin, 112px) + 2vmin) * var(--t-scale)); }
#touch.swap .tb-fire { right: auto; left: calc(var(--sa-l) + 4vmin); }
/* The weapon chips: a row to the left of DASH; the held one outlined, those you lack dimmed. */
#touch .tb-w { --i: 0; border-radius: 10px; width: calc(clamp(64px, 15vmin, 84px) * var(--t-scale)); height: calc(clamp(40px, 9vmin, 48px) * var(--t-scale));
  bottom: calc(var(--sa-b) + 4vmin); font-size: calc(clamp(10px, 2.3vmin, 13px) * var(--t-scale));
  right: calc(var(--sa-r) + 4vmin + (2 - var(--i)) * (clamp(64px, 15vmin, 84px) + 8px) * var(--t-scale)); }
#touch .tb-w:not(.have) { opacity: calc(var(--t-opacity) * 0.35); }
#touch .tb-w.held { border-color: #ffd23c; color: #ffd23c; box-shadow: 0 0 12px rgba(255, 210, 60, 0.35); }
#touch .tb-emote { right: calc(var(--sa-r) + 4vmin + clamp(72px, 18vmin, 108px) * var(--t-scale)); bottom: calc(var(--sa-b) + 30vmin); }
#touch .tb-use { right: calc(var(--sa-r) + 4vmin); bottom: calc(var(--sa-b) + 46vmin); border-radius: 12px; width: auto; padding: 0 12px; border-color: rgba(92, 232, 200, 0.75); color: #9fe8d4; }
/* The top bar: chat, the board (hold), the menu — top right, clear of the run HUD and the timer. */
#touch .tb-top { top: calc(var(--sa-t) + 8px); width: calc(44px * var(--t-scale)); height: calc(44px * var(--t-scale)); border-radius: 12px; font-size: 20px; }
#touch .tb-menu { right: calc(var(--sa-r) + 8px); }
#touch .tb-board { right: calc(var(--sa-r) + 8px + 52px * var(--t-scale)); }
#touch .tb-chat { right: calc(var(--sa-r) + 8px + 104px * var(--t-scale)); }
#touch.swap .tb-dash { right: auto; left: calc(var(--sa-l) + 4vmin); }
#touch.swap .tb-w { right: auto; left: calc(var(--sa-l) + 4vmin + var(--i) * (clamp(64px, 15vmin, 84px) + 8px) * var(--t-scale)); }
#touch.swap .tb-emote { right: auto; left: calc(var(--sa-l) + 4vmin + clamp(72px, 18vmin, 108px) * var(--t-scale)); }
#touch.swap .tb-use { right: auto; left: calc(var(--sa-l) + 4vmin); }
/* On touch the HUD makes room for the thumbs: the minimap under the top bar, no mini board
   (the board button), the weapon line's key hints and the CLICK TO AIM hint gone. */
body.touch-on #minimap { top: calc(env(safe-area-inset-top, 0px) + 60px); bottom: auto; right: calc(env(safe-area-inset-right, 0px) + 8px); width: clamp(84px, 22vmin, 130px); height: clamp(84px, 22vmin, 130px); }
body.touch-on #miniboard, body.touch-on #aimhint, body.touch-on #weapon { display: none !important; }
/* VOL joins the top bar as a thumb-sized button, left of chat (the touch bar's three are 44 px + 8 px gaps). */
body.touch-on #volbtn { top: calc(env(safe-area-inset-top, 0px) + 8px); right: calc(env(safe-area-inset-right, 0px) + 8px + 156px); height: 44px; min-width: 56px; padding: 0 10px; border-radius: 12px; font-size: 11px; }
body.touch-on #runhud { top: calc(env(safe-area-inset-top, 0px) + 8px); left: calc(env(safe-area-inset-left, 0px) + 8px); }
/* The kill feed under the minimap (which moved up under the touch bar). */
body.touch-on #killfeed { top: calc(env(safe-area-inset-top, 0px) + 68px + clamp(84px, 22vmin, 130px)); right: calc(env(safe-area-inset-right, 0px) + 8px); }
/* Touch phones (2026-10-14: "the time is in the middle of the screen, overlapping the
   detected messages"): every line has its own lane, nothing stacks on another.
   The run HUD is compact (the dash ring beside the health bar), so the top band
   is short. */
@media (max-width: 600px), (max-height: 520px) {
  body.touch-on #runhud { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 8px;
    padding: 5px 9px; font-size: 13px; line-height: 1.3; }
  body.touch-on #runhud > :not(#dashring):not(#hpbar) { grid-column: 1 / -1; }
  body.touch-on #dashring { margin: 0; }
  body.touch-on #hpbar { width: 96px; margin: 0; }
  body.touch-on #timer { font-size: 30px; }
  body.touch-on #detected { font-size: 16px; padding: 3px 10px; white-space: nowrap; }
  body.touch-on #vaultnews { font-size: 11px; padding: 4px 10px; overflow: hidden; text-overflow: ellipsis; }
  body.touch-on #roundstrip { font-size: 11px; padding: 4px 8px; overflow: hidden; text-overflow: ellipsis; }
  body.touch-on #banner { top: 40%; z-index: 25; font-size: 14px; }
}
/* Upright: the timer between the run HUD and the minimap; under them, the
   lanes — the round strip, DETECTED, the city news — then the kill feed. */
@media (max-width: 600px) {
  body.touch-on #timer { top: calc(env(safe-area-inset-top, 0px) + 58px); }
  body.touch-on #roundstrip { top: calc(env(safe-area-inset-top, 0px) + 156px); max-width: calc(100vw - 16px); }
  body.touch-on #detected { top: calc(env(safe-area-inset-top, 0px) + 186px); }
  body.touch-on #vaultnews { top: calc(env(safe-area-inset-top, 0px) + 222px); max-width: calc(100vw - 16px); }
  body.touch-on #killfeed { top: calc(env(safe-area-inset-top, 0px) + 256px); right: calc(env(safe-area-inset-right, 0px) + 8px); }
  body.touch-on #banner { top: 56%; }
}
/* On its side: a centre column — the timer at the top, then the round strip,
   DETECTED and the news; the run HUD left, the buttons and minimap right; the
   kill feed under the run HUD. */
@media (max-height: 520px) and (min-width: 601px) {
  body.touch-on #timer { top: calc(env(safe-area-inset-top, 0px) + 4px); }
  body.touch-on #roundstrip { top: calc(env(safe-area-inset-top, 0px) + 52px); max-width: calc(100vw - 320px); }
  body.touch-on #detected { top: calc(env(safe-area-inset-top, 0px) + 84px); }
  body.touch-on #vaultnews { top: calc(env(safe-area-inset-top, 0px) + 120px); max-width: calc(100vw - 320px); }
  body.touch-on #banner { top: 56%; }
  body.touch-on #killfeed { top: calc(env(safe-area-inset-top, 0px) + 124px); right: auto; left: calc(env(safe-area-inset-left, 0px) + 8px); align-items: flex-start; }
}

/* Short screens (a phone on its side): the deck's overlays fit the height and scroll if they must. */
#deckui .du-panel { max-height: calc(100vh - 16px); overflow-y: auto; box-sizing: border-box; }
@media (max-height: 520px) {
  #deckui .du-panel { padding: 10px 14px; }
  #deckui .du-title { font-size: 22px; }
  #deckui .du-sub { margin: 4px 0 6px; font-size: 12px; }
  #deckui .du-stage { min-height: 220px; }
  #deckui .du-card { width: 260px; gap: 5px; }
  #deckui .du-name { font-size: 24px; }
}

/* Phones (2026-10-13): the wardrobe as compact tiles — three across upright,
   all six in one row on its side; the leaderboard's podium smaller on a short
   screen so the names and scores show without scrolling. */
@media (max-width: 600px), (max-height: 520px) {
  #deckui .du-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  #deckui .du-hero { width: auto; min-width: 0; padding: 6px; gap: 4px; font-size: 12px; line-height: 1.15; }
  #deckui .du-hero img { width: 100%; max-width: 96px; height: auto; aspect-ratio: 1; }
}
@media (max-height: 520px) {
  #deckui .du-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  #deckui .du-hero img { max-width: 76px; }
  #lb .pd-frame .pt, #lb .pd-frame .pt-img { width: 60px; height: 60px; }
  #lb .pd-1 .pd-frame { margin-bottom: 10px; }
  #lb .pd-name { margin-top: 10px; }
  #lb .podium { margin: 0 0 6px; }
}
