/* ============================================
   AIQuiz — Aurora Neon Theme
   Dark midnight · Cyan · Violet · Pink
   Mobile-first · 430px app frame (all screens)
   ============================================ */

:root {
  --bg-deep: #060a12;
  --bg-base: #0a1020;
  --bg-elevated: #111b2e;
  --bg: #141e33;
  --bg-white: #1a2640;
  --surface: rgba(20, 30, 51, 0.88);
  --surface-card: rgba(255, 255, 255, 0.05);
  --surface-glass: rgba(255, 255, 255, 0.07);
  --surface-muted: #1a2540;

  --cyan: #22d3ee;
  --cyan-dark: #06b6d4;
  --violet: #8b5cf6;
  --violet-dark: #7c3aed;
  --pink: #f43f7d;
  --primary: #22d3ee;
  --primary-dark: #06b6d4;
  --primary-light: rgba(34, 211, 238, 0.12);
  --accent: #fb923c;
  --accent-pink: #f43f7d;
  --accent-light: rgba(251, 146, 60, 0.12);

  --success: #34d399;
  --success-light: rgba(52, 211, 153, 0.15);
  --gold: #fbbf24;
  --gold-light: rgba(251, 191, 36, 0.15);

  --text: #e8edf5;
  --text-on-dark: #ffffff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-muted-soft: rgba(255, 255, 255, 0.55);

  --border: rgba(255, 255, 255, 0.08);
  --border-glass: rgba(255, 255, 255, 0.12);
  --border-glow: rgba(34, 211, 238, 0.35);

  --gradient-brand: linear-gradient(135deg, #22d3ee 0%, #8b5cf6 50%, #f43f7d 100%);
  --gradient-btn: linear-gradient(135deg, #06b6d4 0%, #6366f1 100%);
  --gradient-banner: linear-gradient(135deg, #0891b2 0%, #7c3aed 55%, #db2777 100%);
  --gradient-warm: linear-gradient(135deg, #fb923c 0%, #f43f7d 100%);

  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 8px 28px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 24px rgba(34, 211, 238, 0.2);

  --radius: 20px;
  --radius-sm: 14px;
  --radius-full: 100px;
  --header-h: 58px;
  --app-width: 430px;
  --content-max: 100%;
  --pad-x: 16px;
  --font: 'Plus Jakarta Sans', 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition: 0.25s ease;
}

*, *::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.5;
  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;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.55);
}

/* Aurora mesh — inside mobile frame */
.quiz-bg-pattern {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--app-width);
  height: 100%;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 10%, rgba(34, 211, 238, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse 70% 45% at 85% 25%, rgba(139, 92, 246, 0.2) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 50% 80%, rgba(244, 63, 125, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse 90% 60% at 50% 50%, rgba(99, 102, 241, 0.06) 0%, transparent 60%);
}

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; }

/* --- Header --- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(10, 16, 32, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--pad-x);
  padding-left: max(var(--pad-x), env(safe-area-inset-left, 0px));
  padding-right: max(var(--pad-x), env(safe-area-inset-right, 0px));
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
}

.logo-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-brand);
  color: #fff;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(34, 211, 238, 0.35);
}

.coin-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--gold-light);
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
}

.coin-badge svg { flex-shrink: 0; }

.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--pad-x);
  padding-left: max(var(--pad-x), env(safe-area-inset-left, 0px));
  padding-right: max(var(--pad-x), env(safe-area-inset-right, 0px));
}

.page { padding-bottom: 32px; }

/* --- Quiz Play Page --- */
html:has(body.quiz-play-page) { background: var(--bg-deep); }

body.quiz-play-page {
  padding-bottom: 0;
  background: var(--bg-base);
  box-shadow: none;
  position: relative;
  overflow-x: hidden;
}

body.quiz-play-page .page,
body.quiz-play-page .container {
  position: relative;
  z-index: 1;
}

body.quiz-play-page .page {
  padding-top: 14px;
  padding-bottom: 24px;
}

body.quiz-play-page .container {
  padding-left: max(var(--pad-x), env(safe-area-inset-left, 0px));
  padding-right: max(var(--pad-x), env(safe-area-inset-right, 0px));
}

body.quiz-play-page .sponsored {
  display: block;
  text-align: center;
  margin: 0 0 18px;
  padding: 6px 0 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted-soft);
  background: none;
  border: none;
}

body.quiz-play-page .top-ad-section { margin-bottom: 18px; }

