/* ---------------------------------------------------------------
   CLIFF HANGERS — 1976 game-show × Bavarian alpine, sized so
   marquee + mountain + product card all share one viewport.

   Typography uses the actual show fonts:
     - "Decorative" for the title card (the western/circus lockup)
     - "Swis721 BT" / Condensed / Bold Condensed Outline for tags,
       readouts, and dollar amounts.
   Sourced from tpirepguide.com → cliff.zip + swiss.zip.
   --------------------------------------------------------------- */

@font-face {
  font-family: "ClifHangerTitle";
  src: url("/fonts/cliff-decorative.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Swiss721";
  src: url("/fonts/swiss721.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Swiss721Cond";
  src: url("/fonts/swiss721-cond.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Swiss721BoldCondOutline";
  src: url("/fonts/swiss721-bold-cond-outline.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --stage-curtain-1: #5B0E1A;
  --stage-curtain-2: #2C0810;

  --marquee-yellow: #FFD23F;
  --marquee-yellow-bright: #FFE57A;
  --marquee-yellow-dim: #B8941D;
  --gameshow-red: #DC2F1F;
  --gameshow-red-dark: #8A1A0F;

  --alpine-snow: #FAFAFA;
  --alpine-cream: #FAF1DA;
  --alpine-cream-2: #F2E2BD;
  --leder-brown: #7A4A28;
  --wood-brown: #6B3410;
  --wood-light: #A06B3F;
  --wood-dark: #3D2817;
  --cobble: #9C968B;

  --ink: #1A0F08;
  --muted: #6E5238;

  --crt-bg: #0E1A0E;
  --crt-green: #62FF8A;
  --crt-green-dim: #1F4A24;

  --shadow-deep: 0 22px 48px rgba(20, 6, 6, 0.55), 0 4px 0 rgba(0, 0, 0, 0.3);
  --shadow-cardboard: 0 6px 0 var(--ink), 0 14px 0 rgba(0, 0, 0, 0.18), 0 22px 32px rgba(20, 6, 6, 0.4);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: 'Swiss721', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(ellipse at top, rgba(255, 210, 63, 0.12), transparent 70%),
    repeating-linear-gradient(
      90deg,
      var(--stage-curtain-1) 0,
      var(--stage-curtain-1) 28px,
      var(--stage-curtain-2) 28px,
      var(--stage-curtain-2) 56px
    );
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% -10%, rgba(255, 226, 122, 0.22), transparent 60%);
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 3px 3px;
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: overlay;
}

.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.theater {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.9rem 1rem 2.5rem;
  display: grid;
  gap: 1rem;
}

/* =============================================================
   MARQUEE — compact wood-grain "CLIFF HANGERS"
   ============================================================= */
.marquee {
  background: linear-gradient(180deg, #FFE57A, #FFC93C);
  border: 4px solid var(--ink);
  border-radius: 14px;
  padding: 0;
  box-shadow: var(--shadow-deep);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.marquee-inner {
  padding: 0.4rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.title-cliff-hangers {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-family: 'ClifHangerTitle', 'Smokum', cursive;
  font-weight: 400;
  font-size: clamp(1.85rem, 3.6vw, 2.6rem);
  line-height: 0.9;
  letter-spacing: 0.04em;
}
.wood-word {
  background:
    linear-gradient(180deg, #A06B3F 0%, #7A4A28 35%, #8A5532 55%, #5A3416 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 2px var(--ink);
          text-stroke: 2px var(--ink);
  filter:
    drop-shadow(0 2px 0 rgba(0, 0, 0, 0.35))
    drop-shadow(0 4px 6px rgba(0, 0, 0, 0.25));
}
.edelweiss-mid {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--gameshow-red);
  border: 2px solid var(--ink);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  padding: 4px;
  box-shadow: 0 2px 0 var(--gameshow-red-dark);
  transform: rotate(-8deg);
}

.tagline {
  font-family: 'Swiss721', sans-serif;
  font-size: clamp(0.82rem, 1.1vw, 0.95rem);
  font-weight: 500;
  color: var(--ink);
  margin: 0;
  max-width: 56ch;
  text-align: right;
}
.tagline em {
  font-style: italic;
  color: var(--gameshow-red-dark);
  font-weight: 700;
  white-space: nowrap;
}

/* Bulb strips */
.bulbs {
  height: 12px;
  background-color: var(--ink);
  background-image:
    radial-gradient(circle, var(--marquee-yellow-bright) 3.6px, var(--marquee-yellow-dim) 4.2px, transparent 5.2px),
    radial-gradient(circle, rgba(255, 226, 122, 0.55) 5.5px, transparent 6.5px);
  background-size: 22px 12px, 22px 12px;
  background-repeat: repeat-x;
}
.bulbs-row { animation: chase 1.2s linear infinite; }
.bulbs-top { animation-direction: reverse; }
@keyframes chase {
  to { background-position: 22px 0, 22px 0; }
}

/* =============================================================
   HERO — mountain stage on left, prize/guess panel on right
   ============================================================= */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.85fr);
  gap: 1rem;
  align-items: stretch;
}
@media (max-width: 920px) {
  .hero { grid-template-columns: 1fr; }
}

/* =============================================================
   MOUNTAIN STAGE
   ============================================================= */
.mountain-stage {
  position: relative;
  background: linear-gradient(180deg, #2A0F1A 0%, #5B0E1A 100%);
  border: 4px solid var(--ink);
  border-radius: 14px;
  padding: 0;
  box-shadow: var(--shadow-deep);
  overflow: hidden;
  /* The SVG is square-ish and self-sizing; cap its height so the row
     fits a typical desktop viewport. */
  max-height: min(72vh, 640px);
}
.alps {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--cobble);
}

/* LED-style step readout */
.readout {
  position: absolute;
  top: 0.85rem;
  right: 1rem;
  z-index: 2;
  background: var(--crt-bg);
  border: 3px solid var(--ink);
  border-radius: 10px;
  padding: 0.32rem 0.75rem;
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  font-family: 'Swiss721Cond', 'Bungee', sans-serif;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6), 0 4px 0 #4A0010;
}
.readout-label {
  font-size: 0.65rem;
  color: var(--marquee-yellow);
  letter-spacing: 0.1em;
}
.readout-digits {
  /* The LED counter is the one place the outline face shines: big,
     glowing, used purely as a number display. */
  font-family: 'Swiss721BoldCondOutline', 'Swiss721Cond', 'Bungee', sans-serif;
  font-size: 1.4rem;
  color: var(--crt-green);
  text-shadow: 0 0 6px rgba(98, 255, 138, 0.55);
  min-width: 2ch;
  text-align: center;
}
.readout-digits.danger {
  color: #FF5555;
  text-shadow: 0 0 6px rgba(255, 50, 50, 0.7);
  animation: pulseRed 0.4s ease-in-out infinite alternate;
}
@keyframes pulseRed { to { opacity: 0.55; } }
.readout-divider, .readout-cap {
  font-size: 1rem;
  color: var(--crt-green-dim);
}

/* Climber motion — slow on purpose so each climb has a beat of suspense
   before he settles. */
.climber {
  transition: transform 1800ms cubic-bezier(0.4, 0.0, 0.3, 1);
}
.climber.fallen {
  animation: tumble 1.8s cubic-bezier(0.45, 0.05, 0.7, 0.95) forwards;
}
@keyframes tumble {
  0%   { transform: translate(290px, 145px) rotate(0); }
  18%  { transform: translate(330px, 110px) rotate(220deg); }
  45%  { transform: translate(420px, 240px) rotate(540deg); }
  70%  { transform: translate(520px, 400px) rotate(820deg); }
  100% { transform: translate(640px, 620px) rotate(1080deg); }
}
.climber-arms { transform-origin: center; }
.climber.yodel .climber-arms {
  animation: yodelArms 0.45s ease-in-out 3;
}
@keyframes yodelArms {
  0%, 100% { transform: rotate(0); }
  50%      { transform: rotate(-4deg) translateY(-1px); }
}
.climber.yodel .climber-mouth {
  animation: mouthOpen 0.45s ease-in-out 3;
}
/* Non-Hans face symbols include their own .climber-mouth, so hide the
   external live mouth to avoid stacking two identical ellipses. */
.climber:not([data-climber="hans"]) .climber-mouth-live { display: none; }
@keyframes mouthOpen {
  0%, 100% { transform: scaleY(1); }
  50%      { transform: scaleY(1.7); }
}
.climber.celebrate {
  animation: celebrate 0.65s ease-in-out infinite alternate;
}
@keyframes celebrate {
  to { transform: translate(290px, 132px) scale(1.08); }
}

/* Yodel speech bubbles */
.yodel-bubbles text {
  font-family: 'Swiss721Cond', 'Bagel Fat One', sans-serif;
  font-size: 22px;
  fill: var(--marquee-yellow);
  stroke: var(--ink);
  stroke-width: 4;
  paint-order: stroke fill;
  pointer-events: none;
}
.yodel-bubble {
  animation: bubbleFloat 1.4s ease-out forwards;
}
@keyframes bubbleFloat {
  0%   { opacity: 0; transform: translateY(0) scale(0.8); }
  20%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(-60px) scale(1.4); }
}

/* Cliff flag wave */
.cliff-flag path {
  transform-origin: 0 -24px;
  animation: flagWave 1.2s ease-in-out infinite alternate;
}
@keyframes flagWave { to { transform: skewY(-8deg); } }

/* Cloud drift */
.clouds { animation: drift 26s linear infinite; }
@keyframes drift {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(-16px); }
}

/* =============================================================
   GAME PANEL — right column. Sits flush with the mountain stage.
   ============================================================= */
.game-panel {
  position: relative;
  background: linear-gradient(180deg, var(--alpine-cream) 0%, var(--alpine-cream-2) 100%);
  border: 4px solid var(--ink);
  border-radius: 14px;
  box-shadow: var(--shadow-deep);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: min(72vh, 640px);
}
.game-panel > .bulbs:first-child { border-radius: 10px 10px 0 0; }
.game-panel > .bulbs:last-child  { border-radius: 0 0 10px 10px; }

.round-pill {
  align-self: center;
  margin: 0.35rem auto 0.55rem;
  background: var(--ink);
  color: var(--marquee-yellow);
  font-family: 'Swiss721Cond', 'Bungee', sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  padding: 0.4rem 1.1rem;
  border-radius: 999px;
  border: 2px solid var(--marquee-yellow);
  box-shadow: 0 4px 0 var(--marquee-yellow-dim);
}
.round-pill span {
  color: var(--gameshow-red);
  font-size: 1.15em;
  margin: 0 0.15em;
}

.mode-toggle {
  align-self: center;
  display: inline-flex;
  gap: 0.35rem;
  margin: 0.85rem auto 0;
  padding: 0.22rem;
  background: rgba(26, 15, 8, 0.12);
  border: 2px solid rgba(26, 15, 8, 0.38);
  border-radius: 999px;
}
.mode-toggle button {
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--ink);
  color: var(--marquee-yellow);
  padding: 0.28rem 0.75rem;
  font-family: 'Swiss721Cond', 'Bungee', sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(26, 15, 8, 0.45);
}
.mode-toggle button span { color: var(--gameshow-red); }
.mode-toggle button.is-active {
  background: var(--marquee-yellow);
  color: var(--ink);
  border-color: var(--ink);
  transform: translateY(1px);
  box-shadow: 0 1px 0 rgba(26, 15, 8, 0.45);
}
.mode-toggle button.is-active span { color: var(--gameshow-red-dark); }
.mode-toggle button:focus-visible {
  outline: 3px solid var(--marquee-yellow);
  outline-offset: 2px;
}

