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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ===== CSS Custom Properties ===== */
:root {
  /* Colors — Light theme */
  --primary: #6C5CE7;
  --primary-light: #A29BFE;
  --primary-dark: #5A4BD1;
  --accent: #00B894;
  --accent-light: #55EFC4;
  --warning: #FDCB6E;
  --error: #E17055;
  --error-light: #FAB1A0;

  --bg: #FAFAFA;
  --bg-card: #FFFFFF;
  --bg-elevated: #FFFFFF;
  --bg-terminal: #1E1E2E;
  --text: #2D3436;
  --text-secondary: #636E72;
  --text-muted: #B2BEC3;
  --text-terminal: #A6E3A1;
  --border: #E0E0E0;
  --border-light: #F0F0F0;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Typography */
  --font-sans: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-4xl: 2.5rem;

  /* Borders & Shadows */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 200ms ease;
  --transition-slow: 300ms ease;
}

/* ===== Layout ===== */
#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
}

/* ===== Header ===== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header__logo {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--primary);
}

.header__logo span {
  color: var(--text-secondary);
  font-weight: 400;
  font-size: var(--text-sm);
  margin-left: var(--space-xs);
}

.header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* ===== Language Toggle ===== */
.lang-toggle {
  display: flex;
  align-items: center;
  background: var(--border-light);
  border-radius: var(--radius-full);
  padding: 2px;
  cursor: pointer;
  border: none;
  font-size: var(--text-sm);
  font-weight: 500;
}

.lang-toggle__option {
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  color: var(--text-secondary);
}

.lang-toggle__option--active {
  background: var(--primary);
  color: white;
}

/* ===== Auth Button ===== */
.auth-btn {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--bg-card);
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.auth-btn:hover { border-color: var(--primary); color: var(--primary); }

.auth-btn__avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

/* ===== Navigation ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: flex;
  justify-content: space-around;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-light);
  padding: var(--space-sm) 0;
  padding-bottom: calc(var(--space-sm) + env(safe-area-inset-bottom));
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-xs) var(--space-md);
  color: var(--text-muted);
  font-size: var(--text-xs);
  cursor: pointer;
  transition: color var(--transition-fast);
  background: none;
  border: none;
  -webkit-tap-highlight-color: transparent;
}

.nav-item--active { color: var(--primary); }
.nav-item:hover { color: var(--primary-light); }

.nav-item__icon {
  width: 24px;
  height: 24px;
}

/* ===== Main Content Area ===== */
.main-content {
  padding: var(--space-md);
  padding-bottom: calc(80px + env(safe-area-inset-bottom));
}

/* ===== View Transitions ===== */
.view-enter {
  animation: fadeSlideIn var(--transition-slow) ease forwards;
}

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

/* ===== Landing / Home ===== */
.hero {
  text-align: center;
  padding: var(--space-3xl) var(--space-md) var(--space-2xl);
}

.hero__badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: white;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-lg);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hero__title {
  font-size: var(--text-3xl);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--space-md);
  color: var(--text);
}

.hero__title em {
  font-style: normal;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__subtitle {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  line-height: 1.5;
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  font-size: var(--text-lg);
  font-weight: 600;
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: all var(--transition-normal);
  box-shadow: 0 4px 16px rgba(108, 92, 231, 0.3);
}

.hero__cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(108, 92, 231, 0.4);
}

.hero__cta:active { transform: translateY(0); }

/* Feature cards */
.features {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: 0 var(--space-md) var(--space-2xl);
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
  box-shadow: var(--shadow-sm);
}

.feature-card__icon {
  font-size: var(--text-2xl);
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--border-light);
  border-radius: var(--radius-sm);
}

.feature-card__title {
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.feature-card__desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ===== Lesson List ===== */
.lesson-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.lesson-list__week {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: var(--space-md) 0 var(--space-sm);
}

.lesson-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.lesson-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-sm);
}

.lesson-card--completed { border-left: 3px solid var(--accent); }
.lesson-card--current { border-left: 3px solid var(--primary); }
.lesson-card--locked { opacity: 0.6; cursor: default; }

.lesson-card__number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--text-sm);
  flex-shrink: 0;
  background: var(--border-light);
  color: var(--text-secondary);
}

.lesson-card--completed .lesson-card__number {
  background: var(--accent);
  color: white;
}

.lesson-card--current .lesson-card__number {
  background: var(--primary);
  color: white;
}

.lesson-card__info { flex: 1; min-width: 0; }

.lesson-card__title {
  font-size: var(--text-base);
  font-weight: 500;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lesson-card__meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.lesson-card__badge {
  font-size: var(--text-xs);
  padding: 2px var(--space-sm);
  border-radius: var(--radius-full);
  font-weight: 500;
}

.lesson-card__badge--free {
  background: var(--accent-light);
  color: #00695C;
}

.lesson-card__badge--paid {
  background: var(--warning);
  color: #7B6B1A;
}

/* ===== Lesson View ===== */
.lesson-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-light);
}

