/* ===== TV Display Styles ===== */
/* Optimized for large screen presentation - no controls, larger fonts */

/* ===== CSS Variables ===== */
:root {
  --jeopardy-blue: #060CE9;
  --jeopardy-blue-dark: #04098B;
  --jeopardy-blue-light: #1E24FF;
  --jeopardy-gold: #D4A843;
  --jeopardy-gold-light: #E8C66A;
  --white: #FFFFFF;
  --black: #000000;
  --gray: #666666;
  --gray-light: #CCCCCC;
  --correct-green: #28a745;
  --wrong-red: #dc3545;

  --font-logo: 'Michroma', sans-serif;
  --font-sans: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  --shadow-heavy: 0 8px 16px rgba(0, 0, 0, 0.4);
}

/* ===== Audio Prompt ===== */
.audio-prompt {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: var(--jeopardy-gold);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 1rem;
  z-index: 1000;
  cursor: pointer;
  border: 1px solid var(--jeopardy-gold);
  animation: pulse-prompt 2s ease-in-out infinite;
}

.audio-prompt.hidden {
  display: none;
}

@keyframes pulse-prompt {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

/* ===== Reset & Base ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-sans);
  background: linear-gradient(135deg, var(--jeopardy-blue-dark) 0%, var(--jeopardy-blue) 100%);
  color: var(--white);
}

/* ===== Screen Management ===== */
.screen {
  display: none;
  width: 100%;
  height: 100%;
  padding: 1.5rem;
  overflow: hidden;
}

.screen.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ===== Waiting Screen ===== */
#waiting-screen {
  text-align: center;
}

.waiting-message {
  font-size: 2rem;
  color: var(--gray-light);
  animation: pulse 2s ease-in-out infinite;
}

/* ===== Game Title ===== */
.game-title {
  font-family: var(--font-logo);
  font-size: 4rem;
  color: var(--jeopardy-gold);
  text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.5);
  margin-bottom: 2rem;
  text-align: center;
  letter-spacing: 0.1em;
}

/* ===== Board Screen ===== */
#board-screen {
  justify-content: flex-start;
  padding: 1rem 2rem;
}

.board-header {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 1400px;
  margin-bottom: 1rem;
}

.board-title {
  font-family: var(--font-logo);
  font-size: 2.5rem;
  color: var(--jeopardy-gold);
  text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
  letter-spacing: 0.1em;
}

/* ===== Game Board ===== */
.game-board {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  width: 100%;
  max-width: 1400px;
  flex: 1;
  min-height: 0;
}

.category-header {
  background: var(--jeopardy-blue);
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 1.4rem;
  font-weight: 700;
  text-transform: uppercase;
  text-align: center;
  padding: 0.75rem 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  border: 3px solid var(--jeopardy-blue-dark);
  min-height: 90px;
}

.tile {
  background: var(--jeopardy-blue);
  color: var(--jeopardy-gold);
  font-family: var(--font-sans);
  font-size: 2.75rem;
  font-weight: bold;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--jeopardy-blue-dark);
  text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
  min-height: 90px;
}

.tile.answered {
  background: var(--jeopardy-blue-dark);
  color: transparent;
}

/* ===== Scoreboard ===== */
.scoreboard {
  display: flex;
  justify-content: center;
  gap: 2rem;
  width: 100%;
  max-width: 1400px;
  margin-top: 1rem;
}

.player-score-card {
  background: rgba(0, 0, 0, 0.4);
  padding: 1rem 2rem;
  border-radius: 12px;
  text-align: center;
  min-width: 250px;
}

.player-name {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.player-score-value {
  font-size: 3rem;
  font-weight: bold;
  color: var(--jeopardy-gold);
}

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

/* ===== Question Screen ===== */
#question-screen {
  justify-content: center;
}

.question-container {
  background: var(--jeopardy-blue);
  border: 6px solid var(--jeopardy-gold);
  border-radius: 20px;
  padding: 3rem;
  max-width: 1200px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-heavy);
}

.question-header {
  margin-bottom: 2rem;
}

.question-category {
  font-family: var(--font-sans);
  font-size: 2rem;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.75rem;
}

.question-value {
  font-size: 3rem;
  font-weight: bold;
  color: var(--jeopardy-gold);
}

.question-text {
  font-family: var(--font-sans);
  font-size: 3.5rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 2rem;
  text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
}

.answer-text {
  font-family: var(--font-sans);
  font-size: 3rem;
  font-weight: 700;
  color: var(--jeopardy-gold);
  margin-top: 2rem;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 12px;
}

.buzzer-status {
  font-size: 2rem;
  font-weight: bold;
  margin-top: 2rem;
  padding: 1rem 2rem;
  border-radius: 8px;
}

.buzzer-status.enabled {
  background: var(--correct-green);
  color: var(--white);
}

.buzzer-status.winner {
  background: var(--jeopardy-gold);
  color: var(--black);
}