/* Cards — slimmer to fit one column */
.prize-card,
.result-card,
.endgame-card {
  margin: 0.85rem 0.85rem 0.85rem;
  padding: 0.95rem 1rem 1rem;
  background: #FFFFFF;
  border: 3px solid var(--ink);
  border-radius: 12px;
  box-shadow: var(--shadow-cardboard);
  position: relative;
  /* No overflow clipping — banners use top:-18px and need to bleed
     above the card edge. */
}
.prize-card { transform: rotate(-0.4deg); }
.result-card { transform: rotate(0.4deg); }
.endgame-card { transform: rotate(-0.3deg); }

.prize-frame {
  position: relative;
  background:
    repeating-linear-gradient(45deg, var(--alpine-cream) 0 8px, var(--alpine-cream-2) 8px 16px);
  border: 3px solid var(--ink);
  border-radius: 10px;
  padding: 0.65rem;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  height: clamp(140px, 22vh, 200px);
  overflow: hidden;
  box-shadow: inset 0 0 0 3px #FFFFFF, inset 0 0 0 4px var(--ink);
}
.prize-frame img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.25));
}
.prize-tag {
  position: absolute;
  top: -14px;
  left: -14px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gameshow-red);
  color: #FFFFFF;
  border: 3px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Swiss721Cond', 'Bagel Fat One', sans-serif;
  font-size: 1.4rem;
  transform: rotate(-12deg);
  box-shadow: 0 3px 0 var(--gameshow-red-dark);
  z-index: 2;
}

