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

:root {
  --blue-dark:  #010580;
  --blue-main:  #060CE9;
  --blue-hover: #1a24f0;
  --gold:       #D4A017;
  --gold-light: #f0c040;
  --black:      #000;
  --white:      #fff;
}

/* ── CRT bezel ── */
html {
  background: #07070f;
}

body {
  background: var(--blue-main);
  color: var(--white);
  font-family: 'Arial Black', Arial, sans-serif;
  min-height: 100vh;
  /* Phosphor color temperature */
  filter: contrast(1.06) brightness(0.91) saturate(1.12);
  /* Occasional flicker — mostly off, fires ~once every 8s */
  animation: crt-flicker 8s steps(1) infinite;
  /* Screen edge shadow */
  box-shadow:
    0 0 0 3px #12122a,
    0 0 55px rgba(10, 20, 180, 0.18),
    inset 0 0 90px rgba(0, 0, 0, 0.38);
}

@keyframes crt-flicker {
  0%, 93%, 95.5%, 100% { filter: contrast(1.06) brightness(0.91) saturate(1.12); }
  94%   { filter: contrast(1.08) brightness(0.76) saturate(1.12); }
  95%   { filter: contrast(1.06) brightness(0.91) saturate(1.12); }
}

/* Scanlines + vignette — single fixed overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent    0px,
      transparent    2px,
      rgba(0,0,0,0.18) 2px,
      rgba(0,0,0,0.18) 4px
    ),
    radial-gradient(
      ellipse 100% 100% at 50% 50%,
      transparent 38%,
      rgba(0, 0, 18, 0.72) 100%
    );
}

/* Phosphor noise grain */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 300px 300px;
}

/* ── Top strip (host card + scoreboard) — always above modal overlay ── */
#top-strip {
  position: relative;
  z-index: 25;
  background: #020a70;
  border-bottom: 3px solid var(--gold);
  display: flex;
  align-items: center;
  padding: 10px 16px;
  gap: 16px;
}

/* ── Host card (in scoreboard strip) ── */
#host-card {
  background: var(--blue-dark);
  border: 2px solid var(--gold);
  border-radius: 6px;
  padding: 10px 16px;
  text-align: center;
  min-width: 130px;
  max-width: 180px;
  box-shadow: 0 0 10px rgba(212, 160, 23, 0.2);
}

#host-speaker {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--gold);
  margin-bottom: 4px;
}

#host-line {
  font-size: 0.72rem;
  font-family: Arial, sans-serif;
  font-weight: normal;
  font-style: italic;
  color: #cce0ff;
  line-height: 1.35;
  min-height: 2.7em;
}

#host-portrait {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(212, 160, 23, 0.45);
}

#host-bubble {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

#host-speaker {
  font-size: 0.58rem;
  letter-spacing: 2.5px;
  color: var(--gold);
  text-transform: uppercase;
  text-shadow: 0 0 8px rgba(212, 160, 23, 0.5);
  flex-shrink: 0;
}

#host-line {
  font-size: 0.9rem;
  font-family: Arial, sans-serif;
  font-weight: normal;
  color: #dde8ff;
  font-style: italic;
  text-shadow: 0 0 6px rgba(150, 180, 255, 0.3);
  line-height: 1.35;
}

/* ── Header ── */
header {
  position: relative;
  z-index: 95;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 32px;
  background: var(--blue-dark);
  border-bottom: 4px solid var(--gold);
}

#header-btns {
  display: flex;
  gap: 10px;
  align-items: center;
}

#about-btn, #help-btn, #cheat-btn {
  background: transparent;
  border: 1px solid #667;
  color: #aab;
  font-size: 0.7rem;
  font-family: 'Arial Black', Arial, sans-serif;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

#about-btn:hover, #help-btn:hover, #cheat-btn:hover {
  color: #fff;
  border-color: #aab;
  background: rgba(255,255,255,0.07);
}

#help-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 96;
}

#help-modal {
  position: fixed;
  inset: 0;
  z-index: 97;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

#help-inner {
  background: var(--blue-dark);
  border: 2px solid var(--gold);
  border-radius: 10px;
  padding: 36px 40px;
  max-width: 560px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

#help-title {
  font-size: 1rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  text-align: center;
}