/* ===== Daily Double Screen ===== */
#daily-double-screen {
  justify-content: center;
}

.daily-double-container {
  text-align: center;
}

.daily-double-title {
  font-family: var(--font-logo);
  font-size: 5rem;
  color: var(--jeopardy-gold);
  text-shadow: 6px 6px 12px rgba(0, 0, 0, 0.5);
  animation: pulse 1s ease-in-out infinite alternate;
  margin-bottom: 2rem;
  letter-spacing: 0.1em;
}

@keyframes pulse {
  from { transform: scale(1); }
  to { transform: scale(1.05); }
}

.dd-player-name {
  font-size: 3rem;
  color: var(--jeopardy-gold);
  margin-bottom: 1rem;
}

.dd-wager-amount {
  font-size: 2.5rem;
  color: var(--white);
}

/* ===== DD Timer ===== */
.dd-timer {
  font-size: 6rem;
  font-weight: bold;
  color: var(--jeopardy-gold);
  font-family: var(--font-logo);
  text-align: center;
  margin: 1rem 0;
}

.dd-timer.hidden {
  display: none;
}

.dd-timer.urgent {
  color: #ff4444;
  animation: pulse 0.5s ease-in-out infinite alternate;
}

/* ===== Stats Recap Screen (TV) ===== */
#stats-recap-screen {
  justify-content: center;
  align-items: center;
}

.stats-recap-container {
  width: 100%;
  max-width: 1400px;
  text-align: center;
  padding: 2rem;
}

.stats-title {
  font-family: var(--font-logo);
  font-size: 4rem;
  color: var(--jeopardy-gold);
  text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.5);
  margin-bottom: 2rem;
  letter-spacing: 0.1em;
}

.tv-player-stats {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.tv-player-stat-card {
  background: rgba(0, 0, 0, 0.4);
  padding: 1.5rem 2rem;
  border-radius: 16px;
  min-width: 300px;
  flex: 1;
  max-width: 400px;
}

.tv-player-stat-card .player-name {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 1rem;
  color: var(--jeopardy-gold);
}

.tv-player-stat-card .player-score-big {
  font-size: 3.5rem;
  font-weight: bold;
  color: var(--white);
  margin-bottom: 1.5rem;
}

.tv-player-stat-card .player-score-big.negative {
  color: var(--wrong-red);
}

.tv-player-stat-card .stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 1.25rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tv-player-stat-card .stat-row:last-child {
  border-bottom: none;
}

.tv-player-stat-card .stat-row .label {
  color: var(--gray-light);
}

.tv-player-stat-card .stat-row .value {
  font-weight: bold;
}

.tv-player-stat-card .stat-row .value.positive {
  color: var(--correct-green);
}

.tv-player-stat-card .stat-row .value.negative {
  color: var(--wrong-red);
}

.tv-game-stats {
  display: flex;
  gap: 3rem;
  justify-content: center;
  flex-wrap: wrap;
  padding: 1.5rem 2rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 16px;
  max-width: 800px;
  margin: 0 auto;
}

.tv-game-stats .stat-item {
  text-align: center;
}

.tv-game-stats .stat-label {
  display: block;
  font-size: 1.1rem;
  color: var(--gray-light);
  margin-bottom: 0.5rem;
}

.tv-game-stats .stat-value {
  display: block;
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--jeopardy-gold);
}

/* ===== Final Jeopardy Screens ===== */
#fj-category-screen,
#fj-question-screen,
#fj-scoring-screen {
  justify-content: center;
}

.final-container {
  text-align: center;
  width: 100%;
  max-width: 1200px;
}

.fj-title {
  font-family: var(--font-logo);
  font-size: 4rem;
  color: var(--jeopardy-gold);
  text-shadow: 5px 5px 10px rgba(0, 0, 0, 0.5);
  margin-bottom: 1.5rem;
  letter-spacing: 0.1em;
}