.prize-card h2 {
  margin: 0 0 0.25rem;
}
#product-title {
  font-family: 'Swiss721Cond', 'Bagel Fat One', sans-serif;
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  line-height: 1.15;
  color: var(--ink);
  text-decoration: none;
  /* Clamp long titles to keep the card height predictable */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
#product-title:hover,
#product-title:focus-visible {
  color: var(--gameshow-red-dark);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.12em;
}
.product-shop {
  font-family: 'Swiss721Cond', 'Bungee', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.45rem;
}
.product-shop a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}
.product-shop a:hover,
.product-shop a:focus-visible {
  color: var(--gameshow-red-dark);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}
.hint {
  margin: 0 0 0.7rem;
  font-style: italic;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---------- Loading skeleton ---------- */
/* The prize-card stays mounted from first paint with data-state="loading"
   so /api/round can land without the game-panel collapsing then
   expanding by ~500px. Each placeholder occupies the exact footprint
   of the loaded element, then gets replaced 1:1 when data arrives.
   The prize-frame's existing diagonal cream stripe pattern is itself
   the image skeleton — nothing extra needed inside the frame. */

.prize-card[data-state="loading"] #product-image { opacity: 0; }
#product-image { transition: opacity 220ms ease-out; }
.prize-card[data-state="loading"] .prize-tag {
  opacity: 0.45;
  transition: opacity 220ms ease-out;
}

/* Text placeholders: dashed-border tabs that occupy the exact line
   height of the real h2 / .product-shop, so the column doesn't grow
   when the round arrives. */
.prize-card[data-state="loading"] h2,
.prize-card[data-state="loading"] .product-shop {
  position: relative;
  color: transparent;
}
.prize-card[data-state="loading"] h2 a,
.prize-card[data-state="loading"] .product-shop a {
  color: transparent;
  pointer-events: none;
}
.prize-card[data-state="loading"] h2::after,
.prize-card[data-state="loading"] .product-shop::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  height: 0.85em;
  border-radius: 4px;
  background: repeating-linear-gradient(
    45deg,
    var(--alpine-cream) 0 6px,
    var(--alpine-cream-2) 6px 12px
  );
  border: 1.5px dashed rgba(122, 74, 40, 0.4);
  animation: skelPulse 1.6s ease-in-out infinite;
}
.prize-card[data-state="loading"] h2::after { width: 68%; }
.prize-card[data-state="loading"] .product-shop::after { width: 42%; }
@keyframes skelPulse {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 1; }
}

/* Form stays mounted but inert while loading so the column footprint
   is identical before and after data arrives. */
.prize-card[data-state="loading"] #guess-form {
  opacity: 0.55;
  pointer-events: none;
}
.prize-card[data-state="loading"] #guess { background: var(--alpine-cream); }

#guess-form label {
  display: block;
  font-family: 'Swiss721Cond', 'Bungee', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--ink);
  margin-bottom: 0.3rem;
}
.input-row {
  display: grid;
  grid-template-columns: auto 1fr;
  margin-bottom: 0.6rem;
  border-radius: 10px;
}
.dollar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.7rem;
  background: var(--ink);
  color: var(--marquee-yellow);
  border: 3px solid var(--ink);
  border-right: none;
  border-radius: 8px 0 0 8px;
  font-family: 'Swiss721Cond', 'Bungee', sans-serif;
  font-size: 1.2rem;
}
input[type="number"] {
  font: inherit;
  font-family: 'Swiss721Cond', 'Bungee', sans-serif;
  font-size: 1.4rem;
  padding: 0.45rem 0.65rem;
  background: var(--alpine-cream);
  border: 3px solid var(--ink);
  border-radius: 0 8px 8px 0;
  color: var(--ink);
  width: 100%;
  appearance: textfield;
  transition: border-color 120ms ease;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
/* Keyboard focus halo — visible when a real Tab navigation lands on
   the input, suppressed when JS auto-focuses on showProduct (some
   browsers treat post-keyboard programmatic focus as :focus-visible
   which painted a red ring on every round). The data-silent-focus
   attribute is set by silentFocus() in game.js for one frame. */
input[type="number"]:focus { outline: none; }
@media (any-hover: hover) and (any-pointer: fine) {
  .input-row:has(input[type="number"]:focus-visible):not(:has(input[type="number"][data-silent-focus])) {
    outline: 3px solid var(--marquee-yellow);
    outline-offset: 2px;
    box-shadow: 0 0 0 5px rgba(26, 15, 8, 0.18);
  }
  input[type="number"][data-silent-focus]:focus,
  input[type="number"][data-silent-focus]:focus-visible {
    outline: none;
  }

  /* Same treatment for the Next / Play-again buttons, which we also
     auto-focus after a result. */
  .lock-btn:focus-visible {
    outline: 3px solid var(--gameshow-red);
    outline-offset: 3px;
  }
  .lock-btn[data-silent-focus]:focus,
  .lock-btn[data-silent-focus]:focus-visible { outline: none; }
}

.lock-btn {
  font-family: 'Swiss721Cond', 'Bagel Fat One', sans-serif;
  font-size: 1rem;
  letter-spacing: 0.04em;
  background: var(--marquee-yellow);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 10px;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 5px 0 var(--marquee-yellow-dim), 0 8px 0 var(--ink);
  transition: transform 80ms ease, box-shadow 80ms ease;
}
.lock-btn:hover {
  background: var(--marquee-yellow-bright);
  transform: translateY(-1px);
}
.lock-btn:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--marquee-yellow-dim), 0 4px 0 var(--ink);
}
/* Inline kbd hint inside buttons */
.kbd-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4em;
  height: 1.4em;
  padding: 0 0.35em;
  background: var(--ink);
  color: var(--marquee-yellow);
  border-radius: 4px;
  font-family: 'Swiss721Cond', 'Bungee', sans-serif;
  font-size: 0.7em;
  letter-spacing: 0;
}

