/*
 * Gameshow game page (gameshow.php).
 * Same dark slate chrome as Takeover (styles/takeover.css): flat panels, a faint grid,
 * condensed headings. The only warm light on the page comes from the podium bulbs
 * and score displays, so the scores are what the eye lands on.
 */

.gs-page {
  --gs-bg:          #0b0e14;
  --gs-surface:     #11161f;
  --gs-surface-2:   #171d28;
  --gs-surface-3:   #1e2533;
  --gs-line:        #222a37;
  --gs-line-strong: #313b4b;
  --gs-text:        #e7eaf0;
  --gs-text-soft:   #c3c9d4;
  --gs-muted:       #8b94a5;
  --gs-faint:       #5c6576;
  --gs-focus:       #f4f6fa;
  --gs-amber:       #ffb547;
  --gs-amber-soft:  #ffd38a;
  --gs-led:         #ffc457;
  --gs-right:       #3fc77f;
  --gs-wrong:       #ff6b6b;
  --gs-lacquer-1:   #1d2c6e;
  --gs-lacquer-2:   #101945;
  --gs-trim:        #b8954a;
  --gs-radius-sm:   6px;
  --gs-radius:      10px;
  --gs-display:     'Barlow Condensed', 'Inter', system-ui, sans-serif;
  --gs-body:        'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  margin: 0;
  padding: 0;
  /* Takeover's grid, washed by coloured studio lights from above (fixed, so they stay put while scrolling) */
  background-color: var(--gs-bg);
  background-image:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px),
    radial-gradient(45% 40% at 8% 0%, rgba(255, 64, 160, 0.30), transparent 70%),
    radial-gradient(40% 38% at 50% -6%, rgba(255, 181, 71, 0.18), transparent 70%),
    radial-gradient(45% 40% at 92% 0%, rgba(64, 140, 255, 0.32), transparent 70%),
    radial-gradient(60% 45% at 50% 105%, rgba(120, 70, 255, 0.20), transparent 70%);
  background-size: 32px 32px, 32px 32px, 100% 100%, 100% 100%, 100% 100%, 100% 100%;
  background-attachment: scroll, scroll, fixed, fixed, fixed, fixed;
  color: var(--gs-text);
  font-family: var(--gs-body);
  font-size: 14px;
  cursor: auto;
}

.gs-page *,
.gs-page *::before,
.gs-page *::after { box-sizing: border-box; }

.gs-page :focus-visible {
  outline: 2px solid var(--gs-focus);
  outline-offset: 2px;
}

.gs-page h1,
.gs-page h2,
.gs-page h3,
.gs-page p { margin: 0; }

.gs-page button { font-family: inherit; }

/* ─── Shell ─────────────────────────────────────────────────────────────── */

.gs-shell {
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: 16px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gs-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.gs-eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gs-faint);
}

.gs-bar h1 {
  font-family: var(--gs-display);
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
  margin-top: 4px;
}

.gs-phase {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-align: right;
}

.gs-phase-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gs-muted);
}

.gs-clock {
  font-family: var(--gs-display);
  font-size: 40px;
  font-weight: 600;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
  color: var(--gs-text);
}

.gs-clock:empty { display: none; }
.gs-clock.is-urgent { color: var(--gs-wrong); }

.gs-live {
  font-size: 11px;
  font-weight: 600;
  color: var(--gs-amber);
}

.gs-live.is-up { color: var(--gs-faint); }

.gs-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
}

/* ─── Stage ─────────────────────────────────────────────────────────────── */

.gs-stage {
  position: relative;
  min-width: 0;
  background: var(--gs-surface);
  border: 1px solid var(--gs-line);
  border-radius: var(--gs-radius);
  overflow: hidden;
}

/* Marquee bulbs along the top of the set, chasing like the podium lights */
.gs-stage::before,
.gs-stage::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 10px;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(circle, #ffd38a 0 2px, transparent 2.6px) 0 50% / 14px 10px repeat-x;
  filter: drop-shadow(0 0 3px rgba(255, 200, 110, 0.9));
  animation: gs-chase 1.4s steps(1) infinite;
}

.gs-stage::after {
  background-position: 7px 50%;
  animation-direction: reverse;
}

.gs-screen { padding: 24px 20px 4px; }

/* The question board: plain text on the panel, nothing boxed that doesn't need to be */
.gs-board {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 820px;
  margin: 0 auto;
}

.gs-board.is-quiet { padding: 28px 0 20px; }

.gs-board-meta {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gs-muted);
}

