/* VocaBag — Design System */

@font-face {
  font-family: 'Inter';
  src: url('/assets/fonts/Inter.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --teal:       #2dd4bf;
  --teal-dark:  #0f9f8e;
  --teal-light: #e0faf7;
  --teal-glow:  rgba(45,212,191,.18);
  --bg:         #f8fafb;
  --surface:    #ffffff;
  --border:     #e8ecef;
  --text:       #1a1a2e;
  --muted:      #6b7280;
  --success:    #22c55e;
  --danger:     #ef4444;
  --warning:    #f59e0b;
  --radius:     14px;
  --shadow:     0 2px 16px rgba(0,0,0,.07);
  --shadow-lg:  0 8px 40px rgba(0,0,0,.12);
  --transition: .2s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'kern' 1, 'liga' 1;
}

a { color: var(--teal-dark); text-decoration: none; }
a:hover { color: var(--teal); }

/* ── Nav ───────────────────────────────────────────── */
.nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
}
.lang-dropdown + .nav-logo { margin-left: 12px; }
.nav-logo-icon { font-size: 22px; }
.nav-logo-bag { stroke: var(--teal); stroke-width: 2; flex-shrink: 0; }
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-link {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
}
.nav-link:hover { background: var(--teal-light); color: var(--teal-dark); }
.nav-link.active { color: var(--teal-dark); }
.avatar {
  width: 32px; height: 32px;
  background: var(--teal);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  flex-shrink: 0;
}
.nav-link-avatar {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 8px; background: none; border: none; cursor: pointer;
}
.nav-avatar-wrap { position: relative; }
.nav-avatar-menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-lg);
  min-width: 160px; overflow: hidden; z-index: 200;
  animation: fadeIn .15s ease both;
}
.nav-avatar-menu a {
  display: block; padding: 10px 16px; font-size: 14px;
  font-weight: 500; color: var(--text); text-decoration: none;
}
.nav-avatar-menu a:hover { background: var(--teal-light); color: var(--teal-dark); }

.nav-streak { display:inline-flex;align-items:center;gap:3px;font-size:13px;font-weight:700;color:var(--text);background:rgba(255,140,0,.12);padding:4px 10px;border-radius:20px;line-height:1; }
.nav-streak-icon { display:block;line-height:1;font-size:14px; }
.nav-streak-num { display:block;line-height:1; }
.nav-daily { display:flex; align-items:center; gap:6px; font-size:12px; font-weight:600; color:var(--muted); padding:4px 10px; background:var(--surface); border-radius:20px; border:1px solid var(--border); }
.nav-daily-bar { width:48px; height:5px; background:var(--border); border-radius:99px; overflow:hidden; }
.nav-daily-fill { display:block; height:100%; background:var(--teal); border-radius:99px; transition:width .4s ease; }
@media (max-width:768px) { .nav-daily { display:none; } }
.nav-friend-chip { display:inline-flex;align-items:center;gap:5px;font-size:12px;font-weight:600;color:var(--muted);padding:4px 10px;background:var(--surface);border-radius:20px;border:1px solid var(--border);white-space:nowrap;transition:border-color .15s; }
.nav-friend-chip:hover { border-color:var(--teal);color:var(--text); }
@media (max-width:900px) { .nav-friend-chip { display:none; } }
.nav-upgrade-cta { display:inline-flex;align-items:center;gap:5px;font-size:13px;font-weight:700;padding:5px 13px;border-radius:20px;background:linear-gradient(135deg,#f59e0b,#f97316);color:#fff !important;white-space:nowrap;transition:transform .15s,box-shadow .15s; }.nav-upgrade-cta:hover { transform:translateY(-1px);box-shadow:0 4px 14px rgba(245,158,11,.45);color:#fff !important; }.nav-premium-badge { display:inline-flex;align-items:center;gap:4px;font-size:12px;font-weight:800;padding:4px 11px;border-radius:20px;background:linear-gradient(135deg,#fef3c7,#fde68a);color:#92400e;border:1px solid rgba(245,158,11,.5);letter-spacing:.01em;white-space:nowrap;cursor:default; }[data-theme=dark] .nav-premium-badge { background:linear-gradient(135deg,rgba(245,158,11,.25),rgba(249,115,22,.2));color:#fbbf24;border-color:rgba(245,158,11,.35); }

/* ── Language dropdown ──────────────────────────────── */
.lang-dropdown { position: relative; }
.lang-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 8px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}
.lang-dropdown-trigger:hover { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-glow); }
.lang-trigger-flag { font-size: 17px; line-height: 1; }
.lang-trigger-name { font-size: 12px; }
.lang-trigger-chevron { color: var(--muted); transition: transform var(--transition); flex-shrink: 0; }
.lang-dropdown.open .lang-trigger-chevron { transform: rotate(180deg); }
.lang-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 190px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.06);
  overflow: hidden;
  z-index: 200;
  padding: 4px;
  animation: fadeIn .15s ease;
}
.lang-dropdown.open .lang-dropdown-menu { display: block; }
.lang-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: background var(--transition);
}
.lang-dropdown-item:hover { background: var(--teal-light); }
.lang-dropdown-item.active { background: var(--teal-light); font-weight: 700; color: var(--teal-dark); }
[data-theme='dark'] .lang-dropdown-trigger { background: rgba(255,255,255,.06); }
[data-theme='dark'] .lang-dropdown-menu { background: #1e2030; border-color: rgba(255,255,255,.1); box-shadow: 0 8px 32px rgba(0,0,0,.4); }
[data-theme='dark'] .lang-dropdown-item:hover,
[data-theme='dark'] .lang-dropdown-item.active { background: rgba(45,212,191,.12); }
.choice-card { border:2px solid transparent;transition:var(--transition); }
.choice-card:hover { border-color:var(--teal); }
.nav-burger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px; }
.nav-burger span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: all var(--transition); }
.nav-mobile { display: none; flex-direction: column; padding: 12px 20px 16px; border-top: 1px solid var(--border); gap: 4px; }
.nav-mobile a { padding: 10px 12px; border-radius: 8px; color: var(--text); font-size: 15px; transition: background var(--transition); }
.nav-mobile a:hover { background: var(--teal-light); }
.nav-mobile.open { display: flex; max-height: calc(100dvh - 60px); overflow-y: auto; overscroll-behavior: contain; }