body.quiz-play-page .gpt-ad-wrap--top {
  padding-top: 0;
  padding-bottom: 0;
  margin-bottom: 0;
  min-height: 0;
}

body.quiz-play-page .gpt-ad-wrap--top .gpt-slot--top.is-pending {
  width: 100%;
  min-width: 300px;
  min-height: 250px;
  max-width: min(300px, 100%);
  margin: 0 auto;
  background: var(--surface-glass);
  border: 1px solid var(--border);
  border-radius: 12px;
}

body.quiz-play-page .gpt-ad-wrap--top.is-collapsed,
body.quiz-play-page .gpt-ad-wrap--top:has(.gpt-slot.is-collapsed) {
  display: none;
  min-height: 0;
  margin: 0;
  padding: 0;
}

body.quiz-play-page .gpt-ad-wrap--top.is-collapsed + .btn-ad-trigger { margin-top: 0; }

body.quiz-play-page .quiz-card {
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border-glass);
  border-radius: 22px;
  box-shadow: var(--shadow-card), var(--shadow-glow);
  margin-top: 0;
  margin-bottom: 16px;
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

body.quiz-play-page .quiz-reward-banner {
  background: var(--gradient-banner);
  padding: 20px 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

body.quiz-play-page .quiz-reward-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 0%, rgba(255,255,255,0.2) 0%, transparent 50%);
  pointer-events: none;
}

body.quiz-play-page .quiz-reward-banner h1 {
  font-size: clamp(1rem, 3.5vw, 1.35rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.4;
  margin: 0;
  position: relative;
}

body.quiz-play-page .quiz-reward-banner #reward-coins {
  color: var(--gold);
  font-weight: 800;
}

body.quiz-play-page .quiz-card-body { padding: 16px 14px 18px; }

body.quiz-play-page .quiz-question-box {
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.2);
  border-radius: 16px;
  padding: 16px 14px;
  margin-bottom: 16px;
}

body.quiz-play-page .quiz-question {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1.45;
  text-align: center;
}

body.quiz-play-page .options-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 4px;
}

body.quiz-play-page .option-btn {
  min-height: 52px;
  padding: 14px 12px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: var(--gradient-btn);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

body.quiz-play-page .option-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(6, 182, 212, 0.45);
}

body.quiz-play-page .option-btn.selected {
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.45);
}

body.quiz-play-page .option-btn.correct {
  background: linear-gradient(135deg, #34d399, #059669);
  box-shadow: 0 4px 14px rgba(52, 211, 153, 0.4);
  color: #fff;
}

body.quiz-play-page .option-btn.wrong {
  background: linear-gradient(135deg, #f87171, #dc2626);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
  color: #fff;
}

body.quiz-play-page .quiz-progress {
  text-align: center;
  margin-top: 18px;
  padding-top: 0;
  border-top: none;
}

body.quiz-play-page .progress-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

body.quiz-play-page .progress-text span {
  color: var(--cyan);
  font-weight: 800;
}

body.quiz-play-page .progress-bar { display: none; }

body.quiz-play-page .btn-next {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: var(--gradient-btn);
  border: none;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.35);
}

body.quiz-play-page .btn-next-outline {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--cyan);
  background: var(--primary-light);
  border: 1px solid rgba(34, 211, 238, 0.25);
  border-radius: 14px;
}

body.quiz-play-page .fact-card {
  background: var(--surface-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: 18px;
  padding: 14px 16px;
  margin-bottom: 16px;
  animation: slideUp 0.5s ease 0.1s both;
}

body.quiz-play-page .fact-card-inner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

body.quiz-play-page .fact-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-brand);
  border-radius: 12px;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.35);
}

body.quiz-play-page .fact-card h4 {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

body.quiz-play-page .fact-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

body.quiz-play-page .discover-section {
  background: var(--surface);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 20px 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

body.quiz-play-page .discover-section h2 {
  font-size: 1.125rem;
  color: var(--text);
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body.quiz-play-page .discover-list li { color: var(--text-secondary); font-size: 13px; }

body.quiz-play-page .footer-minimal {
  padding: 8px 16px 20px;
  border-top: none;
}

body.quiz-play-page .footer-minimal .footer-links a {
  color: var(--text-muted-soft);
  font-weight: 600;
  font-size: 14px;
}

body.quiz-play-page .footer-minimal .footer-links a:hover {
  color: var(--cyan);
  text-decoration: none;
}

body.quiz-play-page .result-screen .result-body {
  text-align: center;
  padding: 24px 16px;
}

/* --- Result popup modal --- */
.result-modal {
  position: fixed;
  top: 0;
  bottom: 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: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px));
}

.result-modal.hidden {
  display: none;
}

.result-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(6, 10, 18, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: modalFadeIn 0.25s ease;
}

.result-modal-box {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 100%;
  animation: modalPopIn 0.35s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.result-modal .quiz-card {
  margin: 0;
  width: 100%;
  overflow: hidden;
  border-radius: 22px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55), 0 0 40px rgba(34, 211, 238, 0.12);
}

body.modal-open {
  overflow: hidden;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalPopIn {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

body.quiz-play-page .result-screen .result-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  border-radius: 50%;
}

body.quiz-play-page .result-screen h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}

body.quiz-play-page .result-screen .coins-won {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--gold);
  margin: 12px 0;
}

