/* ============================================================
   Jeopardy! — Styles
   ============================================================ */

/* ── CSS Variables ───────────────────────────────────────── */
:root {
  --board-blue:    #0a0aad;
  --board-hover:   #1515d0;
  --board-used:    #1a1a3a;
  --cat-bg:        #060660;
  --gold:          #ffcc00;
  --gold-dark:     #cc9900;
  --white:         #ffffff;
  --text:          #f0f0f0;
  --text-muted:    #888;
  --bg:            #050520;
  --overlay-bg:    rgba(5, 5, 32, 0.78);
  --final-bg:      #0a0040;
  --green:         #22c55e;
  --red:           #ef4444;
  --radius:        6px;
  --font-main:     'Arial Black', 'Impact', 'Franklin Gothic Medium', sans-serif;
  --font-body:     Arial, sans-serif;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg) url('Gemini_Generated_Image_3u2vbd3u2vbd3u2v-topaz-upscale-2x-denoise.jpg') center center / cover no-repeat fixed;
  color: var(--text);
  font-family: var(--font-body);
  overflow: hidden;
}
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input  { font-family: inherit; }

/* ── App Container ───────────────────────────────────────── */
#app { width: 100vw; height: 100vh; display: flex; flex-direction: column; }

/* ── Screens ──────────────────────────────────────────────── */
.screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  height: 100%;
}