/* Result/Endgame banners */
.result-banner,
.endgame-banner {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%) rotate(-3deg);
  background: var(--marquee-yellow);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 8px;
  padding: 0.3rem 0.95rem;
  font-family: 'Swiss721Cond', 'Bungee', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  box-shadow: 0 4px 0 var(--marquee-yellow-dim);
  white-space: nowrap;
}
.endgame-banner {
  font-family: 'Swiss721Cond', 'Bagel Fat One', sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
}
.result-card.lose .result-banner,
.endgame-card.lose .endgame-banner {
  background: var(--gameshow-red);
  color: #FFFFFF;
  box-shadow: 0 4px 0 var(--gameshow-red-dark);
}
.result-card.win .result-banner,
.endgame-card.win .endgame-banner {
  background: #6CCF4E;
  color: var(--ink);
  box-shadow: 0 4px 0 #2E7A1A;
}
#result-headline,
#endgame-headline {
  font-family: 'Swiss721Cond', 'Bagel Fat One', sans-serif;
  font-size: 1.15rem;
  margin: 0.65rem 0 0.4rem;
  text-align: center;
  color: var(--ink);
}
.actual-price {
  text-align: center;
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.88rem;
}
.actual-price strong {
  /* Big price reveal — outline face matches the show's price tags. */
  font-family: 'Swiss721BoldCondOutline', 'Swiss721Cond', 'Bungee', sans-serif;
  font-size: 1.5rem;
  color: var(--ink);
  letter-spacing: 0.02em;
}
#result-detail,
#endgame-detail {
  text-align: center;
  margin: 0 0 0.7rem;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.4;
}

/* Buy CTA */
.buy-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(180deg, #6CCF4E 0%, #4AA130 100%);
  color: var(--ink);
  font-family: 'Swiss721Cond', 'Bagel Fat One', sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  border: 3px solid var(--ink);
  border-radius: 10px;
  padding: 0.6rem 0.85rem;
  margin-bottom: 0.55rem;
  box-shadow: 0 5px 0 #2E7A1A, 0 8px 0 var(--ink);
  transition: transform 80ms ease, box-shadow 80ms ease;
}
.buy-cta:hover {
  background: linear-gradient(180deg, #82E060 0%, #5BB73A 100%);
  transform: translateY(-1px);
}
.buy-cta:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #2E7A1A, 0 4px 0 var(--ink);
}
.buy-cta-arrow {
  color: var(--gameshow-red-dark);
  font-weight: bold;
}

.endgame-buys {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0.4rem 0 0.85rem;
}
.endgame-buy-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--alpine-cream);
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 0.4rem 0.55rem;
  text-decoration: none;
  color: var(--ink);
  box-shadow: 0 3px 0 var(--ink);
  transition: transform 80ms ease;
}
.endgame-buy-row:hover { transform: translateY(-1px); }
.endgame-buy-row img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  background: #FFFFFF;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
}
.endgame-buy-row .row-title-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}
.endgame-buy-row .row-title {
  font-family: 'Schibsted Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1.15;
}
.endgame-buy-row .row-shop {
  font-family: 'Swiss721Cond', 'Bungee', sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.endgame-buy-row .row-price {
  font-family: 'Swiss721Cond', 'Bungee', sans-serif;
  font-size: 0.9rem;
  color: var(--gameshow-red-dark);
}
.endgame-buy-row .row-arrow {
  color: var(--gameshow-red-dark);
  font-size: 1rem;
}

.error {
  margin: 0 0.85rem 0.85rem;
  padding: 0.6rem 0.85rem;
  background: rgba(220, 47, 31, 0.12);
  color: var(--gameshow-red-dark);
  border: 2px dashed var(--gameshow-red);
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
}

/* =============================================================
   SHOPIFY UCP CALLOUT — single compact row, no header
   ============================================================= */
.ucp-callout {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(180deg, #FFFFFF 0%, #DCFCE7 100%);
  border: 4px solid var(--ink);
  border-radius: 14px;
  padding: 0.95rem 1.1rem;
  box-shadow: 0 5px 0 #1F8A4F, 0 10px 22px rgba(31, 138, 79, 0.3);
}
.ucp-icon {
  font-size: 2rem;
  flex-shrink: 0;
  /* Emojis have a tall implicit line-box that pushes them above the
     text baseline in a flex row. Lock to 1 and translate-y compensates. */
  line-height: 1;
  display: flex;
  align-items: center;
  height: 2rem;
}
.ucp-body {
  flex: 1;
  min-width: 0;
}
.ucp-body p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--ink);
}
.ucp-body strong {
  color: var(--gameshow-red-dark);
  font-weight: 700;
}
.ucp-link {
  flex-shrink: 0;
  font-family: 'Swiss721Cond', 'Bungee', sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: #FFFFFF;
  background: #5DA34A;
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  text-decoration: none;
  text-transform: uppercase;
  box-shadow: 0 4px 0 #2E5A20;
  transition: transform 80ms ease;
}
.ucp-link:hover { transform: translateY(-1px); }
.ucp-link:active { transform: translateY(2px); box-shadow: 0 2px 0 #2E5A20; }
@media (max-width: 640px) {
  .ucp-callout { flex-direction: column; align-items: flex-start; }
  .ucp-link { align-self: stretch; text-align: center; }
}

/* =============================================================
   VIDEO STRIP — real lite-loaded YouTube embeds (3 across)
   ============================================================= */
.vid-strip {
  background: var(--ink);
  border: 4px solid var(--ink);
  border-radius: 14px;
  padding: 1.1rem 1rem;
  box-shadow: var(--shadow-deep);
}
.vid-header {
  text-align: center;
  margin-bottom: 0.85rem;
  color: var(--alpine-cream);
}
.vid-header h2 {
  font-family: 'Swiss721Cond', 'Bagel Fat One', sans-serif;
  font-size: clamp(1.2rem, 2.4vw, 1.6rem);
  margin: 0 0 0.15rem;
  color: var(--marquee-yellow);
}
.vid-header p {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(250, 241, 218, 0.75);
}
.vid-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}
@media (max-width: 720px) {
  .vid-grid { grid-template-columns: 1fr; }
}
.vid-card {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 3px solid var(--ink);
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--marquee-yellow-dim), 0 10px 18px rgba(0, 0, 0, 0.45);
  transition: transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 200ms;
}
.vid-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 9px 0 var(--marquee-yellow-dim), 0 16px 26px rgba(0, 0, 0, 0.5);
}
.vid-card:focus-visible {
  outline: 3px solid var(--marquee-yellow);
  outline-offset: 3px;
}
.vid-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.vid-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gameshow-red);
  color: #FFFFFF;
  border: 3px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  padding-left: 0.2rem;
  box-shadow: 0 4px 0 var(--gameshow-red-dark);
  transition: transform 200ms;
}
.vid-card:hover .vid-play { transform: translate(-50%, -50%) scale(1.1); }
.vid-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.55rem 0.8rem;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.85) 100%);
  color: #FFFFFF;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}