.fj-label {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

.fj-category {
  font-family: var(--font-sans);
  font-size: 3rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 2rem;
  padding: 1.5rem 3rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  display: inline-block;
}

.fj-question-category {
  font-family: var(--font-sans);
  font-size: 2rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.fj-question-text {
  font-family: var(--font-sans);
  font-size: 3rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 2rem;
  padding: 2rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
}

.fj-timer {
  margin-bottom: 2rem;
}

#fj-timer-display {
  font-size: 8rem;
  font-weight: bold;
  color: var(--jeopardy-gold);
  font-family: var(--font-sans);
}

.fj-answer-text {
  font-family: var(--font-sans);
  font-size: 3rem;
  font-weight: 700;
  color: var(--jeopardy-gold);
  margin-top: 2rem;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
}

/* ===== FJ Scoring Container ===== */
.fj-scoring-container {
  text-align: center;
  width: 100%;
  max-width: 1400px;
  padding: 1rem;
}

.fj-scoring-question {
  font-family: var(--font-sans);
  font-size: 2.25rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 1.5rem;
  padding: 1.5rem 2rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
}

.fj-scoring-answer {
  font-family: var(--font-sans);
  font-size: 2rem;
  font-weight: 700;
  color: var(--jeopardy-gold);
  margin-bottom: 1.5rem;
  padding: 1rem 2rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  display: inline-block;
}

.fj-scoring-answer.hidden {
  display: none;
}

/* ===== FJ Scoring Cards ===== */
.fj-scoring {
  display: flex;
  gap: 2rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.fj-score-card {
  background: rgba(0, 0, 0, 0.3);
  padding: 1.5rem 2rem;
  border-radius: 12px;
  min-width: 280px;
  text-align: center;
  transition: all 0.3s ease;
}

.fj-score-card .player-name-label {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 0.75rem;
}

.fj-score-card .wager-display {
  font-size: 1.25rem;
  color: var(--gray-light);
  margin-bottom: 0.5rem;
}

/* Player answer in handwritten Caveat font */
.fj-score-card .player-answer {
  font-family: 'Caveat', cursive;
  font-size: 2.25rem;
  color: var(--white);
  margin: 0.75rem 0;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  min-height: 60px;
  overflow: hidden;
  position: relative;
}

.fj-score-card .player-answer.hidden-answer {
  color: transparent;
  background: rgba(255, 255, 255, 0.05);
}

.fj-score-card .player-answer.hidden-answer::after {
  content: "???";
  color: var(--gray);
  font-family: var(--font-sans);
  font-size: 1.5rem;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Wager display with wipe animation support - same styling as answer */
.fj-score-card .wager-display {
  font-family: var(--font-sans);
  font-size: 1.75rem;
  color: var(--white);
  margin: 0.5rem 0;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.fj-score-card .wager-display.hidden-wager {
  display: none;
}

.fj-score-card .new-score.hidden-score {
  display: none;
}

.fj-score-card .new-score {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--jeopardy-gold);
  margin-top: 0.75rem;
}

.fj-score-card.correct {
  border: 3px solid var(--correct-green);
}

.fj-score-card.wrong {
  border: 3px solid var(--wrong-red);
}

.fj-score-card.ineligible {
  opacity: 0.5;
}

.fj-score-card .new-score.negative {
  color: #ff4444;
}

/* Wipe from center outward animation */
.wipe-reveal {
  animation: wipe-from-center 0.6s ease-out forwards;
}

@keyframes wipe-from-center {
  0% {
    clip-path: inset(0 50% 0 50%);
    opacity: 0.5;
  }
  100% {
    clip-path: inset(0 0 0 0);
    opacity: 1;
  }
}

/* Container for wipe effect */
.reveal-wrapper {
  position: relative;
  overflow: hidden;
}

/* ===== Winner Screen ===== */
#winner-screen {
  justify-content: center;
}

.winner-container {
  text-align: center;
}

.winner-label {
  font-family: var(--font-sans);
  font-size: 3rem;
  color: var(--white);
  margin-bottom: 1.5rem;
}

.winner-name {
  font-family: var(--font-logo);
  font-size: 5rem;
  color: var(--jeopardy-gold);
  text-shadow: 5px 5px 10px rgba(0, 0, 0, 0.5);
  margin-bottom: 1.5rem;
  letter-spacing: 0.05em;
  animation: winner-glow 2s ease-in-out infinite alternate;
}

@keyframes winner-glow {
  from { text-shadow: 5px 5px 10px rgba(0, 0, 0, 0.5); }
  to { text-shadow: 0 0 30px var(--jeopardy-gold), 5px 5px 10px rgba(0, 0, 0, 0.5); }
}

.winner-score {
  font-size: 3rem;
  color: var(--jeopardy-gold-light);
}

/* ===== Confetti Canvas ===== */
#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

/* ===== Utilities ===== */
.hidden {
  display: none !important;
}

/* ===== Responsive - Medium screens ===== */
@media (max-width: 1200px) {
  .game-title {
    font-size: 3rem;
  }

  .board-title {
    font-size: 2rem;
  }

  .category-header {
    font-size: 1.1rem;
    min-height: 70px;
  }

  .tile {
    font-size: 2rem;
    min-height: 70px;
  }

  .player-score-value {
    font-size: 2.5rem;
  }

  .question-text {
    font-size: 2.5rem;
  }

  .daily-double-title {
    font-size: 4rem;
  }
}

/* ===== Extra large screens ===== */
@media (min-width: 1600px) {
  .game-board {
    max-width: 1600px;
  }

  .category-header {
    font-size: 1.6rem;
    min-height: 100px;
  }

  .tile {
    font-size: 3rem;
    min-height: 100px;
  }

  .player-score-card {
    min-width: 300px;
    padding: 1.25rem 2.5rem;
  }

  .player-score-value {
    font-size: 3.5rem;
  }
}
