/* ===========================
   FACT ROYALE — Base Styles
   =========================== */

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

:root {
  --bg:         #0f0f1a;
  --surface:    #1a1a2e;
  --surface2:   #22223b;
  --gold:       #f0c040;
  --gold-dim:   #b8902e;
  --text:       #e8e8f0;
  --text-muted: #8888aa;
  --correct:    #22c55e;
  --wrong:      #ef4444;
  --correct-bg: #052e16;
  --wrong-bg:   #2d0707;

  --history:    #f59e0b;
  --sports:     #3b82f6;
  --music:      #a855f7;
  --default:    #64748b;

  --radius:     14px;
  --transition: 0.2s ease;
  --page-width: 1100px;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  min-height: 100vh;
  /* Prevent font size zoom on iOS input focus */
  -webkit-text-size-adjust: 100%;
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.85); }
}

/* ===========================
   SCREENS
   =========================== */

.screen { display: none; }

.screen.active { display: block; animation: fadeIn 0.3s ease; }

#screen-quiz.active,
#screen-results.active,
#screen-noquiz.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px 16px;
}

/* ===========================
   HOME — LAYOUT WRAPPER
   =========================== */

#screen-landing {
  width: 100%;
}

.home-wrap {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0 32px;
}

/* ===========================
   HOME — NAV
   =========================== */

.home-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 32px;
  max-width: var(--page-width);
  margin: 0 auto;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.nav-logo {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--gold);
  letter-spacing: -0.3px;
}

.nav-links {
  display: flex;
  gap: 28px;
  align-items: center;
}

.nav-link {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: color var(--transition);
}

.nav-link:hover { color: var(--text); }

.nav-link-cta {
  background: rgba(240,192,64,0.12);
  border: 1px solid rgba(240,192,64,0.3);
  color: var(--gold);
  border-radius: 100px;
  padding: 6px 18px;
}

.nav-link-cta:hover {
  background: rgba(240,192,64,0.2);
  color: var(--gold);
}

/* ===========================
   HOME — HERO
   =========================== */

.hero {
  position: relative;
  overflow: hidden;
  padding: 80px 32px 60px;
  max-width: var(--page-width);
  margin: 0 auto;
}

.hero-glow {
  position: absolute;
  top: -80px;
  right: -100px;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(240,192,64,0.07) 0%, transparent 65%);
  pointer-events: none;
  border-radius: 50%;
}

.hero-content {
  position: relative;
  max-width: 640px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--gold);
  background: rgba(240,192,64,0.08);
  border: 1px solid rgba(240,192,64,0.2);
  border-radius: 100px;
  padding: 5px 14px;
  margin-bottom: 24px;
}

.hero-title {
  font-size: 5rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1.0;
  letter-spacing: -2px;
  margin-bottom: 20px;
}

.hero-title-accent {
  color: var(--gold);
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 520px;
  margin-bottom: 36px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.btn-hero {
  background: var(--gold);
  color: #0f0f1a;
  border: none;
  border-radius: 100px;
  padding: 16px 36px;
  font-size: 1.05rem;
  font-weight: 900;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  white-space: nowrap;
  font-family: 'Nunito', sans-serif;
  box-shadow: 0 0 32px rgba(240,192,64,0.2);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-height: 52px;
}

.btn-hero:hover {
  background: #ffd060;
  transform: translateY(-2px);
  box-shadow: 0 0 48px rgba(240,192,64,0.35);
}

.hero-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.already-played {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-top: 8px;
}

.hero-stat-row {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 52px;
  padding-top: 36px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 40px 0 0;
}

.hero-stat:first-child { padding-left: 0; }

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

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.hero-stat-divider {
  width: 1px;
  height: 40px;
  background: rgba(255,255,255,0.08);
  margin-right: 40px;
}

/* ===========================
   HOME — SECTION BASE
   =========================== */

.home-section {
  padding: 64px 32px;
  max-width: var(--page-width);
  margin: 0 auto;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.section-title {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.section-sub {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 480px;
  line-height: 1.6;
}

/* ===========================
   HOME — DAILY SECTION
   =========================== */

.daily-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.daily-main-card {
  background: var(--surface);
  border: 1px solid rgba(240,192,64,0.25);
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.daily-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.daily-label {
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gold);
}

.daily-live-dot {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--correct);
}

.dot-pulse {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--correct);
  border-radius: 50%;
  animation: pulse 1.8s ease-in-out infinite;
}

.daily-card-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.4;
}

