/* ── VerbaSave Quiz Page ───────────────────────────────────────────────── */
:root {
  --quiz-a: #4F8EF7;
  --quiz-b: #F7A34F;
  --quiz-c: #4FC98E;
  --quiz-d: #F74F7A;
  /* fallback for surface-3 (not in theme-overrides) */
  --surface-3: rgba(255,255,255,0.05);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg, #08051b); color: var(--text-1, #fff); font-family: 'Nunito', system-ui, sans-serif; min-height: 100vh; }
a { color: inherit; text-decoration: none; }

/* ── Header ─────────────────────────────────────────────────────────────── */
.quiz-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex; align-items: center; gap: 16px;
}
.quiz-logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 17px; }
.quiz-logo img { width: 28px; height: 28px; object-fit: contain; }
.quiz-header-back {
  margin-left: auto;
  padding: 6px 14px; border-radius: 8px;
  background: var(--surface-3); border: 1px solid var(--border);
  color: var(--text-2); font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  transition: background .15s;
}
.quiz-header-back:hover { background: var(--surface-2); }

/* ── Main layout ─────────────────────────────────────────────────────────── */
.quiz-main {
  max-width: 680px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

/* ── Hero (start screen) ─────────────────────────────────────────────────── */
#quiz-start-screen {
  text-align: center;
  padding: 48px 0;
}
.quiz-hero-icon { font-size: 64px; margin-bottom: 16px; }
.quiz-hero-title { font-size: 2rem; font-weight: 900; margin-bottom: 8px; }
.quiz-hero-sub { color: var(--text-2); font-size: 15px; line-height: 1.6; margin-bottom: 32px; }

.quiz-stats-row {
  display: flex; gap: 16px; justify-content: center;
  margin-bottom: 32px; flex-wrap: wrap;
}
.quiz-stat-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 24px;
  min-width: 120px;
}
.quiz-stat-num { font-size: 1.8rem; font-weight: 900; color: var(--accent-1); }
.quiz-stat-label { font-size: 12px; color: var(--text-2); margin-top: 2px; }

.quiz-btn-start {
  background: var(--accent-1);
  color: #fff;
  border: none; border-radius: 12px;
  padding: 14px 36px;
  font-size: 16px; font-weight: 800;
  cursor: pointer; font-family: inherit;
  transition: opacity .15s, transform .1s;
  display: inline-flex; align-items: center; gap: 8px;
}
.quiz-btn-start:hover { opacity: .88; }
.quiz-btn-start:active { transform: scale(.97); }
.quiz-btn-start:disabled { opacity: .45; cursor: not-allowed; }

.quiz-limit-notice {
  margin-top: 16px;
  font-size: 12px; color: var(--text-3);
}

.quiz-no-questions {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
  margin-top: 24px;
}
.quiz-no-questions h3 { font-size: 1.1rem; margin-bottom: 8px; }
.quiz-no-questions p { color: var(--text-2); font-size: 14px; line-height: 1.5; }
.quiz-no-questions a { color: var(--accent-1); text-decoration: underline; }

/* ── Quiz session ─────────────────────────────────────────────────────────── */
#quiz-session-screen { display: none; }

.quiz-progress-bar-wrap {
  height: 6px; background: var(--surface-3); border-radius: 99px;
  margin-bottom: 24px; overflow: hidden;
}
.quiz-progress-bar {
  height: 100%; background: var(--accent-1); border-radius: 99px;
  transition: width .4s ease;
}
.quiz-progress-label {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--text-3);
  margin-bottom: 8px;
}

.quiz-article-tag {
  font-size: 11px; color: var(--text-3);
  background: var(--surface-3);
  border-radius: 999px; padding: 3px 10px;
  display: inline-block; margin-bottom: 16px;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.quiz-question-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px 28px 24px;
  margin-bottom: 20px;
}
.quiz-q-number { font-size: 11px; font-weight: 700; color: var(--text-3); margin-bottom: 10px; text-transform: uppercase; letter-spacing: .05em; }
.quiz-q-text { font-size: 1.1rem; font-weight: 700; line-height: 1.5; }

.quiz-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 24px;
}
@media (max-width: 480px) {
  .quiz-options-grid { grid-template-columns: 1fr; }
}

