/* ============================================================
   GrammarPath — Design System
   Modern English Learning App with Lucide Icons & Pedagogical Components
   ============================================================ */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,400&family=Noto+Nastaliq+Urdu:wght@400;700&display=swap');

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Urdu font support */
[lang="ur"] {
  font-family: 'Noto Nastaliq Urdu', 'Nunito', sans-serif;
}

input, button, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

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

/* ---------- Design Tokens ---------- */
:root {
  /* Colors - Primary Brand */
  --primary: #58CC02;
  --primary-dark: #46A302;
  --primary-light: #89E219;
  --primary-glow: rgba(88, 204, 2, 0.35);
  --primary-bg: rgba(88, 204, 2, 0.12);

  /* Colors - Secondary Brand */
  --secondary: #1CB0F6;
  --secondary-dark: #1899D6;
  --secondary-light: #49C0F8;
  --secondary-glow: rgba(28, 176, 246, 0.35);

  /* Colors - Gamification Accents */
  --tertiary: #CE82FF;
  --streak: #FF9600;
  --streak-glow: rgba(255, 150, 0, 0.45);
  --xp-gold: #FFC800;
  --xp-glow: rgba(255, 200, 0, 0.35);
  --heart-red: #FF4B4B;
  --heart-glow: rgba(255, 75, 75, 0.35);

  /* Pedagogical Syntax Colors (Francisco Ochoa Method) */
  --syntax-subject: #1CB0F6;
  --syntax-aux: #FF9600;
  --syntax-verb: #58CC02;
  --syntax-complement: #CE82FF;

  /* Colors - Backgrounds & Cards */
  --bg-primary: #0F171B;
  --bg-secondary: #152228;
  --bg-card: #1B2D35;
  --bg-elevated: #223B46;
  --bg-input: #15242C;
  --bg-hover: rgba(255, 255, 255, 0.06);
  --bg-active: rgba(255, 255, 255, 0.1);
  --bg-overlay: rgba(0, 0, 0, 0.75);

  /* Colors - Glassmorphism */
  --glass: rgba(255, 255, 255, 0.04);
  --glass-hover: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.09);
  --glass-strong: rgba(255, 255, 255, 0.12);

  /* Colors - Text */
  --text-primary: #FFFFFF;
  --text-secondary: #AFC3D2;
  --text-muted: #6D8292;

  /* Layout */
  --nav-height: 64px;
  --bottom-nav-height: 72px;
  --max-width: 500px;
  --header-height: 60px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;
}

/* Light Theme Variables */
body.theme-light {
  --bg-primary: #FFFFFF;
  --bg-secondary: #F7F7F7;
  --bg-card: #FFFFFF;
  --bg-elevated: #E5E5E5;
  --bg-input: #F7F7F7;
  --bg-hover: rgba(0, 0, 0, 0.05);
  --bg-active: rgba(0, 0, 0, 0.08);
  --bg-overlay: rgba(0, 0, 0, 0.6);

  --glass: rgba(0, 0, 0, 0.03);
  --glass-hover: rgba(0, 0, 0, 0.06);
  --glass-border: #E5E5E5;
  --glass-strong: rgba(0, 0, 0, 0.1);

  --text-primary: #3C3C3C;
  --text-secondary: #777777;
  --text-muted: #AFAFAF;
}

body.theme-light .app-header,
body.theme-light .bottom-nav {
  background: #FFFFFF;
  border-color: #E5E5E5;
}

body.theme-light .lesson-node .lesson-circle.locked {
  background: #E5E5E5;
  border-color: #D6D6D6;
  color: #AFAFAF;
}

body.theme-light .continue-card,
body.theme-light .grammar-section,
body.theme-light .profile-stat-card,
body.theme-light .mc-option,
body.theme-light .flashcard-front,
body.theme-light .flashcard-back {
  background: #FFFFFF;
  border-color: #E5E5E5;
  box-shadow: 0 4px 0 #E5E5E5;
}

body.theme-light .modal {
  background: #FFFFFF;
  border-color: #E5E5E5;
  color: #3C3C3C;
}

/* ============================================================
   STRICT RTL & ENGLISH ISOLATION (FIXES URDU REVERSAL ISSUE)
   ============================================================ */
