/* ═══════════════════════════════════════════════
   QuizBlitz — Electric dark + gold design system
═══════════════════════════════════════════════ */

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

:root {
  /* Brand */
  --purple:    #7c3aed;
  --purple-l:  #a78bfa;
  --purple-d:  #5b21b6;
  --gold:      #f5c518;
  --gold-d:    #d4a800;
  --orange:    #f97316;
  /* Semantic */
  --green:     #059669;
  --green-l:   #d1fae5;
  --red:       #dc2626;
  --red-l:     #fee2e2;
  --amber:     #f59e0b;
  /* Neutrals */
  --bg:        #f0f2f8;
  --white:     #ffffff;
  --gray-1:    #f8fafc;
  --gray-2:    #e2e8f0;
  --gray-3:    #94a3b8;
  --gray-4:    #64748b;
  --text:      #1e293b;
  /* Hero / icon palette */
  --hero-top:  #3d1073;
  --hero-mid:  #1a0533;
  --hero-edge: #0d0520;
  /* Radii & shadows */
  --radius:    16px;
  --shadow:    0 4px 24px rgba(124,58,237,0.14);
  --shadow-sm: 0 2px 10px rgba(0,0,0,0.08);
  --shadow-gold: 0 6px 24px rgba(245,197,24,0.45);
  --shadow-purple: 0 6px 24px rgba(124,58,237,0.4);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  font-family: 'Nunito', 'Segoe UI', sans-serif;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

#app {
  width: 100%;
  max-width: 500px;
  padding: 0 16px 56px;
}

/* ── Screens ────────────────────────────────── */
.screen { display: none; }
.screen.active { display: block; animation: slideUp 0.35s cubic-bezier(.22,.68,0,1.2) both; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════════
   HOME SCREEN
══════════════════════════════════════════════ */

/* ── Hero card ──────────────────────────────── */
.home-hero {
  background: radial-gradient(ellipse at 50% 0%, var(--hero-top) 0%, var(--hero-mid) 55%, var(--hero-edge) 100%);
  border-radius: 24px;
  padding: 44px 24px 30px;
  margin-bottom: 14px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(13,5,32,0.55), inset 0 1px 0 rgba(255,255,255,0.06);
}

.home-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.12) 1px, transparent 1px),
    radial-gradient(circle, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 44px 44px, 72px 72px;
  background-position: 0 0, 22px 22px;
  pointer-events: none;
}

.home-hero::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 24px;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
}

.logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}

.logo-icon {
  font-size: 2.6rem;
  filter: drop-shadow(0 2px 8px rgba(245,197,24,0.6));
  animation: float 3.5s ease-in-out infinite;
}

.logo-text {
  font-size: 2.4rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-7px); }
}

.logo-sub {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  position: relative;
  z-index: 1;
}

/* ── Auth bars ──────────────────────────────── */
.auth-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #2d1060, #1a0533);
  border: 1px solid rgba(167,139,250,0.25);
  border-radius: 12px;
  padding: 10px 16px;
  margin-bottom: 12px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--purple-l);
}

.auth-bar-links { display: flex; gap: 12px; align-items: center; }

.auth-link {
  color: #a78bfa;
  font-weight: 800;
  text-decoration: none;
  font-size: 0.82rem;
}
.auth-link:hover { color: var(--gold); }

.auth-link-btn {
  background: none;
  border: none;
  color: #f87171;
  font-family: 'Nunito', sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  padding: 0;
}
.auth-link-btn:hover { color: var(--red); }

.login-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--white);
  border: 1.5px solid var(--gray-2);
  border-radius: 12px;
  padding: 10px 16px;
  margin-bottom: 12px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gray-4);
}

.login-bar-cta {
  color: var(--purple);
  font-weight: 800;
  text-decoration: none;
  font-size: 0.82rem;
  white-space: nowrap;
}
.login-bar-cta:hover { color: var(--purple-d); }

/* ── Stat row ───────────────────────────────── */
.stat-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.stat-chip {
  flex: 1;
  background: var(--white);
  border-radius: var(--radius);
  padding: 14px 10px 12px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1.5px solid transparent;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.stat-chip::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
}

