/* ============ RESET / BASE ============ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }

:root {
  --deep-blue: #0a0a2e;
  --purple: #2d1b4e;
  --gold: #ffd700;
  --gold-dim: #b8860b;
  --white: #ffffff;
  --soft-white: rgba(255, 255, 255, 0.9);
  --red: #ff3366;
  --green: #33ff66;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  --shadow-glow-gold: 0 0 24px rgba(255, 215, 0, 0.5);

  --font-display: 'Bebas Neue', 'Anton', 'Oswald', Impact, sans-serif;
  --font-body: 'Inter', -apple-system, system-ui, sans-serif;
}

body {
  font-family: var(--font-body);
  color: var(--white);
  background: var(--deep-blue);
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

button { font-family: inherit; cursor: pointer; }
code { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; background: rgba(255,255,255,0.08); padding: 0.1em 0.4em; border-radius: 4px; font-size: 0.9em; }
.hidden { display: none !important; }

/* ============ STAGE BACKDROP ============ */
.stage-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at top, rgba(45, 27, 78, 0.6) 0%, transparent 70%),
    radial-gradient(ellipse at bottom, rgba(255, 215, 0, 0.08) 0%, transparent 60%),
    linear-gradient(180deg, var(--deep-blue) 0%, #050518 100%);
  background-image: url("../assets/img/stage-bg.svg"), linear-gradient(180deg, var(--deep-blue) 0%, #050518 100%);
  background-size: cover, auto;
  background-position: center;
}

.spotlight {
  position: absolute;
  top: -10%;
  left: 50%;
  width: 1200px;
  height: 1200px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(255, 215, 0, 0.18) 0%, rgba(255, 215, 0, 0) 50%);
  pointer-events: none;
  animation: spotlight-sway 12s ease-in-out infinite alternate;
}

/* ============ TOPBAR ============ */
.topbar {
  position: fixed;
  top: 16px;
  right: 24px;
  display: flex;
  gap: 12px;
  z-index: 100;
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.06);
  color: var(--soft-white);
  border: 1px solid rgba(255, 215, 0, 0.4);
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  transition: all 0.2s ease;
  font-weight: 600;
}
.ghost-btn:hover {
  background: rgba(255, 215, 0, 0.15);
  border-color: var(--gold);
}

/* ============ SCREEN SCAFFOLD ============ */
.screen {
  display: none;
  min-height: 100vh;
  padding: 80px 32px 48px;
  max-width: 1400px;
  margin: 0 auto;
}
.screen.active { display: block; animation: screen-fade-in 0.5s ease; }

/* ============ TITLE SCREEN ============ */
#screen-title { display: none; text-align: center; padding-top: 12vh; }
#screen-title.active { display: flex; flex-direction: column; align-items: center; justify-content: center; }

.show-title {
  font-family: var(--font-display);
  font-weight: 400;
  margin: 0 0 32px;
  line-height: 0.9;
  letter-spacing: 0.04em;
}
.show-title .line-1 {
  display: block;
  font-size: clamp(2rem, 4vw, 3.5rem);
  color: var(--soft-white);
  letter-spacing: 0.18em;
}
.show-title .line-2 {
  display: block;
  font-size: clamp(3.5rem, 8vw, 7rem);
  color: var(--white);
  margin-top: 8px;
  text-shadow: 0 4px 24px rgba(255, 215, 0, 0.3);
}
.gold { color: var(--gold); }

.tagline {
  font-size: 1.1rem;
  color: var(--soft-white);
  margin: 8px 0 48px;
  letter-spacing: 0.06em;
}

.big-btn {
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold-dim) 100%);
  color: var(--deep-blue);
  border: none;
  padding: 18px 48px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.12em;
  border-radius: 6px;
  box-shadow: var(--shadow-glow-gold);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  font-weight: 700;
}
.big-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.8);
}
.big-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.micro-note {
  margin-top: 32px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}

/* ============ BOARD SCREEN ============ */
.board-header {
  text-align: center;
  margin-bottom: 40px;
}
.board-header h2 {
  font-family: var(--font-display);
  font-size: 2.5rem;
  letter-spacing: 0.15em;
  margin: 0 0 16px;
}

.score-strip {
  display: flex;
  justify-content: center;
  gap: 32px;
  font-family: var(--font-display);
  letter-spacing: 0.1em;
  color: var(--gold);
  font-size: 1.1rem;
}

.lifelines { color: var(--soft-white); }

.category-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 16px;
  max-width: 1300px;
  margin: 0 auto;
}

@media (max-width: 1100px) {
  .category-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 700px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); }
}

