/* Disney Wheel of Fortune - original artwork, styled after the show's set:
   a green puzzle board with white trilon tiles, gold trim, and a night-sky
   park backdrop. No Disney logos, characters or show assets are used. */

:root {
  --ink: #06122b;
  --night-1: #0a1533;
  --night-2: #16114a;
  --night-3: #2b1259;
  --gold: #f4c145;
  --gold-deep: #c8901c;
  --gold-soft: #ffe9a8;
  --teal: #1fa9a0;
  --teal-deep: #0d6f77;
  --board-green: #17805a;
  --board-green-dark: #0d5a3f;
  --tile: #f6f4ec;
  --tile-edge: #cdc8b6;
  --tile-ink: #12203c;
  --red: #d8443c;
  --violet: #7d5bd6;
  --text: #eef2ff;
  --muted: #9fb0d8;
  --panel: rgba(10, 20, 48, 0.72);
  --panel-line: rgba(244, 193, 69, 0.28);
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --tile-w: clamp(15px, 3.6vw, 46px);
  --font-display: "Trebuchet MS", "Gill Sans", "Avenir Next", system-ui, sans-serif;
  --font-body: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100dvh;
  background:
    radial-gradient(120% 90% at 50% -20%, #3b1c74 0%, transparent 60%),
    radial-gradient(100% 70% at 12% 8%, #1a3a7a 0%, transparent 55%),
    linear-gradient(180deg, var(--night-2) 0%, var(--night-1) 45%, #050d20 100%);
  overflow-x: hidden;
}

/* ---------- backdrop ---------- */
.sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.sky canvas { width: 100%; height: 100%; display: block; }

.skyline {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: min(30vh, 260px);
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  background: no-repeat bottom center / cover
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 260' preserveAspectRatio='xMidYMax slice'><g fill='%23070d22'><path d='M0 260V196c46-6 78-20 104-40l18 22 22-30 20 30 16-22c28 22 60 34 104 40v64z'/><path d='M1200 260v-70c-52-6-88-22-116-44l-20 24-24-32-22 32-18-24c-30 24-64 38-110 44v70z'/><path d='M470 260V150c0-8 6-12 12-16l16-10V96l-14 6 22-34 22 34-14-6v28l16 10c6 4 12 8 12 16v110z'/><path d='M560 260V120c0-10 8-16 16-22l24-16V44l-20 8 34-46 34 46-20-8v38l24 16c8 6 16 12 16 22v140z'/><path d='M676 260V150c0-8 6-12 12-16l16-10V96l-14 6 22-34 22 34-14-6v28l16 10c6 4 12 8 12 16v110z'/><path d='M240 260v-84c0-10 10-16 20-22l14-8v-22l-12 4 20-30 20 30-12-4v22l14 8c10 6 20 12 20 22v84z'/><path d='M850 260v-84c0-10 10-16 20-22l14-8v-22l-12 4 20-30 20 30-12-4v22l14 8c10 6 20 12 20 22v84z'/><rect x='0' y='236' width='1200' height='24'/></g></svg>");
}

/* ---------- screens ---------- */
.screen { position: relative; z-index: 1; }
[hidden] { display: none !important; }

/* ================= SETUP ================= */
.setup {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: clamp(16px, 4vw, 48px);
}

.setup-card {
  width: min(980px, 100%);
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: var(--r-lg);
  padding: clamp(20px, 4vw, 44px);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  text-align: center;
}

.kicker {
  margin: 0 0 6px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--gold);
}

.logo {
  margin: 0;
  font-family: var(--font-display);
  line-height: 0.92;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.logo-wheel, .logo-fortune {
  display: block;
  font-size: clamp(38px, 9vw, 96px);
  font-weight: 800;
  background: linear-gradient(180deg, #fff8dc 0%, var(--gold) 45%, var(--gold-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.35));
}
.logo-of {
  display: block;
  font-size: clamp(14px, 2.6vw, 26px);
  letter-spacing: 0.5em;
  color: var(--teal);
  margin: 2px 0 2px 0.5em;
}

.tagline {
  max-width: 64ch;
  margin: 14px auto 26px;
  color: var(--muted);
  line-height: 1.6;
  font-size: clamp(13px, 1.6vw, 16px);
}

.setup-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: start;
  text-align: left;
  margin-bottom: 26px;
}

.field {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--r-md);
  padding: 14px 16px 16px;
  margin: 0;
  background: rgba(255, 255, 255, 0.03);
}
.field legend {
  padding: 0 8px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}
.hint {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.seg-control {
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, 0.3);
  padding: 5px;
  border-radius: 999px;
  flex-wrap: wrap;
}
.seg-btn {
  flex: 1 1 0;
  min-width: 0;
  border: 0;
  border-radius: 999px;
  padding: 9px 8px;
  font: inherit;
  font-size: 12.5px;
  white-space: nowrap;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}
.seg-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.07); }
.seg-btn.is-on {
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  color: #3a2a05;
  box-shadow: 0 2px 10px rgba(244, 193, 69, 0.35);
}

