/* ============================================================
   PHONETIC FLIPBOOK — SHARED STYLESHEET
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --m1: #2563EB;      /* Module 1 — Vowels — Blue        */
  --m2: #059669;      /* Module 2 — Diphthongs — Green   */
  --m3: #D97706;      /* Module 3 — Word Stress — Amber  */
  --m4: #EA580C;      /* Module 4 — Sent. Stress — Orange*/
  --m5: #DC2626;      /* Module 5 — Intonation — Red     */
  --m6: #7C3AED;      /* Module 6 — Monitoring — Violet  */

  --white:     #ffffff;
  --gray-50:   #F9FAFB;
  --gray-100:  #F3F4F6;
  --gray-200:  #E5E7EB;
  --gray-300:  #D1D5DB;
  --gray-400:  #9CA3AF;
  --gray-500:  #6B7280;
  --gray-700:  #374151;
  --gray-900:  #111827;

  --font:      -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono:      'Courier New', Courier, monospace;

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow:    0 4px 12px rgba(0,0,0,.10);
  --shadow-lg: 0 12px 28px rgba(0,0,0,.12);
  --shadow-xl: 0 20px 40px rgba(0,0,0,.14);

  --header-h: 64px;
  --transition: 0.25s ease;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--white);
  color: var(--gray-900);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: var(--font); border: none; background: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ── Site Header ────────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  height: var(--header-h);
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  gap: 16px;
}
.site-header-left { display: flex; align-items: center; gap: 12px; }
.site-logo { height: 38px; width: auto; object-fit: contain; }
.site-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gray-900);
  display: none;
}
.site-nav { display: flex; align-items: center; gap: 6px; }
.site-nav a {
  font-size: 0.85rem;
  color: var(--gray-500);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}
.site-nav a:hover { color: var(--gray-900); background: var(--gray-100); }
.site-nav a.active { color: var(--gray-900); font-weight: 500; }
.btn-home {
  font-size: 0.85rem;
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  background: var(--gray-900);
  color: white;
  transition: opacity var(--transition);
}
.btn-home:hover { opacity: 0.85; }

/* ── Page wrapper ───────────────────────────────────────────── */
.page-body { padding-top: var(--header-h); min-height: 100vh; }

/* ── Hero Section ───────────────────────────────────────────── */
.hero {
  padding: 80px 32px 64px;
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--gray-700);
  padding: 4px 14px;
  margin-bottom: 24px;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--gray-900);
  margin-bottom: 16px;
}
.hero h1 span { color: var(--m1); }
.hero p {
  font-size: 1.1rem;
  color: var(--gray-500);
  max-width: 560px;
  margin: 0 auto 32px;
}
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--gray-900);
  color: white;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  transition: transform var(--transition), box-shadow var(--transition);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--white);
  color: var(--gray-700);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  transition: border-color var(--transition), background var(--transition);
}
.btn-secondary:hover { border-color: var(--gray-400); background: var(--gray-50); }

/* ── Section ────────────────────────────────────────────────── */
.section { padding: 56px 32px; }
.section-inner { max-width: 1100px; margin: 0 auto; }
.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-400);
  margin-bottom: 8px;
}
.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--gray-900);
  margin-bottom: 12px;
}
.section-desc {
  font-size: 1rem;
  color: var(--gray-500);
  max-width: 560px;
  margin-bottom: 40px;
}
.section-divider { background: var(--gray-100); }

/* ── How It Works ───────────────────────────────────────────── */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-top: 40px;
}
.step-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.step-num {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--gray-900);
  color: white;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.step-card h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 6px; }
.step-card p  { font-size: 0.875rem; color: var(--gray-500); }