.stat-row .stat-chip:nth-child(1)::before { background: linear-gradient(90deg, #f97316, #dc2626); }
.stat-row .stat-chip:nth-child(2)::before { background: linear-gradient(90deg, #f5c518, #f97316); }
.stat-row .stat-chip:nth-child(3)::before { background: linear-gradient(90deg, #7c3aed, #a78bfa); }

.stat-chip:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.stat-chip.highlight {
  border-color: rgba(245,197,24,0.5);
  background: linear-gradient(160deg, #fffdf0 0%, #fffbeb 100%);
}

.stat-num {
  font-size: 1.7rem;
  font-weight: 900;
  color: var(--purple);
  line-height: 1;
}

.stat-lbl {
  font-size: 0.7rem;
  color: var(--gray-4);
  font-weight: 700;
  margin-top: 5px;
}

/* ── Date pill ──────────────────────────────── */
.date-pill {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gray-4);
  background: var(--white);
  border-radius: 100px;
  padding: 7px 16px;
  margin: 0 auto 16px;
  width: 100%;
  box-shadow: var(--shadow-sm);
  border: 1.5px solid var(--gray-2);
}

/* Archive banner */
.archive-banner {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--purple);
  background: #f5f3ff;
  border: 2px solid #ddd6fe;
  border-radius: 100px;
  padding: 8px 18px;
  margin: -4px auto 16px;
  width: 100%;
}

/* ── CTA buttons ────────────────────────────── */
.cta-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 17px 20px;
  background: linear-gradient(135deg, var(--purple), var(--purple-d));
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: 'Nunito', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  margin-bottom: 12px;
  box-shadow: var(--shadow-purple);
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  letter-spacing: 0.01em;
}

.cta-btn:hover  { transform: translateY(-2px); box-shadow: 0 10px 32px rgba(124,58,237,0.5); }
.cta-btn:active { transform: translateY(0); }

/* Play button — GOLD */
#btn-play {
  background: linear-gradient(135deg, var(--gold) 0%, var(--orange) 100%);
  color: var(--hero-edge);
  font-size: 1.12rem;
  font-weight: 900;
  box-shadow: var(--shadow-gold);
  animation: pulse-gold 2.5s ease-in-out infinite;
}

#btn-play:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 36px rgba(245,197,24,0.65);
  animation: none;
}

@keyframes pulse-gold {
  0%, 100% { box-shadow: 0 6px 24px rgba(245,197,24,0.45); }
  50%       { box-shadow: 0 6px 36px rgba(245,197,24,0.75); }
}

.cta-btn.secondary {
  background: var(--white);
  color: var(--purple);
  border: 2px solid var(--purple-l);
  box-shadow: var(--shadow-sm);
}
.cta-btn.secondary:hover { background: #f5f3ff; box-shadow: var(--shadow); }

/* Share row */
.share-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.share-row .cta-btn { margin-bottom: 0; }
.share-row .share-btn { flex: 2; }
.share-row .share-copy-btn { flex: 1; }

.cta-btn.share-btn {
  background: linear-gradient(135deg, #059669, #047857);
  box-shadow: 0 4px 16px rgba(5,150,105,0.4);
}
.cta-btn.share-btn:hover { box-shadow: 0 8px 28px rgba(5,150,105,0.55); }

.btn-arrow { font-size: 1.2rem; }

/* ── How to Play card ───────────────────────── */
.how-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  border-top: 3px solid transparent;
  background-clip: padding-box;
  position: relative;
}

.how-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--orange), var(--purple));
  border-radius: var(--radius) var(--radius) 0 0;
}

.how-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gray-3);
  font-weight: 800;
  margin-bottom: 14px;
}

.how-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}
.how-row:last-child { margin-bottom: 0; }

.how-num {
  background: linear-gradient(135deg, var(--gold), var(--orange));
  color: var(--hero-edge);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 900;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(245,197,24,0.4);
}

/* ══════════════════════════════════════════════
   QUESTION SCREEN
══════════════════════════════════════════════ */

.q-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 0 10px;
  font-weight: 800;
  font-size: 0.9rem;
}

.q-progress-label { color: var(--gray-4); font-weight: 700; }

.q-live-score {
  background: linear-gradient(135deg, var(--gold), var(--orange));
  color: var(--hero-edge);
  padding: 5px 16px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 900;
  box-shadow: 0 2px 10px rgba(245,197,24,0.4);
}

/* Progress dots */
.dot-track {
  display: flex;
  gap: 7px;
  margin-bottom: 14px;
}