/* ── Layout ────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.main { flex: 1; }
.page { padding: 40px 0; }
.page-narrow { max-width: 480px; margin: 0 auto; padding: 40px 20px; }
.page-title { font-size: 28px; font-weight: 800; margin-bottom: 8px; letter-spacing: -.02em; }
.page-sub { color: var(--muted); font-size: 15px; margin-bottom: 32px; }

/* ── Card ──────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}
.card-sm { padding: 20px; }
.card-lg { padding: 40px; }

/* ── Buttons ───────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px;
  border-radius: 10px;
  font-size: 15px; font-weight: 600;
  cursor: pointer; border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 16px var(--teal-glow); }
.btn-outline { background: transparent; color: var(--teal-dark); border: 2px solid var(--teal); }
.btn-outline:hover { background: var(--teal-light); }
.btn-ghost { background: var(--bg); color: var(--text); }
.btn-ghost:hover { background: var(--border); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 7px 16px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-full { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ── Forms ─────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.form-input {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-glow);
}
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }
.form-hint  { font-size: 12px; color: var(--muted); margin-top: 4px; }
.form-input-error { border-color: var(--danger) !important; }

.checkbox-row { display: flex; align-items: center; gap: 10px; }
.checkbox-row input[type=checkbox] { accent-color: var(--teal); width: 16px; height: 16px; }

/* ── Alerts ────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 20px;
  display: flex; align-items: flex-start; gap: 10px;
}
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* ── Hero ──────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 80px 20px 60px;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--teal-light); color: var(--teal-dark);
  font-size: 13px; font-weight: 600;
  padding: 6px 14px; border-radius: 20px;
  margin-bottom: 24px;
}
.hero h1 {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 18px;
  color: var(--text);
}
.hero h1 span { color: var(--teal); }
.hero-sub { font-size: 18px; color: var(--muted); max-width: 520px; margin: 0 auto 36px; }
.hero-ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── Features ──────────────────────────────────────── */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  padding: 20px 0 60px;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform var(--transition), box-shadow var(--transition);
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.feature-icon { font-size: 32px; margin-bottom: 12px; }
.feature-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.feature-desc { font-size: 14px; color: var(--muted); line-height: 1.5; }

/* ── Stats ─────────────────────────────────────────── */
.stats-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 32px; }
.stat-card {
  flex: 1; min-width: 110px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
  transition: box-shadow var(--transition), transform var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.stat-value { font-size: 28px; font-weight: 800; color: var(--teal-dark); letter-spacing: -.02em; }
.stat-label { font-size: 12px; font-weight: 500; color: var(--muted); margin-top: 2px; text-transform: uppercase; letter-spacing: .04em; }

/* ── Progress bar ──────────────────────────────────── */
.progress-bar { background: var(--border); border-radius: 99px; height: 8px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--teal); border-radius: 99px; transition: width .5s ease; }

/* ── XP / Level badge ──────────────────────────────── */
.level-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--teal-light); color: var(--teal-dark);
  font-size: 13px; font-weight: 700;
  padding: 4px 12px; border-radius: 20px;
}

/* ── Vocab card (learn/quiz) ────────────────────────── */
.vocab-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 32px;
  text-align: center;
  box-shadow: var(--shadow);
  max-width: 560px;
  margin: 0 auto;
}
.vocab-word {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.2;
}
.vocab-word[dir=rtl] { font-size: clamp(32px, 5vw, 52px); font-family: 'Noto Naskh Arabic', serif; }
.vocab-translit { font-size: 15px; color: var(--muted); font-style: italic; margin-bottom: 18px; }
#learn-card .vocab-translit { margin-bottom: 10px; }
.category-hint-btn { background: none; border: 1px dashed var(--border); color: var(--muted); font-size: 11px; padding: 2px 10px; border-radius: 20px; cursor: pointer; margin-bottom: 24px; transition: opacity .15s; }
.category-hint-btn:hover { opacity: .7; }
.vocab-category { display: inline-block; background: var(--teal-light); color: var(--teal-dark); font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 20px; margin-bottom: 24px; }