/* ── Module Cards ───────────────────────────────────────────── */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 40px;
}
.module-card {
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--gray-200);
  overflow: hidden;
  background: var(--white);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  display: flex;
  flex-direction: column;
}
.module-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--module-color, var(--gray-300));
}
.module-card-stripe {
  height: 5px;
  background: var(--module-color, var(--gray-300));
}
.module-card-body { padding: 24px; flex: 1; }
.module-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.module-num {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--module-color, var(--gray-500));
  background: color-mix(in srgb, var(--module-color, #ccc) 12%, white);
  padding: 3px 10px;
  border-radius: 100px;
}
.module-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 6px;
}
.module-card p {
  font-size: 0.875rem;
  color: var(--gray-500);
  line-height: 1.5;
  margin-bottom: 16px;
}
.module-features { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.feature-chip {
  font-size: 0.75rem;
  color: var(--gray-600, var(--gray-500));
  background: var(--gray-100);
  border-radius: 100px;
  padding: 3px 10px;
}
.module-card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.module-progress-bar {
  flex: 1;
  height: 4px;
  background: var(--gray-200);
  border-radius: 100px;
  overflow: hidden;
  margin-right: 12px;
}
.module-progress-fill {
  height: 100%;
  background: var(--module-color, var(--gray-400));
  border-radius: 100px;
  transition: width 0.4s ease;
}
.module-progress-label { font-size: 0.75rem; color: var(--gray-400); white-space: nowrap; }
.btn-start {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--module-color, var(--gray-900));
  padding: 8px 18px;
  border: 1.5px solid var(--module-color, var(--gray-300));
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}
.btn-start:hover {
  background: var(--module-color, var(--gray-900));
  color: white;
}

/* ── Pre-test CTA ───────────────────────────────────────────── */
.pretest-cta {
  background: var(--gray-900);
  border-radius: var(--radius-xl);
  padding: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  margin-top: 40px;
}
.pretest-cta h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  margin-bottom: 8px;
}
.pretest-cta p { font-size: 0.95rem; color: var(--gray-400); }
.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: white;
  color: var(--gray-900);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  transition: opacity var(--transition);
}
.btn-cta:hover { opacity: 0.9; }

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
  padding: 32px;
  text-align: center;
}
.site-footer p { font-size: 0.8rem; color: var(--gray-400); }

/* ── MODULE PAGE LAYOUT ─────────────────────────────────────── */
.module-layout { display: flex; flex-direction: column; min-height: calc(100vh - var(--header-h)); }
.module-topbar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.module-topbar-left { display: flex; align-items: center; gap: 12px; }
.module-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: white;
  background: var(--module-color, var(--gray-700));
  padding: 4px 12px;
  border-radius: 100px;
}
.module-topbar h1 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gray-900);
}
.module-topbar-right { display: flex; align-items: center; gap: 12px; }
.page-indicator {
  font-size: 0.8rem;
  color: var(--gray-500);
  font-weight: 500;
}
.global-progress {
  width: 120px;
  height: 4px;
  background: var(--gray-200);
  border-radius: 100px;
  overflow: hidden;
}
.global-progress-fill {
  height: 100%;
  background: var(--module-color, var(--gray-400));
  border-radius: 100px;
  transition: width 0.4s ease;
}

/* ── Flipbook Container ─────────────────────────────────────── */
.flipbook-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  background: var(--gray-50);
  perspective: 2000px;
}
.flipbook-stage {
  width: 100%;
  max-width: 800px;
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  min-height: 480px;
  display: flex;
  flex-direction: column;
}

/* ── Flipbook Pages ─────────────────────────────────────────── */
.fp-page {
  display: none;
  flex: 1;
  flex-direction: column;
  padding: 40px 44px;
}
.fp-page.active {
  display: flex;
  animation: pageIn 0.35s ease both;
}
.fp-page.flip-out  { animation: pageOut 0.28s ease both; }
.fp-page.flip-in   { animation: pageIn  0.35s ease both; }

@keyframes pageOut {
  from { opacity: 1; transform: rotateY(0deg); }
  to   { opacity: 0; transform: rotateY(-12deg) scale(0.96); }
}
@keyframes pageIn {
  from { opacity: 0; transform: rotateY(12deg) scale(0.96); }
  to   { opacity: 1; transform: rotateY(0deg) scale(1); }
}

.page-num-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--module-color, var(--gray-400));
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.page-num-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}
.page-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.page-subtitle {
  font-size: 0.925rem;
  color: var(--gray-500);
  margin-bottom: 28px;
  line-height: 1.5;
}