.quiz-option-btn {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 13px; font-weight: 600;
  color: var(--text-1);
  cursor: pointer; font-family: inherit;
  text-align: left; line-height: 1.4;
  transition: border-color .15s, background .15s, transform .1s;
}
.quiz-option-btn:hover:not(:disabled) { border-color: var(--accent-1); background: rgba(79,142,247,0.08); }
.quiz-option-btn:active:not(:disabled) { transform: scale(.98); }
.quiz-option-btn:disabled { cursor: default; }

.quiz-opt-letter {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 900; flex-shrink: 0;
  margin-top: 1px;
}
.quiz-option-btn[data-opt="a"] .quiz-opt-letter { background: rgba(79,142,247,0.18); color: var(--quiz-a); }
.quiz-option-btn[data-opt="b"] .quiz-opt-letter { background: rgba(247,163,79,0.18); color: var(--quiz-b); }
.quiz-option-btn[data-opt="c"] .quiz-opt-letter { background: rgba(79,201,142,0.18); color: var(--quiz-c); }
.quiz-option-btn[data-opt="d"] .quiz-opt-letter { background: rgba(247,79,122,0.18); color: var(--quiz-d); }

/* Answer feedback states */
.quiz-option-btn.correct {
  border-color: #4FC98E !important;
  background: rgba(79,201,142,0.12) !important;
}
.quiz-option-btn.wrong {
  border-color: #F74F7A !important;
  background: rgba(247,79,122,0.10) !important;
}

/* ── Feedback bar ─────────────────────────────────────────────────────────── */
#quiz-feedback {
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 16px;
  font-size: 14px; font-weight: 700;
  display: none;
  align-items: center; gap: 10px;
}
#quiz-feedback.correct { background: rgba(79,201,142,0.12); border: 1px solid rgba(79,201,142,0.3); color: #4FC98E; }
#quiz-feedback.wrong   { background: rgba(247,79,122,0.10); border: 1px solid rgba(247,79,122,0.3); color: #F74F7A; }
#quiz-feedback.show    { display: flex; }

.quiz-points-badge {
  margin-left: auto; font-size: 13px;
  background: rgba(79,201,142,0.2); color: #4FC98E;
  border-radius: 999px; padding: 2px 10px;
}

.quiz-btn-next {
  width: 100%;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px;
  font-size: 14px; font-weight: 700;
  color: var(--text-1);
  cursor: pointer; font-family: inherit;
  transition: background .15s;
  display: none;
}
.quiz-btn-next.show { display: block; }
.quiz-btn-next:hover { background: var(--surface-2); }

/* ── Results screen ─────────────────────────────────────────────────────────── */
#quiz-results-screen {
  display: none;
  text-align: center;
  padding: 48px 0;
}
#quiz-results-screen.show { display: block; }
.quiz-results-emoji { font-size: 72px; margin-bottom: 16px; }
.quiz-results-title { font-size: 1.8rem; font-weight: 900; margin-bottom: 8px; }
.quiz-results-sub   { color: var(--text-2); font-size: 15px; margin-bottom: 32px; }
.quiz-results-score {
  font-size: 3.5rem; font-weight: 900;
  color: var(--accent-1);
  margin-bottom: 4px;
}
.quiz-results-points {
  font-size: 14px; color: var(--text-2); margin-bottom: 32px;
}
.quiz-results-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.quiz-btn-again {
  background: var(--accent-1); color: #fff;
  border: none; border-radius: 12px;
  padding: 12px 28px;
  font-size: 14px; font-weight: 800;
  cursor: pointer; font-family: inherit;
  transition: opacity .15s;
}
.quiz-btn-again:hover { opacity: .88; }
.quiz-btn-lb {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 28px;
  font-size: 14px; font-weight: 700;
  color: var(--text-2); cursor: pointer; font-family: inherit;
  transition: background .15s;
}
.quiz-btn-lb:hover { background: var(--surface-2); }

/* ── Daily limit screen ─────────────────────────────────────────────────────── */
#quiz-limit-screen {
  display: none;
  text-align: center;
  padding: 48px 0;
}
#quiz-limit-screen.show { display: block; }
