:root {
  --night: #08090c;
  --panel: #111318;
  --panel-edge: rgba(255, 255, 255, 0.07);
  --row: #171a21;
  --row-edge: rgba(255, 255, 255, 0.06);
  --accent: #f4c24e;
  --text: #f3f1ec;
  --text-soft: rgba(243, 241, 236, 0.64);
  --text-faint: rgba(243, 241, 236, 0.4);
  --sans: "Mona Sans Variable", "Mona Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono Variable", "JetBrains Mono", ui-monospace, monospace;
  --row-h: clamp(34px, 8.6vh, 54px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--night);
  color: var(--text);
  font-family: var(--sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.stage {
  width: 100%;
  height: 100vh;
  display: grid;
  place-items: center;
  padding: min(4vw, 4vh, 28px);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(244, 194, 78, 0.06), transparent 60%),
    var(--night);
}

/* the panel: a dark card with a soft edge light, like a broadcast graphic */
.panel {
  position: relative;
  width: min(560px, 100%);
  max-height: 100%;
  display: grid;
  gap: clamp(8px, 2.2vh, 18px);
  padding: clamp(12px, 3vh, 24px) clamp(12px, 3.4vw, 24px);
  border-radius: clamp(14px, 2.6vh, 20px);
  background: linear-gradient(180deg, #14161c, var(--panel));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 0 0 1px var(--panel-edge),
    0 30px 60px -20px rgba(0, 0, 0, 0.7),
    0 8px 18px -8px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  isolation: isolate;
}

/* the sheen that crosses the panel now and then */
.panel__glare {
  position: absolute;
  inset: -20% auto -20% 0;
  width: 38%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.055) 45%, rgba(255, 255, 255, 0.09) 50%, rgba(255, 255, 255, 0.055) 55%, transparent);
  opacity: 0; /* GSAP moves it; hidden until it does */
  pointer-events: none;
  z-index: 3;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.show {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: clamp(9px, 1.7vh, 11px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.show__mark {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-linecap: round;
}

.round {
  font-size: clamp(16px, 3.6vh, 26px);
  font-weight: 640;
  font-stretch: 112%;
  letter-spacing: -0.01em;
  line-height: 1;
}

.round__mask {
  display: inline-block;
  overflow: hidden;
  padding-bottom: 0.08em;
  vertical-align: bottom;
}

.round__text { display: inline-block; }

.question {
  display: grid;
  gap: clamp(6px, 1.5vh, 12px);
}

.question__text {
  font-size: clamp(13px, 2.7vh, 19px);
  font-weight: 520;
  line-height: 1.25;
  color: var(--text);
}

.answers {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.answer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: clamp(24px, 5vh, 34px);
  padding: 0 6px;
  border-radius: 999px;
  font-size: clamp(10px, 1.9vh, 13px);
  font-weight: 540;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
  white-space: nowrap;
  min-width: 0;
}

.answer span { overflow: hidden; text-overflow: ellipsis; }

/* the tick sits outside the flow, so the word stays centred until the tick shows */
.answer__tick {
  position: absolute;
  left: 10%;
  top: 50%;
  width: 11px;
  height: 11px;
  margin-top: -5.5px;
  fill: none;
  stroke: #1a1406;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.clock {
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.clock__bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--text);
  transform-origin: 0 50%;
}

/* the board: four rows, one per player */
.board {
  position: relative;
  list-style: none;
  display: grid;
  gap: 6px;
}

.board__lead {
  position: absolute;
  left: 0;
  top: 0;
  width: 2px;
  height: var(--row-h);
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(244, 194, 78, 0.45);
  z-index: 2;
}

.row { height: var(--row-h); }

.row__in {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: clamp(8px, 2vw, 12px);
  height: 100%;
  padding: 0 clamp(10px, 2.4vw, 16px) 0 clamp(8px, 1.8vw, 12px);
  border-radius: 12px;
  background: var(--row);
  box-shadow: inset 0 0 0 1px var(--row-edge), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.row__seal {
  display: grid;
  place-items: center;
  width: calc(var(--row-h) - 14px);
  height: calc(var(--row-h) - 14px);
  border-radius: 50%;
  font-size: clamp(9px, 1.7vh, 12px);
  font-weight: 640;
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.09);
}

.row__name {
  font-size: clamp(12px, 2.4vh, 16px);
  font-weight: 540;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row__gain,
.row__out {
  font-family: var(--mono);
  font-size: clamp(9px, 1.7vh, 11px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.row__gain {
  color: var(--accent);
  opacity: 0;
}

.row__out { color: var(--text-soft); }

/* the score: four reels of digits */
.row__score {
  display: inline-flex;
  font-size: clamp(15px, 3.2vh, 23px);
  font-weight: 620;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  line-height: 1;
}

.reel {
  display: inline-block;
  height: 1em;
  overflow: hidden;
}

.reel__strip {
  display: flex;
  flex-direction: column;
}

.reel__strip span {
  display: block;
  height: 1em;
  text-align: center;
}

@media (max-width: 420px) {
  .answers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-height: 420px) {
  .answers { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
