/* ============================================
   QuizTadka v2 — Neon Stage Interactive
   Electric · Playful · Touch-first
   ============================================ */

:root {
  --bg-deep: #050508;
  --bg-base: #0c0c14;
  --bg-elevated: #14141f;
  --surface: rgba(20, 20, 35, 0.85);
  --surface-hover: rgba(30, 30, 50, 0.95);
  --surface-glass: rgba(255, 255, 255, 0.05);

  --purple: #a855f7;
  --purple-dark: #7c3aed;
  --pink: #ec4899;
  --cyan: #22d3ee;
  --lime: #a3e635;
  --orange: #fb923c;

  --primary: #a855f7;
  --primary-light: rgba(168, 85, 247, 0.15);
  --accent: #ec4899;
  --accent-light: rgba(236, 72, 153, 0.15);
  --success: #4ade80;
  --success-light: rgba(74, 222, 128, 0.15);
  --danger: #f87171;
  --star: #fde047;
  --star-glow: rgba(253, 224, 71, 0.4);
  --gold: #fde047;

  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --border: rgba(255, 255, 255, 0.08);
  --border-active: rgba(168, 85, 247, 0.5);

  --gradient-brand: linear-gradient(135deg, #a855f7, #ec4899, #22d3ee);
  --gradient-btn: linear-gradient(135deg, #7c3aed, #db2777);
  --gradient-hero: linear-gradient(160deg, #1e1b4b 0%, #0c0c14 40%, #18181b 100%);
  --gradient-win: linear-gradient(135deg, #fde047, #fb923c);

  --shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(168, 85, 247, 0.25);
  --shadow-pink: 0 0 24px rgba(236, 72, 153, 0.3);

  --radius: 22px;
  --radius-sm: 14px;
  --radius-full: 999px;
  --header-h: 60px;
  --nav-h: 68px;
  --app-width: 430px;
  --pad-x: 16px;
  --font: 'Rubik', 'Segoe UI', sans-serif;
  --transition: 0.3s cubic-bezier(0.34, 1.2, 0.64, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background: var(--bg-deep);
}

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg-base);
  width: 100%;
  max-width: var(--app-width);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { max-width: 100%; display: block; }

/* Animated background */
.quiz-bg-pattern {
  position: fixed;
  inset: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--app-width);
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.quiz-bg-pattern::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 15%, rgba(168, 85, 247, 0.2) 0%, transparent 45%),
    radial-gradient(circle at 80% 25%, rgba(236, 72, 153, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 50% 90%, rgba(34, 211, 238, 0.1) 0%, transparent 50%);
  animation: none;
}

#particle-canvas,
#confetti-canvas {
  display: none !important;
}

@keyframes bgShift {
  from { opacity: 0.8; transform: scale(1); }
  to { opacity: 1; transform: scale(1.05); }
}

/* Flash feedback */
.flash-overlay {
  position: fixed;
  inset: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--app-width);
  z-index: 300;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.flash-overlay.flash-success { background: rgba(74, 222, 128, 0.2); opacity: 1; }
.flash-overlay.flash-error { background: rgba(248, 113, 113, 0.2); opacity: 1; }

/* Toast — hidden sitewide */
.toast-stack,
.toast {
  display: none !important;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-16px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(-8px); }
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(12, 12, 20, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 var(--pad-x);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  transition: transform var(--transition);
}

.logo:active { transform: scale(0.96); }

.logo-icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-brand);
  color: #fff;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 900;
  box-shadow: var(--shadow-glow);
}

@keyframes logoPulse {
  0%, 100% { box-shadow: 0 0 16px rgba(168, 85, 247, 0.3); }
  50% { box-shadow: 0 0 28px rgba(236, 72, 153, 0.45); }
}

.header-stats {
  display: flex;
  align-items: center;
  gap: 8px;
}

.streak-badge, .coin-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  transition: transform 0.2s ease;
}