#help-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.help-section-title {
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold-light);
  margin-bottom: 5px;
}

.help-section p {
  font-size: 0.82rem;
  line-height: 1.65;
  color: #ccd;
  font-family: Arial, sans-serif;
  font-weight: normal;
}

.help-section p strong {
  color: #fff;
}

#help-close {
  background: transparent;
  border: 1px solid #556;
  color: #889;
  font-size: 0.75rem;
  font-family: 'Arial Black', Arial, sans-serif;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 8px 20px;
  border-radius: 4px;
  cursor: pointer;
  align-self: center;
  transition: color 0.2s, border-color 0.2s;
}

#help-close:hover { color: #fff; border-color: #aab; }

#about-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 96;
}

#about-modal {
  position: fixed;
  inset: 0;
  z-index: 97;
  display: flex;
  align-items: center;
  justify-content: center;
}

#about-inner {
  background: var(--blue-dark);
  border: 2px solid var(--gold);
  border-radius: 10px;
  padding: 36px 40px;
  max-width: 480px;
  width: 90%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

#about-title {
  font-size: 1rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  text-align: center;
}

#about-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #ccd;
}

#about-body a {
  color: var(--gold-light);
  text-decoration: none;
}

#about-body a:hover { text-decoration: underline; }

#about-tech {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
  border-top: 1px solid #334;
  padding-top: 14px;
}

.about-tech-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
}

.about-tech-label { color: #889; }

.about-tech-val {
  color: var(--gold-light);
  font-weight: bold;
}

#about-close {
  background: transparent;
  border: 1px solid #556;
  color: #889;
  font-size: 0.75rem;
  font-family: 'Arial Black', Arial, sans-serif;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 8px 20px;
  border-radius: 4px;
  cursor: pointer;
  align-self: center;
  transition: color 0.2s, border-color 0.2s;
}

#about-close:hover { color: #aaa; border-color: #888; }

#cheat-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 40;
}

#cheat-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}

#cheat-inner {
  background: var(--blue-dark);
  border: 2px solid #444;
  border-radius: 8px;
  padding: 32px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  min-width: 280px;
}

#cheat-title {
  font-size: 1rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #778;
  margin-bottom: 8px;
}

#cheat-double-jeopardy {
  background: var(--blue-main);
  color: var(--gold);
  border: 2px solid var(--gold);
  padding: 12px 28px;
  font-size: 1rem;
  font-family: 'Arial Black', Arial, sans-serif;
  letter-spacing: 1px;
  border-radius: 4px;
  cursor: pointer;
  width: 100%;
  transition: background 0.15s, color 0.15s;
}

#cheat-double-jeopardy:hover { background: var(--gold); color: var(--black); }

#cheat-final-jeopardy {
  background: var(--blue-main);
  color: var(--gold);
  border: 2px solid var(--gold);
  padding: 12px 28px;
  font-size: 1rem;
  font-family: 'Arial Black', Arial, sans-serif;
  letter-spacing: 1px;
  border-radius: 4px;
  cursor: pointer;
  width: 100%;
  transition: background 0.15s, color 0.15s;
}

#cheat-final-jeopardy:hover { background: var(--gold); color: var(--black); }

#cheat-end-game {
  background: #8b0000;
  color: var(--white);
  border: none;
  padding: 12px 28px;
  font-size: 1rem;
  font-family: 'Arial Black', Arial, sans-serif;
  letter-spacing: 1px;
  border-radius: 4px;
  cursor: pointer;
  width: 100%;
  transition: background 0.15s;
}

#cheat-end-game:hover { background: #b00000; }

#cheat-close {
  background: transparent;
  border: 1px solid #445;
  color: #778;
  padding: 8px 20px;
  font-size: 0.85rem;
  font-family: 'Arial Black', Arial, sans-serif;
  letter-spacing: 1px;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

#cheat-close:hover { color: #aac4ff; border-color: #aac4ff; }

/* ── Player Selection Modal ── */
#player-select-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 80;
}

#player-select-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
}

#player-select-inner {
  background: var(--blue-dark);
  border: 3px solid var(--gold);
  border-radius: 12px;
  padding: 36px 40px;
  max-width: 700px;
  width: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