/* All English content inside the app must strictly preserve LTR ordering */
.en-isolate,
.example-en,
.formula-text,
.syntax-bar,
.reorder-target,
.reorder-bank,
.word-chip,
.flashcard-word,
.flashcard-phonetic,
.fill-blank-input,
.translation-input,
.conjugation-table,
.english-content,
[data-lang="en"] {
  direction: ltr !important;
  text-align: left !important;
  unicode-bidi: isolate !important;
}

/* Specific RTL adjustments */
[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .example-en,
[dir="rtl"] .formula-text,
[dir="rtl"] .syntax-bar,
[dir="rtl"] .reorder-target,
[dir="rtl"] .reorder-bank,
[dir="rtl"] .word-chip,
[dir="rtl"] .flashcard-word,
[dir="rtl"] .flashcard-phonetic,
[dir="rtl"] .conjugation-table,
[dir="rtl"] .conjugation-table td,
[dir="rtl"] .conjugation-table th {
  direction: ltr !important;
  text-align: left !important;
  unicode-bidi: isolate !important;
}

[dir="rtl"] .header-left,
[dir="rtl"] .header-right {
  direction: rtl;
}

[dir="rtl"] .lesson-node {
  direction: rtl;
}

[dir="rtl"] .lesson-info {
  text-align: right;
}

[dir="rtl"] .rule-card.highlight {
  border-left: none;
  border-right: 4px solid var(--primary);
}

[dir="rtl"] .toast.success { border-left: none; border-right: 4px solid var(--primary); }
[dir="rtl"] .toast.error { border-left: none; border-right: 4px solid var(--heart-red); }
[dir="rtl"] .toast.info { border-left: none; border-right: 4px solid var(--secondary); }

/* ============================================================
   APP SHELL & LAYOUT
   ============================================================ */
#app {
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  background-color: var(--bg-primary);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.6);
}

#app-content {
  padding-bottom: calc(var(--bottom-nav-height) + 1.5rem);
  min-height: 100vh;
  min-height: 100dvh;
}

/* Loading Screen */
.loading-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 500;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-logo {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  animation: float 2.5s ease-in-out infinite;
}

.loading-title {
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--glass-border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-top: 1rem;
}

/* ============================================================
   MODERN STICKY HEADER
   ============================================================ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(15, 23, 27, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  background: linear-gradient(135deg, #fff, #b2c9d6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.header-stat {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 800;
  font-size: 0.95rem;
  padding: 4px 10px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
}

.header-stat svg,
.header-stat .lucide {
  width: 17px;
  height: 17px;
}

.header-stat.streak { color: var(--streak); border-color: rgba(255, 150, 0, 0.25); }
.header-stat.xp { color: var(--xp-gold); border-color: rgba(255, 200, 0, 0.25); }
.header-stat.hearts { color: var(--heart-red); border-color: rgba(255, 75, 75, 0.25); }

/* ============================================================
   MODERN BOTTOM NAVIGATION (WITH LUCIDE ICONS)
   ============================================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-width);
  height: var(--bottom-nav-height);
  background: rgba(15, 23, 27, 0.96);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-top: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 300;
  padding: 0 0.5rem;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-muted);
  background: none;
  border: none;
  min-width: 70px;
  position: relative;
}

.nav-item:hover {
  color: var(--text-secondary);
}

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

.nav-item.active::after {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 4px 4px;
  box-shadow: 0 0 10px var(--primary-glow);
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-icon svg,
.nav-icon .lucide {
  width: 22px;
  height: 22px;
  stroke-width: 2.3;
}

.nav-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.2px;
}

/* ============================================================
   PEDAGOGICAL COMPONENTS (OCHOA, LOPERA, ARNEL)
   ============================================================ */

/* 1. Arnel's Visual Timeline */
.timeline-container {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.timeline-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  padding: 0.5rem 0.25rem;
}

.timeline-line {
  position: absolute;
  left: 15%;
  right: 15%;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  z-index: 0;
}

.timeline-node {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.timeline-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--text-muted);
  transition: all var(--transition-base);
}

.timeline-node.active .timeline-dot {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
  transform: scale(1.3);
}

.timeline-node-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.timeline-node.active .timeline-node-label {
  color: var(--primary);
}

/* 2. Francisco Ochoa's Color-Coded Syntax Formula */
.syntax-container {
  background: linear-gradient(135deg, rgba(28, 176, 246, 0.08), rgba(88, 204, 2, 0.06));
  border: 2px dashed rgba(28, 176, 246, 0.4);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1rem;
  text-align: center;
  margin-bottom: 1.25rem;
}