.gs-prompt {
  font-family: var(--gs-display);
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 600;
  line-height: 1.1;
  color: var(--gs-text);
}

.gs-prompt.is-small {
  font-size: 22px;
  color: var(--gs-text-soft);
}

.gs-board-text { font-size: 14px; color: var(--gs-text-soft); line-height: 1.5; }
.gs-board-text strong { color: var(--gs-text); }
.gs-board-foot { font-size: 12px; color: var(--gs-muted); line-height: 1.45; }
.gs-key-text { color: var(--gs-right); font-weight: 600; }
.gs-host-note { font-size: 11.5px; color: var(--gs-faint); }

.gs-timebar {
  height: 4px;
  border-radius: 999px;
  background: var(--gs-surface-3);
  overflow: hidden;
}

.gs-timebar i {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--gs-text-soft);
  transition: width 0.2s linear;
}

/* Answer choices: rows like the Takeover map squares */
.gs-choices {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.gs-choice {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--gs-line);
  border-radius: var(--gs-radius-sm);
  background: var(--gs-surface-2);
  color: var(--gs-text);
  font: 500 15px/1.3 var(--gs-body);
  text-align: left;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

button.gs-choice { cursor: pointer; }
button.gs-choice:hover:not(:disabled) { background: var(--gs-surface-3); border-color: var(--gs-line-strong); }
button.gs-choice:disabled { cursor: progress; }

.gs-choice-key {
  flex-shrink: 0;
  width: 1.2em;
  font-family: var(--gs-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  color: var(--gs-faint);
}

.gs-choice-text { min-width: 0; overflow-wrap: anywhere; }

.gs-choice.is-picked {
  background: var(--gs-focus);
  border-color: var(--gs-focus);
  color: var(--gs-bg);
}
.gs-choice.is-picked .gs-choice-key { color: var(--gs-bg); }
.gs-choice.is-faded { opacity: 0.45; }
/* Host only: the right answer */
.gs-choice.is-key { box-shadow: inset 3px 0 0 var(--gs-right); }
.gs-choice.is-key .gs-choice-key { color: var(--gs-right); }

.gs-type-answer { display: flex; gap: 6px; }

.gs-type-answer input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--gs-line-strong);
  border-radius: var(--gs-radius-sm);
  background: var(--gs-surface-2);
  color: var(--gs-text);
  font: 500 15px var(--gs-body);
}

.gs-type-answer input:focus { outline: none; border-color: var(--gs-muted); }
.gs-type-answer .gs-btn { width: auto; }

.gs-typed { font-size: 15px; color: var(--gs-text-soft); }
.gs-typed strong { color: var(--gs-text); }
.gs-typed.is-muted { color: var(--gs-muted); }

.gs-answer {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--gs-display);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--gs-right);
}

.gs-answer span {
  font-family: var(--gs-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gs-muted);
}

/* ─── Rows (live answers, reveal, minigame, final) ──────────────────────── */

.gs-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  border-radius: var(--gs-radius-sm);
  overflow: hidden;
  background: var(--gs-line);
}

.gs-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 6px 12px 6px 8px;
  background: var(--gs-surface-2);
  font-size: 13px;
  color: var(--gs-text-soft);
}

.gs-row-rank {
  width: 26px;
  flex-shrink: 0;
  text-align: center;
  font-family: var(--gs-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--gs-faint);
}

.gs-head {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--gs-surface-3);
  background-repeat: no-repeat;
  background-size: 180%;
  background-position: 50% 4%;
}