.daily-card-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: auto;
}

.daily-side-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.side-card {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color var(--transition);
  flex: 1;
}

.side-card:hover {
  border-color: rgba(240,192,64,0.2);
}

.side-card-icon {
  font-size: 1.3rem;
  margin-bottom: 2px;
}

.side-card-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
}

.side-card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ===========================
   HOME — FEATURES GRID
   =========================== */

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color var(--transition), transform var(--transition);
}

.feature-card:hover {
  border-color: rgba(240,192,64,0.25);
  transform: translateY(-3px);
}

.feature-icon-wrap {
  font-size: 2rem;
  line-height: 1;
}

.feature-body { flex: 1; }

.feature-title {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 8px;
}

.feature-desc {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.feature-badge {
  display: inline-block;
  background: rgba(240,192,64,0.1);
  border: 1px solid rgba(240,192,64,0.25);
  color: var(--gold);
  border-radius: 100px;
  padding: 4px 12px;
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: fit-content;
}

/* ===========================
   HOME — EMAIL SIGNUP
   =========================== */

.notify-section {
  background: var(--surface);
  border-top: 1px solid rgba(255,255,255,0.05);
  max-width: 100%;
  padding: 64px 32px;
}

.notify-card {
  max-width: var(--page-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 48px;
  flex-wrap: wrap;
}

.notify-left { flex: 1; min-width: 260px; }

.notify-title {
  font-size: 2rem;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.5px;
  margin-bottom: 10px;
}

.notify-sub {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 400px;
}

.notify-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.notify-input {
  background: var(--surface2);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 100px;
  padding: 13px 22px;
  font-size: 0.95rem;
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  outline: none;
  width: 260px;
  transition: border-color var(--transition);
}

.notify-input:focus {
  border-color: var(--gold-dim);
}

.notify-input::placeholder {
  color: var(--text-muted);
}

.notify-btn {
  white-space: nowrap;
}

.notify-confirm {
  font-size: 0.9rem;
  color: var(--correct);
  font-weight: 700;
  margin-top: 10px;
}

/* ===========================
   HOME — FOOTER
   =========================== */

.home-footer {
  border-top: 1px solid rgba(255,255,255,0.05);
  padding: 32px;
}

.footer-inner {
  max-width: var(--page-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-logo {
  font-size: 1rem;
  font-weight: 900;
  color: var(--gold);
}

.footer-copy {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ===========================
   SHARED ELEMENTS
   =========================== */

.meta-badge {
  background: var(--surface2);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 100px;
  padding: 5px 14px;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

.category-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  border-radius: 100px;
  padding: 4px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: none;
}

/* ===========================
   BUTTONS
   =========================== */

.btn-primary {
  background: var(--gold);
  color: #0f0f1a;
  border: none;
  border-radius: 100px;
  padding: 13px 32px;
  font-size: 0.95rem;
  font-weight: 900;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  font-family: 'Nunito', sans-serif;
  /* Mobile: no tap flash, proper touch sizing */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-height: 44px;
}

.btn-primary:hover {
  background: #ffd060;
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--gold);
  border: 1px solid rgba(240,192,64,0.4);
  border-radius: 100px;
  padding: 10px 24px;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  font-family: 'Nunito', sans-serif;
  white-space: nowrap;
  align-self: flex-start;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-height: 44px;
}

.btn-outline:hover {
  background: rgba(240,192,64,0.1);
  border-color: var(--gold);
}

.btn-next {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 100px;
  padding: 12px 30px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition);
  margin-top: 20px;
  width: 100%;
  font-family: 'Nunito', sans-serif;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-height: 48px;
}

.btn-next:hover { background: #2e2e4a; }

/* ===========================
   NO QUIZ / FALLBACK
   =========================== */

.landing-card {
  background: var(--surface);
  border: 1px solid rgba(240,192,64,0.15);
  border-radius: var(--radius);
  padding: 48px 36px;
  text-align: center;
  width: 100%;
  max-width: 480px;
}

.crown { font-size: 3rem; margin-bottom: 8px; color: var(--gold); }
.logo  { font-size: 2.4rem; font-weight: 900; color: var(--gold); letter-spacing: -0.5px; margin-bottom: 8px; }
.tagline { color: var(--text-muted); font-size: 1rem; }

/* ===========================
   QUIZ SCREEN
   =========================== */

#screen-quiz .inner-wrap,
#screen-results .inner-wrap {
  width: 100%;
  max-width: 540px;
}

.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 540px;
  margin-bottom: 16px;
}

.logo-small {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--gold);
}

.streak-badge {
  background: var(--surface2);
  border-radius: 100px;
  padding: 4px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gold);
}

