/* ==========================================================================
   HOST / TV SCREEN
   Designed to be read from ~10 feet away. Everything is oversized on purpose.
   ========================================================================== */

:root {
  --bg:       #0b0b12;
  --bg2:      #12121c;
  --surface:  #1b1b28;
  --line:     #2c2c3d;
  --text:     #f4f4fa;
  --muted:    #9a9ab0;
  --pink:     #ea587d;
  --gold:     #ebc95a;
  --green:    #3ddc97;
  --blue:     #67a3ec;
  --purple:   #ba91f1;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  overflow: hidden;
}

/* The backdrop lives in host-bg.css, which owns body::before and sits at
   z-index -2, below the drifting blobs at -1. */

#app { height: 100dvh; }

.screen {
  display: none;
  height: 100dvh;
  padding: 3vh 4vw;
  flex-direction: column;
}
.screen.active { display: flex; }

.center-stack {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.2vh;
  text-align: center;
}

/* ---- buttons ------------------------------------------------------------ */

.btn {
  font-family: inherit;
  font-weight: 800;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: transform .08s var(--ease), filter .15s var(--ease);
}
.btn:active { transform: translateY(2px) scale(.99); }
.btn:disabled { opacity: .35; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(180deg, var(--pink), #d51a49);
  color: #fff;
  box-shadow: 0 6px 0 #88112f, 0 12px 30px rgba(234,88,125,.3);
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn-primary:active:not(:disabled) { box-shadow: 0 3px 0 #88112f; }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 2px solid var(--line);
  font-size: 1rem;
  padding: .6rem 1.1rem;
}
.btn-ghost:hover { color: var(--text); border-color: var(--muted); }

.btn-big { font-size: clamp(1.2rem, 2.2vw, 2rem); padding: .8em 2em; }
.next-btn { margin-top: 1vh; }
.skip-btn { position: absolute; bottom: 2vh; right: 3vw; }

/* ---- LOBBY -------------------------------------------------------------- */

.lobby-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 4vw;
  align-items: center;
}

.lobby-left { text-align: center; }

.logo {
  font-size: clamp(2rem, 4.6vw, 4.5rem);
  font-weight: 900;
  line-height: .95;
  letter-spacing: -0.02em;
  margin-bottom: 3vh;
}
.logo span {
  display: block;
  background: linear-gradient(90deg, var(--pink), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lobby-instructions {
  color: var(--muted);
  font-size: clamp(.9rem, 1.3vw, 1.3rem);
  text-transform: uppercase;
  letter-spacing: .18em;
  margin: 1.2vh 0 .6vh;
}

.join-url {
  font-size: clamp(1.3rem, 2.6vw, 2.6rem);
  font-weight: 800;
  color: var(--blue);
  word-break: break-all;
}

.room-code {
  font-size: clamp(3.5rem, 9vw, 9rem);
  font-weight: 900;
  letter-spacing: .12em;
  color: var(--gold);
  text-shadow: 0 0 50px rgba(235,201,90,.35);
  line-height: 1;
}

.qr-wrap {
  margin-top: 2.4vh;
  display: inline-block;
  padding: 12px;
  background: #fff;
  border-radius: 14px;
}
.qr-wrap img { display: block; width: clamp(120px, 13vw, 200px); height: auto; }
.qr-hint { color: var(--muted); font-size: .9rem; margin-top: .8vh; }

.lobby-right { display: flex; flex-direction: column; height: 84vh; }

.players-title {
  font-size: clamp(1rem, 1.6vw, 1.5rem);
  letter-spacing: .2em;
  color: var(--muted);
  margin-bottom: 1.5vh;
}
.players-title .count { color: var(--text); }

.player-list {
  list-style: none;
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .8vh 1vw;
  align-content: start;
}
.player-list li {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: .7em 1em;
  font-size: clamp(.9rem, 1.5vw, 1.5rem);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: .5em;
  animation: pop .25s ease;
}
.player-list li.host { border-color: var(--gold); }
.player-list li.away { opacity: .4; }
.player-list .crown { font-size: .85em; }

@keyframes pop {
  from { transform: scale(.85); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.lobby-controls {
  display: flex;
  gap: 1vw;
  align-items: center;
  margin-top: 2vh;
}
.rounds-label {
  color: var(--muted);
  font-size: .8rem;
  letter-spacing: .15em;
  display: flex;
  flex-direction: column;
  gap: .4em;
}
.rounds-label select {
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: .6em .8em;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: inherit;
}
.lobby-controls .btn-primary { flex: 1; }

.debug-bar { display: flex; gap: .6vw; margin-top: 1.2vh; opacity: .5; }
.debug-bar .btn { font-size: .8rem; padding: .5em .9em; }

/* ---- ROUND INTRO -------------------------------------------------------- */

.round-pill {
  display: inline-block;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: .5em 1.4em;
  font-size: clamp(.8rem, 1.2vw, 1.1rem);
  font-weight: 800;
  letter-spacing: .2em;
  color: var(--muted);
}

.round-title {
  font-size: clamp(3rem, 10vw, 10rem);
  font-weight: 900;
  letter-spacing: -.02em;
  line-height: 1;
  background: linear-gradient(90deg, var(--pink), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: slam .4s cubic-bezier(.2,1.4,.4,1);
}
@keyframes slam {
  from { transform: scale(1.4); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.round-sub { color: var(--muted); font-size: clamp(1rem, 2vw, 1.8rem); }

.bonus-banner {
  background: linear-gradient(90deg, rgba(235,201,90,.16), rgba(234,88,125,.16));
  border: 2px solid var(--gold);
  border-radius: 14px;
  padding: 1em 2em;
  font-size: clamp(1rem, 2vw, 1.9rem);
  font-weight: 800;
  color: var(--gold);
  animation: glow 2s ease-in-out infinite;
}
.bonus-banner:empty { display: none; }
@keyframes glow {
  0%,100% { box-shadow: 0 0 0 rgba(235,201,90,0); }
  50%     { box-shadow: 0 0 40px rgba(235,201,90,.35); }
}

.effects-row { display: flex; gap: 1vw; flex-wrap: wrap; justify-content: center; }
.effect-chip {
  background: rgba(186,145,241,.15);
  border: 2px solid var(--purple);
  color: var(--purple);
  border-radius: 999px;
  padding: .45em 1.1em;
  font-size: clamp(.8rem, 1.2vw, 1.1rem);
  font-weight: 800;
}

/* ---- QUESTION ----------------------------------------------------------- */

#s-question { position: relative; }

.q-top { display: flex; justify-content: space-between; align-items: center; }
.answered-pill {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: .5em 1.4em;
  font-size: clamp(.8rem, 1.2vw, 1.1rem);
  font-weight: 800;
  color: var(--muted);
}

.timer-bar {
  height: 12px;
  background: var(--surface);
  border-radius: 999px;
  overflow: hidden;
  margin: 2vh 0;
}
.timer-bar.wide { width: 60vw; }
.timer-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--green), var(--gold), var(--pink));
  transition: width .2s linear;
}

.q-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4vh;
}

.question-text {
  font-size: clamp(1.6rem, 4.4vw, 4.4rem);
  font-weight: 800;
  text-align: center;
  line-height: 1.15;
  max-width: 85%;
}

.options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.6vh 2vw;
  width: 82%;
}
.options.two-up { grid-template-columns: 1fr 1fr; width: 70%; }

.option {
  background: var(--surface);
  border: 3px solid var(--line);
  border-radius: 22px;
  padding: 1em 1.2em;
  font-size: clamp(1rem, 2.2vw, 2.1rem);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: .8em;
  transition: border-color .3s var(--ease), background-color .3s var(--ease), transform .3s var(--ease), opacity .3s var(--ease);
}
.option .letter {
  width: 1.7em; height: 1.7em;
  flex: none;
  display: grid; place-items: center;
  background: var(--line);
  border-radius: 8px;
  font-weight: 900;
  font-size: .8em;
}
.option.correct {
  border-color: var(--green);
  background: rgba(61,220,151,.14);
  transform: scale(1.03);
}
.option.correct .letter { background: var(--green); color: #06301f; }
.option.wrong { opacity: .35; }
.option .tally {
  margin-left: auto;
  font-size: .75em;
  color: var(--muted);
  font-weight: 800;
}

/* tap race */
.tap-stage {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: var(--bg);
}
.tap-word {
  font-size: clamp(4rem, 18vw, 18rem);
  font-weight: 900;
  letter-spacing: -.03em;
  color: var(--muted);
}
.tap-stage.go { background: var(--green); }
.tap-stage.go .tap-word { color: #05291a; animation: slam .15s ease; }

/* ---- REVEAL ------------------------------------------------------------- */

.reveal-head { text-align: center; margin-bottom: 2vh; }
.reveal-answer {
  font-size: clamp(1.4rem, 3.4vw, 3.4rem);
  font-weight: 900;
  color: var(--green);
}
.reveal-answer:empty { display: none; }
.winner-line {
  font-size: clamp(1rem, 1.8vw, 1.7rem);
  color: var(--gold);
  font-weight: 700;
  margin-top: .6vh;
}

.reveal-body { flex: 1; display: flex; flex-direction: column; align-items: center; min-height: 0; }

.punish-title {
  font-size: clamp(1.2rem, 2.6vw, 2.6rem);
  font-weight: 900;
  letter-spacing: .12em;
  color: var(--pink);
  margin-bottom: 1.6vh;
}

.punish-list {
  list-style: none;
  width: 72%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1vh;
}
.punish-list li {
  display: flex;
  align-items: center;
  gap: 1em;
  background: var(--surface);
  border-left: 8px solid var(--pink);
  border-radius: 14px;
  padding: .8em 1.2em;
  font-size: clamp(1rem, 1.9vw, 1.8rem);
  animation: slidein .3s ease backwards;
}
.punish-list li:nth-child(1) { animation-delay: .05s; }
.punish-list li:nth-child(2) { animation-delay: .12s; }
.punish-list li:nth-child(3) { animation-delay: .19s; }
.punish-list li:nth-child(4) { animation-delay: .26s; }
.punish-list li:nth-child(5) { animation-delay: .33s; }
@keyframes slidein {
  from { transform: translateX(-24px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
.punish-list .pname { font-weight: 800; }
.punish-list .preason { color: var(--muted); font-size: .75em; margin-left: auto; }
.punish-list .psips {
  background: var(--pink);
  color: #fff;
  border-radius: 999px;
  padding: .25em .9em;
  font-weight: 900;
  font-size: .85em;
  white-space: nowrap;
}
.punish-list li.shielded { border-left-color: var(--blue); }
.punish-list li.shielded .psips { background: var(--blue); }
.punish-list li.chug { border-left-color: var(--gold); }
.punish-list li.chug .psips { background: var(--gold); color: #3a2c00; }
.punish-list li.none { border-left-color: var(--line); color: var(--muted); justify-content: center; }

.award-banner {
  text-align: center;
  background: rgba(235,201,90,.12);
  border: 2px solid var(--gold);
  border-radius: 14px;
  padding: .9em 1.6em;
  font-size: clamp(1rem, 1.8vw, 1.7rem);
  font-weight: 800;
  color: var(--gold);
  margin: 2vh auto 0;
  max-width: 70%;
}

/* ---- CARD WINDOW / RESOLVE ---------------------------------------------- */

.cards-title {
  font-size: clamp(2rem, 5.5vw, 5rem);
  font-weight: 900;
  color: var(--purple);
}
.cards-sub { color: var(--muted); font-size: clamp(1rem, 1.8vw, 1.6rem); }

.played-list { list-style: none; display: flex; flex-wrap: wrap; gap: 1vw; justify-content: center; }
.played-list li {
  background: var(--surface);
  border: 2px solid var(--purple);
  border-radius: 14px;
  padding: .6em 1.2em;
  font-size: clamp(.9rem, 1.5vw, 1.4rem);
  font-weight: 700;
  animation: pop .25s ease;
}

.bonus-shout {
  font-size: clamp(2.5rem, 8vw, 8rem);
  font-weight: 900;
  color: var(--gold);
  letter-spacing: .04em;
  animation: slam .35s cubic-bezier(.2,1.4,.4,1);
  text-shadow: 0 0 60px rgba(235,201,90,.4);
}
.card-counter { color: var(--muted); letter-spacing: .2em; font-size: .95rem; font-weight: 800; }

.big-card {
  background: linear-gradient(160deg, #2a1f3d, var(--surface));
  border: 3px solid var(--purple);
  border-radius: 22px;
  padding: 1.6em 2.4em;
  box-shadow: 0 0 60px rgba(186,145,241,.25);
  animation: pop .3s ease;
}
.big-card-icon { font-size: clamp(2.5rem, 6vw, 5rem); }
.big-card-name {
  font-size: clamp(1.4rem, 3vw, 2.8rem);
  font-weight: 900;
  color: var(--purple);
  margin-top: .2em;
}
.big-card-desc { color: var(--muted); font-size: clamp(.9rem, 1.5vw, 1.4rem); margin-top: .3em; }

.card-story {
  font-size: clamp(1.1rem, 2.4vw, 2.2rem);
  font-weight: 700;
}
.card-story b { color: var(--gold); }

/* ---- SCORES ------------------------------------------------------------- */

.score-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 4vw; width: 78%; }
.score-col h3 {
  color: var(--muted);
  letter-spacing: .2em;
  font-size: clamp(.8rem, 1.2vw, 1.1rem);
  margin-bottom: 1.4vh;
}
.score-list { list-style: none; display: flex; flex-direction: column; gap: .8vh; }
.score-list li {
  display: flex;
  align-items: center;
  gap: .8em;
  background: var(--surface);
  border-radius: 14px;
  padding: .7em 1.1em;
  font-size: clamp(.95rem, 1.7vw, 1.6rem);
  font-weight: 700;
}
.score-list li:first-child { border: 2px solid var(--gold); }
.score-list .rank { color: var(--muted); font-weight: 900; width: 1.6em; }
.score-list .val { margin-left: auto; color: var(--gold); font-weight: 900; }

/* ---- misc --------------------------------------------------------------- */

.conn-warn {
  position: fixed;
  top: 1vh; left: 50%;
  transform: translateX(-50%);
  background: var(--pink);
  color: #fff;
  padding: .5em 1.4em;
  border-radius: 999px;
  font-weight: 800;
  z-index: 50;
}

/* Narrow screens (previewing the host view on a laptop or in a small pane) */
@media (max-width: 900px) {
  .lobby-grid { grid-template-columns: 1fr; gap: 2vh; }
  .lobby-right { height: auto; }
  .player-list { grid-template-columns: 1fr; }
  .options { grid-template-columns: 1fr; width: 92%; }
  .score-columns { grid-template-columns: 1fr; gap: 2vh; }
  .punish-list { width: 94%; }
}

/* --------------------------------------------------------------------------
   Applied from the Web Interface Guidelines audit.
   -------------------------------------------------------------------------- */

/* Numbers that tick in place must not jitter as digit widths change. The tap
   counter updates several times a second; the countdown every second. */
.answered-pill, .score-list .val, .timer-tag, .round-pill,
.tug-count, .tc-score, .final-stat span, .card-counter,
.quip-results .qv, .tally-list b, .cr-guess b {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* Stop single words dropping to their own line in big display type. */
.round-title, .question-text, .q-prompt, .reveal-answer,
.cards-title, .challenge-text, .ad-tag, .big-status, .verdict-text {
  text-wrap: balance;
}

/* Surfaces catch a light from above rather than sitting flat on the page.
   One inset hairline; no extra DOM. */
.player-list li, .vote-card, .team-card, .roster, .big-card, .option,
.punish-list li, .answer, .card, .tool-btn, .round-pill, .answered-pill,
.effect-chip, .bet-chip, .typing-list li, .clue, .dare-box, .final-stat {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}