/* ═══════════════════════════════════════
   ქართული (Kartuli) — Design System
   Georgian Language Learning App
   ═══════════════════════════════════════ */

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

/* ── CSS Variables ── */
:root {
  /* Colors — Warm Georgian palette */
  --wine: #722F37;
  --wine-light: #8B3A44;
  --wine-dark: #5A2530;
  --gold: #C9A96E;
  --gold-light: #D4BC8A;
  --gold-dark: #A88A50;
  --olive: #6B7F3B;
  --olive-light: #8CA04E;
  --terracotta: #C17A56;
  --terracotta-light: #D4956F;
  --sand: #F5ECD7;
  --sand-dark: #E8DCC0;
  --cream: #FAF6EB;
  --parchment: #FDF8EF;

  /* Semantic */
  --success: #4CAF50;
  --success-bg: #E8F5E9;
  --error: #E53935;
  --error-bg: #FFEBEE;
  --info: #1976D2;
  --info-bg: #E3F2FD;
  --warning: #FF9800;

  /* Neutrals */
  --text-primary: #2D2018;
  --text-secondary: #6B5D52;
  --text-muted: #9E8E82;
  --border: #E0D5C5;
  --border-light: #EDE6DA;

  /* Backgrounds */
  --bg-primary: #FAF6EB;
  --bg-secondary: #F5ECD7;
  --bg-card: rgba(255, 255, 255, 0.72);
  --bg-card-hover: rgba(255, 255, 255, 0.88);
  --bg-sidebar: rgba(250, 246, 235, 0.95);
  --bg-overlay: rgba(45, 32, 24, 0.5);

  /* Glass */
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.3);
  --glass-shadow: 0 8px 32px rgba(114, 47, 55, 0.1);

  /* Typography */
  --font-georgian: 'Noto Sans Georgian', sans-serif;
  --font-ui: 'Inter', 'Outfit', system-ui, sans-serif;
  --font-display: 'Outfit', 'Inter', sans-serif;

  /* Sizes */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(114, 47, 55, 0.06);
  --shadow-md: 0 4px 16px rgba(114, 47, 55, 0.08);
  --shadow-lg: 0 8px 32px rgba(114, 47, 55, 0.12);
  --shadow-xl: 0 16px 48px rgba(114, 47, 55, 0.16);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition: 300ms ease;
  --transition-slow: 500ms ease;

  /* Layout */
  --sidebar-width: 280px;
  --header-height: 64px;
  --content-max: 1100px;
}

/* ── Dark Theme ── */
[data-theme="dark"] {
  --wine: #B85A64;
  --wine-light: #D47A84;
  --gold: #D4BC8A;
  --gold-light: #E0CFA0;
  --olive: #8CA04E;
  --terracotta: #D4956F;
  --sand: #2A2420;
  --cream: #1E1A16;
  --parchment: #252120;

  --text-primary: #F0E8DC;
  --text-secondary: #B8A898;
  --text-muted: #7A6E64;
  --border: #3A322C;
  --border-light: #2E2822;

  --bg-primary: #1A1612;
  --bg-secondary: #242018;
  --bg-card: rgba(42, 36, 30, 0.8);
  --bg-card-hover: rgba(52, 46, 38, 0.9);
  --bg-sidebar: rgba(26, 22, 18, 0.95);
  --bg-overlay: rgba(0, 0, 0, 0.6);

  --glass-bg: rgba(42, 36, 30, 0.6);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);

  /* Dark mode fixes */
  .substitution-text {
    background: var(--parchment);
    color: var(--text-primary);
  }

  .slot-frame {
    background: linear-gradient(180deg, #3A2820 0%, #2A1E18 100%);
    border-color: var(--gold);
  }

  .slot-reel {
    background: linear-gradient(180deg, #2A2420 0%, #1E1A16 50%, #2A2420 100%);
  }

  .slot-letter {
    color: var(--wine-light);
  }

  .path-progress-card {
    background: linear-gradient(145deg, var(--wine-dark) 0%, #3A2028 100%);
  }

  .path-content-card,
  .path-learn-card,
  .path-test-card,
  .path-dialogue {
    background: var(--bg-card);
    border-color: var(--border-light);
  }

  .flip-card-front {
    background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    border-color: var(--border-light);
  }

  .flip-card-back {
    background: linear-gradient(145deg, var(--wine-dark) 0%, #3A2028 100%);
  }

  .wotd-card {
    background: var(--bg-card);
    border-color: var(--border-light);
  }

  .exercise-container {
    background: var(--bg-card);
    border-color: var(--border-light);
  }

  .btn-outline {
    border-color: var(--border);
    color: var(--text-primary);
  }

  .btn-outline:hover {
    background: var(--bg-secondary);
  }
}

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

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

body {
  font-family: var(--font-ui);
  color: var(--text-primary);
  background: var(--bg-primary);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(114, 47, 55, 0.04) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(201, 169, 110, 0.06) 0%, transparent 50%);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Georgian text */
.ka, [lang="ka"] {
  font-family: var(--font-georgian);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.ka-large {
  font-family: var(--font-georgian);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.4;
}

.ka-huge {
  font-family: var(--font-georgian);
  font-size: 6rem;
  font-weight: 700;
  line-height: 1;
}

/* ── Layout ── */
.app {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
  overflow-y: auto;
}

.sidebar-logo {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo .logo-letter {
  font-family: var(--font-georgian);
  font-size: 2rem;
  font-weight: 800;
  color: var(--wine);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(114, 47, 55, 0.1), rgba(201, 169, 110, 0.15));
  border-radius: var(--radius-md);
}

.sidebar-logo .logo-text {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.sidebar-logo .logo-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Navigation */
.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
}

.nav-section {
  margin-bottom: 8px;
}

.nav-section-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 8px 12px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  position: relative;
  user-select: none;
}

.nav-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(114, 47, 55, 0.12), rgba(201, 169, 110, 0.1));
  color: var(--wine);
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--wine);
  border-radius: 0 3px 3px 0;
}

.nav-item .nav-icon {
  font-size: 1.2rem;
  width: 24px;
  text-align: center;
}