.progress-wrap {
  width: 100%;
  max-width: 540px;
  height: 5px;
  background: var(--surface2);
  border-radius: 100px;
  margin-bottom: 8px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--gold);
  border-radius: 100px;
  transition: width 0.4s ease;
  width: 0%;
}

.progress-text {
  text-align: right;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  width: 100%;
  max-width: 540px;
  margin-bottom: 20px;
}

.question-card {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 28px 24px;
  width: 100%;
  max-width: 540px;
}

.category-tag {
  display: inline-block;
  border-radius: 100px;
  padding: 3px 12px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 16px;
}

.question-text {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 24px;
  color: var(--text);
}

.options-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-btn {
  background: var(--surface2);
  border: 2px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  padding: 13px 18px;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
  font-family: 'Nunito', sans-serif;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-height: 50px;
}

.option-btn:hover:not(:disabled) {
  border-color: var(--gold-dim);
  transform: translateX(3px);
}

.option-btn:disabled { cursor: default; }
.option-btn.correct  { background: var(--correct-bg); border-color: var(--correct); color: var(--correct); }
.option-btn.wrong    { background: var(--wrong-bg);   border-color: var(--wrong);   color: var(--wrong); }
.option-btn.correct::after { content: ' ✓'; font-weight: 900; }
.option-btn.wrong::after   { content: ' ✗'; font-weight: 900; }

.feedback-box {
  margin-top: 22px;
  border-top: 1px solid rgba(255,255,255,0.07);
  padding-top: 20px;
}

.feedback-result { font-size: 1rem; font-weight: 800; margin-bottom: 10px; }
.feedback-result.correct { color: var(--correct); }
.feedback-result.wrong   { color: var(--wrong); }

.feedback-explanation {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.memory-hook {
  background: rgba(240,192,64,0.07);
  border: 1px solid rgba(240,192,64,0.2);
  border-radius: 10px;
  padding: 12px 16px;
  margin-top: 14px;
}

.hook-label {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gold);
  display: block;
  margin-bottom: 6px;
}

.memory-hook p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ===========================
   RESULTS SCREEN
   =========================== */

.results-card {
  background: var(--surface);
  border: 1px solid rgba(240,192,64,0.15);
  border-radius: var(--radius);
  padding: 48px 36px;
  text-align: center;
  width: 100%;
  max-width: 540px;
}

.results-title { font-size: 1.6rem; font-weight: 900; color: var(--gold); margin-bottom: 16px; }

.score-display {
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 28px;
  line-height: 1;
}

.score-display span { font-size: 1.5rem; color: var(--text-muted); font-weight: 600; }

.category-breakdown {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 32px;
  text-align: left;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface2);
  border-radius: 10px;
  padding: 10px 16px;
}

.breakdown-label { font-size: 0.88rem; font-weight: 700; color: var(--text-muted); }
.breakdown-score { font-size: 0.88rem; font-weight: 800; color: var(--text); }
.results-actions { margin-bottom: 20px; }

.share-confirm { margin-top: 10px; font-size: 0.85rem; color: var(--correct); font-weight: 700; }
.comeback-msg  { font-size: 0.85rem; color: var(--text-muted); }

/* ===========================
   CATEGORY COLOURS
   =========================== */

.cat-history { background: rgba(245,158,11,0.15); color: var(--history); }
.cat-sports  { background: rgba(59,130,246,0.15);  color: var(--sports); }
.cat-music   { background: rgba(168,85,247,0.15);  color: var(--music); }
.cat-default { background: rgba(100,116,139,0.15); color: var(--default); }

/* ===========================
   NAV AUTH
   =========================== */

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

.btn-nav-signin {
  background: transparent;
  border: 1px solid rgba(240,192,64,0.4);
  border-radius: 100px;
  color: var(--gold);
  font-family: 'Nunito', sans-serif;
  font-size: 0.85rem;
  font-weight: 800;
  padding: 7px 18px;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-height: 36px;
}

.btn-nav-signin:hover {
  background: rgba(240,192,64,0.1);
  border-color: var(--gold);
}

.nav-user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-user-name {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--gold);
}