.category-tile {
  background: linear-gradient(180deg, rgba(45, 27, 78, 0.9) 0%, rgba(10, 10, 46, 0.95) 100%);
  border: 2px solid rgba(255, 215, 0, 0.3);
  border-radius: 8px;
  padding: 24px 12px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}
.category-tile::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255, 215, 0, 0.1) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}
.category-tile:hover:not(.played)::before {
  transform: translateX(100%);
}
.category-tile:hover:not(.played) {
  border-color: var(--gold);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow-gold);
}
.category-tile.played {
  opacity: 0.3;
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.1);
}

.tile-icon {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--gold);
  letter-spacing: 0.15em;
  background: rgba(255, 215, 0, 0.12);
  padding: 6px 12px;
  border-radius: 4px;
}
.tile-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: 0.08em;
  line-height: 1.1;
  margin: 0;
  color: var(--white);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.tile-subtitle {
  font-size: 0.75rem;
  color: var(--soft-white);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.tile-progress {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.12em;
  color: var(--gold);
  background: rgba(255, 215, 0, 0.12);
  border: 1px solid rgba(255, 215, 0, 0.35);
  border-radius: 999px;
  padding: 2px 14px;
  margin-top: 4px;
}
.category-tile.played .tile-progress {
  color: var(--soft-white);
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
}

.board-footer {
  text-align: center;
  margin-top: 48px;
}

/* ============ QUESTION SCREEN ============ */
.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.category-tag, .difficulty-tag {
  font-family: var(--font-display);
  letter-spacing: 0.12em;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 1.1rem;
}
.category-tag {
  background: rgba(255, 215, 0, 0.15);
  color: var(--gold);
  border: 1px solid var(--gold-dim);
}
.difficulty-tag {
  background: rgba(255, 255, 255, 0.06);
  color: var(--soft-white);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.difficulty-tag[data-difficulty="easy"] { color: var(--green); border-color: rgba(51, 255, 102, 0.4); }
.difficulty-tag[data-difficulty="hard"] { color: var(--red); border-color: rgba(255, 51, 102, 0.4); }

.question-stage {
  max-width: 1100px;
  margin: 0 auto 32px;
  display: flex;
  justify-content: center;
}

.podium {
  position: relative;
  background:
    url("../assets/img/podium.svg") center bottom / contain no-repeat,
    linear-gradient(180deg, rgba(45, 27, 78, 0.85) 0%, rgba(10, 10, 46, 0.95) 100%);
  border: 2px solid rgba(255, 215, 0, 0.5);
  border-radius: 12px;
  padding: 48px 64px;
  max-width: 900px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow);
}

.podium-light {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 80px;
  background: radial-gradient(ellipse, rgba(255, 215, 0, 0.5) 0%, transparent 70%);
  pointer-events: none;
}

.prompt {
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  line-height: 1.5;
  margin: 0;
  font-weight: 600;
  color: var(--white);
}

.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 1100px;
  margin: 0 auto 32px;
}

@media (max-width: 700px) {
  .options-grid { grid-template-columns: 1fr; }
}

.option {
  background: linear-gradient(135deg, rgba(45, 27, 78, 0.85) 0%, rgba(10, 10, 46, 0.95) 100%);
  border: 2px solid rgba(255, 215, 0, 0.3);
  border-radius: 8px;
  padding: 20px 24px;
  font-size: 1rem;
  color: var(--white);
  text-align: left;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  transition: all 0.2s ease;
  line-height: 1.4;
}
.option:hover:not(.disabled) {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(45, 27, 78, 0.95) 0%, rgba(10, 10, 46, 1) 100%);
  transform: translateY(-2px);
}
.option.selected {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 215, 0, 0.05) 100%);
  box-shadow: var(--shadow-glow-gold);
}
.option.disabled {
  opacity: 0.2;
  cursor: not-allowed;
  pointer-events: none;
}
.option.eliminated {
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

.option-letter {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--gold);
  background: rgba(255, 215, 0, 0.12);
  padding: 4px 12px;
  border-radius: 4px;
  flex-shrink: 0;
}

.question-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
  gap: 24px;
  flex-wrap: wrap;
}

.lifelines-bar {
  display: flex;
  gap: 12px;
}

.lifeline-btn {
  background: rgba(45, 27, 78, 0.6);
  border: 2px solid rgba(255, 215, 0, 0.4);
  border-radius: 8px;
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--white);
  transition: all 0.2s ease;
}
.lifeline-btn:hover:not(:disabled) {
  border-color: var(--gold);
  box-shadow: var(--shadow-glow-gold);
}
.lifeline-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}
.ll-icon {
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 1rem;
  letter-spacing: 0.1em;
}
.ll-label {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--soft-white);
}

