/* ─── CSS Variables ─────────────────────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg:        #06080f;
  --surface:   #0c1120;
  --surface-2: #111827;
  --surface-3: #1a2236;

  /* Borders */
  --border:        rgba(255, 255, 255, 0.07);
  --border-hover:  rgba(255, 255, 255, 0.14);
  --border-accent: rgba(59, 130, 246, 0.45);

  /* Brand accent */
  --accent:     #3b82f6;
  --accent-dim: rgba(59, 130, 246, 0.12);
  --accent-glow:rgba(59, 130, 246, 0.22);

  /* Semantic */
  --correct:     #10b981;
  --correct-dim: rgba(16, 185, 129, 0.13);
  --wrong:       #f43f5e;
  --wrong-dim:   rgba(244, 63, 94, 0.13);
  --warning:     #f59e0b;
  --warning-dim: rgba(245, 158, 11, 0.13);

  /* Text */
  --text:           #e8edf8;
  --text-secondary: #7c90ae;
  --text-muted:     #3d4f6a;

  /* Vendor colors */
  --cisco:   #1d6fbb;
  --aws:     #f97316;
  --azure:   #0ea5e9;
  --comptia: #c8202f;
  --google:  #4285f4;
  --linux:   #e8a800;

  /* Layout */
  --radius-sm: 10px;
  --radius:    16px;
  --radius-lg: 24px;
  --header-h:  60px;

  /* Fonts */
  --font:      'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button { font-family: var(--font); cursor: pointer; border: none; outline: none; background: none; }
a { text-decoration: none; color: inherit; }
input { font-family: var(--font); }

/* ─── App Shell ──────────────────────────────────────────────────────────────── */
#app {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
  background: var(--bg);
}

#screen-container {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

/* ─── Screen Transitions ─────────────────────────────────────────────────────── */
.screen {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* Scrollbar styling */
.screen::-webkit-scrollbar { width: 4px; }
.screen::-webkit-scrollbar-track { background: transparent; }
.screen::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 2px; }

#screen-container.entering .screen {
  animation: screenSlideIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
#screen-container.exiting {
  animation: screenSlideOut 0.2s ease forwards;
}

@keyframes screenSlideIn {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes screenSlideOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-12px); }
}

/* ─── Typography ─────────────────────────────────────────────────────────────── */
.label-mono {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  margin: 24px 0 12px;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ─── Buttons ────────────────────────────────────────────────────────────────── */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 600;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
}
.btn-primary:hover  { background: #2563eb; box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4); }
.btn-primary:active { transform: scale(0.97); }

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 500;
  transition: background 0.15s, transform 0.1s;
}
.btn-secondary:hover  { background: var(--surface-3); }
.btn-secondary:active { transform: scale(0.97); }

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-secondary);
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
  flex-shrink: 0;
}
.btn-icon:hover  { background: var(--surface-3); color: var(--text); }
.btn-icon:active { transform: scale(0.95); }

/* ─── Loading ────────────────────────────────────────────────────────────────── */
.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.loader {
  width: 32px;
  height: 32px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Badges ─────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}
.badge-soon   { background: var(--surface-3); color: var(--text-muted); }
.badge-easy   { background: var(--correct-dim); color: var(--correct); }
.badge-medium { background: var(--warning-dim); color: var(--warning); }
.badge-hard   { background: var(--wrong-dim); color: var(--wrong); }


/* ═══════════════════════════════════════════════════════════════════════════════
   HOME SCREEN
════════════════════════════════════════════════════════════════════════════════ */
.home-screen {
  padding-bottom: 40px;
  background: var(--bg);
}

/* Header */
.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 56px 20px 0;
}

