/* The show's palette: a very saturated blue board, gold money, white clues in
   heavy uppercase with a hard black shadow. Everything scales off viewport
   units so the board fills a TV as happily as a laptop. */

:root {
  --board-blue: #060ce9;
  --board-blue-lit: #0a12ff;
  --gold: #d69f4c;
  --gold-bright: #ffcc5c;
  --ink: #04061f;
  --white: #fff;
  --dim: #9aa4c8;
  --right: #58d68d;
  --wrong: #ff6b6b;

  --stack: "Helvetica Neue", Helvetica, Arial, "Segoe UI", sans-serif;
  --display: "Arial Black", "Segoe UI Black", Impact, var(--stack);
}

* { box-sizing: border-box; }

/* `display: flex` on an element beats the hidden attribute's UA rule, and most
   things this game hides are flex containers. */
[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--ink);
  color: var(--white);
  font-family: var(--stack);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

button { font: inherit; cursor: pointer; }
input { font: inherit; }

/* ------------------------------------------------------------------ layout */

main {
  flex: 1;
  min-height: 0;
  position: relative;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  padding: clamp(0.8rem, 2vw, 2rem);
  text-align: center;
}

.screen.active { display: flex; }

/* --------------------------------------------------------------------- hud */

#hud {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem clamp(0.8rem, 2vw, 1.5rem);
  background: #000;
  border-bottom: 2px solid #1a1f4a;
  font-family: var(--display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: clamp(0.75rem, 1.4vw, 1rem);
}

#hud-round { color: var(--dim); }

.score {
  margin-left: auto;
  color: var(--gold-bright);
  font-size: clamp(1rem, 2.4vw, 1.8rem);
  font-variant-numeric: tabular-nums;
}

.score.negative { color: var(--wrong); }

.mic {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #131735;
  color: var(--dim);
  border: 1px solid #2a316b;
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.8em;
  letter-spacing: 0.06em;
}

.mic-dot {
  width: 0.6em;
  height: 0.6em;
  border-radius: 50%;
  background: #4a5183;
}

.mic[aria-pressed="true"] { color: var(--white); border-color: var(--right); }
.mic[aria-pressed="true"] .mic-dot {
  background: var(--right);
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse { 50% { opacity: 0.25; } }

/* ------------------------------------------------------------------- title */

.logo {
  font-family: var(--display);
  font-size: clamp(2.5rem, 9vw, 7rem);
  color: var(--gold-bright);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0;
  transform: skewX(-8deg);
  text-shadow: 5px 5px 0 #000, 0 0 40px rgba(214, 159, 76, 0.35);
}

.subtitle { color: var(--dim); margin: 0; font-size: clamp(0.85rem, 1.8vw, 1.1rem); }
.note { color: var(--dim); font-size: 0.8rem; max-width: 46ch; margin: 0; line-height: 1.5; }
.kicker {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--gold-bright);
  margin: 0;
}

.settings {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem 1.6rem;
  margin: 0.5rem 0;
  color: var(--dim);
  font-size: 0.9rem;
}

.settings label { display: flex; align-items: center; gap: 0.5rem; }
.settings input[type="number"] {
  width: 4.5rem;
  background: #0d1130;
  border: 1px solid #2a316b;
  color: var(--white);
  border-radius: 6px;
  padding: 0.3rem 0.5rem;
}
.settings .check { gap: 0.4rem; }

button.primary {
  background: var(--gold);
  color: #1a1200;
  border: none;
  border-radius: 8px;
  padding: 0.7rem 1.8rem;
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: clamp(0.85rem, 1.6vw, 1.05rem);
}
button.primary:hover { background: var(--gold-bright); }

button.ghost {
  background: transparent;
  color: var(--dim);
  border: 1px solid #2a316b;
  border-radius: 8px;
  padding: 0.7rem 1.2rem;
}
button.ghost:hover { color: var(--white); border-color: #4a5183; }

/* ------------------------------------------------------------------- board */

#screen-board { justify-content: flex-start; gap: 0.6rem; }

.board {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 1fr;
  gap: 5px;
  background: #000;
  /* The header row is shorter than the money rows, as on the show. */
  grid-template-rows: minmax(3.5rem, 0.8fr) repeat(5, 1fr);
}

.cat {
  background: var(--board-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  font-family: var(--display);
  text-transform: uppercase;
  font-size: clamp(0.5rem, 1.05vw, 0.95rem);
  line-height: 1.15;
  letter-spacing: 0.02em;
  text-shadow: 2px 2px 0 #000;
  hyphens: auto;
}

.cell {
  background: var(--board-blue);
  border: none;
  color: var(--gold-bright);
  font-family: var(--display);
  font-size: clamp(1rem, 3.2vw, 2.6rem);
  text-shadow: 4px 4px 0 #000;
  transition: background 90ms linear;
}

.cell:hover:not(.spent) { background: var(--board-blue-lit); }
.cell:focus-visible { outline: 3px solid var(--gold-bright); outline-offset: -6px; }

.cell.spent {
  color: transparent;
  cursor: default;
  background: #04061f;
}

.cell.picked { animation: flash 260ms ease-out; }
@keyframes flash { 0%, 60% { background: var(--gold-bright); } }

.hint { color: var(--dim); font-size: 0.85rem; margin: 0; }

.heard {
  color: #6d76a8;
  font-size: 0.85rem;
  font-style: italic;
  min-height: 1.4em;
  margin: 0;
}

/* -------------------------------------------------------------------- clue */

.clue-screen {
  background: var(--board-blue);
  justify-content: space-between;
  padding: clamp(1rem, 3vh, 2.5rem);
}

.clue-head {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: clamp(0.7rem, 1.5vw, 1.1rem);
  color: var(--gold-bright);
  text-shadow: 2px 2px 0 #000;
}

#clue-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  width: 100%;
}

#clue-text {
  font-family: var(--display);
  text-transform: uppercase;
  font-size: clamp(1.1rem, 3.4vw, 3rem);
  line-height: 1.25;
  letter-spacing: 0.01em;
  text-shadow: 4px 4px 0 rgba(0, 0, 0, 0.85);
  max-width: 24ch;
  margin: 0;
  text-wrap: balance;
}