.vid-meta strong {
  font-family: 'Swiss721Cond', 'Bagel Fat One', sans-serif;
  font-size: 0.95rem;
  font-weight: 400;
}
.vid-meta span {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.78);
}
.vid-card iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.vid-homage {
  margin: 0.85rem 0 0;
  text-align: center;
  font-size: 0.78rem;
  font-style: italic;
  color: rgba(250, 241, 218, 0.55);
  letter-spacing: 0.01em;
}
.vid-homage em {
  color: rgba(250, 241, 218, 0.7);
  font-style: italic;
}

/* =============================================================
   FOOTER STRIP
   ============================================================= */
.footer-strip {
  background: var(--ink);
  color: var(--alpine-cream);
  border: 4px solid var(--ink);
  border-radius: 12px;
  padding: 0.7rem 1.1rem;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  box-shadow: var(--shadow-deep);
}
.footer-key {
  font-family: 'Swiss721Cond', 'Bungee', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: var(--marquee-yellow);
}
.footer-val {
  font-family: 'Schibsted Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
}
.footer-keys {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.78rem;
  color: rgba(250, 241, 218, 0.72);
  flex-wrap: wrap;
}
.footer-shortcut-pair {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
}
.footer-shortcut {
  /* The pill is the tap target; the label beside it is plain text.
     Padding around the kbd gives a comfortable hit area without
     stretching the footer vertically. */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  padding: 0.25rem;
  margin: 0;
  cursor: pointer;
  border-radius: 6px;
  -webkit-tap-highlight-color: transparent;
}
.footer-shortcut:focus-visible {
  outline: 2px solid var(--marquee-yellow);
  outline-offset: 1px;
}
.footer-shortcut kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6em;
  height: 1.5em;
  padding: 0 0.35em;
  background: rgba(255, 226, 122, 0.15);
  color: var(--marquee-yellow);
  border: 1px solid rgba(255, 226, 122, 0.4);
  border-bottom-width: 2px;
  border-radius: 4px;
  font-family: 'Swiss721Cond', 'Bungee', sans-serif;
  font-size: 0.85em;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}
.footer-shortcut:hover kbd {
  background: rgba(255, 226, 122, 0.3);
  border-color: rgba(255, 226, 122, 0.75);
  color: var(--alpine-cream);
}
.footer-shortcut:active kbd {
  background: rgba(255, 226, 122, 0.45);
}
.footer-shortcut-label {
  color: rgba(250, 241, 218, 0.72);
  font-family: 'Swiss721Cond', 'Bungee', sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}
.sound-toggle {
  background: var(--gameshow-red);
  color: #FFFFFF;
  border: 2px solid var(--marquee-yellow);
  border-radius: 999px;
  padding: 0;
  font-family: 'Swiss721Cond', 'Bungee', sans-serif;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  width: 44px;
  min-height: 44px;
}
.sound-toggle[aria-pressed="false"] {
  background: var(--crt-green-dim);
  color: rgba(255, 255, 255, 0.6);
}
.sound-icon-off,
.sound-toggle[aria-pressed="false"] .sound-icon-on {
  display: none;
}
.sound-toggle[aria-pressed="false"] .sound-icon-off {
  display: inline;
}
.sound-toggle:hover { filter: brightness(1.1); }
.climber-reopen {
  background: transparent;
  border: 1px dashed rgba(250, 241, 218, 0.4);
  color: rgba(250, 241, 218, 0.7);
  font-family: 'Swiss721Cond', sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}
.climber-reopen:hover { color: var(--marquee-yellow); border-color: var(--marquee-yellow); }
.climber-reopen:focus-visible { outline: 2px solid var(--marquee-yellow); outline-offset: 2px; }