.dot {
  flex: 1;
  height: 7px;
  border-radius: 4px;
  background: var(--gray-2);
  transition: all 0.3s;
}

.dot.active  { background: var(--purple-l); box-shadow: 0 0 8px rgba(167,139,250,0.5); }
.dot.correct { background: var(--green); box-shadow: 0 0 8px rgba(5,150,105,0.4); }
.dot.wrong   { background: var(--red);   box-shadow: 0 0 8px rgba(220,38,38,0.4); }

/* Timer bar */
.countup-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
  border: 2px solid var(--gray-2);
  border-radius: 12px;
  padding: 8px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.timer-elapsed {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}

.pts-available {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--green);
  transition: color 0.4s;
}
.pts-available.reduced { color: var(--amber); }

/* Category banner */
.cat-banner {
  display: inline-block;
  background: linear-gradient(135deg, var(--purple), var(--purple-d));
  color: white;
  padding: 5px 18px;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  box-shadow: 0 2px 10px rgba(124,58,237,0.35);
}

/* Question box */
.question-box {
  background: var(--white);
  border-radius: 20px;
  padding: 28px 24px;
  margin-bottom: 16px;
  min-height: 116px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  border-left: 5px solid var(--purple);
  position: relative;
  overflow: hidden;
}

.question-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, rgba(124,58,237,0.03) 0%, transparent 60%);
  pointer-events: none;
}

.question-txt {
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.5;
  text-align: center;
  color: var(--text);
  position: relative;
}

/* Typed answer input */
.answer-input-wrap {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.answer-input {
  flex: 1;
  padding: 15px 18px;
  border: 2px solid var(--gray-2);
  border-radius: var(--radius);
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  background: var(--white);
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.answer-input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.12);
}

.answer-input::placeholder { color: var(--gray-3); font-weight: 600; }

.answer-input.correct {
  border-color: var(--green);
  background: var(--green-l);
  color: #065f46;
}
.answer-input.wrong {
  border-color: var(--red);
  background: var(--red-l);
  color: #7f1d1d;
}
.answer-input.timeout {
  border-color: var(--amber);
  background: #fffbeb;
  color: #92400e;
}
.answer-input:disabled { cursor: default; }

.answer-submit-btn {
  padding: 0 22px;
  background: linear-gradient(135deg, var(--gold), var(--orange));
  color: var(--hero-edge);
  border: none;
  border-radius: var(--radius);
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  box-shadow: 0 2px 10px rgba(245,197,24,0.4);
}

.answer-submit-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(245,197,24,0.55);
}
.answer-submit-btn:disabled { opacity: 0.45; cursor: default; }

/* Hint */
.hint-btn {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 11px;
  background: transparent;
  border: 2px dashed var(--gray-2);
  border-radius: 12px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--gray-3);
  cursor: pointer;
  transition: all 0.2s;
}
.hint-btn:hover:not(:disabled) {
  border-color: var(--gold);
  color: var(--gold-d);
  background: rgba(245,197,24,0.06);
}
.hint-btn.exhausted { opacity: 0.5; cursor: not-allowed; }

.hint-box {
  margin-top: 10px;
  padding: 14px 16px;
  background: #fffbeb;
  border: 2px solid #fde68a;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #92400e;
  line-height: 1.5;
}

/* Dispute button */
.dispute-btn {
  display: block;
  margin: 10px auto 0;
  background: none;
  border: none;
  color: var(--gray-4);
  font-size: 0.78rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 4px 8px;
}
.dispute-btn:hover { color: var(--red); }

/* Dispute overlay + modal */
.dispute-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 16px;
}
.dispute-modal {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px 20px 20px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
}
.dispute-modal-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
}
.dispute-context {
  font-size: 0.8rem;
  color: var(--gray-4);
  background: var(--gray-1);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
  line-height: 1.4;
}
.dispute-textarea {
  width: 100%;
  border: 1.5px solid var(--gray-2);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
  outline: none;
  color: var(--text);
}
.dispute-textarea:focus { border-color: var(--purple); }
.dispute-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.dispute-cancel {
  flex: 1;
  padding: 10px;
  border: 1.5px solid var(--gray-2);
  border-radius: 10px;
  background: var(--white);
  color: var(--gray-4);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}