.app-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo-bolt {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 4px 12px var(--accent-glow);
}
.logo-text {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.header-stat {
  text-align: right;
}
.header-stat .stat-val {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.header-stat .stat-lbl {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Hero */
.home-hero {
  padding: 32px 20px 8px;
}
.hero-title {
  font-size: clamp(28px, 8vw, 36px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text);
}
.hero-accent {
  background: linear-gradient(90deg, var(--accent), #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle {
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 400;
}

/* Pack Cards */
.pack-list {
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pack-card {
  display: flex;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s, transform 0.1s, box-shadow 0.2s;
  cursor: pointer;
  position: relative;
}
.pack-card.available:hover {
  border-color: var(--border-hover);
  box-shadow: 0 4px 24px rgba(0,0,0,0.35);
}
.pack-card.available:active { transform: scale(0.985); }
.pack-card.unavailable { opacity: 0.55; cursor: default; }

.pack-card .accent-strip {
  width: 4px;
  flex-shrink: 0;
  border-radius: 0;
}

.pack-card .card-body {
  flex: 1;
  padding: 16px 16px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.card-vendor {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 400;
}
.card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.card-meta-item {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.card-meta-item.best {
  color: var(--correct);
  font-weight: 500;
}

.btn-start {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.btn-start:hover  { background: rgba(59, 130, 246, 0.2); border-color: rgba(59, 130, 246, 0.4); }
.btn-start:active { transform: scale(0.96); }
.btn-start:disabled { opacity: 0.5; cursor: not-allowed; }


/* ═══════════════════════════════════════════════════════════════════════════════
   QUIZ SCREEN
════════════════════════════════════════════════════════════════════════════════ */
.quiz-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
}

/* Top bar */
.quiz-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 56px 16px 12px;
  gap: 12px;
  flex-shrink: 0;
}
.quiz-pack-label {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.quiz-counter {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  min-width: 40px;
  text-align: right;
}

/* Timer bar */
.timer-track {
  height: 3px;
  background: var(--surface-2);
  margin: 0 0 0 0;
  flex-shrink: 0;
}
.timer-fill {
  height: 100%;
  width: 100%;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
  transition: width 1s linear, background 0.5s ease;
  transform-origin: left;
}
.timer-fill.warning { background: var(--warning); }
.timer-fill.danger  { background: var(--wrong); }

/* Timer number */
.quiz-timer-num {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  min-width: 24px;
  text-align: center;
  transition: color 0.3s;
}
.quiz-timer-num.warning { color: var(--warning); }
.quiz-timer-num.danger  { color: var(--wrong); animation: pulse 0.8s ease infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

/* Progress dots */
.progress-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 20px 4px;
  flex-shrink: 0;
}
.progress-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--surface-3);
  transition: background 0.2s, transform 0.2s;
}
.progress-dot.answered-correct { background: var(--correct); }
.progress-dot.answered-wrong   { background: var(--wrong); }
.progress-dot.current {
  background: var(--accent);
  transform: scale(1.4);
}

/* Question area */
.question-area {
  flex: 1;
  padding: 20px 20px 12px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}
.question-num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.question-difficulty {
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 600;
}
.question-text {
  font-size: clamp(16px, 4.5vw, 20px);
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
  letter-spacing: -0.01em;
}

/* Answer options */
.options-area {
  padding: 0 16px 12px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.answer-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  user-select: none;
}
.answer-option:hover:not(.disabled) {
  border-color: var(--border-hover);
  background: var(--surface-2);
}
.answer-option:active:not(.disabled) { transform: scale(0.985); }
.answer-option.disabled { cursor: default; }

.answer-option.correct {
  border-color: var(--correct);
  background: var(--correct-dim);
  animation: correctPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.answer-option.wrong {
  border-color: var(--wrong);
  background: var(--wrong-dim);
  animation: wrongShake 0.4s ease;
}
.answer-option.reveal-correct {
  border-color: var(--correct);
  background: var(--correct-dim);
  opacity: 0.55;
}

@keyframes correctPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.025); }
  100% { transform: scale(1); }
}
@keyframes wrongShake {
  0%,100% { transform: translateX(0); }
  20%     { transform: translateX(-6px); }
  60%     { transform: translateX(6px); }
  80%     { transform: translateX(-3px); }
}

.option-letter {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.answer-option.correct .option-letter {
  background: var(--correct);
  color: #fff;
  border-color: var(--correct);
}
.answer-option.wrong .option-letter {
  background: var(--wrong);
  color: #fff;
  border-color: var(--wrong);
}
.answer-option.reveal-correct .option-letter {
  background: rgba(16, 185, 129, 0.25);
  color: var(--correct);
  border-color: var(--correct);
}

.option-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
}

/* Explanation card */
.explanation-card {
  margin: 0 16px 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  flex-shrink: 0;
  animation: fadeSlideUp 0.3s ease forwards;
}
.explanation-card.hidden { display: none; }
.explanation-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.explanation-text {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.explanation-locked {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}
.explanation-locked .lock-icon { font-size: 16px; }
.explanation-locked .unlock-link {
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
}

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

/* Next button */
.next-container {
  padding: 4px 16px 32px;
  flex-shrink: 0;
}
.next-container.hidden { display: none; }
.btn-next {
  width: 100%;
  padding: 16px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  animation: fadeSlideUp 0.25s ease forwards;
}
.btn-next:hover  { background: #2563eb; box-shadow: 0 6px 24px rgba(59, 130, 246, 0.4); }
.btn-next:active { transform: scale(0.98); }
.btn-next .arrow { font-size: 18px; }

/* ── Segmented progress bar (Duolingo-style) ──────────────────────────────── */
.seg-progress-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
}
.seg-progress-track {
  flex: 1;
  height: 10px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
}
.seg-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, #60a5fa 100%);
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 8px rgba(59,130,246,0.5);
}
.seg-counter {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ── Quiz meta row (hearts + mode + combo) ───────────────────────────────── */
.quiz-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 16px 2px;
  flex-shrink: 0;
}

/* ── Question meta row ───────────────────────────────────────────────────── */
.question-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.question-num-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* ── Option check mark ───────────────────────────────────────────────────── */
.option-check {
  margin-left: auto;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}
.answer-option.correct .option-check { color: var(--correct); }
.answer-option.wrong   .option-check { color: var(--wrong); }
.answer-option.reveal-correct .option-check { color: var(--correct); }

/* ── Duolingo Feedback Panel ─────────────────────────────────────────────── */
.feedback-panel {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 16px 20px 32px;
  border-radius: 20px 20px 0 0;
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.34, 1.2, 0.64, 1), opacity 0.25s ease;
  flex-shrink: 0;
}
.feedback-panel.panel-visible {
  transform: translateY(0);
  opacity: 1;
}
.correct-panel {
  background: #052e20;
  border-top: 2px solid var(--correct);
}
.wrong-panel {
  background: #2a0a14;
  border-top: 2px solid var(--wrong);
}
.feedback-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}
.feedback-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}
.correct-panel .feedback-icon {
  background: var(--correct);
  color: #fff;
}
.wrong-panel .feedback-icon {
  background: var(--wrong);
  color: #fff;
}
.feedback-text { flex: 1; }
.feedback-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}
.correct-panel .feedback-title { color: var(--correct); }
.wrong-panel   .feedback-title { color: var(--wrong); }
.feedback-sub {
  font-size: 13px;
  color: var(--text-secondary);
}
.feedback-explanation {
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255,255,255,0.65);
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
  border-left: 3px solid rgba(255,255,255,0.15);
}
.lock-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}
.lock-inline .unlock-link {
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.btn-feedback-next {
  width: 100%;
  padding: 15px;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  border: none;
}
.btn-feedback-next:active { transform: scale(0.98); }
.correct-panel .btn-feedback-next {
  background: var(--correct);
  color: #fff;
  box-shadow: 0 4px 20px rgba(16,185,129,0.35);
}
.correct-panel .btn-feedback-next:hover { background: #059669; }
.wrong-panel .btn-feedback-next {
  background: var(--wrong);
  color: #fff;
  box-shadow: 0 4px 20px rgba(244,63,94,0.35);
}
.wrong-panel .btn-feedback-next:hover { background: #e11d48; }

/* ── Badge tag ───────────────────────────────────────────────────────────── */
.badge-tag {
  background: rgba(139,92,246,0.12);
  color: #a78bfa;
  border: 1px solid rgba(139,92,246,0.2);
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 5px;
  font-weight: 500;
  text-transform: lowercase;
}

/* Timeout overlay */
.timeout-flash {
  position: absolute;
  inset: 0;
  background: rgba(244, 63, 94, 0.06);
  pointer-events: none;
  animation: timeoutFlash 0.4s ease forwards;
}
@keyframes timeoutFlash {
  0%   { opacity: 1; }
  100% { opacity: 0; }
}


/* ═══════════════════════════════════════════════════════════════════════════════
   RESULTS SCREEN
════════════════════════════════════════════════════════════════════════════════ */
.results-screen {
  padding-bottom: 40px;
  background: var(--bg);
}

.results-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 56px 20px 0;
}
.results-pack-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  flex: 1;
  text-align: center;
}

/* Score section */
.score-section {
  padding: 32px 20px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.score-ring-wrap {
  position: relative;
  width: 160px;
  height: 160px;
}
.score-ring {
  transform: rotate(-90deg);
  width: 160px;
  height: 160px;
}
.ring-track {
  fill: none;
  stroke: var(--surface-2);
  stroke-width: 10;
}
.ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 326.7; /* 2π × 52 */
  stroke-dashoffset: 326.7;
  transition: stroke 0.5s ease;
}
.ring-fill.excellent { stroke: var(--correct); }
.ring-fill.good      { stroke: var(--accent); }
.ring-fill.average   { stroke: var(--warning); }
.ring-fill.poor      { stroke: var(--wrong); }

.score-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.score-pct {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1;
}
.score-grade {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Result stats row */
.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
}
.result-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 12px;
  text-align: center;
}
.result-stat-val {
  display: block;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text);
}
.result-stat-val.v-correct { color: var(--correct); }
.result-stat-val.v-wrong   { color: var(--wrong); }
.result-stat-lbl {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Review list */
.review-list {
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.review-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s;
}
.review-item.correct { border-left: 3px solid var(--correct); }
.review-item.wrong   { border-left: 3px solid var(--wrong); }

.review-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}
.review-item.correct .review-icon { background: var(--correct-dim); color: var(--correct); }
.review-item.wrong   .review-icon { background: var(--wrong-dim); color: var(--wrong); }