body.quiz-play-page .result-screen .result-msg {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

body.quiz-play-page .result-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Engagement hooks */
body.quiz-play-page .engage-ticker {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: 10px;
  background: var(--surface-glass);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  font-size: clamp(11px, 2.8vw, 13px);
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  animation: slideUp 0.4s ease;
}

body.quiz-play-page .engage-ticker #winner-ticker,
body.quiz-play-page .engage-ticker span:not(.engage-ticker-dot) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

body.quiz-play-page .engage-ticker-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--success);
  animation: liveBlink 1.2s ease-in-out infinite;
}

body.quiz-play-page .engage-stats {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

body.quiz-play-page .engage-stat {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 10px;
  background: var(--surface-glass);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 11px;
  color: var(--text-secondary);
}

body.quiz-play-page .engage-stat strong {
  color: var(--cyan);
  font-weight: 800;
}

body.quiz-play-page .engage-stat-urgent strong {
  color: var(--gold);
  animation: urgentPulse 1s ease-in-out infinite;
}

body.quiz-play-page .engage-stat-icon { font-size: 14px; }

body.quiz-play-page .engage-slots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 12px;
  margin-bottom: 12px;
  background: linear-gradient(90deg, rgba(244, 63, 125, 0.2), rgba(251, 191, 36, 0.15));
  border: 1px solid rgba(244, 63, 125, 0.3);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  animation: slotsShake 3s ease-in-out infinite;
}

body.quiz-play-page .engage-slots strong {
  color: var(--gold);
  font-size: 14px;
}

body.quiz-play-page .engage-slots em {
  font-style: normal;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--pink);
}

body.quiz-play-page .slots-pulse {
  width: 8px;
  height: 8px;
  background: var(--pink);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--pink);
  animation: liveBlink 0.8s ease-in-out infinite;
}

body.quiz-play-page .quiz-card-glow { animation: cardGlow 2.5s ease-in-out infinite; }

body.quiz-play-page .coin-float {
  font-size: 28px;
  margin-bottom: 4px;
  animation: coinBounce 1.5s ease-in-out infinite;
}

body.quiz-play-page .reward-sub {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 6px;
  position: relative;
}

body.quiz-play-page .tap-hint {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--cyan);
  margin-bottom: 12px;
  padding: 9px 10px;
  background: rgba(34, 211, 238, 0.08);
  border: 1px dashed rgba(34, 211, 238, 0.4);
  border-radius: 12px;
  animation: tapHintPulse 1.2s ease-in-out infinite;
}

body.quiz-play-page .tap-hint.hidden { display: none; }

body.quiz-play-page .tap-arrow {
  display: inline-block;
  animation: arrowBounce 0.8s ease-in-out infinite;
}

body.quiz-play-page .options-pulse .option-btn { animation: optionPulse 2s ease-in-out infinite; }
body.quiz-play-page .options-pulse .option-btn:nth-child(1) { animation-delay: 0s; }
body.quiz-play-page .options-pulse .option-btn:nth-child(2) { animation-delay: 0.3s; }
body.quiz-play-page .options-pulse .option-btn:nth-child(3) { animation-delay: 0.6s; }
body.quiz-play-page .options-pulse .option-btn:nth-child(4) { animation-delay: 0.9s; }

body.quiz-play-page .options-pulse.answered .option-btn,
body.quiz-play-page .option-btn:disabled { animation: none; }

/* GPT Ads */
.gpt-ad-wrap {
  display: block;
  min-height: 0;
  overflow: hidden;
  padding-top: 12px;
  padding-bottom: 12px;
  text-align: center;
}