.dispute-cancel:hover { border-color: var(--gray-3); }
.dispute-submit {
  flex: 2;
  padding: 10px;
  border: none;
  border-radius: 10px;
  background: var(--purple);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}
.dispute-submit:hover:not(:disabled) { background: var(--purple-d); }
.dispute-submit:disabled { opacity: 0.6; cursor: default; }
.dispute-feedback {
  margin-top: 12px;
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
}
.dispute-feedback--ok  { color: var(--green); }
.dispute-feedback--err { color: var(--red); }

[data-theme="dark"] .dispute-modal {
  background: #1a0a35;
  color: #f1f5f9;
}
[data-theme="dark"] .dispute-modal-title { color: #f1f5f9; }
[data-theme="dark"] .dispute-context { background: #0d051a; color: var(--gray-3); }
[data-theme="dark"] .dispute-textarea {
  background: #0d051a;
  border-color: #2d1b5e;
  color: #f1f5f9;
}
[data-theme="dark"] .dispute-cancel {
  background: #0d051a;
  border-color: #2d1b5e;
  color: var(--gray-3);
}

/* Did you mean? */
.did-you-mean {
  margin-top: 14px;
  padding: 18px 16px;
  background: #f5f3ff;
  border: 2px solid var(--purple-l);
  border-radius: 16px;
  text-align: center;
  animation: slideUp 0.25s ease both;
}
.dym-text { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 14px; }
.dym-text strong { color: var(--purple); font-weight: 900; }
.dym-buttons { display: flex; gap: 10px; }
.dym-yes, .dym-no {
  flex: 1;
  padding: 12px 8px;
  border-radius: 12px;
  border: 2px solid;
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.18s;
}
.dym-yes { background: var(--green); color: #fff; border-color: var(--green); }
.dym-yes:hover { background: #047857; border-color: #047857; transform: translateY(-1px); }
.dym-no  { background: transparent; color: var(--gray-4); border-color: var(--gray-2); }
.dym-no:hover { border-color: var(--purple); color: var(--purple); background: #f5f3ff; }

/* ══════════════════════════════════════════════
   REVEAL SCREEN
══════════════════════════════════════════════ */

.reveal-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 0 4px;
  text-align: center;
  gap: 14px;
}

.reveal-badge {
  font-size: 1.6rem;
  font-weight: 900;
  padding: 12px 32px;
  border-radius: 100px;
  display: inline-block;
}

.reveal-badge.correct-badge {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: #065f46;
  box-shadow: 0 4px 16px rgba(5,150,105,0.25);
}
.reveal-badge.wrong-badge {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  color: #991b1b;
  box-shadow: 0 4px 16px rgba(220,38,38,0.2);
}
.reveal-badge.fuzzy-badge {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: #065f46;
  box-shadow: 0 4px 16px rgba(5,150,105,0.25);
}

.reveal-pts {
  font-size: 3.2rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--gold), var(--orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  filter: drop-shadow(0 2px 8px rgba(245,197,24,0.3));
}

.reveal-box {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px 24px;
  width: 100%;
  box-shadow: var(--shadow-sm);
  border-left: 5px solid var(--green);
}

.reveal-lbl {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gray-3);
  font-weight: 800;
  margin-bottom: 6px;
}

.reveal-ans {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--green);
}

.reveal-yours {
  background: var(--red-l);
  border-radius: var(--radius);
  padding: 14px 18px;
  width: 100%;
  border-left: 5px solid var(--red);
}
.reveal-yours-text {
  font-size: 1rem;
  font-weight: 800;
  color: var(--red);
}

.reveal-fact {
  font-size: 0.88rem;
  color: var(--gray-4);
  font-weight: 600;
  line-height: 1.6;
  background: var(--gray-1);
  border-radius: 12px;
  padding: 14px 18px;
  width: 100%;
  border-left: 4px solid var(--purple-l);
}

/* ══════════════════════════════════════════════
   RESULTS SCREEN
══════════════════════════════════════════════ */

.results-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0 18px;
}

.results-logo {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--purple);
  display: flex;
  align-items: center;
  gap: 6px;
}

.results-logo-img {
  width: 24px;
  height: 24px;
  position: relative;
  top: -1px;
}

.results-date-lbl {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gray-3);
}

/* Results back button */
.results-home-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--gray-4);
  text-decoration: none;
  transition: color 0.15s;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: 'Nunito', sans-serif;
}
.results-home-btn:hover { color: var(--purple); }