.name-inputs { display: grid; gap: 8px; }
.name-inputs input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.32);
  color: var(--text);
  font: inherit;
}
.name-inputs input:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.name-row { display: flex; align-items: center; gap: 8px; }
.name-row .tag {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  min-width: 52px;
}

.group-checks { display: grid; gap: 7px; }
.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.35;
  cursor: pointer;
  padding: 4px 2px;
  border-radius: var(--r-sm);
}
.check:hover { background: rgba(255, 255, 255, 0.05); }
.check input { margin-top: 2px; accent-color: var(--gold); width: 16px; height: 16px; }

.btn {
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 12px 22px;
  transition: transform 0.12s, box-shadow 0.18s, filter 0.18s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-gold {
  background: linear-gradient(180deg, var(--gold-soft), var(--gold) 55%, var(--gold-deep));
  color: #3a2a05;
  box-shadow: 0 8px 22px rgba(244, 193, 69, 0.3);
}
.btn-gold:hover:not(:disabled) { filter: brightness(1.06); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.15); }
.btn-teal {
  background: linear-gradient(180deg, #35d6c9, var(--teal) 60%, var(--teal-deep));
  color: #04262a;
}
.btn-red { background: linear-gradient(180deg, #f06a62, var(--red)); color: #fff; }
.btn-big { font-size: clamp(15px, 2vw, 19px); padding: 15px 42px; }

.fine-print { margin: 16px 0 0; font-size: 12px; color: var(--muted); }
kbd {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: var(--font-body);
  font-size: 11px;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

/* ================= GAME ================= */
.game {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.4vh, 16px);
  min-height: 100dvh;
  padding: clamp(10px, 2vw, 20px) clamp(10px, 2.5vw, 28px) clamp(14px, 2vw, 22px);
  max-width: 1500px;
  margin: 0 auto;
  width: 100%;
}

.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.hud-seg { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.seg-name {
  font-family: var(--font-display);
  font-size: clamp(16px, 2.6vw, 26px);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold);
  white-space: nowrap;
}
.seg-sub {
  font-size: clamp(11px, 1.4vw, 13px);
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hud-actions { display: flex; gap: 8px; flex-shrink: 0; }
.icon-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: grid;
  place-items: center;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.16); }
#btn-sound .ic-off { display: none; }
#btn-sound[aria-pressed="false"] .ic-on { display: none; }
#btn-sound[aria-pressed="false"] .ic-off { display: inline; }

/* ---------- stage ---------- */
.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(220px, 26vw, 340px);
  gap: clamp(12px, 2vw, 28px);
  align-items: center;
}

.board-column { display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 0; }

.category-strip {
  position: relative;
  background: linear-gradient(180deg, #27c3bb, var(--teal) 50%, var(--teal-deep));
  color: #04262a;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: clamp(10px, 1.5vw, 15px);
  padding: 7px 44px;
  border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  text-align: center;
  max-width: 100%;
}
/* Three-circle motif at each end, echoing the show's themed category strips. */
.category-strip::before, .category-strip::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 26px; height: 12px;
  transform: translateY(-50%);
  background:
    radial-gradient(circle at 4px 3px, #04262a 3px, transparent 3.5px),
    radial-gradient(circle at 22px 3px, #04262a 3px, transparent 3.5px),
    radial-gradient(circle at 13px 8px, #04262a 5px, transparent 5.5px);
  opacity: 0.65;
}
.category-strip::before { left: 10px; }
.category-strip::after { right: 10px; }

.board-frame {
  background: linear-gradient(180deg, #12305c, #0a1c3a);
  padding: clamp(8px, 1.4vw, 16px);
  border-radius: var(--r-md);
  border: 3px solid transparent;
  background-clip: padding-box;
  box-shadow:
    0 0 0 2px var(--gold-deep),
    0 0 0 5px rgba(0, 0, 0, 0.5),
    0 22px 50px rgba(0, 0, 0, 0.55),
    inset 0 0 60px rgba(0, 0, 0, 0.4);
  max-width: 100%;
  overflow-x: auto;
}

.board { display: grid; gap: clamp(2px, 0.45vw, 5px); }
.board-row { display: grid; grid-auto-flow: column; gap: clamp(2px, 0.45vw, 5px); justify-content: center; }

.tile {
  width: var(--tile-w);
  height: calc(var(--tile-w) * 1.34);
  border-radius: 3px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: calc(var(--tile-w) * 0.72);
  line-height: 1;
  color: transparent;
  background: linear-gradient(180deg, var(--board-green), var(--board-green-dark));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
  transition: background 0.2s;
}
/* A tile that holds a letter, still hidden. */
.tile.is-slot {
  background: linear-gradient(180deg, #ffffff, var(--tile));
  box-shadow: inset 0 0 0 1px var(--tile-edge), 0 1px 2px rgba(0, 0, 0, 0.3);
}
.tile.is-shown { color: var(--tile-ink); }
.tile.is-punct {
  background: linear-gradient(180deg, #ffffff, var(--tile));
  color: var(--tile-ink);
  box-shadow: inset 0 0 0 1px var(--tile-edge);
}
.tile.flip { animation: flip 0.45s ease both; }
@keyframes flip {
  0% { transform: rotateX(0deg); }
  45% { transform: rotateX(90deg); background: #fff; }
  100% { transform: rotateX(0deg); }
}
.tile.glow { animation: glow 0.7s ease 2; }
@keyframes glow {
  0%, 100% { box-shadow: inset 0 0 0 1px var(--tile-edge); }
  50% { box-shadow: inset 0 0 0 2px var(--gold), 0 0 18px var(--gold); }
}

.board-note {
  font-size: clamp(11px, 1.4vw, 13px);
  color: var(--gold-soft);
  text-align: center;
  background: rgba(244, 193, 69, 0.1);
  border: 1px solid var(--panel-line);
  border-radius: 999px;
  padding: 5px 16px;
  max-width: 100%;
}

/* ---------- wheel ---------- */
.wheel-column { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.wheel-stage { position: relative; width: 100%; aspect-ratio: 1; max-width: 340px; }
#wheel { width: 100%; height: 100%; display: block; filter: drop-shadow(0 16px 34px rgba(0, 0, 0, 0.55)); }

.wheel-pointer {
  position: absolute;
  top: -6px; left: 50%;
  width: 22px; height: 40px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, var(--gold-soft), var(--gold) 40%, var(--gold-deep));
  clip-path: polygon(50% 100%, 0 22%, 12% 0, 88% 0, 100% 22%);
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.6));
  z-index: 3;
  transform-origin: 50% 10%;
}
.wheel-pointer.tick { animation: tick 0.09s ease; }
@keyframes tick {
  0% { transform: translateX(-50%) rotate(0deg); }
  50% { transform: translateX(-50%) rotate(9deg); }
  100% { transform: translateX(-50%) rotate(0deg); }
}

.wheel-hub {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 27%; height: 27%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 30%, #2a4a86, #0b1631 70%);
  border: 2px solid var(--gold-deep);
  color: var(--gold);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(9px, 1.5vw, 13px);
  letter-spacing: 0.1em;
  z-index: 2;
  pointer-events: none;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.7);
}

.wedge-readout {
  min-height: 30px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(15px, 2.4vw, 24px);
  letter-spacing: 0.04em;
  text-align: center;
  color: var(--gold);
  text-shadow: 0 2px 12px rgba(244, 193, 69, 0.4);
}
.wedge-readout.bad { color: #ff8a80; text-shadow: 0 2px 14px rgba(216, 68, 60, 0.5); }

/* ---------- host line ---------- */
.host-line {
  margin: 0;
  text-align: center;
  min-height: 1.5em;
  font-size: clamp(13px, 1.8vw, 17px);
  color: var(--gold-soft);
  letter-spacing: 0.01em;
}

/* ---------- podiums ---------- */
.podiums {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: clamp(8px, 1.5vw, 18px);
}
.podium {
  position: relative;
  background: linear-gradient(180deg, rgba(20, 34, 72, 0.9), rgba(8, 16, 38, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--r-md);
  padding: clamp(8px, 1.4vw, 14px);
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  min-width: 0;
}
.podium.is-turn {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold), 0 10px 30px rgba(244, 193, 69, 0.22);
  transform: translateY(-3px);
}
.podium.is-you .p-name { color: var(--teal); }
.podium.is-out { opacity: 0.42; }
.p-name {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: clamp(11px, 1.5vw, 15px);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.p-round {
  font-family: var(--font-display);
  font-size: clamp(20px, 3.4vw, 34px);
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.p-total {
  font-size: clamp(10px, 1.3vw, 12px);
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
.p-tokens { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; margin-top: 5px; min-height: 16px; }
.token {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 999px;
  text-transform: uppercase;
}
.token.wild { background: var(--violet); color: #fff; }
.token.million { background: linear-gradient(90deg, var(--gold), #fff3c4); color: #3a2a05; }
.token.prize { background: var(--teal); color: #04262a; }
.token.gift { background: var(--red); color: #fff; }

/* ---------- controls ---------- */
.controls { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.action-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; min-height: 44px; }

/* Buzz-in row: one clearly labelled button per person at the keyboard. */
.buzz-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.buzz-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: clamp(13px, 1.7vw, 16px);
  padding: 13px 22px;
}
.buzz-key {
  display: grid;
  place-items: center;
  width: 22px; height: 22px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.28);
  color: inherit;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}

/* ---------- inline answer bar ---------- */
/* Deliberately not a modal: you must be able to read the board while typing. */
.answer-bar {
  width: min(760px, 100%);
  background: linear-gradient(180deg, rgba(22, 40, 82, 0.96), rgba(10, 20, 48, 0.96));
  border: 1px solid var(--gold);
  border-radius: var(--r-md);
  padding: 12px 16px 14px;
  box-shadow: 0 0 0 1px rgba(244, 193, 69, 0.25), 0 14px 34px rgba(0, 0, 0, 0.45);
  animation: riseIn 0.22s cubic-bezier(0.2, 1.2, 0.4, 1);
}
@keyframes riseIn {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.answer-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 9px;
}
.answer-title {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: clamp(12px, 1.7vw, 15px);
  color: var(--gold);
}
.answer-hint { font-size: 12px; color: var(--muted); }

.answer-timer {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  margin-bottom: 10px;
}
.answer-timer-fill {
  height: 100%;
  width: 100%;
  transform-origin: left;
  background: linear-gradient(90deg, var(--teal), var(--gold));
}

.answer-form { display: flex; gap: 8px; flex-wrap: wrap; }
.answer-form input {
  flex: 1 1 260px;
  min-width: 0;
  padding: 12px 14px;
  font-family: var(--font-display);
  font-size: clamp(15px, 2.2vw, 20px);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--r-sm);
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.42);
  color: #fff;
}
.answer-form input::placeholder { color: rgba(159, 176, 216, 0.6); letter-spacing: 0.04em; }
.answer-form input:focus-visible { outline: none; border-color: var(--gold); }
.answer-form .btn { flex: 0 0 auto; padding: 12px 20px; }

@media (max-width: 560px) {
  .answer-form .btn { flex: 1 1 auto; }
}

.letter-pad {
  display: grid;
  grid-template-columns: repeat(13, minmax(0, 1fr));
  gap: clamp(3px, 0.5vw, 6px);
  width: min(760px, 100%);
}
.key {
  aspect-ratio: 1 / 1.1;
  border-radius: var(--r-sm);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(11px, 1.7vw, 17px);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.14s, transform 0.1s, opacity 0.2s;
  padding: 0;
}
.key:hover:not(:disabled) { background: rgba(244, 193, 69, 0.25); transform: translateY(-2px); }
.key:disabled { opacity: 0.2; cursor: not-allowed; }
.key.is-vowel { border-color: rgba(31, 169, 160, 0.5); background: rgba(31, 169, 160, 0.12); }
.key.is-used { opacity: 0.22; }
.key.pick { background: var(--gold); color: #3a2a05; border-color: var(--gold); }

/* ---------- overlay + modal ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 8, 20, 0.78);
  backdrop-filter: blur(6px);
  animation: fade 0.2s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: min(620px, 100%);
  max-height: 88dvh;
  overflow-y: auto;
  background: linear-gradient(180deg, #142449, #0a1430);
  border: 1px solid var(--panel-line);
  border-radius: var(--r-lg);
  padding: clamp(20px, 4vw, 34px);
  box-shadow: var(--shadow);
  text-align: center;
  animation: pop 0.24s cubic-bezier(0.2, 1.2, 0.4, 1);
}
@keyframes pop { from { transform: scale(0.94) translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

.modal h2 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: clamp(20px, 3.4vw, 30px);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold);
}
.modal p { color: var(--muted); line-height: 1.6; margin: 0 0 16px; }
.modal .big-answer {
  font-family: var(--font-display);
  font-size: clamp(18px, 3vw, 28px);
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.04em;
  margin: 10px 0 18px;
}
.modal-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.modal input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--font-display);
  font-size: clamp(15px, 2.4vw, 21px);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
  border-radius: var(--r-md);
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  margin-bottom: 14px;
}
.modal input[type="text"]:focus-visible { outline: none; border-color: var(--gold); }

.timer-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  margin-bottom: 16px;
}
.timer-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  transform-origin: left;
}

.standings { list-style: none; margin: 0 0 18px; padding: 0; text-align: left; }
.standings li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.05);
  margin-bottom: 6px;
}
.standings li.top { background: rgba(244, 193, 69, 0.16); border: 1px solid var(--panel-line); }
.standings .amt { font-family: var(--font-display); font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }
.prize-list { list-style: none; padding: 0; margin: 4px 0 0; font-size: 12px; color: var(--teal); }

.rules-body { text-align: left; }
.rules-body h3 {
  margin: 18px 0 6px;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}
.rules-body p, .rules-body li { font-size: 13px; line-height: 1.65; color: var(--muted); }
.rules-body ul { margin: 0; padding-left: 20px; }

/* ---------- flash banner ---------- */
.flash {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.flash span {
  font-family: var(--font-display);
  font-size: clamp(34px, 11vw, 120px);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  animation: stamp 1.1s cubic-bezier(0.2, 1.4, 0.3, 1) both;
  text-align: center;
  padding: 0 20px;
}
@keyframes stamp {
  0% { transform: scale(2.6) rotate(-8deg); opacity: 0; }
  22% { transform: scale(1) rotate(-3deg); opacity: 1; }
  78% { transform: scale(1) rotate(-3deg); opacity: 1; }
  100% { transform: scale(1.08); opacity: 0; }
}
.flash.bad span { color: #ff6b60; text-shadow: 0 0 40px rgba(216, 68, 60, 0.7); }
.flash.good span { color: var(--gold); text-shadow: 0 0 44px rgba(244, 193, 69, 0.7); }
.flash.big span {
  background: linear-gradient(180deg, #fff, var(--gold) 50%, var(--gold-deep));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .stage { grid-template-columns: 1fr; }
  .wheel-column { order: -1; }
  .wheel-stage { max-width: 250px; }
  .letter-pad { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  :root { --tile-w: clamp(15px, 5.4vw, 34px); }
}
@media (max-width: 560px) {
  .podiums { grid-auto-flow: row; grid-auto-columns: auto; }
  .podium { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; text-align: left; }
  .p-round { font-size: 20px; }
  .p-tokens { justify-content: flex-end; }
  .category-strip { padding: 6px 34px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