body.dialog-open { overflow: hidden; }
.scoreboard,
.newscore,
.climber-picker {
  border: none;
  padding: 0;
  background: transparent;
  color: var(--ink);
}
.scoreboard { max-width: 540px; width: calc(100vw - 2rem); margin: auto; }
.newscore { max-width: 460px; width: calc(100vw - 2rem); margin: auto; }
.climber-picker { max-width: 540px; width: calc(100vw - 2rem); margin: auto; }
.scoreboard::backdrop {
  background:
    radial-gradient(ellipse at top, rgba(220, 47, 31, 0.18), transparent 70%),
    rgba(20, 6, 6, 0.78);
  backdrop-filter: blur(2px);
}
.climber-picker::backdrop {
  background:
    radial-gradient(ellipse at top, rgba(255, 210, 63, 0.18), transparent 60%),
    rgba(20, 6, 6, 0.78);
  backdrop-filter: blur(2px);
}
.newscore::backdrop {
  background:
    radial-gradient(ellipse at top, rgba(255, 210, 63, 0.22), transparent 60%),
    rgba(20, 6, 6, 0.88);
  animation: nsBackdropPulse 2.4s ease-in-out infinite alternate;
}
@keyframes nsBackdropPulse {
  to {
    background:
      radial-gradient(ellipse at top, rgba(255, 210, 63, 0.4), transparent 60%),
      rgba(20, 6, 6, 0.88);
  }
}
.scoreboard[open], .climber-picker[open] { animation: sbDrop 280ms cubic-bezier(0.2, 0.9, 0.2, 1); }
.newscore[open] { animation: nsLand 0.5s cubic-bezier(0.34, 1.45, 0.64, 1); }
@keyframes sbDrop {
  from { opacity: 0; transform: translateY(-24px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}
@keyframes nsLand {
  0%   { transform: translateY(-30px) scale(0.85); opacity: 0; }
  60%  { transform: translateY(0) scale(1.04); opacity: 1; }
  100% { transform: none; }
}
.scoreboard > .bulbs:first-child,
.newscore > .bulbs:first-child,
.climber-picker > .bulbs:first-child {
  border: 4px solid var(--ink);
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
}
.scoreboard > .bulbs:last-child,
.newscore > .bulbs:last-child,
.climber-picker > .bulbs:last-child {
  border: 4px solid var(--ink);
  border-top: 0;
  border-radius: 0 0 14px 14px;
}
.scoreboard-frame,
.newscore-frame,
.climber-picker-frame {
  background: linear-gradient(180deg, var(--alpine-cream) 0%, var(--alpine-cream-2) 100%);
  border-left: 4px solid var(--ink);
  border-right: 4px solid var(--ink);
  box-shadow: var(--shadow-deep);
}
.scoreboard-frame { padding: 1rem 1.2rem 1.1rem; }
.newscore-frame { padding: 1.3rem 1.5rem 1.4rem; text-align: center; }
.climber-picker-frame {
  padding: 1rem 1.2rem 1.1rem;
  background:
    repeating-linear-gradient(90deg, rgba(122, 74, 40, 0.04) 0, rgba(122, 74, 40, 0.04) 2px, transparent 2px, transparent 9px),
    linear-gradient(180deg, var(--alpine-cream) 0%, var(--alpine-cream-2) 100%);
}
.scoreboard-header {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 0.85rem;
}
.scoreboard-title {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-family: 'ClifHangerTitle', 'Smokum', cursive;
  font-weight: 400;
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  letter-spacing: 0.04em;
  line-height: 0.9;
}
.scoreboard-close {
  position: absolute;
  top: -0.2rem;
  right: -0.2rem;
  background: var(--gameshow-red);
  color: #FFF;
  border: 2px solid var(--ink);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 0 var(--gameshow-red-dark);
}
.climber-picker-header {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 0.85rem;
}
.climber-picker-title {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-family: 'ClifHangerTitle', 'Smokum', cursive;
  font-weight: 400;
  font-size: clamp(1.3rem, 3vw, 1.75rem);
  letter-spacing: 0.04em;
  line-height: 0.9;
  text-align: center;
}
.climber-picker-close {
  position: absolute;
  top: -0.2rem;
  right: -0.2rem;
  background: var(--gameshow-red);
  color: #FFF;
  border: 2px solid var(--ink);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 0 var(--gameshow-red-dark);
}
.climber-picker-close:hover { transform: translateY(-1px); }
.climber-picker-intro {
  margin: 0.4rem 0 0.85rem;
  text-align: center;
  font-style: italic;
  font-size: 0.92rem;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.climber-grid {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0.1rem 0.6rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem 0.7rem;
}
.climber-card {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  isolation: isolate;
  transform-origin: 50% 90%;
  transition: transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1), filter 180ms ease;
  filter: drop-shadow(0 6px 0 rgba(26, 15, 8, 0.85)) drop-shadow(0 10px 14px rgba(20, 6, 6, 0.35));
}
.climber-grid li:nth-child(1) .climber-card { transform: rotate(-1.5deg); }
.climber-grid li:nth-child(2) .climber-card { transform: rotate( 1deg); }
.climber-grid li:nth-child(3) .climber-card { transform: rotate(-2deg); }
.climber-grid li:nth-child(4) .climber-card { transform: rotate( 1.5deg); }
.climber-grid li:nth-child(5) .climber-card { transform: rotate(-1deg); }
.climber-grid li:nth-child(6) .climber-card { transform: rotate( 2deg); }
.climber-grid li:nth-child(7) .climber-card { transform: rotate(-1.5deg); }
.climber-grid li:nth-child(8) .climber-card { transform: rotate( 1deg); }
.climber-card:hover {
  transform: translateY(-3px) rotate(0deg);
  filter: drop-shadow(0 10px 0 rgba(26, 15, 8, 0.9)) drop-shadow(0 16px 22px rgba(20, 6, 6, 0.4));
  z-index: 2;
}
.climber-card:focus-visible { outline: none; }
.climber-card:focus-visible .climber-card-frame {
  outline: 3px solid var(--gameshow-red);
  outline-offset: 4px;
}
.climber-card.is-active {
  transform: translateY(-4px) rotate(0deg);
  z-index: 3;
  filter: drop-shadow(0 12px 0 rgba(26, 15, 8, 0.9)) drop-shadow(0 18px 24px rgba(20, 6, 6, 0.45));
}
.climber-card-frame {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  background-image: linear-gradient(180deg, #FFFFFF 0%, #FBF4E0 100%);
  border: 3px solid var(--ink);
  border-bottom: 0;
  overflow: hidden;
}
.climber-card-hans-svg,
.climber-card-portrait-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.climber-card-plate {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.45rem 0.35rem 0.5rem;
  background: linear-gradient(180deg, var(--marquee-yellow-bright) 0%, var(--marquee-yellow) 70%, var(--marquee-yellow-dim) 100%);
  border: 3px solid var(--ink);
  border-top: 2px solid var(--ink);
  transition: filter 180ms ease;
}
.climber-card:hover .climber-card-plate { filter: brightness(1.08); }
.climber-card-name {
  font-family: 'Swiss721Cond', 'Bungee', sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  color: var(--ink);
  text-transform: uppercase;
  line-height: 1;
}
.climber-card-stamp {
  position: absolute;
  top: 6px;
  right: -10px;
  padding: 0.15rem 0.55rem 0.1rem;
  font-family: 'Swiss721BoldCondOutline', 'Swiss721Cond', sans-serif;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  color: var(--gameshow-red);
  border: 3px double var(--gameshow-red);
  border-radius: 4px;
  background: rgba(220, 47, 31, 0.06);
  transform: rotate(-8deg);
  pointer-events: none;
  z-index: 4;
  opacity: 0;
  scale: 0;
}
.climber-card.is-active .climber-card-stamp {
  animation: stampLand 0.32s cubic-bezier(0.5, -0.4, 0.2, 1.4) forwards;
}
.climber-card.is-active.no-stamp-animation .climber-card-stamp {
  animation: none;
  opacity: 1;
  scale: 1;
}
@keyframes stampLand {
  0%   { opacity: 0; transform: rotate(28deg) scale(2.2) translateY(-30px); filter: blur(2px); }
  60%  { opacity: 1; transform: rotate(-12deg) scale(0.92); filter: blur(0); }
  100% { opacity: 1; transform: rotate(-8deg) scale(1); filter: blur(0); }
}
.climber-card.is-active .climber-card-stamp::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 4px;
  box-shadow: 0 0 8px rgba(220, 47, 31, 0.35);
  pointer-events: none;
  z-index: -1;
}
.climber-picker-hint {
  margin: 0.4rem 0 0;
  text-align: center;
  font-family: 'Swiss721Cond', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
}
.climber-picker-hint kbd {
  background: var(--ink);
  color: var(--marquee-yellow);
  padding: 0.05rem 0.4em;
  border-radius: 3px;
  font-family: 'Swiss721Cond', sans-serif;
  font-size: 0.9em;
  margin: 0 0.15em;
}
.climber-picker-hint > span { margin: 0 0.35em; opacity: 0.45; }
@media (max-width: 480px) {
  .climber-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem 0.85rem; }
}
.scoreboard-tabs {
  display: flex;
  justify-content: center;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}
.sb-tab {
  background: var(--ink);
  color: var(--marquee-yellow);
  border: 2px solid var(--marquee-yellow);
  border-radius: 999px;
  padding: 0.4rem 1rem;
  font-family: 'Swiss721Cond', 'Bungee', sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--marquee-yellow-dim);
}
.sb-tab.is-active {
  background: var(--marquee-yellow);
  color: var(--ink);
  transform: translateY(1px);
}
.sb-tab-cap { color: var(--gameshow-red); margin-left: 0.15em; }
.sb-tab.is-active .sb-tab-cap { color: var(--gameshow-red-dark); }
.scoreboard-screen {
  position: relative;
  background: var(--crt-bg);
  border: 4px solid var(--ink);
  border-radius: 8px;
  padding: 0.85rem 1rem 0.95rem;
  box-shadow:
    inset 0 2px 14px rgba(0, 0, 0, 0.85),
    inset 0 0 80px rgba(98, 255, 138, 0.05),
    0 4px 0 #4A0010;
  overflow: hidden;
}
.scoreboard-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(180deg, transparent 0, transparent 2px, rgba(0, 0, 0, 0.22) 2px, rgba(0, 0, 0, 0.22) 3px);
  pointer-events: none;
}
.scoreboard-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
  pointer-events: none;
}
.sb-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.32rem;
}
.sb-row {
  display: grid;
  grid-template-columns: 2.6em auto 1fr 3.2em;
  align-items: baseline;
  gap: 0.65rem;
  font-family: 'Swiss721BoldCondOutline', 'Swiss721Cond', monospace;
  font-size: 1.15rem;
  color: var(--crt-green);
  text-shadow: 0 0 6px rgba(98, 255, 138, 0.55);
  letter-spacing: 0.04em;
  padding: 0.12rem 0.3rem;
  border-radius: 3px;
  position: relative;
}
.sb-rank { font-variant-numeric: tabular-nums; text-align: right; }
.sb-name {
  font-family: 'Swiss721Cond', monospace;
  letter-spacing: 0.12em;
  white-space: nowrap;
  overflow: hidden;
}
.sb-dots {
  display: block;
  height: 1px;
  background-image: radial-gradient(circle, currentColor 0.7px, transparent 1.2px);
  background-size: 6px 6px;
  background-repeat: repeat-x;
  background-position: 0 0.55em;
  opacity: 0.45;
  align-self: center;
}
.sb-wins { font-variant-numeric: tabular-nums; text-align: right; }
.sb-row.is-me {
  background: rgba(255, 210, 63, 0.18);
  color: var(--marquee-yellow);
  text-shadow: 0 0 8px rgba(255, 210, 63, 0.7);
  outline: 1px dashed rgba(255, 210, 63, 0.55);
  outline-offset: -1px;
  animation: meBlink 1.6s ease-in-out infinite;
}
@keyframes meBlink {
  0%, 100% { background: rgba(255, 210, 63, 0.18); }
  50%      { background: rgba(255, 210, 63, 0.32); }
}
.sb-row.is-me .sb-rank::before { content: "▶ "; font-size: 0.85em; }
.sb-row.is-empty { color: rgba(98, 255, 138, 0.22); text-shadow: none; }
.sb-rename {
  position: absolute;
  right: -0.4em;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 1px solid var(--marquee-yellow);
  color: var(--marquee-yellow);
  border-radius: 4px;
  padding: 0.1rem 0.3rem;
  font-size: 0.62rem;
  cursor: pointer;
  opacity: 0.8;
}
.sb-rename:hover { opacity: 1; background: rgba(255, 210, 63, 0.15); }
.sb-row.is-renaming { grid-template-columns: 2.6em 1fr; background: rgba(255, 210, 63, 0.28); outline: 2px solid var(--marquee-yellow); }
.sb-rename-form { display: grid; grid-template-columns: 1fr auto auto; gap: 0.35rem; }
.sb-rename-input {
  min-width: 0;
  background: var(--crt-bg);
  color: var(--crt-green);
  border: 1px solid var(--marquee-yellow);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  font: inherit;
  letter-spacing: 0.12em;
}
.sb-rename-cancel,
.sb-rename-save {
  background: var(--marquee-yellow);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 4px;
  font-family: 'Swiss721Cond', sans-serif;
  cursor: pointer;
}
.sb-rename-cancel { background: var(--alpine-cream); }
.scoreboard-hint {
  margin: 0.8rem 0 0;
  text-align: center;
  color: var(--muted);
  font-family: 'Swiss721Cond', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.scoreboard-hint kbd {
  background: var(--ink);
  color: var(--marquee-yellow);
  border-radius: 4px;
  padding: 0.05rem 0.25rem;
}
.newscore-stars {
  margin: 0 0 0.25rem;
  color: var(--marquee-yellow);
  -webkit-text-stroke: 1px var(--ink);
  letter-spacing: 0.35em;
}
.newscore-banner {
  font-family: 'Swiss721BoldCondOutline', 'Swiss721Cond', sans-serif;
  font-size: clamp(1.5rem, 5vw, 2.1rem);
  font-weight: 700;
  color: var(--marquee-yellow);
  -webkit-text-stroke: 1.5px var(--ink);
  letter-spacing: 0.04em;
  text-shadow: 0 3px 0 var(--ink), 0 0 24px rgba(255, 210, 63, 0.55);
  margin: 0;
  animation: nsBannerPulse 0.85s ease-in-out infinite alternate;
}
@keyframes nsBannerPulse {
  from { transform: scale(1); }
  to   { transform: scale(1.04); filter: brightness(1.18) drop-shadow(0 0 10px rgba(255, 210, 63, 0.55)); }
}
.newscore-rank {
  margin: 0.35rem 0 1rem;
  font-family: 'Swiss721Cond', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.22em;
  color: var(--gameshow-red-dark);
  text-transform: uppercase;
}
.newscore-rank::before,
.newscore-rank::after { content: "--"; margin: 0 0.55em; opacity: 0.55; }
.newscore-prompt {
  margin: 0 0 1.1rem;
  font-style: italic;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}
.newscore-label {
  display: block;
  margin-bottom: 0.45rem;
  font-family: 'Swiss721Cond', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
}
.newscore-slots {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.35rem;
  background: var(--crt-bg);
  border: 3px solid var(--ink);
  border-radius: 10px;
  padding: 0.55rem 0.6rem 0.7rem;
  margin: 0 auto 0.95rem;
  max-width: 360px;
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.75), 0 4px 0 #4A0010;
  cursor: text;
  position: relative;
}
.newscore-slots::before {
  content: "";
  position: absolute;
  inset: 3px;
  background: repeating-linear-gradient(180deg, transparent 0, transparent 2px, rgba(0, 0, 0, 0.22) 2px, rgba(0, 0, 0, 0.22) 3px);
  pointer-events: none;
  border-radius: 7px;
}
.newscore-slots:focus-within,
.newscore-slots:has(+ .newscore-input-hidden:focus) {
  border-color: var(--marquee-yellow);
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.75), 0 4px 0 var(--marquee-yellow-dim), 0 0 0 3px rgba(255, 210, 63, 0.24);
}
.ns-slot {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 2.5rem;
  border-bottom: 3px solid var(--crt-green-dim);
  font-family: 'Swiss721BoldCondOutline', 'Swiss721Cond', monospace;
  font-size: 1.7rem;
  color: var(--crt-green);
  text-shadow: 0 0 6px rgba(98, 255, 138, 0.65);
  position: relative;
  z-index: 1;
}
.ns-slot.is-cursor::after {
  content: "▌";
  color: var(--marquee-yellow);
  text-shadow: 0 0 6px rgba(255, 210, 63, 0.75);
  font-size: 1.3rem;
  margin-bottom: 0.05rem;
  animation: nsCursorBlink 0.75s steps(2, end) infinite;
}
@keyframes nsCursorBlink { to { opacity: 0; } }
.newscore-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  border: 0;
}
.newscore-error {
  margin: -0.4rem 0 0.7rem;
  color: var(--gameshow-red-dark);
  font-weight: 700;
  font-size: 0.8rem;
}
.newscore-skip {
  display: block;
  margin: 0.85rem auto 0;
  background: none;
  border: none;
  color: var(--muted);
  font-family: 'Swiss721', sans-serif;
  font-size: 0.78rem;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  letter-spacing: 0.02em;
}
.newscore-skip:hover { color: var(--ink); }
.endgame-card { position: relative; }
.rank-stamp {
  position: absolute;
  top: -16px;
  right: -14px;
  width: 78px;
  height: 78px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.05rem;
  background: radial-gradient(circle at 35% 35%, var(--marquee-yellow-bright), var(--marquee-yellow) 60%, var(--marquee-yellow-dim) 100%);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 50%;
  transform: rotate(8deg);
  box-shadow: 0 4px 0 var(--marquee-yellow-dim), 0 8px 16px rgba(0, 0, 0, 0.3);
  font-family: 'Swiss721Cond', 'Bungee', sans-serif;
  text-align: center;
  z-index: 3;
  animation: rankStampLand 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}