.streak-badge {
  background: rgba(251, 146, 60, 0.15);
  border: 1px solid rgba(251, 146, 60, 0.35);
  color: var(--orange);
}

.streak-badge.bump { animation: badgeBump 0.5s ease; }

.coin-badge {
  background: rgba(253, 224, 71, 0.12);
  border: 1px solid rgba(253, 224, 71, 0.35);
  color: var(--star);
}

.coin-badge.pop { animation: starPop 0.6s ease; }

@keyframes badgeBump {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

@keyframes starPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.container {
  width: 100%;
  padding: 0 var(--pad-x);
  padding-left: max(var(--pad-x), env(safe-area-inset-left));
  padding-right: max(var(--pad-x), env(safe-area-inset-right));
}

.page { padding-bottom: 24px; position: relative; z-index: 1; }

/* Genre chips — interactive filter */
.genre-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 12px;
  margin-bottom: 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.genre-chips::-webkit-scrollbar { display: none; }

.genre-chip {
  flex-shrink: 0;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--surface-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  transition: all var(--transition);
  white-space: nowrap;
}

.genre-chip:active { transform: scale(0.94); }

.genre-chip.active {
  color: #fff;
  background: var(--gradient-btn);
  border-color: transparent;
  box-shadow: var(--shadow-pink);
}

/* Quiz intro screen */
.quiz-intro {
  text-align: center;
  padding: 12px 14px 10px;
  background: var(--gradient-hero);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
}

.quiz-intro.hidden { display: none; }

.quiz-intro::after {
  display: none;
}

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

.quiz-intro-content { position: relative; z-index: 1; }

.intro-emoji {
  font-size: 32px;
  display: block;
  margin-bottom: 4px;
}

@keyframes bounceEmoji {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-6px) rotate(5deg); }
}

.quiz-intro h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 4px;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.quiz-intro p {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.btn-start {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  max-width: 260px;
  padding: 10px 14px;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  background: var(--gradient-btn);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-pink);
  position: relative;
  overflow: hidden;
  transition: transform var(--transition);
}

.btn-start::after {
  display: none;
}

@keyframes btnShine {
  0% { transform: translateX(-100%); }
  50%, 100% { transform: translateX(100%); }
}

/* Quiz card */
.quiz-screen.hidden { display: none; }

.btn-start:active { transform: scale(0.97); }

.quiz-screen.animate-in {
  animation: none;
}

@keyframes cardSlideIn {
  from { opacity: 0; transform: translateY(30px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.quiz-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.quiz-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: rgba(168, 85, 247, 0.08);
  border-bottom: 1px solid var(--border);
}

.quiz-category-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cyan);
}

.progress-ring-wrap {
  position: relative;
  width: 44px;
  height: 44px;
}

.progress-ring-wrap svg { transform: rotate(-90deg); }

.progress-ring-bg { fill: none; stroke: rgba(255,255,255,0.08); stroke-width: 4; }

.progress-ring-fill {
  fill: none;
  stroke: url(#ringGradient);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 113;
  stroke-dashoffset: 113;
  transition: stroke-dashoffset 0.6s ease;
}

.progress-ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--text);
}

.quiz-card-body { padding: 18px 16px 20px; }

.quiz-question-box {
  background: var(--surface-glass);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-sm);
  padding: 18px 16px;
  margin-bottom: 16px;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quiz-question {
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.45;
  transition: opacity 0.25s ease;
}

.quiz-question.fade-out,
.quiz-question.fade-in {
  animation: none;
  opacity: 1;
  transform: none;
}

@keyframes qFadeIn {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}

.tap-hint {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--pink);
  margin-bottom: 14px;
  padding: 8px;
  border-radius: 10px;
  background: var(--accent-light);
}

.tap-hint.hidden { display: none; }

