/* ═══════════════════════════════════════════════════
   Finance Challenge — Dark Game Show UI
   Mobile-first, no external fonts, sub-1s render
═══════════════════════════════════════════════════ */

/* ── Design Tokens ──────────────────────────────── */
:root {
  --bg:           #0a0e1a;
  --bg-card:      #131929;
  --bg-card-2:    #1a2035;
  --gold:         #f5a623;
  --gold-dark:    #d4881c;
  --gold-dim:     rgba(245,166,35,0.15);
  --gold-glow:    rgba(245,166,35,0.35);
  --gold-border:  rgba(245,166,35,0.28);
  --correct:      #22c55e;
  --correct-bg:   rgba(34,197,94,0.12);
  --correct-glow: rgba(34,197,94,0.35);
  --wrong:        #ef4444;
  --wrong-bg:     rgba(239,68,68,0.12);
  --wrong-glow:   rgba(239,68,68,0.35);
  --text:         #ffffff;
  --text-muted:   #9ca3af;
  --text-dim:     rgba(255,255,255,0.35);
  --radius:       14px;
  --radius-sm:    8px;
  --radius-pill:  999px;
  --transition:   0.18s ease;
  --font:         -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Reset & Base ───────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  /* Subtle radial glow — game show spotlight effect */
  background-image:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(245,166,35,0.06) 0%, transparent 60%);
}

img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; outline: none; font-family: var(--font); }
a { color: inherit; text-decoration: none; }

/* ── Layout ─────────────────────────────────────── */
.page {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100dvh;
  padding: 0 20px 40px;
}

.container {
  width: 100%;
  max-width: 480px;
}

/* ── Brand Label ────────────────────────────────── */
.brand-label {
  display: block;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--gold);
  padding: 24px 0 0;
  text-transform: uppercase;
}

/* ═══════════════════════════════════════════════
   START / LANDING PAGE
═══════════════════════════════════════════════ */
.start-page {
  justify-content: center;
  text-align: center;
  padding-top: 0;
}

.start-icon {
  font-size: 160px;
  font-weight: 500;
  line-height: 1;
  margin: 10px auto 24px;
  color: transparent;
  -webkit-text-stroke: 5px var(--gold);
  filter: drop-shadow(0 0 24px var(--gold-glow));
  animation: pulse-glow 2.8s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { filter: drop-shadow(0 0 24px var(--gold-glow)); }
  50%       { filter: drop-shadow(0 0 48px rgba(245,166,35,0.6)); }
}

.start-headline {
  font-size: clamp(26px, 7vw, 36px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  text-shadow: 0 0 40px rgba(255,255,255,0.1);
}

.start-subtext {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 40px;
  letter-spacing: 0.02em;
}

.social-proof {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-dim);
}

.social-proof-dot {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--text-dim);
}

/* ═══════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  border-radius: var(--radius-pill);
  padding: 16px 32px;
  width: 100%;
  transition: var(--transition);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #1a0f00;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.08),
    0 4px 24px var(--gold-glow),
    0 2px 8px rgba(0,0,0,0.4);
}

.btn-gold:hover, .btn-gold:focus {
  transform: translateY(-1px);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.1),
    0 6px 32px rgba(245,166,35,0.55),
    0 2px 8px rgba(0,0,0,0.4);
}

.btn-gold:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid rgba(255,255,255,0.1);
}

/* ═══════════════════════════════════════════════
   QUESTION PAGE
═══════════════════════════════════════════════ */

/* Progress Dots */
.progress-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 28px;
  gap: 8px;
}

.progress-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.progress-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  transition: background 0.3s, box-shadow 0.3s;
  flex-shrink: 0;
}

.progress-dot.filled {
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold-glow);
}

.progress-dot.current {
  background: var(--gold);
  box-shadow: 0 0 12px rgba(245,166,35,0.7);
  transform: scale(1.2);
}

/* Timer */
.timer-wrap {
  position: relative;
  width: 44px; height: 44px;
  flex-shrink: 0;
}

.timer-svg {
  transform: rotate(-90deg);
  position: absolute;
  inset: 0;
}

.timer-track {
  fill: none;
  stroke: rgba(255,255,255,0.08);
  stroke-width: 3;
}

.timer-fill {
  fill: none;
  stroke: var(--gold);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 113; /* 2π × 18 */
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke 0.5s;
}

.timer-fill.urgent { stroke: var(--wrong); }

.timer-number {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
}

.timer-number.urgent { color: var(--wrong); }

/* Question Text */
.question-text {
  font-size: clamp(20px, 5.5vw, 26px);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-bottom: 28px;
  text-align: center;
}

/* Answer Options */
.options-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.option-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--bg-card);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.option-btn:hover:not(:disabled) {
  background: var(--bg-card-2);
  border-color: var(--gold);
  box-shadow: 0 0 16px var(--gold-dim);
  transform: translateX(3px);
}

.option-letter {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--gold-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  flex-shrink: 0;
  transition: inherit;
}

.option-btn:hover:not(:disabled) .option-letter {
  background: var(--gold-dim);
  border-color: var(--gold);
}

/* Feedback States */
.option-btn.correct {
  background: var(--correct-bg);
  border-color: var(--correct);
  box-shadow: 0 0 20px var(--correct-glow);
  pointer-events: none;
}

.option-btn.correct .option-letter {
  background: var(--correct);
  border-color: var(--correct);
  color: #fff;
}