#player-select-title {
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  letter-spacing: 4px;
  color: var(--gold);
  text-align: center;
}

#player-select-subtitle {
  font-size: 0.85rem;
  color: #aaa;
  letter-spacing: 1px;
  text-align: center;
  font-family: Arial, sans-serif;
  font-weight: normal;
}

#player-select-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  width: 100%;
}

.ps-card {
  background: var(--blue-main);
  border: 2px solid #334;
  border-radius: 8px;
  padding: 18px 20px;
  width: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  user-select: none;
}

.ps-card:hover {
  border-color: #667;
  transform: translateY(-2px);
}

.ps-card.ps-selected {
  border-color: var(--gold);
  background: #0a1060;
}

.ps-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  background: #0a1060;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  flex-shrink: 0;
}

.ps-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.ps-name {
  font-size: 0.9rem;
  letter-spacing: 1px;
  text-align: center;
}

.ps-stats {
  font-size: 0.72rem;
  color: #99a;
  text-align: center;
  font-family: Arial, sans-serif;
  font-weight: normal;
}

#player-select-start {
  background: var(--gold);
  color: var(--black);
  border: none;
  padding: 14px 48px;
  font-size: 1rem;
  font-family: 'Arial Black', Arial, sans-serif;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  margin-top: 4px;
}

#player-select-start:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

#player-select-start:not(:disabled):hover {
  background: var(--gold-light);
}

h1 {
  font-size: clamp(1.4rem, 4vw, 2.6rem);
  color: var(--gold);
  text-shadow:
    3px 3px 0 var(--black),
    -1px 0 rgba(255, 70, 70, 0.28),
    1px  0 rgba(70, 130, 255, 0.28),
    0 0 22px rgba(212, 160, 23, 0.55);
  letter-spacing: 6px;
}

/* ── Scoreboard ── */
#scoreboard {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  flex: 1;
}

.player-card {
  background: var(--blue-dark);
  border: 2px solid #1a3080;
  border-radius: 6px;
  padding: 10px 16px;
  text-align: center;
  min-width: 130px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.player-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  background: #0a1060;
  margin: 0 auto 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}

.player-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.player-card.human {
  border-color: #4466cc;
}

.player-card.leader {
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(212, 160, 23, 0.5);
}

.player-name {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #aac4ff;
  margin-bottom: 4px;
}

.player-card.human .player-name {
  color: #88aaff;
}

.player-score {
  font-size: 1.6rem;
  color: var(--gold);
  font-weight: 900;
  text-shadow: 0 0 10px rgba(212, 160, 23, 0.55), 0 0 22px rgba(212, 160, 23, 0.25);
}

.turn-label {
  font-size: 0.65rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: transparent;
  margin-top: 4px;
  transition: color 0.2s;
}

.player-card.active-turn {
  border-color: #fff;
  box-shadow: 0 0 14px rgba(255,255,255,0.25);
}

.player-card.active-turn .turn-label {
  color: #aac4ff;
}

/* ── Character reaction animations ── */
@keyframes card-buzz {
  0%   { transform: translateY(0)    scale(1);    }
  25%  { transform: translateY(-8px) scale(1.06); }
  60%  { transform: translateY(-4px) scale(1.04); }
  100% { transform: translateY(0)    scale(1);    }
}

@keyframes card-correct {
  0%   { transform: scale(1);    box-shadow: 0 0 0px rgba(76,175,80,0); }
  30%  { transform: scale(1.08); box-shadow: 0 0 22px rgba(76,175,80,0.85); }
  60%  { transform: scale(1.04); box-shadow: 0 0 14px rgba(76,175,80,0.55); }
  100% { transform: scale(1);    box-shadow: 0 0 0px rgba(76,175,80,0); }
}

@keyframes card-wrong {
  0%   { transform: translateX(0); }
  15%  { transform: translateX(-7px); }
  30%  { transform: translateX(7px);  }
  45%  { transform: translateX(-5px); }
  60%  { transform: translateX(5px);  }
  75%  { transform: translateX(-3px); }
  100% { transform: translateX(0); }
}