.syntax-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.syntax-pill {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.syntax-pill.subject { background: rgba(28, 176, 246, 0.15); color: var(--syntax-subject); border: 1px solid var(--syntax-subject); }
.syntax-pill.aux { background: rgba(255, 150, 0, 0.15); color: var(--syntax-aux); border: 1px solid var(--syntax-aux); }
.syntax-pill.verb { background: rgba(88, 204, 2, 0.15); color: var(--syntax-verb); border: 1px solid var(--syntax-verb); }
.syntax-pill.complement { background: rgba(206, 130, 255, 0.15); color: var(--syntax-complement); border: 1px solid var(--syntax-complement); }

.formula-text {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  font-family: 'Courier New', monospace;
  direction: ltr !important;
  text-align: center !important;
}

/* 3. Teacher's Master Tip Card (Ochoa & Lopera Secret) */
.teacher-tip-card {
  background: linear-gradient(135deg, rgba(255, 200, 0, 0.08), rgba(255, 150, 0, 0.04));
  border: 1px solid rgba(255, 200, 0, 0.3);
  border-radius: var(--radius-lg);
  padding: 1rem 1.2rem;
  margin-bottom: 1.25rem;
  position: relative;
}

.teacher-tip-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--xp-gold);
  font-weight: 800;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.4rem;
}

.teacher-tip-text {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* 4. Common Mistake Warning Card */
.common-mistake-card {
  background: linear-gradient(135deg, rgba(255, 75, 75, 0.08), rgba(255, 75, 75, 0.03));
  border: 1px solid rgba(255, 75, 75, 0.3);
  border-radius: var(--radius-lg);
  padding: 1rem 1.2rem;
  margin-bottom: 1.25rem;
}

.common-mistake-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--heart-red);
  font-weight: 800;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.4rem;
}

.common-mistake-text {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ============================================================
   LESSON CONTENT & PATH
   ============================================================ */
.lesson-map {
  padding: 1rem;
}

.continue-card {
  background: linear-gradient(135deg, #1B2D35, #17262D);
  border: 1px solid rgba(88, 204, 2, 0.3);
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.continue-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 12px 32px var(--primary-glow);
}

.continue-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.continue-lesson-title {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 0.2rem;
}

.continue-lesson-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.continue-progress {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.progress-bar-container {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  height: 10px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--primary-dark), var(--primary), var(--primary-light));
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.continue-progress-text {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-secondary);
}

/* Level Section */
.level-section {
  margin-bottom: 2rem;
}

.level-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
  padding: 0.5rem 0.75rem;
  background: var(--glass);
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
}

.level-badge {
  font-size: 0.7rem;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  color: white;
}

.level-badge.foundations { background: var(--primary); }
.level-badge.elementary { background: var(--secondary); }
.level-badge.preintermediate { background: var(--tertiary); }
.level-badge.intermediate { background: var(--streak); }
.level-badge.upper { background: var(--heart-red); }

.level-title {
  font-weight: 800;
  font-size: 1rem;
}

.level-cefr {
  margin-left: auto;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-muted);
}

[dir="rtl"] .level-cefr {
  margin-left: 0;
  margin-right: auto;
}

/* Lesson Nodes */
.lesson-path {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.lesson-node {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-base);
}

.lesson-node:hover {
  background: var(--bg-elevated);
  transform: translateY(-2px);
  border-color: var(--glass-strong);
}

.lesson-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  border: 3px solid;
  position: relative;
  background: var(--bg-primary);
}

.lesson-circle.completed {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
  box-shadow: 0 0 16px var(--primary-glow);
}

.lesson-circle.current {
  border-color: var(--secondary);
  box-shadow: 0 0 16px var(--secondary-glow);
  animation: pulse-border 2s ease-in-out infinite;
}

.lesson-circle.locked {
  border-color: rgba(255, 255, 255, 0.1);
  opacity: 0.45;
}

.lesson-info {
  flex: 1;
}

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

.lesson-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.lesson-status {
  font-size: 0.74rem;
  font-weight: 800;
  margin-top: 4px;
}

.lesson-status.completed { color: var(--primary); }
.lesson-status.current { color: var(--secondary); }
.lesson-status.locked { color: var(--text-muted); }