.btn-nav-signout {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: 'Nunito', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.btn-nav-signout:hover { color: var(--text); }

/* ===========================
   AUTH MODAL
   =========================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 36px 32px;
  width: 100%;
  max-width: 420px;
  position: relative;
  animation: fadeIn 0.2s ease;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--surface2);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
  font-family: 'Nunito', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

.modal-close:hover { color: var(--text); background: #2e2e4a; }

.modal-header {
  text-align: center;
  margin-bottom: 24px;
}

.modal-crown {
  font-size: 2rem;
  color: var(--gold);
  display: block;
  margin-bottom: 8px;
}

.modal-title {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}

.modal-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.modal-tabs {
  display: flex;
  gap: 0;
  background: var(--surface2);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 20px;
}

.modal-tab {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 8px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.modal-tab.active {
  background: var(--surface);
  color: var(--text);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 4px;
}

.auth-input {
  background: var(--surface2);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 12px 16px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition);
  min-height: 48px;
}

.auth-input:focus { border-color: var(--gold-dim); }
.auth-input::placeholder { color: var(--text-muted); }

.auth-submit {
  width: 100%;
  margin-top: 4px;
}

.auth-error {
  font-size: 0.82rem;
  color: var(--wrong);
  font-weight: 700;
  min-height: 1.2em;
  text-align: center;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.07);
}

.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #fff;
  color: #1a1a1a;
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-height: 48px;
}

.btn-google:hover {
  background: #f0f0f0;
  transform: translateY(-1px);
}

.auth-fine-print {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
  margin-top: 14px;
}

/* ===========================
   LEADERBOARD
   =========================== */

.leaderboard-wrap {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}

.lb-header-row {
  display: grid;
  grid-template-columns: 52px 1fr 80px 72px;
  padding: 10px 20px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.lb-count {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 700;
  align-self: flex-end;
}

.leaderboard-list {
  min-height: 80px;
}

.lb-row {
  display: grid;
  grid-template-columns: 52px 1fr 80px 72px;
  padding: 14px 20px;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background var(--transition);
}

.lb-row:last-child { border-bottom: none; }
.lb-row:hover { background: rgba(255,255,255,0.02); }

.lb-row-you {
  background: rgba(240,192,64,0.06);
  border-left: 3px solid var(--gold);
}

.lb-row-you:hover { background: rgba(240,192,64,0.09); }

.lb-rank {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--text-muted);
}

.lb-row:nth-child(1) .lb-rank { font-size: 1.2rem; }
.lb-row:nth-child(2) .lb-rank { font-size: 1.15rem; }
.lb-row:nth-child(3) .lb-rank { font-size: 1.1rem; }

.lb-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.lb-you-tag {
  font-size: 0.65rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gold);
  background: rgba(240,192,64,0.15);
  border-radius: 100px;
  padding: 2px 8px;
}

.lb-score {
  font-size: 1rem;
  font-weight: 900;
  color: var(--text);
}

.lb-total {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.lb-pct {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
}

.lb-row-seed { opacity: 0.55; }
.lb-row-seed:hover { opacity: 0.7; }

.lb-loading,
.lb-empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.lb-empty-state {
  padding: 40px 20px;
  text-align: center;
}

.lb-empty-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}

.lb-empty-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.lb-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  background: rgba(240,192,64,0.05);
  border: 1px solid rgba(240,192,64,0.15);
  border-radius: var(--radius);
  padding: 20px 24px;
}

.lb-cta-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  flex: 1;
  min-width: 200px;
  line-height: 1.5;
}

/* ===========================
   PERSONAL STATS
   =========================== */

.stats-section { border-top: 1px solid rgba(255,255,255,0.05); }

.stats-username {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--gold);
  background: rgba(240,192,64,0.08);
  border: 1px solid rgba(240,192,64,0.2);
  border-radius: 100px;
  padding: 5px 16px;
  align-self: flex-start;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.stat-box {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  transition: border-color var(--transition);
}

.stat-box:hover { border-color: rgba(240,192,64,0.2); }

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

.stat-box-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 700;
  text-align: center;
  line-height: 1.3;
}

.stat-cats-wrap { margin-top: 4px; }

.stat-cats-title {
  font-size: 0.88rem;
  font-weight: 900;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 14px;
}

.stat-cat-row {
  margin-bottom: 14px;
}