@keyframes avatar-correct {
  0%   { filter: brightness(1)   saturate(1); }
  35%  { filter: brightness(1.3) saturate(1.4) drop-shadow(0 0 8px #4caf50); }
  100% { filter: brightness(1)   saturate(1); }
}

@keyframes avatar-wrong {
  0%   { filter: brightness(1)   saturate(1); }
  35%  { filter: brightness(0.75) saturate(0.6) drop-shadow(0 0 8px #e53935); }
  100% { filter: brightness(1)   saturate(1); }
}

.player-card.react-buzz {
  animation: card-buzz 0.35s ease-out forwards;
}

.player-card.react-correct {
  animation: card-correct 0.55s ease-out forwards;
  border-color: #4caf50 !important;
}

.player-card.react-correct .player-avatar,
.player-card.react-correct .player-avatar-img {
  animation: avatar-correct 0.55s ease-out forwards;
}

.player-card.react-wrong {
  animation: card-wrong 0.5s ease-out forwards;
  border-color: #e53935 !important;
}

.player-card.react-wrong .player-avatar,
.player-card.react-wrong .player-avatar-img {
  animation: avatar-wrong 0.5s ease-out forwards;
}

/* ── Board ── */
#board {
  display: flex;
  flex-direction: row;
  gap: 5px;
  padding: 16px;
  max-width: 1300px;
  margin: 0 auto;
}

.category-col {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  gap: 5px;
  min-width: 0;
}

.cat-header {
  background: var(--blue-dark);
  border: 2px solid var(--black);
  padding: 10px 6px;
  text-align: center;
  font-size: clamp(0.65rem, 1.1vw, 0.95rem);
  text-transform: uppercase;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  text-shadow: 0 0 8px rgba(140, 180, 255, 0.45);
}

.clue-cell {
  background: var(--blue-dark);
  border: 2px solid var(--black);
  padding: 16px 6px;
  text-align: center;
  font-size: clamp(1.1rem, 2.2vw, 1.9rem);
  color: var(--gold);
  cursor: pointer;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, transform 0.08s;
  user-select: none;
  text-shadow: 0 0 10px rgba(212, 160, 23, 0.5), 0 0 22px rgba(212, 160, 23, 0.22);
}

.clue-cell:hover:not(.answered):not(.loading) {
  background: var(--blue-hover);
  transform: scale(1.03);
}

/* ── Mobile board ── */
@media (max-width: 640px) {
  #board {
    display: flex;
    flex-direction: row;
    overflow-x: scroll;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 0;
    padding: 0;
    scrollbar-width: none;
  }

  #board::-webkit-scrollbar { display: none; }

  .category-col {
    flex: 0 0 100vw;
    scroll-snap-align: start;
    padding: 10px 12px;
    gap: 10px;
    box-sizing: border-box;
  }

  .cat-header {
    font-size: 1rem;
    min-height: 60px;
    border-radius: 6px;
    letter-spacing: 2px;
  }

  .clue-cell {
    font-size: 2rem;
    min-height: 80px;
    border-radius: 6px;
    flex: 1;
  }

  /* dot indicators */
  #board-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 10px 0 6px;
  }

  .board-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #334;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
  }

  .board-dot.active {
    background: var(--gold);
    transform: scale(1.3);
  }
}

.clue-cell.answered {
  color: var(--blue-dark);
  cursor: default;
  pointer-events: none;
}

.clue-cell.loading {
  font-size: 0.9rem;
  color: #8899ff;
  cursor: wait;
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

@keyframes tile-reveal {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes ai-select-pulse {
  0%, 100% { background: var(--blue-dark); }
  50%       { background: #2a3fa0; border-color: var(--gold); }
}

.clue-cell.ai-selecting {
  animation: ai-select-pulse 0.35s ease-in-out 2 !important;
  border-color: var(--gold);
}

/* ── Loading screen ── */
#loading-screen {
  position: fixed;
  inset: 0;
  background: var(--blue-main);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease;
}

#loading-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

#loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  font-size: 1.1rem;
  color: #aac4ff;
  letter-spacing: 2px;
  text-transform: uppercase;
}

#loading-inner .spinner {
  width: 56px;
  height: 56px;
}

/* ── Overlay ── */
#overlay {
  position: fixed;
  top: var(--strip-top, 0px);
  left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.75);
  z-index: 10;
}