.gpt-ad-wrap--top { padding-top: 8px; padding-bottom: 10px; }
.gpt-ad-wrap--inline { padding-top: 10px; padding-bottom: 10px; margin: 8px 0; }
.gpt-ad-wrap:empty, .gpt-ad-wrap.is-collapsed { display: none; }

.gpt-slot {
  display: inline-block;
  width: auto;
  margin: 0 auto;
  text-align: center;
  vertical-align: top;
}

.gpt-slot.is-pending {
  width: 100%;
  min-width: 0;
  max-width: min(336px, 100%);
}

/* Top ad — GPT needs visible slot size (expands to 300×600 when loaded) */
.gpt-slot--top.is-pending {
  min-height: 250px;
  max-width: min(300px, 100%);
}

body.quiz-play-page .gpt-ad-wrap--top:has(.gpt-slot--top.is-pending) {
  min-height: 0;
  padding-top: 8px;
  padding-bottom: 10px;
}

/* Inline & result ads — no empty gap until ad actually renders */
.gpt-slot--inline.is-pending,
.gpt-slot--result.is-pending {
  min-height: 0 !important;
  height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  visibility: hidden;
  border: none;
  background: transparent;
}

.gpt-slot.is-native-size,
.gpt-slot:not(.is-pending):not(.is-collapsed) {
  visibility: visible;
  height: auto;
  overflow: visible;
}

.gpt-ad-wrap--inline:has(.gpt-slot--inline.is-pending),
.gpt-ad-wrap--inline:has(.gpt-slot--result.is-pending) {
  padding: 0;
  margin: 0;
  min-height: 0;
}

.gpt-slot.is-collapsed,
.gpt-ad-wrap.is-collapsed {
  display: none !important;
  min-height: 0 !important;
}

.gpt-slot.is-native-size {
  min-width: 0 !important;
  max-width: none !important;
  min-height: 0 !important;
  padding: 0 !important;
  overflow: hidden;
}

body.quiz-play-page .discover-section .gpt-ad-wrap--inline { margin-bottom: 12px; }
/* Ad trigger button */
body.quiz-play-page .btn-ad-trigger {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: min(300px, 100%);
  margin: 14px auto 0;
  padding: 14px 16px;
  background: var(--gradient-warm);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  box-shadow: 0 6px 24px rgba(244, 63, 125, 0.4);
  cursor: pointer;
  animation: adBtnPulse 1.5s ease-in-out infinite;
  transition: transform 0.2s ease;
}

body.quiz-play-page .btn-ad-trigger .ad-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #fff;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  line-height: 1;
}

body.quiz-play-page .btn-ad-trigger:hover { transform: scale(1.03); }
body.quiz-play-page .btn-ad-trigger:active { transform: scale(0.98); }
body.quiz-play-page .btn-ad-trigger-icon { font-size: 24px; line-height: 1; }
body.quiz-play-page .btn-ad-trigger-text { font-size: 16px; font-weight: 800; color: #fff; margin-top: 4px; }
body.quiz-play-page .btn-ad-trigger-sub { font-size: 11px; font-weight: 500; color: rgba(255, 255, 255, 0.85); margin-top: 2px; }

/* Sponsored */
.sponsored {
  display: inline-block;
  margin: 16px 0 8px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
}

/* Quiz Card (generic) */
.quiz-card {
  background: var(--surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: var(--shadow-card);
  margin-bottom: 20px;
  animation: slideUp 0.4s ease;
}

.quiz-reward { text-align: center; margin-bottom: 24px; }

.quiz-category-label {
  display: inline-block;
  margin-bottom: 8px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cyan);
  background: var(--primary-light);
  border-radius: var(--radius-full);
}

.quiz-reward h1 {
  font-size: clamp(1.25rem, 4.5vw, 1.5rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

.quiz-reward .coins-highlight { color: var(--gold); font-weight: 800; }

.quiz-question {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 20px;
  line-height: 1.45;
}

/* Options (generic) */
.options-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.option-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 88px;
  padding: 14px 10px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  background: var(--surface-muted);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.option-btn .option-text { line-height: 1.3; word-break: break-word; }

.option-btn:hover:not(:disabled) {
  border-color: var(--cyan);
  background: var(--primary-light);
}

.option-btn.selected {
  border-color: var(--cyan);
  background: var(--primary-light);
  color: var(--cyan);
}

.option-btn.correct {
  border-color: var(--success);
  background: var(--success-light);
  color: var(--success);
}

.option-btn.wrong {
  border-color: #f87171;
  background: rgba(248, 113, 113, 0.12);
  color: #f87171;
}

.option-btn:disabled { cursor: default; }

.option-letter {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.option-btn.selected .option-letter,
.option-btn:hover:not(:disabled) .option-letter {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #0a1020;
}

.option-btn.correct .option-letter {
  background: var(--success);
  border-color: var(--success);
  color: #0a1020;
}

.option-btn.wrong .option-letter {
  background: #f87171;
  border-color: #f87171;
  color: #fff;
}

/* Progress */
.quiz-progress {
  text-align: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.progress-text { font-size: 14px; font-weight: 600; color: var(--text-secondary); }
.progress-text strong { color: var(--cyan); font-size: 16px; }

.progress-bar {
  height: 6px;
  background: var(--surface-muted);
  border-radius: var(--radius-full);
  margin-top: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-brand);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

/* Fact card (generic) */
.fact-card {
  background: var(--surface-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
  animation: slideUp 0.5s ease 0.1s both;
}

.fact-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.fact-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-brand);
  border-radius: 10px;
  font-size: 18px;
}

.fact-card h4 { font-size: 15px; font-weight: 700; color: var(--text); }
.fact-card p { font-size: 14px; color: var(--text-secondary); line-height: 1.55; }

/* Discover */
.discover-section {
  background: var(--surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.discover-section--spaced { margin-top: 24px; }

.discover-section h2 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 16px;
  text-align: center;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.discover-list { display: flex; flex-direction: column; gap: 12px; }

.discover-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.discover-list li::before {
  content: '✓';
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  color: var(--cyan);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
}

/* Category cards */
.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 12px;
  background: var(--surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
  text-align: center;
  transition: all var(--transition);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.category-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-card), var(--shadow-glow);
}

.category-card .cat-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-brand);
  border-radius: 14px;
  font-size: 24px;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.3);
}

.category-card h3 { font-size: 14px; font-weight: 700; color: var(--text); }
.category-card span { font-size: 12px; color: var(--text-muted); }

/* Contest cards */
.contest-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.contest-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  transition: all var(--transition);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.contest-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-card), var(--shadow-glow);
}

