/* Jamboozle brand tokens (jamboozle-brand-kit/source/build.py). */
:root {
  --navy: #081638;
  --navy-raised: #12245a;
  --yellow: #ffc629;
  --ivory: #fff9ee;
  --teal: #00c9c9;
  --tangerine: #ff7029;
  --muted: #b9c2dd;
  --radius: 16px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--navy);
  color: var(--ivory);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.4;
}

[hidden] {
  display: none !important;
}

.status {
  position: fixed;
  inset: 0 0 auto;
  padding: 8px 16px;
  background: var(--tangerine);
  color: var(--navy);
  font-weight: 700;
  text-align: center;
}

.wordmark {
  display: block;
  height: auto;
}

.player {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--navy-raised);
  animation: pop-in 300ms ease-out;
}

.player.offline,
.player.away {
  opacity: 0.55;
}

.player.me {
  outline: 2px solid var(--yellow);
}

.tag {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--teal);
  color: var(--navy);
  font-size: 0.75em;
  font-weight: 700;
}

.player.settled {
  animation: none;
}

@keyframes pop-in {
  from {
    transform: scale(0.85);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .player {
    animation: none;
  }
}

/* The TV: readable from the sofa. */
.tv {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 4vw;
  padding: 5vh 5vw;
  min-height: 100vh;
  font-size: clamp(16px, 1.6vw, 40px);
}

.tv .wordmark {
  width: min(32vw, 640px);
  margin-bottom: 4vh;
}

.tv .join-card {
  display: flex;
  flex-direction: column;
  gap: 2vh;
}

.tv .qr {
  width: min(24vw, 420px);
  aspect-ratio: 1;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--ivory);
}

.tv .code {
  font-size: 3.2em;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: var(--yellow);
}

.tv .link {
  color: var(--muted);
  word-break: break-all;
}

.tv .players {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11em, 1fr));
  gap: 12px;
  align-content: start;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tv h2 {
  margin: 0 0 2vh;
  color: var(--teal);
}

.tv .message {
  grid-column: 1 / -1;
  text-align: center;
  align-self: center;
}

/* The phone: one column, big targets. */
.phone {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.phone .wordmark {
  width: 70%;
  margin: 8px auto 24px;
}

.phone #join,
.phone section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.phone label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
}

.phone input[type="text"] {
  padding: 14px 16px;
  border: 2px solid var(--navy-raised);
  border-radius: var(--radius);
  background: var(--ivory);
  color: var(--navy);
  font-size: 1.2rem;
}

.phone input[type="text"]:focus {
  outline: 3px solid var(--yellow);
}

.phone button {
  padding: 16px;
  border: 0;
  border-radius: var(--radius);
  background: var(--yellow);
  color: var(--navy);
  font-size: 1.2rem;
  font-weight: 800;
}

.phone .toggle {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--navy-raised);
}

.phone .toggle input {
  width: 28px;
  height: 28px;
  accent-color: var(--teal);
}

.phone .error {
  min-height: 1.4em;
  color: var(--tangerine);
  font-weight: 600;
}

.phone .note {
  color: var(--muted);
}