/* ── Modal ── */
#modal {
  position: fixed;
  top: var(--strip-top, 0px);
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

#modal-inner {
  background: var(--blue-dark);
  border: 4px solid var(--gold);
  border-radius: 8px;
  padding: 36px 40px;
  max-width: 680px;
  width: 100%;
  text-align: center;
  box-shadow: 0 8px 40px rgba(0,0,0,0.7);
}

.hidden { display: none !important; }

/* Phase: Daily Double bet */
#phase-bet {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding: 10px 0;
}

#daily-double-banner {
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--gold);
  text-shadow: 3px 3px 0 var(--black);
  letter-spacing: 4px;
  animation: dd-glow 0.7s ease-in-out infinite alternate;
}

@keyframes dd-glow {
  from { text-shadow: 3px 3px 0 #000, 0 0 16px rgba(212,160,23,0.45), -1px 0 rgba(255,60,60,0.2), 1px 0 rgba(60,110,255,0.2); }
  to   { text-shadow: 3px 3px 0 #000, 0 0 42px rgba(212,160,23,1.0), -1px 0 rgba(255,60,60,0.15), 1px 0 rgba(60,110,255,0.15); }
}

#bet-instruction {
  font-size: 0.95rem;
  color: #aac4ff;
  letter-spacing: 1px;
}

#bet-form {
  display: flex;
  gap: 12px;
  align-items: center;
}

#bet-input {
  background: #020a70;
  border: 2px solid var(--gold);
  border-radius: 4px;
  color: var(--white);
  font-size: 1.4rem;
  font-family: 'Arial Black', Arial, sans-serif;
  padding: 10px 14px;
  width: 160px;
  text-align: center;
}

#bet-input:focus { outline: none; border-color: var(--gold-light); }

#bet-submit-btn {
  background: var(--gold);
  color: var(--black);
  border: none;
  padding: 12px 28px;
  font-size: 1.1rem;
  font-family: 'Arial Black', Arial, sans-serif;
  font-weight: 900;
  letter-spacing: 2px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.12s, transform 0.08s;
}

#bet-submit-btn:hover { background: var(--gold-light); transform: scale(1.04); }

#ai-bet-display {
  font-size: 1.4rem;
  color: var(--gold);
  font-style: italic;
}

/* Persistent clue header */
#clue-header {
  margin-bottom: 24px;
}

#category-label {
  font-size: 0.9rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 14px;
}

#clue-text {
  font-size: clamp(1.1rem, 2.5vw, 1.6rem);
  line-height: 1.5;
  margin-bottom: 18px;
  font-family: Arial, sans-serif;
  font-weight: normal;
}

#clue-divider {
  border: none;
  border-top: 1px solid #1a3080;
}

/* Phase: Clue */


/* Buzz countdown bar */
#buzz-timer-track {
  height: 4px;
  background: #1a2060;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 24px;
}

#buzz-timer-bar {
  height: 100%;
  background: #ff6644;
  border-radius: 2px;
  transform-origin: left;
  transform: scaleX(0);
  will-change: transform;
}

#buzz-btn, #continue-btn {
  background: var(--gold);
  color: var(--black);
  border: none;
  padding: 16px 48px;
  font-size: 1.3rem;
  font-family: 'Arial Black', Arial, sans-serif;
  font-weight: 900;
  letter-spacing: 2px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.12s, transform 0.08s;
}

#buzz-btn:hover:not(.locked), #continue-btn:hover {
  background: var(--gold-light);
  transform: scale(1.04);
}

#buzz-btn.locked {
  background: #444;
  color: #888;
  cursor: not-allowed;
  transform: none;
}

/* Phase: Listen */
#phase-listen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.mic-icon {
  font-size: 2.4rem;
  animation: mic-pulse 0.8s ease-in-out infinite alternate;
}

@keyframes mic-pulse {
  from { transform: scale(1);    opacity: 1; }
  to   { transform: scale(1.15); opacity: 0.7; }
}

#listening-label {
  font-size: 1rem;
  color: #aac4ff;
  letter-spacing: 2px;
}

#countdown-ring {
  position: relative;
  width: 100px;
  height: 100px;
}

#countdown-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

#countdown-ring .bg {
  fill: none;
  stroke: #1a2060;
  stroke-width: 8;
}