/* ── Logo ─────────────────────────────────────────────────── */
.j-logo {
  font-family: var(--font-main);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  color: var(--gold);
  text-shadow: 3px 3px 0 #000, 0 0 20px rgba(255,204,0,0.5);
  letter-spacing: 0.06em;
  text-align: center;
  margin-bottom: 1.5rem;
}
.j-logo-lobby { font-size: clamp(2rem, 5vw, 3.5rem); margin-bottom: 0.75rem; }
.j-logo-img { max-width: 640px; width: 80%; height: auto; display: block; margin: 0 auto; }
.j-logo-above-card { padding-top: 100px; text-align: center; margin-bottom: 1.5rem; }
.j-logo-header { font-size: clamp(1rem, 2.5vw, 1.6rem); color: var(--gold); font-family: var(--font-main); letter-spacing: 0.08em; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  transition: filter 0.15s, transform 0.1s;
}
.btn:hover  { filter: brightness(1.15); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary  { background: var(--gold); color: #000; }
.btn-secondary{ background: #333; color: var(--text); }
.btn-outline  { background: transparent; border: 2px solid var(--gold); color: var(--gold); }
.btn-small    { padding: 0.3rem 0.8rem; font-size: 0.8rem; }
.btn-large    { padding: 0.85rem 2.2rem; font-size: 1.1rem; }
.btn-accept   { background: var(--green); color: #000; font-size: 1rem; padding: 0.6rem 1.4rem; border-radius: var(--radius); font-weight: 700; }
.btn-reject   { background: var(--red);   color: #fff; font-size: 1rem; padding: 0.6rem 1.4rem; border-radius: var(--radius); font-weight: 700; }

.btn-buzz {
  font-family: var(--font-main);
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  background: var(--gold);
  color: #000;
  padding: 1rem 2.5rem;
  margin-bottom: 1.2rem;
  border-radius: 50px;
  letter-spacing: 0.08em;
  box-shadow: 0 0 20px rgba(255,204,0,0.6);
  animation: pulse-buzz 1s ease-in-out infinite;
  border: none;
  cursor: pointer;
  transition: filter 0.15s;
}
.btn-buzz:hover  { filter: brightness(1.1); }
.btn-buzz:active { transform: scale(0.97); }
.btn-buzz:disabled { background: #555; color: #888; box-shadow: none; animation: none; cursor: not-allowed; }

@keyframes pulse-buzz {
  0%, 100% { box-shadow: 0 0 20px rgba(255,204,0,0.6); }
  50%       { box-shadow: 0 0 35px rgba(255,204,0,0.9); }
}

@keyframes buzz-shake {
  0%,100% { transform: translateX(0); }
  10%     { transform: translateX(-8px) rotate(-3deg); }
  20%     { transform: translateX(8px)  rotate(3deg); }
  30%     { transform: translateX(-7px) rotate(-2deg); }
  40%     { transform: translateX(7px)  rotate(2deg); }
  50%     { transform: translateX(-5px) rotate(-1deg); }
  60%     { transform: translateX(5px)  rotate(1deg); }
  70%     { transform: translateX(-3px); }
  85%     { transform: translateX(3px); }
}
.btn-buzz-shake {
  animation: buzz-shake 0.9s ease-in-out forwards !important;
}

@keyframes cardBounceIn {
  0%   { opacity: 0; transform: scale(0.7); }
  55%  { opacity: 1; transform: scale(1.04); }
  75%  { transform: scale(0.97); }
  90%  { transform: scale(1.01); }
  100% { opacity: 1; transform: scale(1); }
}
.clue-card-animate {
  animation: cardBounceIn 0.45s cubic-bezier(0.34,1.56,0.64,1) both;
}

/* ── Forms ────────────────────────────────────────────────── */
.inline-form { display: flex; gap: 0.6rem; margin-top: 0.75rem; }
.inline-form input { flex: 1; min-width: 0; }
input[type="text"], input[type="number"] {
  background: #111;
  border: 2px solid #444;
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.55rem 0.8rem;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.15s;
}
input:focus { border-color: var(--gold); }
.wager-input { width: 180px; }
.wager-input-large { width: 220px; font-size: 1.2rem; padding: 0.7rem 1rem; }

/* ── Cards ────────────────────────────────────────────────── */
.center-card {
  background: #0d0d2b;
  border: 2px solid var(--gold);
  border-radius: 12px;
  padding: 2.5rem 2.5rem;
  max-width: 560px;
  width: 92%;
  text-align: center;
}
.center-card p { color: var(--text-muted); margin-bottom: 0.75rem; }
.subtitle { font-size: 0.95rem; margin-bottom: 1rem; }

/* ── No-Game / Join Screen ──────────────────────────────── */
#screen-no-game, #screen-join { padding-top: 3rem; }
.game-name-row { display: flex; align-items: center; justify-content: center; gap: 0.4rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.game-name-row p { margin: 0; line-height: 1; }
.section-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.3rem; }
#join-player-list { list-style: none; text-align: left; }
#join-player-list li { padding: 2px 0; font-size: 0.9rem; }

/* ── Lobby Screen ─────────────────────────────────────────── */
.lobby-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 1rem;
  width: 100%;
  max-width: 600px;
}
.lobby-room-row { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; justify-content: center; margin-bottom: 1rem; }
.lobby-room-row h2 { color: var(--white); }
.player-list-container { background: #0d0d2b; border: 1px solid #333; border-radius: 8px; padding: 1rem 1.2rem; width: 100%; margin-bottom: 1rem; }
.player-list-container h3 { color: var(--gold); margin-bottom: 0.5rem; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.1em; }
#lobby-player-list { list-style: none; }
#lobby-player-list li { padding: 0.35rem 0; border-bottom: 1px solid #1a1a3a; display: flex; align-items: center; gap: 0.5rem; }
#lobby-player-list li:last-child { border-bottom: none; }
.host-badge { font-size: 0.65rem; background: var(--gold); color: #000; padding: 1px 5px; border-radius: 4px; font-weight: 700; }
.lobby-instructions { color: #ffffff; font-size: 0.85rem; text-align: center; margin-bottom: 1rem; }
.muted { color: var(--text-muted); font-size: 0.9rem; }
#lobby-waiting { color: #ffffff; }

/* ── Game Screen Layout ───────────────────────────────────── */
#screen-game {
  display: none;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  position: relative;
}
#game-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  padding: 0.4rem 1rem;
  background: var(--cat-bg);
  border-bottom: 3px solid var(--gold);
  flex-shrink: 0;
  gap: 0.5rem;
}
#game-header .j-logo-header { /* handled by .game-header-left flex container */ }
.round-label { color: var(--gold); font-family: var(--font-main); font-size: clamp(0.75rem, 1.8vw, 1.1rem); letter-spacing: 0.06em; justify-self: center; text-align: center; }
.room-name-display { color: #ccc; font-size: 1rem; font-weight: bold; white-space: nowrap; }
.game-header-left { display: flex; flex-direction: row; align-items: center; gap: 0.5rem; justify-self: start; }
.game-header-right { display: flex; flex-direction: row; align-items: center; justify-self: end; gap: 0.3rem; }

/* ── Score Bar ────────────────────────────────────────────── */
#score-bar {
  display: flex;
  gap: 8px;
  background: #060630;
  padding: 8px 12px;
  flex-shrink: 0;
  overflow-x: auto;
  border-bottom: 2px solid #111;
}
.score-tile {
  flex: 1;
  min-width: 120px;
  text-align: center;
  padding: 14px 20px;
  border-radius: 6px;
  border: 1px solid #222;
  background: #0a0a40;
  transition: background 0.2s;
}
.score-tile.active-selector { background: #1a1a60; border-color: var(--gold); animation: pulse-glow 1.5s ease-in-out infinite; }

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 6px rgba(255, 215, 0, 0.3); }
  50%       { box-shadow: 0 0 20px rgba(255, 215, 0, 0.9); }
}
.score-tile.eliminated { opacity: 0.4; }
.score-tile .s-name  { font-size: clamp(0.65rem, 1.5vw, 0.85rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #ccc; }
.score-tile .s-score { font-family: var(--font-main); font-size: clamp(1rem, 2.4vw, 1.4rem); color: var(--gold); white-space: nowrap; }
.score-tile .s-score.negative { color: var(--red); }
.score-tile .s-me { font-size: 0.6rem; color: var(--gold); }

/* ── Game Board ───────────────────────────────────────────── */
#board-container {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  padding: 4px 4px 0;
}
#game-board {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  /* Category row auto-sizes; each clue row is capped so the board doesn't
     fill the entire viewport. clamp(52px, 9vh, 80px) gives taller cells on
     big screens and shorter ones on small screens, with room below. */
  grid-template-rows: auto;
  grid-auto-rows: clamp(48px, 9vh, 76px);
  gap: 4px;
  height: auto;
}
.board-cell {
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4px;
  transition: background 0.15s, transform 0.1s;
}
.board-cat {
  background: var(--cat-bg);
  color: var(--white);
  font-size: clamp(0.55rem, 1.4vw, 0.85rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.2;
  min-height: 44px;
}
.board-clue {
  background: var(--board-blue);
  color: var(--gold);
  font-family: var(--font-main);
  font-size: clamp(0.9rem, 2.5vw, 1.6rem);
  font-weight: 900;
  cursor: default;
}
.board-clue.selectable {
  cursor: pointer;
}
.board-clue.selectable:hover { background: var(--board-hover); transform: scale(1.02); }
.board-clue.used { background: var(--board-used); color: #2a2a4a; cursor: default; }
.board-clue.used:hover { background: var(--board-used); transform: none; }
.board-clue.dd-debug { background: #1a7a1a; color: #fff; }
.board-clue.dd-debug.selectable:hover { background: #22a022; }

/* ── Board entrance animation ──────────────────────────────── */
@keyframes cellSlideIn {
  0%   { opacity: 0; transform: translateX(70px) scale(0.85); }
  55%  { opacity: 1; transform: translateX(-6px) scale(1.05); }
  75%  { transform: translateX(3px) scale(0.98); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}
.board-cell-animated {
  animation: cellSlideIn 0.45s ease-out both;
}

/* ── Clue select flash ─────────────────────────────────────── */
@keyframes clueSelectPop {
  0%   { transform: scale(1); }
  60%  { transform: scale(1.18); }
  100% { transform: scale(1.12); }
}
.clue-selecting {
  animation: clueSelectPop 0.175s ease-out forwards;
  background: #f97316 !important;
  color: #fff !important;
  cursor: default !important;
  pointer-events: none !important;
  position: relative;
  z-index: 5;
}

/* ── Overlays ──────────────────────────────────────────────── */
.overlay {
  position: absolute;
  inset: 0;
  background: var(--overlay-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}
.overlay-final   { background: rgba(0,0,30,0.97); }
.overlay-scoreboard { background: rgba(0,0,30,0.97); }

/* ── Clue Card ─────────────────────────────────────────────── */
.clue-card {
  background: var(--board-blue);
  border: 3px solid var(--gold);
  border-radius: 12px;
  padding: 2rem 2.5rem;
  max-width: 760px;
  width: 95%;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  max-height: 90vh;
  overflow-y: auto;
}
.clue-meta-category {
  color: #99aaff;
  font-size: clamp(0.8rem, 2vw, 1rem);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}
.clue-meta-value {
  font-family: var(--font-main);
  font-size: clamp(1.8rem, 5vw, 3rem);
  color: var(--gold);
}
.clue-text {
  font-size: clamp(1rem, 3vw, 1.6rem);
  color: var(--white);
  line-height: 1.45;
}
.clue-answer-reveal {
  font-size: clamp(0.9rem, 2.5vw, 1.3rem);
  color: #aaffaa;
  border-top: 1px solid #334;
  padding-top: 0.8rem;
}
.answering-label { color: var(--gold); font-size: 1.1rem; font-weight: 700; }

/* ── Buzz-winner prompt ──────────────────────────────────── */
.buzz-winner-prompt {
  font-family: var(--font-main);
  font-size: clamp(1.4rem, 4vw, 2rem);
  color: var(--gold);
  letter-spacing: 0.04em;
}
.buzz-winner-subtext { font-size: 0.95rem; margin-top: 0.4rem; }

/* ── Voting UI ───────────────────────────────────────────── */
.voting-prompt {
  color: var(--white);
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  margin-bottom: 1rem;
}
.voting-prompt strong { color: var(--gold); }
.vote-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.btn-vote-correct {
  background: var(--green);
  color: #000;
  font-size: clamp(0.95rem, 2.2vw, 1.1rem);
  padding: 0.75rem 1.8rem;
  border-radius: var(--radius);
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
}
.btn-vote-correct:hover  { filter: brightness(1.15); transform: translateY(-1px); }
.btn-vote-correct:active { transform: translateY(0); }
.btn-vote-correct:disabled { background: #2a6e45; color: #aaa; cursor: not-allowed; transform: none; filter: none; }
.btn-vote-incorrect {
  background: var(--red);
  color: #fff;
  font-size: clamp(0.95rem, 2.2vw, 1.1rem);
  padding: 0.75rem 1.8rem;
  border-radius: var(--radius);
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
}
.btn-vote-incorrect:hover  { filter: brightness(1.15); transform: translateY(-1px); }
.btn-vote-incorrect:active { transform: translateY(0); }
.btn-vote-incorrect:disabled { background: #7a2222; color: #aaa; cursor: not-allowed; transform: none; filter: none; }
.vote-status {
  margin-top: 0.75rem;
  font-size: 1rem;
  font-weight: 700;
  min-height: 1.4em;
}
.vote-status-correct   { color: var(--green); }
.vote-status-incorrect { color: var(--red); }
.adjudicating-response {
  font-size: 1.3rem;
  color: var(--white);
  background: #111;
  padding: 0.8rem 1.2rem;
  border-radius: 6px;
  font-style: italic;
}

/* ── Buzz Timer Bar ─────────────────────────────────────── */
#buzz-timer-bar {
  width: 100%;
  height: 8px;
  background: #1a1a4a;
  border-radius: 4px;
  overflow: hidden;
}
#buzz-timer-fill {
  height: 100%;
  background: var(--gold);
  width: 100%;
  transition: width 0.1s linear;
}
@keyframes buzz-warning-pulse {
  0%   { background: var(--board-blue); }
  50%  { background: #6b0000; }
  100% { background: var(--board-blue); }
}
.buzz-warning {
  animation: buzz-warning-pulse 0.6s ease-in-out infinite;
}
.timer-display { color: var(--gold); font-family: var(--font-main); font-size: 1.4rem; }
.timer-large   { font-size: 2.5rem; }

/* ── Daily Double ─────────────────────────────────────────── */
.dd-banner {
  font-family: var(--font-main);
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  color: var(--gold);
  text-shadow: 2px 2px 0 #000;
  animation: dd-flash 0.7s ease-in-out infinite alternate;
}
@keyframes dd-flash {
  from { text-shadow: 2px 2px 0 #000, 0 0 10px rgba(255,204,0,0.3); }
  to   { text-shadow: 2px 2px 0 #000, 0 0 30px rgba(255,204,0,0.8); }
}
.dd-wager-label { color: #ccc; font-size: 1rem; }
.dd-wager-hint  { font-size: 0.85rem; margin-top: 10px; margin-bottom: 6px; }
#lobby-waiting  { margin-top: 20px; }

/* ── Final Jeopardy ──────────────────────────────────────── */
.overlay-final .final-card {
  background: linear-gradient(160deg, #060640 0%, #0a0060 100%);
  border: 3px solid var(--gold);
  border-radius: 14px;
  padding: 2rem 2.5rem;
  max-width: 800px;
  width: 96%;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1.3rem;
  max-height: 92vh;
  overflow-y: auto;
}
.final-reveal-card { max-width: 860px; }
.final-header {
  font-family: var(--font-main);
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  color: var(--gold);
  letter-spacing: 0.08em;
  text-shadow: 2px 2px 0 #000;
}
.final-category {
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  color: var(--white);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.final-clue-text { font-size: clamp(1.1rem, 3vw, 1.5rem); color: var(--white); line-height: 1.4; }
.final-instructions { color: #aaa; font-size: 0.9rem; }
.locked-msg { color: var(--green); font-weight: 700; font-size: 1.1rem; }
.wager-statuses { display: flex; gap: 0.75rem; flex-wrap: wrap; justify-content: center; }
.wager-status-chip {
  background: #1a1a4a;
  border: 1px solid #333;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.85rem;
  color: #ccc;
}
.wager-status-chip.locked { border-color: var(--green); color: var(--green); }

/* ── Final Reveal List ────────────────────────────────────── */
.final-reveal-list { display: flex; flex-direction: column; gap: 0.75rem; text-align: left; }
.reveal-row {
  background: #0d0d30;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s, transform 0.4s;
}
.reveal-row.visible { opacity: 1; transform: translateY(0); }
.reveal-row.accepted { border-color: var(--green); }
.reveal-row.rejected { border-color: var(--red); }
.reveal-name  { font-weight: 700; min-width: 90px; }
.reveal-answer { flex: 1; color: #ccc; font-style: italic; }
.reveal-result { font-weight: 700; font-family: var(--font-main); min-width: 80px; text-align: right; }

/* ── Gear / Settings Button ───────────────────────────────── */
.btn-gear {
  background: transparent;
  border: none;
  color: var(--gold);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
  transition: opacity 0.15s, transform 0.15s;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}
.btn-gear:hover { opacity: 0.8; transform: rotate(30deg); }
.btn-gear:disabled { color: #555; cursor: default; transform: none; opacity: 0.4; }

/* Position gear on the no-game/login card */
.center-card { position: relative; }
.center-card > .btn-gear {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
}

/* How to Play button displayed above the logo on login/lobby screens */
.above-logo-btn {
  margin-top: 1.5rem;
  align-self: center;
}
.above-logo-btn + .j-logo-above-card {
  padding-top: 1rem;
}

/* ── QR Invite Button ───────────────────────────────────────── */
.btn-qr {
  background: transparent;
  border: none;
  color: var(--gold);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0.85;
  transition: opacity 0.15s, transform 0.15s;
  vertical-align: middle;
}
.btn-qr:hover { opacity: 1; transform: scale(1.1); }
.btn-qr:active { transform: scale(0.96); }

/* ── QR Invite Modal ────────────────────────────────────────── */
.qr-modal-box {
  background: #0d0d2b;
  border: 2px solid var(--gold);
  border-radius: 12px;
  padding: 1.8rem 2rem 1.5rem;
  text-align: center;
  max-width: 340px;
  width: 92%;
  position: relative;
}
.qr-modal-title {
  color: var(--gold);
  font-family: var(--font-main);
  font-size: 1.3rem;
  margin-bottom: 0.3rem;
}
.qr-modal-subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}
.qr-modal-img-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 0.9rem;
}
.qr-modal-img {
  border-radius: 8px;
  display: block;
}
.qr-modal-url {
  color: #aaa;
  font-size: 0.72rem;
  word-break: break-all;
  margin: 0;
}

/* ── Settings Modal ───────────────────────────────────────── */
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #1e1e4a;
}
.settings-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
  flex: 1;
}
.settings-hint {
  color: #888;
  font-size: 0.82rem;
  margin: 0 0 0.75rem 0;
  line-height: 1.4;
}
.settings-hint code {
  background: #1a1a3a;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.8rem;
  color: var(--gold);
}
.settings-number {
  width: 70px;
  background: #1a1a3a;
  border: 1px solid #444;
  color: var(--white);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 1rem;
  text-align: center;
}
.settings-number:focus { outline: 2px solid var(--gold); border-color: transparent; }
.settings-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.2rem;
}
/* Toggle switch */
.settings-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}
.settings-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.settings-toggle-track {
  width: 46px;
  height: 24px;
  background: #333;
  border-radius: 12px;
  transition: background 0.2s;
  flex-shrink: 0;
}
.settings-toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}
.settings-toggle input:checked + .settings-toggle-track { background: var(--gold); }
.settings-toggle input:checked + .settings-toggle-track::after { transform: translateX(22px); }

/* Settings section header */
.settings-section-header {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
  padding: 0.6rem 0 0.3rem;
  border-top: 1px solid #2a2a5a;
  margin-top: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.settings-section-header:first-child { border-top: none; margin-top: 0; padding-top: 0; }

/* Lock badge shown next to Game Settings header when game is in progress */
.settings-lock-badge {
  font-size: 0.7rem;
  font-weight: 600;
  color: #f0a000;
  background: #2a1a00;
  border: 1px solid #a06000;
  border-radius: 10px;
  padding: 2px 8px;
  letter-spacing: 0.04em;
  text-transform: none;
}

/* Styled dropdown matching the dark theme */
.settings-select {
  background: #1a1a3a;
  border: 1px solid #444;
  color: var(--white);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.95rem;
  min-width: 140px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23ffcc00'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}
.settings-select:focus { outline: 2px solid var(--gold); border-color: transparent; }
.settings-select option { background: #1a1a3a; color: var(--white); }

/* Disabled state for locked game settings */
.settings-number:disabled,
.settings-select:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  border-color: #2a2a4a;
}
.settings-row:has(input:disabled) .settings-label,
.settings-row:has(select:disabled) .settings-label { opacity: 0.5; }
.reveal-result.up   { color: var(--green); }
.reveal-result.down { color: var(--red); }

/* ── Scoreboard Overlay ───────────────────────────────────── */
.scoreboard-card {
  background: #0d0d2b;
  border: 3px solid var(--gold);
  border-radius: 14px;
  padding: 2rem 2.5rem;
  max-width: 640px;
  width: 95%;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 90vh;
  overflow-y: auto;
}
.scoreboard-title { font-family: var(--font-main); font-size: clamp(1.4rem, 3vw, 2rem); color: var(--gold); }
.scoreboard-list { display: flex; flex-direction: column; gap: 0.5rem; text-align: left; }
.sb-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  background: #111130;
}
.sb-rank  { font-family: var(--font-main); font-size: 1.1rem; color: var(--gold); min-width: 24px; }
.sb-name  { flex: 1; font-weight: 700; }
.sb-score { font-family: var(--font-main); font-size: 1.1rem; color: var(--gold); }
.sb-score.negative { color: var(--red); }
.sb-row.eliminated { opacity: 0.5; }

/* ── Game Over ─────────────────────────────────────────────── */
@keyframes sbRowSlideIn {
  0%   { opacity: 0; transform: translateY(-22px) scale(0.95); }
  60%  { opacity: 1; transform: translateY(4px) scale(1.02); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.sb-row-animated {
  animation: sbRowSlideIn 0.4s ease-out both;
}
.game-over-winner {
  font-family: var(--font-main);
  font-size: clamp(1.2rem, 3.5vw, 1.8rem);
  color: var(--gold);
  text-shadow: 0 0 20px rgba(255,204,0,0.6);
}

/* ── Modal ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.8);
  display: flex; align-items: center; justify-content: center;
  z-index: 300;
}
.modal-box {
  background: #0d0d2b;
  border: 2px solid var(--gold);
  border-radius: 12px;
  padding: 2rem;
  max-width: 620px;
  width: 92%;
  position: relative;
  max-height: 85vh;
  overflow-y: auto;
}
.modal-box h2  { color: var(--gold); margin-bottom: 1rem; font-size: 1.4rem; }
.modal-close   { position: absolute; top: 0.8rem; right: 1rem; color: #aaa; font-size: 1.2rem; background: none; border: none; cursor: pointer; }
.htp-list      { list-style: disc; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 0.6rem; font-size: 0.95rem; color: #ddd; line-height: 1.5; }
.modal-body h3 { color: var(--gold); font-size: 1rem; margin: 1.2rem 0 0.5rem; font-family: var(--font-body); }
.modal-body h3:first-child { margin-top: 0; }
.modal-body p  { color: #ddd; font-size: 0.92rem; line-height: 1.55; }

.modal-body ul { list-style: disc; padding-left: 1.3rem; display: flex; flex-direction: column; gap: 0.45rem; }
.modal-body li { color: #ddd; font-size: 0.92rem; line-height: 1.55; }

/* ── Disconnected Label ───────────────────────────────────── */
.disconnected { color: var(--text-muted); font-size: 0.75rem; }

/* ── Utility ─────────────────────────────────────────────── */
.flex-center { display: flex; align-items: center; justify-content: center; gap: 0.75rem; }
.gap-btns    { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

/* ── Score Toast Notifications ───────────────────────────── */
#score-notifications {
  position: fixed;
  top: 4.5rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  align-items: flex-end;
}
.score-toast {
  background: #1a7a1a;
  border: 1px solid #2ecc2e;
  border-radius: 8px;
  padding: 0.55rem 1rem;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 600;
  box-shadow: 0 4px 18px rgba(0,0,0,0.6), 0 0 8px rgba(46,204,46,0.4);
  animation: score-toast-in 0.3s ease forwards;
  white-space: nowrap;
}
.score-toast.score-toast-loss {
  background: #a01010;
  border-color: #e05050;
  box-shadow: 0 4px 18px rgba(0,0,0,0.6), 0 0 8px rgba(204,50,50,0.45);
}
.score-toast.fade-out {
  animation: score-toast-out 0.6s ease forwards;
}
@keyframes score-toast-in {
  from { opacity: 0; transform: translateX(50px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes score-toast-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(50px); }
}

/* ══════════════════════════════════════════════════════════════
   HOST CROWN BUTTON
══════════════════════════════════════════════════════════════ */
.btn-host-crown {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: filter 0.15s, transform 0.1s;
  opacity: 0.92;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}
.btn-host-crown:hover  { filter: brightness(1.3); transform: scale(1.12); }
.btn-host-crown:active { transform: scale(1.0); }

/* ══════════════════════════════════════════════════════════════
   HOST CONTROL PANEL MODAL
══════════════════════════════════════════════════════════════ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 20, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 900;
  padding: 1rem;
}

.host-panel-box {
  background: #0d0d2b;
  border: 2px solid var(--gold);
  border-radius: 12px;
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.host-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem 0.6rem;
  border-bottom: 1px solid #222;
}

.host-panel-title {
  font-size: 1.2rem;
  color: var(--gold);
  font-family: var(--font-main);
  letter-spacing: 0.04em;
}

.host-panel-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #222;
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.65rem 1rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  font-family: var(--font-body);
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); }

.host-tab-content {
  flex: 1;
  overflow-y: auto;
  padding: 0.8rem 1.2rem;
}

/* ── Players Tab ─────────────────────────────────────────────── */
.hp-player-list { display: flex; flex-direction: column; gap: 0.4rem; }

.hp-player-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #111130;
  border: 1px solid #1e1e3a;
  border-radius: 6px;
  padding: 0.55rem 0.8rem;
}

.hp-player-name { flex: 1; font-size: 0.95rem; }

.hp-player-score {
  font-family: var(--font-main);
  color: var(--gold);
  font-size: 0.9rem;
  min-width: 60px;
  text-align: right;
}

.conn-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.conn-dot.connected    { background: var(--green); box-shadow: 0 0 5px var(--green); }
.conn-dot.disconnected { background: #555; }

.btn-remove-player {
  background: #4a0a0a;
  color: #ff8888;
  border: 1px solid #7a1a1a;
  border-radius: 4px;
  padding: 0.2rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}
.btn-remove-player:hover { background: #7a0a0a; }

/* ── Categories Tab ───────────────────────────────────────────── */
.category-selection-ui { display: flex; flex-direction: column; gap: 0.75rem; }

.cat-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.category-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.2rem 0.5rem;
}

.cat-check-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  cursor: pointer;
  padding: 0.25rem 0.3rem;
  border-radius: 4px;
  transition: background 0.1s;
  user-select: none;
}
.cat-check-label:hover { background: #161634; }
.cat-check-label input[type="checkbox"] { accent-color: var(--gold); cursor: pointer; flex-shrink: 0; }

/* Movies section */
.cat-movies-section {
  background: #0a0a22;
  border: 1px solid #222;
  border-radius: 6px;
  overflow: hidden;
}

.cat-movies-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  user-select: none;
  transition: background 0.1s;
}
.cat-movies-header:hover { background: #111130; }
.movies-chevron { font-size: 0.75rem; color: var(--text-muted); width: 12px; }
.movies-subcount { color: var(--gold); font-size: 0.78rem; }

.movies-sub-list {
  padding: 0.3rem 0.75rem 0.6rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.2rem 0.5rem;
  border-top: 1px solid #1a1a2e;
}

/* Custom categories */
.custom-cats-section { display: flex; flex-direction: column; gap: 0.4rem; }

.custom-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.custom-cat-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.custom-cat-input {
  flex: 1;
  min-width: 0;
  padding: 0.35rem 0.6rem;
  font-size: 0.88rem;
}

.btn-remove-custom {
  background: transparent;
  border: 1px solid #444;
  color: #888;
  border-radius: 4px;
  padding: 0.2rem 0.45rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.btn-remove-custom:hover { color: var(--red); border-color: var(--red); }

/* Count status row + generate button */
.cat-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.4rem;
  border-top: 1px solid #1a1a2e;
}

.cat-count-status { font-size: 0.85rem; color: var(--text-muted); }
.cat-count-status.at-limit { color: var(--green); font-weight: 600; }

.cat-generate-btn { font-size: 0.95rem; padding: 0.5rem 1.1rem; }
.cat-generate-btn:disabled { opacity: 0.45; cursor: not-allowed; filter: none; transform: none; }

/* Generation status message */
.generate-status {
  font-size: 0.85rem;
  min-height: 1.3em;
  border-radius: 4px;
  padding: 0 0.3rem;
}
.generate-status.info    { color: #aaa; }
.generate-status.success { color: var(--green); font-weight: 600; }
.generate-status.error   { color: var(--red); }

/* Locked categories message */
.hp-cats-locked { padding: 0.5rem 0; }
.hp-cats-locked-msg { color: #aaa; font-size: 0.9rem; margin-bottom: 0.4rem; }
.hp-cats-active { color: var(--gold); font-size: 0.85rem; line-height: 1.5; }