/* ============================================================
   LESSON DETAIL SCREEN
   ============================================================ */
.lesson-content {
  padding: 1rem;
}

.lesson-hero {
  text-align: center;
  padding: 1.5rem 1rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(180deg, var(--bg-card), transparent);
  border-radius: var(--radius-xl);
}

.lesson-hero-icon {
  font-size: 3.5rem;
  margin-bottom: 0.75rem;
  animation: float 3s ease-in-out infinite;
}

.lesson-hero-level {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.lesson-hero-title {
  font-size: 1.6rem;
  font-weight: 900;
  margin-bottom: 0.35rem;
}

.section-title {
  font-size: 0.85rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.section-title svg,
.section-title .lucide {
  width: 18px;
  height: 18px;
}

.rule-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  line-height: 1.8;
}

.rule-card.highlight {
  border-left: 4px solid var(--primary);
}

.rule-text {
  font-size: 0.98rem;
  color: var(--text-secondary);
}

/* Conjugation Table */
.conjugation-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1.25rem;
  border: 1px solid var(--glass-border);
  direction: ltr !important;
}

.conjugation-table th {
  background: var(--bg-elevated);
  padding: 0.65rem 0.85rem;
  text-align: left !important;
  font-weight: 800;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.conjugation-table td {
  padding: 0.65rem 0.85rem;
  border-top: 1px solid var(--glass-border);
  font-size: 0.9rem;
  text-align: left !important;
}

.conjugation-table tr:nth-child(even) td {
  background: var(--glass);
}

/* Examples */
.example-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.example-item {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  transition: all var(--transition-fast);
}

.example-item:hover {
  background: var(--bg-elevated);
}

.example-en {
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
  direction: ltr !important;
  text-align: left !important;
  unicode-bidi: isolate !important;
}

.example-native {
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-top: 3px;
}

.example-audio-btn {
  background: rgba(28, 176, 246, 0.12);
  border: 1px solid rgba(28, 176, 246, 0.3);
  color: var(--secondary);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.example-audio-btn:hover {
  background: var(--secondary);
  color: white;
}

/* ============================================================
   EXERCISES SCREEN
   ============================================================ */
.exercise-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.exercise-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  background: rgba(15, 23, 27, 0.92);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 200;
}

.exercise-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.exercise-progress {
  flex: 1;
}

.exercise-progress-bar {
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  height: 10px;
  overflow: hidden;
}

.exercise-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-dark), var(--primary));
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.exercise-hearts {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--heart-red);
  font-weight: 800;
  font-size: 0.95rem;
}

.exercise-body {
  flex: 1;
  padding: 1.5rem 1.1rem;
  display: flex;
  flex-direction: column;
}

.exercise-type-badge {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

.exercise-question {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.5;
  margin-bottom: 1.75rem;
}

/* Multiple choice */
.mc-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mc-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.mc-option:hover {
  background: var(--bg-elevated);
  border-color: rgba(255, 255, 255, 0.2);
}

.mc-option.selected {
  border-color: var(--secondary);
  background: rgba(28, 176, 246, 0.1);
}

.mc-option.correct {
  border-color: var(--primary);
  background: rgba(88, 204, 2, 0.15);
}

.mc-option.incorrect {
  border-color: var(--heart-red);
  background: rgba(255, 75, 75, 0.15);
}

.mc-letter {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.mc-option.selected .mc-letter {
  background: var(--secondary);
  border-color: var(--secondary);
  color: white;
}

.mc-option.correct .mc-letter {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.mc-option.incorrect .mc-letter {
  background: var(--heart-red);
  border-color: var(--heart-red);
  color: white;
}

.mc-text {
  font-weight: 700;
  font-size: 1rem;
}

/* Word Ordering (Strict LTR for English chips) */
.reorder-target {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: 60px;
  padding: 0.85rem;
  background: var(--bg-input);
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  align-items: center;
  direction: ltr !important;
  text-align: left !important;
  unicode-bidi: isolate !important;
}

.reorder-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  direction: ltr !important;
  unicode-bidi: isolate !important;
}

.word-chip {
  padding: 0.5rem 1rem;
  background: var(--bg-card);
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: 0.95rem;
  color: white;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
  direction: ltr !important;
  unicode-bidi: isolate !important;
}

.word-chip:hover {
  border-color: var(--secondary);
  transform: translateY(-2px);
}

.word-chip.placed {
  opacity: 0.25;
  pointer-events: none;
}

.word-chip.in-target {
  background: var(--secondary);
  border-color: var(--secondary);
  color: white;
}

/* Fill in the blank & translation inputs */
.fill-blank-input {
  background: var(--bg-input);
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  color: white;
  font-size: 1.15rem;
  font-weight: 700;
  text-align: center;
  width: 100%;
  max-width: 320px;
  margin: 0 auto 1.5rem;
  display: block;
  direction: ltr !important;
}

.fill-blank-input:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px var(--secondary-glow);
}

.translation-source {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  text-align: center;
}

.translation-source-text {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
}

.translation-source-lang {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
}

.translation-input {
  background: var(--bg-input);
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  color: white;
  font-size: 1rem;
  width: 100%;
  min-height: 85px;
  resize: none;
  direction: ltr !important;
  text-align: left !important;
}

.translation-input:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px var(--secondary-glow);
}