#countdown-ring .fg {
  fill: none;
  stroke: var(--gold);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 276.5;  /* 2π×44 */
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke 0.3s;
}

#countdown-ring .fg.urgent {
  stroke: #ff4444;
}

#countdown-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 900;
  color: var(--white);
}

#transcript-display {
  font-size: 1.1rem;
  font-style: italic;
  color: #cce0ff;
  min-height: 28px;
  max-width: 480px;
}

/* Phase: Clarify */
#phase-clarify {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

#clarify-header {
  font-size: 1.6rem;
  color: var(--gold);
  letter-spacing: 2px;
}

#clarify-original {
  font-size: 0.95rem;
  color: #8899cc;
  font-style: italic;
  font-family: Arial, sans-serif;
}

#clarify-countdown-ring {
  position: relative;
  width: 100px;
  height: 100px;
}

#clarify-countdown-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

#clarify-countdown-ring .bg { fill: none; stroke: #1a2060; stroke-width: 8; }
#clarify-countdown-ring .fg {
  fill: none;
  stroke: var(--gold);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 276.5;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke 0.3s;
}
#clarify-countdown-ring .fg.urgent { stroke: #ff4444; }

#clarify-countdown-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 900;
}

#clarify-transcript-display {
  font-size: 1.1rem;
  font-style: italic;
  color: #cce0ff;
  min-height: 28px;
  max-width: 480px;
}

/* Phase: AI */
#phase-ai {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
}

#ai-buzz-name {
  font-size: 1.6rem;
  color: var(--gold);
  letter-spacing: 2px;
}

#ai-buzz-status {
  font-size: 1rem;
  color: #aac4ff;
}

#ai-answer-reveal {
  font-size: 1.3rem;
  font-style: italic;
  color: var(--white);
  font-family: Arial, sans-serif;
}

/* Phase: Judging */
#phase-judging {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 20px 0;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 5px solid #1a2060;
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Phase: Result */
#phase-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

#result-badge {
  font-size: 4rem;
  line-height: 1;
}

#result-message {
  font-size: 1.2rem;
  font-family: Arial, sans-serif;
  line-height: 1.4;
  max-width: 480px;
}

#correct-answer-reveal {
  font-size: 1rem;
  color: #aac4ff;
  font-family: Arial, sans-serif;
}

/* ── Game Over / Breakdown ── */
#game-over {
  position: fixed;
  inset: 0;
  background: var(--blue-main);
  z-index: 30;
  overflow-y: auto;
  padding: 32px 16px;
}

#breakdown-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
}

#breakdown-winner {
  text-align: center;
  font-size: clamp(2rem, 5vw, 3.2rem);
  color: var(--gold);
  text-shadow:
    3px 3px 0 var(--black),
    -1px 0 rgba(255, 70, 70, 0.25),
    1px  0 rgba(70, 130, 255, 0.25),
    0 0 24px rgba(212, 160, 23, 0.55);
  letter-spacing: 3px;
}

#breakdown-winner-score {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  color: var(--white);
  margin-top: 6px;
  letter-spacing: 2px;
}

#breakdown-players {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  width: 100%;
}

.bd-player-card {
  background: var(--blue-dark);
  border: 2px solid #1a3080;
  border-radius: 8px;
  padding: 20px 24px;
  min-width: 200px;
  flex: 1 1 200px;
  max-width: 260px;
}

.bd-player-card.bd-winner {
  border-color: var(--gold);
  box-shadow: 0 0 18px rgba(212,160,23,0.45);
}

.bd-name {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #aac4ff;
  margin-bottom: 4px;
}

.bd-score {
  font-size: 2rem;
  color: var(--gold);
  font-weight: 900;
  margin-bottom: 14px;
}

.bd-stat {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-family: Arial, sans-serif;
  color: #cce0ff;
  padding: 4px 0;
  border-top: 1px solid #1a3080;
}

.bd-stat span:last-child {
  font-weight: bold;
  color: var(--white);
}

#breakdown-highlights {
  width: 100%;
  text-align: center;
}

.bd-highlight-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: #7788bb;
  margin-bottom: 16px;
}