.review-content { flex: 1; min-width: 0; }
.review-question-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.review-answer {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}
.review-answer.correct { color: var(--correct); }
.review-answer.wrong   { color: var(--wrong); }

/* Results actions */
.results-actions {
  display: flex;
  gap: 10px;
  padding: 24px 16px 0;
}
.results-actions .btn-secondary { flex: 1; }
.results-actions .btn-primary   { flex: 2; }


/* ═══════════════════════════════════════════════════════════════════════════════
   BRAND SECTIONS (Home screen)
════════════════════════════════════════════════════════════════════════════════ */

.brands-list {
  padding: 0 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.brand-section {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
}

.brand-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s;
}
.brand-header:hover  { background: var(--surface-2); }
.brand-header:active { background: var(--surface-3); }

.brand-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.brand-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.brand-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface-3);
  padding: 2px 7px;
  border-radius: 20px;
}

.brand-chevron {
  color: var(--text-muted);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
}
.brand-chevron.open { transform: rotate(180deg); }

/* Collapsible pack list */
.brand-packs {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
}
.brand-packs.expanded {
  max-height: 600px;
}
.brand-packs .pack-card {
  border-radius: 0;
  border: none;
  border-top: 1px solid var(--border);
  background: var(--bg);
  margin: 0;
}
.brand-packs .pack-card:last-child { border-bottom: none; }


/* ═══════════════════════════════════════════════════════════════════════════════
   STREAK BADGE
════════════════════════════════════════════════════════════════════════════════ */
.streak-badge {
  font-size: 13px;
  font-weight: 700;
  color: var(--warning);
  background: var(--warning-dim);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 20px;
  padding: 4px 10px;
  letter-spacing: -0.01em;
}


/* ═══════════════════════════════════════════════════════════════════════════════
   MODE PICKER MODAL
════════════════════════════════════════════════════════════════════════════════ */