.lock-area {
  display: flex;
  align-items: center;
  gap: 16px;
}

.countdown {
  position: relative;
  width: 64px;
  height: 64px;
}
.countdown-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 6;
}
.ring-fg {
  fill: none;
  stroke: var(--gold);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 283;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.1s linear;
}
.countdown-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--gold);
}

/* ============ REVEAL SCREEN ============ */
#screen-reveal { display: none; }
#screen-reveal.active { display: flex; align-items: center; justify-content: center; padding-top: 8vh; }

.reveal-wrap {
  text-align: center;
  max-width: 800px;
}

.reveal-verdict {
  font-family: var(--font-display);
  font-size: clamp(4rem, 10vw, 8rem);
  margin: 0 0 16px;
  letter-spacing: 0.1em;
  line-height: 0.9;
}
.reveal-verdict.correct { color: var(--green); text-shadow: 0 0 40px rgba(51, 255, 102, 0.5); }
.reveal-verdict.wrong { color: var(--red); text-shadow: 0 0 40px rgba(255, 51, 102, 0.5); }

.reveal-detail {
  font-size: 1.2rem;
  color: var(--soft-white);
  margin: 0 0 24px;
}

.reveal-rationale {
  background: rgba(45, 27, 78, 0.6);
  border-left: 4px solid var(--gold);
  padding: 20px 24px;
  text-align: left;
  font-size: 1rem;
  line-height: 1.6;
  margin: 0 auto 32px;
  border-radius: 4px;
  color: var(--white);
}

/* ============ END SCREEN ============ */
#screen-end { display: none; }
#screen-end.active { display: flex; align-items: center; justify-content: center; padding-top: 6vh; }

.end-wrap {
  text-align: center;
  max-width: 800px;
}

.end-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 6vw, 5rem);
  margin: 0 0 24px;
  letter-spacing: 0.1em;
  color: var(--gold);
}

.final-score {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 16px;
  margin: 24px 0 8px;
}
.big-num {
  font-family: var(--font-display);
  font-size: 5rem;
  color: var(--white);
  line-height: 1;
}
.of { color: var(--soft-white); font-size: 1.2rem; letter-spacing: 0.1em; }
.final-pct {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--gold);
  letter-spacing: 0.1em;
  margin-bottom: 24px;
}

.verdict-banner {
  font-family: var(--font-display);
  font-size: 3rem;
  letter-spacing: 0.2em;
  padding: 16px 48px;
  border-radius: 8px;
  margin: 0 auto 32px;
  display: inline-block;
}
.verdict-banner.pass { background: rgba(51, 255, 102, 0.15); color: var(--green); border: 2px solid var(--green); }
.verdict-banner.fail { background: rgba(255, 51, 102, 0.15); color: var(--red); border: 2px solid var(--red); }

.by-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin: 32px 0;
}
@media (max-width: 700px) { .by-week { grid-template-columns: repeat(4, 1fr); } }

.week-card {
  background: rgba(45, 27, 78, 0.6);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 4px;
  padding: 12px 8px;
  font-family: var(--font-display);
  letter-spacing: 0.05em;
}
.week-card .wk { color: var(--gold); font-size: 0.9rem; }
.week-card .wk-score { font-size: 1.4rem; }

.end-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

/* ============ MODALS ============ */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}
.modal.hidden { display: none; }

.modal-inner {
  background: linear-gradient(180deg, var(--purple) 0%, var(--deep-blue) 100%);
  border: 2px solid var(--gold);
  border-radius: 12px;
  padding: 32px;
  max-width: 600px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-glow-gold);
}

.phone-header, .audience-header {
  font-family: var(--font-display);
  color: var(--gold);
  letter-spacing: 0.15em;
  font-size: 1.5rem;
  margin-bottom: 24px;
}

.phone-screen {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 6px;
  padding: 24px;
  margin-bottom: 24px;
  font-size: 1.1rem;
  line-height: 1.6;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.audience-bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  align-items: end;
  min-height: 220px;
  margin-bottom: 24px;
}

.audience-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.audience-bar .bar-fill {
  width: 100%;
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold-dim) 100%);
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: height 1.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  height: 0;
}
.audience-bar .bar-pct {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--gold);
}
.audience-bar .bar-letter {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--white);
  background: rgba(255, 215, 0, 0.15);
  padding: 4px 12px;
  border-radius: 4px;
}
