/* public/style.css */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #1a1a2e; --bg2: #16213e; --bg3: #0f3460;
  --text: #eee; --gold: #f0c040; --green: #4caf50; --red: #f44336; --gray: #555;
  --radius: 8px;
}

html, body { background: var(--bg); color: var(--text); font-family: Arial, sans-serif; height: 100%; }

/* Score bar */
#score-bar { display: flex; gap: 12px; padding: 12px 20px; background: var(--bg2); border-bottom: 2px solid var(--bg3); flex-wrap: wrap; }
.score-card { display: flex; flex-direction: column; align-items: center; padding: 8px 20px; background: var(--bg3); border-radius: var(--radius); min-width: 120px; border: 2px solid transparent; }
.score-card.active { border-color: var(--gold); }
.score-card .player-name { font-size: 1rem; font-weight: bold; color: var(--gold); }
.score-card .player-score { font-size: 1.4rem; font-weight: bold; }

/* Board */
#board { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; padding: 16px; }
.board-theme { background: var(--bg3); border-radius: var(--radius); padding: 10px; text-align: center; font-weight: bold; font-size: 0.95rem; }
.board-cell { display: flex; align-items: center; justify-content: center; background: var(--bg2); border: 2px solid var(--bg3); border-radius: var(--radius); padding: 16px 10px; text-align: center; font-size: 1.6rem; font-weight: bold; color: var(--gold); cursor: pointer; transition: background 0.15s, transform 0.1s; user-select: none; }
.board-cell:hover:not(.used):not(.disabled) { background: var(--bg3); transform: scale(1.04); }
.board-cell.used { background: var(--gray); color: #444; cursor: default; border-color: #444; }
.board-cell.disabled { cursor: default; }

/* Screens */
.screen { display: none; flex-direction: column; align-items: center; justify-content: center; min-height: 60vh; padding: 40px 24px; text-align: center; }
.screen.active { display: flex; }
.screen h1 { font-size: 2.4rem; margin-bottom: 16px; color: var(--gold); }
.screen h2 { font-size: 1.8rem; margin-bottom: 12px; }
.screen p  { font-size: 1.4rem; line-height: 1.5; }

/* Question */
#question-theme { font-size: 1.2rem; color: var(--gold); margin-bottom: 6px; }
#question-value { font-size: 1.8rem; font-weight: bold; color: var(--gold); margin-bottom: 20px; }
#question-text  { font-size: 1.6rem; max-width: 900px; margin-bottom: 24px; }
#question-image { max-width: 600px; max-height: 400px; border-radius: var(--radius); margin-bottom: 24px; display: none; }

#timer { font-size: 3rem; font-weight: bold; color: var(--gold); margin-bottom: 20px; min-width: 80px; text-align: center; }
#timer.urgent { color: var(--red); animation: pulse 0.5s infinite alternate; }
@keyframes pulse { from { opacity: 1; } to { opacity: 0.4; } }

#answered-banner { font-size: 2rem; font-weight: bold; padding: 16px 40px; border-radius: var(--radius); background: var(--bg3); border: 3px solid var(--gold); margin-top: 20px; display: none; }

/* Popup */
#popup { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7); align-items: center; justify-content: center; z-index: 100; }
#popup.show { display: flex; }
#popup-box { background: var(--bg2); border-radius: 16px; padding: 48px 64px; text-align: center; border: 3px solid var(--gold); min-width: 400px; }
#popup-box .popup-icon { font-size: 3rem; margin-bottom: 12px; }
#popup-box .popup-name { font-size: 2rem; font-weight: bold; margin-bottom: 8px; }
#popup-box .popup-delta { font-size: 2.4rem; font-weight: bold; }
#popup-box .popup-delta.plus { color: var(--green); }
#popup-box .popup-delta.minus { color: var(--red); }

/* Spinner */
.spinner { width: 80px; height: 80px; border: 8px solid var(--bg3); border-top-color: var(--gold); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 32px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Gameover */
.gameover-list { list-style: none; margin-top: 24px; }
.gameover-list li { font-size: 1.8rem; padding: 12px 24px; margin-bottom: 8px; background: var(--bg2); border-radius: var(--radius); }
.gameover-list li:first-child { border: 2px solid var(--gold); }

/* Buttons */
.btn { padding: 12px 24px; border: none; border-radius: var(--radius); font-size: 1rem; font-weight: bold; cursor: pointer; transition: opacity 0.15s; }
.btn:hover { opacity: 0.85; }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn-primary { background: var(--gold); color: #000; }
.btn-green   { background: var(--green); color: #fff; }
.btn-red     { background: var(--red); color: #fff; }
.btn-gray    { background: var(--gray); color: #fff; }
.btn-player  { background: var(--bg3); color: var(--text); border: 2px solid var(--bg3); font-size: 1.1rem; }

/* Admin layout */
#admin-wrap { max-width: 960px; margin: 0 auto; padding: 16px; }
#admin-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--bg3); margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }
#admin-header h1 { font-size: 1.4rem; color: var(--gold); }

/* Admin setup */
#setup-players { list-style: none; margin: 12px 0; }
#setup-players li { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: var(--bg2); border-radius: var(--radius); margin-bottom: 6px; font-size: 1.1rem; }
#player-input-row { display: flex; gap: 8px; margin-bottom: 12px; }
#player-input-row input, #player-name-input { flex: 1; padding: 10px 14px; background: var(--bg2); border: 1px solid var(--bg3); color: var(--text); border-radius: var(--radius); font-size: 1rem; }

/* Admin buttons */
#answer-buttons, #player-buttons, #media-buttons { display: flex; gap: 12px; margin-top: 12px; flex-wrap: wrap; }

/* Kot form */
#kot-form { display: flex; gap: 10px; align-items: center; margin-top: 16px; }
#kot-stake-input { padding: 10px 14px; background: var(--bg2); border: 1px solid var(--bg3); color: var(--text); border-radius: var(--radius); font-size: 1.1rem; width: 120px; }

/* Admin answer box */
#admin-answer-box { background: var(--bg3); border-left: 4px solid var(--green); padding: 12px 16px; border-radius: var(--radius); font-size: 1.1rem; margin-bottom: 16px; }

/* Auth */
#auth-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; gap: 12px; }
#auth-screen h1 { color: var(--gold); font-size: 1.8rem; }
#password-input { padding: 12px 20px; font-size: 1.2rem; background: var(--bg2); border: 1px solid var(--bg3); color: var(--text); border-radius: var(--radius); width: 280px; }
#auth-error { color: var(--red); font-size: 0.95rem; }

/* ─── Game screen (TV layout) ───────────────────────── */
.game-body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Score bar — bigger for TV */
.game-body #score-bar { flex-shrink: 0; padding: 18px 32px; gap: 20px; }
.game-body .score-card { padding: 12px 36px; min-width: 180px; }
.game-body .score-card .player-name { font-size: 1.6rem; }
.game-body .score-card .player-score { font-size: 2.8rem; }

/* Screens fill remaining height */
.game-body .screen { min-height: unset; flex: 1; }
.game-body #screen-picking { flex: 1; overflow: hidden; display: flex; flex-direction: column; }

/* Board — full height, 1 theme row + 5 equal question rows */
.game-body #board {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: auto repeat(5, 1fr);
  gap: 12px;
  padding: 12px 16px;
  flex: 1;
  overflow: hidden;
}
.game-body .board-theme { font-size: 1.5rem; padding: 14px 8px; }
.game-body .board-cell  { font-size: 3.2rem; padding: 0; }

/* Super game board — 5 columns, no theme row */
#board.board--super {
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: 1fr;
}
.game-body #board.board--super {
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: 1fr;
}

/* Screens — bigger text */
.game-body .screen h1 { font-size: 3.4rem; }
.game-body .screen h2 { font-size: 2.6rem; }
.game-body .screen p  { font-size: 2rem; }

/* Question */
.game-body #question-theme { font-size: 1.8rem; }
.game-body #question-value { font-size: 2.8rem; margin-bottom: 24px; }
.game-body #question-text  { font-size: 2.4rem; max-width: 1300px; margin-bottom: 32px; }
.game-body #question-image { max-width: 900px; max-height: 520px; margin-bottom: 32px; }

/* Timer & answered banner */
.game-body #timer { font-size: 5.5rem; }
.game-body #answered-banner { font-size: 3rem; padding: 20px 60px; margin-top: 28px; }

/* Popup */
.game-body #popup-box { padding: 64px 90px; min-width: 500px; border-radius: 24px; }
.game-body #popup-box .popup-icon  { font-size: 5rem; }
.game-body #popup-box .popup-name  { font-size: 3.5rem; }
.game-body #popup-box .popup-delta { font-size: 5rem; }

/* Gameover */
.game-body .gameover-list li { font-size: 2.4rem; padding: 16px 36px; }

/* Responsive (admin only) */
@media (max-width: 600px) {
  #board { gap: 4px; padding: 8px; }
  .board-cell { padding: 10px 4px; font-size: 1rem; }
  .board-theme { font-size: 0.75rem; padding: 6px 4px; }
  .btn { padding: 10px 16px; font-size: 0.9rem; }
  #popup-box { padding: 32px 24px; min-width: unset; }
}