.nav-item .nav-badge {
  margin-left: auto;
  background: var(--wine);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

/* Sidebar progress */
.sidebar-progress {
  padding: 16px 20px;
  border-top: 1px solid var(--border-light);
}

.progress-bar-container {
  height: 6px;
  background: var(--border-light);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 8px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--wine), var(--gold));
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

.progress-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

/* Theme toggle */
.theme-toggle {
  padding: 12px 20px;
  border-top: 1px solid var(--border-light);
}

.theme-toggle-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: transparent;
  cursor: pointer;
  width: 100%;
  color: var(--text-secondary);
  font-size: 0.85rem;
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--wine);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100%;
  box-sizing: border-box;
}

.page-header {
  padding: 32px 40px 24px;
  border-bottom: 1px solid var(--border-light);
}

.page-header h1 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.page-header .subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.page-body {
  padding: 32px 40px;
  max-width: var(--content-max);
}

/* ── Cards ── */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  background: var(--bg-card-hover);
}

.card-flat {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
}

/* ── Alphabet grid ── */
.alphabet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 12px;
}

.letter-card {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.letter-card .letter {
  font-family: var(--font-georgian);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  transition: transform var(--transition);
}

.letter-card .sound {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
  opacity: 0;
  transform: translateY(4px);
  transition: all var(--transition);
}

.letter-card:hover {
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px) scale(1.03);
  border-color: var(--gold);
}

.letter-card:hover .letter {
  color: var(--wine);
  transform: scale(1.1);
}

.letter-card:hover .sound {
  opacity: 1;
  transform: translateY(0);
}

.letter-card.vowel {
  border-left: 3px solid var(--gold);
}

.letter-card.consonant {
  border-left: 3px solid var(--olive);
}

.letter-card.learned {
  background: var(--success-bg);
  border-color: var(--success);
}

.letter-card.learned::after {
  content: '✓';
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 0.7rem;
  color: var(--success);
  font-weight: 700;
}

/* ── Letter Detail ── */
.letter-detail {
  text-align: center;
}

.letter-display {
  font-family: var(--font-georgian);
  font-size: 10rem;
  font-weight: 700;
  color: var(--wine);
  line-height: 1;
  margin: 20px 0;
  text-shadow: 0 4px 24px rgba(114, 47, 55, 0.15);
  transition: all var(--transition);
}

.letter-meta {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin: 16px 0;
  flex-wrap: wrap;
}

.letter-meta-item {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  text-align: center;
}

.letter-meta-item label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.letter-meta-item .value {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
}

.mnemonic-box {
  background: linear-gradient(135deg, rgba(201, 169, 110, 0.1), rgba(114, 47, 55, 0.06));
  border: 1px solid rgba(201, 169, 110, 0.3);
  border-radius: var(--radius-lg);
  padding: 20px 28px;
  margin: 20px auto;
  max-width: 500px;
  font-style: italic;
  color: var(--text-secondary);
  font-size: 1rem;
}

.mnemonic-box::before {
  content: '💡 ';
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-md);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  text-decoration: none;
  user-select: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--wine), var(--wine-light));
  color: #fff;
  box-shadow: 0 2px 8px rgba(114, 47, 55, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 4px 16px rgba(114, 47, 55, 0.35);
  transform: translateY(-1px);
}

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

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--wine);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--wine-dark);
  box-shadow: 0 2px 8px rgba(201, 169, 110, 0.3);
}

.btn-gold:hover {
  box-shadow: 0 4px 12px rgba(201, 169, 110, 0.4);
  transform: translateY(-1px);
}

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }
.btn-icon {
  width: 40px; height: 40px;
  padding: 0;
  border-radius: var(--radius-full);
}

.btn-play {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--wine), var(--terracotta));
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 10px rgba(114, 47, 55, 0.2);
}

.btn-play:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(114, 47, 55, 0.3);
}

.btn-record {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
  cursor: pointer;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  position: relative;
}

.btn-record:hover {
  background: var(--wine);
  color: #fff;
  border-color: var(--wine);
  transform: scale(1.05);
}

.btn-record.recording {
  background: var(--error);
  color: #fff;
  border-color: var(--error);
  animation: pulse-record 1s infinite;
}

.btn-record.has-recording {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}

@keyframes pulse-record {
  0%, 100% { box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(229, 57, 53, 0); }
}

.word-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
}

/* ── Substitution Module ── */
#substitutionContent {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.substitution-text {
  font-family: 'Outfit', 'Inter', system-ui, sans-serif;
  font-size: 1.15rem;
  line-height: 2.2;
  padding: 40px;
  background: var(--parchment);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-xl);
  letter-spacing: 0.01em;
  box-shadow: inset 0 0 40px rgba(114, 47, 55, 0.03), var(--shadow-lg);
  text-align: justify;
  color: #3e3229;
  word-wrap: break-word;
  overflow-wrap: break-word;
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  display: block;
  white-space: normal;
}

.substitution-text p {
  margin-bottom: 20px;
  text-indent: 30px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.substitution-text p:last-child {
  margin-bottom: 0;
}

.substitution-text .char-ru {
  color: inherit;
  transition: all var(--transition);
  display: inline;
}

.substitution-text .char-ka {
  font-family: var(--font-georgian);
  color: inherit;
  font-weight: inherit;
  font-size: 1.15em;
  position: relative;
  cursor: help;
  transition: color var(--transition-fast);
  display: inline;
}

.substitution-text .char-ka:hover {
  color: var(--wine);
}

.substitution-text .char-ka .tooltip {
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--text-primary);
  border: 1px solid var(--gold);
  color: var(--gold-light);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-xl);
  z-index: 10;
}

.substitution-text .char-ka:hover .tooltip,
.substitution-text .char-ka.active .tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(-8px);
}

.substitution-text .char-ka.active {
  color: var(--wine);
}

/* Horizontal Slider Layout on Top */
.level-slider-container {
  margin-top: 8px;
  margin-bottom: 24px;
  padding: 16px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.level-indicator-horizontal {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.level-indicator-horizontal .v-slider-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  white-space: nowrap;
  letter-spacing: 0.05em;
}

.level-slider-horizontal-input {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 8px;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--wine), var(--gold));
  outline: none;
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.level-slider-horizontal-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--wine);
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(114, 47, 55, 0.3);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.level-slider-horizontal-input::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.level-info-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.level-info-card .level-num {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--wine);
  white-space: nowrap;
}