#bd-highlight-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.bd-highlight {
  background: var(--blue-dark);
  border: 1px solid #1a3080;
  border-radius: 6px;
  padding: 14px 20px;
  min-width: 140px;
}

.bd-hl-val {
  font-size: 1.4rem;
  color: var(--gold);
  font-weight: 900;
  margin-bottom: 4px;
}

.bd-hl-label {
  font-size: 0.78rem;
  font-family: Arial, sans-serif;
  color: #aac4ff;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#play-again-btn {
  background: var(--gold);
  color: var(--black);
  border: none;
  padding: 16px 52px;
  font-size: 1.3rem;
  font-family: 'Arial Black', Arial, sans-serif;
  font-weight: 900;
  letter-spacing: 2px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.12s, transform 0.08s;
}

#play-again-btn:hover {
  background: var(--gold-light);
  transform: scale(1.04);
}

/* ── Double Jeopardy transition ── */
#dj-transition {
  position: fixed;
  inset: 0;
  background: var(--blue-dark);
  z-index: 35;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 80px 20px 20px;
  animation: fj-fade-in 0.5s ease-out;
}

#dj-banner { font-size: clamp(2rem, 5vw, 3.2rem); }

#dj-subtitle {
  font-size: 1rem;
  color: #aac4ff;
  letter-spacing: 3px;
  text-transform: uppercase;
}

#dj-scores {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
  min-width: 260px;
}

.dj-score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
  padding: 8px 16px;
  background: rgba(0,0,0,0.25);
  border-radius: 4px;
  border-left: 3px solid transparent;
}

.dj-score-row.dj-last { border-left-color: var(--gold); }

.dj-sr-name  { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 2px; color: #aac4ff; }
.dj-sr-score { font-size: 1.2rem; color: var(--gold); font-weight: 900; }

/* ── Final Jeopardy ── */
#fj-screen {
  position: fixed;
  inset: 0;
  background: var(--blue-dark);
  z-index: 35;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 20px 20px;
  overflow-y: auto;
}

.fj-phase {
  width: 100%;
  max-width: 860px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.fj-logo {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: var(--gold);
  letter-spacing: 6px;
  text-shadow: 3px 3px 0 var(--black), 0 0 24px rgba(212,160,23,0.5);
  animation: fj-glow 1.2s ease-in-out infinite alternate;
}

@keyframes fj-glow {
  from { text-shadow: 3px 3px 0 #000, 0 0 12px rgba(212,160,23,0.4), -1px 0 rgba(255,60,60,0.18), 1px 0 rgba(60,110,255,0.18); }
  to   { text-shadow: 3px 3px 0 #000, 0 0 36px rgba(212,160,23,0.9), -1px 0 rgba(255,60,60,0.12), 1px 0 rgba(60,110,255,0.12); }
}

/* Phase 1: reveal */
#fj-reveal-cat {
  font-size: clamp(2rem, 5vw, 3.5rem);
  color: var(--white);
  text-align: center;
  letter-spacing: 3px;
  animation: fj-fade-in 0.7s ease-out;
}

#fj-reveal-sub {
  font-size: 0.9rem;
  color: #778;
  letter-spacing: 3px;
  text-transform: uppercase;
}

@keyframes fj-fade-in {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

/* Phase 2: wager */
#fj-wager-cat {
  font-size: clamp(1.3rem, 3vw, 2rem);
  color: var(--gold-light);
  text-align: center;
  letter-spacing: 2px;
}

#fj-wager-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.fj-wager-card {
  background: rgba(0,0,0,0.3);
  border: 2px solid #2a3a80;
  border-radius: 8px;
  padding: 16px 22px;
  text-align: center;
  min-width: 140px;
  transition: border-color 0.4s;
}