.gs-row-name {
  min-width: 0;
  font-weight: 600;
  color: var(--gs-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gs-row-answer {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gs-row-time {
  font-variant-numeric: tabular-nums;
  color: var(--gs-faint);
  font-size: 12px;
}

.gs-row-points {
  min-width: 48px;
  text-align: right;
  font-family: var(--gs-display);
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--gs-text);
}

.gs-grow { flex: 1; }
.gs-you { font-weight: 400; color: var(--gs-faint); }

.gs-row.is-right .gs-row-points { color: var(--gs-right); }
.gs-row.is-right .gs-row-rank { color: var(--gs-text-soft); }

.gs-row.is-wrong { background: color-mix(in srgb, var(--gs-wrong) 13%, var(--gs-surface-2)); }
.gs-row.is-wrong .gs-row-answer,
.gs-row.is-wrong .gs-row-points,
.gs-row.is-wrong .gs-row-rank { color: var(--gs-wrong); }

.gs-row.is-me { box-shadow: inset 3px 0 0 var(--gs-focus); }
.gs-row.is-pending { color: var(--gs-faint); }
.gs-row.is-pending .gs-row-points { font: 500 12px var(--gs-body); color: var(--gs-faint); }
.gs-row.is-winner .gs-row-rank,
.gs-row.is-winner .gs-row-points { color: var(--gs-amber); }

/* Host-only live answers */
.gs-host-live { display: flex; flex-direction: column; gap: 8px; }
.gs-host-live .gs-row { min-height: 38px; }
.gs-host-live .gs-row.is-wrong { background: var(--gs-surface-2); }
.gs-host-live .gs-row.is-wrong .gs-row-answer { color: var(--gs-text-soft); }

.gs-mark { display: flex; gap: 4px; }

.gs-mark-btn {
  height: 26px;
  padding: 0 8px;
  border: 1px solid var(--gs-line-strong);
  border-radius: 4px;
  background: transparent;
  color: var(--gs-muted);
  font: 600 11px var(--gs-body);
  cursor: pointer;
}

.gs-mark-btn:hover:not(.is-on) { color: var(--gs-text); background: var(--gs-surface-3); }
.gs-mark-btn.is-on { background: var(--gs-right); border-color: var(--gs-right); color: var(--gs-bg); }
.gs-mark-btn.is-no.is-on { background: var(--gs-wrong); border-color: var(--gs-wrong); }

.gs-host-bar {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--gs-line);
}

.gs-host-bar .gs-btn { width: auto; }

/* ─── Prize wheel ───────────────────────────────────────────────────────── */

.gs-wheel {
  position: relative;
  width: min(380px, 100%);
  aspect-ratio: 1;
  margin: 4px auto 0;
}

.gs-wheel-disc {
  width: 100%;
  height: 100%;
  transform-origin: 50% 50%;
  will-change: transform;
}

.gs-wheel-disc svg { display: block; width: 100%; height: 100%; overflow: visible; }

.gs-wheel-rim {
  fill: #0d0905;
  stroke: var(--gs-trim);
  stroke-width: 7;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.55));
}

.gs-wheel-slices text {
  fill: #fff;
  font-family: var(--gs-display);
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: middle;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, 0.45);
  stroke-width: 1.4px;
}

.gs-wheel-lines line { stroke: rgba(0, 0, 0, 0.35); stroke-width: 0.8; }

/* Bulbs round the rim, chasing like the podiums' */
.gs-wheel-bulbs circle {
  fill: #ffe7b8;
  filter: drop-shadow(0 0 2px rgba(255, 210, 130, 0.95));
  animation: gs-chase 1.2s steps(1) infinite;
}

.gs-wheel-bulbs circle.is-odd { animation-direction: reverse; }

/* Fixed pointer at the top, over the rim */
.gs-wheel-pointer {
  position: absolute;
  top: -6px;
  left: 50%;
  z-index: 2;
  width: 26px;
  height: 30px;
  transform: translateX(-50%);
  background: var(--gs-focus);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6));
}

.gs-wheel-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: 22%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  border: 3px solid var(--gs-trim);
  border-radius: 50%;
  background: #12151d;
  color: var(--gs-text);
  font: 700 clamp(14px, 2.2vw, 20px) var(--gs-display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

button.gs-wheel-hub { cursor: pointer; }
.gs-wheel-hub.is-live { background: var(--gs-focus); color: var(--gs-bg); }
.gs-wheel-hub.is-live:hover { filter: brightness(0.92); }
.gs-wheel-hub:disabled { cursor: progress; opacity: 0.7; }

.gs-wheel-result {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  font-family: var(--gs-display);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--gs-text);
  text-align: center;
}

.gs-wheel-result span {
  font-family: var(--gs-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gs-muted);
}

.gs-wheel.is-done + .gs-wheel-result,
.gs-board .gs-wheel-result { animation: gs-pop 0.4s ease-out; }

@keyframes gs-pop {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

#gs-wheel-segments {
  width: 100%;
  min-height: 84px;
  padding: 8px 10px;
  border: 1px solid var(--gs-line-strong);
  border-radius: var(--gs-radius-sm);
  background: var(--gs-surface-2);
  color: var(--gs-text);
  font: 500 13px/1.4 var(--gs-body);
  resize: vertical;
}

#gs-wheel-segments:focus { outline: none; border-color: var(--gs-muted); }

/* ─── Host announcement on the stage ────────────────────────────────────── */

.gs-announce {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  max-width: 820px;
  margin: 14px auto 0;
  padding: 0 20px;
}

