/* ═══════════════════════════════════════════════════
   Coco's Academy — GED Preparation Platform
   Self-Paced · Made with ❤️ by Wolf Pak Strategies
   ═══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Coco's Academy palette */
  --wolf-blue: #0e8a9e;
  --wolf-blue-light: #14b8c6;
  --wolf-blue-dark: #0a7085;
  --wolf-cyan: #06b6d4;
  --wolf-gold: #c8a84e;
  --wolf-gold-light: #d4b85c;
  --wolf-green: #22c55e;
  --wolf-green-light: #4ade80;
  --wolf-red: #ef4444;
  --wolf-purple: #7c5cbf;
  --wolf-orange: #f97316;

  /* Light theme */
  --bg-primary: #f5f7fa;
  --bg-secondary: #edf0f5;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f4f8;
  --bg-card-active: #e8edf3;
  --bg-input: #f0f2f5;

  /* Text */
  --text-primary: #1a2332;
  --text-secondary: #5a6a7a;
  --text-muted: #8899aa;
  --text-accent: var(--wolf-blue-dark);

  /* Borders */
  --border-subtle: rgba(0, 0, 0, 0.06);
  --border-medium: rgba(0, 0, 0, 0.10);
  --border-active: var(--wolf-blue);

  /* Feedback */
  --correct: #16a34a;
  --correct-bg: rgba(22, 163, 74, 0.10);
  --wrong: #dc2626;
  --wrong-bg: rgba(220, 38, 38, 0.10);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.10);
  --shadow-glow: 0 0 16px rgba(14, 138, 158, 0.12);

  /* Layout */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 100px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;

  /* Subject colors */
  --math-color: #0e8a9e;
  --math-bg: rgba(14, 138, 158, 0.10);
  --rla-color: #7c5cbf;
  --rla-bg: rgba(124, 92, 191, 0.10);
  --science-color: #16a34a;
  --science-bg: rgba(22, 163, 74, 0.10);
  --social-color: #c8a84e;
  --social-bg: rgba(200, 168, 78, 0.10);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  line-height: 1.5;
}

/* Subtle ambient background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 15% 10%, rgba(14, 138, 158, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 85%, rgba(124, 92, 191, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(22, 163, 74, 0.02) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
}

/* ═══ LAYOUT ═══ */
.app {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
  padding: 16px;
  min-height: 100dvh;
}

/* ═══ SCREEN MANAGEMENT ═══ */
.screen { display: none; animation: fadeIn 0.35s ease; }
.screen.active { display: block; }

/* ═══ HEADER ═══ */
.header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 0 24px;
  position: relative;
}

.header-center {
  text-align: center;
}

.header-center h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a2332;
  line-height: 1.2;
}

.header-center .subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.header-right {
  position: absolute;
  right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.streak-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--wolf-gold-light);
}

/* ═══ HOME DASHBOARD ═══ */
.welcome-hero {
  text-align: center;
  padding: 20px 0 28px;
}

.welcome-hero h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.welcome-hero p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.emblem-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 12px 0 8px;
}

.emblem-side,
.emblem-center {
  width: 130px;
  height: 130px;
  object-fit: contain;
}

.emblem-center {
  border-radius: 50%;
}

.overall-progress.compact {
  max-width: 400px;
  margin: 0 auto 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  box-shadow: var(--shadow-sm);
}

.overall-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.overall-progress-header h3 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
  font-weight: 600;
}

.overall-pct {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--wolf-blue-light);
}

.overall-bar-wrap {
  height: 10px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.overall-bar {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--wolf-blue), var(--wolf-cyan));
  transition: width 1s ease;
  width: 0%;
}

/* Subject cards grid */
.subjects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 24px;
}

.subject-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.subject-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  transition: var(--transition);
}

.subject-card.math::before { background: var(--math-color); }
.subject-card.rla::before { background: var(--rla-color); }
.subject-card.science::before { background: var(--science-color); }
.subject-card.social::before { background: var(--social-color); }

.subject-card:hover {
  border-color: var(--border-medium);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.subject-card:active { transform: translateY(-1px); }

.subject-icon {
  font-size: 2rem;
  margin-bottom: 10px;
  display: block;
}

.subject-name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.subject-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
  line-height: 1.4;
}

/* Mini progress bar inside card */
.subject-progress-wrap {
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 6px;
}

.subject-progress-bar {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 1s ease;
  width: 0%;
}

.subject-card.math .subject-progress-bar { background: var(--math-color); }
.subject-card.rla .subject-progress-bar { background: var(--rla-color); }
.subject-card.science .subject-progress-bar { background: var(--science-color); }
.subject-card.social .subject-progress-bar { background: var(--social-color); }

.subject-progress-text {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Quick stats row */
.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.quick-stat {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
}

.quick-stat-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--wolf-blue-light);
}

.quick-stat-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ═══ SUBJECT SCREEN ═══ */
.subject-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 0 20px;
}

.back-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-medium);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.back-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--wolf-blue);
}

.subject-header-info {
  flex: 1;
}

.subject-header-info h2 {
  font-size: 1.3rem;
  font-weight: 700;
}