/* Feedback Drawer */
.exercise-feedback {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-width);
  padding: 1rem;
  z-index: 500;
  animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.feedback-content {
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.feedback-content.correct {
  background: #112918;
  border: 2px solid var(--primary);
}

.feedback-content.incorrect {
  background: #2D1414;
  border: 2px solid var(--heart-red);
}

.feedback-title {
  font-weight: 900;
  font-size: 1.15rem;
}

.feedback-content.correct .feedback-title { color: var(--primary); }
.feedback-content.incorrect .feedback-title { color: var(--heart-red); }

.feedback-correct-answer {
  font-weight: 800;
  font-size: 1rem;
  color: var(--primary);
  direction: ltr !important;
  text-align: left !important;
}

.exercise-footer {
  padding: 1rem;
  margin-top: auto;
}

/* ============================================================
   VOCABULARY 3D FLASHCARDS
   ============================================================ */
.vocabulary-page {
  padding: 1rem;
}

.vocab-daily-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.vocab-count {
  font-size: 3rem;
  font-weight: 900;
  color: var(--xp-gold);
}

.vocab-of-total {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 700;
}

.flashcard-container {
  perspective: 1000px;
  margin-bottom: 1.5rem;
}

.flashcard {
  width: 100%;
  height: 250px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.flashcard.flipped {
  transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  border: 1px solid var(--glass-border);
}

.flashcard-front {
  background: linear-gradient(135deg, var(--bg-card), var(--bg-elevated));
}

.flashcard-back {
  background: linear-gradient(135deg, rgba(88, 204, 2, 0.12), rgba(28, 176, 246, 0.08));
  border-color: var(--primary);
  transform: rotateY(180deg);
}

.flashcard-word {
  font-size: 2.2rem;
  font-weight: 900;
  margin-bottom: 0.25rem;
}

.flashcard-phonetic {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.flashcard-type {
  font-size: 0.75rem;
  color: var(--secondary);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 12px;
  background: rgba(28, 176, 246, 0.12);
  border-radius: var(--radius-full);
}

.flashcard-translation {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.flashcard-example {
  font-size: 0.95rem;
  color: var(--text-secondary);
  text-align: center;
  direction: ltr !important;
}

.vocab-actions {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.vocab-action-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-base);
}

.vocab-action-btn.skip {
  background: var(--bg-card);
  border: 2px solid var(--glass-border);
  color: var(--text-muted);
}

.vocab-action-btn.skip:hover {
  border-color: var(--heart-red);
  color: var(--heart-red);
}

.vocab-action-btn.know {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.vocab-action-btn.know:hover {
  transform: scale(1.08);
}

/* ============================================================
   PROFILE & SETTINGS
   ============================================================ */
.profile-page {
  padding: 1rem;
}

.profile-header {
  text-align: center;
  padding: 1.5rem 1rem;
  margin-bottom: 1.25rem;
}

.profile-avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  margin: 0 auto 0.75rem;
  border: 3px solid var(--primary);
  box-shadow: 0 0 20px var(--primary-glow);
}

.profile-name {
  font-size: 1.35rem;
  font-weight: 900;
}

.profile-level {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.profile-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  text-align: center;
}

.profile-stat-value {
  font-size: 1.4rem;
  font-weight: 900;
  display: block;
}

.profile-stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.settings-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.settings-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: background var(--transition-fast);
  background: transparent;
  border: none;
  width: 100%;
  color: var(--text-primary);
  text-align: left;
}

[dir="rtl"] .settings-item {
  text-align: right;
}

.settings-item:hover {
  background: var(--bg-hover);
}

.settings-item .settings-text {
  flex: 1;
  font-weight: 700;
  font-size: 0.92rem;
}

.settings-item.danger {
  color: var(--heart-red);
}

/* ============================================================
   BUTTONS & FORMS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  height: 48px;
  user-select: none;
}

.btn:active {
  transform: translateY(2px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 0 var(--primary-dark);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-light);
}

.btn-primary:active:not(:disabled) {
  box-shadow: 0 1px 0 var(--primary-dark);
}

.btn-secondary {
  background: var(--secondary);
  color: white;
  box-shadow: 0 4px 0 var(--secondary-dark);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid var(--glass-border);
}

.btn-danger {
  background: var(--heart-red);
  color: white;
  box-shadow: 0 4px 0 #cc3c3c;
}

.btn-block { width: 100%; }
.btn-lg { height: 54px; font-size: 1.05rem; border-radius: var(--radius-lg); }

/* Language Selector */
.language-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.lang-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0.85rem;
  background: var(--bg-card);
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-base);
}

