/* Spectate viewer (0.47.1). Podium look: navy panels, orange = action, teal = status. */
:root {
  --navy-900: #0b1524;
  --navy-800: #101d30;
  --navy-700: #16263d;
  --navy-600: #26384e;
  --ink: #f4f7fb;
  --ink-dim: #b9c6d6;
  --orange: #ff782e;
  --orange-soft: rgba(255, 120, 46, 0.28);
  --teal: #71ded3;
  --teal-deep: #087b75;
  --panel: rgba(16, 29, 48, 0.9);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--navy-900);
  color: var(--ink);
  font-family: var(--font);
  overflow: hidden;
}

.spectate { position: fixed; inset: 0; }
.stage { position: absolute; inset: 0; }
.stage canvas { display: block; width: 100%; height: 100%; }
/* A replay recorded in the game: the video fills the stage and the 3D canvas steps aside. */
.stage-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.stage.is-video canvas { display: none; }
/* Podium Pro TV ad break: the clip fills the screen (letterboxed, never cropped) with a small channel bug. */
.ad-break { position: absolute; inset: 0; z-index: 4; background: #000; }
.ad-break[hidden] { display: none; }
.off-air { position: absolute; inset: 0; z-index: 4; background: #080808; color: #fff; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; padding: var(--gutter); text-align: center; }
.off-air[hidden] { display: none; }
.off-air img { width: min(320px, 50%); height: auto; }
.off-air-title { margin: 0; font: 700 clamp(14px, 3vw, 28px)/1 "Oswald HUD", var(--font); letter-spacing: 0.14em; color: var(--teal); }
.off-air-head { margin: 0; font: 900 clamp(18px, 5vw, 48px)/1.05 "Arial Narrow", "Segoe UI", Arial, sans-serif; letter-spacing: -0.5px; color: #fff; }
.ad-bug b { font-weight: inherit; }
.off-air-note { margin: 0; font-size: clamp(11px, 2vw, 16px); color: #c6c6c6; }
.ad-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.ad-bug { position: absolute; left: var(--gutter); top: var(--gutter); z-index: 1; margin: 0; padding: 6px 10px;
  background: rgba(0, 0, 0, 0.7); border: 2px solid #fff; font: 800 11px/1 var(--font); letter-spacing: 0.1em; color: #fff; }
.ad-bug span { color: var(--teal); margin-right: 6px; }
/* Progress to the next race: a bar, not a clock (no digits to check against the no-7 rule). */
.ad-bar { display: block; height: 3px; margin-top: 6px; background: rgba(255, 255, 255, 0.25); }
.ad-bar i { display: block; height: 100%; width: 0; background: var(--teal); }

.panel {
  background: var(--panel);
  border: 2px solid var(--navy-600);
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.eyebrow {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--teal);
}

/* ---------- Code entry ---------- */
.join {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, calc(100% - 2 * var(--gutter)));
  padding: 24px;
  border-top: 6px solid var(--teal);
  z-index: 5;
}
.join h1 { margin: 0 0 8px; font-size: 28px; font-weight: 800; }
.join-help { margin: 0 0 16px; color: var(--ink-dim); line-height: 1.4; }
.join label[for="code"] { display: block; font-weight: 700; margin-bottom: 6px; }
.join-row { display: flex; gap: 8px; }
.join-row input {
  flex: 1; min-width: 0;
  font: 800 24px/1 var(--font);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--navy-700);
  border: 2px solid var(--navy-600);
  border-radius: 4px;
}
.join-row input:focus { outline: none; border-color: var(--teal); }
.btn-action {
  font: 800 16px/1 var(--font);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 20px;
  color: #1a0d04;
  background: var(--orange);
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}
.btn-action:hover { filter: brightness(1.08); }
.btn-action:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

.home-link { color: inherit; text-decoration: none; }
.home-link:hover, .home-link:focus-visible { text-decoration: underline; }
/* Spectate lives under Game: the GAME crumb is underlined as the current section, with a 40 px tap height. */
.join .eyebrow .home-link { display: inline-block; padding: 12px 0; margin: -10px 0; }
.section-link { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.signin-panel[hidden], .code-panel[hidden] { display: none; }
.signin-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.btn-link { display: inline-flex; align-items: center; min-height: 48px; text-decoration: none; }
.text-link { color: var(--teal); font-weight: 700; }
.signin-note {
  margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--navy-600);
  display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink-dim);
}
.signin-note .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--teal); flex: none; }
.signin-note strong { color: var(--teal); }
.join-status { min-height: 1.3em; margin: 12px 0 0; color: var(--teal); font-weight: 600; }
.join-status.is-error { color: var(--orange); }
.join-status:empty { display: none; }