.level-info-card .level-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

/* ── Lessons ── */
.lesson-list {
  display: grid;
  gap: 16px;
}

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

.lesson-card:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
  border-color: var(--gold);
}

.lesson-num {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--wine), var(--terracotta));
  color: #fff;
  font-weight: 700;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lesson-card.completed .lesson-num {
  background: linear-gradient(135deg, var(--success), #66BB6A);
}

.lesson-info { flex: 1; }
.lesson-info h3 { font-size: 1.05rem; margin-bottom: 2px; }
.lesson-info .ka-title {
  font-family: var(--font-georgian);
  color: var(--wine);
  font-weight: 500;
  font-size: 0.9rem;
}
.lesson-info p { font-size: 0.85rem; color: var(--text-muted); margin-top: 4px; }

.lesson-arrow {
  font-size: 1.2rem;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}

.lesson-card:hover .lesson-arrow {
  transform: translateX(4px);
  color: var(--wine);
}

/* Lesson view */
.lesson-section {
  margin-bottom: 36px;
}

.lesson-section-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.word-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.word-card {
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
}

.word-card:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow-sm);
}

.word-card .word-ka {
  font-family: var(--font-georgian);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--wine);
}

.word-card .word-transcription {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 2px 0;
}

.word-card .word-ru {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Dialogue */
.dialogue {
  max-width: 600px;
}

.dialogue-line {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.dialogue-line:hover {
  border-color: var(--gold);
  background: var(--bg-card-hover);
}

.dialogue-line.speaker-a {
  margin-right: 40px;
}

.dialogue-line.speaker-b {
  margin-left: 40px;
  background: linear-gradient(135deg, rgba(114, 47, 55, 0.04), rgba(201, 169, 110, 0.06));
}

.dialogue-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--wine);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.speaker-b .dialogue-avatar {
  background: var(--gold-dark);
}

.dialogue-text .dl-ka {
  font-family: var(--font-georgian);
  font-weight: 500;
  color: var(--text-primary);
}

.dialogue-text .dl-ru {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Exercises */
.exercise-container {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 20px;
}

.exercise-instruction {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.exercise-type-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: rgba(114, 47, 55, 0.1);
  color: var(--wine);
  margin-bottom: 12px;
}

/* Match exercise */
.match-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
}

.match-item {
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
  font-weight: 500;
  user-select: none;
}

.match-item:hover { border-color: var(--gold); }
.match-item.selected { border-color: var(--wine); background: rgba(114, 47, 55, 0.06); }
.match-item.correct {
  border-color: var(--success);
  background: var(--success-bg);
  animation: pulse-success 0.5s ease;
}
.match-item.incorrect {
  border-color: var(--error);
  background: var(--error-bg);
  animation: shake 0.4s ease;
}
.match-item.matched {
  opacity: 0.5;
  pointer-events: none;
  border-color: var(--success);
  background: var(--success-bg);
}

/* Choose exercise */
.choose-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.choose-option {
  padding: 14px 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-weight: 500;
  text-align: center;
  user-select: none;
}

.choose-option:hover { border-color: var(--gold); background: rgba(201, 169, 110, 0.06); }
.choose-option.correct {
  border-color: var(--success);
  background: var(--success-bg);
  animation: pulse-success 0.5s ease;
}
.choose-option.incorrect {
  border-color: var(--error);
  background: var(--error-bg);
  animation: shake 0.4s ease;
}

/* Fill blank exercise */
.fill-blank-sentence {
  font-size: 1.2rem;
  margin-bottom: 12px;
  font-family: var(--font-georgian);
}

.fill-blank-input {
  border: none;
  border-bottom: 2px solid var(--wine);
  background: transparent;
  font-family: var(--font-georgian);
  font-size: 1.1rem;
  padding: 4px 8px;
  color: var(--wine);
  outline: none;
  min-width: 120px;
  text-align: center;
  transition: border-color var(--transition-fast);
}

.fill-blank-input:focus {
  border-bottom-color: var(--gold);
}

.fill-blank-input.correct { border-bottom-color: var(--success); color: var(--success); }
.fill-blank-input.incorrect { border-bottom-color: var(--error); color: var(--error); }

.fill-blank-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 4px;
}

/* Build sentence */
.word-blocks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.word-block {
  padding: 8px 18px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-georgian);
  font-size: 1.05rem;
  font-weight: 500;
  cursor: grab;
  user-select: none;
  transition: all var(--transition-fast);
}

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

.word-block.placed {
  opacity: 0.3;
  pointer-events: none;
}

.sentence-dropzone {
  min-height: 56px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  transition: border-color var(--transition-fast);
}

.sentence-dropzone.active { border-color: var(--wine); }
.sentence-dropzone.correct { border-color: var(--success); background: var(--success-bg); }

.placed-word {
  padding: 8px 18px;
  background: rgba(114, 47, 55, 0.08);
  border: 2px solid var(--wine);
  border-radius: var(--radius-md);
  font-family: var(--font-georgian);
  font-size: 1.05rem;
  font-weight: 500;
  cursor: pointer;
}

/* Score */
.exercise-score {
  text-align: center;
  padding: 32px;
}

.score-stars {
  font-size: 3rem;
  margin-bottom: 12px;
}

.score-text {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
}

.score-detail {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Phrasebook ── */
.phrase-categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.phrase-cat-card {
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}

.phrase-cat-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.phrase-cat-card.active {
  border-color: var(--wine);
  background: rgba(114, 47, 55, 0.06);
}

.phrase-cat-icon {
  font-size: 2rem;
  margin-bottom: 6px;
}

.phrase-cat-title {
  font-size: 0.85rem;
  font-weight: 600;
}

.phrase-list {
  display: grid;
  gap: 8px;
}

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

.phrase-item:hover {
  border-color: var(--gold);
  background: var(--bg-card-hover);
}

.phrase-item .phrase-ka {
  font-family: var(--font-georgian);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--wine);
}