.option-btn.wrong {
  background: var(--wrong-bg);
  border-color: var(--wrong);
  box-shadow: 0 0 20px var(--wrong-glow);
  pointer-events: none;
}

.option-btn.wrong .option-letter {
  background: var(--wrong);
  border-color: var(--wrong);
  color: #fff;
}

.option-btn:disabled { pointer-events: none; opacity: 0.45; }

/* Feedback Panel (slides up after answer) */
.feedback-panel {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--gold-border);
  border-radius: 20px 20px 0 0;
  padding: 24px 20px 36px;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 50;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.5);
}

.feedback-panel.show { transform: translateY(0); }

.feedback-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.feedback-icon {
  font-size: 28px;
  line-height: 1;
}

.feedback-label {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.feedback-label.correct { color: var(--correct); }
.feedback-label.wrong   { color: var(--wrong); }

.feedback-fact {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

.feedback-fact strong { color: var(--text); }

.feedback-advance {
  font-size: 12px;
  text-align: center;
  color: var(--text-dim);
  margin-top: 10px;
}

/* ═══════════════════════════════════════════════
   RESULT PAGE
═══════════════════════════════════════════════ */
.result-page {
  text-align: center;
  padding-top: 0;
}

.result-trophy {
  font-size: 88px;
  line-height: 1;
  margin: 28px auto 16px;
  filter: drop-shadow(0 0 32px var(--gold-glow));
  animation: trophy-bounce 0.6s cubic-bezier(0.34,1.56,0.64,1) forwards;
}

@keyframes trophy-bounce {
  0%   { transform: scale(0.4); opacity: 0; }
  100% { transform: scale(1);   opacity: 1; }
}

.result-score {
  font-size: 56px;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 10px;
}

.result-stars {
  font-size: 26px;
  letter-spacing: 4px;
  margin-bottom: 14px;
}

.result-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #1a0f00;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  margin-bottom: 12px;
}

.result-percentile {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.result-percentile strong { color: var(--gold); font-size: 17px; }

.result-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.07);
  margin: 20px 0;
}

.result-description {
  background: var(--bg-card);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius);
  padding: 16px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  text-align: left;
  margin-bottom: 20px;
}

/* Share Row */
.share-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.share-label {
  font-size: 13px;
  color: var(--text-dim);
}

.share-btns { display: flex; gap: 8px; }

.share-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: transform 0.15s;
}

.share-btn:hover { transform: scale(1.15); }
.share-btn.fb   { background: #1877f2; }
.share-btn.tw   { background: #1da1f2; }
.share-btn.wa   { background: #25d366; }

/* Next Quiz Cards */
.next-quiz-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  text-transform: uppercase;
  text-align: left;
  margin-bottom: 10px;
}

.next-quiz-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 24px;
}

.next-quiz-card {
  background: var(--bg-card);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius);
  padding: 14px 12px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color var(--transition), background var(--transition);
}

.next-quiz-card:hover {
  border-color: var(--gold);
  background: var(--bg-card-2);
}

.next-quiz-card-icon { font-size: 22px; margin-bottom: 4px; }
.next-quiz-card-sub  { font-size: 11px; color: var(--text-dim); font-weight: 400; }

/* ═══════════════════════════════════════════════
   INTERSTITIAL OVERLAY
═══════════════════════════════════════════════ */
#interstitial-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 1000;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.interstitial-container {
  width: 100%;
  max-width: 480px;
  position: relative;
}

.interstitial-close-btn {
  position: absolute;
  top: -44px;
  right: 0;
  background: rgba(255,255,255,0.12);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background var(--transition);
}

.interstitial-close-btn:disabled {
  opacity: 0.4;
  pointer-events: none;
}

.interstitial-close-btn:not(:disabled):hover { background: rgba(255,255,255,0.2); }

/* ═══════════════════════════════════════════════
   AD PLACEHOLDERS  (swap with real GPT tags later)
═══════════════════════════════════════════════ */
.ad-placeholder {
  background: rgba(255,255,255,0.025);
  border: 1px dashed rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 0 auto;
  overflow: hidden;
}

.ad-placeholder .ad-tag {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.18);
  font-weight: 600;
}

.ad-placeholder .ad-size {
  font-size: 11px;
  color: rgba(255,255,255,0.12);
}

/* Banner 320×50 */
.ad-banner {
  width: 320px;
  height: 50px;
}

/* Mid Rectangle 300×250 */
.ad-mid {
  width: 300px;
  height: 250px;
  margin-top: 16px;
}

/* Interstitial full-screen content */
.ad-interstitial-content {
  width: 100%;
  height: 260px;
  background: rgba(255,255,255,0.03);
  border: 1px dashed rgba(255,255,255,0.12);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.ad-interstitial-content .ad-tag {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.25);
  font-weight: 600;
}

.ad-interstitial-content .ad-type {
  font-size: 14px;
  color: rgba(255,255,255,0.35);
}

.ad-interstitial-content .ad-cpm {
  font-size: 12px;
  color: var(--gold);
  opacity: 0.6;
}

/* Banner wrap (sticky bottom on question page) */
.banner-wrap {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex;
  justify-content: center;
  padding: 8px;
  background: linear-gradient(to top, var(--bg) 60%, transparent);
  z-index: 10;
}

/* ═══════════════════════════════════════════════
   UTILS
═══════════════════════════════════════════════ */
.spacer { flex: 1; }

.text-center { text-align: center; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

/* Extra bottom padding when sticky banner is present */
.has-sticky-ad { padding-bottom: 80px; }