/* Final score card — dark like the icon */
.final-score-card {
  background: radial-gradient(ellipse at 50% 0%, var(--hero-top) 0%, var(--hero-mid) 60%, var(--hero-edge) 100%);
  border-radius: 20px;
  padding: 32px 24px;
  text-align: center;
  color: white;
  margin-bottom: 14px;
  box-shadow: 0 12px 40px rgba(13,5,32,0.5);
  position: relative;
  overflow: hidden;
}

.final-score-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 36px 36px;
  pointer-events: none;
}

.final-lbl {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.6;
  font-weight: 800;
  margin-bottom: 8px;
  position: relative;
}

.final-num {
  font-size: 5rem;
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, var(--gold), var(--orange));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 12px rgba(245,197,24,0.5));
  position: relative;
}

.final-max {
  font-size: 0.85rem;
  opacity: 0.55;
  font-weight: 700;
  margin-top: 2px;
  position: relative;
}

.final-grade {
  margin-top: 14px;
  font-size: 1.1rem;
  font-weight: 900;
  background: rgba(245,197,24,0.15);
  border: 1px solid rgba(245,197,24,0.3);
  color: var(--gold);
  border-radius: 100px;
  padding: 6px 22px;
  display: inline-block;
  position: relative;
}

/* Results stat row */
.results-stat-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

/* Breakdown card */
.breakdown-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

.breakdown-hdr {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gray-3);
  font-weight: 800;
  margin-bottom: 12px;
}

.bd-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-2);
  font-size: 0.85rem;
}
.bd-item:last-child { border-bottom: none; }

.bd-num {
  background: var(--gray-2);
  color: var(--gray-4);
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 900;
  flex-shrink: 0;
}

.bd-q { flex: 1; font-weight: 700; color: var(--text); line-height: 1.3; }

.bd-score {
  font-weight: 900;
  font-size: 0.9rem;
  min-width: 60px;
  text-align: right;
}
.bd-score.correct { color: var(--green); }
.bd-score.wrong   { color: var(--red); }
.bd-score.timeout { color: var(--amber); }

/* Next quiz countdown */
.next-quiz-label {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gray-4);
  margin-top: 4px;
}
.next-timer {
  font-weight: 900;
  color: var(--gold-d);
}

/* Account CTA */
.results-cta-saved {
  background: #d1fae5;
  color: #065f46;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.875rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.results-cta-saved a { color: #059669; font-weight: 900; text-decoration: none; white-space: nowrap; }

.results-cta-login {
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
  color: var(--purple-d);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.875rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 14px;
}
.results-cta-login a { color: var(--purple); font-weight: 900; text-decoration: none; }

/* ── Toast ──────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--hero-mid);
  color: white;
  padding: 12px 24px;
  border-radius: 100px;
  font-size: 0.875rem;
  font-weight: 800;
  white-space: nowrap;
  transition: transform 0.3s cubic-bezier(.22,.68,0,1.2);
  z-index: 999;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  border: 1px solid rgba(245,197,24,0.2);
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ══════════════════════════════════════════════
   HOME SCREEN v2 — VENTURE-BACKED REDESIGN
══════════════════════════════════════════════ */

/* ── Hero enhancements ──────────────────────── */
.home-hero { padding-bottom: 28px; }
.home-hero::after { display: none; } /* remove bottom fade so CTAs aren't covered */

/* Floating decorative particles */
.hero-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.fp {
  position: absolute;
  opacity: 0.13;
  animation: fp-float 6s ease-in-out infinite;
  user-select: none;
}
.fp1 { top: 10%; left: 6%;   font-size: 1.1rem; animation-duration: 5.5s; animation-delay: 0s; }
.fp2 { top: 22%; right: 8%;  font-size: 0.9rem; animation-duration: 7s;   animation-delay: 1.4s; }
.fp3 { top: 62%; left: 4%;   font-size: 1.7rem; animation-duration: 6.2s; animation-delay: 2.1s; }
.fp4 { top: 42%; right: 6%;  font-size: 1rem;   animation-duration: 5s;   animation-delay: 0.7s; }
.fp5 { top: 76%; right: 12%; font-size: 0.85rem; animation-duration: 8s;  animation-delay: 3.2s; }

@keyframes fp-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33%       { transform: translateY(-16px) rotate(12deg); }
  66%       { transform: translateY(8px) rotate(-6deg); }
}