.fj-wager-card.human-card { border-color: #4466cc; }

.fj-wager-card .wc-name  { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 2px; color: #aac4ff; margin-bottom: 6px; }
.fj-wager-card .wc-score { font-size: 1.5rem; color: var(--gold); font-weight: 900; margin-bottom: 10px; }
.fj-wager-card .wc-wager { font-size: 0.95rem; color: #667; min-height: 1.4em; transition: color 0.3s; }
.fj-wager-card .wc-wager.locked { color: var(--gold-light); }

#fj-human-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

#fj-wager-instr {
  font-size: 0.9rem;
  color: #aac4ff;
  letter-spacing: 1px;
  text-align: center;
}

#fj-wager-input {
  background: #020a70;
  border: 2px solid var(--gold);
  border-radius: 4px;
  color: var(--white);
  font-size: 1.4rem;
  font-family: 'Arial Black', Arial, sans-serif;
  padding: 10px 16px;
  width: 200px;
  text-align: center;
}

#fj-wager-input:focus { outline: none; border-color: var(--gold-light); }

#fj-wager-btn {
  background: var(--gold);
  color: var(--black);
  border: none;
  padding: 14px 36px;
  font-size: 1.1rem;
  font-family: 'Arial Black', Arial, sans-serif;
  font-weight: 900;
  letter-spacing: 2px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.12s, transform 0.08s;
}

#fj-wager-btn:hover { background: var(--gold-light); transform: scale(1.04); }

/* Phase 3: clue */
#fj-clue-cat {
  font-size: 1rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 4px;
  text-align: center;
}

#fj-clue-text {
  font-size: clamp(1.1rem, 2.4vw, 1.6rem);
  font-family: Arial, sans-serif;
  font-weight: normal;
  line-height: 1.6;
  text-align: center;
  max-width: 720px;
  min-height: 4em;
}

#fj-clue-timer-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 540px;
}

#fj-timer-track {
  flex: 1;
  height: 6px;
  background: #1a2060;
  border-radius: 3px;
  overflow: hidden;
}

#fj-timer-bar {
  height: 100%;
  background: var(--gold);
  border-radius: 3px;
  transform-origin: left;
  transform: scaleX(1);
  will-change: transform;
}

#fj-timer-num {
  font-size: 1.6rem;
  color: var(--gold);
  font-weight: 900;
  min-width: 2.5rem;
  text-align: right;
}

#fj-clue-status {
  font-size: 0.9rem;
  color: #8899cc;
  letter-spacing: 1px;
  text-align: center;
}

#fj-clue-transcript {
  font-size: 1.2rem;
  font-style: italic;
  color: #cce0ff;
  min-height: 1.6em;
  text-align: center;
  max-width: 600px;
  font-family: Arial, sans-serif;
}

/* Phase 4: answer reveal */
#fj-answer-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}

.fj-ans-card {
  background: #020a60;
  border: 2px solid #2a3a80;
  border-radius: 8px;
  padding: 18px 22px;
  text-align: center;
  min-width: 160px;
  flex: 1 1 160px;
  max-width: 200px;
  transition: border-color 0.4s, transform 0.25s, box-shadow 0.25s;
}

.fj-ans-card.active {
  border-color: var(--gold);
  transform: scale(1.06);
  box-shadow: 0 0 18px rgba(212,160,23,0.5);
}

.fj-ans-card.fj-correct { border-color: #4caf50; }
.fj-ans-card.fj-wrong   { border-color: #e53935; }

.fj-ans-card .ac-name   { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 2px; color: #aac4ff; margin-bottom: 6px; }
.fj-ans-card .ac-score  { font-size: 1.5rem; color: var(--gold); font-weight: 900; margin-bottom: 6px; transition: color 0.3s; }
.fj-ans-card .ac-wager  { font-size: 0.8rem; color: #667; margin-bottom: 10px; }
.fj-ans-card .ac-answer { font-size: 0.9rem; font-style: italic; color: #cce0ff; font-family: Arial, sans-serif; min-height: 2em; line-height: 1.4; }
.fj-ans-card .ac-result { font-size: 1rem; font-weight: 900; margin-top: 8px; min-height: 1.4em; }

#fj-answer-correct {
  font-size: 1rem;
  color: #aac4ff;
  font-family: Arial, sans-serif;
  text-align: center;
  min-height: 1.4em;
}

#fj-continue-btn {
  background: var(--gold);
  color: var(--black);
  border: none;
  padding: 16px 52px;
  font-size: 1.2rem;
  font-family: 'Arial Black', Arial, sans-serif;
  font-weight: 900;
  letter-spacing: 2px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.12s, transform 0.08s;
}

#fj-continue-btn:hover { background: var(--gold-light); transform: scale(1.04); }