@keyframes hintPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Interactive options */
.options-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.option-btn {
  position: relative;
  min-height: 58px;
  padding: 14px 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  background: var(--surface-glass);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.option-btn .option-letter {
  position: absolute;
  top: 6px;
  left: 8px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: var(--text-muted);
  background: rgba(255,255,255,0.06);
  border-radius: 6px;
}

.option-btn:active:not(:disabled) { transform: scale(0.96); }

.option-btn:hover:not(:disabled) {
  border-color: var(--purple);
  background: var(--primary-light);
  transform: translateY(-2px);
}

.option-btn.selected {
  border-color: var(--purple);
  background: var(--primary-light);
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.3);
}

.option-btn.correct {
  border-color: var(--success);
  background: var(--success-light);
  color: var(--success);
}

.option-btn.wrong {
  border-color: var(--danger);
  background: rgba(248, 113, 113, 0.12);
  color: var(--danger);
}

.option-btn:disabled { cursor: default; }

@keyframes correctPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes shakeWrong {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.ripple {
  display: none !important;
}

@keyframes rippleAnim {
  to { transform: scale(4); opacity: 0; }
}

.quiz-progress-bar {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-full);
  margin-top: 16px;
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  background: var(--gradient-brand);
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
  width: 0%;
}

.progress-text {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 8px;
}

.progress-text span { color: var(--cyan); font-weight: 800; }

/* Engagement widgets */
.engage-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.engage-card {
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: var(--text-secondary);
  transition: transform 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
}

.engage-card:active { transform: scale(0.97); }
.engage-card:hover { border-color: var(--border-active); }

.engage-card strong {
  display: block;
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 2px;
}

.engage-card .live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--success);
  border-radius: 50%;
  margin-right: 4px;
}

@keyframes liveBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.engage-ticker {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s;
}

.engage-ticker:hover { border-color: var(--border-active); }

.engage-ticker-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  background: var(--pink);
  border-radius: 50%;
}

/* Fact carousel */
.fact-carousel {
  position: relative;
  margin-bottom: 16px;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

.fact-slide {
  padding: 16px;
  display: none;
}

.fact-slide.active { display: block; }

@keyframes factSlide {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.fact-slide-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.fact-slide-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-brand);
  border-radius: 12px;
  font-size: 20px;
}

.fact-slide h4 { font-size: 14px; font-weight: 700; }
.fact-slide p { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

.fact-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 0 16px 12px;
}

.fact-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  transition: all 0.3s ease;
  cursor: pointer;
}

.fact-dot.active {
  width: 22px;
  border-radius: 4px;
  background: var(--gradient-brand);
}

/* Quick action buttons */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.quick-action span:first-child { font-size: 22px; }

.quick-action:active { transform: scale(0.94); border-color: var(--purple); }

/* Discover section */
.discover-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  margin-bottom: 16px;
}

.discover-section h2 {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 14px;
  text-align: center;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.discover-section--spaced { margin-top: 20px; }

.discover-list { display: flex; flex-direction: column; gap: 10px; }

.discover-list li {
  display: flex;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  padding: 10px 12px;
  background: var(--surface-glass);
  border-radius: 10px;
  transition: transform 0.2s ease;
}

.discover-list li:active { transform: scale(0.98); }

.discover-list li::before {
  content: '🎯';
  flex-shrink: 0;
}

/* Category grid — tilt cards */
.category-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 22px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
  transform-style: preserve-3d;
}

.category-card:active { transform: scale(0.96); }

.category-card .cat-icon {
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-brand);
  border-radius: 16px;
  font-size: 26px;
  transition: transform 0.3s ease;
}

.category-card:hover .cat-icon { transform: scale(1.1) rotate(-5deg); }

.category-card h3 { font-size: 13px; font-weight: 700; }
.category-card span { font-size: 11px; color: var(--text-muted); }

/* Contest cards */
.contest-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }

.contest-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.contest-card:active { transform: scale(0.98); border-color: var(--border-active); }

.contest-card-icon {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-btn);
  border-radius: 14px;
  font-size: 22px;
  flex-shrink: 0;
}