.subject-header-info p {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* Skill level tabs */
.level-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 4px;
  border: 1px solid var(--border-subtle);
}

.level-tab {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.level-tab:hover { color: var(--text-primary); }

.level-tab.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.level-tab .tab-icon {
  display: block;
  font-size: 1rem;
  margin-bottom: 2px;
}

/* Topic list */
.topic-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.topic-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 14px;
}

.topic-card:hover {
  border-color: var(--border-medium);
  background: var(--bg-card-hover);
}

.topic-status {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  transition: var(--transition);
}

.topic-status.completed {
  background: var(--correct);
  border-color: var(--correct);
  color: #fff;
}

.topic-status.in-progress {
  border-color: var(--wolf-blue);
  color: var(--wolf-blue);
}

.topic-info { flex: 1; }

.topic-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.topic-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.topic-score {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--wolf-gold);
}

.topic-arrow {
  color: var(--text-muted);
  font-size: 1rem;
  transition: var(--transition);
}

.topic-card:hover .topic-arrow { color: var(--text-primary); transform: translateX(3px); }

/* ═══ LESSON SCREEN ═══ */
.lesson-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 0 20px;
}

.lesson-header-info h2 {
  font-size: 1.2rem;
  font-weight: 700;
}

.lesson-header-info p {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.lesson-content {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.lesson-intro {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-primary);
  margin-bottom: 24px;
  white-space: pre-line;
}

.lesson-section-title {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 12px;
  margin-top: 20px;
}

.lesson-section-title:first-of-type { margin-top: 0; }

/* Example cards */
.example-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  border-left: 3px solid var(--wolf-blue);
}

.example-problem {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--wolf-blue-light);
  margin-bottom: 8px;
}

.example-explanation {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
  white-space: pre-line;
}

.example-answer {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  font-weight: 700;
  color: var(--wolf-green);
  font-size: 1rem;
}

/* Key points */
.key-points {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.key-points li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(14, 165, 233, 0.06);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  line-height: 1.5;
}

.key-points li::before {
  content: '💡';
  flex-shrink: 0;
  margin-top: 1px;
}

/* Start quiz button */
.lesson-start-quiz {
  display: block;
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--wolf-blue), var(--wolf-blue-dark));
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.3px;
}

.lesson-start-quiz:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(14, 165, 233, 0.35);
}

.lesson-start-quiz:active { transform: translateY(0); }

/* ═══ QUIZ SCREEN ═══ */
.quiz-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 0 12px;
}

.quiz-header-info h2 {
  font-size: 1rem;
  font-weight: 600;
}

.quiz-header-info p {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.quiz-progress-wrap {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 10px;
}

.quiz-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--wolf-blue), var(--wolf-cyan));
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
  width: 0%;
}

.quiz-stats-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.quiz-timer {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--wolf-gold);
}

.quiz-score { font-weight: 600; }
.quiz-score .q-correct { color: var(--correct); }
.quiz-score .q-wrong { color: var(--wrong); }

/* Question card */
.question-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.question-category-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 14px;
}

.question-category-tag.math { background: var(--math-bg); color: var(--math-color); }
.question-category-tag.rla { background: var(--rla-bg); color: var(--rla-color); }
.question-category-tag.science { background: var(--science-bg); color: var(--science-color); }
.question-category-tag.social { background: var(--social-bg); color: var(--social-color); }

.question-text {
  font-size: 1.08rem;
  font-weight: 500;
  line-height: 1.65;
  margin-bottom: 20px;
  white-space: pre-line;
}

/* Choices */
.quiz-choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.choice-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 400;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  line-height: 1.45;
  user-select: none;
  -webkit-user-select: none;
}

.choice-btn:hover {
  border-color: var(--wolf-blue);
  background: rgba(14, 165, 233, 0.06);
}

.choice-letter {
  min-width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  transition: var(--transition);
}

.choice-btn.correct {
  border-color: var(--correct) !important;
  background: var(--correct-bg) !important;
}
.choice-btn.correct .choice-letter {
  background: var(--correct) !important;
  color: #fff !important;
}

.choice-btn.wrong {
  border-color: var(--wrong) !important;
  background: var(--wrong-bg) !important;
}
.choice-btn.wrong .choice-letter {
  background: var(--wrong) !important;
  color: #fff !important;
}

.choice-btn.disabled {
  pointer-events: none;
  opacity: 0.5;
}
.choice-btn.correct.disabled,
.choice-btn.wrong.disabled { opacity: 1; }

/* Explanation box */
.quiz-explanation {
  display: none;
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(14, 165, 233, 0.06);
  border: 1px solid rgba(14, 165, 233, 0.15);
  margin: 16px 0;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-primary);
}
.quiz-explanation.show { display: block; animation: slideUp 0.3s ease; }
.quiz-explanation .explain-label {
  font-weight: 700;
  color: var(--wolf-blue-light);
  margin-bottom: 6px;
}

/* Next button */
.quiz-next-btn {
  display: none;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--wolf-blue), var(--wolf-blue-dark));
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 8px;
}
.quiz-next-btn.show { display: block; animation: slideUp 0.3s ease; }
.quiz-next-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.3);
}