/* Hero tagline */
.hero-tagline {
  font-size: 2.15rem;
  font-weight: 900;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
  letter-spacing: -0.025em;
  text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.hero-desc {
  font-size: 0.84rem;
  color: rgba(255,255,255,0.55);
  font-weight: 600;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
  letter-spacing: 0.02em;
}

/* Urgency countdown strip */
.hero-urgency {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 100px;
  padding: 5px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(255,255,255,0.75);
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}
.hero-urgency strong {
  color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}
.urgency-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f87171;
  flex-shrink: 0;
  animation: udot 1.5s ease-in-out infinite;
}
@keyframes udot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.35; transform: scale(0.65); }
}

/* Ensure hero content sits above particles */
.home-hero .logo-wrap,
.home-hero .hero-tagline,
.home-hero .hero-desc,
.home-hero .hero-urgency,
.home-hero .cta-btn,
.home-hero .date-pill,
.home-hero .archive-banner { position: relative; z-index: 1; }

/* ── Login value card (replaces simple login-bar) ─ */
.login-value-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, #2d1060, #1a0533);
  border: 1px solid rgba(167,139,250,0.28);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 12px;
}
.lvc-left { flex: 1; min-width: 0; }
.lvc-title { font-size: 0.88rem; font-weight: 900; color: #fff; margin-bottom: 5px; }
.lvc-perks { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.lvc-perks span { font-size: 0.7rem; font-weight: 700; color: rgba(167,139,250,0.85); }
.lvc-btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--gold), var(--orange));
  color: var(--hero-edge);
  font-family: 'Nunito', sans-serif;
  font-size: 0.82rem;
  font-weight: 900;
  padding: 9px 16px;
  border-radius: 10px;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 3px 12px rgba(245,197,24,0.4);
  flex-shrink: 0;
  transition: opacity 0.2s, transform 0.2s;
}
.lvc-btn:hover { opacity: 0.9; transform: translateY(-1px); }

/* ── Section layout components ──────────────── */
.section-eyebrow {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gold-d, #d4a800);
  margin-bottom: 3px;
}
.section-heading {
  font-size: 1.18rem;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 14px;
  line-height: 1.25;
}
.section-heading.nomargin { margin-bottom: 0; }
.section-header-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 12px;
}
.section-more-link {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--purple);
  text-decoration: none;
  flex-shrink: 0;
  padding-bottom: 2px;
}
.section-more-link:hover { color: var(--purple-d); }

/* ── Community stats section — dark scoreboard ── */
.community-section {
  margin-bottom: 24px;
  background: linear-gradient(135deg, var(--hero-top) 0%, var(--hero-mid) 100%);
  border-radius: 20px;
  padding: 20px 16px 22px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(13,5,32,0.45), inset 0 1px 0 rgba(255,255,255,0.06);
}
.community-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.07) 1px, transparent 1px);
  background-size: 38px 38px;
  pointer-events: none;
}
.community-section .section-eyebrow {
  color: var(--gold);
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 6px;
}
.community-section .section-heading { color: #fff; position: relative; z-index: 1; }

/* Pulsing green live dot */
.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  flex-shrink: 0;
  animation: live-pulse 1.6s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(74,222,128,0.6); }
  50%       { opacity: 0.7; box-shadow: 0 0 0 5px rgba(74,222,128,0); }
}

.community-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  position: relative;
  z-index: 1;
}
.comm-card {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.11);
  border-top: 2px solid rgba(245,197,24,0.55);
  border-radius: 14px;
  padding: 16px 10px 14px;
  text-align: center;
  transition: background 0.2s, transform 0.2s;
}
.comm-card:nth-child(2) { border-top-color: rgba(249,115,22,0.55); }
.comm-card:nth-child(3) { border-top-color: rgba(124,58,237,0.55); }
.comm-card-today        { border-top-color: rgba(74,222,128,0.7) !important; }
.comm-card:hover { background: rgba(255,255,255,0.12); transform: translateY(-2px); }
.comm-num {
  font-size: 1.85rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 4px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--orange) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.comm-lbl { font-size: 0.67rem; font-weight: 700; color: rgba(255,255,255,0.5); }