.phrase-item .phrase-transcription {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.phrase-item .phrase-ru {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.phrase-item .phrase-fav {
  margin-left: auto;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0.3;
  transition: all var(--transition-fast);
}

.phrase-item .phrase-fav:hover,
.phrase-item .phrase-fav.active { opacity: 1; }

/* ── Games ── */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.game-card {
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--gold);
}

.game-card .game-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.game-card h3 { font-size: 1.1rem; margin-bottom: 6px; }
.game-card p { font-size: 0.85rem; color: var(--text-muted); }

/* Memory game */
.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  max-width: 500px;
  margin: 0 auto;
}

.memory-card {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  cursor: pointer;
  perspective: 600px;
  user-select: none;
}

.memory-card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.5s ease;
}

.memory-card.flipped .memory-card-inner {
  transform: rotateY(180deg);
}

.memory-card-front, .memory-card-back {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden; /* Safari fallback */
  font-weight: 600;
  padding: 6px;
  text-align: center;
  word-break: break-word;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.memory-card-front {
  background: linear-gradient(135deg, var(--wine), var(--terracotta)) !important;
  color: #fff;
  font-size: 1rem;
  line-height: 1.2;
  transform: rotateY(180deg); /* Text should be rotated by default, so it shows correctly when card is flipped */
}

.memory-card:not(.flipped) .memory-card-front {
  pointer-events: none;
}

.memory-card-back {
  background: var(--bg-card);
  border: 2px solid var(--border);
  font-size: 2rem;
  transform: rotateY(0deg); /* Default state facing user */
}

.memory-card-back::after {
  content: 'ქ';
  font-family: var(--font-georgian);
  font-size: 2rem;
  color: var(--wine);
  opacity: 0.4;
}

.memory-card.matched .memory-card-front {
  background: linear-gradient(135deg, var(--success), #66BB6A);
}

/* Word scramble */
.scramble-letters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 20px 0;
}

.scramble-letter {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-georgian);
  font-size: 1.6rem;
  font-weight: 600;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: grab;
  user-select: none;
  transition: all var(--transition-fast);
}

.scramble-letter:hover {
  border-color: var(--wine);
  transform: scale(1.08);
}

.scramble-letter.used {
  opacity: 0.3;
  pointer-events: none;
}

.scramble-target {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 20px 0;
  min-height: 56px;
}

.scramble-slot {
  width: 48px;
  height: 52px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-georgian);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--wine);
  transition: all var(--transition-fast);
}

.scramble-slot.filled {
  border-style: solid;
  border-color: var(--wine);
  background: rgba(114, 47, 55, 0.06);
  cursor: pointer;
}

.scramble-slot.correct {
  border-color: var(--success);
  background: var(--success-bg);
  color: var(--success);
}

/* ── Progress / Dashboard ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

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

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--wine);
  line-height: 1;
}

.stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.stat-card .stat-icon {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

/* Badges */
.badges-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.badge {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: all var(--transition);
  position: relative;
}

.badge.earned {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(201, 169, 110, 0.15), rgba(114, 47, 55, 0.08));
  box-shadow: 0 2px 12px rgba(201, 169, 110, 0.2);
}

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

/* Word of the Day */
.wotd-card {
  padding: 28px;
  background: linear-gradient(135deg, rgba(114, 47, 55, 0.06), rgba(201, 169, 110, 0.08));
  border: 1px solid rgba(201, 169, 110, 0.3);
  border-radius: var(--radius-xl);
  text-align: center;
  margin-bottom: 28px;
}

.wotd-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold-dark);
  font-weight: 600;
  margin-bottom: 12px;
}

.wotd-word {
  font-family: var(--font-georgian);
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--wine);
  margin-bottom: 8px;
}