/* ── Flipbook Nav ───────────────────────────────────────────── */
.flipbook-nav {
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1.5px solid var(--gray-200);
  color: var(--gray-700);
  background: var(--white);
  transition: all var(--transition);
}
.nav-btn:hover:not(:disabled) {
  border-color: var(--module-color, var(--gray-400));
  color: var(--module-color, var(--gray-900));
}
.nav-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.nav-btn.btn-finish {
  background: var(--module-color, var(--gray-900));
  color: white;
  border-color: var(--module-color, var(--gray-900));
}
.page-dots { display: flex; gap: 6px; align-items: center; }
.page-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gray-300);
  transition: all var(--transition);
  cursor: pointer;
}
.page-dot.active {
  width: 20px;
  border-radius: 4px;
  background: var(--module-color, var(--gray-700));
}

/* ── Audio Button ───────────────────────────────────────────── */
.btn-audio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1.5px solid var(--module-color, var(--gray-300));
  color: var(--module-color, var(--gray-700));
  background: color-mix(in srgb, var(--module-color, #ccc) 8%, white);
  transition: all var(--transition);
  cursor: pointer;
}
.btn-audio:hover {
  background: var(--module-color, var(--gray-900));
  color: white;
}
.btn-audio.playing {
  background: var(--module-color, var(--gray-900));
  color: white;
  animation: pulse-border 1s infinite;
}
@keyframes pulse-border {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--module-color, #ccc) 40%, transparent); }
  50%       { box-shadow: 0 0 0 6px color-mix(in srgb, var(--module-color, #ccc) 0%, transparent); }
}

/* ── Record Button ──────────────────────────────────────────── */
.btn-record {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1.5px solid var(--gray-300);
  color: var(--gray-700);
  background: var(--white);
  transition: all var(--transition);
}
.btn-record:hover { border-color: #DC2626; color: #DC2626; }
.btn-record.recording {
  background: #DC2626;
  color: white;
  border-color: #DC2626;
  animation: rec-pulse 1s infinite;
}
@keyframes rec-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.4); }
  50%       { box-shadow: 0 0 0 8px rgba(220,38,38,0); }
}
.btn-play-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1.5px solid var(--gray-300);
  color: var(--gray-700);
  background: var(--white);
  transition: all var(--transition);
}
.btn-play-back:hover { border-color: var(--gray-500); background: var(--gray-50); }
.btn-play-back:disabled { opacity: 0.35; cursor: not-allowed; }

/* ── Phoneme Cards ──────────────────────────────────────────── */
.phoneme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.phoneme-card {
  border-radius: var(--radius);
  border: 1.5px solid var(--gray-200);
  padding: 16px;
  text-align: center;
  background: var(--white);
  transition: all var(--transition);
  cursor: pointer;
}
.phoneme-card:hover {
  border-color: var(--module-color, var(--gray-400));
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.phoneme-card.selected {
  border-color: var(--module-color, var(--gray-700));
  background: color-mix(in srgb, var(--module-color, #ccc) 8%, white);
}
.phoneme-ipa {
  font-family: var(--mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--module-color, var(--gray-700));
  margin-bottom: 4px;
}
.phoneme-word {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-700);
}
.phoneme-label { font-size: 0.75rem; color: var(--gray-400); }

/* ── Minimal Pair Row ───────────────────────────────────────── */
.pair-list { display: flex; flex-direction: column; gap: 12px; }
.pair-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  background: var(--gray-50);
}
.pair-word {
  flex: 1;
  text-align: center;
}
.pair-word .word {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gray-900);
}
.pair-word .ipa {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--gray-400);
}
.pair-sep {
  font-size: 0.85rem;
  color: var(--gray-400);
  font-weight: 500;
}
.pair-row .btn-audio { margin-left: auto; }

