@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --navy-deep: #060a3d;
  --navy: #0b1373;
  --navy-light: #172a9e;
  --tile-blue: #10188f;
  --tile-blue-hover: #1c26b8;
  --gold: #f5c518;
  --gold-dim: #c9a012;
  --white: #f5f7ff;
  --ink: #0a0e2a;
  --green: #2fae5c;
  --red: #d64545;
  --panel: #0e1550;
  --panel-line: rgba(245, 197, 24, 0.18);
  --radius: 10px;
  font-family: 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 50% -10%, var(--navy-light), var(--navy-deep) 65%);
  color: var(--white);
  font-family: 'Inter', system-ui, sans-serif;
}

h1, h2, h3, .display {
  font-family: 'Bebas Neue', 'Inter', sans-serif;
  letter-spacing: 0.03em;
  font-weight: 400;
}

a { color: inherit; }

button {
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  border: none;
  border-radius: var(--radius);
  transition: transform 0.08s ease, box-shadow 0.15s ease, background 0.15s ease;
}
button:active { transform: scale(0.97); }
button:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

input, textarea, select {
  font-family: 'Inter', sans-serif;
  border-radius: var(--radius);
  border: 1px solid var(--panel-line);
  background: rgba(255,255,255,0.06);
  color: var(--white);
  padding: 10px 12px;
  font-size: 1rem;
}
input::placeholder, textarea::placeholder { color: rgba(245,247,255,0.4); }
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

.btn-gold {
  background: linear-gradient(180deg, var(--gold), var(--gold-dim));
  color: var(--ink);
  font-weight: 700;
  padding: 12px 22px;
  font-size: 1rem;
  box-shadow: 0 4px 0 rgba(0,0,0,0.25);
}
.btn-gold:hover:not(:disabled) { box-shadow: 0 4px 12px rgba(245,197,24,0.4); }

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 1.5px solid var(--panel-line);
  padding: 10px 18px;
  font-weight: 600;
}
.btn-outline:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }

.btn-green { background: var(--green); color: white; font-weight: 700; padding: 10px 18px; }
.btn-red { background: var(--red); color: white; font-weight: 700; padding: 10px 18px; }
.btn-small { padding: 6px 12px; font-size: 0.85rem; border-radius: 6px; }

.center-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 16px;
  padding: 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: var(--gold);
  font-weight: 700;
}

.title-lockup {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 3rem;
  line-height: 1;
  color: var(--white);
  text-shadow: 0 2px 0 rgba(0,0,0,0.4);
}
.title-lockup .accent { color: var(--gold); }