#clue-media { max-height: 38vh; display: flex; justify-content: center; }
#clue-media:empty { display: none; }  /* no gap on a clue with no picture */
#clue-media img, #clue-media video {
  max-height: 38vh;
  max-width: min(90vw, 900px);
  border: 3px solid #000;
  border-radius: 4px;
}

.timer {
  width: min(100%, 900px);
  height: 12px;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 999px;
  overflow: hidden;
}

#clue-timer-bar {
  height: 100%;
  width: 100%;
  background: var(--gold-bright);
  transform-origin: left center;
}

#clue-timer-bar.low { background: var(--wrong); }

.answer {
  display: flex;
  gap: 0.6rem;
  width: min(100%, 900px);
  flex-wrap: wrap;
  justify-content: center;
}

.answer input {
  flex: 1;
  min-width: 12rem;
  background: rgba(0, 0, 0, 0.35);
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  color: var(--white);
  padding: 0.7rem 1rem;
  font-size: clamp(0.95rem, 2vw, 1.3rem);
}
.answer input:focus {
  outline: none;
  border-color: var(--gold-bright);
}
.answer input::placeholder { color: rgba(255, 255, 255, 0.45); }

.clue-screen .heard { color: rgba(255, 255, 255, 0.6); }

/* ----------------------------------------------------------------- verdict */

.verdict {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 31, 0.94);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  padding: 2rem;
}

.verdict-line {
  font-family: var(--display);
  text-transform: uppercase;
  font-size: clamp(1.6rem, 5vw, 3.5rem);
  margin: 0;
  letter-spacing: 0.04em;
}
.verdict-line.right { color: var(--right); }
.verdict-line.wrong { color: var(--wrong); }

.verdict-response {
  font-size: clamp(1rem, 2.4vw, 1.6rem);
  margin: 0;
  color: var(--white);
}
.verdict-response b { color: var(--gold-bright); }

.verdict-reason { color: var(--dim); font-size: 0.85rem; margin: 0; min-height: 1.2em; }
.verdict-actions { display: flex; gap: 0.6rem; margin-top: 0.5rem; flex-wrap: wrap; justify-content: center; }

/* ------------------------------------------------------------ wager, break */

.wager-screen, .break-screen { background: var(--board-blue); }

.wager-screen h2, .break-screen h2 {
  font-family: var(--display);
  text-transform: uppercase;
  font-size: clamp(1.4rem, 4.5vw, 3.2rem);
  margin: 0;
  text-shadow: 4px 4px 0 rgba(0, 0, 0, 0.85);
}

.wager-screen .subtitle, .break-screen .subtitle { color: rgba(255, 255, 255, 0.75); }

/* --------------------------------------------------------------- game over */

.final-score {
  font-family: var(--display);
  font-size: clamp(2.5rem, 10vw, 6rem);
  color: var(--gold-bright);
  margin: 0;
  text-shadow: 4px 4px 0 #000;
}
.final-score.negative { color: var(--wrong); }

.recap {
  width: min(100%, 900px);
  max-height: 40vh;
  overflow-y: auto;
  text-align: left;
  border-top: 1px solid #1a1f4a;
  font-size: 0.85rem;
}

.recap-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem 1rem;
  padding: 0.5rem 0.4rem;
  border-bottom: 1px solid #10142f;
}
.recap-row .cat { background: none; display: block; text-align: left; padding: 0; font-size: 0.7rem; color: var(--dim); text-shadow: none; }
.recap-row .given { color: var(--dim); }
.recap-row .given b { color: var(--white); font-weight: normal; }
.recap-delta { font-variant-numeric: tabular-nums; align-self: center; }
.recap-delta.pos { color: var(--right); }
.recap-delta.neg { color: var(--wrong); }
.recap-delta.zero { color: var(--dim); }

/* -------------------------------------------------------------- speech bar */

.speech-status {
  margin: 0;
  padding: 0.5rem 1rem;
  background: #131735;
  color: var(--gold-bright);
  font-size: 0.78rem;
  text-align: center;
  border-top: 1px solid #2a316b;
}