.contest-card-info { flex: 1; min-width: 0; }
.contest-card-info h3 { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.contest-card-info p { font-size: 11px; color: var(--text-muted); }

.contest-coins { font-size: 12px; font-weight: 800; color: var(--star); flex-shrink: 0; }

.contest-play-btn {
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  background: var(--gradient-btn);
  border-radius: var(--radius-full);
  flex-shrink: 0;
  transition: transform 0.2s;
}

.contest-play-btn:active { transform: scale(0.94); }

/* Result modal */
.result-modal {
  position: fixed;
  inset: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--app-width);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.result-modal.hidden { display: none; }

.result-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 8, 0.88);
  backdrop-filter: blur(10px);
}

.result-modal-box {
  position: relative;
  z-index: 1;
  width: 100%;
}

@keyframes modalFadeIn { from { opacity: 0; } to { opacity: 1; } }

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.8) translateY(40px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.result-screen { text-align: center; }

.result-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  background: var(--gradient-win);
  border-radius: 50%;
}

@keyframes resultBounce {
  0% { transform: scale(0); }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.result-screen h2 { font-size: 1.3rem; font-weight: 800; margin-bottom: 6px; }

.coins-won {
  font-size: 2rem;
  font-weight: 900;
  background: var(--gradient-win);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 10px 0;
}

.result-msg { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; }

.result-body { padding-bottom: 4px; }

.result-ad-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 16px 20px;
}

.result-ad-actions .btn-ad-trigger {
  margin-top: 0;
  animation: none;
}

.result-actions { display: flex; flex-direction: column; gap: 10px; padding: 0 16px 20px; }

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  transition: transform 0.2s ease;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  color: #fff;
  background: var(--gradient-btn);
  box-shadow: var(--shadow-pink);
}

.btn-secondary {
  color: var(--purple);
  background: var(--primary-light);
  border: 1px solid var(--border-active);
}

/* Confetti */
#confetti-canvas {
  position: fixed;
  inset: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--app-width);
  pointer-events: none;
  z-index: 210;
}

/* Page title */
.page-title { text-align: center; padding: 20px 0 8px; }

.page-title h1 {
  font-size: clamp(1.3rem, 4vw, 1.75rem);
  font-weight: 800;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-title p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* Bottom nav — interactive */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--app-width);
  z-index: 100;
  display: flex;
  background: rgba(12, 12, 20, 0.92);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 4px;
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  transition: color 0.2s ease;
  position: relative;
}

.bottom-nav a svg { width: 22px; height: 22px; transition: transform 0.3s ease; }

.bottom-nav a.active {
  color: var(--purple);
}

.bottom-nav a.active svg {
  transform: translateY(-3px) scale(1.1);
  filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.6));
}

.bottom-nav a.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: var(--gradient-brand);
  border-radius: 0 0 4px 4px;
}

body.has-bottom-nav {
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}

body.modal-open { overflow: hidden; }

/* Legal & blog */
.legal-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  margin-bottom: 14px;
}

.legal-section h2 {
  font-size: 1.05rem;
  font-weight: 800;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
}

.legal-section h3 { font-size: 0.9rem; font-weight: 600; margin: 14px 0 6px; }
.legal-section p, .legal-section li { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 6px; }
.legal-section ul { list-style: disc; padding-left: 18px; }

.blog-grid { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }

.blog-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s;
}

.blog-card:active { transform: scale(0.98); border-color: var(--border-active); }

.blog-card-thumb {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.3), rgba(219, 39, 119, 0.25));
}

.blog-card-body { padding: 14px; }

.blog-tag {
  display: inline-block;
  padding: 3px 10px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.1);
  border-radius: var(--radius-full);
  margin-bottom: 6px;
}

.blog-card h3 { font-size: 1rem; font-weight: 700; line-height: 1.35; margin-bottom: 6px; }
.blog-card p { font-size: 12px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 8px; }
.blog-meta { font-size: 10px; color: var(--text-muted); font-weight: 600; }