.wotd-transcription {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.wotd-translation {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ── Grammar ── */
.grammar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 12px;
}

.grammar-card h3 {
  font-size: 1rem;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.grammar-example {
  padding: 12px 16px;
  background: rgba(114, 47, 55, 0.04);
  border-left: 3px solid var(--wine);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 8px 0;
}

.grammar-example .ge-ka {
  font-family: var(--font-georgian);
  font-weight: 500;
  color: var(--text-primary);
  font-size: 1.05rem;
}

.grammar-example .ge-tr {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.grammar-example .ge-ru {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ── Animations ── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

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

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

@keyframes pulse-success {
  0% { transform: scale(1); }
  50% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

@keyframes letterDraw {
  from { stroke-dashoffset: var(--path-length); }
  to { stroke-dashoffset: 0; }
}

@keyframes bounceIn {
  0% { transform: scale(0); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

@keyframes slideRight {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

.animate-in {
  animation: fadeIn 0.4s ease forwards;
}

.page-body > * {
  animation: fadeInUp 0.35s ease forwards;
}

/* ── Text Selector Tabs ── */
.text-tabs-container {
  position: relative;
  margin-bottom: 24px;
}

.text-tabs-container::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 40px;
  background: linear-gradient(90deg, transparent, var(--bg-primary));
  pointer-events: none;
}

.text-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.text-tabs::-webkit-scrollbar {
  display: none;
}

.text-tab {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  background: var(--bg-card);
  color: var(--text-secondary);
  user-select: none;
}

.text-tab:hover {
  border-color: var(--wine);
  color: var(--wine);
  background: var(--bg-card-hover);
}

.text-tab.active {
  background: var(--wine);
  color: #fff;
  border-color: var(--wine);
  box-shadow: var(--shadow-sm);
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition);
}

.modal-overlay.show .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  font-size: 1.2rem;
}

.modal-close {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  font-size: 1.4rem;
  cursor: pointer;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
}

/* ── Responsive ── */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 150;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  cursor: pointer;
  font-size: 1.3rem;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.sidebar-toggle:hover { border-color: var(--wine); }

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }

  .sidebar-toggle {
    display: flex;
  }

  .main-content {
    margin-left: 0;
    width: 100%;
    overflow-x: hidden;
  }

  .page-header {
    padding: 20px 20px 16px;
    padding-top: 64px;
  }

  .page-body {
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .alphabet-grid {
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 8px;
  }

  .letter-display {
    font-size: 6rem;
  }

  .choose-options {
    grid-template-columns: 1fr;
  }

  .match-columns {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .memory-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }

  .wotd-word {
    font-size: 2rem;
  }

  .dialogue-line.speaker-a { margin-right: 16px; }
  .dialogue-line.speaker-b { margin-left: 16px; }

  /* ── Substitution Tablet ── */
  .substitution-text {
    padding: 24px;
    font-size: 1.05rem;
    line-height: 2.1;
  }

  .substitution-text p {
    text-indent: 20px;
  }

  .text-tabs {
    gap: 6px;
  }

  .text-tab {
    padding: 8px 14px;
    font-size: 0.8rem;
  }

  .level-indicator-horizontal {
    gap: 12px;
  }

  .level-slider-horizontal-input::-webkit-slider-thumb {
    width: 26px;
    height: 26px;
  }
}

@media (max-width: 480px) {
  .alphabet-grid {
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  }

  .word-grid {
    grid-template-columns: 1fr;
  }

  .phrase-categories {
    grid-template-columns: repeat(3, 1fr);
  }

  .games-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* ── Substitution Mobile ── */
  .substitution-text {
    padding: 16px;
    font-size: 1rem;
    line-height: 2;
    border-radius: 16px;
    text-align: left;
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow-x: hidden;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }

  .substitution-text p {
    text-indent: 16px;
    margin-bottom: 14px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
  }

  .substitution-text .char-ka {
    font-size: 1.1em;
  }

  .substitution-text .char-ka .tooltip {
    font-size: 0.75rem;
    padding: 4px 10px;
    bottom: 110%;
  }

  .level-slider-container {
    padding: 12px 16px;
    margin-bottom: 16px;
  }

  .level-indicator-horizontal {
    gap: 10px;
  }

  .level-indicator-horizontal .v-slider-label {
    font-size: 0.7rem;
  }

  .level-slider-horizontal-input {
    height: 6px;
  }

  .level-slider-horizontal-input::-webkit-slider-thumb {
    width: 28px;
    height: 28px;
  }

  .level-info-card {
    padding: 14px;
  }

  .level-num {
    font-size: 1rem;
  }

  .level-desc {
    font-size: 0.8rem;
  }

  /* Letter map */
  .letter-map-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .letter-map-item {
    padding: 4px 8px;
    font-size: 0.75rem;
    border-radius: 16px;
  }

  /* Quiz on mobile */
  .quiz-letter-big {
    font-size: 3.5rem !important;
  }

  .quiz-option {
    padding: 14px !important;
    font-size: 1.2rem !important;
  }

  /* Flip cards mobile */
  .flip-card-scene {
    height: 240px;
    max-width: 100%;
  }

  .flip-card-face {
    padding: 20px;
  }

  .flip-card-front .flip-word {
    font-size: 2.2rem;
  }

  .flip-card-back .flip-word {
    font-size: 1.8rem;
  }

  .flip-card-back .flip-translation {
    font-size: 1.2rem;
  }

  .flip-nav .btn {
    padding: 10px 14px;
    font-size: 0.85rem;
  }

  /* Progress mobile */
  .progress-circles {
    gap: 8px;
  }

  .progress-ring {
    width: 70px;
    height: 70px;
  }

  .progress-ring-text {
    font-size: 0.85rem;
  }

  .progress-stats-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .progress-badges {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .progress-badge {
    padding: 10px 6px;
  }

  .progress-badge-icon {
    font-size: 1.4rem;
  }

  .progress-badge-name {
    font-size: 0.65rem;
  }
}

/* ── Utility ── */
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.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; }
.mb-24 { margin-bottom: 24px; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.inline-flex { display: inline-flex; align-items: center; gap: 6px; }

/* ═══════════════════════════════════════
   Loading Skeletons
   ═══════════════════════════════════════ */

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

.skeleton {
  background: linear-gradient(90deg, var(--border-light) 25%, var(--bg-secondary) 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
  border-radius: 8px;
}

.skeleton-text {
  height: 16px;
  margin-bottom: 8px;
}

.skeleton-text.short {
  width: 60%;
}

.skeleton-title {
  height: 24px;
  width: 40%;
  margin-bottom: 16px;
}

.skeleton-card {
  height: 120px;
  margin-bottom: 16px;
}

.skeleton-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
}

.skeleton-btn {
  height: 44px;
  width: 120px;
  border-radius: 12px;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.3s ease;
}

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

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--wine);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ═══════════════════════════════════════
   Daily Goal & SRS Stats
   ═══════════════════════════════════════ */

.daily-goal-card {
  background: linear-gradient(145deg, rgba(114, 47, 55, 0.08) 0%, rgba(201, 169, 110, 0.08) 100%);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 20px;
}

.daily-goal-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.daily-goal-icon {
  font-size: 1.8rem;
}

.daily-goal-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.daily-goal-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.srs-stat {
  text-align: center;
  padding: 12px 8px;
  border-radius: 12px;
}

.srs-stat-val {
  font-size: 1.3rem;
  font-weight: 700;
}

.srs-stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Dark mode for daily goal */
[data-theme="dark"] .daily-goal-card {
  background: linear-gradient(145deg, rgba(184, 90, 100, 0.1) 0%, rgba(212, 188, 138, 0.1) 100%);
  border-color: var(--border-light);
}

[data-theme="dark"] .srs-stat {
  background: var(--bg-card);
  border-color: var(--border-light);
}

/* ═══════════════════════════════════════
   Teacher Module
   ═══════════════════════════════════════ */

.teacher-lesson-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.teacher-lesson-card:hover {
  border-color: var(--wine);
  box-shadow: 0 4px 12px rgba(114, 47, 55, 0.1);
}

.teacher-lesson-card.completed {
  background: var(--success-bg);
  border-color: rgba(76, 175, 80, 0.3);
}

.teacher-lesson-icon {
  font-size: 1.8rem;
  width: 48px;
  height: 48px;
  background: var(--bg-secondary);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.teacher-lesson-info {
  flex: 1;
}

.teacher-lesson-title {
  font-weight: 700;
  font-size: 1rem;
}

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

.teacher-lesson-status {
  font-size: 1.2rem;
}

/* Teacher Card */
.teacher-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 28px;
}

.teacher-ka {
  font-family: var(--font-georgian);
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--wine);
  text-align: center;
  margin-bottom: 8px;
}

.teacher-tr {
  font-size: 1rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 4px;
}

.teacher-ru {
  font-size: 1.4rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 16px;
}

.teacher-literal {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
  padding: 8px;
  background: var(--bg-secondary);
  border-radius: 10px;
  margin-bottom: 16px;
}

.teacher-example {
  background: rgba(114, 47, 55, 0.05);
  border: 1px solid rgba(114, 47, 55, 0.1);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}

.teacher-example-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.teacher-example-ka {
  font-family: var(--font-georgian);
  font-size: 1.1rem;
  color: var(--wine);
  margin-bottom: 4px;
}

.teacher-example-tr {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.teacher-example-ru {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.teacher-usage {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.teacher-level {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.teacher-level.official {
  background: rgba(25, 118, 210, 0.1);
  color: var(--info);
}

.teacher-level.friendly {
  background: rgba(76, 175, 80, 0.1);
  color: var(--success);
}

.teacher-level.informal {
  background: rgba(255, 152, 0, 0.1);
  color: var(--warning);
}

/* Dialogue */
.teacher-dialogue {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 28px;
  text-align: center;
}

.teacher-dialogue-speaker {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.teacher-dialogue-ka {
  font-family: var(--font-georgian);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--wine);
  margin-bottom: 8px;
}

.teacher-dialogue-ru {
  font-size: 1rem;
  color: var(--text-secondary);
}

/* Mobile */
@media (max-width: 768px) {
  .teacher-ka {
    font-size: 2.2rem;
  }

  .teacher-card {
    padding: 20px;
  }
}

/* ═══════════════════════════════════════
   Flip Card — Memrise-style 3D animation
   ═══════════════════════════════════════ */

.flip-card-scene {
  perspective: 1200px;
  width: 100%;
  max-width: 380px;
  height: 280px;
  margin: 0 auto 24px;
  cursor: pointer;
}

.flip-card {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.flip-card.flipped {
  transform: rotateY(180deg);
}

.flip-card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  text-align: center;
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.04),
    0 10px 30px rgba(114, 47, 55, 0.08);
}

.flip-card-front {
  background: linear-gradient(145deg, #ffffff 0%, var(--sand) 100%);
  border: 2px solid var(--border-light);
}

.flip-card-front::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--wine), var(--gold), var(--terracotta));
  border-radius: 20px 20px 0 0;
}

.flip-card-front .flip-word {
  font-family: var(--font-georgian);
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--wine);
  margin-bottom: 12px;
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.flip-card-front .flip-hint {
  font-size: 0.9rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.flip-card-front .flip-hint::before {
  content: '👆';
  font-size: 1.1rem;
}

.flip-card-back {
  background: linear-gradient(145deg, var(--wine) 0%, var(--wine-dark) 100%);
  border: 2px solid var(--wine-light);
  transform: rotateY(180deg);
}

.flip-card-back::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light), var(--gold));
  border-radius: 20px 20px 0 0;
}

.flip-card-back .flip-word {
  font-family: var(--font-georgian);
  font-size: 2.2rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.flip-card-back .flip-transcription {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 8px;
}

.flip-card-back .flip-translation {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--gold-light);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.flip-example {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  text-align: center;
}

.flip-example-ka {
  display: block;
  font-family: var(--font-georgian);
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 4px;
  font-style: italic;
}

.flip-example-ru {
  display: block;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
}

/* Hover / active states */
.flip-card-scene:hover .flip-card:not(.flipped) {
  transform: rotateY(-5deg) scale(1.02);
}

.flip-card-scene:active .flip-card {
  transform: scale(0.97);
  transition-duration: 0.15s;
}

.flip-card.flipped:active {
  transform: rotateY(180deg) scale(0.97);
}

/* Card entrance animation */
@keyframes cardEnter {
  0% {
    opacity: 0;
    transform: translateX(80px) rotateY(-15deg);
  }
  100% {
    opacity: 1;
    transform: translateX(0) rotateY(0);
  }
}

@keyframes cardExit {
  0% {
    opacity: 1;
    transform: translateX(0) rotateY(0);
  }
  100% {
    opacity: 0;
    transform: translateX(-80px) rotateY(15deg);
  }
}

.flip-card-scene.enter {
  animation: cardEnter 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.flip-card-scene.exit {
  animation: cardExit 0.4s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}

/* Shake on wrong answer */
@keyframes cardShake {
  0%, 100% { transform: translateX(0) rotateY(180deg); }
  10%, 50%, 90% { transform: translateX(-8px) rotateY(180deg); }
  30%, 70% { transform: translateX(8px) rotateY(180deg); }
}

.flip-card.shake {
  animation: cardShake 0.5s ease;
}

/* Pulse on correct answer */
@keyframes cardPulse {
  0% { transform: rotateY(180deg) scale(1); }
  50% { transform: rotateY(180deg) scale(1.05); }
  100% { transform: rotateY(180deg) scale(1); }
}

.flip-card.pulse {
  animation: cardPulse 0.4s ease;
}

/* Nav buttons */
.flip-nav {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 8px;
}

.flip-nav .btn {
  min-width: 48px;
  padding: 12px 20px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.25s ease;
}

.flip-nav .btn:active {
  transform: scale(0.95);
}

/* Progress dots */
.flip-progress {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
}

.flip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: all 0.3s ease;
}

.flip-dot.active {
  background: var(--wine);
  transform: scale(1.3);
}

.flip-dot.done {
  background: var(--success);
}

/* ═══════════════════════════════════════
   Progress Module — Enhanced styles
   ═══════════════════════════════════════ */

.progress-level-card {
  background: linear-gradient(145deg, #ffffff 0%, var(--sand) 100%);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 16px rgba(114, 47, 55, 0.06);
}

.progress-level-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.progress-level-icon {
  font-size: 2.5rem;
  width: 64px;
  height: 64px;
  background: rgba(114, 47, 55, 0.08);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-level-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.progress-level-xp {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.progress-level-steps {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  position: relative;
}

.progress-level-steps::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 16px;
  right: 16px;
  height: 2px;
  background: var(--border);
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  z-index: 1;
}

.progress-step-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--border);
  border: 3px solid var(--bg-primary);
  transition: all 0.3s ease;
}

.progress-step.active .progress-step-dot {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.2);
}

.progress-step.current .progress-step-dot {
  background: var(--wine);
  box-shadow: 0 0 0 4px rgba(114, 47, 55, 0.2);
  transform: scale(1.2);
}

.progress-step-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Circular Progress */
.progress-circles {
  display: flex;
  justify-content: space-around;
  margin-bottom: 24px;
  gap: 12px;
}

.progress-circle-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.progress-ring {
  width: 80px;
  height: 80px;
  position: relative;
  --color: var(--wine);
}

.progress-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(0deg);
}

.progress-ring circle:last-child {
  stroke: var(--color);
  transition: stroke-dashoffset 1s ease;
}

.progress-ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.progress-ring-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.progress-ring-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Quick Stats Row */
.progress-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.progress-stat-mini {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: transform 0.2s ease;
}

.progress-stat-mini:hover {
  transform: translateY(-2px);
}

.progress-stat-icon {
  font-size: 1.2rem;
}

.progress-stat-val {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.progress-stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Weekly Activity */
.progress-week {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.progress-week-day {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.progress-week-bar {
  width: 100%;
  height: 48px;
  background: var(--border-light);
  border-radius: 8px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.progress-week-day.active .progress-week-bar {
  background: linear-gradient(180deg, var(--success) 0%, rgba(76, 175, 80, 0.6) 100%);
}

.progress-week-day.today .progress-week-bar {
  background: linear-gradient(180deg, var(--wine) 0%, var(--wine-light) 100%);
  box-shadow: 0 2px 8px rgba(114, 47, 55, 0.3);
}

.progress-week-day.today.active .progress-week-bar {
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold-light) 100%);
  box-shadow: 0 2px 8px rgba(201, 169, 110, 0.4);
}

.progress-week-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

.progress-week-day.today .progress-week-label {
  color: var(--wine);
  font-weight: 700;
}

/* ═══════════════════════════════════════
   Alphabet Games — Maze, Dragon, Flood
   ═══════════════════════════════════════ */

/* Maze cells */
.maze-cell {
  transition: all 0.3s ease;
}

.maze-wall {
  background: #3e3229;
}

.maze-path {
  background: var(--sand);
  border: 1px solid var(--border-light);
}

.maze-dead {
  background: rgba(229, 57, 53, 0.15);
  border: 1px solid rgba(229, 57, 53, 0.3);
}

.maze-player {
  background: linear-gradient(135deg, var(--wine), var(--gold));
  border: 2px solid var(--gold);
  box-shadow: 0 0 12px rgba(201, 169, 110, 0.5);
  animation: mazePlayerPulse 1s ease infinite;
}

@keyframes mazePlayerPulse {
  0%, 100% { box-shadow: 0 0 12px rgba(201, 169, 110, 0.5); }
  50% { box-shadow: 0 0 20px rgba(201, 169, 110, 0.8); }
}

/* Flood water animation */
@keyframes floodWave {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-5px); }
}

/* Dragon fire effect */
@keyframes dragonFire {
  0% { text-shadow: 0 0 20px rgba(255, 100, 0, 0.8); }
  50% { text-shadow: 0 0 40px rgba(255, 50, 0, 1); }
  100% { text-shadow: 0 0 20px rgba(255, 100, 0, 0.8); }
}

/* ═══════════════════════════════════════
   Slot Machine
   ═══════════════════════════════════════ */

.slot-machine {
  display: inline-block;
  position: relative;
}

.slot-frame {
  background: linear-gradient(180deg, #8B4513 0%, #654321 100%);
  border: 4px solid #DAA520;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 8px 32px rgba(139, 69, 19, 0.4), inset 0 2px 0 rgba(255, 215, 0, 0.3);
}

.slot-reels {
  display: flex;
  gap: 8px;
}

.slot-reel {
  width: 80px;
  height: 100px;
  background: linear-gradient(180deg, #FFF8E1 0%, #FFECB3 50%, #FFF8E1 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.2);
  position: relative;
}

.slot-reel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, transparent 100%);
  pointer-events: none;
}

.slot-reel::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(0deg, rgba(0,0,0,0.1) 0%, transparent 100%);
  pointer-events: none;
}