/* ── Quiz options ───────────────────────────────────── */
.quiz-options { display: grid; gap: 12px; margin-top: 28px; }
.quiz-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 16px 20px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  font-size: 18px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition);
}
.quiz-option:hover { border-color: var(--teal); background: var(--teal-light); }
.quiz-option.correct { border-color: var(--success); background: #f0fdf4; color: #166534; }
.quiz-option.wrong   { border-color: var(--danger);  background: #fef2f2; color: #991b1b; }

/* ── Quiz page : mode cards & catégorie chips ───────── */
.mode-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.mode-card {
  display: flex; flex-direction: column;
  padding: 18px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  color: var(--text);
  transition: all var(--transition);
}
.mode-card:hover { border-color: var(--teal); transform: translateY(-2px); box-shadow: var(--shadow); color: var(--text); }
.mode-card.active { border-color: var(--teal); background: var(--teal-light); }
.mode-card-locked { opacity: .75; border-style: dashed; cursor: pointer; }
.mode-card-locked:hover { border-color: #f59e0b; transform: translateY(-2px); box-shadow: var(--shadow); }
.mode-card-premium-badge { position: absolute; top: -10px; right: 12px; background: #f59e0b; color: #fff; font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 20px; letter-spacing: .03em; }
.mode-card { position: relative; }
.mode-card-icon { font-size: 28px; margin-bottom: 10px; }
.mode-card-name { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.mode-card-desc { font-size: 12px; color: var(--muted); flex: 1; margin-bottom: 12px; line-height: 1.4; }
.mode-card-footer { display: flex; align-items: center; gap: 8px; }
.diff-badge { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 2px 8px; border-radius: 20px; }
.diff-easy   { color: var(--teal-dark); background: var(--teal-light); }
.diff-medium { color: #b45309; background: #fef3c7; }
.diff-hard   { color: #7c3aed; background: #ede9fe; }
.mode-xp { font-size: 12px; font-weight: 600; color: var(--muted); }
.section-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin-bottom: 10px; }
.cat-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.cat-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  background: var(--surface);
  transition: all var(--transition);
  white-space: nowrap;
}
.cat-chip:hover { border-color: var(--teal); color: var(--teal-dark); background: var(--teal-light); }
.cat-chip.active { border-color: var(--teal); color: var(--teal-dark); background: var(--teal-light); font-weight: 600; }
.cat-chip-count { font-size: 11px; opacity: .55; }
@media (max-width: 640px) {
  .mode-cards { gap: 8px; }
  .mode-card { padding: 12px; }
  .mode-card-desc { display: none; }
}

/* ── Leaderboard ────────────────────────────────────── */
.leaderboard-row {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.leaderboard-row:last-child { border: none; }
.lb-rank { width: 32px; font-weight: 800; font-size: 16px; color: var(--muted); text-align: center; }
.lb-rank.top-1 { color: #f59e0b; font-size: 20px; }
.lb-rank.top-2 { color: #9ca3af; font-size: 18px; }
.lb-rank.top-3 { color: #b45309; font-size: 17px; }
.lb-user { flex: 1; font-weight: 600; }
.lb-xp { color: var(--teal-dark); font-weight: 700; font-size: 14px; }

/* ── Badges ─────────────────────────────────────────── */
.badges-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.badge-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
}
.badge-item.earned { border-color: var(--teal); background: var(--teal-light); }
.badge-icon { font-size: 24px; }
.badge-name { font-weight: 600; }
.badge-desc { font-size: 12px; color: var(--muted); }

/* ── Language selector ──────────────────────────────── */
.lang-cards { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 32px; }
.lang-card {
  flex: 1; min-width: 160px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--surface);
}
.lang-card:hover { border-color: var(--teal); transform: translateY(-2px); }
.lang-card.active { border-color: var(--teal); background: var(--teal-light); }
.lang-flag { font-size: 40px; margin-bottom: 8px; }
.lang-name { font-weight: 700; font-size: 15px; }
.lang-native { font-size: 13px; color: var(--muted); }

/* ── Footer ─────────────────────────────────────────── */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 20px 0;
  margin-top: auto;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--teal); }

/* ── Divider ─────────────────────────────────────────── */
.divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--muted); font-size: 13px;
  margin: 20px 0;
}
.divider::before, .divider::after {
  content: ''; flex: 1; border-top: 1px solid var(--border);
}

/* ── Animations ──────────────────────────────────────── */
@keyframes fadeIn { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:none; } }
@keyframes pop    { 0%,100% { transform:scale(1); } 50% { transform:scale(1.08); } }
@keyframes shake  { 0%,100% { transform:translateX(0); } 25% { transform:translateX(-6px); } 75% { transform:translateX(6px); } }

.fade-in   { animation: fadeIn .4s ease both; }
.pop       { animation: pop .3s ease; }
.shake     { animation: shake .3s ease; }

/* ── Vocabulary page ─────────────────────────────────── */
.vl-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }
.vl-tab {
  padding: 8px 18px;
  border-radius: 20px;
  border: 2px solid var(--border);
  background: var(--surface);
  font-size: 14px; font-weight: 600;
  cursor: pointer; color: var(--muted);
  text-decoration: none;
  transition: all var(--transition);
  display: inline-flex; align-items: center; gap: 6px;
}
.vl-tab:hover { border-color: var(--teal); color: var(--teal-dark); }
.vl-tab.active { border-color: var(--teal); background: var(--teal-light); color: var(--teal-dark); }

.vl-filters {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex; flex-direction: column; gap: 14px;
  position: sticky;
  top: 61px;
  z-index: 10;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.vl-search-wrap { position: relative; }
.vl-search-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.vl-search {
  width: 100%; padding: 10px 14px 10px 38px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.vl-search:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-glow); }
.vl-filter-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.vl-filter-label { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.vl-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.vl-chip {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: transparent;
  font-size: 12px; font-weight: 600;
  cursor: pointer; color: var(--muted);
  transition: all var(--transition);
}
.vl-chip:hover { border-color: var(--teal); color: var(--teal-dark); }
.vl-chip.active { border-color: var(--teal); background: var(--teal-light); color: var(--teal-dark); }

.vl-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.vl-count { font-size: 13px; color: var(--muted); font-weight: 500; }

.vl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}
.vl-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.04);
  display: flex; flex-direction: column; gap: 8px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  animation: fadeIn .3s ease both;
  position: relative;
  overflow: hidden;
}
.vl-item::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--border);
  border-radius: 16px 0 0 16px;
}
.vl-item:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(0,0,0,.1), 0 2px 8px rgba(0,0,0,.06); border-color: var(--teal-light); }