/* ── Stress Visualizer ──────────────────────────────────────── */
.stress-word-display {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  justify-content: center;
  margin: 24px 0;
  flex-wrap: wrap;
}
.syllable {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: transform var(--transition);
}
.syllable:hover { transform: translateY(-2px); }
.syllable-text {
  padding: 10px 16px;
  border-radius: var(--radius);
  border: 2px solid var(--gray-200);
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-700);
  background: var(--white);
  transition: all var(--transition);
}
.syllable.stressed .syllable-text {
  border-color: var(--module-color, var(--gray-700));
  background: var(--module-color, var(--gray-700));
  color: white;
  font-size: 1.2rem;
  padding: 14px 20px;
}
.syllable-label { font-size: 0.7rem; color: var(--gray-400); }
.syllable.stressed .syllable-label {
  color: var(--module-color, var(--gray-700));
  font-weight: 600;
}
.stress-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--module-color, var(--gray-700));
  opacity: 0;
}
.syllable.stressed .stress-dot { opacity: 1; }

/* ── Intonation Arrow ───────────────────────────────────────── */
.intonation-display {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 16px 0;
}
.intonation-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  background: var(--gray-50);
}
.intonation-pattern {
  font-size: 1.8rem;
  min-width: 40px;
  text-align: center;
}
.intonation-text { flex: 1; }
.intonation-text .sentence {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 2px;
}
.intonation-text .description { font-size: 0.8rem; color: var(--gray-500); }
.pitch-line {
  width: 80px;
  height: 40px;
  flex-shrink: 0;
}