.slot-letter {
  font-family: var(--font-georgian);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--wine);
  transition: transform 0.1s ease;
}

.slot-reel.spinning .slot-letter {
  animation: slotSpin 0.1s linear infinite;
}

.slot-reel.stopped .slot-letter {
  animation: slotStop 0.3s ease;
}

.slot-reel.jackpot .slot-letter {
  animation: slotJackpot 0.5s ease infinite;
}

@keyframes slotSpin {
  0% { transform: translateY(-20px); opacity: 0.5; }
  50% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(20px); opacity: 0.5; }
}

@keyframes slotStop {
  0% { transform: scale(1.2); }
  50% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

@keyframes slotJackpot {
  0%, 100% { transform: scale(1); color: var(--wine); }
  50% { transform: scale(1.1); color: var(--gold); }
}

.slot-lights {
  display: flex;
  justify-content: space-around;
  margin-top: 8px;
}

.slot-light {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #FFD700;
  box-shadow: 0 0 8px #FFD700;
  animation: slotLightBlink 1s ease infinite;
}

.slot-light:nth-child(2) { animation-delay: 0.2s; }
.slot-light:nth-child(3) { animation-delay: 0.4s; }
.slot-light:nth-child(4) { animation-delay: 0.6s; }
.slot-light:nth-child(5) { animation-delay: 0.8s; }

@keyframes slotLightBlink {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px #FFD700; }
  50% { opacity: 0.4; box-shadow: 0 0 4px #FFD700; }
}

.slot-win-amount {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(201, 169, 110, 0.1), rgba(201, 169, 110, 0.05));
  border: 1px solid rgba(201, 169, 110, 0.3);
  border-radius: 12px;
}

/* ═══════════════════════════════════════
   Simon Game
   ═══════════════════════════════════════ */



/* Badges Grid */
.progress-badges {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
}

.progress-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 8px;
  border-radius: 14px;
  border: 2px solid var(--border-light);
  background: var(--bg-card);
  transition: all 0.25s ease;
  text-align: center;
}