#mode-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  transition: background 0.3s, backdrop-filter 0.3s;
}
.modal-backdrop.visible {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.modal-sheet {
  position: relative;
  width: 100%;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 0 0 40px;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  z-index: 1;
}
.modal-sheet.visible { transform: translateY(0); }

.modal-handle {
  width: 36px;
  height: 4px;
  background: var(--surface-3);
  border-radius: 2px;
  margin: 12px auto 0;
}

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-pack-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.modal-pack-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  letter-spacing: 0.06em;
}

.modal-body {
  padding: 16px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mode-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 18px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.mode-card:hover  { border-color: var(--border-hover); background: var(--surface-3); }
.mode-card:active { transform: scale(0.98); }

.mode-icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-3);
  border-radius: 12px;
}

.mode-info { flex: 1; }
.mode-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.mode-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.mode-chevron {
  font-size: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
}

#mode-quick:hover .mode-chevron { color: var(--accent); }
#mode-full:hover  .mode-chevron { color: var(--accent); }
#mode-quick:hover { border-color: var(--border-accent); }
#mode-full:hover  { border-color: var(--border-accent); }


/* ═══════════════════════════════════════════════════════════════════════════════
   QUIZ MODE TAG
════════════════════════════════════════════════════════════════════════════════ */
.quiz-mode-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 2px;
}


/* ═══════════════════════════════════════════════════════════════════════════════
   NOTIFICATION BANNER
════════════════════════════════════════════════════════════════════════════════ */
.notif-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 16px 0;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  animation: fadeSlideUp 0.3s ease forwards;
}
.notif-banner span { flex: 1; line-height: 1.4; }
.notif-banner-btn {
  background: var(--accent);
  color: #fff;
  border-radius: 7px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.15s;
}
.notif-banner-btn:hover { background: #2563eb; }
.notif-banner-close {
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
  padding: 2px;
  transition: color 0.15s;
}
.notif-banner-close:hover { color: var(--text); }


/* ═══════════════════════════════════════════════════════════════════════════════
   GAMIFICATION — XP FLOAT, PARTICLES, COMBO, LEVEL BAR, CONFETTI, ACHIEVEMENTS
════════════════════════════════════════════════════════════════════════════════ */

/* Floating XP text */
.xp-float {
  position: absolute;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 800;
  color: var(--correct);
  text-shadow: 0 0 12px rgba(16,185,129,0.6);
  pointer-events: none;
  z-index: 100;
  animation: xpFloat 1s cubic-bezier(0.22,1,0.36,1) forwards;
  letter-spacing: -0.01em;
}
@keyframes xpFloat {
  0%   { opacity: 0; transform: translateY(0) scale(0.6); }
  20%  { opacity: 1; transform: translateY(-8px) scale(1.15); }
  70%  { opacity: 1; transform: translateY(-36px) scale(1); }
  100% { opacity: 0; transform: translateY(-60px) scale(0.9); }
}

/* Particles */
.particle {
  position: fixed;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 200;
  animation: particleBurst 0.65s ease-out forwards;
}
@keyframes particleBurst {
  0%   { opacity: 1; transform: translate(0,0) scale(1); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.2); }
}

/* Combo badge */
.combo-badge {
  position: absolute;
  top: 108px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #f97316, #ef4444);
  color: #fff;
  border-radius: 20px;
  padding: 5px 12px 5px 8px;
  font-weight: 800;
  font-size: 13px;
  box-shadow: 0 4px 14px rgba(239,68,68,0.4);
  z-index: 10;
  animation: comboAppear 0.3s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
.combo-badge.hidden { display: none; }
.combo-badge.pop    { animation: comboPop 0.3s cubic-bezier(0.34,1.56,0.64,1) forwards; }
.combo-fire  { font-size: 16px; }
.combo-num   { font-size: 18px; line-height: 1; }
.combo-label { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.1em; opacity: 0.85; }

@keyframes comboAppear {
  from { opacity:0; transform: scale(0.5) translateY(8px); }
  to   { opacity:1; transform: scale(1) translateY(0); }
}
@keyframes comboPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.25); }
  100% { transform: scale(1); }
}

/* Level bar */
.level-bar-section {
  padding: 0 16px 16px;
}
.level-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 7px;
}
.level-info {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.level-next {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}
.level-track {
  height: 6px;
  background: var(--surface-2);
  border-radius: 3px;
  overflow: hidden;
}
.level-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #8b5cf6);
  border-radius: 3px;
  transition: width 1.2s cubic-bezier(0.22,1,0.36,1);
}

/* Level-up overlay (transient — auto-fades, non-interactive) */
.levelup-transient {
  pointer-events: none;
  animation: levelOverlayFade 2.2s ease forwards;
}
@keyframes levelOverlayFade {
  0%   { opacity: 0; }
  15%  { opacity: 1; }
  70%  { opacity: 1; }
  100% { opacity: 0; }
}

/* Confetti */
.confetti-piece {
  position: fixed;
  top: -12px;
  z-index: 400;
  pointer-events: none;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* Achievements */
.achievements-banner {
  margin: 0 16px 8px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: var(--radius);
  animation: fadeSlideUp 0.4s ease forwards;
}

.achievement-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  opacity: 0;
}
.achievement-item:first-of-type { border-top: none; }