/* ---------- Podium Pro TV sign-in / race code card (11-19): the website's own account card ----------
   Same look as podiumpromedia.com/#/signin: black card, 3 px white border with a hard white offset shadow, square
   corners, Arial Narrow heading, white-bordered inputs and the orange button with a black edge and white shadow. */
.join {
  background: #000;
  border: 3px solid #fff;
  border-radius: 0;
  /* The second shadow dims the race behind the card, so the card never fights the tower or rider tags. */
  box-shadow: 7px 7px 0 #fff, 0 0 0 100vmax rgba(0, 0, 0, 0.62);
  padding: 32px;
  width: min(440px, calc(100% - 2 * var(--gutter) - 7px));
}
.join .eyebrow { font-size: 10px; font-weight: 400; letter-spacing: 1.5px; color: #fff; margin-bottom: 10px; }
.join h1 { font: 900 34px/1.05 "Arial Narrow", "Segoe UI", Arial, sans-serif; letter-spacing: -1px; margin: 0 0 10px; }
.join-help { font-size: 14px; color: #c6c6c6; }
.join label[for="code"] { font-size: 12px; color: #fff; }
.join-row input { background: #080808; border: 2px solid #fff; border-radius: 0; }
.join-row input:focus { border-color: var(--orange); }
.join .btn-action {
  font: 800 13px/1 "Segoe UI", Arial, sans-serif;
  letter-spacing: normal;
  color: #000;
  border: 3px solid #000;
  border-radius: 0;
  box-shadow: 4px 4px 0 #fff;
  padding: 15px 25px;
  min-height: 48px;
}
.join .btn-action:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 #fff; }
.join .text-link { color: #fff; font-size: 13px; font-weight: 400; text-decoration: underline; text-underline-offset: 3px; }
.join .btn-ghost { border-radius: 0; border-color: #fff; color: #fff; }
.signin-note { border-top-color: #333; color: #c6c6c6; }
.ov-channel { margin: 0 0 2px; font: 700 calc(20 * var(--s, 1px))/1 "Oswald HUD", var(--font); letter-spacing: 0.12em; color: var(--teal); }

/* ---------- Broadcast overlay (0.48.1): the game's race HUD look ----------
   Navy cut-corner panels with a light-blue edge, Oswald, yellow = leader/names, orange = announcer/action,
   teal = status. Sizes are written at 1920 px wide and scale with the window (--s); phones get their own layout. */
@font-face { font-family: "Oswald HUD"; src: url(fonts/Oswald-Bold.ttf) format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Oswald HUD"; src: url(fonts/Oswald-SemiBold.ttf) format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plate HUD"; src: url(fonts/RobotoPlate-Black.ttf) format("truetype"); font-display: swap; }

.overlay {
  --s: min(1px, calc(100vw / 1920));
  --hud: linear-gradient(180deg, rgba(22, 44, 66, 0.93), rgba(14, 30, 46, 0.95));
  --edge: #4f9fd0;
  --yellow: #ffd400;
  --soft: #dbe7f2;
  --display: "Oswald HUD", "Oswald", "Arial Narrow", sans-serif;
  position: absolute; inset: 0; pointer-events: none; z-index: 3;
  font-family: var(--display);
}
.overlay[hidden] { display: none; }
.overlay p { margin: 0; }
.hud { position: absolute; background: var(--hud); border: 2px solid var(--edge); color: #fff; }
.cut { clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18 * var(--s)), calc(100% - 18 * var(--s)) 100%, 0 100%); }

/* Title bug, top left */
.ov-title {
  top: calc(36 * var(--s)); left: calc(40 * var(--s));
  display: flex; align-items: center; gap: calc(22 * var(--s));
  padding: calc(14 * var(--s)) calc(30 * var(--s)) calc(14 * var(--s)) calc(18 * var(--s));
}
.ov-logo { height: calc(78 * var(--s)); width: auto; }
.ov-title-line { font-size: calc(44 * var(--s)); font-weight: 700; line-height: 1; letter-spacing: 0.02em; white-space: nowrap; }
.ov-title-line b { color: var(--yellow); font-weight: 700; }
.ov-sub { font-size: calc(24 * var(--s)); color: #cfe0ee; letter-spacing: 0.12em; font-weight: 600; margin-top: calc(8 * var(--s)) !important; white-space: nowrap; }
.pill-live {
  display: inline-flex; align-items: center; gap: calc(8 * var(--s)); vertical-align: middle;
  margin-left: calc(12 * var(--s));
  font-size: calc(20 * var(--s)); font-weight: 700; letter-spacing: 0.12em;
  padding: calc(3 * var(--s)) calc(12 * var(--s));
  color: #fff; background: #e5484d;
}
.pill-live::before {
  content: ""; width: calc(10 * var(--s)); height: calc(10 * var(--s)); border-radius: 50%; background: #fff;
  animation: blink 1.2s infinite;
}
.pill-live.is-ended { background: #3a3f46; color: #cfe0ee; }
.pill-live.is-ended::before { display: none; }
@keyframes blink { 50% { opacity: 0.25; } }

/* Clock + camera, top right */
.ov-clock {
  top: calc(36 * var(--s)); right: calc(40 * var(--s));
  min-width: calc(300 * var(--s)); text-align: center;
  padding: calc(10 * var(--s)) calc(20 * var(--s)) calc(14 * var(--s));
}
.ov-clock-time { font-size: calc(56 * var(--s)); font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ov-clock-time:empty::before { content: "\00a0"; }
.ov-cam { font-size: calc(20 * var(--s)); color: #cfe0ee; letter-spacing: 0.16em; font-weight: 600; white-space: nowrap; }
.ov-cam-label { color: var(--teal); }
.ov-phase { color: var(--yellow); margin-left: calc(6 * var(--s)); }

/* Running order */
.ov-order {
  top: calc(172 * var(--s)); left: calc(40 * var(--s));
  width: calc(480 * var(--s));
  padding: calc(10 * var(--s)) 0 calc(12 * var(--s));
}
.ov-order-head { font-size: calc(20 * var(--s)); letter-spacing: 0.16em; color: var(--teal); font-weight: 600; padding: 0 calc(18 * var(--s)) calc(8 * var(--s)); }
.ov-order ol { list-style: none; margin: 0; padding: 0; }
.ov-row {
  display: grid;
  grid-template-columns: calc(44 * var(--s)) calc(66 * var(--s)) 1fr calc(110 * var(--s));
  align-items: center;
  height: calc(56 * var(--s));
  padding: 0 calc(16 * var(--s));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.ov-pos { font-size: calc(32 * var(--s)); font-weight: 700; }
.ov-row.is-lead .ov-pos { color: var(--yellow); }
.ov-name { font-size: calc(27 * var(--s)); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: calc(12 * var(--s)); }
.ov-gap { font-size: calc(26 * var(--s)); font-weight: 600; text-align: right; color: var(--soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ov-row.is-lead .ov-gap { color: var(--yellow); font-size: calc(20 * var(--s)); letter-spacing: 0.08em; }
.ov-plate {
  font-family: "Plate HUD", var(--display);
  width: calc(58 * var(--s)); height: calc(40 * var(--s));
  display: inline-flex; align-items: center; justify-content: center;
  font-size: calc(26 * var(--s)); line-height: 1;
  color: #111; background: #fff;
  border: 2px solid #111; border-radius: calc(6 * var(--s)) calc(6 * var(--s)) calc(10 * var(--s)) calc(10 * var(--s));
  box-shadow: inset 0 calc(-4 * var(--s)) 0 var(--pc, var(--yellow));
}
.tag-club {
  display: inline-block; font-size: 0.55em; font-weight: 700; letter-spacing: 0.08em;
  color: #0b1524; background: #b9c6d6; padding: 1px 4px; margin-left: 6px; vertical-align: 0.2em;
}
/* A rider who just gained a place flashes yellow. */
.ov-row.gained { animation: gained 1.4s ease-out; }
@keyframes gained {
  0%, 30% { background: rgba(255, 212, 0, 0.35); }
  100% { background: transparent; }
}

/* Rider tags (moved by spectate.js; the stem length follows how far a tag was lifted to avoid others) */
.ov-tags { position: absolute; inset: 0; overflow: hidden; }
.rtag {
  position: absolute; left: 0; top: 0;
  display: flex; align-items: stretch;
  height: calc(44 * var(--s)); min-height: 24px;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.45));
  will-change: transform;
}
.rtag[hidden] { display: none; }
.rtag::after {
  content: ""; position: absolute; left: 50%; top: 100%;
  width: 3px; margin-left: -1.5px; height: var(--stem, 14px); background: var(--edge);
}
.rtag-p {
  display: flex; align-items: center; justify-content: center;
  min-width: calc(42 * var(--s)); padding: 0 calc(8 * var(--s));
  font-size: max(15px, calc(28 * var(--s))); font-weight: 700;
  color: #111; background: var(--yellow);
}
.rtag-n {
  display: flex; align-items: center; white-space: nowrap;
  padding: 0 calc(12 * var(--s));
  font-size: max(13px, calc(22 * var(--s))); font-weight: 600;
  background: rgba(14, 30, 46, 0.95); border: 2px solid var(--edge); border-left: 0;
}
.rtag-n:empty { display: none; }
.rtag.is-chip .rtag-p {
  font-family: "Plate HUD", var(--display); font-weight: 400;
  background: #fff; border-radius: 5px; box-shadow: inset 0 -5px 0 var(--pc, var(--yellow));
}

/* Announcer lower third */
.ov-ann {
  left: 50%; transform: translateX(-50%);
  bottom: calc(44 * var(--s));
  width: min(calc(1180 * var(--s)), calc(100% - 32px));
  min-height: calc(118 * var(--s));
  display: flex; align-items: center; gap: calc(22 * var(--s));
  padding: calc(14 * var(--s)) calc(26 * var(--s));
}
.ov-ann[hidden] { display: none; }
.ov-ann.is-new .ov-ann-say { animation: say-in 0.35s ease-out; }
@keyframes say-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.ov-mic {
  flex: none; width: calc(64 * var(--s)); height: calc(64 * var(--s)); min-width: 32px; min-height: 32px;
  border-radius: 50%; background: var(--orange);
  display: flex; align-items: center; justify-content: center;
}
.ov-mic svg { width: 55%; height: 55%; fill: #111; }
.ov-ann-text { flex: 1; min-width: 0; }
.ov-ann-who { font-size: calc(18 * var(--s)); letter-spacing: 0.18em; color: var(--orange); font-weight: 600; }
.ov-ann-say { font-size: calc(40 * var(--s)); font-weight: 600; line-height: 1.15; }
.ov-ann-say b { color: var(--yellow); font-weight: 700; }
.ov-voice {
  pointer-events: auto; flex: none;
  font: 600 calc(20 * var(--s)) / 1 var(--display); letter-spacing: 0.08em; text-transform: uppercase;
  min-height: 40px; padding: 0 calc(16 * var(--s));
  color: #fff; background: transparent; border: 2px solid var(--edge); cursor: pointer;
}
.ov-voice[aria-pressed="true"] { background: var(--orange); border-color: var(--orange); color: #111; }
.ov-voice:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* Results with a podium, then UP NEXT */
.ov-results, .ov-next {
  left: 50%; top: calc(170 * var(--s));
  transform: translateX(-50%);
  width: min(calc(1120 * var(--s)), calc(100% - 32px));
  padding: calc(26 * var(--s)) calc(34 * var(--s));
}
.ov-results[hidden], .ov-next[hidden] { display: none; }
.ov-results .eyebrow, .ov-next .eyebrow { font-family: var(--display); font-size: calc(20 * var(--s)); }
.ov-results h2, .ov-next h2 { margin: 0; font-size: calc(52 * var(--s)); font-weight: 700; line-height: 1.05; }
.ov-results h2 b { color: var(--yellow); }
.ov-podium { display: flex; gap: calc(18 * var(--s)); margin: calc(22 * var(--s)) 0 calc(18 * var(--s)); align-items: flex-end; }
.pod-step {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: calc(8 * var(--s));
  padding: calc(16 * var(--s)) calc(10 * var(--s)) calc(14 * var(--s));
  background: rgba(255, 255, 255, 0.05); border: 2px solid rgba(255, 255, 255, 0.12);
}
.pod-step.is-first { border-color: var(--yellow); background: rgba(255, 212, 0, 0.12); padding-top: calc(26 * var(--s)); }
.pod-place { font-size: calc(44 * var(--s)); font-weight: 700; line-height: 1; }
.pod-step.is-first .pod-place { color: var(--yellow); font-size: calc(58 * var(--s)); }
.pod-name { font-size: calc(30 * var(--s)); font-weight: 600; text-align: center; }
.pod-time { font-size: calc(28 * var(--s)); font-weight: 600; color: var(--soft); font-variant-numeric: tabular-nums; white-space: pre; }
.ov-results ol { list-style: none; margin: 0; padding: 0; }
.res-row {
  display: grid; grid-template-columns: calc(50 * var(--s)) calc(70 * var(--s)) 1fr calc(220 * var(--s));
  align-items: center; height: calc(52 * var(--s)); padding: 0 calc(14 * var(--s));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.res-pos { font-size: calc(30 * var(--s)); font-weight: 700; }
.res-gap { font-size: calc(26 * var(--s)); font-weight: 600; color: var(--soft); text-align: right; font-variant-numeric: tabular-nums; }
.ov-next { text-align: center; }
/* Shown under the results once the room has ended. The overlay ignores the pointer, the link doesn't. */
.ov-ended-note { margin: 12px 0 0 !important; color: #cfe0ee; pointer-events: auto; font-family: var(--font); }
.ov-ended-note[hidden] { display: none; }
.ov-ended-note a { color: var(--orange); font-weight: 800; }
.ov-next-note { color: #cfe0ee; font-family: var(--font); font-size: max(15px, calc(24 * var(--s))); margin-top: 8px !important; }

/* ---------- No-code join: "No race found" radar ---------- */
.radar {
  display: flex; align-items: center; gap: 14px;
  margin: 0 0 12px; padding: 12px 14px;
  background: rgba(255, 255, 255, 0.05); border: 2px solid rgba(255, 255, 255, 0.12);
}
.radar .ring {
  --p: 0;
  flex: none; width: 64px; height: 64px; border-radius: 50%;
  background: conic-gradient(var(--teal) calc(var(--p) * 1%), rgba(255, 255, 255, 0.12) 0);
  display: flex; align-items: center; justify-content: center;
}
.radar .ring span {
  width: 50px; height: 50px; border-radius: 50%; background: var(--navy-800);
  display: flex; align-items: center; justify-content: center; text-align: center;
  font: 700 14px/1 "Oswald HUD", var(--font); color: var(--teal); letter-spacing: 0.04em;
}
.radar-text p { margin: 0; }
.radar-big { font: 700 26px/1.05 "Oswald HUD", var(--font); }
.radar-small { margin-top: 4px !important; color: var(--teal); font-weight: 600; line-height: 1.35; }
.btn-ghost {
  font: 700 16px/1 "Oswald HUD", var(--font); letter-spacing: 0.08em; text-transform: uppercase;
  min-height: 44px; padding: 0 18px; margin: 0 0 16px;
  color: var(--ink); background: transparent; border: 2px solid #4f9fd0; cursor: pointer;
}
.btn-ghost[hidden] { display: none; }
.btn-ghost:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

/* Results / NEXT RACE card up: hide the order tower and floating tags behind it (TV layout only). */
@media not ((max-width: 700px) and (orientation: portrait)) {
  .overlay:has(#ov-results:not([hidden])) .ov-order,
  .overlay:has(#ov-next:not([hidden])) .ov-order,
  .overlay:has(#ov-results:not([hidden])) .ov-tags,
  .overlay:has(#ov-next:not([hidden])) .ov-tags { visibility: hidden; }
}

/* ---------- Phone: video on top, panels underneath ---------- */
@media (max-width: 700px) and (orientation: portrait) {
  .stage { bottom: auto; height: 56.25vw; }
  .overlay {
    --s: 1px;
    display: flex; flex-direction: column; gap: 14px;
    padding: calc(56.25vw + 64px) 16px 24px;
    overflow-y: auto; pointer-events: auto;
  }
  .ov-tags { bottom: auto; height: 56.25vw; }
  .hud { position: relative; inset: auto; transform: none; width: auto; }
  /* The TV widths are 1920-scale pixels; on a phone every stacked panel is just the screen width. */
  .ov-ann, .ov-order, .ov-results, .ov-next { width: auto; min-width: 0; max-width: 100%; box-sizing: border-box; flex-shrink: 0; }
  .ov-title { position: absolute; top: 8px; left: 8px; padding: 4px 10px; gap: 0; }
  .ov-logo { display: none; }
  .ov-title-line { font-size: 18px; }
  .pill-live { font-size: 13px; padding: 2px 8px; margin-left: 8px; }
  .ov-sub {
    position: fixed; left: 0; right: 0; top: 56.25vw;
    padding: 10px 16px; margin: 0 !important;
    font-size: 16px; color: var(--soft); background: #12263a; border-bottom: 2px solid var(--edge);
  }
  .ov-clock { position: absolute; top: 8px; right: 8px; min-width: 0; padding: 2px 10px; }
  .ov-clock-time { font-size: 20px; }
  .ov-cam { display: none; }
  .ov-ann { order: 1; min-height: 0; padding: 12px 14px; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
  .ov-mic { width: 40px; height: 40px; }
  .ov-ann-who { font-size: 13px; }
  .ov-ann-say { font-size: 21px; line-height: 1.2; }
  .ov-ann-text { flex: 1 1 calc(100% - 64px); }
  .ov-voice { font-size: 14px; margin-left: 52px; }
  .ov-order { order: 2; padding: 8px 0 6px; }
  .ov-order-head { font-size: 15px; padding: 0 14px 6px; }
  .ov-row { grid-template-columns: 30px 58px 1fr 76px; height: 52px; padding: 0 12px; }
  .ov-pos { font-size: 24px; }
  .ov-name { font-size: 20px; }
  .ov-gap { font-size: 18px; }
  .ov-row.is-lead .ov-gap { font-size: 15px; }
  .ov-plate { width: 48px; height: 34px; font-size: 20px; }
  .rtag { height: 26px; }
  .rtag-p { font-size: 15px; min-width: 24px; padding: 0 5px; }
  .rtag-n { font-size: 13px; padding: 0 6px; }
  .ov-results, .ov-next { order: 0; padding: 16px; }
  .ov-results h2, .ov-next h2 { font-size: 26px; }
  .ov-results .eyebrow { font-size: 14px; }
  .ov-podium { gap: 8px; margin: 12px 0; }
  .pod-place { font-size: 22px; }
  .pod-step.is-first .pod-place { font-size: 28px; }
  .pod-name { font-size: 16px; }
  .pod-time { font-size: 14px; white-space: normal; text-align: center; }
  .res-row { grid-template-columns: 30px 58px 1fr 80px; height: 48px; }
  .res-pos { font-size: 22px; }
  .res-gap { font-size: 16px; }
}
/* Landscape phones and small windows: keep the TV layout but never below readable sizes. */
@media (max-width: 1000px) and (orientation: landscape) {
  .overlay { --s: 0.62px; }
  .ov-order { width: 300px; }
  .ov-row { grid-template-columns: 26px 44px 1fr 70px; height: 34px; }
  .ov-name { font-size: 17px; } .ov-gap { font-size: 16px; } .ov-pos { font-size: 20px; }
  .ov-plate { width: 40px; height: 26px; font-size: 17px; }
  .ov-ann-say { font-size: 20px; } .ov-sub { font-size: 14px; } .ov-title-line { font-size: 26px; }
}
/* 11-15: a visible way back to the site from the full-screen viewer (critic) */
.back-link{margin:14px 0 0;padding-top:12px;border-top:1px solid rgba(255,255,255,.12);font-size:14px}
.back-link .text-link{display:inline-flex;align-items:center;min-height:40px}

/* ?embed=1 (the app's Home video slot): no race code, sign-in or links away; the card only shows status lines. */
.embed #open-code,
.embed .join .eyebrow,
.embed .signin-panel,
.embed .code-panel,
.embed .back-link,
.embed .ov-ended-note { display: none !important; }

/* ---------- ?embed=1 compact HUD (11-19, Alex: "This needs updated video hud here") ----------
   The app's Home slot is a small 16:9 frame (about 360 x 200). The race stays in view: a small corner badge
   (PODIUM PRO TV + LIVE/REPLAY), the top two plates top right, and a one-line announcer ticker with SOUND at the
   bottom. Rider tags, clock, camera, subtitle and the results card stay hidden; the ticker calls the finish.
   Fixed pixel sizes, and html.embed outranks every TV/phone media rule above. */
html.embed .stage { bottom: 0; height: auto; }
html.embed .overlay { --s: 1px; display: block; padding: 0; overflow: hidden; pointer-events: none; }
html.embed .hud { position: absolute; clip-path: none; border-width: 1px; }
html.embed .ov-tags,
html.embed .ov-clock,
html.embed .ov-sub,
html.embed .ov-logo,
html.embed #ov-title-main,
html.embed #ov-title-accent,
html.embed .ov-order-head,
html.embed .ov-results,
html.embed .ov-next,
html.embed .ov-mic,
html.embed .ov-ann-who,
html.embed .ov-row:nth-child(n+3),
html.embed .ov-gap { display: none !important; }
html.embed .ov-title { top: 6px; left: 6px; right: auto; width: auto; padding: 3px 6px; gap: 0; }
html.embed .ov-title > div { display: flex; align-items: center; gap: 6px; }
html.embed .ov-channel { margin: 0; font-size: 8px; letter-spacing: 0.08em; }
html.embed .ov-title-line { font-size: 10px; display: flex; align-items: center; }
html.embed .pill-live { font-size: 9px; padding: 1px 5px; margin: 0; gap: 3px; }
html.embed .pill-live::before { width: 5px; height: 5px; }
html.embed .ov-order { top: 6px; right: 6px; left: auto; width: auto; padding: 1px 0; visibility: visible !important; }
html.embed .ov-row { grid-template-columns: 14px 28px auto; height: 20px; padding: 0 6px; border-top: 0; }
html.embed .ov-pos { font-size: 12px; }
html.embed .ov-plate { width: 26px; height: 16px; font-size: 11px; border-width: 1px; box-shadow: inset 0 -2px 0 var(--pc, var(--yellow)); }
html.embed .ov-name { font-size: 11px; padding-left: 4px; }
html.embed .ov-ann {
  left: 0; right: 0; bottom: 0; transform: none; width: auto; min-height: 0;
  flex-wrap: nowrap; align-items: center; gap: 6px; padding: 3px 4px 3px 8px;
  border-width: 1px 0 0; background: rgba(10, 22, 36, 0.86);
}
html.embed .ov-ann-text { flex: 1 1 auto; }
html.embed .ov-ann-say { color: #fff; font-size: 12px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.embed .ov-voice { min-height: 22px; font-size: 10px; padding: 0 6px; margin: 0; }

/* While the sign-in / race code card is open, the race panels behind it step aside (critic 11-19). */
.spectate:has(#join:not([hidden])) .ov-order,
.spectate:has(#join:not([hidden])) .ov-tags { visibility: hidden; }
html.embed .ad-bug { top: 4px; left: 4px; padding: 3px 5px; border-width: 1px; font-size: 8px; }
html.embed .ad-bar { height: 2px; margin-top: 3px; }

/* ---------- ?embed=1, 11-20 (Alex via the app): "any text that says podium pro tv should be on top of the player, not on
   it" and "make sure the video is still 16:9". The app draws the PODIUM PRO TV title above the player, so the embed
   shows no channel text: the LIVE/REPLAY pill stays, the ad bug goes, and every picture fills the 16:9 frame. The
   channel card is a real in-game still of the Riverside start gate (from the 1080p replay), not text on black. */
html.embed .ov-channel,
html.embed .ad-bug,
html.embed .off-air > * { display: none !important; }
html.embed .ad-video { object-fit: cover; }
html.embed .off-air { background: #000 url("img/gate-card.webp") center / cover no-repeat; }
/* 11-20 (Alex via the app): "the podium pro tv UI clashes with our logo so we need to move the UI down on the top left".
   The app's logo sits over the top-left of the player, so the top-left HUD starts below the top 14% of the frame
   (scales with the player); the running order stays top-right. */
html.embed .ov-title { top: calc(14% + 4px); }