/* ═══ RESULTS SCREEN ═══ */
.results-hero {
  text-align: center;
  padding: 32px 0 20px;
}

.results-emoji {
  font-size: 3rem;
  margin-bottom: 10px;
}

.results-title {
  font-size: 1.6rem;
  font-weight: 800;
}

.results-score-big {
  font-size: 3.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--wolf-blue-light), var(--wolf-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 8px 0;
}

.results-message {
  color: var(--text-secondary);
  font-size: 1rem;
}

.results-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 20px 0;
}

.results-stat {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
}

.results-stat-val {
  font-size: 1.4rem;
  font-weight: 700;
}

.results-stat-val.green { color: var(--correct); }
.results-stat-val.red { color: var(--wrong); }
.results-stat-val.gold { color: var(--wolf-gold); }

.results-stat-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Review section */
.results-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}

.results-card h3 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.review-item {
  padding: 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  border: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  line-height: 1.5;
  cursor: pointer;
  transition: var(--transition);
}
.review-item:hover { background: rgba(255, 255, 255, 0.03); }
.review-item.review-correct { border-left: 3px solid var(--correct); }
.review-item.review-wrong { border-left: 3px solid var(--wrong); }

.review-item .rq { font-weight: 600; margin-bottom: 4px; }
.review-item .ra { color: var(--text-secondary); }
.review-item .ra .right { color: var(--correct); font-weight: 600; }
.review-item .ra .user-wrong { color: var(--wrong); text-decoration: line-through; margin-right: 6px; }
.review-item .rexp {
  display: none;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.82rem;
}
.review-item.open .rexp { display: block; }

/* Result action buttons */
.result-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.result-btn {
  flex: 1;
  padding: 14px;
  border: 2px solid var(--wolf-blue);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--wolf-blue);
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.result-btn:hover { background: var(--wolf-blue); color: #fff; }

.result-btn.primary {
  background: linear-gradient(135deg, var(--wolf-blue), var(--wolf-blue-dark));
  border-color: transparent;
  color: #fff;
}
.result-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.3);
}

/* ═══ ANIMATIONS ═══ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

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

/* Celebration effects */
.streak-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  font-size: 2.2rem;
  font-weight: 800;
  pointer-events: none;
  z-index: 100;
  opacity: 0;
  text-align: center;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.streak-popup.show {
  animation: streakPop 1.2s ease forwards;
}

@keyframes streakPop {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  20% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
  50% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -60%) scale(0.8); opacity: 0; }
}

.star-burst {
  position: fixed;
  pointer-events: none;
  z-index: 99;
  font-size: 1.3rem;
  animation: starFly 0.8s ease forwards;
}

@keyframes starFly {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; }
}

/* ═══ EMPTY STATE ═══ */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 0.92rem;
  line-height: 1.5;
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 480px) {
  .app { padding: 12px; }
  .subjects-grid { grid-template-columns: 1fr; }
  .header-title h1 { font-size: 1.15rem; }
  .welcome-hero h2 { font-size: 1.2rem; }
  .question-text { font-size: 1rem; }
  .choice-btn { padding: 12px 14px; font-size: 0.9rem; }
  .results-score-big { font-size: 2.8rem; }
  .results-stats { grid-template-columns: repeat(3, 1fr); }
  .quick-stats { grid-template-columns: repeat(3, 1fr); }
  .level-tabs { flex-wrap: wrap; }
  .level-tab { font-size: 0.78rem; padding: 8px; }
}

@media (min-width: 768px) {
  .app { padding: 24px; }
  .header-title h1 { font-size: 1.5rem; }
  .question-text { font-size: 1.15rem; }
  .lesson-intro { font-size: 1.05rem; }
}

/* ═══ SCROLLBAR ═══ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.15); }

/* ═══ AUDIO PLAYER ═══ */
.lesson-audio-player {
  margin: 0 0 1.5rem 0;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #e8f8fa, #f0fdf8);
  border: 1px solid var(--wolf-blue-light);
  border-radius: var(--radius-lg);
  text-align: center;
}

.audio-play-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--wolf-blue), var(--wolf-blue-dark));
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 3px 12px rgba(14, 138, 158, 0.3);
}

.audio-play-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 18px rgba(14, 138, 158, 0.4);
}

.audio-play-btn:active {
  transform: translateY(0);
}

.audio-icon {
  font-size: 1.3rem;
}

.audio-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.audio-ctrl-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--wolf-blue);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.audio-ctrl-btn:hover {
  background: var(--wolf-blue-dark);
}

.audio-progress-wrap {
  flex: 1;
  height: 6px;
  background: rgba(14, 138, 158, 0.15);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.audio-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--wolf-blue), var(--wolf-blue-light));
  border-radius: var(--radius-full);
  transition: width 0.3s linear;
}

.audio-time {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--wolf-blue-dark);
  min-width: 3rem;
  text-align: right;
  flex-shrink: 0;
}

/* ═══ UTILITY ═══ */
.hidden { display: none !important; }
.text-center { text-align: center; }