.achievement-item.achievement-pop {
  animation: achievementPop 0.5s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
@keyframes achievementPop {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}

.achievement-icon {
  font-size: 26px;
  width: 40px;
  height: 40px;
  background: var(--warning-dim);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.achievement-info { flex: 1; }
.achievement-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.achievement-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}


/* ═══════════════════════════════════════════════════════════════════════════════
   DUOLINGO FEATURES — HEARTS, DAILY GOAL, MASTERY, TOASTS
════════════════════════════════════════════════════════════════════════════════ */

/* ── Header hearts ─────────────────────────────────────────────────────────── */
.header-hearts {
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 4px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
}

/* Hearts row defined later in quiz section */

/* ── Daily goal card ───────────────────────────────────────────────────────── */
.daily-goal-card {
  margin: 12px 16px 0;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.3s;
}
.daily-goal-card.daily-done {
  border-color: rgba(16,185,129,0.35);
  background: rgba(16,185,129,0.05);
}
.daily-goal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.daily-goal-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.daily-goal-xp {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}
.daily-track {
  height: 7px;
  background: var(--surface-3);
  border-radius: 4px;
  overflow: hidden;
}
.daily-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.8s cubic-bezier(0.22,1,0.36,1);
}
.daily-fill-done {
  background: var(--correct);
}

/* ── Mastery bar on pack card ──────────────────────────────────────────────── */
.mastery-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.mastery-track {
  flex: 1;
  height: 4px;
  background: var(--surface-3);
  border-radius: 2px;
  overflow: hidden;
}
.mastery-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s ease;
  opacity: 0.75;
}
.mastery-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ── Motivational toast (mid-quiz) ────────────────────────────────────────── */
.motivational-toast {
  position: absolute;
  top: 48%;
  left: 50%;
  transform: translateX(-50%) translateY(-50%);
  pointer-events: none;
  z-index: 150;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
  padding: 8px 18px;
  border-radius: 24px;
  white-space: nowrap;
  animation: toastPop 1.5s cubic-bezier(0.22,1,0.36,1) forwards;
}
.toast-correct {
  background: var(--correct-dim);
  color: var(--correct);
  border: 1px solid rgba(16,185,129,0.3);
}
.toast-wrong {
  background: rgba(100,116,139,0.15);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
@keyframes toastPop {
  0%   { opacity: 0; transform: translateX(-50%) translateY(-30%) scale(0.8); }
  15%  { opacity: 1; transform: translateX(-50%) translateY(-50%) scale(1.05); }
  70%  { opacity: 1; transform: translateX(-50%) translateY(-50%) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-70%) scale(0.95); }
}