.progress-badge.earned {
  border-color: var(--gold);
  background: linear-gradient(145deg, rgba(201, 169, 110, 0.08) 0%, rgba(201, 169, 110, 0.02) 100%);
}

.progress-badge.earned:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(201, 169, 110, 0.2);
}

.progress-badge.locked {
  opacity: 0.45;
  filter: grayscale(0.8);
}

.progress-badge-icon {
  font-size: 1.8rem;
  margin-bottom: 6px;
}

.progress-badge-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.progress-badge-xp {
  font-size: 0.65rem;
  color: var(--gold-dark);
  font-weight: 700;
  margin-top: 4px;
}

/* ═══════════════════════════════════════
   Learning Path — Step-by-Step styles
   ═══════════════════════════════════════ */

.path-progress-card {
  background: linear-gradient(145deg, var(--wine) 0%, var(--wine-dark) 100%);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 24px;
  color: white;
  box-shadow: 0 8px 32px rgba(114, 47, 55, 0.3);
}

.path-progress-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.path-progress-icon {
  font-size: 2.5rem;
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.path-progress-title {
  font-size: 1.2rem;
  font-weight: 700;
}

.path-progress-sub {
  font-size: 0.85rem;
  opacity: 0.8;
}

.path-progress-pct {
  text-align: right;
  font-size: 0.9rem;
  margin-top: 8px;
  opacity: 0.8;
}

.path-progress-card .progress-bar-container {
  background: rgba(255, 255, 255, 0.2);
}

.path-progress-card .progress-bar-fill {
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
}

/* Info Card */
.path-info-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  font-size: 0.9rem;
}