/* ── Quiz ───────────────────────────────────────────────────── */
.quiz-container { display: flex; flex-direction: column; gap: 16px; }
.quiz-question-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 4px;
}
.quiz-hint {
  font-size: 0.82rem;
  color: var(--gray-500);
  margin-bottom: 16px;
}
.quiz-options { display: flex; flex-direction: column; gap: 8px; }
.quiz-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-radius: var(--radius);
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  font-size: 0.925rem;
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
  width: 100%;
}
.quiz-option:hover:not(:disabled) {
  border-color: var(--module-color, var(--gray-400));
  background: color-mix(in srgb, var(--module-color, #ccc) 5%, white);
}
.quiz-option.correct {
  border-color: #059669;
  background: #F0FDF4;
  color: #065F46;
}
.quiz-option.wrong {
  border-color: #DC2626;
  background: #FEF2F2;
  color: #991B1B;
}
.quiz-option:disabled { cursor: default; }
.option-letter {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--gray-100);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}
.quiz-option.correct .option-letter { background: #059669; color: white; }
.quiz-option.wrong .option-letter   { background: #DC2626; color: white; }
.quiz-feedback {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  display: none;
}
.quiz-feedback.correct {
  background: #F0FDF4;
  color: #065F46;
  border: 1px solid #BBF7D0;
  display: block;
}
.quiz-feedback.wrong {
  background: #FEF2F2;
  color: #991B1B;
  border: 1px solid #FECACA;
  display: block;
}
.quiz-score {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
}
.score-circle {
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 3px solid var(--module-color, var(--gray-700));
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  flex-shrink: 0;
}
.score-number {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--module-color, var(--gray-900));
  line-height: 1;
}
.score-total {
  font-size: 0.65rem;
  color: var(--gray-400);
}
.score-details h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 2px; }
.score-details p { font-size: 0.82rem; color: var(--gray-500); }
.btn-next-q {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 8px 18px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: var(--module-color, var(--gray-900));
  color: white;
  transition: opacity var(--transition);
}
.btn-next-q:hover { opacity: 0.88; }

/* ── Sentence Stress Highlight ──────────────────────────────── */
.sentence-stress-display {
  font-size: 1.1rem;
  line-height: 2;
  color: var(--gray-700);
}
.sentence-stress-display .stressed-word {
  font-weight: 800;
  color: var(--module-color, var(--gray-900));
  background: color-mix(in srgb, var(--module-color, #ccc) 12%, white);
  padding: 2px 6px;
  border-radius: 4px;
}
.sentence-stress-display .unstressed-word { color: var(--gray-400); }

/* ── Result Dashboard ───────────────────────────────────────── */
.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.result-card {
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
}
.result-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--module-color, var(--gray-900));
  line-height: 1;
  margin-bottom: 4px;
}
.result-label { font-size: 0.78rem; color: var(--gray-500); }
.error-map { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.error-row { display: flex; align-items: center; gap: 10px; }
.error-label { font-size: 0.82rem; color: var(--gray-700); min-width: 140px; }
.error-bar { flex: 1; height: 6px; background: var(--gray-200); border-radius: 100px; overflow: hidden; }
.error-fill {
  height: 100%;
  border-radius: 100px;
  background: var(--module-color, var(--gray-400));
}
.error-pct { font-size: 0.78rem; color: var(--gray-500); min-width: 36px; text-align: right; }

/* ── Utility ────────────────────────────────────────────────── */
.flex  { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.text-muted { color: var(--gray-500); }
.text-small { font-size: 0.82rem; }
.ipa { font-family: var(--mono); }
.text-center { text-align: center; }
.info-box {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
  font-size: 0.875rem;
  color: var(--gray-700);
  line-height: 1.6;
}
.info-box.accent {
  background: color-mix(in srgb, var(--module-color, #ccc) 8%, white);
  border-color: color-mix(in srgb, var(--module-color, #ccc) 25%, white);
}
.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 100px;
  background: var(--gray-100);
  color: var(--gray-600, var(--gray-500));
}
.tag.accent {
  background: color-mix(in srgb, var(--module-color, #ccc) 15%, white);
  color: var(--module-color, var(--gray-700));
}

/* ── Complete Banner ────────────────────────────────────────── */
.complete-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  text-align: center;
  gap: 16px;
}
.complete-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--module-color, #ccc) 12%, white);
  border: 3px solid var(--module-color, var(--gray-400));
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
}
.complete-banner h2 { font-size: 1.5rem; font-weight: 700; color: var(--gray-900); }
.complete-banner p { font-size: 0.925rem; color: var(--gray-500); max-width: 400px; }
.btn-next-module {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--module-color, var(--gray-900));
  color: white;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 8px;
  transition: opacity var(--transition);
}
.btn-next-module:hover { opacity: 0.88; }

/* ── Recording Status ───────────────────────────────────────── */
.recording-area {
  border: 1.5px dashed var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  transition: border-color var(--transition);
}
.recording-area.recording-active {
  border-color: #DC2626;
  background: #FFF5F5;
}
.recording-area.has-recording {
  border-color: var(--module-color, var(--gray-400));
  background: color-mix(in srgb, var(--module-color, #ccc) 4%, white);
}
.recording-status {
  font-size: 0.82rem;
  color: var(--gray-500);
  margin-top: 10px;
}
.recording-status.active { color: #DC2626; font-weight: 500; }
.recording-controls { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.wave-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 32px;
  margin: 10px 0;
}
.wave-bar {
  width: 3px;
  background: #DC2626;
  border-radius: 2px;
  opacity: 0;
  animation: none;
}
.recording-active .wave-bar {
  opacity: 1;
  animation: wave 0.8s infinite ease-in-out;
}
.wave-bar:nth-child(1) { animation-delay: 0s;    height: 8px; }
.wave-bar:nth-child(2) { animation-delay: 0.1s;  height: 20px; }
.wave-bar:nth-child(3) { animation-delay: 0.2s;  height: 28px; }
.wave-bar:nth-child(4) { animation-delay: 0.3s;  height: 14px; }
.wave-bar:nth-child(5) { animation-delay: 0.4s;  height: 24px; }
.wave-bar:nth-child(6) { animation-delay: 0.5s;  height: 10px; }
.wave-bar:nth-child(7) { animation-delay: 0.6s;  height: 18px; }
@keyframes wave {
  0%, 100% { transform: scaleY(0.4); }
  50%       { transform: scaleY(1); }
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 640px) {
  .site-header { padding: 0 16px; }
  .hero { padding: 48px 16px 40px; }
  .section { padding: 40px 16px; }
  .flipbook-wrap { padding: 16px 12px; }
  .fp-page { padding: 24px 20px; }
  .flipbook-nav { padding: 12px 16px; }
  .pretest-cta { padding: 32px 24px; }
  .site-nav { display: none; }
}