.error-text { color: #ff8a8a; font-size: 0.9rem; margin-top: 8px; }

/* ---------- Scoreboard strip (shared) ---------- */
.scorebar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding: 14px;
}
.score-chip {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 10px;
  padding: 8px 16px;
  text-align: center;
  min-width: 110px;
}
.score-chip.leader { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.score-chip .name { font-weight: 700; font-size: 0.85rem; color: var(--white); }
.score-chip .amount { font-family: 'Bebas Neue', sans-serif; font-size: 1.6rem; color: var(--gold); }
.score-chip.negative .amount { color: #ff8a8a; }
.score-chip.controller { position: relative; }
.score-chip.controller::after {
  content: "picking";
  position: absolute;
  top: -9px; right: 8px;
  font-size: 0.6rem;
  background: var(--gold);
  color: var(--ink);
  padding: 1px 6px;
  border-radius: 6px;
  font-weight: 700;
  text-transform: uppercase;
}

/* ---------- Board (display view) ---------- */
.board-wrap { padding: 18px; max-width: 1400px; margin: 0 auto; }
.board-header {
  display: flex; align-items: baseline; justify-content: center; gap: 16px;
  margin-bottom: 14px;
}
.round-name { font-family: 'Bebas Neue', sans-serif; font-size: 2.4rem; color: var(--gold); }

.grid {
  display: grid;
  gap: 8px;
}
.cat-cell {
  background: linear-gradient(180deg, var(--navy-light), var(--navy));
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  padding: 14px 8px;
  text-align: center;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  line-height: 1.05;
}
.clue-cell {
  background: linear-gradient(180deg, var(--tile-blue), #0a1170);
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  color: var(--gold);
  min-height: 80px;
  perspective: 600px;
}
.clue-cell.used {
  background: rgba(255,255,255,0.03);
  color: transparent;
}
.clue-cell.clickable { cursor: pointer; }
.clue-cell.clickable:hover { background: linear-gradient(180deg, var(--tile-blue-hover), #0a1170); }

/* ---------- Active clue overlay ---------- */
.clue-stage {
  background: var(--navy);
  border: 2px solid var(--gold);
  border-radius: 18px;
  padding: 40px;
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
  min-height: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  animation: flipIn 0.5s ease;
}
@keyframes flipIn {
  from { transform: rotateX(90deg); opacity: 0; }
  to { transform: rotateX(0deg); opacity: 1; }
}
.clue-stage .category-tag {
  font-family: 'Bebas Neue', sans-serif;
  color: var(--gold);
  font-size: 1.4rem;
  letter-spacing: 0.05em;
}
.clue-stage .value-tag { color: var(--white); opacity: 0.8; font-size: 1rem; }
.clue-stage .question-text {
  font-size: clamp(1.4rem, 2.6vw, 2.1rem);
  line-height: 1.35;
  max-width: 900px;
}
.clue-stage .answer-text {
  font-size: clamp(1.2rem, 2vw, 1.7rem);
  color: var(--gold);
  font-style: italic;
}
.clue-stage img { max-width: 100%; max-height: 320px; border-radius: 8px; margin-top: 10px; }

.dd-banner {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 3rem;
  color: var(--gold);
  text-shadow: 0 0 24px rgba(245,197,24,0.6);
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.buzz-order-strip {
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center;
}
.buzz-chip {
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.9rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--panel-line);
}
.buzz-chip.pending { border-color: var(--gold); color: var(--gold); }
.buzz-chip.correct { background: var(--green); border-color: var(--green); color: white; }
.buzz-chip.incorrect { background: rgba(214,69,69,0.25); border-color: var(--red); color: #ffb3b3; text-decoration: line-through; }

.countdown-bar {
  width: 100%;
  max-width: 500px;
  margin: 14px auto 0;
  height: 10px;
  border-radius: 6px;
  background: rgba(255,255,255,0.1);
  overflow: hidden;
}
.countdown-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--gold), var(--green));
  transition: width 0.1s linear;
}

.category-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 340px;
}
.category-intro .intro-round-label {
  font-family: 'Bebas Neue', sans-serif;
  color: var(--gold);
  font-size: 1.4rem;
  letter-spacing: 0.08em;
  opacity: 0.8;
}
.category-intro .intro-cat {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  color: var(--white);
  text-align: center;
  animation: introPop 0.65s ease;
}
@keyframes introPop {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ---------- Player buzzer view ---------- */
.player-wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 100vh;
}
.me-card {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 14px;
  padding: 16px 20px;
  display: flex; justify-content: space-between; align-items: center;
}
.me-card .name { font-weight: 700; font-size: 1.1rem; }
.me-card .score { font-family: 'Bebas Neue', sans-serif; font-size: 1.8rem; color: var(--gold); }

.buzz-btn {
  flex: 1;
  min-height: 260px;
  border-radius: 24px;
  background: radial-gradient(circle at 50% 35%, var(--red), #8a1c1c);
  color: white;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 3rem;
  box-shadow: 0 10px 0 #6d1414, 0 16px 30px rgba(0,0,0,0.5);
  border: none;
}
.buzz-btn:active:not(:disabled) { box-shadow: 0 4px 0 #6d1414; transform: translateY(6px); }
.buzz-btn:disabled {
  background: radial-gradient(circle at 50% 35%, #3a3f66, #23274a);
  box-shadow: 0 10px 0 #171a33;
  color: rgba(255,255,255,0.4);
  opacity: 1;
}
.buzz-btn.buzzed {
  background: radial-gradient(circle at 50% 35%, var(--gold), var(--gold-dim));
  color: var(--ink);
  box-shadow: 0 10px 0 #8a6f0a;
}

.status-line {
  text-align: center;
  color: rgba(245,247,255,0.7);
  font-size: 0.95rem;
}

.form-block {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.form-block h3 { margin: 0; font-size: 1.3rem; color: var(--gold); }

/* ---------- Admin ---------- */
.admin-wrap { max-width: 1300px; margin: 0 auto; padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.admin-topbar {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 14px;
  padding: 18px;
}
.panel h3 { margin: 0 0 12px 0; color: var(--gold); font-size: 1.2rem; }

.admin-grid { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 6px; }
.admin-clue-btn {
  background: var(--tile-blue);
  color: var(--gold);
  border-radius: 6px;
  padding: 14px 4px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.2rem;
  border: 1px solid var(--panel-line);
}
.admin-clue-btn.used { background: rgba(255,255,255,0.03); color: rgba(255,255,255,0.2); }
.admin-clue-btn.dd { outline: 2px dashed rgba(245,197,24,0.5); }
.admin-cat-label {
  font-size: 0.72rem; text-align: center; padding: 6px 2px; font-weight: 700;
  color: var(--white); opacity: 0.85;
}

.player-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid var(--panel-line);
  flex-wrap: wrap;
}
.player-row:last-child { border-bottom: none; }
.player-row .pname { font-weight: 700; min-width: 120px; }
.player-row .pscore { font-family: 'Bebas Neue', sans-serif; color: var(--gold); font-size: 1.3rem; min-width: 70px; }
.tag { font-size: 0.7rem; padding: 2px 8px; border-radius: 10px; background: rgba(255,255,255,0.08); }
.tag.on { background: var(--green); color: white; }

.judge-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 12px; border-radius: 8px; background: rgba(255,255,255,0.04);
  margin-bottom: 6px;
  border: 1px solid transparent;
}
.judge-row-next {
  background: rgba(245,197,24,0.12);
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(245,197,24,0.25) inset;
}

.two-col { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .admin-grid { grid-template-columns: repeat(4, 1fr); }
}

.pill-row { display: flex; gap: 8px; flex-wrap: wrap; }

.badge-gold { background: var(--gold); color: var(--ink); padding: 3px 10px; border-radius: 20px; font-weight: 700; font-size: 0.75rem; }

footer.hint { text-align: center; color: rgba(245,247,255,0.4); font-size: 0.8rem; padding: 20px 0; }