.gs-announce[hidden] { display: none; }
.gs-announce.is-in { animation: gs-pop 0.3s ease-out; }

.gs-announce-ava {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid var(--gs-trim);
  background-color: var(--gs-surface-3);
  background-repeat: no-repeat;
  background-size: 180%;
  background-position: 50% 4%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

.gs-bubble {
  position: relative;
  flex: 1;
  min-width: 0;
  padding: 10px 14px 12px;
  border-radius: 12px;
  background: var(--gs-focus);
  color: var(--gs-bg);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

/* Speech-bubble tail pointing at the avatar */
.gs-bubble::before {
  content: '';
  position: absolute;
  top: 22px;
  left: -9px;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 10px solid var(--gs-focus);
}

.gs-bubble-name {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5c6576;
}

.gs-bubble-text {
  margin-top: 2px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.gs-bubble-text img,
.gs-bubble-text iframe { max-width: 100%; border-radius: var(--gs-radius-sm); }

.gs-announce-close { position: absolute; top: -6px; right: 14px; background: var(--gs-surface-3); }

/* ─── Floor and podiums ─────────────────────────────────────────────────── */

.gs-floor {
  position: relative;
  container-type: inline-size;
  margin-top: 16px;
  padding: 52px 16px 0;
  border-top: 1px solid var(--gs-line);
  overflow: hidden;
}

.gs-podiums {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 18px 14px;
  /* Podiums share one row until they hit their minimum width (--n is set by gameshow.js) */
  --pw: clamp(84px, calc((100cqw - 36px - (var(--n, 6) - 1) * 14px) / var(--n, 6)), 150px);
}

.gs-empty-stage {
  color: var(--gs-faint);
  padding: 40px 0 56px;
}

.gs-podium {
  position: relative;
  width: var(--pw);
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Each contestant's own bulb colour (--hue is set per podium by gameshow.js); right/wrong override it */
  --bulb: var(--hue, var(--gs-amber));
  --bulb-glow: color-mix(in srgb, var(--bulb) 75%, transparent);
  --led: var(--gs-led);
}

/* Contestant standing behind the desk: the avatar is 330×630, the desk hides it from the hips down */
.gs-figure {
  width: 116%;
  aspect-ratio: 330 / 390;
  background-repeat: no-repeat;
  background-size: 100% auto;
  background-position: 50% 0;
  margin-bottom: calc(var(--pw) * -0.4);
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5));
  transition: filter 0.3s;
}

.gs-desk {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 16px 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: center;
  transition: filter 0.3s;
}

/* Lacquered front panel, tapering towards the floor */
.gs-desk::after {
  content: '';
  position: absolute;
  inset: 6px 0 0;
  z-index: -1;
  clip-path: polygon(0 0, 100% 0, 93% 100%, 7% 100%);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 2px, transparent 2px calc(100% - 2px), rgba(255, 255, 255, 0.05) calc(100% - 2px)),
    linear-gradient(180deg, var(--gs-lacquer-1) 0%, var(--gs-lacquer-2) 100%);
}

/* Desk top: a brass-edged slab a little wider than the front */
.gs-desk::before {
  content: '';
  position: absolute;
  top: 0;
  left: -4%;
  right: -4%;
  height: 8px;
  z-index: 0;
  border-radius: 3px;
  background: linear-gradient(180deg, #e2c27a 0%, var(--gs-trim) 45%, #6e5526 100%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

button.gs-desk { cursor: pointer; }
button.gs-desk:hover .gs-display { border-color: var(--gs-amber-soft); }
button.gs-desk:hover .gs-plate::after {
  content: 'Edit';
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--gs-body);
  font-size: 9px;
  letter-spacing: 0.04em;
  color: var(--gs-amber-soft);
}

/* Marquee bulbs above and below the score display; alternate bulbs chase */
.gs-bulbs {
  position: absolute;
  left: 12%;
  right: 12%;
  top: 14px;
  height: calc(var(--pw) * 0.42 + 10px);
  pointer-events: none;
}

.gs-bulbs::before,
.gs-bulbs::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  background:
    radial-gradient(circle, var(--bulb) 0 1.8px, transparent 2.4px) 0 0 / 10px 6px repeat-x,
    radial-gradient(circle, var(--bulb) 0 1.8px, transparent 2.4px) 0 100% / 10px 6px repeat-x;
  filter: drop-shadow(0 0 3px var(--bulb-glow));
}

.gs-bulbs::after {
  background-position: 5px 0, 5px 100%;
  animation: gs-chase 1.2s steps(1) infinite;
}

