/* ── Timed Trivia Challenge — 1970s TV game show set ────────────────
   Burgundy stage curtain, chasing marquee bulbs, flip-clock shot
   timer that flushes red, podium-button choices with gold bevels,
   starburst grand-total panel, cue-card answer review. */

:root {
  --curtain: #4a1220;
  --curtain-dark: #350a16;
  --gold: #e8b73c;
  --gold-deep: #c2932a;
  --cream: #fdf3dc;
  --teal-pop: #2fa79a;
  --alarm: #e3452f;
  --ok: #3fae62;
  --ink: #2c1a10;
  --ink-soft: rgba(253, 243, 220, 0.65);
  --display: 'Bowlby One', cursive;
  --mono: 'IBM Plex Mono', monospace;
  --sans: 'DM Sans', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

.hidden { display: none !important; }

body {
  font-family: var(--sans);
  color: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.22) 0 22px, transparent 22px 44px),
    linear-gradient(180deg, var(--curtain), var(--curtain-dark));
  background-attachment: fixed;
  min-height: 100vh;
}

.studio { min-height: 100vh; display: flex; flex-direction: column; }

.wrap { width: 100%; max-width: 620px; margin: 0 auto; padding: 0 24px; }

main { flex: 1 0 auto; padding-bottom: 60px; }

/* ── Marquee ──────────────────────────────────────────────────────── */
.marquee { text-align: center; padding: 40px 24px 10px; }

.bulb-row { display: flex; justify-content: center; gap: 14px; }

.bulb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px rgba(232, 183, 60, 0.9);
  animation: chase 1.2s steps(2) infinite;
}

.bulb:nth-child(2n) { animation-delay: 0.6s; }

@keyframes chase {
  0%, 49%  { opacity: 1; }
  50%, 100% { opacity: 0.25; box-shadow: none; }
}

.marquee h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.2rem, 9vw, 3.8rem);
  line-height: 1.05;
  text-transform: uppercase;
  color: var(--gold);
  text-shadow: 0 3px 0 #7a5312, 0 8px 22px rgba(0, 0, 0, 0.55);
  margin: 18px 0 8px;
}

.amp {
  font-size: 0.55em;
  color: var(--cream);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.4);
  vertical-align: middle;
}

.tagline {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 18px;
}

/* ── Stage card ───────────────────────────────────────────────────── */
.stage-card {
  background: rgba(0, 0, 0, 0.32);
  border: 2px solid var(--gold);
  border-radius: 16px;
  padding: 30px 30px 28px;
  margin-top: 24px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(232, 183, 60, 0.25);
}

/* intro */
.intro { text-align: center; }

.host-line { font-family: var(--display); font-size: 1.2rem; color: var(--cream); margin-bottom: 16px; }

.rules-list {
  list-style: none;
  display: grid;
  gap: 10px;
  max-width: 380px;
  margin: 0 auto 24px;
  text-align: left;
}

.rules-list li {
  background: rgba(232, 183, 60, 0.08);
  border-left: 4px solid var(--gold);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 0.95rem;
}

.rules-list strong { color: var(--gold); }

/* ── Quiz head ────────────────────────────────────────────────────── */
.quiz-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.q-counter {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
}

.shot-clock {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.7rem;
  min-width: 76px;
  text-align: center;
  color: var(--ink);
  background: linear-gradient(180deg, var(--gold), var(--gold-deep));
  border-radius: 10px;
  padding: 6px 16px;
  box-shadow: 0 4px 0 #8a6417, inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: background 0.3s ease, color 0.3s ease;
}