.lesson-header__back {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: var(--space-sm);
  display: flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.lesson-header__back:hover {
  background: var(--border-light);
}

.lesson-header__title {
  font-size: var(--text-base);
  font-weight: 600;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Progress bar */
.progress-bar {
  height: 4px;
  background: var(--border-light);
  position: relative;
}

.progress-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
  transition: width var(--transition-slow);
}

/* Step counter */
.step-counter {
  text-align: center;
  font-size: var(--text-xs);
  color: var(--text-muted);
  padding: var(--space-sm) 0;
}

/* Lesson step content */
.lesson-step {
  padding: var(--space-lg) var(--space-md);
  animation: fadeSlideIn var(--transition-slow) ease;
}

.lesson-step__title {
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: var(--space-md);
  line-height: 1.3;
}

.lesson-step__body {
  font-size: var(--text-base);
  line-height: 1.8;
  color: var(--text-secondary);
}

.lesson-step__body p { margin-bottom: var(--space-md); }
.lesson-step__body strong { color: var(--text); font-weight: 600; }

/* ===== Code Blocks ===== */
.code-block {
  position: relative;
  margin: var(--space-md) 0;
  background: var(--bg-terminal);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.code-block__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  background: rgba(255,255,255,0.05);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.code-block__label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.code-block__copy {
  background: none;
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--text-muted);
  padding: 2px var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.code-block__copy:hover {
  border-color: var(--primary-light);
  color: var(--primary-light);
}

.code-block__copy--copied {
  border-color: var(--accent);
  color: var(--accent);
}

.code-block pre {
  padding: var(--space-md);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.6;
  color: #CDD6F4;
}

/* ===== Terminal Simulator ===== */
.terminal {
  background: var(--bg-terminal);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: var(--space-md) 0;
  box-shadow: var(--shadow-md);
}

.terminal__titlebar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: rgba(255,255,255,0.05);
}

.terminal__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.terminal__dot--red { background: #FF5F57; }
.terminal__dot--yellow { background: #FFBD2E; }
.terminal__dot--green { background: #28C840; }

.terminal__title {
  flex: 1;
  text-align: center;
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.terminal__body {
  padding: var(--space-md);
  min-height: 200px;
  max-height: 400px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.terminal__output {
  color: var(--text-terminal);
  white-space: pre-wrap;
  word-break: break-all;
}

.terminal__output-line { margin-bottom: 2px; }

.terminal__output-line--command { color: #89B4FA; }
.terminal__output-line--response { color: var(--text-terminal); }
.terminal__output-line--error { color: var(--error-light); }
.terminal__output-line--success { color: var(--accent-light); }
.terminal__output-line--hint { color: var(--warning); font-style: italic; }

.terminal__input-line {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.terminal__prompt {
  color: #89B4FA;
  font-weight: 500;
  flex-shrink: 0;
}

.terminal__input {
  flex: 1;
  background: none;
  border: none;
  color: #CDD6F4;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  outline: none;
  caret-color: var(--accent);
}

.terminal__cursor {
  display: inline-block;
  width: 8px;
  height: 16px;
  background: var(--accent);
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ===== Quiz ===== */
.quiz {
  padding: var(--space-md) 0;
}

.quiz__question {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-lg);
  line-height: 1.4;
}

.quiz__options {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.quiz__option {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: var(--text-base);
  min-height: 48px;
  -webkit-tap-highlight-color: transparent;
  text-align: left;
  width: 100%;
}

.quiz__option:hover { border-color: var(--primary-light); }

.quiz__option--selected {
  border-color: var(--primary);
  background: rgba(108, 92, 231, 0.05);
}

.quiz__option--correct {
  border-color: var(--accent);
  background: rgba(0, 184, 148, 0.08);
  animation: correctPulse 0.5s ease;
}

.quiz__option--incorrect {
  border-color: var(--error);
  animation: shake 0.4s ease;
}

@keyframes correctPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

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

.quiz__option-letter {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--border-light);
  font-weight: 600;
  font-size: var(--text-sm);
  flex-shrink: 0;
}

.quiz__option--correct .quiz__option-letter {
  background: var(--accent);
  color: white;
}

.quiz__feedback {
  margin-top: var(--space-md);
  padding: var(--space-md);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  line-height: 1.5;
  animation: fadeSlideIn var(--transition-normal) ease;
}

.quiz__feedback--correct {
  background: rgba(0, 184, 148, 0.08);
  border: 1px solid var(--accent);
  color: #00695C;
}

.quiz__feedback--incorrect {
  background: rgba(225, 112, 85, 0.08);
  border: 1px solid var(--error);
  color: #C0392B;
}

/* ===== Dashboard ===== */
.dashboard {
  padding: var(--space-md);
}

.dashboard__greeting {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-lg);
}

.dashboard__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

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

.stat-card__value {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--primary);
}

.stat-card__label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

/* Lesson map */
.lesson-map {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.lesson-dot {
  aspect-ratio: 1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 600;
  background: var(--border-light);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.lesson-dot--complete {
  background: var(--accent);
  color: white;
}

.lesson-dot--current {
  background: var(--primary);
  color: white;
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2);
}

.lesson-dot--locked {
  opacity: 0.4;
  cursor: default;
}

/* Continue button */
.continue-btn {
  width: 100%;
  padding: var(--space-md);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.2);
}

.continue-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(108, 92, 231, 0.3);
}

/* ===== Streak ===== */
.streak {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: linear-gradient(135deg, #FF9A56, #FF6B6B);
  border-radius: var(--radius-md);
  color: white;
  margin-bottom: var(--space-lg);
}

.streak__icon { font-size: var(--text-2xl); }
.streak__count { font-size: var(--text-xl); font-weight: 700; }
.streak__label { font-size: var(--text-sm); opacity: 0.9; }

/* ===== Badges ===== */
.badges {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
}

.badge {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
}

.badge--earned {
  border-color: var(--warning);
  background: rgba(253, 203, 110, 0.1);
}

.badge--locked {
  opacity: 0.4;
  filter: grayscale(1);
}

/* ===== Paywall ===== */
.paywall {
  text-align: center;
  padding: var(--space-2xl) var(--space-md);
}

.paywall__icon {
  font-size: 48px;
  margin-bottom: var(--space-lg);
}

.paywall__title {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-md);
}

.paywall__desc {
  font-size: var(--text-base);
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  line-height: 1.6;
}

.paywall__preview {
  text-align: left;
  margin-bottom: var(--space-xl);
}

.paywall__preview-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.paywall__cta {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  font-size: var(--text-base);
  font-weight: 600;
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: all var(--transition-normal);
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.2);
}

.paywall__cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(108, 92, 231, 0.3);
}

/* ===== Confetti ===== */
#confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -10px;
  animation: confettiFall 3s ease-in forwards;
}

@keyframes confettiFall {
  0% {
    transform: translateY(0) rotateZ(0) rotateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotateZ(720deg) rotateY(360deg);
    opacity: 0;
  }
}

/* ===== Celebration Modal ===== */
.celebration {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  background: rgba(0,0,0,0.5);
  animation: fadeIn var(--transition-normal) ease;
}

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

.celebration__card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  text-align: center;
  max-width: 320px;
  margin: var(--space-md);
  animation: celebrationPop var(--transition-slow) ease;
}

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

.celebration__icon { font-size: 64px; margin-bottom: var(--space-md); }

.celebration__title {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.celebration__msg {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  line-height: 1.5;
}

.celebration__btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  padding: var(--space-sm) var(--space-xl);
  border-radius: var(--radius-full);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.celebration__btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.3);
}