/* ── Daily goal complete toast ─────────────────────────────────────────────── */
.goal-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  background: var(--correct);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  box-shadow: 0 8px 28px rgba(16,185,129,0.45);
  animation: goalToastAnim 3.5s ease forwards;
}
@keyframes goalToastAnim {
  0%   { opacity:0; transform: translateX(-50%) translateY(20px); }
  10%  { opacity:1; transform: translateX(-50%) translateY(0); }
  80%  { opacity:1; }
  100% { opacity:0; transform: translateX(-50%) translateY(-10px); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   DUOLINGO-STYLE IMPROVEMENTS v2.0
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Question entrance slide animation ──────────────────────────────────── */
.question-enter {
  animation: questionSlideIn 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes questionSlideIn {
  from { opacity: 0; transform: translateX(28px) scale(0.98); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

/* ── Staggered option entrance ───────────────────────────────────────────── */
.answer-option.option-enter {
  animation: optionFadeIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes optionFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Milestone overlay (mid-quiz celebration) ────────────────────────────── */
.milestone-overlay {
  position: fixed;
  inset: 0;
  z-index: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  animation: milestoneIn 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.milestone-card {
  background: linear-gradient(135deg, var(--surface-2) 0%, var(--surface) 100%);
  border: 2px solid var(--accent);
  border-radius: 24px;
  padding: 28px 36px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(59, 130, 246, 0.35);
  pointer-events: all;
  animation: milestoneCardPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.milestone-emoji {
  font-size: 52px;
  line-height: 1;
  margin-bottom: 10px;
  animation: milestoneEmojiSpin 0.6s ease;
}
.milestone-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.milestone-sub {
  font-size: 14px;
  color: var(--text-secondary);
}
@keyframes milestoneIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes milestoneCardPop {
  0%   { transform: scale(0.7) rotate(-3deg); opacity: 0; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
@keyframes milestoneEmojiSpin {
  0%   { transform: scale(0) rotate(-180deg); }
  100% { transform: scale(1) rotate(0deg); }
}

/* ── Daily XP goal bar (home screen) ─────────────────────────────────────── */
.daily-goal-section {
  margin: 0 0 12px;
  padding: 14px 16px;
  background: var(--surface-2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.daily-goal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.daily-goal-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.daily-goal-xp {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent);
}
.daily-goal-track {
  height: 8px;
  background: var(--surface);
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.daily-goal-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent) 0%, #60a5fa 100%);
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 8px rgba(59,130,246,0.5);
}
.daily-goal-fill.goal-done {
  background: linear-gradient(90deg, var(--correct) 0%, #34d399 100%);
  box-shadow: 0 0 8px rgba(16,185,129,0.5);
}

/* ── Pack mastery bar (home screen) ─────────────────────────────────────── */
.pack-mastery-bar {
  height: 3px;
  background: var(--surface);
  border-radius: 99px;
  margin-top: 6px;
  overflow: hidden;
}
.pack-mastery-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent) 0%, #60a5fa 100%);
  transition: width 0.6s ease;
}
.pack-mastery-pct {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 3px;
  font-weight: 600;
}

/* ── Answer correct pulse ────────────────────────────────────────────────── */
@keyframes correctPulse {
  0%   { transform: scale(1); box-shadow: none; }
  30%  { transform: scale(1.025); box-shadow: 0 0 20px rgba(16,185,129,0.4); }
  100% { transform: scale(1); box-shadow: none; }
}
.answer-option.correct {
  animation: correctPulse 0.45s ease both;
}

/* ── Wrong answer wobble ─────────────────────────────────────────────────── */
@keyframes wrongWobble {
  0%  { transform: translateX(0); }
  15% { transform: translateX(-6px); }
  30% { transform: translateX(6px); }
  45% { transform: translateX(-4px); }
  60% { transform: translateX(4px); }
  80% { transform: translateX(-2px); }
  100%{ transform: translateX(0); }
}
.answer-option.wrong {
  animation: wrongWobble 0.4s ease both;
}

/* ── Streak fire animation ───────────────────────────────────────────────── */
.streak-badge-pulse {
  animation: streakFirePop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes streakFirePop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.25) rotate(5deg); }
  100% { transform: scale(1) rotate(0); }
}

/* ── XP burst after correct (upgraded) ──────────────────────────────────── */
.xp-float {
  position: absolute;
  pointer-events: none;
  font-size: 15px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  color: #34d399;
  text-shadow: 0 0 12px rgba(52,211,153,0.7);
  animation: xpFloatUp 1.1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  white-space: nowrap;
  z-index: 100;
}
@keyframes xpFloatUp {
  0%   { opacity: 0; transform: translateY(0) scale(0.7); }
  15%  { opacity: 1; transform: translateY(-10px) scale(1.1); }
  85%  { opacity: 1; transform: translateY(-50px) scale(1); }
  100% { opacity: 0; transform: translateY(-65px) scale(0.9); }
}

/* ── Progress milestone toast (mid-quiz feedback) ──────────────────────── */
.progress-toast {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 600;
  background: var(--surface-2);
  border: 1px solid var(--accent);
  border-radius: 24px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(59,130,246,0.25);
  animation: progressToastAnim 2.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  pointer-events: none;
}
@keyframes progressToastAnim {
  0%   { opacity:0; transform: translateX(-50%) translateY(-14px) scale(0.9); }
  12%  { opacity:1; transform: translateX(-50%) translateY(0) scale(1); }
  75%  { opacity:1; }
  100% { opacity:0; transform: translateX(-50%) translateY(-8px); }
}

/* ── Lesson complete overlay (after full exam) ───────────────────────────── */
.lesson-complete-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  animation: lessonCompleteIn 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.lesson-complete-emoji {
  font-size: 72px;
  animation: lessonEmojiPop 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}
.lesson-complete-title {
  font-size: 28px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.03em;
  animation: lessonTextIn 0.4s ease 0.4s both;
}
.lesson-complete-sub {
  font-size: 15px;
  color: var(--text-secondary);
  animation: lessonTextIn 0.4s ease 0.5s both;
}
.lesson-complete-xp {
  background: linear-gradient(135deg, rgba(59,130,246,0.15) 0%, rgba(96,165,250,0.1) 100%);
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: var(--radius);
  padding: 14px 28px;
  text-align: center;
  animation: lessonTextIn 0.4s ease 0.6s both;
}
.lesson-complete-xp-num {
  font-size: 32px;
  font-weight: 900;
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
}
.lesson-complete-xp-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
@keyframes lessonCompleteIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes lessonEmojiPop {
  0%   { transform: scale(0); }
  100% { transform: scale(1); }
}
@keyframes lessonTextIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Stars row (results page) ─────────────────────────────────────────────── */
.stars-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  font-size: 28px;
  margin: 8px 0 4px;
}
.star-item {
  animation: starPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.star-item:nth-child(2) { animation-delay: 0.12s; }
.star-item:nth-child(3) { animation-delay: 0.24s; }
@keyframes starPop {
  0%   { transform: scale(0) rotate(-40deg); opacity: 0; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

/* ── Improved score grade messages ──────────────────────────────────────── */
.grade-message {
  font-size: 13px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 99px;
  margin-top: 6px;
  display: inline-block;
}
.grade-message.excellent { background: rgba(16,185,129,0.15); color: var(--correct); }
.grade-message.good      { background: rgba(59,130,246,0.12); color: var(--accent); }
.grade-message.average   { background: rgba(245,158,11,0.12); color: var(--warning); }
.grade-message.poor      { background: rgba(244,63,94,0.12);  color: var(--wrong); }

/* ── Keyboard focus ring for answer options ─────────────────────────────── */
.answer-option:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.answer-option:focus:not(:focus-visible) {
  outline: none;
}
.answer-option:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  background: rgba(59,130,246,0.07);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   DUOLINGO-STYLE ENHANCEMENTS
════════════════════════════════════════════════════════════════════════════════ */

/* ── Hearts regen timer (home header) ────────────────────────────────────── */
.heart-regen-timer {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--wrong);
  background: var(--wrong-dim);
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 2px;
  animation: pulse 2s ease infinite;
}

/* ── Streak-at-risk warning card ─────────────────────────────────────────── */
.streak-warning-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 16px 0;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(245,158,11,0.12), rgba(244,63,94,0.08));
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: var(--radius);
  animation: streakPulse 3s ease infinite;
}
.streak-warning-icon {
  font-size: 28px;
  animation: streakFlame 1.5s ease infinite;
}
.streak-warning-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--warning);
}
.streak-warning-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}
@keyframes streakPulse {
  0%, 100% { border-color: rgba(245,158,11,0.25); }
  50%      { border-color: rgba(245,158,11,0.5); }
}
@keyframes streakFlame {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.15) rotate(-5deg); }
}

/* ── Study mode card in mode picker ───────────────────────────────────���──── */
.mode-card-study {
  border-color: rgba(139, 92, 246, 0.25) !important;
  background: rgba(139, 92, 246, 0.06) !important;
}
.mode-card-study:hover {
  border-color: rgba(139, 92, 246, 0.45) !important;
  background: rgba(139, 92, 246, 0.12) !important;
}

/* ── Feedback XP breakdown line ──────────────────────────────────────────── */
.feedback-xp-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.feedback-xp-val {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--correct);
  background: rgba(16, 185, 129, 0.15);
  padding: 2px 8px;
  border-radius: 6px;
}
.feedback-xp-mult {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
  padding: 2px 7px;
  border-radius: 5px;
}