.contest-card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-btn);
  border-radius: 12px;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.25);
}

.contest-card-info { flex: 1; min-width: 0; }
.contest-card-info h3 { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.contest-card-info p { font-size: 12px; color: var(--text-muted); }

.contest-coins {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  flex-shrink: 0;
}

.contest-play-btn {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: var(--gradient-btn);
  border-radius: var(--radius-full);
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
  transition: all var(--transition);
  flex-shrink: 0;
}

.contest-play-btn:hover {
  transform: scale(1.04);
  box-shadow: 0 6px 16px rgba(6, 182, 212, 0.45);
}

/* Result screen */
.result-screen { text-align: center; animation: popIn 0.5s ease; }

.result-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gold-light);
  border-radius: 50%;
  font-size: 40px;
  animation: bounce 0.6s ease;
}

.result-screen h2 { font-size: 1.5rem; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.result-screen .coins-won { font-size: 2rem; font-weight: 800; color: var(--gold); margin: 16px 0; }
.result-screen p { font-size: 14px; color: var(--text-secondary); margin-bottom: 24px; }
.result-actions { display: flex; flex-direction: column; gap: 10px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 700;
  border-radius: var(--radius-full);
  transition: all var(--transition);
  width: 100%;
}

.btn-primary {
  color: #fff;
  background: var(--gradient-btn);
  box-shadow: 0 4px 16px rgba(6, 182, 212, 0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.45);
}

.btn-cta { margin-top: 16px; }

.btn-secondary {
  color: var(--cyan);
  background: var(--primary-light);
  border: 1px solid rgba(34, 211, 238, 0.25);
}

.btn-secondary:hover { background: rgba(34, 211, 238, 0.18); }

.btn-accent {
  color: #fff;
  background: var(--gradient-warm);
}

/* Legal */
.legal-section {
  background: var(--surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
  padding: 24px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.legal-section h2 {
  font-size: 1.125rem;
  font-weight: 800;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}

.legal-section h3 { font-size: 0.9375rem; font-weight: 600; color: var(--text); margin: 16px 0 8px; }
.legal-section p, .legal-section li { font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 8px; }
.legal-section ul { list-style: disc; padding-left: 20px; }

/* Page title */
.page-title { text-align: center; padding: 24px 0 8px; }

.page-title h1 {
  font-size: clamp(1.35rem, 4.5vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-title p { font-size: 14px; color: var(--text-muted-soft); margin-top: 6px; }

/* Bottom nav */
.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(10, 16, 32, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-glass);
  box-shadow: 0 -4px 28px rgba(0, 0, 0, 0.4);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  transition: color var(--transition);
}

.bottom-nav a svg { width: 22px; height: 22px; }

.bottom-nav a.active {
  color: var(--cyan);
}

.bottom-nav a.active svg {
  filter: drop-shadow(0 0 6px rgba(34, 211, 238, 0.6));
}

.bottom-nav a:hover { color: var(--text); }

body.has-bottom-nav {
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  position: relative;
}

body.app-page .header,
body.app-page .gpt-ad-wrap,
body.app-page .page { position: relative; z-index: 1; }

body.app-page .gpt-ad-wrap--top {
  padding-top: 4px;
  padding-bottom: 4px;
  max-width: var(--content-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: max(var(--pad-x), env(safe-area-inset-left, 0px));
  padding-right: max(var(--pad-x), env(safe-area-inset-right, 0px));
}

/* Footer */
.footer {
  text-align: center;
  padding: 20px 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 8px;
}

.footer-links a {
  color: var(--text-muted-soft);
  font-weight: 600;
  font-size: 14px;
}

.footer-links a:hover { color: var(--cyan); }

.quiz-screen.hidden { display: none; }

/* Animations */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

@keyframes liveBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

@keyframes urgentPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes slotsShake {
  0%, 90%, 100% { transform: translateX(0); }
  92% { transform: translateX(-3px); }
  94% { transform: translateX(3px); }
  96% { transform: translateX(-2px); }
  98% { transform: translateX(2px); }
}

@keyframes cardGlow {
  0%, 100% { box-shadow: var(--shadow-card), 0 0 0 0 rgba(34, 211, 238, 0); }
  50% { box-shadow: var(--shadow-card), 0 0 24px 4px rgba(34, 211, 238, 0.15); }
}

@keyframes coinBounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-6px) rotate(10deg); }
}

@keyframes tapHintPulse {
  0%, 100% { transform: scale(1); background: rgba(34, 211, 238, 0.08); }
  50% { transform: scale(1.02); background: rgba(34, 211, 238, 0.14); }
}

@keyframes arrowBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(3px); }
}