.stat-cat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.stat-cat-pct {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

.stat-bar-track {
  height: 6px;
  background: var(--surface2);
  border-radius: 100px;
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  border-radius: 100px;
  transition: width 0.6s ease;
}

/* ===========================
   RESPONSIVE — TABLET (≤768px)
   =========================== */

@media (max-width: 768px) {
  /* Nav */
  .home-nav { padding: 16px 20px; }
  .nav-links { gap: 16px; }
  .nav-link:not(.nav-link-cta) { display: none; }

  /* Stats grid — 3 columns on tablet */
  .stats-grid { grid-template-columns: repeat(3, 1fr); }

  /* Leaderboard — hide accuracy column */
  .lb-header-row,
  .lb-row { grid-template-columns: 48px 1fr 72px; }
  .lb-pct,
  .lb-header-row span:last-child { display: none; }

  /* Hero */
  .hero { padding: 48px 20px 40px; }
  .hero-title { font-size: clamp(2.4rem, 8vw, 3.6rem); }
  .hero-sub { font-size: 1rem; }
  .hero-stat-row { gap: 0; }
  .hero-stat { padding: 0 24px 0 0; }
  .hero-stat-divider { margin-right: 24px; }

  /* Sections */
  .home-section { padding: 48px 20px; }
  .notify-section { padding: 48px 20px; }
  .home-footer { padding: 24px 20px; }

  /* Grids */
  .daily-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr 1fr; }

  /* Email */
  .notify-card { flex-direction: column; gap: 28px; }

  /* Quiz */
  .quiz-header,
  .progress-wrap,
  .progress-text,
  .question-card {
    max-width: 100%;
  }
  #screen-quiz.active,
  #screen-results.active,
  #screen-noquiz.active {
    padding: 16px 12px;
    justify-content: flex-start;
    padding-top: 24px;
  }
}

/* ===========================
   RESPONSIVE — MOBILE (≤480px)
   =========================== */

@media (max-width: 480px) {
  /* Hero */
  .hero-title { font-size: clamp(2rem, 10vw, 2.8rem); letter-spacing: -1px; }
  .hero-sub { font-size: 0.95rem; }
  .hero-eyebrow { font-size: 0.7rem; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .btn-hero { text-align: center; }
  .hero-badges { justify-content: flex-start; }
  .hero-stat-row { flex-wrap: wrap; gap: 20px; padding-top: 24px; margin-top: 32px; }
  .hero-stat-divider { display: none; }
  .hero-stat { padding: 0; }
  .stat-num { font-size: 1.6rem; }

  /* Nav — just the logo + CTA pill */
  .home-nav { padding: 14px 16px; }

  /* Sections */
  .home-section { padding: 40px 16px; }
  .notify-section { padding: 40px 16px; }
  .section-header { flex-direction: column; gap: 16px; }
  .section-title { font-size: 1.5rem; }
  .btn-outline { align-self: stretch; text-align: center; }

  /* Grids */
  .features-grid { grid-template-columns: 1fr; }
  .daily-side-cards { flex-direction: column; }

  /* Email */
  .notify-form { flex-direction: column; align-items: stretch; }
  .notify-input { width: 100%; box-sizing: border-box; }
  .notify-btn { width: 100%; text-align: center; }
  .notify-title { font-size: 1.6rem; }

  /* Footer */
  .home-footer { padding: 20px 16px; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 6px; }

  /* Stats grid — 2 columns on mobile */
  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  /* Leaderboard — simplify to 2 cols */
  .lb-header-row,
  .lb-row { grid-template-columns: 44px 1fr 60px; }
  .lb-row { padding: 12px 14px; }
  .lb-header-row { padding: 8px 14px; }

  /* Auth modal */
  .modal-card { padding: 28px 20px; }

  /* LB CTA */
  .lb-cta { flex-direction: column; align-items: flex-start; }
  .lb-signup-btn { align-self: stretch; text-align: center; }

  /* Quiz card — use full screen width on phones */
  .question-card { padding: 20px 16px; border-radius: 10px; }
  .question-text { font-size: 1.05rem; }
  .option-btn { font-size: 0.9rem; padding: 12px 14px; }
  .results-card { padding: 32px 20px; border-radius: 10px; }
  .score-display { font-size: 3rem; }

  /* Safe area padding for notched iPhones */
  #screen-quiz.active,
  #screen-results.active,
  #screen-noquiz.active {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
    padding-left: calc(12px + env(safe-area-inset-left));
    padding-right: calc(12px + env(safe-area-inset-right));
  }
}