.shot-clock.danger {
  background: linear-gradient(180deg, var(--alarm), #b1301e);
  color: #fff;
  box-shadow: 0 4px 0 #7c1f11, 0 0 22px rgba(227, 69, 47, 0.6);
  animation: pulse 0.5s ease infinite alternate;
}

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

/* question */
.q-text {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.22rem;
  line-height: 1.4;
  text-align: center;
  margin-bottom: 20px;
}

.choices { display: grid; gap: 10px; }

.choice-btn {
  width: 100%;
  text-align: center;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
  background: linear-gradient(180deg, var(--cream), #ecd9b4);
  border: none;
  border-radius: 10px;
  padding: 15px 18px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  box-shadow: 0 5px 0 var(--gold-deep);
}

.choice-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 7px 0 var(--gold-deep); }
.choice-btn:disabled { cursor: default; }
.choice-btn.picked { background: linear-gradient(180deg, var(--teal-pop), #24857b); color: #fff; box-shadow: 0 5px 0 #17564f; }
.choice-btn.timeout { opacity: 0.4; }

.timeout-flash {
  text-align: center;
  font-family: var(--display);
  font-size: 1.3rem;
  color: var(--alarm);
  text-transform: uppercase;
  margin-top: 16px;
  animation: pulse 0.4s ease infinite alternate;
}

/* ── Gate ─────────────────────────────────────────────────────────── */
.gate { text-align: center; }

.gate h2 { font-family: var(--display); font-size: 1.7rem; color: var(--gold); text-transform: uppercase; }

.lead { color: var(--ink-soft); margin: 8px 0 22px; }

.field { margin-bottom: 16px; text-align: left; }

label {
  display: block;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.64rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  margin-bottom: 6px;
  color: var(--gold);
}

input[type="text"],
input[type="email"] {
  width: 100%;
  padding: 13px 15px;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--cream);
  background: rgba(253, 243, 220, 0.08);
  border: 1.5px solid rgba(253, 243, 220, 0.25);
  border-radius: 10px;
  transition: border-color 0.15s ease;
}

input:focus { outline: none; border-color: var(--gold); }
input.error { border-color: var(--alarm); }
input::placeholder { color: rgba(253, 243, 220, 0.35); }

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  background: linear-gradient(180deg, var(--gold), var(--gold-deep));
  border: none;
  border-radius: 12px;
  padding: 16px 32px;
  cursor: pointer;
  transition: transform 0.12s ease;
  box-shadow: 0 6px 0 #8a6417;
}

.btn:hover:not(:disabled) { transform: translateY(-2px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn:focus-visible { outline: 3px solid var(--cream); outline-offset: 3px; }

.btn-big { font-size: 1.25rem; padding: 18px 40px; }
.btn-block { width: 100%; }

.form-error { color: #ff9a86; font-weight: 700; text-align: center; margin-top: 14px; }

.spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2.5px solid rgba(44, 26, 16, 0.35);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Result ───────────────────────────────────────────────────────── */
.total-panel {
  position: relative;
  text-align: center;
  background: linear-gradient(180deg, var(--gold), var(--gold-deep));
  color: var(--ink);
  border-radius: 16px;
  padding: 36px 30px;
  margin-top: 24px;
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
}

.burst {
  position: absolute;
  inset: -40%;
  background: repeating-conic-gradient(rgba(255, 255, 255, 0.16) 0 9deg, transparent 9deg 18deg);
  animation: rotate 30s linear infinite;
  pointer-events: none;
}

@keyframes rotate { to { transform: rotate(360deg); } }

.total-tag {
  position: relative;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.score-line {
  position: relative;
  font-family: var(--display);
  font-size: clamp(2.6rem, 10vw, 4rem);
  line-height: 1;
}

.total-panel h2 {
  position: relative;
  font-family: var(--display);
  font-size: 1.35rem;
  text-transform: uppercase;
  margin-top: 10px;
}

.result-desc { position: relative; margin-top: 8px; max-width: 420px; margin-left: auto; margin-right: auto; font-weight: 500; }

/* review cue cards */
.review { display: grid; gap: 10px; margin-top: 22px; }

.review-card {
  background: var(--cream);
  color: var(--ink);
  border-radius: 10px;
  padding: 14px 16px;
  border-left: 6px solid var(--ok);
}

.review-card.missed { border-left-color: var(--alarm); }

.review-q { font-weight: 700; font-size: 0.95rem; }

.review-a { font-size: 0.88rem; margin-top: 4px; color: #6d5c49; }

.review-a strong.right { color: var(--ok); }
.review-a strong.wrong { color: var(--alarm); }

.challenge-line { text-align: center; color: var(--ink-soft); font-size: 0.9rem; margin-top: 22px; }

/* ── Footer ───────────────────────────────────────────────────────── */
.foot {
  text-align: center;
  padding: 30px 20px;
  color: rgba(253, 243, 220, 0.45);
  font-size: 0.8rem;
}

#wbx-powered-by-slot { margin-top: 12px; }

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 540px) {
  .stage-card { padding: 24px 18px 22px; }
  .total-panel { padding: 30px 20px; }
}