.gs-bulbs::before { animation: gs-chase 1.2s steps(1) infinite reverse; }

@keyframes gs-chase {
  0%   { opacity: 1; }
  50%  { opacity: 0.25; }
}

.gs-display {
  position: relative;
  width: 76%;
  height: calc(var(--pw) * 0.42);
  margin-top: 4px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  border: 1px solid #3a2a12;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.18) 0 1px, transparent 1px 3px),
    radial-gradient(120% 90% at 50% 40%, #1e1408, #0b0703);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.8);
  transition: border-color 0.2s;
}

.gs-score {
  font-family: var(--gs-display);
  font-size: calc(var(--pw) * 0.25);
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--led);
  text-shadow: 0 0 6px color-mix(in srgb, var(--led) 70%, transparent), 0 0 1px var(--led);
}

/* Name card: dim until the contestant locks in an answer, then it lights up */
.gs-plate {
  position: relative;
  width: 86%;
  padding: 5px 4px;
  border-radius: 3px;
  background: #0c112b;
  border: 1px solid #2b376a;
  font-family: var(--gs-display);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #cfd6f2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.gs-podium.is-me .gs-plate { border-color: var(--gs-amber-soft); }

.gs-podium.is-locked .gs-plate {
  background: #ffe7b8;
  border-color: #ffe7b8;
  color: #2a1a03;
  box-shadow: 0 0 12px rgba(255, 210, 130, 0.55);
}

.gs-podium.is-right {
  --bulb: var(--gs-right);
  --bulb-glow: rgba(63, 214, 138, 0.8);
  --led: #7ff0b4;
}
.gs-podium.is-right .gs-display { border-color: rgba(63, 214, 138, 0.6); }

.gs-podium.is-wrong {
  --bulb: var(--gs-wrong);
  --bulb-glow: rgba(255, 82, 82, 0.8);
  --led: #ff7a7a;
}
.gs-podium.is-wrong .gs-display { border-color: rgba(255, 82, 82, 0.6); }

.gs-podium.is-winner { --bulb: #ffe08a; }

.gs-podium.is-up .gs-score { animation: gs-bump 0.9s ease-out; }
.gs-podium.is-down .gs-score { animation: gs-dip 0.9s ease-out; }

@keyframes gs-bump {
  0%   { transform: scale(1); }
  20%  { transform: scale(1.18); color: #fff; }
  100% { transform: scale(1); }
}

@keyframes gs-dip {
  0%   { transform: none; }
  20%  { transform: translateY(2px); color: var(--gs-wrong); }
  100% { transform: none; }
}

/* Not on the page, or eliminated: lights off, colour drained */
.gs-podium:is(.is-offline, .is-out) .gs-figure { filter: grayscale(1) brightness(0.45); }
.gs-podium:is(.is-offline, .is-out) .gs-desk { filter: grayscale(1) brightness(0.6); }
.gs-podium:is(.is-offline, .is-out) .gs-bulbs { display: none; }
.gs-podium:is(.is-offline, .is-out)::after { display: none; }
.gs-podium.is-out .gs-score { color: #6d6d6d; text-shadow: none; }
.gs-podium.is-out .gs-place { background: #3a4150; color: var(--gs-text-soft); }

/* Each podium throws a pool of its own light onto the stage floor */
.gs-podium::after {
  content: '';
  position: absolute;
  left: -30%;
  right: -30%;
  bottom: -14px;
  height: 40px;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(50% 50% at 50% 50%, color-mix(in srgb, var(--bulb) 75%, transparent), transparent 72%);
}
.gs-podium.is-offline .gs-score { color: #6d6d6d; text-shadow: none; }

.gs-off-tag {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  font-family: var(--gs-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #d0d0d0;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 1px 6px;
}

.gs-place {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  font-family: var(--gs-display);
  font-size: 14px;
  font-weight: 600;
  color: #1a1206;
  background: var(--gs-amber);
  border-radius: 5px;
  padding: 2px 7px;
}

.gs-podium.is-winner .gs-place { background: #ffe08a; }


/* ─── Side panels ───────────────────────────────────────────────────────── */

.gs-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.gs-panel {
  background: var(--gs-surface);
  border: 1px solid var(--gs-line);
  border-radius: var(--gs-radius);
  padding: 14px;
}

.gs-panel-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gs-faint);
  margin-bottom: 10px;
}

.gs-hint { font-size: 11.5px; color: var(--gs-faint); line-height: 1.45; }
.gs-muted { color: var(--gs-faint); font-weight: 500; }

/* Host console */
.gs-console {
  display: flex;
  flex-direction: column;
  max-height: 60vh;
  overflow-y: auto;
}

.gs-console-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--gs-line);
}

.gs-console-block:first-of-type { border-top: 0; padding-top: 0; }

.gs-console-block h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--gs-text);
}

.gs-console-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.gs-bank {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  border-radius: var(--gs-radius-sm);
  overflow: hidden;
  background: var(--gs-line);
}

.gs-bank-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  background: var(--gs-surface-2);
}

.gs-bank-item.is-asked { opacity: 0.5; }
.gs-bank-item.is-on { opacity: 1; box-shadow: inset 3px 0 0 var(--gs-focus); }

.gs-bank-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gs-bank-meta { font-size: 11px; color: var(--gs-faint); }

.gs-bank-prompt {
  font-size: 12.5px;
  color: var(--gs-text-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gs-bank-actions { display: flex; align-items: center; gap: 2px; }
.gs-bank-actions .gs-btn { width: auto; margin-right: auto; }

.gs-mini-pick { display: flex; gap: 6px; }
.gs-mini-pick .gs-btn { width: auto; }

.gs-mini-pick select,
.gs-field input,
.gs-field textarea {
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--gs-line-strong);
  border-radius: var(--gs-radius-sm);
  background: var(--gs-surface-2);
  color: var(--gs-text);
  font: 500 13px var(--gs-body);
}

.gs-mini-pick select { flex: 1; }

.gs-field textarea {
  height: auto;
  padding: 8px 10px;
  resize: vertical;
  line-height: 1.4;
}

.gs-mini-pick select:focus,
.gs-field input:focus,
.gs-field textarea:focus { outline: none; border-color: var(--gs-muted); }

/* Chat */
.gs-chat {
  display: flex;
  flex-direction: column;
  min-height: 260px;
}

.gs-chat-log {
  list-style: none;
  margin: 0;
  padding: 0 2px 0 0;
  flex: 1;
  min-height: 0;
  max-height: 46vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  line-height: 1.4;
}

.gs-page.is-host .gs-chat-log { max-height: 26vh; }

.msg { color: var(--gs-text-soft); overflow-wrap: anywhere; }
.msg time { font-size: 11px; color: var(--gs-faint); margin-right: 2px; }
.msg-user { font-weight: 600; color: var(--gs-text); text-decoration: none; }
.msg-user:hover { text-decoration: underline; }
.msg-tag { font-size: 11px; color: var(--gs-muted); }
.msg.is-private .msg-text { color: #c9b8f0; }
.msg.is-system { color: var(--gs-muted); }
.msg.is-system .msg-text strong { color: var(--gs-text-soft); }
.msg img { max-width: 100%; border-radius: var(--gs-radius-sm); }
.msg iframe { max-width: 100%; height: auto; aspect-ratio: 16 / 9; }
.msg-loading { color: var(--gs-faint); font-size: 12px; text-align: center; }

.gs-chat-form { display: flex; gap: 6px; margin-top: 10px; }

.gs-chat-form input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--gs-line-strong);
  border-radius: var(--gs-radius-sm);
  background: var(--gs-surface-2);
  color: var(--gs-text);
  font: 400 13px var(--gs-body);
}

.gs-chat-form input:focus { outline: none; border-color: var(--gs-muted); }

.gs-chat-form button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--gs-line-strong);
  border-radius: var(--gs-radius-sm);
  background: transparent;
  color: var(--gs-text-soft);
  cursor: pointer;
}