/* Accent couleur par statut */
.vl-item[data-due=1]::before                              { background: #d97706; }
.vl-item[data-status=new]::before                         { background: #9ca3af; }
.vl-item[data-status=learning]:not([data-due=1])::before  { background: var(--teal); }
.vl-item[data-status=learned]:not([data-due=1])::before   { background: #16a34a; }
.vl-item[data-status=mastered]:not([data-due=1])::before  { background: #7c3aed; }
.vl-item-top { display: flex; align-items: center; justify-content: space-between; }
.vl-badge {
  font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: 20px;
  letter-spacing: .03em;
}
.vl-badge-new      { background: #f3f4f6; color: #4b5563; }
.vl-badge-learning { background: var(--teal-light); color: var(--teal-dark); }
.vl-badge-learned  { background: #f0fdf4; color: #166534; }
.vl-badge-mastered { background: #ede9fe; color: #6d28d9; }
.vl-badge-due      { background: #fffbeb; color: #92400e; }
.vl-badge-hard     { background: #fef2f2; color: #b91c1c; border: 1px solid #fca5a5; }
.vl-word {
  font-size: clamp(20px, 2.8vw, 26px);
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  letter-spacing: -.02em;
}
.vl-word[dir=rtl] {
  font-family: 'Noto Naskh Arabic', serif;
  text-align: right;
  letter-spacing: 0;
  font-size: clamp(22px, 3vw, 30px);
}
.vl-translit { font-size: 12px; color: var(--muted); font-style: italic; letter-spacing: .01em; }
.vl-meaning { font-size: 14px; font-weight: 700; color: var(--teal-dark); margin-top: 2px; }
.vl-example {
  font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.55;
  border-top: 1px solid var(--border); padding-top: 8px;
  font-style: italic;
}
.vl-item-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto; padding-top: 10px;
  border-top: 1px solid var(--border);
}
.vl-cat {
  font-size: 11px; font-weight: 600;
  background: transparent; color: var(--muted);
  padding: 2px 8px; border-radius: 20px;
  border: 1px solid var(--border);
}
.audio-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--teal-light);
  color: var(--teal-dark);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}
.audio-btn:hover { background: var(--teal); color: #fff; transform: scale(1.08); box-shadow: 0 2px 10px var(--teal-glow); }
.audio-btn.playing { background: var(--teal); color: #fff; animation: pop .3s ease; }
.vl-fav-btn {
  background: none; border: none; cursor: pointer;
  width: 30px; height: 30px; padding: 0; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  color: var(--border); transition: color var(--transition), transform var(--transition);
  flex-shrink: 0; border-radius: 50%;
}
.vl-fav-btn:hover { color: #f59e0b; transform: scale(1.15); }
.vl-fav-btn.active { color: #f59e0b; }

/* ── Phrase d'exemple dans les quiz (MCQ / fill_blank) ─ */
.quiz-example {
  margin-top: 18px;
  padding: 10px 14px;
  background: var(--bg);
  border-left: 3px solid var(--teal);
  border-radius: 4px;
  font-size: 13px;
  text-align: left;
  line-height: 1.6;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  transition: border-left-color .15s, background .15s;
}
.quiz-example--held {
  border-left-color: var(--teal-dark);
  background: var(--teal-light);
}

.vl-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  grid-column: 1 / -1;
}
.vl-empty-icon { font-size: 48px; margin-bottom: 12px; }
.vl-empty h3 { font-size: 18px; color: var(--text); margin-bottom: 8px; }

/* ── View toggle ─────────────────────────────────────── */
.vl-view-toggle { display: flex; border: 1.5px solid var(--border); border-radius: 8px; overflow: hidden; }
.vl-view-btn {
  padding: 5px 9px; background: transparent; border: none; cursor: pointer;
  color: var(--muted); display: flex; align-items: center; justify-content: center;
  transition: all var(--transition); line-height: 1;
}
.vl-view-btn + .vl-view-btn { border-left: 1.5px solid var(--border); }
.vl-view-btn:hover { background: var(--bg); color: var(--text); }
.vl-view-btn.active { background: var(--teal-light); color: var(--teal-dark); }

/* ── Compact list view ───────────────────────────────── */
.vl-list { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.vl-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; min-height: 48px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  animation: fadeIn .15s ease both;
}
.vl-row:hover { background: var(--bg); }
.vl-row-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; cursor: help; }
.vl-row-body { flex: 1; min-width: 0; overflow: hidden; }
.vl-row-top { display: flex; align-items: baseline; gap: 6px; overflow: hidden; }
.vl-row-word {
  font-size: 15px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex-shrink: 0; max-width: 55%;
}
.vl-row-word[dir=rtl] { font-family: 'Noto Naskh Arabic', sans-serif; }
.vl-row-translit {
  font-size: 11px; color: var(--muted); font-style: italic;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.vl-row-tr {
  font-size: 13px; font-weight: 500; color: var(--teal-dark);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px;
}
.vl-row-audio { flex-shrink: 0; }
.vl-list-empty { padding: 40px 20px; text-align: center; color: var(--muted); font-size: 14px; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-burger { display: flex; }
  .hero { padding: 50px 20px 40px; }
  .vocab-card { padding: 20px; }
  .stats-row { gap: 8px; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 22px; }
  .vl-grid { grid-template-columns: 1fr; }
  /* Point 3 — vocabulaire mobile : désactive le sticky pour libérer le scroll */
  .vl-filters { position: static; box-shadow: none; }
}

/* ── Mot de passe toggle (Point 7) ───────────────────── */
.pwd-wrap { position: relative; }
.pwd-wrap .form-input { padding-right: 42px; }
.pwd-toggle {
  position: absolute; right: 10px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none; padding: 4px 6px;
  cursor: pointer; color: var(--muted); line-height: 1;
}
.pwd-toggle:hover { color: var(--text); }

/* ── Mode sombre ─────────────────────────────────────── */
[data-theme='dark'] {
  --bg:       #0f1117;
  --surface:  #1a1d27;
  --border:   #2d3143;
  --text:     #e5e7eb;
  --muted:    #9ca3af;
  --teal-light: #0f3d38;
  --shadow:   0 2px 16px rgba(0,0,0,.4);
  --shadow-lg:0 8px 40px rgba(0,0,0,.5);
}
[data-theme='dark'] .nav { background: var(--surface); border-color: var(--border); }
[data-theme='dark'] .card { background: var(--surface); border-color: var(--border); }
[data-theme='dark'] .vocab-card { background: var(--surface); border-color: var(--border); }
[data-theme='dark'] .form-input { background: var(--bg); border-color: var(--border); color: var(--text); }
[data-theme='dark'] .btn-ghost { border-color: var(--border); color: var(--text); }
[data-theme='dark'] .vl-cat { background: transparent; border-color: var(--border); }
[data-theme='dark'] .vl-item { box-shadow: 0 1px 3px rgba(0,0,0,.3), 0 4px 12px rgba(0,0,0,.2); }
[data-theme='dark'] .vl-item:hover { border-color: rgba(45,212,191,.3); box-shadow: 0 8px 28px rgba(0,0,0,.4); }
[data-theme='dark'] .vl-item::before { opacity: .8; }
[data-theme='dark'] .audio-btn { background: rgba(45,212,191,.12); color: var(--teal); }
[data-theme='dark'] .audio-btn:hover { background: var(--teal); color: #fff; }
[data-theme='dark'] .vl-filters { box-shadow: 0 2px 12px rgba(0,0,0,.3); }
[data-theme='dark'] .stat-card { background: var(--surface); border-color: var(--border); }
[data-theme='dark'] .footer { background: var(--surface); border-color: var(--border); }
[data-theme='dark'] .quiz-option { background: var(--surface); border-color: var(--border); color: var(--text); }
[data-theme='dark'] .mode-card { background: var(--surface); border-color: var(--border); color: var(--text); }
[data-theme='dark'] .mode-card.active { background: rgba(45,212,191,.12); }
[data-theme='dark'] .cat-chip { background: var(--surface); border-color: var(--border); color: var(--muted); }
[data-theme='dark'] .cat-chip.active,
[data-theme='dark'] .cat-chip:hover { background: rgba(45,212,191,.12); border-color: var(--teal); color: var(--teal); }
[data-theme='dark'] .nav-mobile { background: var(--surface); }
[data-theme='dark'] .hero { background: linear-gradient(135deg, #0f1117 0%, #1a1d27 100%); }

/* ── Mode fill_blank ─────────────────────────────────── */
.fill-input {
  width: 100%; padding: 14px 18px;
  font-size: 18px; font-weight: 600;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-align: center;
  outline: none;
  transition: border-color var(--transition);
}
.fill-input:focus { border-color: var(--teal); }
.fill-input.correct { border-color: var(--success); background: rgba(34,197,94,.08); }
.fill-input.wrong   { border-color: var(--danger);  background: rgba(239,68,68,.08); }
.fill-hint { font-size: 13px; color: var(--muted); margin-top: 8px; }

/* ── Récapitulatif de fin de session ─────────────────── */
.session-summary {
  background: var(--teal-light);
  border-radius: var(--radius);
  padding: 20px;
  margin: 20px 0;
  text-align: left;
}
.session-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}
.ss-cell { text-align: center; }
.ss-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--teal-dark);
  line-height: 1.2;
}
.ss-label { font-size: 11px; color: var(--muted); margin-top: 2px; }
.ss-progress-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.ss-progress-sub   { font-size: 11px; color: var(--muted); margin-top: 4px; text-align: right; }
[data-theme='dark'] .session-summary { background: rgba(45,212,191,.1); }

/* ── Mode Matching ───────────────────────────────────── */
.vocab-card--match { max-width: 720px; padding: 32px 28px; }

/* En-têtes de colonnes — même grille que .match-grid pour un alignement parfait */
.match-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 24px;
  margin-bottom: 12px;
}
.match-col-label {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.match-col-label--native {
  border-color: var(--teal);
  color: var(--teal-dark);
  background: var(--teal-light);
}

/*
 * Grille plate : chaque .match-item est un enfant direct → CSS Grid aligne
 * left[i] et right[i] dans la même rangée → hauteurs synchronisées automatiquement.
 */
.match-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 24px;
  align-items: stretch;
  position: relative;
}
.match-grid::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
  transform: translateX(-50%);
  pointer-events: none;
}

/* Cellule individuelle — display:flex pour que .match-btn s'étire à la hauteur de rangée */
.match-item {
  position: relative;
  display: flex;
  min-height: 0;
}
.match-item--audio .match-btn { padding-right: 38px; }

/* Audio btn en absolu dans la cellule : ne perturbe pas la largeur du bouton */
.match-item .audio-btn {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  font-size: 11px;
  z-index: 1;
  padding: 0;
  border-radius: 6px;
}

/* Bouton mot — flex:1 pour remplir toute la hauteur de la cellule grid */
.match-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 3px;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  text-align: center;
  word-break: break-word;
  min-height: 56px;
  min-width: 0;
  line-height: 1.35;
}
.match-btn-text { display: block; }
.match-btn[dir=rtl] .match-btn-text { font-family: 'Noto Naskh Arabic', serif; font-size: 17px; }
.match-btn-translit { font-size: 11px; font-weight: 400; color: var(--muted); font-style: italic; }
.match-btn:hover:not(:disabled) { border-color: var(--teal); }
.match-btn.selected { border-color: var(--teal); background: var(--teal-light); }
.match-btn.correct  { border-color: var(--success); background: rgba(34,197,94,.1); color: var(--success); cursor: default; }
.match-btn.wrong    { border-color: var(--danger); background: rgba(239,68,68,.1); animation: shake .4s; }
[data-theme='dark'] .match-btn { background: var(--surface); border-color: var(--border); color: var(--text); }

/* ── Quiz options avec translittération ─────────────── */
.quiz-opt-word   { display: block; line-height: 1.35; }
.quiz-opt-word[dir=rtl] { width: 100%; text-align: right; font-family: 'Noto Naskh Arabic', serif; font-size: 22px; }
.quiz-opt-translit { font-size: 14px; font-style: italic; color: var(--muted); font-weight: 400; }

@media (max-width: 640px) {
  .quiz-option { font-size: 16px; padding: 13px 16px; }
  .quiz-opt-word[dir=rtl] { font-size: 19px; }
  .quiz-opt-translit { font-size: 13px; }
}

/* ── Matching responsive ─────────────────────────────── */
@media (max-width: 768px) {
  .vocab-card--match { padding: 24px 20px; }
  .match-grid   { gap: 8px 16px; }
  .match-header { column-gap: 16px; }
}
@media (max-width: 640px) {
  .vocab-card--match { padding: 16px 12px; }
  .match-grid   { gap: 7px 12px; }
  .match-header { column-gap: 12px; margin-bottom: 8px; }
  .match-col-label { font-size: 10px; padding: 4px 6px; letter-spacing: 0.04em; }
  .match-btn { font-size: 13px; padding: 10px 10px; min-height: 48px; }
  .match-btn[dir=rtl] .match-btn-text { font-size: 15px; }
  .match-item--audio .match-btn { padding-right: 32px; }
  .match-item .audio-btn { width: 22px; height: 22px; font-size: 10px; right: 4px; }
}
@media (max-width: 400px) {
  .vocab-card--match { padding: 12px 8px; }
  .match-btn { font-size: 12px; padding: 8px 8px; min-height: 44px; }
  .match-col-label { letter-spacing: 0; }
}

/* ── Review count badge (learn.php) ─────────────────── */
.review-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 99px;
  line-height: 1;
}

/* ── SRS info block (learn.php) ─────────────────────── */
.srs-info-block {
  margin: 0 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text);
}
.srs-info-block summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--teal-dark);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.srs-info-block summary::before { content: 'ℹ️'; }
.srs-info-block[open] summary   { margin-bottom: 12px; }
.srs-info-block p               { color: var(--muted); margin: 0 0 10px; line-height: 1.6; }
.srs-steps-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 10px;
}
.srs-step-pill {
  display: flex;
  flex-direction: column;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  flex: 1;
  min-width: 100px;
}
.srs-step-pill span { font-size: 11px; font-weight: 400; margin-top: 2px; opacity: .8; }
.srs-pill-learning  { background: var(--teal-light); color: var(--teal-dark); }
.srs-pill-learned   { background: #f0fdf4; color: #166534; }
.srs-pill-mastered  { background: #ede9fe; color: #6d28d9; }

/* ── SRS legend block (vocabulaire.php) ─────────────── */
.srs-legend-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px 16px;
  font-size: 13px;
}
.srs-legend-block summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
  list-style: none;
}
.srs-legend-block summary::before { content: '❔ '; }
.srs-legend-block[open] summary   { margin-bottom: 10px; }
.srs-legend-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.srs-legend-grid > div {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}
.srs-legend-grid .vl-badge { flex-shrink: 0; }

/* ── Next review date on vocab cards ────────────────── */
.vl-item-foot-right { margin-left: auto; }
.vl-next-review {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
}
.vl-reschedule-btn {
  background: none; border: none; cursor: pointer; font-size: 13px; padding: 0 2px;
  opacity: .5; transition: opacity .15s; line-height: 1;
}
.vl-reschedule-btn:hover { opacity: 1; }
.vl-reschedule-btn:disabled { opacity: .25; cursor: default; }

/* ── Mastered-due badge ─────────────────────────────── */
.vl-badge-mastered-due { background: #f3e8ff; color: #7c3aed; border: 1px solid #c4b5fd; }

[data-theme='dark'] .srs-info-block,
[data-theme='dark'] .srs-legend-block { background: var(--surface); border-color: var(--border); }
[data-theme='dark'] .srs-pill-learned  { background: rgba(34,197,94,.1); color: #4ade80; }
[data-theme='dark'] .srs-pill-mastered { background: rgba(139,92,246,.15); color: #a78bfa; }

/* ── Onboarding language selector ───────────────────── */
.ob-lang-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition), background var(--transition);
}
.ob-lang-label:hover { border-color: var(--teal); }
.ob-lang-label:has(input:checked) { border-color: var(--teal); background: var(--teal-light); }
[data-theme='dark'] .ob-lang-label:has(input:checked) { background: rgba(45,212,191,.12); }

/* ── Status cards & banners (pratique.php) ───────────── */
.status-card { padding: 20px; cursor: pointer; height: 100%; transition: box-shadow var(--transition); }
.status-card:hover { box-shadow: var(--shadow); }
.status-card-learning { border-left: 4px solid #7dd3fc; }
.status-card-learned  { border-left: 4px solid #86efac; }
.status-card-mastered { border-left: 4px solid #d8b4fe; }
.status-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.status-count { font-size: 28px; font-weight: 800; line-height: 1; }
.status-sub   { font-size: 12px; color: var(--muted); margin-top: 4px; }
.status-label-learning, .status-count-learning { color: #0369a1; }
.status-label-learned,  .status-count-learned  { color: #166534; }
.status-label-mastered, .status-count-mastered { color: #7e22ce; }
.status-banner { border-radius: var(--radius); padding: 10px 16px; font-size: 13px; margin-bottom: 16px; border: 1px solid; }
.status-banner-learning { background: #e0f2fe; border-color: #7dd3fc; color: #0369a1; }
.status-banner-learned  { background: #dcfce7; border-color: #86efac; color: #166534; }
.status-banner-mastered { background: #f3e8ff; border-color: #d8b4fe; color: #7e22ce; }
.status-banner-reinforcement { background: #dbeafe; border-color: #93c5fd; color: #1e40af; }
.status-banner-maintenance   { background: #f3f4f6; border-color: #d1d5db; color: #374151; }
.status-banner-bonus         { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }
[data-theme='dark'] .status-label-learning, [data-theme='dark'] .status-count-learning { color: #38bdf8; }
[data-theme='dark'] .status-label-learned,  [data-theme='dark'] .status-count-learned  { color: #4ade80; }
[data-theme='dark'] .status-label-mastered, [data-theme='dark'] .status-count-mastered { color: #a78bfa; }
[data-theme='dark'] .status-banner-learning { background: rgba(14,165,233,.12); border-color: #0284c7; color: #38bdf8; }
[data-theme='dark'] .status-banner-learned  { background: rgba(34,197,94,.10);  border-color: #15803d; color: #4ade80; }
[data-theme='dark'] .status-banner-mastered { background: rgba(139,92,246,.12); border-color: #7c3aed; color: #a78bfa; }
[data-theme='dark'] .status-banner-reinforcement { background: rgba(59,130,246,.12); border-color: #1d4ed8; color: #60a5fa; }
[data-theme='dark'] .status-banner-maintenance   { background: var(--surface); border-color: var(--border); color: var(--muted); }
[data-theme='dark'] .status-banner-bonus         { background: rgba(249,115,22,.10); border-color: #c2410c; color: #fb923c; }

/* ── Index page — app mobile section ────────────────── */
.app-mobile-box    { padding: 40px 44px; }
.app-mobile-main   { flex: 1; min-width: 260px; }
.app-mobile-feats  { display: flex; flex-direction: column; gap: 12px; min-width: 220px; flex-shrink: 0; }

@media (max-width: 640px) {
  .app-mobile-box   { padding: 24px 20px; }
  .app-mobile-main  { min-width: 0; }
  .app-mobile-feats { min-width: 0; flex-shrink: 1; width: 100%; }
}

/* ── Section "Retenez vraiment" — courbe de l'oubli ─── */
/* Deux cartes comparatives — empilées sur mobile */
.srs-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 56px;
}

@media (max-width: 640px) {
  .srs-compare-grid { grid-template-columns: 1fr; gap: 16px; margin-bottom: 36px; }
}

/* Marqueurs de révision J+ dans la carte "Avec VocaBag" */
.srs-review-label {
  font-size: 9px; color: var(--teal-dark); font-weight: 700; white-space: nowrap;
}
@media (max-width: 640px) {
  .srs-review-label { font-size: 10px; }
}

/* ── Parcours 4 étapes — 4 cols desktop, 2 cols mobile ── */
.srs-journey-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-bottom: 56px;
  position: relative;
}
/* Flèche de fond (desktop seulement) */
.srs-journey-arrow {
  position: absolute; top: 36px; left: 12%; right: 12%; height: 2px;
  background: linear-gradient(90deg, var(--border), var(--teal), var(--border));
  z-index: 0;
}

@media (max-width: 640px) {
  .srs-journey-grid  { grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 36px; }
  .srs-journey-arrow { display: none; }
}

/* ── Section stats recherche — 3 cols auto-fit ───────── */
.srs-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 56px;
}
@media (max-width: 640px) {
  .srs-stats-grid { grid-template-columns: 1fr; gap: 12px; margin-bottom: 36px; }
}

/* ── Section "Vous décidez" — 2 cols / 1 col mobile ──── */
.srs-decide-box   { padding: 36px 32px; }
.srs-decide-grid  { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

@media (max-width: 640px) {
  .srs-decide-box  { padding: 24px 20px; }
  .srs-decide-grid { grid-template-columns: 1fr; gap: 20px; }
}

/* ── Image mot (learn.php uniquement) ─────────────────── */
:root {
  --card-pad-v: 48px;
  --card-pad-h: 32px;
}
@media (max-width: 640px) {
  :root { --card-pad-v: 20px; --card-pad-h: 20px; }
}
.learn-img-wrap {
  margin: calc(-1 * var(--card-pad-v)) calc(-1 * var(--card-pad-h)) 20px;
  border-radius: 20px 20px 0 0;
  overflow: hidden;
  height: 200px;
  background: var(--border);
}
.learn-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity .3s;
}
@media (max-width: 640px) {
  .learn-img-wrap { height: 160px; }
}

/* ── Grade-up popup ──────────────────────────────────────── */
#grade-up-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.72);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: guFadeIn .35s ease both;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
}
@keyframes guFadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes guFadeOut { from { opacity: 1 } to { opacity: 0 } }

.gu-card {
  position: relative; overflow: hidden;
  max-width: 380px; width: 100%;
  border-radius: 28px; padding: 36px 28px 24px;
  text-align: center; cursor: default;
  animation: guSlideUp .5s cubic-bezier(.34,1.56,.64,1) both;
  box-shadow: 0 40px 90px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.1);
}
@keyframes guSlideUp {
  from { transform: translateY(48px) scale(.88); opacity: 0 }
  to   { transform: translateY(0)    scale(1);   opacity: 1 }
}
.gu-guild-label {
  font-size: 11px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: rgba(255,255,255,.6); margin-bottom: 6px;
}
.gu-title {
  font-size: 26px; font-weight: 900; color: #fff;
  letter-spacing: -.02em; margin-bottom: 28px; line-height: 1.2;
}
.gu-grades {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  margin-bottom: 22px;
}
.gu-grade-old, .gu-grade-new {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.gu-grade-old .gu-emoji { font-size: 38px; opacity: .45;
  animation: guOldOut .6s ease both; }
@keyframes guOldOut {
  from { transform: scale(1.1); opacity: .8 }
  to   { transform: scale(.85); opacity: .45 }
}
.gu-grade-new .gu-emoji {
  font-size: 60px; line-height: 1;
  animation: guNewIn .7s cubic-bezier(.34,1.56,.64,1) .2s both, guPulse 2s ease 1s infinite;
  filter: drop-shadow(0 0 16px rgba(255,255,255,.45));
}
@keyframes guNewIn {
  from { transform: scale(.4); opacity: 0 }
  to   { transform: scale(1);  opacity: 1 }
}
@keyframes guPulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.07); }
}
.gu-grade-old .gu-name { font-size: 12px; color: rgba(255,255,255,.45); font-weight: 600; }
.gu-grade-new .gu-name { font-size: 20px; color: #fff; font-weight: 900; letter-spacing: -.01em; }
.gu-arrow { font-size: 22px; color: rgba(255,255,255,.35); flex-shrink: 0; }
.gu-rank  { font-size: 12px; color: rgba(255,255,255,.55); margin-bottom: 20px; }
.gu-btn {
  background: rgba(255,255,255,.18); border: 1.5px solid rgba(255,255,255,.35);
  color: #fff; font-weight: 700; font-size: 15px;
  padding: 13px 32px; border-radius: 99px; cursor: pointer;
  width: 100%; margin-bottom: 14px; transition: background .15s;
}
.gu-btn:hover, .gu-btn:active { background: rgba(255,255,255,.28); }
.gu-countdown-bar { height: 3px; background: rgba(255,255,255,.18); border-radius: 99px; overflow: hidden; }
.gu-countdown-fill {
  height: 100%; background: rgba(255,255,255,.55); border-radius: 99px;
  animation: guCountdown 5s linear forwards;
}
@keyframes guCountdown { from { width: 0% } to { width: 100% } }

/* Particules flottantes */
.gu-particle {
  position: absolute; border-radius: 50%;
  background: rgba(255,255,255,.45);
  pointer-events: none;
  animation: guParticle 3.5s ease-in infinite;
}
@keyframes guParticle {
  0%   { transform: translateY(0)     scale(1);   opacity: .8 }
  100% { transform: translateY(-220px) scale(.2); opacity: 0  }
}
.gu-particle:nth-child(1)  { width:7px;height:7px; left:8%;  bottom:12%; animation-delay:.0s; }
.gu-particle:nth-child(2)  { width:4px;height:4px; left:18%; bottom:20%; animation-delay:.4s; }
.gu-particle:nth-child(3)  { width:6px;height:6px; left:78%; bottom:8%;  animation-delay:.7s; }
.gu-particle:nth-child(4)  { width:9px;height:9px; left:65%; bottom:5%;  animation-delay:1.1s; }
.gu-particle:nth-child(5)  { width:5px;height:5px; left:50%; bottom:2%;  animation-delay:.25s; }
.gu-particle:nth-child(6)  { width:4px;height:4px; left:35%; bottom:15%; animation-delay:1.4s; }
.gu-particle:nth-child(7)  { width:6px;height:6px; left:88%; bottom:22%; animation-delay:.55s; }
.gu-particle:nth-child(8)  { width:5px;height:5px; left:58%; bottom:10%; animation-delay:1.8s; }
.gu-particle:nth-child(9)  { width:3px;height:3px; left:28%; bottom:25%; animation-delay:.9s; }
.gu-particle:nth-child(10) { width:7px;height:7px; left:45%; bottom:18%; animation-delay:2.1s; }

/* Mobile */
@media (max-width: 480px) {
  .gu-card { padding: 28px 20px 20px; border-radius: 22px; }
  .gu-title { font-size: 22px; }
  .gu-grade-new .gu-emoji { font-size: 50px; }
  .gu-grade-old .gu-emoji { font-size: 32px; }
  .gu-grade-new .gu-name  { font-size: 18px; }
}

/* Grilles grades (index.php + abonnement.php) */
#grades-grid    { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
#ab-grades-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 860px) {
  #grades-grid, #ab-grades-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  #grades-grid    { gap: 8px; }
  #ab-grades-grid { gap: 8px; }
}

/* ── Mode daltonien — icônes ✓/✗ sur les options quiz ─── */
.quiz-option[data-colorblind-hint]::after {
  content: attr(data-colorblind-hint);
  position: absolute;
  top: 6px; right: 8px;
  font-size: 13px;
  font-weight: 800;
  pointer-events: none;
}
.quiz-option { position: relative; }

/* ── Font-size dynamique (appliqué depuis PHP via style sur <html>) ── */
body { font-size: var(--font-base, 16px); }

/* ── Combo flamme animation ─────────────────────────────── */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.7; transform: scale(1.05); }
}