.lang-option:hover {
  background: var(--bg-elevated);
}

.lang-option.selected {
  border-color: var(--primary);
  background: var(--primary-bg);
  box-shadow: 0 0 16px var(--primary-glow);
}

.lang-flag { font-size: 1.8rem; }
.lang-name { font-weight: 800; font-size: 0.9rem; }
.lang-native { font-size: 0.72rem; color: var(--text-muted); }

/* Goal Selector */
.goal-selector {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.goal-option {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1.1rem;
  background: var(--bg-card);
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-base);
}

.goal-option:hover { background: var(--bg-elevated); }
.goal-option.selected {
  border-color: var(--xp-gold);
  background: rgba(255, 200, 0, 0.08);
}

.goal-title { font-weight: 800; font-size: 0.92rem; }
.goal-desc { font-size: 0.78rem; color: var(--text-muted); }
.goal-words { font-weight: 900; color: var(--xp-gold); font-size: 1.15rem; margin-left: auto; }
[dir="rtl"] .goal-words { margin-left: 0; margin-right: auto; }

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 400;
  padding: 1.25rem;
}

.modal-overlay.hidden { display: none; }

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  width: 100%;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}

.modal-icon { font-size: 2.75rem; margin-bottom: 0.5rem; }
.modal-title { font-size: 1.3rem; font-weight: 900; margin-bottom: 0.5rem; }
.modal-text { color: var(--text-secondary); font-size: 0.92rem; margin-bottom: 1.25rem; line-height: 1.6; }

/* Toasts */
.toast-container {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-width);
  padding: 0 1rem;
  z-index: 600;
  pointer-events: none;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  margin-bottom: 0.5rem;
  font-weight: 700;
  font-size: 0.88rem;
}

.toast.success { border-left: 4px solid var(--primary); }
.toast.error { border-left: 4px solid var(--heart-red); }
.toast.info { border-left: 4px solid var(--secondary); }
.toast.warning { border-left: 4px solid var(--streak); }

