/* The Big Ask: broadcast theme, matched to the edition logo art
   (navy stage, blue spotlights, metallic gold + white block type, gold-trimmed ribbons, bulb rings) */
:root {
  --set: #16205a;
  --set-glow: #2446b8;
  --set-deep: #090e30;
  --panel-top: #1f2d80;
  --panel-bot: #111a54;
  --panel-edge: rgba(255, 205, 70, 0.42);
  --beam: rgba(90, 150, 255, 0.2);

  --gold: #ffc933;
  --gold-hot: #fff0a0;
  --gold-deep: #b98200;
  --metal-gold: linear-gradient(180deg, #fff6c2 0%, #ffd84a 38%, #e8a300 54%, #ffcf3a 74%, #fff0a0 100%);
  --metal-white: linear-gradient(180deg, #ffffff 0%, #eef2fb 44%, #b3bfd9 56%, #f2f5fc 100%);
  --satin-white: linear-gradient(180deg, #ffffff 0%, #eef2fb 55%, #d5ddee 100%);

  --tangerine: #ff6a2b;
  --chalk: #f4f7ff;
  --chalk-dim: rgba(214, 224, 250, 0.68);
  --mint: #3fe0a4;

  --sans: 'Archivo', system-ui, sans-serif;

  --col: min(460px, 100vw);
  --gutter: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }

body {
  background: var(--set-deep);
  color: var(--chalk);
  font-family: var(--sans);
  font-variation-settings: 'wdth' 100;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

/* ---------- Type: block capitals in metal, like the logo ---------- */
.disp {
  font-family: var(--sans);
  font-weight: 900;
  font-variation-settings: 'wdth' 112;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}
.mg, .mw {
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 1px rgba(6, 10, 36, 0.85);
  filter: drop-shadow(0 2px 0 #060a24) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45));
}
.mg { background-image: var(--metal-gold); }
.mw { background-image: var(--metal-white); }

/* ---------- The stage: spotlight beams from the rigging, a lit floor ring ---------- */
.set {
  position: relative;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  background:
    radial-gradient(110% 55% at 50% -10%, var(--set-glow) 0%, transparent 60%),
    linear-gradient(180deg, var(--set) 0%, var(--set) 45%, var(--set-deep) 100%);
}
.set::before, .sting::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    conic-gradient(from 138deg at 4% -8%, transparent 0deg, var(--beam) 7deg, transparent 13deg,
                   transparent 21deg, rgba(90, 150, 255, 0.13) 26deg, transparent 32deg, transparent 360deg),
    conic-gradient(from 190deg at 96% -8%, transparent 0deg, rgba(90, 150, 255, 0.13) 6deg, transparent 12deg,
                   transparent 20deg, var(--beam) 26deg, transparent 32deg, transparent 360deg);
  filter: blur(5px);
}
.set::after {
  content: '';
  position: absolute;
  left: 50%; bottom: -70px;
  width: 150%; height: 150px;
  transform: translateX(-50%);
  border-radius: 50%;
  border: 2px solid rgba(120, 175, 255, 0.45);
  box-shadow: 0 0 36px rgba(80, 140, 255, 0.45), inset 0 0 40px rgba(80, 140, 255, 0.3);
  pointer-events: none;
}
.masthead, .stage { position: relative; z-index: 1; }

.masthead {
  width: var(--col);
  padding: 14px var(--gutter) 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.masthead__logo { font-size: 19px; line-height: 1; }
.masthead__ed {
  margin-left: 9px;
  padding: 3px 8px;
  font-size: 10px;
  letter-spacing: 0.02em;
  color: var(--chalk);
  background: var(--set-deep);
  border: 1.5px solid var(--gold);
  border-radius: 4px;
  vertical-align: 3px;
}
.masthead__ed:empty { display: none; }
.masthead__score {
  font-variation-settings: 'wdth' 125;
  font-weight: 500;
  font-size: 15px;
  color: var(--chalk-dim);
}
.masthead__score b { color: var(--chalk); font-weight: 900; font-size: 18px; }

.stage {
  width: var(--col);
  flex: 1;
  min-height: 0;
}
.screen {
  position: absolute;
  inset: 0;
  padding: 8px var(--gutter) calc(64px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}
.screen[hidden] { display: none; }

/* ---------- Panels: navy glass with a gold edge ---------- */
.panel {
  background: linear-gradient(180deg, rgba(31, 45, 128, 0.85), rgba(12, 18, 62, 0.9));
  border: 1.5px solid var(--panel-edge);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* ---------- Ribbon banner: navy band, gold trim, swallowtail ends ---------- */
.banner {
  --notch: 14px;
  position: relative;
  display: inline-block;
  padding: 2px;
  background: var(--metal-gold);
  clip-path: polygon(0 0, 100% 0, calc(100% - var(--notch)) 50%, 100% 100%, 0 100%, var(--notch) 50%);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}
.banner[hidden] { display: none; }
.banner > span {
  display: block;
  padding: 8px calc(var(--notch) + 16px) 9px;
  background: linear-gradient(180deg, #22318c, #0d1548);
  clip-path: polygon(0 0, 100% 0, calc(100% - var(--notch)) 50%, 100% 100%, 0 100%, var(--notch) 50%);
  font-weight: 900;
  font-variation-settings: 'wdth' 112;
  text-transform: uppercase;
  font-size: 17px;
  letter-spacing: 0.01em;
  color: var(--chalk);
  white-space: nowrap;
}
/* the little gold dashes either side, as on the logo ribbon */
.banner > span::before, .banner > span::after {
  content: '';
  display: inline-block;
  width: 12px; height: 3px;
  margin: 0 10px;
  vertical-align: 0.3em;
  background: var(--gold);
  border-radius: 2px;
}

/* ---------- Buttons ---------- */
.btn {
  font: inherit;
  font-weight: 900;
  font-size: 17px;
  border: 0;
  border-radius: 999px;
  padding: 15px 22px;
  cursor: pointer;
}
.btn--gold {
  background: var(--metal-gold);
  color: #0b1240;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.5), 0 4px 0 var(--gold-deep), 0 8px 20px rgba(255, 190, 40, 0.25);
}
.btn--gold:active { transform: translateY(3px); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.5), 0 1px 0 var(--gold-deep); }
.link {
  font: inherit;
  background: none;
  border: 0;
  color: var(--chalk-dim);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 8px;
}
:focus-visible { outline: 3px solid var(--gold-hot); outline-offset: 3px; }

/* ---------- Marquee bulbs ---------- */
.bulbs { position: absolute; inset: 0; pointer-events: none; }
.bulb {
  position: absolute;
  width: 8px; height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: #fffbe0;
  box-shadow: 0 0 6px 2px rgba(255, 210, 80, 0.8), 0 0 16px 4px rgba(255, 180, 40, 0.35);
  animation: chase 0.9s steps(1) infinite;
}
.bulb:nth-child(odd) { animation-delay: -0.45s; }
@keyframes chase {
  0%   { opacity: 1; }
  50%  { opacity: 0.3; box-shadow: none; }
}

/* Bulb ring: the logo's circle. Bulbs sit in the navy band between two gold rims. */
.ring {
  --d: 240px;
  position: relative;
  width: var(--d);
  height: var(--d);
  margin: 0 auto;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: radial-gradient(circle at 50% 38%, #2a4fc4 0%, #15206a 55%, #0a1036 100%);
  box-shadow:
    0 0 0 4px #ffd84a,
    0 0 0 6px #8a6000,
    0 0 0 20px #0d1548,
    0 0 0 23px #ffd84a,
    0 0 0 25px #8a6000,
    0 0 60px 26px rgba(255, 200, 60, 0.22);
}
.ring .bulbs { inset: 0; }

/* fallback marquee sign for editions without artwork */
.sign {
  position: relative;
  margin: 10px 6px 0;
  padding: 34px 24px 28px;
  border-radius: 18px;
  background: radial-gradient(circle at 50% 30%, #2446b8 0%, #111a58 70%);
  border: 3px solid #ffd84a;
  box-shadow: 0 0 0 3px #0d1548, 0 0 0 5px #8a6000, 0 18px 40px rgba(0, 0, 0, 0.55);
  text-align: center;
}
.sign[hidden] { display: none; }
.sign .bulbs { inset: 9px; }
.sign__title { margin: 0; font-size: clamp(48px, 14vw, 64px); line-height: 0.95; }
.sign__sub { margin: 16px 0 0; font-size: 15px; color: var(--chalk-dim); }
.banner--edition { margin-top: 16px; }

/* ---------- Lobby ---------- */
.join { margin-top: 26px; }
.join label { display: block; font-weight: 700; margin-bottom: 10px; }
.join input {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  color: #0b1240;
  background: var(--chalk);
  border: 2px solid var(--gold);
  border-radius: 999px;
  padding: 13px 18px;
}
.join input::placeholder { color: #7d88ad; }
.join__hint { margin: 10px 4px 0; font-size: 14px; line-height: 1.4; color: var(--chalk-dim); }
.join__hint b { color: var(--chalk); font-weight: 700; }
.join__record { margin: 10px 4px 0; font-size: 14px; color: var(--chalk-dim); }
.join__record[hidden] { display: none; }
.join__record b { color: var(--gold); font-variation-settings: 'wdth' 125; font-weight: 900; }
.join__note { margin: 8px 4px 0; font-size: 12px; color: var(--chalk-dim); opacity: 0.8; }

.countdown { margin-top: 24px; text-align: center; }
.countdown > p:first-child { margin: 0; color: var(--chalk-dim); }
.countdown__num { font-size: 68px; line-height: 1.05; font-variant-numeric: tabular-nums; }

.roster { margin-top: auto; padding-top: 24px; }
.roster__head { margin: 0 0 10px; color: var(--chalk-dim); font-size: 14px; }
.roster__head b { color: var(--chalk); font-variation-settings: 'wdth' 125; }
.roster__list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.roster__list li {
  font-size: 13px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(20, 30, 90, 0.8);
  border: 1px solid rgba(255, 205, 70, 0.25);
}
.roster__list li.is-me { background: var(--satin-white); color: #0b1240; border-color: #fff; }

.hero { margin: 0 calc(-1 * var(--gutter)); }
.hero[hidden] { display: none; }
.hero img {
  display: block;
  width: 100%;
  height: auto;
  /* feather the baked-in stage into the set */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent),
                      linear-gradient(to bottom, transparent, #000 5%, #000 84%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent),
              linear-gradient(to bottom, transparent, #000 5%, #000 84%, transparent);
  mask-composite: intersect;
}
.hero__sub { margin: 2px var(--gutter) 0; text-align: center; font-size: 15px; color: var(--chalk-dim); }
/* the artwork already says the name; the masthead logo waits for the show */
body.has-hero .masthead__logo { visibility: hidden; }

/* ---------- Timer: a strip of bulbs going dark ---------- */
.timer {
  display: flex;
  justify-content: space-between;
  margin: 6px 0 14px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #0d1548;
  box-shadow: 0 0 0 2px #ffd84a, 0 0 0 3.5px #8a6000, 0 6px 16px rgba(0, 0, 0, 0.4);
}
.timer i {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #fffbe0;
  box-shadow: 0 0 8px 2px rgba(255, 205, 70, 0.75);
  transition: background 0.25s, box-shadow 0.25s;
}
.timer i.off { background: rgba(3, 5, 22, 0.8); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6); }
.timer.is-late i:not(.off) {
  background: #ffb08a;
  box-shadow: 0 0 10px 3px rgba(255, 106, 43, 0.85);
  animation: flicker 0.5s steps(1) infinite;
}
@keyframes flicker { 50% { opacity: 0.55; } }

.qmeta {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 700;
  color: var(--chalk-dim);
}
.qmeta #qCat { color: var(--gold); }
.qtext {
  margin: 10px 0 18px;
  font-weight: 800;
  font-size: 27px;
  line-height: 1.2;
  text-wrap: balance;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}
.qtext.is-long { font-size: 22px; }

/* ---------- Answer tiles: navy lozenges with gold trim ---------- */
.tiles { display: flex; flex-direction: column; gap: 11px; }
.tile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 68px;
  padding: 10px 16px 10px 10px;
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  text-align: left;
  color: var(--chalk);
  background: linear-gradient(180deg, var(--panel-top), var(--panel-bot));
  border: 2px solid var(--panel-edge);
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 4px 14px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, opacity 0.35s, border-color 0.2s;
}
.tile__bar {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 0;
  border-radius: 12px;
  background: rgba(140, 180, 255, 0.16);
  pointer-events: none;
}
.tile__letter {
  position: relative;
  flex: none;
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border-radius: 10px;
  font-weight: 900;
  font-variation-settings: 'wdth' 125;
  font-size: 17px;
  color: #0b1240;
  background: var(--metal-gold);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}
.tile__txt { position: relative; flex: 1; line-height: 1.25; }
.tile__pct {
  position: relative;
  font-variation-settings: 'wdth' 125;
  font-weight: 900;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  opacity: 0;
}
.tile__tag {
  position: absolute;
  top: -9px; right: 12px;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--chalk);
  color: #0b1240;
  opacity: 0;
}
.tile .bulbs { inset: -7px; }
.tile .bulb { width: 6px; height: 6px; margin: -3px 0 0 -3px; }

@media (hover: hover) {
  .tiles:not(.is-revealed) .tile:not(.is-picked):not(.is-out):hover { border-color: var(--gold); opacity: 1; }
}
.tile.is-picked { background: var(--satin-white); color: #0b1240; border-color: #fff; }
.tile.is-picked .tile__letter { background: #0d1548; color: var(--gold); box-shadow: none; }
.tiles.is-locked:not(.is-revealed) .tile:not(.is-picked) { opacity: 0.62; }
.tiles.is-revealed .tile { cursor: default; }

/* after the reveal */
.tiles.is-revealed .tile { opacity: 1; }
.tiles.is-revealed .tile__pct { opacity: 1; }
.tiles.is-revealed .tile.is-wrong:not(.is-picked) { opacity: 0.55; }
.tile.is-wrong:not(.is-picked) .tile__letter { background: rgba(214, 224, 250, 0.2); color: var(--chalk); box-shadow: none; }
.tile.is-correct {
  background: var(--metal-gold);
  color: #0b1240;
  border-color: var(--gold-hot);
  opacity: 1;
  box-shadow: 0 0 30px rgba(255, 200, 60, 0.5);
}
.tile.is-correct .tile__letter { background: #0d1548; color: var(--gold); box-shadow: none; }
.tile.is-correct .tile__bar { background: rgba(13, 21, 72, 0.14); }
.tile.is-picked.is-wrong {
  background: linear-gradient(180deg, var(--panel-top), var(--panel-bot));
  color: var(--chalk);
  border-color: var(--tangerine);
  opacity: 1;
}
.tile.is-picked.is-wrong .tile__letter { background: var(--tangerine); color: var(--chalk); }
.tile.is-picked .tile__tag { opacity: 1; }
.tile.is-picked.is-wrong .tile__tag { background: var(--tangerine); color: var(--chalk); }

.qfoot { margin-top: 16px; min-height: 64px; text-align: center; }
.qstatus { margin: 8px 0 0; color: var(--chalk-dim); font-size: 15px; }
.qstatus b { color: var(--chalk); font-variation-settings: 'wdth' 125; }
.result__pts { font-size: 50px; line-height: 1; font-variant-numeric: tabular-nums; }
.result.is-miss .result__pts,
.result.is-loss .result__pts { background: none; -webkit-text-stroke: 0; filter: none; }
.result.is-miss .result__pts { color: var(--chalk-dim); font-size: 32px; }
.result.is-loss .result__pts { color: var(--tangerine); }
.result__note { margin-top: 8px; font-size: 15px; color: var(--chalk-dim); }

.host {
  margin-top: auto;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 16px 16px 16px 4px;
}
.host[hidden] { display: none; }
.host__badge {
  flex: none;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 18px;
  color: #0b1240;
  background: var(--metal-gold);
  box-shadow: 0 0 0 2px #0d1548, 0 0 0 3.5px #ffd84a;
}
.host__line { margin: 0; font-size: 16px; line-height: 1.4; font-style: italic; }
.host__line b { font-style: normal; color: var(--gold); }

/* ---------- Standings ---------- */
.board__head { margin: 12px 0 16px; text-align: center; }
.board__sub { margin: 10px 0 0; color: var(--chalk-dim); font-weight: 700; font-size: 15px; }
.board__list { position: relative; overflow: hidden; }
.row {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 17px;
  background: linear-gradient(180deg, rgba(31, 45, 128, 0.7), rgba(14, 21, 70, 0.7));
  border: 1px solid rgba(255, 205, 70, 0.14);
}
.row__rank {
  width: 30px;
  font-variation-settings: 'wdth' 125;
  font-weight: 900;
  color: var(--chalk-dim);
  font-variant-numeric: tabular-nums;
}
.row__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__move { width: 34px; font-size: 13px; font-weight: 800; text-align: right; }
.row__move.up { color: var(--mint); }
.row__move.down { color: var(--tangerine); }
.row__score {
  width: 64px;
  text-align: right;
  font-variation-settings: 'wdth' 125;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.row.is-first { border-color: var(--gold); box-shadow: 0 0 18px rgba(255, 200, 60, 0.25); }
.row.is-first .row__rank { color: var(--gold); }
.row.is-me { background: var(--satin-white); color: #0b1240; border-color: #fff; z-index: 2; }
.row.is-me .row__rank { color: #0b1240; }
.board__me { margin-top: 10px; position: relative; height: 52px; }
.board__me::before {
  content: '';
  position: absolute; left: 14px; right: 14px; top: -6px;
  border-top: 2px dotted rgba(214, 224, 250, 0.25);
}

/* ---------- Final ---------- */
.final__kicker { margin: 10px 0 34px; text-align: center; color: var(--chalk-dim); font-weight: 700; }
.champ { position: relative; display: flex; flex-direction: column; align-items: center; }
.ring--champ { --d: 200px; }
.ring__word { font-size: 15px; }
.champ__score { font-size: 46px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.champ__banner { margin-top: -30px; z-index: 2; max-width: 100%; }
.champ__banner > span { font-size: 22px; }
.podium { list-style: none; margin: 18px 0 0; padding: 0; }
.podium li {
  display: flex; gap: 12px; align-items: baseline;
  padding: 9px 14px;
  font-weight: 700;
}
.podium li span:first-child { width: 30px; font-variation-settings: 'wdth' 125; font-weight: 900; color: var(--chalk-dim); }
.podium li span:nth-child(2) { flex: 1; }
.podium li span:last-child { font-variation-settings: 'wdth' 125; font-weight: 900; }
.mine {
  margin: 14px 0 18px;
  padding: 16px;
  border-radius: 16px;
}
.mine__place { margin: 0 0 12px; font-size: 18px; font-weight: 800; }
.mine__stats { margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mine__stats div { display: flex; flex-direction: column-reverse; gap: 2px; }
.mine__stats dt { font-size: 13px; color: var(--chalk-dim); }
.mine__stats dd {
  margin: 0;
  font-variation-settings: 'wdth' 125;
  font-weight: 900;
  font-size: 22px;
  color: var(--gold);
}
#final .btn { align-self: center; margin-bottom: 8px; }

.skip {
  position: absolute;
  right: var(--gutter);
  bottom: calc(18px + env(safe-area-inset-bottom));
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--chalk);
  background: #0d1548;
  border: 1.5px solid var(--panel-edge);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  z-index: 5;
}

/* ---------- Title card between questions ---------- */
.sting {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 45%, #2446b8 0%, #111a58 45%, var(--set-deep) 80%);
}
.sting[hidden] { display: none; }
.sting__inner { position: relative; text-align: center; padding: 0 20px; }
.sting .ring { --d: min(240px, 62vw); }
.ring__num { font-size: calc(var(--d) * 0.46); line-height: 0.9; }
.sting__banner { position: relative; z-index: 2; margin-top: -28px; }
.sting__banner > span { font-size: 19px; }
.sting__diff { margin-top: 14px; color: var(--chalk-dim); font-weight: 700; }

/* ---------- Cheat codes ---------- */
.codes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 16px;
}
.codes[hidden] { display: none; }
.code {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 0;
  font: inherit;
  color: var(--chalk-dim);
  background: none;
  border: 0;
  cursor: pointer;
  transition: opacity 0.25s;
}
.code__disc {
  display: grid;
  place-items: center;
  width: 50px; height: 50px;
  border-radius: 50%;
  color: var(--gold);
  border: 2.5px solid transparent;
  background:
    radial-gradient(circle at 50% 35%, #26379a, #0d1548) padding-box,
    var(--metal-gold) border-box;
  box-shadow: 0 0 14px rgba(255, 200, 60, 0.2);
  transition: color 0.2s, box-shadow 0.2s;
}
.code__disc svg { width: 24px; height: 24px; fill: currentColor; }
.code__txt {
  font-variation-settings: 'wdth' 125;
  font-weight: 900;
  font-size: 12px;
  letter-spacing: -0.02em;
}
.code__txt--big { font-size: 18px; }
.code__label { font-size: 12px; font-weight: 700; line-height: 1.15; text-align: center; }
@media (hover: hover) {
  .code:not(:disabled):hover .code__disc { box-shadow: 0 0 22px rgba(255, 200, 60, 0.5); }
}
.code.is-active .code__disc {
  color: #0b1240;
  background: var(--metal-gold) border-box;
  box-shadow: 0 0 22px rgba(255, 200, 60, 0.65);
}
.code.is-active .code__label { color: var(--gold); }
.code.is-spent { opacity: 0.3; cursor: default; }
.code.is-spent .code__disc {
  background: none;
  border: 2px dashed var(--chalk-dim);
  box-shadow: none;
  color: var(--chalk-dim);
}
.code:disabled:not(.is-active):not(.is-spent) { opacity: 0.4; cursor: default; }

/* 50/50: the slot goes dark */
.tile.is-out { background: transparent; border-style: dashed; box-shadow: none; cursor: default; }
.tile.is-out > :is(.tile__bar, .tile__letter, .tile__txt, .tile__pct) { opacity: 0.18; animation: fizzle 0.55s steps(1); }
.tile.is-out > :is(.tile__tag, .tile__peek) { display: none; }
@keyframes fizzle {
  0% { opacity: 1; } 15% { opacity: 0.2; } 30% { opacity: 0.9; }
  45% { opacity: 0.15; } 60% { opacity: 0.6; } 75% { opacity: 0.18; }
}

/* follow the crowd: live percentages before the reveal */
.tiles.is-crowd .tile__pct { opacity: 1; }

/* peek at the leader */
.tile__peek {
  position: absolute;
  top: -10px; left: 58px;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 999px;
  color: var(--gold);
  background: #0d1548;
  border: 1.5px solid var(--gold);
  white-space: nowrap;
  opacity: 0;
}
.tile.has-peek .tile__peek { opacity: 1; }
.tile.is-correct .tile__peek { color: #0b1240; background: var(--gold-hot); border-color: #0d1548; }

.usage { margin: 14px 0 0; text-align: center; font-size: 14px; color: var(--chalk-dim); }
.usage[hidden] { display: none; }

/* lobby: what the codes do */
.guide__head { margin: 22px 0 0; text-align: left; font-weight: 800; color: var(--chalk); }
.guide { list-style: none; margin: 10px 0 0; padding: 0; text-align: left; display: grid; gap: 10px; }
.guide li { display: flex; gap: 12px; align-items: center; font-size: 14px; line-height: 1.35; color: var(--chalk-dim); }
.guide li b { color: var(--chalk); font-weight: 800; }
.guide .code__disc { flex: none; width: 40px; height: 40px; }
.guide .code__disc svg { width: 20px; height: 20px; }
.guide .code__txt { font-size: 10px; }
.guide .code__txt--big { font-size: 15px; }

@media (prefers-reduced-motion: reduce) {
  .bulb, .timer.is-late i { animation: none !important; }
}

/* show logo above the ring on the title card */
.sting__logo { margin: 0 auto 30px; }
.sting__logo img {
  display: block;
  width: min(330px, 84vw);
  height: auto;
  margin: 0 auto;
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 72%, transparent 100%);
  mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 72%, transparent 100%);
}
.sting__wordmark { font-size: 34px; }
@media (max-height: 700px) {
  .sting__logo { margin-bottom: 22px; }
  .sting__logo img { width: min(250px, 70vw); }
  .sting .ring { --d: min(200px, 56vw); }
}
.sting__logo:has(.sting__wordmark) { margin-bottom: 44px; }

/* edition art as the top-bar mark */
.masthead:has(.masthead__mark) { padding-top: 8px; padding-bottom: 2px; }
.masthead__mark {
  display: block;
  height: 56px;
  width: auto;
  margin-left: -4px;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 3%, #000 97%, transparent),
                      linear-gradient(to bottom, transparent, #000 4%, #000 94%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 3%, #000 97%, transparent),
              linear-gradient(to bottom, transparent, #000 4%, #000 94%, transparent);
  mask-composite: intersect;
  border-radius: 6px;
}

/* ---------- Final wager ---------- */
.wager__cat { color: var(--gold); }
.wager__you { margin: 4px 0 16px; text-align: center; text-wrap: balance; font-size: 16px; font-weight: 700; }
.wager__you b { color: var(--gold); font-variation-settings: 'wdth' 125; font-weight: 900; }
.wager__choices { display: grid; gap: 14px; }
.choice {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 96px;
  padding: 16px;
  font: inherit;
  color: var(--chalk);
  text-align: center;
  background: linear-gradient(180deg, var(--panel-top), var(--panel-bot));
  border: 2px solid var(--panel-edge);
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 6px 18px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  justify-content: center;
}
.choice__title { font-size: 22px; font-weight: 900; }
.choice__sub { font-size: 14px; color: var(--chalk-dim); }
.choice--allin { min-height: 116px; border: 2.5px solid var(--gold); }
.choice--allin .choice__title { font-size: 40px; line-height: 1; }
.choice--allin .bulbs { inset: -8px; }
.choice--allin .bulb { width: 6px; height: 6px; margin: -3px 0 0 -3px; }
.choice:disabled { opacity: 0.4; cursor: default; }
@media (hover: hover) { .choice:not(:disabled):hover { border-color: var(--gold-hot); } }

.choice--safe.is-chosen { background: var(--satin-white); color: #0b1240; border-color: #fff; }
.choice--safe.is-chosen .choice__sub { color: #3a4570; }
.choice--allin.is-chosen {
  background: var(--metal-gold);
  border-color: var(--gold-hot);
  box-shadow: 0 0 36px rgba(255, 200, 60, 0.55);
}
.choice--allin.is-chosen .choice__title { background: none; color: #0b1240; -webkit-text-stroke: 0; filter: none; }
.choice--allin.is-chosen .choice__sub { color: #3a2a00; font-weight: 700; }
.wager__choices:has(.is-chosen) .choice:not(.is-chosen) { opacity: 0.6; }

#wager .timer { margin-top: 20px; }
.wager__mine { margin: 4px 0 0; text-align: center; text-wrap: balance; font-size: 14px; color: var(--chalk-dim); min-height: 2.6em; }
.wager__status { margin: 6px 0 0; text-align: center; font-weight: 800; color: var(--gold); }

/* ---------- Sound toggle ---------- */
.masthead__right { display: flex; align-items: center; gap: 12px; }
.mute {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  padding: 0;
  border-radius: 50%;
  color: var(--gold);
  background: #0d1548;
  border: 1.5px solid var(--panel-edge);
  cursor: pointer;
}
.mute svg { width: 20px; height: 20px; }
.mute__spk { fill: currentColor; }
.mute__on, .mute__off { stroke: currentColor; }
.mute__off { display: none; }
.mute.is-muted { color: var(--chalk-dim); }
.mute.is-muted .mute__on { display: none; }
.mute.is-muted .mute__off { display: inline; }

/* ---------- Short phones: the live question must fit with no scrolling ---------- */
/* while the clock runs there's no Continue button, so the bottom reserve can go */
#question.is-asking { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
#question.is-asking .qfoot { margin-top: 12px; min-height: 0; }

@media (max-height: 740px) {
  .masthead__mark { height: 44px; }
  .masthead { padding-top: 10px; }
  .timer { margin: 2px 0 10px; padding: 7px 11px; }
  .timer i { width: 10px; height: 10px; }
  .qtext { margin: 8px 0 14px; font-size: 24px; }
  .qtext.is-long { font-size: 20px; }
  .tiles { gap: 9px; }
  .tile { min-height: 56px; padding-top: 7px; padding-bottom: 7px; font-size: 16px; }
  .tile__letter { width: 34px; height: 34px; font-size: 16px; }
  .codes { margin-top: 12px; }
  .code__disc { width: 44px; height: 44px; }
  .code__disc svg { width: 22px; height: 22px; }
}
@media (max-height: 620px) {
  .masthead__mark { height: 38px; }
  .masthead { padding-top: 6px; }
  .qmeta { font-size: 13px; }
  .qtext { margin: 6px 0 10px; font-size: 21px; }
  .qtext.is-long { font-size: 18px; }
  .tiles { gap: 7px; }
  .tile { min-height: 48px; gap: 11px; font-size: 15px; }
  .tile__letter { width: 30px; height: 30px; font-size: 15px; border-radius: 8px; }
  .codes { margin-top: 10px; }
  .code { gap: 3px; }
  .code__disc { width: 40px; height: 40px; }
  .code__disc svg { width: 20px; height: 20px; }
  .code__label { font-size: 11px; }
  .codes .code__txt { font-size: 10px; }
  .codes .code__txt--big { font-size: 16px; }
  #question.is-asking .qfoot { margin-top: 8px; }
  .qstatus { margin-top: 4px; font-size: 14px; }
}

/* safety net: trivia.js steps these on until the question fits (long questions, long answers) */
#question.fit-1 .qtext { font-size: 19px; margin-bottom: 10px; }
#question.fit-1 .tile { min-height: 46px; font-size: 15px; }
#question.fit-1 .tiles { gap: 7px; }
#question.fit-2 .qtext { font-size: 17px; margin: 4px 0 8px; }
#question.fit-2 .tile { min-height: 42px; padding-top: 5px; padding-bottom: 5px; font-size: 14px; }
#question.fit-2 .tile__letter { width: 28px; height: 28px; font-size: 14px; }
#question.fit-2 .tiles { gap: 6px; }
#question.fit-2 .code__label { display: none; }
#question.fit-3 .qtext { font-size: 16px; }
#question.fit-3 .timer { margin-bottom: 6px; }
#question.fit-3 .qmeta { display: none; }
#question.fit-3 .code__disc { width: 36px; height: 36px; }

/* ---------- Live show: show card, join, demo board ---------- */
.showcard {
  margin-top: 14px;
  padding: 16px 18px 18px;
  border-radius: 18px;
  text-align: center;
}
.showcard[hidden] { display: none; }
.showcard__kicker {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}
.showcard__when { margin: 6px 0 0; font-size: 20px; font-weight: 800; text-wrap: balance; }
.showcard__clock {
  margin-top: 6px;
  font-size: 44px;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.showcard__clock[hidden] { display: none; }
.showcard__sub { margin: 10px 0 0; font-size: 14px; line-height: 1.4; color: var(--chalk-dim); text-wrap: balance; }

.join[hidden], .roster[hidden], .countdown[hidden] { display: none; }
.join { margin-top: 20px; }
.join__btns { display: flex; gap: 10px; margin-top: 12px; }
.join__btns .btn { flex: 1; }
.btn--ghost {
  background: rgba(13, 21, 72, 0.6);
  color: var(--chalk);
  box-shadow: inset 0 0 0 2px var(--gold);
}
.btn--ghost:active { transform: translateY(2px); }
.btn[hidden] { display: none; }
.join__error { margin: 10px 4px 0; font-size: 14px; font-weight: 700; color: #ff9a70; }
.join__error[hidden], .join__what[hidden], .join__hint[hidden] { display: none; }
.join__what { margin: 10px 4px 0; font-size: 14px; line-height: 1.4; color: var(--chalk-dim); }
.countdown b { color: var(--gold); }
.guide[hidden], .guide__head[hidden] { display: none; }

.demoboard {
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: 16px;
}
.demoboard[hidden] { display: none; }
.demoboard__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0 0 8px;
  font-weight: 800;
}
.demoboard__head span:last-child { font-size: 13px; font-weight: 600; color: var(--chalk-dim); }
.demoboard__list { list-style: none; margin: 0; padding: 0; }
.demoboard__list li {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 6px 2px;
  font-weight: 700;
  font-size: 15px;
  border-top: 1px solid rgba(255, 205, 70, 0.1);
}
.demoboard__list li:first-child { border-top: 0; }
.demoboard__list li span:first-child { width: 24px; font-variation-settings: 'wdth' 125; font-weight: 900; color: var(--chalk-dim); }
.demoboard__list li span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demoboard__list li span:last-child { font-variation-settings: 'wdth' 125; font-weight: 900; font-variant-numeric: tabular-nums; }
.demoboard__list li:first-child span:first-child { color: var(--gold); }
.demoboard__list li.is-me { color: var(--gold); }
.demoboard__me { margin: 8px 2px 0; font-size: 14px; color: var(--chalk-dim); }
.demoboard__me[hidden] { display: none; }
.demoboard__me b { color: var(--gold); }
#final .demoboard { margin: 0 0 16px; }
#final .demoboard__me { margin: 0 0 10px; font-size: 15px; color: var(--chalk); }

.final__next { margin: 4px 0 18px; text-align: center; font-size: 15px; line-height: 1.45; color: var(--chalk-dim); text-wrap: balance; }
.final__next[hidden], #final .mine[hidden], .link[hidden] { display: none; }
#backBtn { align-self: center; }

.notice { margin-top: 40px; padding: 26px 22px; border-radius: 18px; text-align: center; }
.notice__title { margin: 0; font-size: 34px; line-height: 1.05; }
.notice__text { margin: 14px 0 0; color: var(--chalk-dim); line-height: 1.45; }

.board__empty { margin: 0; text-align: center; color: var(--chalk-dim); }
.tiles.is-watching .tile { cursor: default; }

/* ---------- Watching ---------- */
.watchbar {
  position: fixed;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  max-width: calc(100vw - 24px);
  padding: 6px 6px 6px 16px;
  border-radius: 999px;
  background: rgba(9, 14, 48, 0.94);
  border: 1.5px solid var(--panel-edge);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  font-size: 14px;
}
.watchbar[hidden] { display: none; }
.watchbar__label { display: flex; align-items: center; gap: 7px; font-weight: 800; }
.watchbar__dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #ff4d3a;
  box-shadow: 0 0 8px rgba(255, 77, 58, 0.9);
  animation: flicker 1.6s ease-in-out infinite;
}
.watchbar__n { color: var(--chalk-dim); white-space: nowrap; }
.watchbar__btn {
  font: inherit;
  font-weight: 900;
  font-size: 14px;
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  background: var(--metal-gold);
  color: #0b1240;
  cursor: pointer;
  white-space: nowrap;
}
body.is-watch .screen { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }

/* the leaderboard rail only shows on a big screen (a TV, a laptop) */
.rail { display: none; }
@media (min-width: 1000px) {
  body.is-watch .rail:not([hidden]) {
    display: block;
    position: fixed;
    z-index: 2;
    top: 96px;
    right: 32px;
    width: 330px;
    max-height: calc(100dvh - 140px);
    overflow: hidden;
    padding: 18px 20px;
    border-radius: 20px;
  }
  body.is-watch:has(.rail:not([hidden])) .set { padding-right: 380px; }
  body.is-watch { --col: min(720px, calc(100vw - 440px)); }
  body.is-watch .qtext { font-size: 38px; }
  body.is-watch .qtext.is-long { font-size: 32px; }
  body.is-watch .tile { min-height: 82px; font-size: 22px; }
  body.is-watch .tile__letter { width: 46px; height: 46px; font-size: 21px; }
  body.is-watch .timer i { width: 16px; height: 16px; }
  body.is-watch .qmeta { font-size: 17px; }
  body.is-watch .host__line { font-size: 20px; }
  body.is-watch .result__note, body.is-watch .usage { font-size: 18px; }
  /* on a big screen the watch bar tucks under the leaderboard, clear of the host */
  body.is-watch:has(.rail:not([hidden])) .watchbar { left: auto; right: 32px; bottom: 28px; transform: none; }
  body.is-watch:has(.rail:not([hidden])) .screen { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
}
.rail__head { margin: 0; font-size: 26px; }
.rail__count { margin: 6px 0 12px; font-size: 14px; color: var(--chalk-dim); }
.rail__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rail__list li {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 17px;
  background: linear-gradient(180deg, rgba(31, 45, 128, 0.7), rgba(14, 21, 70, 0.7));
  border: 1px solid rgba(255, 205, 70, 0.14);
}
.rail__list li span:first-child { width: 24px; font-variation-settings: 'wdth' 125; font-weight: 900; color: var(--chalk-dim); }
.rail__list li span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail__list li span:last-child { font-variation-settings: 'wdth' 125; font-weight: 900; font-variant-numeric: tabular-nums; }
.rail__list li.is-first { border-color: var(--gold); box-shadow: 0 0 18px rgba(255, 200, 60, 0.25); }
.rail__list li.is-first span:first-child { color: var(--gold); }
.rail__foot { margin: 14px 0 0; font-size: 14px; color: var(--chalk-dim); }
.rail__foot b { color: var(--gold); }

/* ---------- Connection + pause ---------- */
.net {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  margin: 0;
  max-width: calc(100vw - 24px);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  color: #0b1240;
  background: var(--satin-white);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}
.net[hidden] { display: none; }

.pause {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 45%, rgba(36, 70, 184, 0.96) 0%, rgba(17, 26, 88, 0.97) 45%, rgba(9, 14, 48, 0.98) 80%);
}
.pause[hidden] { display: none; }
.pause__inner { text-align: center; padding: 0 24px; }
.pause .ring { --d: min(200px, 56vw); }
.pause .ring__word { font-size: 26px; }
.pause__msg { margin: 40px 0 0; font-size: 20px; font-weight: 800; text-wrap: balance; }

/* ---------- Share ---------- */
.btn--share { align-self: center; margin-bottom: 6px; }
.share__note { margin: 4px 0 12px; text-align: center; font-size: 14px; font-weight: 700; color: var(--gold); text-wrap: balance; }
.share__note[hidden] { display: none; }
.share__note.is-manual { font-weight: 500; color: var(--chalk); user-select: all; -webkit-user-select: all; }
#final #playAgain { margin-top: 6px; }

/* ---------- Invite + results picture ---------- */
.invite { margin-top: 14px; text-align: center; }
.invite[hidden] { display: none; }
.invite__btns { display: grid; gap: 10px; }
.invite__btns .btn { width: 100%; text-align: center; text-decoration: none; white-space: nowrap; }
.btn--fb {
  background: #1877f2;
  color: #fff;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.35), 0 4px 0 #0b4fb0;
}
.btn--fb:active { transform: translateY(3px); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.35), 0 1px 0 #0b4fb0; }
.invite .share__note { margin-top: 10px; }

.cardview {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
  background: rgba(5, 8, 30, 0.88);
  overflow-y: auto;
}
.cardview[hidden] { display: none; }
.cardview__inner { width: min(420px, 100%); text-align: center; }
.cardview__head { margin: 0 0 10px; font-weight: 800; color: var(--gold); }
.cardview__img {
  display: block;
  width: 100%;
  max-height: 62dvh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.6);
  -webkit-touch-callout: default;
}
.cardview__tip { margin: 12px 0 0; font-size: 15px; font-weight: 700; text-wrap: balance; }
.cardview__btns { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.cardview__btns .btn { text-decoration: none; text-align: center; }
.cardview .link { margin-top: 6px; }

/* ---------- Demo: how to play + Dale's tips ---------- */
.howto { margin-top: 2px; text-align: left; }
.howto[hidden], .howto__list[hidden], .howto__go[hidden], .countdown__num[hidden], #countLead[hidden] { display: none; }
.howto__banner { display: block; width: max-content; margin: 0 auto 14px; }
.howto__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; text-align: left; }
.howto__list li {
  position: relative;
  padding-left: 22px;
  font-size: 15px;
  line-height: 1.4;
  color: var(--chalk-dim);
}
.howto__list li::before {
  content: '';
  position: absolute;
  left: 4px; top: 0.5em;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #fffbe0;
  box-shadow: 0 0 6px 2px rgba(255, 210, 80, 0.7);
}
.howto__list li b { color: var(--chalk); font-weight: 800; }
.howto__list--after { margin-top: 16px; }
.howto__go { width: 100%; margin-top: 20px; }

.sting__tip {
  display: flex;
  gap: 12px;
  align-items: center;
  max-width: 380px;
  margin: 22px auto 0;
  padding: 12px 16px;
  border-radius: 16px 16px 16px 4px;
  text-align: left;
}
.sting__tip[hidden] { display: none; }
.sting__tip .host__line { font-size: 17px; }

/* the code Dale just mentioned */
.code.is-hint .code__disc {
  box-shadow: 0 0 0 3px rgba(255, 201, 51, 0.75), 0 0 20px rgba(255, 200, 60, 0.7);
  animation: hint 1.1s ease-in-out infinite;
}
.code.is-hint .code__label { color: var(--gold); }
.code.is-active .code__disc { animation: none; }
@keyframes hint {
  50% { box-shadow: 0 0 0 7px rgba(255, 201, 51, 0.4), 0 0 30px rgba(255, 200, 60, 1); transform: scale(1.12); }
}
@media (prefers-reduced-motion: reduce) { .code.is-hint .code__disc { animation: none; box-shadow: 0 0 0 4px rgba(255, 201, 51, 0.5); } }