.rank-stamp::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1.5px dashed rgba(26, 15, 8, 0.55);
  border-radius: 50%;
  pointer-events: none;
}
.rank-stamp-up { font-size: 0.85rem; color: var(--gameshow-red); line-height: 1; }
.rank-stamp-label { font-size: 0.6rem; letter-spacing: 0.18em; line-height: 1; }
.rank-stamp-num {
  font-family: 'Swiss721BoldCondOutline', 'Swiss721Cond', sans-serif;
  font-size: 1.3rem;
  letter-spacing: 0.02em;
  line-height: 1;
}
@keyframes rankStampLand {
  0%   { transform: rotate(0) scale(2.2); opacity: 0; }
  55%  { transform: rotate(-6deg) scale(0.92); opacity: 1; }
  100% { transform: rotate(8deg) scale(1); }
}
.rank-stamp[data-rank="1"] {
  background: radial-gradient(circle at 35% 35%, #FF8A8A, var(--gameshow-red) 60%, var(--gameshow-red-dark) 100%);
  color: #FFF;
  box-shadow: 0 4px 0 var(--gameshow-red-dark), 0 0 24px rgba(255, 100, 80, 0.6);
}
.rank-stamp[data-rank="1"] .rank-stamp-up { color: var(--marquee-yellow); }
.rank-stamp[data-rank="1"] .rank-stamp-label { color: rgba(255, 255, 255, 0.85); }
.rank-stamp[data-rank="1"]::before { border-color: rgba(255, 255, 255, 0.55); }

/* =============================================================
   PAGE LOAD STAGGER
   ============================================================= */
.marquee, .hero, .ucp-callout, .vid-strip, .footer-strip {
  animation: drop 600ms cubic-bezier(0.2, 0.9, 0.2, 1) backwards;
}
.hero          { animation-delay: 90ms; }
.ucp-callout   { animation-delay: 170ms; }
.vid-strip     { animation-delay: 260ms; }
.footer-strip  { animation-delay: 340ms; }
@keyframes drop {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =============================================================
   RESPONSIVE
   ============================================================= */
@media (max-width: 920px) {
  .mountain-stage,
  .game-panel { max-height: none; }
  .mountain-stage { aspect-ratio: 1; }
}
@media (max-width: 640px) {
  .theater { padding: 0.75rem 0.65rem 2rem; }
  .marquee-inner {
    /* Stack on mobile and center both title and tagline. */
    justify-content: center;
    text-align: center;
    gap: 0.55rem;
    padding: 0.5rem 0.85rem;
  }
  .title-cliff-hangers { width: 100%; justify-content: center; }
  .tagline { text-align: center; }
  .readout {
    top: 0.55rem;
    right: 0.7rem;
    padding: 0.25rem 0.55rem;
  }
  .readout-digits { font-size: 1.1rem; }
}