/* ── Brand section improvements ──────────────────────────────────────────── */
.brand-section {
  margin: 0 16px;
}
.brand-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  background: none;
  cursor: pointer;
  transition: opacity 0.15s;
}
.brand-header:active { opacity: 0.7; }
.brand-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.brand-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.brand-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}
.brand-chevron {
  transition: transform 0.25s ease;
  color: var(--text-muted);
}
.brand-chevron.open {
  transform: rotate(180deg);
}

/* ── Brand packs collapse ────────────────────────────────────────────────── */
.brand-packs {
  display: none;
  flex-direction: column;
  gap: 10px;
  padding: 8px 0 16px;
}
.brand-packs.expanded {
  display: flex;
}

/* ── Mastery bar in pack card ────────────────────────────────────────────── */
.mastery-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pack-mastery-bar {
  flex: 1;
  height: 4px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
}
.pack-mastery-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--correct), #34d399);
  border-radius: 999px;
  transition: width 0.5s ease;
}
.pack-mastery-pct {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--correct);
  white-space: nowrap;
}

/* ── Daily goal card ─────────────────────────────────────────────────────── */
.daily-goal-card {
  margin: 16px 16px 0;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.3s, background 0.3s;
}
.daily-goal-card.daily-done {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.06);
}
.daily-goal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.daily-goal-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.daily-goal-xp {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
}
.daily-track {
  height: 8px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
}
.daily-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.daily-fill-done {
  background: linear-gradient(90deg, var(--correct), #34d399);
}

/* ── Header hearts row ───────────────────────────────────────────────────── */
.header-hearts {
  display: flex;
  align-items: center;
  gap: 1px;
}

/* ── Streak badge ────────────────────────────────────────────────────────── */
.streak-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

/* ── Notification banner ─────────────────────────────────────────────────── */
.notif-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 24px 16px 0;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-secondary);
}
.notif-banner-btn {
  background: var(--accent);
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.notif-banner-close {
  color: var(--text-muted);
  font-size: 14px;
  padding: 4px;
  cursor: pointer;
}

/* ── Mode picker modal ───────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  z-index: 100;
  transition: background 0.3s ease;
}
.modal-backdrop.visible {
  background: rgba(0, 0, 0, 0.6);
}
.modal-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 101;
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  padding: 12px 20px 36px;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.34, 1.2, 0.64, 1);
}
.modal-sheet.visible {
  transform: translateY(0);
}
.modal-handle {
  width: 36px;
  height: 4px;
  background: var(--surface-3);
  border-radius: 999px;
  margin: 0 auto 16px;
}
.modal-header {
  text-align: center;
  margin-bottom: 20px;
}
.modal-pack-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.modal-pack-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}
.modal-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mode-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  text-align: left;
  width: 100%;
}
.mode-card:hover {
  border-color: var(--border-hover);
  background: var(--surface-3);
}
.mode-card:active { transform: scale(0.985); }
.mode-icon {
  font-size: 24px;
  flex-shrink: 0;
}
.mode-info { flex: 1; }
.mode-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.mode-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.mode-chevron {
  font-size: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ── Quiz mode tag ───────────────────────────────────────────────────────── */
.quiz-mode-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* ── Hearts row in quiz ──────────────────────────────────────────────────── */
.hearts-row {
  display: flex;
  align-items: center;
  gap: 2px;
}
.heart {
  font-size: 14px;
  transition: transform 0.2s, opacity 0.2s;
}
.heart-empty {
  opacity: 0.3;
}
.heart-shake {
  animation: heartShake 0.4s ease;
}
@keyframes heartShake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-3px); }
  75%      { transform: translateX(3px); }
}

/* ── Combo badge ─────────────────────────────────────────────────────────── */
.combo-badge {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
  padding: 3px 10px;
  border-radius: 8px;
  border: 1px solid rgba(245, 158, 11, 0.25);
  z-index: 100;
  transition: transform 0.2s, opacity 0.15s;
}
.combo-badge.hidden {
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
}
.combo-badge.pop {
  animation: comboPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes comboPop {
  0%   { transform: scale(0.7); }
  50%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* ── XP float animation ──────────────────────────────────────────────────── */
.xp-float {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--correct);
  pointer-events: none;
  animation: xpFly 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  z-index: 60;
  text-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}
@keyframes xpFly {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-60px) scale(1.2); }
}