.gs-chat-form button:hover { background: var(--gs-surface-2); }
.gs-chat-note { margin-top: 10px; font-size: 12px; color: var(--gs-faint); }

/* ─── Buttons (same as Takeover's) ──────────────────────────────────────── */

.gs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--gs-radius-sm);
  background: var(--gs-focus);
  color: var(--gs-bg);
  font: 600 13px/1 var(--gs-body);
  cursor: pointer;
  transition: filter 0.15s ease, background-color 0.15s ease;
}

.gs-btn:hover:not(:disabled) { filter: brightness(0.92); }
.gs-btn:disabled { background: var(--gs-surface-3); color: var(--gs-faint); cursor: not-allowed; }
.gs-btn-wide { width: 100%; min-height: 42px; font-size: 14px; }
.gs-btn-sm { min-height: 28px; padding: 0 10px; font-size: 12px; }

.gs-btn-ghost {
  background: transparent;
  border-color: var(--gs-line-strong);
  color: var(--gs-text);
}
.gs-btn-ghost:hover:not(:disabled) { background: var(--gs-surface-2); filter: none; }

.gs-btn-danger { background: var(--gs-wrong); color: var(--gs-bg); }

.gs-btn-danger-ghost {
  background: transparent;
  border-color: var(--gs-line-strong);
  color: var(--gs-wrong);
}
.gs-btn-danger-ghost:hover:not(:disabled) { background: var(--gs-surface-2); filter: none; }