/* Animations */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse-border {
  0%, 100% { box-shadow: 0 0 0 0 var(--secondary-glow); }
  50% { box-shadow: 0 0 0 8px transparent; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateX(-50%) translateY(50px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes celebrate {
  0% { transform: scale(0); }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.confetti-piece {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  z-index: 700;
  pointer-events: none;
  animation: confettiFall 2.8s ease-out forwards;
}

@keyframes confettiFall {
  0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ============================================================
   Missing Helper & Component Styles
   ============================================================ */

/* Onboarding & Auth Form */
.onboarding {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.25rem;
  max-width: 440px;
  margin: 0 auto;
  min-height: 100vh;
  text-align: center;
}

.onboarding-logo {
  font-size: 4rem;
  margin-bottom: 0.5rem;
  animation: float 3s ease-in-out infinite;
}

.onboarding-title {
  font-size: 2rem;
  font-weight: 900;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.onboarding-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: left;
}

[dir="rtl"] .form-group {
  text-align: right;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input {
  width: 100%;
  padding: 0.85rem 1.1rem;
  background: var(--bg-card);
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1rem;
  outline: none;
  transition: all var(--transition-fast);
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: var(--bg-elevated);
}

.form-input::placeholder {
  color: var(--text-muted);
}

/* Small Button */
.btn-sm {
  height: 36px;
  padding: 0 1rem;
  font-size: 0.82rem;
  border-radius: var(--radius-md);
}

/* Goal Icon in selector */
.goal-icon {
  font-size: 1.5rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Grammar Sections in Lesson Detail */
.grammar-section {
  background: var(--bg-card);
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.grammar-section .section-title {
  margin-bottom: 0.75rem;
}

/* Lesson Complete Title */
.lesson-complete-title {
  font-size: 1.85rem;
  font-weight: 900;
  margin-bottom: 0.5rem;
  letter-spacing: -0.5px;
}

/* Unlocked Achievements in Profile */
.profile-stat-card.unlocked {
  border-color: var(--xp-gold);
  background: rgba(255, 200, 0, 0.08);
  box-shadow: 0 0 12px var(--xp-glow);
  position: relative;
}

.profile-stat-card:not(.unlocked) {
  opacity: 0.45;
  filter: grayscale(0.8);
}

/* ============================================================
   Mascot Styles & Floating Animations
   ============================================================ */
.mascot-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 1rem auto;
  user-select: none;
}

.mascot-svg {
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.25));
  transition: transform var(--transition-spring);
}

.mascot-svg:hover {
  transform: scale(1.06);
}

.mascot-svg.mood-happy {
  animation: float 3s ease-in-out infinite;
}

.mascot-svg.mood-celebrate {
  animation: celebrate 0.7s ease-out;
}

.mascot-svg.mood-sad {
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.mascot-speech-bubble {
  background: var(--bg-card);
  border: 2px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1.1rem;
  font-weight: 800;
  font-size: 0.95rem;
  position: relative;
  margin-bottom: 0.75rem;
  box-shadow: 0 4px 12px var(--primary-glow);
  max-width: 280px;
  text-align: center;
}

.mascot-speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 10px 10px 0;
  border-style: solid;
  border-color: var(--primary) transparent transparent;
  display: block;
  width: 0;
}

/* Speech Mic Exercise Button */
.speech-mic-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--primary);
  border: 4px solid var(--primary-dark);
  box-shadow: 0 6px 0 var(--primary-dark), 0 0 20px var(--primary-glow);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1.5rem auto 1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.speech-mic-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--primary-dark);
}

.speech-mic-btn.listening {
  background: var(--heart-red);
  border-color: #CC3C3C;
  box-shadow: 0 0 0 0 var(--heart-glow);
  animation: pulse-mic 1.2s infinite;
}

@keyframes pulse-mic {
  0% { box-shadow: 0 0 0 0 rgba(255, 75, 75, 0.7); }
  70% { box-shadow: 0 0 0 20px rgba(255, 75, 75, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 75, 75, 0); }
}

.speech-status-text {
  text-align: center;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

.speech-transcript-box {
  background: var(--bg-card);
  border: 2px dashed var(--secondary);
  border-radius: var(--radius-md);
  padding: 1rem;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--secondary-light);
  margin-top: 1rem;
}

/* Leaderboard League Banner & Rows */
.leaderboard-page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.25rem 1rem 5rem;
}

.league-banner {
  border-radius: var(--radius-lg);
  border: 2px solid;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.league-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

.league-title {
  font-size: 1.35rem;
  font-weight: 900;
  margin-bottom: 0.15rem;
}

.league-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.leaderboard-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--bg-card);
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  transition: all var(--transition-fast);
}

.leaderboard-row.me {
  border-color: var(--primary);
  background: var(--primary-bg);
  box-shadow: 0 0 14px var(--primary-glow);
}

.leaderboard-row.promotion-zone {
  border-left: 4px solid var(--xp-gold);
}

.row-rank {
  font-size: 1.2rem;
  font-weight: 900;
  width: 32px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.row-rank .rank-num {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.row-avatar {
  font-size: 1.6rem;
  line-height: 1;
}

.row-info {
  flex: 1;
}

.row-name {
  font-weight: 800;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.you-badge {
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 900;
}

.row-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.row-xp {
  font-weight: 900;
  font-size: 0.95rem;
  color: var(--xp-gold);
}