.blog-article .article-header { text-align: center; padding: 16px 0; }
.blog-article .article-header h1 { font-size: 1.4rem; font-weight: 800; line-height: 1.3; margin: 10px 0 6px; }
.blog-article .article-meta { font-size: 11px; color: var(--text-muted); }

.blog-article .article-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  margin-bottom: 16px;
}

.blog-article .article-content p { font-size: 14px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 14px; }
.blog-article .article-content h2 { font-size: 1.05rem; font-weight: 700; margin: 20px 0 10px; }

.blog-article .article-content blockquote {
  border-left: 3px solid var(--purple);
  padding: 10px 14px;
  margin: 14px 0;
  background: var(--primary-light);
  font-style: italic;
  font-size: 13px;
  color: var(--text-secondary);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--purple);
  margin-bottom: 6px;
}

.footer {
  text-align: center;
  padding: 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 6px;
}

.footer-links a { font-weight: 600; font-size: 13px; color: var(--text-muted); }
.footer-links a:hover { color: var(--purple); }

.footer-minimal { padding: 8px 0 16px; }

.btn-cta { margin-top: 14px; }

body.app-page .header,
body.app-page .page { position: relative; z-index: 1; }

body.quiz-play-page .page { padding-top: 8px; }

@media (max-width: 359px) {
  .options-list { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 431px) {
  html { background: var(--bg-deep); }
}

@media (hover: none) and (pointer: coarse) {
  .option-btn, .category-card, .contest-card, .bottom-nav a, .blog-card, .engage-card {
    -webkit-tap-highlight-color: transparent;
  }
}

/* ── AdX / GAM display + anchor ── */
.top-ad-section {
  margin-bottom: 14px;
}

.gpt-ad-wrap {
  display: block;
  text-align: center;
  padding: 8px 0;
  overflow: hidden;
}

.gpt-ad-wrap--top { padding-top: 8px; padding-bottom: 10px; }

.quiz-play-page .gpt-ad-wrap--top .gpt-slot.is-pending,
.quiz-play-page .gpt-ad-wrap--top .gpt-slot.is-empty {
  width: min(300px, 100%);
  height: 300px;
  min-width: min(300px, 100%);
  min-height: 300px;
  max-width: min(300px, 100%);
  max-height: 300px;
  aspect-ratio: 1 / 1;
}

.quiz-play-page .gpt-ad-wrap--top .gpt-slot.is-native-size {
  width: auto;
  min-width: min(300px, 100%);
  min-height: 300px;
  max-width: 300px;
}

.gpt-ad-wrap--inline {
  margin: 14px 0;
  padding-top: 10px;
  padding-bottom: 10px;
}

.gpt-ad-wrap--mid {
  margin: 0 0 14px;
  padding-top: 4px;
  padding-bottom: 4px;
}

.quiz-play-page:has(#quiz-screen:not(.hidden)) .home-mid-ad {
  display: none;
}

.gpt-ad-wrap.is-collapsed {
  display: none;
  padding: 0;
  margin: 0;
}

.gpt-slot {
  display: inline-block;
  margin: 0 auto;
  vertical-align: top;
}

.gpt-slot.is-pending,
.gpt-slot.is-empty {
  width: 100%;
  min-height: 300px;
  max-height: 300px;
  max-width: min(300px, 100%);
  background: var(--surface-glass);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.gpt-ad-wrap--inline .gpt-slot.is-pending,
.gpt-ad-wrap--inline .gpt-slot.is-empty,
.gpt-ad-wrap--mid .gpt-slot.is-pending,
.gpt-ad-wrap--mid .gpt-slot.is-empty {
  min-height: 300px;
  max-height: 300px;
}

.gpt-slot.is-collapsed { display: none !important; }

.gpt-slot.is-native-size {
  min-height: 0 !important;
  max-height: none !important;
  border: none;
  background: transparent;
}

/* Anchor — Google-style expand / minimize tab + our GAM sizes */
.gpt-ad-wrap--anchor {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: none;
  z-index: 2147483646;
  contain: layout style;
  display: flex;
  flex-direction: column;
}

.gpt-ad-wrap--anchor.is-minimized {
  position: fixed;
}

.gpt-ad-wrap--anchor.is-collapsed {
  visibility: hidden;
  pointer-events: none;
}

.gpt-ad-wrap--anchor:not(.is-collapsed) {
  visibility: visible;
  pointer-events: auto;
}

.qt-anchor-panel {
  position: relative;
  overflow: visible;
}

.qt-anchor-rail {
  width: 100%;
  height: 1px;
  background: #fff;
}

.gpt-ad-wrap--anchor.is-expanded .qt-anchor-rail,
.gpt-ad-wrap--anchor.is-collapsed .qt-anchor-rail {
  display: none;
}

.qt-anchor-tab {
  position: relative;
  left: 12px;
  bottom: 0;
  z-index: 4;
  width: 44px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 10px 10px 0 0;
  background: #fff;
  box-shadow: 0 -1px 2px rgba(60, 64, 67, 0.12);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.gpt-ad-wrap--anchor.is-expanded .qt-anchor-tab {
  top: 100%;
  bottom: auto;
}

.gpt-ad-wrap--anchor.is-minimized .qt-anchor-tab {
  position: absolute;
  top: auto;
  bottom: 1px;
  left: 12px;
}

.qt-anchor-tab-icon {
  display: block;
  width: 10px;
  height: 10px;
  font-size: 0;
  line-height: 0;
}

.gpt-ad-wrap--anchor.is-expanded .qt-anchor-tab-icon::before {
  content: '';
  display: block;
  width: 0;
  height: 0;
  margin: 2px auto 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #5f6368;
}

.gpt-ad-wrap--anchor.is-minimized .qt-anchor-tab-icon::before {
  content: '';
  display: block;
  width: 0;
  height: 0;
  margin: 0 auto;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 6px solid #5f6368;
}

.qt-anchor-shell {
  position: relative;
  background: #fff;
  border-top: 1px solid #e8eaed;
  box-shadow: 0 -2px 6px rgba(60, 64, 67, 0.1);
  padding-bottom: env(safe-area-inset-bottom);
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.28s ease, opacity 0.22s ease;
}

.gpt-ad-wrap--anchor.is-expanded .qt-anchor-shell {
  max-height: 320px;
  opacity: 1;
}

.gpt-ad-wrap--anchor.is-minimized .qt-anchor-shell {
  max-height: 0;
  opacity: 0;
  border: none;
  box-shadow: none;
  padding: 0;
}

.gpt-ad-wrap--anchor.is-minimized .qt-anchor-panel {
  height: 23px;
}

.qt-anchor-slot-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  text-align: center;
  overflow: hidden;
  max-height: 300px;
}

.gpt-ad-wrap--anchor .gpt-slot {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  margin: 0 auto;
}

.gpt-slot--anchor.is-pending,
.gpt-slot--anchor.is-empty {
  width: auto;
  min-height: 0;
  max-height: 0;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  overflow: hidden;
}

.gpt-slot--anchor.is-native-size {
  width: auto;
  height: auto;
  max-width: 300px;
  max-height: 300px;
  min-height: 0 !important;
  overflow: hidden;
}

.gpt-ad-wrap--anchor iframe {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  max-height: 300px;
}

body.has-anchor-ad {
  padding-bottom: calc(var(--anchor-ad-h, 24px) + env(safe-area-inset-bottom));
}

body.has-bottom-nav.has-anchor-ad {
  padding-bottom: calc(var(--nav-h) + var(--anchor-ad-h, 24px) + env(safe-area-inset-bottom));
}

.quiz-play-page.has-anchor-ad {
  padding-bottom: calc(var(--anchor-ad-h, 24px) + env(safe-area-inset-bottom));
}

/* Treasure popup */
.treasure-popup {
  position: fixed;
  inset: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--app-width);
  z-index: 220;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: transparent;
  backdrop-filter: none;
  pointer-events: none;
}

.treasure-popup.hidden { display: none; }

.treasure-popup.is-open .treasure-popup-box {
  animation: none;
}

.treasure-popup-box {
  position: relative;
  width: 100%;
  max-width: 340px;
  padding: 28px 22px 24px;
  background: var(--surface-hover);
  border: 1px solid var(--border-active);
  border-radius: var(--radius);
  text-align: center;
  box-shadow: var(--shadow-glow);
  pointer-events: auto;
}

.treasure-close {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 24px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
}

.treasure-icon { font-size: 56px; margin-bottom: 10px; }

.treasure-popup-box h2 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}