.gs-console .gs-btn:not(.gs-btn-sm) { width: 100%; }

.gs-chip-btn {
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--gs-line-strong);
  border-radius: var(--gs-radius-sm);
  background: transparent;
  color: var(--gs-text-soft);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.gs-chip-btn:hover:not(:disabled) { background: var(--gs-surface-2); color: var(--gs-text); }
.gs-chip-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.gs-icon-btn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--gs-radius-sm);
  background: transparent;
  color: var(--gs-muted);
  cursor: pointer;
}
.gs-icon-btn:hover:not(:disabled) { color: var(--gs-text); background: var(--gs-surface-3); }
.gs-icon-btn:disabled { opacity: 0.3; cursor: default; }

/* ─── Dialogs ───────────────────────────────────────────────────────────── */

.gs-dialog {
  width: min(380px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--gs-line-strong);
  border-radius: var(--gs-radius);
  background: var(--gs-surface);
  color: var(--gs-text);
  font-family: var(--gs-body);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.gs-dialog-wide { width: min(560px, calc(100vw - 32px)); }
.gs-dialog::backdrop { background: rgba(5, 7, 11, 0.75); }

.gs-dialog-box {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  margin: 0;
}

.gs-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.gs-dialog-head h2 {
  font-family: var(--gs-display);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
}

.gs-dialog-sub { font-size: 12.5px; color: var(--gs-muted); line-height: 1.45; margin-top: 2px; }

.gs-dialog-foot { display: flex; justify-content: flex-end; align-items: center; gap: 6px; }

.gs-flash { font-size: 12.5px; color: var(--gs-wrong); }
.gs-flash:empty { display: none; }

/* Score editor */
.gs-score-edit {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  gap: 6px;
}

.gs-score-edit input {
  height: 60px;
  min-width: 0;
  text-align: center;
  border: 1px solid var(--gs-line-strong);
  border-radius: var(--gs-radius-sm);
  background: #0d0905;
  color: var(--gs-led);
  font: 700 36px var(--gs-display);
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}

.gs-score-edit input::-webkit-outer-spin-button,
.gs-score-edit input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.gs-score-edit input:focus { outline: none; border-color: var(--gs-muted); }

.gs-step {
  height: 60px;
  border: 1px solid var(--gs-line-strong);
  border-radius: var(--gs-radius-sm);
  background: var(--gs-surface-2);
  color: var(--gs-text);
  font: 600 18px var(--gs-display);
  cursor: pointer;
}
.gs-step:hover { background: var(--gs-surface-3); }

.gs-score-quick { display: flex; gap: 6px; flex-wrap: wrap; }

/* Question editor */
.gs-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gs-text-soft);
}

.gs-field[hidden], .gs-options[hidden] { display: none; }
.gs-field-hint { font-size: 11px; font-weight: 400; color: var(--gs-faint); }
.gs-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.gs-segmented {
  display: flex;
  margin: 0;
  padding: 0;
  border: 0;
  gap: 1px;
  border-radius: var(--gs-radius-sm);
  overflow: hidden;
  background: var(--gs-line);
}

.gs-segmented legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.gs-segmented label {
  flex: 1;
  text-align: center;
  padding: 8px 10px;
  background: var(--gs-surface-2);
  font-size: 13px;
  font-weight: 600;
  color: var(--gs-muted);
  cursor: pointer;
}

.gs-segmented input { position: absolute; opacity: 0; pointer-events: none; }
.gs-segmented label:has(input:checked) { background: var(--gs-focus); color: var(--gs-bg); }
.gs-segmented label:has(input:focus-visible) { outline: 2px solid var(--gs-focus); outline-offset: -2px; }