.path-info-icon {
  font-size: 1.5rem;
}

.path-info-text {
  color: var(--text-secondary);
}

/* Phase */
.path-phase {
  margin-bottom: 24px;
}

.path-phase-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  margin-bottom: 12px;
}

.path-phase-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  background: var(--bg-secondary);
}

.path-phase-badge.current {
  background: linear-gradient(135deg, var(--wine), var(--wine-light));
  box-shadow: 0 4px 12px rgba(114, 47, 55, 0.3);
}

.path-phase-badge.completed {
  background: linear-gradient(135deg, var(--success), #66BB6A);
}

.path-phase-info {
  flex: 1;
}

.path-phase-name {
  font-weight: 700;
  font-size: 1rem;
}

.path-phase-progress {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.path-phase-pct {
  font-weight: 700;
  color: var(--wine);
}

/* Steps */
.path-phase-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 20px;
  border-left: 3px solid var(--border-light);
}

.path-phase.active .path-phase-steps {
  border-left-color: var(--wine);
}

.path-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  transition: all 0.25s ease;
}

.path-step:hover:not([style*="cursor:not-allowed"]) {
  border-color: var(--wine);
  box-shadow: 0 2px 8px rgba(114, 47, 55, 0.1);
}

.path-step.next {
  border-color: var(--gold);
  background: linear-gradient(145deg, rgba(201, 169, 110, 0.08) 0%, rgba(201, 169, 110, 0.02) 100%);
}

.path-step.completed {
  background: var(--success-bg);
  border-color: rgba(76, 175, 80, 0.3);
}

.path-step-icon {
  font-size: 1.3rem;
  width: 36px;
  text-align: center;
}

.path-step-info {
  flex: 1;
  min-width: 0;
}

.path-step-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.path-step-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.path-step-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.path-step-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.path-step-done {
  color: var(--success);
  font-weight: 700;
}

/* Content Cards */
.path-content-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 28px;
}

.path-content-text {
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 20px;
}

.path-tips {
  background: rgba(201, 169, 110, 0.1);
  border: 1px solid rgba(201, 169, 110, 0.3);
  border-radius: 12px;
  padding: 16px;
}

.path-tips-title {
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--gold-dark);
}

.path-tip {
  font-size: 0.9rem;
  margin-bottom: 4px;
  color: var(--text-secondary);
}

.path-examples {
  margin-top: 20px;
}

.path-example {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-bottom: 1px solid var(--border-light);
}

.path-example-ka {
  font-family: var(--font-georgian);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--wine);
}

.path-example-ru {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Learn Card */
.path-learn-card {
  background: linear-gradient(145deg, #ffffff 0%, var(--sand) 100%);
  border: 2px solid var(--border-light);
  border-radius: 20px;
  padding: 40px;
  text-align: center;
}

.path-learn-ka {
  font-family: var(--font-georgian);
  font-size: 3rem;
  font-weight: 700;
  color: var(--wine);
  margin-bottom: 12px;
}

.path-learn-tr {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.path-learn-ru {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Test Card */
.path-test-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 28px;
  text-align: center;
}

.path-test-ka {
  font-family: var(--font-georgian);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--wine);
  margin-bottom: 8px;
}

.path-test-tr {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.path-test-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.path-test-btn {
  padding: 16px !important;
  font-size: 1rem !important;
}

/* Dialogue Card */
.path-dialogue {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 28px;
  text-align: center;
}

.path-dialogue-speaker {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.path-dialogue-ka {
  font-family: var(--font-georgian);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--wine);
  margin-bottom: 8px;
}

.path-dialogue-ru {
  font-size: 1rem;
  color: var(--text-secondary);
}

/* Mobile */
@media (max-width: 768px) {
  .path-progress-card {
    padding: 18px;
  }

  .path-progress-icon {
    width: 48px;
    height: 48px;
    font-size: 2rem;
  }

  .path-progress-title {
    font-size: 1rem;
  }

  .path-step {
    padding: 10px 12px;
  }

  .path-step-title {
    font-size: 0.85rem;
  }

  .path-learn-ka {
    font-size: 2.5rem;
  }

  .path-test-ka {
    font-size: 2rem;
  }

  .path-test-options {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .path-phase-steps {
    padding-left: 12px;
  }

  .path-step-desc {
    display: none;
  }

  .path-learn-card {
    padding: 24px;
  }

  .path-learn-ka {
    font-size: 2rem;
  }
}