/* ===== Loading / Skeleton ===== */
.skeleton {
  background: linear-gradient(90deg, var(--border-light) 25%, var(--bg) 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton-text { height: 16px; margin-bottom: var(--space-sm); }
.skeleton-title { height: 24px; width: 60%; margin-bottom: var(--space-md); }
.skeleton-card { height: 80px; margin-bottom: var(--space-sm); }

/* ===== Empty States ===== */
.empty-state {
  text-align: center;
  padding: var(--space-3xl) var(--space-md);
  color: var(--text-muted);
}

.empty-state__icon { font-size: 48px; margin-bottom: var(--space-md); }
.empty-state__text { font-size: var(--text-base); line-height: 1.5; }

/* ===== Error States ===== */
.error-msg {
  background: rgba(225, 112, 85, 0.08);
  border: 1px solid var(--error-light);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
  color: var(--error);
  font-size: var(--text-sm);
  text-align: center;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--text-base);
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
  min-height: 48px;
}

.btn--primary {
  background: var(--primary);
  color: white;
}

.btn--primary:hover { background: var(--primary-dark); }

.btn--secondary {
  background: var(--border-light);
  color: var(--text);
}

.btn--full { width: 100%; }

/* ===== Next Button (Lesson) ===== */
.next-btn {
  position: fixed;
  bottom: calc(16px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 448px;
  padding: var(--space-md);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: 600;
  cursor: pointer;
  z-index: 50;
  box-shadow: 0 4px 16px rgba(108, 92, 231, 0.3);
  transition: all var(--transition-normal);
}

.next-btn:hover {
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 6px 20px rgba(108, 92, 231, 0.4);
}

.next-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.next-btn:disabled:hover {
  transform: translateX(-50%);
}

/* ===== Focus Visible ===== */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

button:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
  outline: none;
}

/* ===== Responsive ===== */
@media (min-width: 768px) {
  #app { max-width: 520px; }

  .hero__title { font-size: var(--text-4xl); }

  .dashboard__stats { gap: var(--space-md); }
}