.gs-options { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

.gs-option-list {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gs-option-row { display: flex; align-items: center; gap: 8px; }

.gs-option-row .gs-option-letter {
  width: 1.2em;
  font: 700 18px var(--gs-display);
  color: var(--gs-faint);
}

.gs-option-input {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--gs-line-strong);
  border-radius: var(--gs-radius-sm);
  background: var(--gs-surface-2);
  color: var(--gs-text);
  font: 500 13px var(--gs-body);
}
.gs-option-input:focus { outline: none; border-color: var(--gs-muted); }

.gs-option-correct input { width: 16px; height: 16px; accent-color: var(--gs-right); cursor: pointer; }
.gs-option-row:has(input[type="radio"]:checked) .gs-option-input { border-color: var(--gs-right); }
.gs-option-row:has(input[type="radio"]:checked) .gs-option-letter { color: var(--gs-right); }

/* End of show order */
.gs-order {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 50vh;
  overflow-y: auto;
  border-radius: var(--gs-radius-sm);
  background: var(--gs-line);
}

.gs-order-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  background: var(--gs-surface-2);
}

.gs-order-row .gs-row-name { flex: 1; }
.gs-order-row .gs-row-rank { width: 34px; }

/*
 * Minigame dialog: the same as Takeover's (.tk-play in styles/takeover.css), which uses the
 * same iframe setup as the other competition pages: a 500x500 content-box iframe with a
 * 2px border, unscaled. Only screens too small for it scale the whole frame down
 * (gameshow.js sets --frame-scale).
 */
.gs-play {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(5, 7, 10, 0.82);
  --minigame-size: 500px; /* overwritten by gameshow.js from MINIGAME_SIZE */
}

.gs-play[hidden] { display: none; }

.gs-play-box {
  width: min(calc(var(--minigame-size) + 38px), 100%); /* iframe + its 2px border + box padding + box border */
  max-height: 100%;
  overflow-y: auto;
  background: var(--gs-surface);
  border: 1px solid var(--gs-line-strong);
  border-radius: var(--gs-radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gs-play-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.gs-play-head h2 {
  font-family: var(--gs-display);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.05;
  color: var(--gs-text);
}

.gs-play-head p { font-size: 12.5px; color: var(--gs-muted); margin-top: 3px; }

.gs-play-frame {
  --frame-outer: calc(var(--minigame-size) + 4px); /* iframe + 2px border each side */
  width: calc(var(--frame-outer) * var(--frame-scale, 1));
  height: calc(var(--frame-outer) * var(--frame-scale, 1));
  margin: 0 auto;
}

.gs-play-frame .minigame-frame {
  box-sizing: content-box; /* .gs-page makes everything border-box; the minigame needs its full 500x500 viewport */
  display: block;
  width: var(--minigame-size);
  height: var(--minigame-size);
  border: 2px solid #ddd;
  border-radius: 8px;
  background-color: #f8f9fa;
  transform-origin: 0 0;
}

.gs-play-frame.is-scaled .minigame-frame { transform: scale(var(--frame-scale)); }
.gs-play-note { font-size: 11.5px; color: var(--gs-faint); }

/* Toast */
.gs-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 2000;
  max-width: calc(100vw - 32px);
  padding: 10px 14px;
  border-radius: var(--gs-radius-sm);
  border: 1px solid var(--gs-line-strong);
  background: var(--gs-surface-2);
  color: var(--gs-text);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.gs-toast.is-error { color: var(--gs-wrong); }

/* ─── Responsive ────────────────────────────────────────────────────────── */

@media (max-width: 1020px) {
  .gs-body { grid-template-columns: minmax(0, 1fr); }
  .gs-console { max-height: none; }
  .gs-chat-log,
  .gs-page.is-host .gs-chat-log { max-height: 50vh; }
}

@media (max-width: 640px) {
  .gs-shell { padding: 12px 12px 20px; }
  .gs-bar { align-items: flex-start; flex-direction: column; gap: 8px; }
  .gs-bar h1 { font-size: 26px; }
  .gs-clock { font-size: 32px; }
  .gs-screen { padding: 14px 12px 4px; }
  .gs-choices { grid-template-columns: minmax(0, 1fr); }
  .gs-floor { padding: 26px 8px 0; }
  .gs-podiums { --pw: clamp(76px, calc((100cqw - 16px - (var(--n, 4) - 1) * 8px) / var(--n, 4)), 110px); gap: 16px 8px; }
  .gs-plate { font-size: 11px; }
  .gs-row-time { display: none; }
  .gs-field-row { grid-template-columns: 1fr; }
  .gs-type-answer input { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .gs-stage::before,
  .gs-stage::after,
  .gs-wheel-bulbs circle,
  .gs-announce.is-in,
  .gs-bulbs::before,
  .gs-bulbs::after,
  .gs-podium.is-up .gs-score,
  .gs-podium.is-down .gs-score { animation: none; }
}