.treasure-heading {
  font-size: 1.25rem;
  font-weight: 800;
  background: var(--gradient-win);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

.treasure-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.btn-treasure-claim {
  width: 100%;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 800;
  color: #1a0a0e;
  background: var(--gradient-win);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.claim-pulse {
  animation: none;
}

.btn-start.claim-pulse,
.btn-ad-trigger.claim-pulse {
  animation: none;
}

@keyframes claimPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(253, 224, 71, 0.45); }
  70% { box-shadow: 0 0 0 12px rgba(253, 224, 71, 0); }
  100% { box-shadow: 0 0 0 0 rgba(253, 224, 71, 0); }
}

.gpt-ad-wrap--result {
  margin: 0 0 12px;
}

/* Rewarded ad trigger — interactive CTA */
.btn-ad-trigger {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 16px;
  margin-top: 10px;
  background: var(--gradient-btn);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-pink);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.2s ease;
}

.btn-ad-trigger:active { transform: scale(0.97); }

.btn-ad-trigger.is-loading {
  opacity: 0.75;
  pointer-events: none;
}

.btn-ad-trigger.is-loading::after {
  content: 'Loading ad...';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

@keyframes adPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(236, 72, 153, 0.35); }
  50% { box-shadow: 0 0 32px rgba(168, 85, 247, 0.5), 0 0 0 4px rgba(168, 85, 247, 0.12); }
}