/* ── How It Works — 4 cards ─────────────────── */
.how-section { margin-bottom: 24px; }
.how-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.how-step-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px 13px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s;
}
.how-step-card:hover { transform: translateY(-2px); }
.how-step-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.how-step-card:nth-child(1)::before { background: linear-gradient(90deg, var(--gold), var(--orange)); }
.how-step-card:nth-child(2)::before { background: linear-gradient(90deg, var(--orange), #ef4444); }
.how-step-card:nth-child(3)::before { background: linear-gradient(90deg, var(--purple), var(--purple-l)); }
.how-step-card:nth-child(4)::before { background: linear-gradient(90deg, var(--green), #0ea5e9); }
.how-step-icon { font-size: 1.55rem; margin-bottom: 8px; display: block; }
.how-step-title { font-size: 0.86rem; font-weight: 900; color: var(--text); margin-bottom: 4px; line-height: 1.3; }
.how-step-desc  { font-size: 0.72rem; font-weight: 600; color: var(--gray-3); line-height: 1.4; }

/* ── Leaderboard preview ────────────────────── */
.lb-preview-section { margin-bottom: 24px; }
.lb-preview-list {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.lb-preview-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--gray-2);
}
.lb-preview-row:last-child { border-bottom: none; }
.lb-medal { font-size: 1.25rem; flex-shrink: 0; width: 26px; text-align: center; }
.lb-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.lb-p-name {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lb-p-correct { font-size: 0.75rem; font-weight: 700; color: var(--gray-3); flex-shrink: 0; }
.lb-p-score   { font-size: 0.9rem; font-weight: 900; color: var(--gold-d, #d4a800); flex-shrink: 0; }
.lb-loading, .lb-empty {
  text-align: center;
  padding: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gray-3);
}

/* ── Achievements preview ───────────────────── */
.achievements-section { margin-bottom: 32px; }
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.badge-card {
  background: var(--white);
  border-radius: 14px;
  padding: 14px 8px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1.5px solid transparent;
  transition: all 0.2s;
}
.badge-card:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: var(--shadow-gold); }
.badge-icon { font-size: 1.75rem; display: block; margin-bottom: 5px; }
.badge-name { font-size: 0.68rem; font-weight: 900; color: var(--text); }
.achievements-cta { text-align: center; }
.achievements-signup { font-size: 0.82rem; font-weight: 700; color: var(--purple); text-decoration: none; }
.achievements-signup:hover { color: var(--purple-d); text-decoration: underline; }

/* ══════════════════════════════════════════════
   DARK MODE
══════════════════════════════════════════════ */

#screen-home { position: relative; }

[data-theme="dark"] {
  --bg:        #080412;
  --white:     #150d2e;
  --gray-1:    #1a1040;
  --gray-2:    #2d2060;
  --gray-3:    #6b5b9a;
  --gray-4:    #9b8ec4;
  --text:      #f0ecff;
  --shadow:    0 4px 24px rgba(0,0,0,0.6);
  --shadow-sm: 0 2px 10px rgba(0,0,0,0.4);
  --green-l:   #064e3b;
  --red-l:     #450a0a;
}

[data-theme="dark"] .home-hero {
  box-shadow: 0 16px 48px rgba(0,0,0,0.8), inset 0 1px 0 rgba(255,255,255,0.08);
}

[data-theme="dark"] .home-hero::after {
  background: linear-gradient(to bottom, transparent, #080412);
}

[data-theme="dark"] .stat-chip.highlight {
  background: linear-gradient(135deg, #1c1205, #241a06);
}

[data-theme="dark"] .login-bar {
  background: var(--white);
  border-color: var(--gray-2);
}

[data-theme="dark"] .hint-box {
  background: #1c1205;
  border-color: #92400e;
  color: #fde68a;
}
[data-theme="dark"] .hint-btn:hover:not(:disabled) { background: rgba(245,197,24,0.06); }

[data-theme="dark"] .did-you-mean {
  background: #1e1045;
  border-color: var(--purple);
}
[data-theme="dark"] .dym-text  { color: var(--text); }
[data-theme="dark"] .dym-no:hover { background: #1e1045; }

[data-theme="dark"] .archive-banner {
  background: #1e1045;
  border-color: var(--purple);
  color: var(--purple-l);
}

[data-theme="dark"] .results-cta-saved { background: #064e3b; color: #a7f3d0; }
[data-theme="dark"] .results-cta-saved a { color: #34d399; }
[data-theme="dark"] .results-cta-login { background: #1e1045; border-color: var(--purple); color: var(--purple-l); }
[data-theme="dark"] .results-cta-login a { color: var(--purple-l); }

[data-theme="dark"] .answer-input.correct { background: #064e3b; color: #a7f3d0; }
[data-theme="dark"] .answer-input.wrong   { background: #450a0a; color: #fca5a5; }
[data-theme="dark"] .answer-input.timeout { background: #1c1205; color: #fde68a; }

[data-theme="dark"] .reveal-yours { background: #450a0a; border-color: var(--red); }
[data-theme="dark"] .reveal-yours-text { color: #fca5a5; }

[data-theme="dark"] .date-pill { background: var(--white); border-color: var(--gray-2); }
[data-theme="dark"] .countup-bar { background: var(--white); border-color: var(--gray-2); }
[data-theme="dark"] .reveal-fact { background: var(--white); }

/* Dark mode toggle */
.dark-toggle {
  position: absolute;
  top: 14px;
  right: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.08);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
  z-index: 10;
  line-height: 1;
  padding: 0;
}
.dark-toggle:hover {
  border-color: rgba(245,197,24,0.5);
  background: rgba(245,197,24,0.12);
  transform: scale(1.08);
}

/* Nav icon */
.nav-icon {
  width: 26px;
  height: 26px;
  vertical-align: middle;
  margin-right: 4px;
  position: relative;
  top: -1px;
}

/* ── Dark mode overrides — v2 components ────── */
[data-theme="dark"] .hero-urgency {
  background: rgba(0,0,0,0.3);
  border-color: rgba(255,255,255,0.1);
}
[data-theme="dark"] .comm-card,
[data-theme="dark"] .how-step-card,
[data-theme="dark"] .badge-card {
  background: var(--white);
  border-color: var(--gray-2);
}
[data-theme="dark"] .lb-preview-list { background: var(--white); }
[data-theme="dark"] .lb-preview-row  { border-bottom-color: var(--gray-2); }
[data-theme="dark"] .section-heading,
[data-theme="dark"] .lb-p-name       { color: var(--text); }
[data-theme="dark"] .login-value-card {
  border-color: rgba(167,139,250,0.35);
  background: linear-gradient(135deg, #2d1060, #1a0533);
}

/* ── Host Panel ──────────────────────────────── */
#host-toggle-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: #7c3aed;
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(124,58,237,0.5);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, background 0.15s;
}
#host-toggle-btn:hover { background: #5b21b6; transform: scale(1.08); }

#host-panel {
  position: fixed;
  bottom: 76px;
  right: 20px;
  width: 240px;
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  z-index: 901;
  display: none;
  overflow: hidden;
  font-family: 'Nunito', sans-serif;
}
#host-panel.open { display: block; }

.host-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #94a3b8;
  border-bottom: 1px solid #334155;
}
.host-panel-close {
  background: none;
  border: none;
  color: #64748b;
  font-size: 1rem;
  cursor: pointer;
  padding: 0 4px;
}
.host-panel-close:hover { color: #e2e8f0; }

.host-panel-body { padding: 14px 16px 16px; }

.host-section-label {
  font-size: 0.65rem;
  font-weight: 900;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 10px;
}

.spotify-track-info {
  font-size: 0.78rem;
  font-weight: 700;
  color: #94a3b8;
  background: #0f172a;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spotify-btns {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.host-btn {
  border: none;
  border-radius: 8px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
  padding: 8px 12px;
  transition: background 0.15s;
}
.host-btn-connect  { width: 100%; background: #1db954; color: #fff; }
.host-btn-connect:hover { background: #17a349; }
.host-btn-prev, .host-btn-next { flex: 1; background: #334155; color: #e2e8f0; }
.host-btn-prev:hover, .host-btn-next:hover { background: #475569; }
.host-btn-disconnect { width: 100%; background: #1e293b; color: #475569; border: 1px solid #334155; font-size: 0.7rem; }
.host-btn-disconnect:hover { color: #94a3b8; background: #0f172a; }

/* ── Responsive ──────────────────────────────── */
@media (max-width: 400px) {
  .logo-img    { width: 96px; height: 96px; }
  .final-num   { font-size: 4rem; }
  .question-txt { font-size: 1rem; }
}