.phone .players {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Shared layout helpers. */
.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.phone select,
.phone input[type="password"],
.phone input[type="number"],
.phone .prompt input {
  padding: 14px 16px;
  border: 2px solid var(--navy-raised);
  border-radius: var(--radius);
  background: var(--ivory);
  color: var(--navy);
  font-size: 1.2rem;
}

.phone fieldset {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 14px;
  border: 2px solid var(--navy-raised);
  border-radius: var(--radius);
}

.phone legend {
  padding: 0 6px;
  font-weight: 700;
}

.phone .toggle input[type="radio"] {
  width: 24px;
  height: 24px;
  accent-color: var(--teal);
}

.phone .prompt {
  padding: 16px;
  border-radius: var(--radius);
  background: var(--navy-raised);
}

.phone .prompt-text {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.phone button:disabled {
  opacity: 0.5;
}

.tv h2 + .qr {
  margin-top: 0;
}

/* The show on the TV. */
.tv .show {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
  gap: 4vw;
}

.tv .stage {
  display: flex;
  flex-direction: column;
  gap: 2vh;
}

.tv .stage p {
  margin: 0;
}

.tv .stage-title {
  margin: 0;
  font-size: 2.4em;
  line-height: 1.15;
}

.tv .eyebrow {
  color: var(--teal);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tv .options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 1.4em;
}

.tv .options li {
  padding: 18px 22px;
  border-radius: var(--radius);
  background: var(--navy-raised);
}

.tv .options b {
  color: var(--yellow);
}

.tv .meta,
.tv .hint {
  color: var(--muted);
}

.tv .countdown {
  color: var(--yellow);
  font-size: 1.6em;
  font-weight: 800;
}

.tv .answer,
.tv .big {
  font-size: 1.6em;
  font-weight: 700;
  color: var(--yellow);
}

.tv .jam {
  padding: 12px 18px;
  border-radius: var(--radius);
  background: var(--yellow);
  color: var(--navy);
  font-size: 1.4em;
  font-weight: 800;
}

.tv .awards,
.tv .reveal,
.tv .vaults,
.tv .scores {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tv .reveal li,
.tv .vaults li {
  padding: 10px 16px;
  border-radius: var(--radius);
  background: var(--navy-raised);
  font-size: 1.2em;
}

.tv .caught {
  background: var(--tangerine) !important;
  color: var(--navy);
  font-weight: 700;
}

.tv .vaults .champion {
  background: var(--yellow);
  color: var(--navy);
  font-size: 1.6em;
  font-weight: 800;
}

.tv .scoreboard h2 {
  margin-bottom: 0;
}

.tv .score {
  display: grid;
  grid-template-columns: 2em 1fr auto;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: var(--navy-raised);
}

.tv .score .rank {
  color: var(--yellow);
  font-weight: 800;
}

.tv .score .points {
  color: var(--muted);
}

/* Playing on the phone. */
.phone .option {
  background: var(--navy-raised);
  color: var(--ivory);
  text-align: left;
  border: 2px solid transparent;
}

.phone .option.chosen {
  border-color: var(--yellow);
  background: var(--yellow);
  color: var(--navy);
}

.phone .option.quiet {
  background: transparent;
  border-color: var(--navy-raised);
}

.phone .big-note {
  margin: 24px 0;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
}

.phone .countdown {
  color: var(--yellow);
  font-weight: 800;
}

/* The join panel the TV keeps in the corner during the show. */
.tv .join-badge {
  position: fixed;
  right: 2vw;
  bottom: 2vh;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--navy-raised);
  font-size: 0.8em;
}

.tv .badge-qr {
  width: 7em;
  aspect-ratio: 1;
  padding: 4px;
  border-radius: 8px;
  background: var(--ivory);
}

.tv .badge-label {
  color: var(--teal);
  font-weight: 700;
}

.tv .badge-code {
  color: var(--yellow);
  font-size: 2em;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.tv .badge-link {
  color: var(--muted);
}

.phone .host-hint {
  margin-top: 32px;
  text-align: center;
}

.phone .host-hint a {
  color: var(--yellow);
  font-weight: 700;
}

/* The TV start screen: what a host types when they can't scan. */
.tv .setup-codes {
  display: flex;
  gap: 4vw;
}

.tv .setup-codes .code {
  font-size: 2.4em;
}

.phone .host-hint details {
  margin-top: 16px;
  text-align: left;
}

.phone .host-hint summary {
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--navy-raised);
  font-weight: 700;
  cursor: pointer;
}

.phone .host-hint form {
  margin-top: 14px;
}

/* The start screen fits on one screen: a smaller host QR code leaves room for the codes. */
.tv #start .wordmark {
  width: min(24vw, 480px);
  margin-bottom: 1vh;
}

.tv #start .qr {
  width: min(20vw, 36vh);
}

.tv #start .note {
  color: var(--muted);
}

.tv #start {
  grid-column: 1 / -1;
  gap: 1.5vh;
}

/* After the awards: start a new show. */
.tv .new-show {
  position: fixed;
  left: 50%;
  bottom: 4vh;
  transform: translateX(-50%);
  padding: 16px 32px;
  border: 0;
  border-radius: var(--radius);
  background: var(--yellow);
  color: var(--navy);
  font-size: 1.2em;
  font-weight: 800;
  cursor: pointer;
}

.phone .button-link {
  display: block;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--yellow);
  color: var(--navy);
  font-size: 1.2rem;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

/* Teams (GDD 4). */
.tv .team-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2vw;
}

.tv .team-card {
  padding: 18px 22px;
  border-radius: var(--radius);
  background: var(--navy-raised);
  font-size: 1.3em;
}

.tv .team-card h2 {
  margin: 0 0 8px;
  color: var(--yellow);
}

/* Survey Showdown (GDD 6). */
.tv .survey-teams {
  display: flex;
  gap: 16px;
}

.tv .survey-team {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  border: 3px solid transparent;
  border-radius: var(--radius);
  background: var(--navy-raised);
}

.tv .survey-team.control {
  border-color: var(--yellow);
}

.tv .survey-team.acting {
  background: var(--teal);
  color: var(--navy);
}

.tv .strikes {
  color: var(--tangerine);
  font-weight: 800;
  letter-spacing: 0.2em;
}

.tv .survey-team.acting .strikes {
  color: var(--navy);
}

.tv .board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-flow: column;
  grid-template-rows: repeat(4, auto);
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 1.25em;
}

.tv .tile {
  display: grid;
  grid-template-columns: 1.6em 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 2.4em;
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--navy-raised);
}

.tv .tile.revealed {
  background: var(--yellow);
  color: var(--navy);
  font-weight: 800;
}

.tv .tile.flipped {
  background: var(--navy-raised);
  color: var(--muted);
}

.tv .tile.fresh {
  animation: flip-in 400ms ease-out;
}

.tv .tile.frozen {
  background: #3a4a7a;
  color: var(--muted);
  text-decoration: line-through;
}

.tv .tile-number {
  color: var(--teal);
  font-weight: 800;
}

.tv .tile.revealed .tile-number {
  color: var(--navy);
}

.tv .tile-value {
  font-weight: 800;
}

.tv .bank {
  margin: 0;
  color: var(--yellow);
  font-size: 1.4em;
  font-weight: 800;
}

.tv .hit {
  color: var(--yellow);
  font-size: 1.3em;
  font-weight: 800;
}

.tv .strike {
  color: var(--tangerine);
  font-size: 1.3em;
  font-weight: 800;
}

@keyframes flip-in {
  from {
    transform: rotateX(90deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tv .tile.fresh {
    animation: none;
  }
}

.phone .buzz {
  padding: 48px 16px;
  background: var(--tangerine);
  font-size: 2rem;
}