@keyframes optionPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(6, 182, 212, 0.3); }
  50% { transform: scale(1.03); box-shadow: 0 8px 22px rgba(6, 182, 212, 0.5); }
}

@keyframes adBtnPulse {
  0%, 100% { box-shadow: 0 6px 24px rgba(244, 63, 125, 0.4); }
  50% { box-shadow: 0 8px 32px rgba(244, 63, 125, 0.6), 0 0 0 4px rgba(244, 63, 125, 0.15); }
}

/* Small phones */
@media (max-width: 359px) {
  body.quiz-play-page .options-list {
    grid-template-columns: 1fr;
  }

  .contest-card {
    display: grid;
    grid-template-columns: 44px 1fr;
    grid-template-rows: auto auto auto;
    gap: 8px 12px;
  }

  .contest-card-icon {
    grid-row: 1 / 3;
    width: 44px;
    height: 44px;
    font-size: 20px;
  }

  .contest-coins {
    grid-column: 2;
    justify-self: start;
  }

  .contest-play-btn {
    grid-column: 1 / -1;
    width: 100%;
    text-align: center;
    padding: 10px 16px;
  }

  .coin-badge {
    padding: 5px 10px;
    font-size: 12px;
  }

  .logo { font-size: 16px; }
  .logo-icon { width: 32px; height: 32px; }
}

/* Medium phones — prevent contest card overflow */
@media (min-width: 360px) and (max-width: 639px) {
  .contest-card {
    flex-wrap: wrap;
    row-gap: 10px;
  }

  .contest-play-btn {
    flex: 1 1 100%;
    text-align: center;
    padding: 10px 16px;
  }
}

/* Phones landscape — keep mobile frame */
@media (min-width: 480px) {
  body.quiz-play-page .engage-stats {
    gap: 12px;
  }

  body.quiz-play-page .engage-stat {
    font-size: 12px;
    padding: 10px 12px;
  }
}

/* Desktop — darker side bars outside phone frame */
@media (min-width: 431px) {
  html {
    background: var(--bg-deep);
  }
}

/* Touch-friendly tap targets */
@media (hover: none) and (pointer: coarse) {
  .option-btn,
  body.quiz-play-page .option-btn,
  .category-card,
  .contest-card,
  .bottom-nav a {
    -webkit-tap-highlight-color: transparent;
  }
}