.btn-ad-trigger .ad-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 7px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 4px;
}

.btn-ad-trigger-icon { font-size: 26px; line-height: 1; }

.btn-ad-trigger-text {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  margin-top: 6px;
}

.btn-ad-trigger-sub {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 3px;
}

.btn-ad-trigger--compact {
  padding: 12px 14px;
  margin-top: 0;
  animation: none;
  flex-direction: row;
  justify-content: center;
  gap: 8px;
}

.btn-ad-trigger--compact .btn-ad-trigger-text {
  font-size: 13px;
  margin-top: 0;
  font-weight: 800;
}

.btn-play-free {
  display: block;
  width: 100%;
  max-width: 260px;
  margin: 4px auto 0;
  padding: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  text-decoration: underline;
  background: none;
  border: none;
  cursor: pointer;
}

.btn-play-free:hover { color: var(--purple); }

.ad-bonus-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  margin-bottom: 14px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.12), rgba(236, 72, 153, 0.1));
  border: 1px solid var(--border-active);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s;
}

.ad-bonus-card:active { transform: scale(0.98); }

.ad-bonus-card-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-brand);
  border-radius: 12px;
  font-size: 22px;
  flex-shrink: 0;
}

.ad-bonus-card-text { flex: 1; min-width: 0; }

.ad-bonus-card-text strong {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 2px;
}

.ad-bonus-card .ad-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 7px;
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 4px;
}

body.quiz-play-page .top-ad-section + .genre-chips { margin-top: 4px; }

.gpt-slot:not(.gpt-slot--anchor).is-pending::after,
.gpt-slot:not(.gpt-slot--anchor).is-empty::after {
  content: 'AD';
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: inherit;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}