/* ── Particle effect ─────────────────────────────────────────────────────── */
.particle {
  position: fixed;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 200;
  animation: particleBurst 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes particleBurst {
  0%   { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.3); }
}

/* ── Level up overlay ────────────────────────────────────────────────────── */
.levelup-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  background: rgba(0, 0, 0, 0.7);
  animation: fadeIn 0.25s ease forwards;
}
.levelup-card {
  text-align: center;
  padding: 32px 40px;
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: var(--radius-lg);
  animation: levelUpBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.levelup-icon { font-size: 48px; margin-bottom: 12px; }
.levelup-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}
.levelup-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}
@keyframes levelUpBounce {
  0%   { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1);   opacity: 1; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── No hearts overlay ───────────────────────────────────────────────────── */
.no-hearts-overlay {
  pointer-events: auto;
  animation: fadeIn 0.25s ease forwards;
}
.no-hearts-overlay .levelup-card {
  min-width: 260px;
  max-width: 320px;
}
.btn-refill-hearts {
  width: 100%;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--wrong);
  color: #fff;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.btn-refill-hearts:hover { background: #e11d48; }
.btn-refill-hearts:active { transform: scale(0.97); }
.btn-quit-hearts {
  width: 100%;
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.btn-quit-hearts:hover {
  color: var(--text);
  border-color: var(--border-hover);
}

/* ── Milestone overlay ───────────────────────────────────────────────────── */
.milestone-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 250;
  pointer-events: none;
  animation: fadeIn 0.2s ease forwards;
}
.milestone-card {
  text-align: center;
  padding: 24px 36px;
  background: var(--surface);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  animation: milestonePop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.milestone-emoji { font-size: 36px; margin-bottom: 8px; }
.milestone-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}
.milestone-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}
@keyframes milestonePop {
  0%   { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1);   opacity: 1; }
}

/* ── Lesson complete overlay ─────────────────────────────────────────────── */
.lesson-complete-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 300;
  background: var(--bg);
  animation: fadeIn 0.3s ease forwards;
}
.lesson-complete-emoji {
  font-size: 64px;
  animation: lessonBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.lesson-complete-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  margin-top: 16px;
  letter-spacing: -0.02em;
}
.lesson-complete-sub {
  font-size: 15px;
  color: var(--text-secondary);
  margin-top: 6px;
}
.lesson-complete-xp {
  margin-top: 24px;
  text-align: center;
}
.lesson-complete-xp-num {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 800;
  color: var(--correct);
  text-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
}
.lesson-complete-xp-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
@keyframes lessonBounce {
  0%   { transform: scale(0) rotate(-20deg); }
  60%  { transform: scale(1.15) rotate(5deg); }
  100% { transform: scale(1) rotate(0); }
}

/* ── Confetti ────────────────────────────────────────────────────────────── */
.confetti-piece {
  position: fixed;
  top: -10px;
  z-index: 400;
  pointer-events: none;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  0%   { transform: translateY(0) rotate(0) scale(1); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg) scale(0.5); opacity: 0; }
}

/* ── Goal complete toast ─────────────────────────────────────────────────── */
.goal-toast {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 24px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.25));
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  color: var(--correct);
  z-index: 500;
  animation: toastSlide 0.3s ease, toastFade 0.5s ease 2.8s forwards;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
@keyframes toastSlide {
  from { transform: translateX(-50%) translateY(-20px); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0); opacity: 1; }
}
@keyframes toastFade {
  to { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

/* ── Achievements banner (results) ───────────────────────────────────────── */
.achievements-banner {
  margin: 0 20px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.achievement-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.achievement-item:last-child { border-bottom: none; }
.achievement-icon { font-size: 28px; flex-shrink: 0; }
.achievement-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.achievement-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.achievement-pop {
  animation: achievePop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes achievePop {
  0%   { transform: translateX(-20px); opacity: 0; }
  100% { transform: translateX(0);     opacity: 1; }
}

/* ── Level bar (results) ─────────────────────────────────────────────────── */
.level-bar-section {
  margin: 20px 20px 0;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.level-bar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.level-info {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.level-next {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}
.level-track {
  height: 8px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
}
.level-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #8b5cf6);
  border-radius: 999px;
  transition: width 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Review list (results) ───────────────────────────────────────────────── */
.review-list {
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.review-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.review-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.review-item.correct .review-icon {
  background: var(--correct-dim);
  color: var(--correct);
}
.review-item.wrong .review-icon {
  background: var(--wrong-dim);
  color: var(--wrong);
}
.review-content { flex: 1; min-width: 0; }
.review-question-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.review-answer {
  font-family: var(--font-mono);
  font-size: 11px;
  margin-top: 4px;
  line-height: 1.4;
}
.review-answer.correct { color: var(--correct); }
.review-answer.wrong   { color: var(--wrong); }

/* ── Results actions ─────────────────────────────────────────────────────── */
.results-actions {
  display: flex;
  gap: 10px;
  padding: 24px 20px 40px;
}
.results-actions .btn-secondary,
.results-actions .btn-primary {
  flex: 1;
}

/* ── Option enter animation ──────────────────────────────────────────────── */
.option-enter {
  animation: optionSlideIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes optionSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Question enter animation ────────────────────────────────────────────── */
.question-enter {
  animation: questionFadeIn 0.3s ease both;
}
@keyframes questionFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
