/* ════════════════════════════════════════════════════════════════════════
   80% Quran Words — design « éditorial / manuscrit »
   Papier & encre, typographie soignée, une seule couleur d'accent.
   Aucun néon, aucun glow, aucun dégradé criard.
═══════════════════════════════════════════════════════════════════════════ */

:root {
  --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-ar: 'Amiri', 'Scheherazade New', 'Geeza Pro', serif;
  --font-title: 'Oswald', 'Plus Jakarta Sans', sans-serif;

  /* Thème clair — clean & moderne (blanc + vert) */
  --paper: #FFFFFF;          /* fond de page blanc pur */
  --paper-2: #F4F3EF;
  --surface: #FFFFFF;        /* cartes */
  --ink: #18181B;
  --ink-2: #52525B;
  --muted: #6B6B73;          /* gris lisible (~4.5:1 sur blanc) */
  --line: #ECEAE3;
  --line-2: #DFDDD3;
  --brown: #18181B;          /* en-tête de section sobre (réutilisé) */
  --brown-ink: #FFFFFF;
  --accent: #12A06B;         /* vert moderne, propre */
  --accent-2: #0E875A;
  --accent-tint: #E6F5EE;
  --gold: #D99A2B;           /* ambre clair — fonds / icônes / bordures */
  --gold-text: #B0801E;      /* ambre foncé lisible — pour le TEXTE (XP, etc.) */
  --gold-tint: #FBF1DC;
  --clay: #DC4B3E;           /* rouge moderne — à revoir / faux */
  --clay-tint: #FCE9E6;
  /* Élévation : 3 niveaux nets mais doux (repos / cartes / survol) */
  --shadow-sm: 0 1px 2px rgba(16,24,40,.05), 0 2px 6px -2px rgba(16,24,40,.08);
  --shadow: 0 2px 4px rgba(16,24,40,.05), 0 10px 22px -10px rgba(16,24,40,.16);
  --shadow-lg: 0 6px 12px rgba(16,24,40,.07), 0 28px 52px -18px rgba(16,24,40,.26);
  --accent-grad: linear-gradient(135deg, #18B27B, #0C875A);
  /* Border-radius unifiés : petit / moyen / grand */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius: 22px;

  /* Alias requis par le JS */
  --emerald: var(--accent);
  --coral: var(--clay);
}

html[dir="rtl"] body { text-align: right; }
html[dir="rtl"] .icon-btn .ico { transform: scaleX(-1); }
html[dir="rtl"] .hm-cta-chev { transform: scaleX(-1); }
html[dir="rtl"] .setting-row,
html[dir="rtl"] .hm-sec-h,
html[dir="rtl"] .theme-card-header,
html[dir="rtl"] .theme-card-footer { direction: rtl; }
html[dir="rtl"] .write-input { text-align: right; }

[data-theme="dark"] {
  --paper: #121214;
  --paper-2: #1A1A1D;
  --surface: #1C1C20;
  --ink: #F4F4F5;
  --ink-2: #C4C4CC;
  --muted: #8A8A93;
  --line: #2A2A2F;
  --line-2: #3A3A42;
  --brown: #F4F4F5;
  --brown-ink: #18181B;
  --accent: #2BB37D;
  --accent-2: #3FC78F;
  --accent-tint: #15271F;
  --gold: #D9A94E;
  --gold-text: #E1B968;
  --gold-tint: #261F12;
  --clay: #E0685A;
  --clay-tint: #2A1A17;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: var(--font-sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  padding-bottom: 72px; /* place pour la nav fixe */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); }

/* ── Accessibilité : focus clavier visible (global) ────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
/* Ne pas afficher l'anneau lors d'un clic souris sur les boutons */
:focus:not(:focus-visible) { outline: none; }

.ico {
  width: 1.25em; height: 1.25em;
  fill: none; stroke: currentColor;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  display: inline-block; vertical-align: middle;
}

/* ── Écrans & en-têtes ─────────────────────────────────────────────────── */

.screen {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 22px;
  animation: screen-in .35s ease both;
}
@keyframes screen-in { from { opacity: 0; transform: translateY(6px); } }

.app-header, .learn-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 0 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}

.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: .2px;
  margin: 0;
  flex: 1;
}
.brand-pct { color: var(--accent); font-style: italic; font-weight: 500; }

.screen-title {
  font-family: var(--font-title);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .01em;
  font-size: 1.85rem;
  margin: 0;
  flex: 1;
}

.icon-btn {
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--ink-2);
  width: 40px; height: 40px;
  border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.icon-btn:hover { background: var(--paper-2); color: var(--ink); }
.icon-btn .ico { width: 22px; height: 22px; }

.screen-main { padding-bottom: 24px; }

/* ── Accueil ───────────────────────────────────────────────────────────── */

.home-main { display: flex; flex-direction: column; gap: 26px; padding-bottom: 24px; }

.gamebar { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.gamebar-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 2px;
}
.streak-item { flex-direction: row; align-items: center; gap: 12px; flex-wrap: wrap; }
.gamebar-icon { color: var(--clay); width: 26px; height: 26px; }
.gamebar-value { font-family: var(--font-display); font-size: 1.7rem; font-weight: 600; line-height: 1; }
.gamebar-label { color: var(--muted); font-size: .82rem; }
.xp-bar-wrap { width: 100%; margin-top: 8px; }
.xp-bar-track { height: 5px; background: var(--line); border-radius: 99px; overflow: hidden; }
.xp-bar-fill { height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .5s ease; }

.goal-ring-wrap { position: relative; width: 168px; height: 168px; margin: 4px auto 0; }
.goal-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--paper-2); stroke-width: 8.5; }
.ring-fill { fill: none; stroke: url(#ringGrad); stroke-width: 8.5; stroke-linecap: round; transition: stroke-dashoffset .8s cubic-bezier(.2,.8,.2,1); }
.goal-ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.goal-pct { font-family: var(--font-display); font-size: 2.1rem; font-weight: 600; }
.goal-label { color: var(--muted); font-size: .76rem; letter-spacing: .04em; }

.quick-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.quick-stat { background: var(--surface); padding: 16px 8px; text-align: center; display: flex; flex-direction: column; gap: 3px; }
.qs-num { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; }
.qs-label { color: var(--muted); font-size: .76rem; letter-spacing: .03em; }

/* ── Carte momentum (accueil) : série · niveau · objectif ──────────────── */
.home-hero-card {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44'%3E%3Cg fill='none' stroke='%2312A06B' stroke-opacity='0.06' stroke-width='1.1'%3E%3Ccircle cx='22' cy='22' r='21'/%3E%3Ccircle cx='0' cy='22' r='21'/%3E%3Ccircle cx='44' cy='22' r='21'/%3E%3Ccircle cx='22' cy='0' r='21'/%3E%3Ccircle cx='22' cy='44' r='21'/%3E%3C/g%3E%3C/svg%3E") var(--surface);
  border: 1px solid var(--line); border-radius: 22px;
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 30px; padding: 26px 30px; flex-wrap: wrap;
}
.hero-streak { display: flex; align-items: center; gap: 14px; }
.hero-streak .flame-icon { width: 24px; height: 24px; padding: 10px; box-sizing: content-box; color: var(--clay); background: var(--clay-tint); border-radius: 13px; }
.hero-streak-num { font-family: var(--font-display); font-size: 2.3rem; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.hero-streak-label { color: var(--muted); font-size: .8rem; line-height: 1.15; max-width: 68px; }
.hero-level { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 12px; padding-left: 30px; border-left: 1px solid var(--line); }
.hero-level-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.hero-level-name { font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; letter-spacing: -.01em; }
.hero-xp { color: var(--gold-text); font-weight: 700; font-size: .92rem; }
.hero-level .xp-bar-track { height: 7px; }
.home-hero-card .goal-ring-wrap { width: 96px; height: 96px; margin: 0; flex-shrink: 0; }
.home-hero-card .goal-pct { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; }
.home-hero-card .goal-label { font-size: .58rem; letter-spacing: .1em; text-transform: uppercase; }

/* ── Boutons ───────────────────────────────────────────────────────────── */

.btn {
  font-family: var(--font-sans);
  font-size: .98rem; font-weight: 600;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .05s ease, color .15s ease;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
}
.btn:active { transform: translateY(1px); }
.btn .ico { width: 19px; height: 19px; }

.btn-hero, .btn-primary { background: var(--accent-grad); color: #fff; width: 100%; box-shadow: 0 8px 20px -8px rgba(18,160,107,.5); }
.btn-hero:hover, .btn-primary:hover { filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 12px 26px -8px rgba(18,160,107,.55); }
.btn-hero { padding: 17px; font-size: 1.08rem; font-weight: 700; letter-spacing: -.01em; }

.btn-review, .btn-know { flex: 1; background: var(--surface); border-color: var(--line-2); }
.btn-review { color: var(--clay); }
.btn-review:hover { background: var(--clay-tint); border-color: var(--clay); }
.btn-know { color: var(--accent); }
.btn-know:hover { background: var(--accent-tint); border-color: var(--accent); }

.mode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 12px; }
.mode-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 20px 14px; display: flex; flex-direction: column; align-items: center; gap: 11px;
  cursor: pointer; text-align: center; box-shadow: var(--shadow-sm);
  transition: transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .18s ease, border-color .18s ease;
}
.mode-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: transparent; }
.mode-icon { width: 24px; height: 24px; padding: 11px; box-sizing: content-box; color: var(--accent); background: var(--accent-tint); border-radius: 13px; }
.mode-label { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; }
.mode-desc { color: var(--muted); font-size: .76rem; }

/* ── Apprentissage ─────────────────────────────────────────────────────── */

.learn-header { justify-content: space-between; }
.learn-header-info { display: flex; flex-direction: column; align-items: center; flex: 1; }
.learn-mode-title { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.learn-mastery { font-size: .76rem; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.learn-progress-text { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .9rem; min-width: 48px; text-align: right; }

.session-progress-track { height: 3px; background: var(--line); border-radius: 99px; overflow: hidden; margin-bottom: 30px; }
.session-progress-fill { height: 100%; width: 0; background: var(--accent); transition: width .4s ease; }

.learn-content { display: flex; flex-direction: column; gap: 18px; align-items: center; }

.mini-chip {
  font-size: .68rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
  border: 1px solid var(--line-2); border-radius: 99px; padding: 4px 12px;
}

.card-ar {
  font-family: var(--font-ar);
  font-size: clamp(3rem, 13vw, 4.6rem);
  line-height: 1.45; color: var(--ink); margin: 6px 0 0; text-align: center;
}
.card-ar-small { font-size: clamp(2.2rem, 9vw, 3.2rem); }
.card-translit { font-family: var(--font-display); font-style: italic; color: var(--muted); font-size: 1.1rem; margin: 0; }
.card-translit:empty { display: none; }
.card-answer { font-family: var(--font-display); font-size: 1.7rem; font-weight: 600; margin: 8px 0 0; text-align: center; }
.flip-hint { color: var(--muted); font-size: .8rem; margin: 10px 0 0; }

.flip-scene { perspective: 1400px; width: 100%; }
.flip-card {
  position: relative; width: 100%; min-height: 270px;
  transform-style: preserve-3d; transition: transform .6s cubic-bezier(.4,.1,.2,1); cursor: pointer;
}
.flip-card.flipped { transform: rotateY(180deg); }
.flip-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 28px;
}
.flip-back { transform: rotateY(180deg); }

.mcq-question-card, .write-question-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  width: 100%; padding: 30px 24px; display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.mcq-prompt, .write-prompt { color: var(--muted); font-family: var(--font-display); font-style: italic; margin: 10px 0 0; }
.mcq-choices { display: grid; gap: 10px; width: 100%; }
.mcq-btn {
  font-family: var(--font-sans); font-size: 1rem; text-align: left;
  background: var(--surface); border: 1px solid var(--line-2); color: var(--ink);
  border-radius: var(--radius-sm); padding: 15px 18px; cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease, transform .12s ease;
}
.mcq-btn:hover:not(:disabled) { transform: translateY(-1px); }
.mcq-btn:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-tint); }
.mcq-btn:disabled { cursor: default; }
.mcq-btn.correct { border-color: var(--accent); background: var(--accent-tint); color: var(--accent); font-weight: 600; }
.mcq-btn.wrong { border-color: var(--clay); background: var(--clay-tint); color: var(--clay); }

.write-input {
  width: 100%; font-family: var(--font-sans); font-size: 1.1rem;
  padding: 15px 18px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); text-align: center;
}
.write-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.write-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.write-input.correct { border-color: var(--accent); background: var(--accent-tint); }
.write-input.wrong { border-color: var(--clay); background: var(--clay-tint); }
.write-feedback { font-family: var(--font-display); font-size: 1.05rem; margin: 0; text-align: center; }
.write-feedback.correct { color: var(--accent); }
.write-feedback.wrong { color: var(--clay); }

/* ── Écran de fin de session (récapitulatif) ───────────────────────────── */
#learn-result { gap: 22px; padding-top: 18px; text-align: center; }
.result-check {
  width: 96px; height: 96px; border-radius: 50%;
  background: var(--accent-tint); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  animation: result-pop .5s cubic-bezier(.2,1.3,.4,1) both;
}
.result-check svg { width: 56px; height: 56px; fill: none; stroke: currentColor; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.result-check svg circle { opacity: .25; }
.result-check svg path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: result-draw .45s .25s ease forwards; }
.result-check-perfect { background: var(--gold-tint); color: var(--gold-text); }
@keyframes result-pop { from { transform: scale(.4); opacity: 0; } }
@keyframes result-draw { to { stroke-dashoffset: 0; } }
.reduce-motion .result-check, .reduce-motion .result-check svg path { animation: none !important; stroke-dashoffset: 0 !important; }

.result-title { font-family: var(--font-title); font-weight: 700; text-transform: uppercase; letter-spacing: .01em; font-size: clamp(1.6rem, 5vw, 2.2rem); margin: 0; }
.result-score { display: flex; align-items: baseline; justify-content: center; gap: 14px; }
.result-score-big { font-family: var(--font-display); font-weight: 800; font-size: 2.6rem; letter-spacing: -.02em; line-height: 1; }
.result-score-sep { color: var(--muted); font-weight: 500; margin: 0 2px; }
.result-score-pct { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; color: var(--accent); }

.result-stats { display: flex; justify-content: center; gap: 14px; width: 100%; max-width: 420px; }
.result-stat {
  flex: 1; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm); padding: 16px 8px; display: flex; flex-direction: column; gap: 4px;
}
.result-stat-num { font-family: var(--font-display); font-weight: 800; font-size: 1.7rem; line-height: 1; }
.result-stat:nth-child(1) .result-stat-num { color: var(--gold-text); }
.result-stat:nth-child(2) .result-stat-num { color: var(--clay); }
.result-stat:nth-child(3) .result-stat-num { color: var(--ink-2); }
.result-stat-label { color: var(--muted); font-size: .72rem; letter-spacing: .02em; }

.result-actions { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 420px; }
.btn-retry { background: var(--surface); border-color: var(--line-2); color: var(--ink); width: 100%; box-shadow: var(--shadow-sm); }
.btn-retry:hover { background: var(--paper-2); border-color: var(--accent); color: var(--accent); }

/* ── Thèmes ────────────────────────────────────────────────────────────── */

.themes-list, .badges-list { display: flex; flex-direction: column; gap: 12px; }
.theme-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 18px 20px; cursor: pointer; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
  transition: transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .18s ease, border-color .18s ease;
}
.theme-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: transparent; }
.theme-card-header { display: flex; justify-content: space-between; align-items: baseline; }
.theme-name { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; }
.theme-count { color: var(--muted); font-size: .82rem; white-space: nowrap; }
.theme-bar-track { height: 4px; background: var(--line); border-radius: 99px; margin: auto 0 8px; overflow: hidden; }
.theme-bar-fill { height: 100%; background: var(--accent); border-radius: 99px; }
.theme-card-footer { display: flex; justify-content: space-between; color: var(--muted); font-size: .8rem; }
.theme-pct { color: var(--accent); font-weight: 600; }

.theme-detail { animation: screen-in .3s ease both; }
.word-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 10px; }
.word-row {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 18px; cursor: pointer; height: 96px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
  transition: transform .15s cubic-bezier(.2,.8,.2,1), box-shadow .15s ease, border-color .15s ease;
}
.word-row:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: transparent; }
.word-row-ar { font-family: var(--font-ar); font-size: 1.7rem; color: var(--ink); flex-shrink: 0; }
.word-row-translit { color: var(--muted); font-style: italic; font-family: var(--font-display); font-size: .9rem; }
.word-row-translit:empty { display: none; }
.word-row-fr { flex: 1; color: var(--ink-2); font-size: .9rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mastery-badge {
  font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600;
  padding: 3px 9px; border-radius: 99px; border: 1px solid var(--line-2); white-space: nowrap;
}
.mastery-badge.mastery-0 { color: var(--muted); }
.mastery-badge.mastery-1 { color: var(--gold-text); border-color: var(--gold); }
.mastery-badge.mastery-2 { color: var(--accent); border-color: var(--accent); }

/* ── Détail d'un mot ───────────────────────────────────────────────────── */

.detail-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 36px 26px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.detail-ar { font-family: var(--font-ar); font-size: clamp(3.4rem, 15vw, 5rem); color: var(--ink); margin: 8px 0 0; }
.detail-translit { font-family: var(--font-display); font-style: italic; color: var(--muted); font-size: 1.15rem; margin: 0; }
.detail-translit:empty { display: none; }
.detail-translations { width: 100%; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.detail-trad { display: flex; align-items: center; gap: 12px; justify-content: center; font-size: 1.05rem; }
.trad-flag { font-size: .66rem; font-weight: 700; letter-spacing: .08em; color: var(--muted); border: 1px solid var(--line-2); border-radius: 5px; padding: 2px 6px; }
.mastery-row { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.detail-mastery { font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.detail-mastery.mastery-1 { color: var(--gold-text); }
.detail-mastery.mastery-2 { color: var(--accent); }
.mastery-dots { display: flex; gap: 6px; }
.mastery-dot { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--line-2); }
.mastery-dot.active { background: var(--accent); border-color: var(--accent); }
.detail-actions { display: flex; gap: 12px; width: 100%; margin-top: 16px; }

/* ── Progrès ───────────────────────────────────────────────────────────── */

.progress-global { margin-bottom: 24px; }
.progress-bar-label { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: .9rem; color: var(--ink-2); }
.progress-bar-label span:last-child { font-family: var(--font-display); font-weight: 600; color: var(--accent); }
.progress-bar-track { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--accent); border-radius: 99px; transition: width .5s ease; }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 10px; text-align: center; display: flex; flex-direction: column; gap: 4px; }
.stat-wide { grid-column: span 3; }
.stat-num { font-family: var(--font-display); font-size: 1.8rem; font-weight: 600; }
.stat-num.emerald { color: var(--accent); }
.stat-num.gold { color: var(--gold-text); }
.stat-num.coral { color: var(--clay); }
.stat-num.muted { color: var(--muted); }
.stat-label { color: var(--muted); font-size: .76rem; letter-spacing: .03em; }

/* ── Succès ────────────────────────────────────────────────────────────── */

.badge-card { display: flex; align-items: center; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.badge-card.locked { opacity: .55; }
.badge-card.earned { border-color: var(--gold); }
.badge-icon { font-size: 1.6rem; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--paper-2); flex-shrink: 0; }
.badge-label { font-family: var(--font-display); font-weight: 600; }
.badge-desc { color: var(--muted); font-size: .85rem; }

/* ── Réglages ──────────────────────────────────────────────────────────── */

.settings-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; background: var(--surface); border-bottom: 1px solid var(--line); cursor: pointer; }
.setting-row:last-child { border-bottom: none; }
.setting-label { font-size: .98rem; }
.setting-select { font-family: var(--font-sans); font-size: .95rem; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--paper); color: var(--ink); cursor: pointer; }

.toggle-wrap { position: relative; width: 46px; height: 26px; flex-shrink: 0; }
.toggle-input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.toggle-knob { position: absolute; inset: 0; background: var(--line-2); border-radius: 99px; transition: background .2s ease; }
.toggle-knob::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: #fff; border-radius: 50%; transition: transform .2s ease; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.toggle-input:checked + .toggle-knob { background: var(--accent); }
.toggle-input:checked + .toggle-knob::after { transform: translateX(20px); }

.credits-block { text-align: center; color: var(--muted); font-size: .85rem; margin-top: 26px; line-height: 1.7; }
.credits-block strong { color: var(--ink-2); }

/* ── À propos ──────────────────────────────────────────────────────────── */

.about-main { display: flex; flex-direction: column; gap: 18px; }
.about-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 22px; }
.about-card h3 { font-family: var(--font-display); font-size: 1.05rem; margin: 18px 0 6px; color: var(--accent); }
.about-card h3:first-child { margin-top: 0; }
.about-card p, .about-card li { color: var(--ink-2); font-size: .95rem; }
.about-card ul { padding-left: 18px; }
.cc-link { display: inline-block; margin-top: 12px; font-weight: 600; }

/* ── Crédit (règle BY) ─────────────────────────────────────────────────── */

.credits { text-align: center; color: var(--muted); font-size: .78rem; line-height: 1.6; padding: 20px; }
.credits strong { color: var(--ink-2); }
.global-credits { border-top: 1px solid var(--line); margin-top: 10px; }
.about-footer { border-top: 1px solid var(--line); }

/* ── Navigation bas ────────────────────────────────────────────────────── */

.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  display: flex; justify-content: space-around;
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(1.2) blur(8px);
  -webkit-backdrop-filter: saturate(1.2) blur(8px);
  border-top: 1px solid var(--line);
  padding: 6px max(env(safe-area-inset-left), 8px) calc(6px + env(safe-area-inset-bottom));
}
.nav-btn { background: none; border: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 10px; color: var(--muted); transition: color .15s ease; }
.nav-icon { width: 22px; height: 22px; }
.nav-label { font-size: .68rem; letter-spacing: .02em; }
.nav-btn.active { color: var(--accent); }
.nav-brand { display: none; }

/* ── Barre de progression « façon PDF » (orange, en bas) ───────────────── */
.fiche-progress {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 20px;
}
.fiche-progress-label { font-family: var(--font-display); font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.fiche-progress-track { flex: 1; height: 12px; background: var(--paper-2); border: 1px solid var(--line-2); border-radius: 99px; overflow: hidden; }
.fiche-progress-fill { height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .6s ease; }
.fiche-progress-pct { font-family: var(--font-display); font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }

/* ── Parcours : aperçu des sections sur l'accueil ──────────────────────── */
.home-section { display: flex; flex-direction: column; gap: 14px; }
.home-section-title {
  font-family: var(--font-title); font-size: 1.05rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em; margin: 0; color: var(--ink-2);
}
.home-themes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }

/* ── Page d'intro de section (style « divider » du PDF) ────────────────── */
.theme-divider { text-align: center; padding: 22px 16px 30px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.ribbon { width: 168px; height: auto; margin: 0 auto; display: block; }
.theme-divider-title {
  font-family: var(--font-title); font-weight: 700; text-transform: uppercase;
  font-size: clamp(1.55rem, 4.2vw, 2.5rem); line-height: 1.08; letter-spacing: .005em;
  margin: 14px auto 8px; max-width: 18ch;
}
.theme-divider-sub { color: var(--muted); font-size: .95rem; margin: 0; }
.theme-divider-sub strong { color: var(--ink); }
.theme-review-btn { max-width: 340px; margin: 16px auto 0; }

/* Badge numéro de section (cartes de listes) */
.section-badge {
  width: 36px; height: 36px; flex-shrink: 0; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-title); font-weight: 700; font-size: 1.1rem; color: #fff;
}
.theme-card-header { align-items: flex-start; gap: 12px; }
.theme-card .theme-name { flex: 1; line-height: 1.25; }
.section-pennant { width: 30px; height: auto; flex-shrink: 0; }

/* ── Chrono du Défi 3′ ─────────────────────────────────────────────────── */
.defi-timer {
  font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--clay); background: var(--clay-tint);
  border: 1px solid var(--clay); border-radius: 99px; padding: 4px 14px; font-size: .95rem;
}

/* ── Bandeau de section brun (façon fiches du PDF) ─────────────────────── */
.theme-detail .app-header {
  background: transparent; color: var(--ink);
  border: none; border-bottom: 1px solid var(--line); border-radius: 0;
  padding: 22px 0 16px; margin-bottom: 20px;
}
.theme-detail .app-header .screen-title { color: var(--ink); }
.theme-detail .icon-btn { color: var(--ink-2); border-color: var(--line-2); }
.theme-detail .icon-btn:hover { background: var(--paper-2); }

/* ── Toasts ────────────────────────────────────────────────────────────── */

.toast {
  position: fixed; left: 50%; bottom: 86px; transform: translate(-50%, 16px);
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-2); border-left: 3px solid var(--muted);
  border-radius: 10px; padding: 12px 18px; font-size: .92rem; font-weight: 500;
  box-shadow: var(--shadow); opacity: 0; z-index: 200; max-width: 88vw;
  transition: opacity .3s ease, transform .3s ease;
}
.toast-show { opacity: 1; transform: translate(-50%, 0); }
.toast-gold { border-left-color: var(--gold); }
.toast-emerald { border-left-color: var(--accent); }
.toast-coral { border-left-color: var(--clay); }

/* ── Préférence : réduire les animations ───────────────────────────────── */

.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .001ms !important; transition-duration: .001ms !important; } }

@media (max-width: 400px) {
  .gamebar { grid-template-columns: 1fr; }
  .mode-grid { gap: 8px; }
  .mode-desc { display: none; }
}

/* ── Desktop : barre latérale (≥ 900px), plus de menu en bas ───────────── */
@media (min-width: 900px) {
  body { padding-bottom: 0; padding-left: 248px; }

  .bottom-nav {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    top: 0; bottom: 0; left: 0; right: auto;
    width: 248px; height: 100vh;
    border-top: none; border-right: 1px solid var(--line);
    background: var(--surface);
    backdrop-filter: none; -webkit-backdrop-filter: none;
    padding: 26px 14px; gap: 4px;
  }
  .nav-brand {
    display: block;
    font-family: var(--font-display);
    font-size: 1.4rem; font-weight: 600;
    padding: 6px 12px 22px;
  }
  .nav-btn {
    flex-direction: row; justify-content: flex-start;
    gap: 13px; padding: 11px 14px; border-radius: 10px;
  }
  .nav-btn:hover { background: var(--paper-2); }
  .nav-btn.active { background: var(--accent-tint); }
  .nav-icon { width: 20px; height: 20px; }
  .nav-label { font-size: .95rem; }

  .screen { max-width: none; padding: 0 clamp(32px, 4vw, 72px); }
  .app-header, .learn-header { padding-top: 30px; }

  /* Accueil : flux vertical clair (les grilles internes remplissent la largeur) */
  .home-main { gap: 30px; }

  /* Écrans de jeu centrés (lecture confortable) */
  .learn-content { max-width: 720px; margin: 0 auto; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ACCUEIL « Nūr » — refonte gamifiée joyeuse (parcours de lumière)
   Tokens vifs + fond chaud global + hero/mascotte/modes/parcours/rail.
═══════════════════════════════════════════════════════════════════════════ */

:root {
  --font-round: 'Fredoka', var(--font-sans);
  /* Fond chaud crème (les cartes blanches ressortent) */
  --paper: #FBF7EF;
  --paper-2: #F2ECDD;
  --surface: #FFFFFF;
  /* Émeraude éclatante + bord 3D */
  --emerald-g1: #23D79C; --emerald-g2: #0FA876; --emerald-edge: #0B7E54;
  --flame: #FF7A1A; --flame-2: #FF9D4D;
  /* Couleur vive par mode */
  --c-quiz: #7C5CFF;  --c-quiz-d: #5E3FE0;
  --c-write: #FF9F1C; --c-write-d: #E07E00;
  --c-defi: #FF5C7A;  --c-defi-d: #E03E5E;
  /* 6 couleurs de parcours (sections) */
  --s1:#13C08A;--s1d:#0C9E70; --s2:#2BA8FF;--s2d:#1487E0; --s3:#7C5CFF;--s3d:#5E3FE0;
  --s4:#FF5C7A;--s4d:#E03E5E; --s5:#FFB300;--s5d:#E09600; --s6:#16C5C5;--s6d:#0FA3A3;
  --hm-edge: rgba(20,40,30,.13);
  --hm-halo: rgba(19,192,138,.30);
}
[data-theme="dark"] {
  --paper: #0F1512; --paper-2: #18211C; --surface: #18211B;
  --emerald-g1:#27DDA2; --emerald-g2:#0FA876; --emerald-edge:#0A6E48;
  --flame:#FF8C3A; --flame-2:#FFA45C;
  --c-quiz:#9A80FF; --c-write:#FFB347; --c-defi:#FF7790;
  --hm-edge: rgba(0,0,0,.55);
  --hm-halo: rgba(34,210,154,.30);
}

/* Fond de page : crème + halos doux émeraude/or */
body {
  background:
    radial-gradient(900px 460px at 92% -8%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%),
    radial-gradient(720px 440px at -10% 6%, color-mix(in srgb, var(--gold) 13%, transparent), transparent 70%),
    var(--paper);
  background-attachment: fixed;
}

/* L'accueil pilote sa propre largeur (le rail desktop a besoin de place) */
.screen-home { max-width: 620px; }

/* ── Barre du haut (mobile) ───────────────────────────────────────────────── */
.hm-topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 0 14px; }
.hm-brand { font-family: var(--font-round); font-weight: 600; font-size: 1.4rem; flex: 0 1 auto; }
.hm-pills { display: flex; align-items: center; gap: 9px; }
.hm-pill {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 999px;
  padding: 6px 13px 6px 7px; font-family: var(--font-round); font-weight: 600; font-size: 1rem;
  color: var(--ink); box-shadow: var(--shadow-sm); line-height: 1;
}
.hm-pill-ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.hm-pill.streak .hm-pill-ic { background: linear-gradient(150deg, var(--flame-2), var(--flame)); }
.hm-pill-ic svg { width: 15px; height: 15px; }
.hm-about { width: 42px; height: 42px; border-radius: 13px; border-width: 1.5px; box-shadow: var(--shadow-sm); }

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hm-main { display: block; }
.hm-hero {
  position: relative; overflow: hidden; border-radius: 28px; padding: 22px 22px;
  color: #fff; background: linear-gradient(145deg, var(--emerald-g1), var(--emerald-g2));
  box-shadow: 0 20px 40px -20px var(--hm-halo), inset 0 1px 0 rgba(255,255,255,.25);
  animation: hm-rise .5s .02s both cubic-bezier(.2,.7,.2,1);
}
.hm-pattern { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .14; color: #fff; pointer-events: none; }
.hm-ar-flourish { position: absolute; right: 120px; top: 12px; font-family: var(--font-ar); font-weight: 700; font-size: 46px; line-height: 1; color: rgba(255,255,255,.22); pointer-events: none; }
.hm-hero-row { position: relative; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.hm-hello { font-family: var(--font-round); font-weight: 600; font-size: 1.55rem; letter-spacing: -.4px; line-height: 1.1; }
.hm-wave { display: inline-block; transform-origin: 70% 80%; animation: hm-wave 2.6s ease-in-out infinite; }
.hm-hello-sub { margin-top: 6px; font-weight: 600; font-size: .92rem; color: rgba(255,255,255,.9); max-width: 210px; }
.hm-hello-sub b { font-weight: 800; }
.hm-mascot { width: 104px; height: 118px; flex: 0 0 auto; margin: -4px -2px 0 0; animation: hm-bob 4s ease-in-out infinite; }

.hm-cta {
  position: relative; display: flex; align-items: center; gap: 13px; width: 100%; margin-top: 18px;
  border: 0; cursor: pointer; text-align: left; background: var(--surface); border-radius: 18px; padding: 13px 15px;
  box-shadow: 0 5px 0 rgba(8,80,55,.26), 0 12px 22px -10px rgba(0,0,0,.34);
  transition: transform .09s ease, box-shadow .09s ease;
}
.hm-cta:hover { box-shadow: 0 6px 0 rgba(8,80,55,.26), 0 16px 28px -10px rgba(0,0,0,.4); transform: translateY(-1px); }
.hm-cta:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(8,80,55,.26); }
.hm-cta-play { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; color: #fff; flex: 0 0 auto;
  background: linear-gradient(150deg, var(--emerald-g1), var(--emerald-g2)); box-shadow: 0 4px 0 var(--emerald-edge); }
.hm-cta-play svg { width: 22px; height: 22px; }
.hm-cta-text { min-width: 0; }
.hm-cta-title { display: block; font-family: var(--font-round); font-weight: 600; font-size: 1.06rem; color: var(--ink); line-height: 1.1; }
.hm-cta-sub { display: block; font-weight: 600; font-size: .78rem; color: var(--muted); margin-top: 1px; }
.hm-cta-chev { margin-left: auto; color: var(--accent); display: grid; place-items: center; }
.hm-cta-chev svg { width: 22px; height: 22px; stroke-width: 2.6; }

/* ── Titres de section ────────────────────────────────────────────────────── */
.hm-sec-h { display: flex; align-items: center; justify-content: space-between; margin: 26px 2px 13px; }
.hm-sec-h h2 { font-family: var(--font-round); font-weight: 600; font-size: 1.22rem; letter-spacing: -.3px; margin: 0; }
.hm-more { background: none; border: 0; cursor: pointer; font-family: var(--font-round); font-weight: 500; font-size: .86rem; color: var(--accent); padding: 4px; }

/* ── Modes (cartes 3D colorées) ───────────────────────────────────────────── */
.hm-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hm-mode {
  position: relative; text-align: left; cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 20px; padding: 15px;
  box-shadow: 0 5px 0 var(--hm-edge), var(--shadow);
  transition: transform .1s ease, box-shadow .1s ease;
  animation: hm-rise .45s both cubic-bezier(.2,.7,.2,1);
}
.hm-mode:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--hm-edge), var(--shadow-lg); }
.hm-mode:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--hm-edge); }
.hm-mode:nth-child(1){animation-delay:.06s} .hm-mode:nth-child(2){animation-delay:.12s}
.hm-mode:nth-child(3){animation-delay:.18s} .hm-mode:nth-child(4){animation-delay:.24s}
.hm-mode-tile { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #fff; margin-bottom: 11px; box-shadow: 0 4px 10px -3px rgba(0,0,0,.3); }
.hm-mode-tile svg { width: 24px; height: 24px; stroke-width: 2.1; }
.t-fiche { background: linear-gradient(150deg, var(--emerald-g1), var(--emerald-g2)); }
.t-quiz  { background: linear-gradient(150deg, color-mix(in srgb, var(--c-quiz) 80%, #fff), var(--c-quiz-d)); }
.t-write { background: linear-gradient(150deg, color-mix(in srgb, var(--c-write) 85%, #fff), var(--c-write-d)); }
.t-defi  { background: linear-gradient(150deg, color-mix(in srgb, var(--c-defi) 85%, #fff), var(--c-defi-d)); }
.hm-mode-l { display: block; font-family: var(--font-round); font-weight: 600; font-size: 1.04rem; color: var(--ink); line-height: 1; }
.hm-mode-d { display: block; font-weight: 600; font-size: .78rem; color: var(--muted); margin-top: 4px; }

/* ── Parcours (chemin sinueux de nœuds-thèmes) ────────────────────────────── */
.hm-path { position: relative; padding: 10px 0 6px; }
/* Objectif du jour — carte de progression sous le hero */
.hm-dg-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 16px 18px; box-shadow: var(--shadow-sm); margin-bottom: 22px; transition: border-color .2s ease, background .2s ease; }
.hm-dg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.hm-dg-title { font-family: var(--font-round, var(--font-display)); font-weight: 700; font-size: .98rem; color: var(--ink); }
.hm-dg-icon { margin-right: 4px; }
.hm-dg-count { font-weight: 700; font-size: .9rem; color: var(--muted); }
.hm-dg-count b { color: var(--accent); }
.hm-dg-track { height: 12px; border-radius: 99px; background: var(--accent-tint); overflow: hidden; }
.hm-dg-fill { height: 100%; border-radius: 99px; background: var(--accent-grad); transition: width .4s ease; }
.hm-dg-msg { margin-top: 8px; font-size: .82rem; font-weight: 600; color: var(--muted); }
.hm-dg-card.dg-done { border-color: var(--accent); background: var(--accent-tint); }
.hm-dg-card.dg-done .hm-dg-title,
.hm-dg-card.dg-done .hm-dg-msg,
.hm-dg-card.dg-done .hm-dg-count,
.hm-dg-card.dg-done .hm-dg-count b { color: var(--accent-2); }
.hm-dg-card.dg-done .hm-dg-icon { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; font-size: .72rem; line-height: 1; vertical-align: middle; }

.hm-node-wrap { position: relative; z-index: 1; display: flex; justify-content: center; margin: 8px 0; animation: hm-pop .5s both cubic-bezier(.2,.9,.3,1.2); }
.hm-node-pos { display: flex; flex-direction: column; align-items: center; }
/* Sinuosité (décalages symétriques, sûrs sur petit écran) */
.hm-node-wrap:nth-child(6n+2) .hm-node-pos { transform: translateX(58px); }
.hm-node-wrap:nth-child(6n+3) .hm-node-pos { transform: translateX(34px); }
.hm-node-wrap:nth-child(6n+5) .hm-node-pos { transform: translateX(-58px); }
.hm-node-wrap:nth-child(6n+0) .hm-node-pos { transform: translateX(-34px); }
.hm-ring { width: 100px; height: 100px; border-radius: 50%; display: grid; place-items: center; padding: 6px;
  background: conic-gradient(var(--c, var(--accent)) calc(var(--p, 0) * 1%), var(--line) 0); }
.hm-node { width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; color: #fff; position: relative;
  background: linear-gradient(150deg, var(--c, var(--accent)), var(--cd, var(--accent-2))); box-shadow: 0 6px 0 var(--cd, var(--accent-2)); }
.hm-node-ic { font-size: 36px; line-height: 1; filter: drop-shadow(0 2px 2px rgba(0,0,0,.25)); }
/* La plupart des emojis Apple sont dessinés bas dans leur case ; 📖 (1ᵉʳ nœud
   « 42% des mots ») l'est nettement → recentrage vertical ciblé (em-based, symétrique). */
.hm-node-wrap:first-child .hm-node-ic { transform: translateY(-0.34em); }
.hm-node-wrap.is-current .hm-node-ic { font-size: 42px; }
.hm-node-label { margin-top: 9px; text-align: center; max-width: 150px; }
.hm-node-label .t { font-family: var(--font-round); font-weight: 600; font-size: .92rem; color: var(--ink); line-height: 1.12; }
.hm-node-label .c { font-weight: 600; font-size: .73rem; color: var(--muted); margin-top: 2px; }
.hm-node.is-done { /* garde sa couleur pleine, ajoute la coche */ }
.hm-node.is-upcoming { background: var(--paper-2); color: var(--muted); box-shadow: 0 5px 0 var(--line-2); }
.hm-node.is-upcoming .hm-node-ic { filter: grayscale(.4) opacity(.85); }
.hm-check { position: absolute; right: -2px; bottom: -2px; width: 26px; height: 26px; border-radius: 50%; background: var(--gold); color: #fff; display: grid; place-items: center; border: 3px solid var(--paper); box-shadow: var(--shadow-sm); }
.hm-check svg { width: 13px; height: 13px; stroke-width: 3.4; }
.hm-node-wrap.is-current .hm-ring { width: 116px; height: 116px; }
.hm-node.is-current-c { animation: hm-breathe 2.6s ease-in-out infinite; }
.hm-halo { position: absolute; inset: -12px; border-radius: 50%; border: 3px solid var(--c, var(--accent)); opacity: 0; animation: hm-halo 2.2s ease-out infinite; z-index: -1; }
.hm-bubble { position: absolute; top: -46px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  background: var(--surface); color: var(--accent-2); font-family: var(--font-round); font-weight: 600; font-size: .82rem;
  padding: 8px 15px; border-radius: 14px; border: 1.5px solid var(--line); box-shadow: 0 4px 0 var(--line-2), var(--shadow);
  animation: hm-nudge 2.2s ease-in-out infinite; }
.hm-bubble::after { content: ""; position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%) rotate(45deg); width: 12px; height: 12px; background: var(--surface); border-right: 1.5px solid var(--line); border-bottom: 1.5px solid var(--line); }

/* ── Rail desktop (masqué en mobile) ──────────────────────────────────────── */
.hm-rail { display: none; }

/* ── Animations accueil ───────────────────────────────────────────────────── */
@keyframes hm-rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes hm-pop { from { opacity: 0; transform: scale(.85); } }
@keyframes hm-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes hm-wave { 0%,60%,100% { transform: rotate(0); } 10%,30% { transform: rotate(16deg); } 20% { transform: rotate(-8deg); } }
@keyframes hm-breathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes hm-halo { 0% { opacity: .5; transform: scale(1); } 100% { opacity: 0; transform: scale(1.35); } }
@keyframes hm-nudge { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-4px); } }
.reduce-motion .hm-hero, .reduce-motion .hm-mode, .reduce-motion .hm-node-wrap,
.reduce-motion .hm-wave, .reduce-motion .hm-mascot, .reduce-motion .hm-halo,
.reduce-motion .hm-bubble, .reduce-motion .hm-node.is-current-c { animation: none !important; opacity: 1 !important; }

/* ── Mobile : bottom-nav flottante arrondie (n'affecte pas la sidebar ≥900px) ── */
@media (max-width: 899px) {
  body { padding-bottom: 96px; }
  .bottom-nav {
    left: 10px; right: 10px; bottom: 10px;
    border: 1.5px solid var(--line); border-radius: 22px;
    border-top: 1.5px solid var(--line);
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    box-shadow: var(--shadow-lg); padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  }
  .nav-btn { border-radius: 14px; gap: 3px; font-family: var(--font-round); }
  .nav-btn .nav-icon { width: 22px; height: 23px; padding: 4px 14px; border-radius: 11px; box-sizing: content-box; transition: background .15s ease; }
  .nav-btn.active .nav-icon { background: color-mix(in srgb, var(--accent) 16%, transparent); }
  .nav-label { font-size: .66rem; }
}

/* ── Desktop : accueil en grille (contenu + rail) ────────────────────────── */
@media (min-width: 1100px) {
  .screen-home { max-width: 1160px; }
  .hm-topbar { display: none; }
  .hm-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 30px; align-items: start; }
  .hm-modes { grid-template-columns: repeat(4, 1fr); }
  .hm-hero { padding: 30px 32px; }
  .hm-hello { font-size: 1.9rem; }
  .hm-hello-sub { max-width: 320px; font-size: 1rem; }
  .hm-mascot { width: 120px; height: 134px; }

  .hm-rail { display: block; }
  .hm-rail-card { background: var(--surface); border: 1.5px solid var(--line); border-radius: 22px; padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
  .hm-rail-card h3 { font-family: var(--font-round); font-weight: 600; font-size: 1rem; margin: 0 0 12px; }
  .hm-rstat { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
  .hm-rstat-ic { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; color: #fff; flex: 0 0 auto; }
  .hm-rstat-ic svg { width: 20px; height: 20px; }
  .hm-rstat-ic.streak { background: linear-gradient(150deg, var(--flame-2), var(--flame)); }
  .hm-rstat-ic.xp { background: linear-gradient(150deg, #FFD05B, var(--gold)); }
  .hm-rstat-big { font-family: var(--font-round); font-weight: 600; font-size: 1.18rem; line-height: 1.05; color: var(--ink); }
  .hm-rstat-lbl { font-weight: 600; font-size: .78rem; color: var(--muted); margin-top: 1px; }
  .hm-goal { display: flex; align-items: center; gap: 16px; }
  .hm-goalring { position: relative; width: 78px; height: 78px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center;
    background: conic-gradient(var(--accent) calc(var(--p, 0) * 1%), var(--line) 0); }
  .hm-goalring::after { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: var(--surface); }
  .hm-goal-pct { position: relative; z-index: 1; font-family: var(--font-round); font-weight: 600; font-size: 1.05rem; color: var(--ink); }
  .hm-goal-big { font-family: var(--font-round); font-weight: 600; font-size: 1.18rem; color: var(--ink); }
  .hm-goal-big b { font-weight: 700; }
}

/* ════════════════════════════════════════════════════════════════════
   NŪR — REFONTE ACCUEIL DESKTOP (parcours-sentier + finition premium)
   Mobile (<1100px) intact : tout le structurel est sous @media.
   ════════════════════════════════════════════════════════════════════ */

:root {
  --path-amp: 200px;      /* amplitude du serpentin desktop (2 colonnes larges) */
}

/* ── Polish global sûr (n'altère AUCUNE disposition mobile) ──────────── */
.hm-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0; border-radius: inherit;
  background:
    radial-gradient(120% 90% at 88% -10%, rgba(255,255,255,.34), rgba(255,255,255,0) 55%),
    radial-gradient(90% 75% at 0% 112%, rgba(11,126,84,.42), rgba(11,126,84,0) 60%);
}
/* On lève seulement les calques de CONTENU (déjà position:relative) au-dessus
   du voile ::before — SANS toucher au positionnement absolu de .hm-pattern /
   .hm-ar-flourish (sinon ils tomberaient dans le flux). */
.hm-hero-row, .hm-cta { z-index: 1; }
.hm-pattern { z-index: 0; }
.hm-cta { box-shadow: 0 5px 0 rgba(8,80,55,.26), 0 12px 22px -10px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.9); }

.hm-mode { overflow: hidden; }
.hm-mode::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; z-index: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.5), rgba(255,255,255,0) 40%);
}
.hm-mode > * { position: relative; z-index: 1; }
.hm-mode-tile { transition: transform .12s ease, box-shadow .12s ease; }
.hm-mode:hover .hm-mode-tile { transform: translateY(-1px) scale(1.04); box-shadow: 0 6px 14px -3px rgba(0,0,0,.32); }

/* Reflet premium en haut du disque (sous l'emoji/coche, au-dessus du fond) */
.hm-node::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none; z-index: 1;
  background: radial-gradient(75% 55% at 50% 22%, rgba(255,255,255,.5), rgba(255,255,255,0) 60%);
}
.hm-node.is-upcoming::after { opacity: .35; }
/* IMPORTANT : NE PAS inclure .hm-halo ici (il reste position:absolute; z-index:-1
   pour pulser DERRIÈRE le disque). On remonte seulement le contenu. */
.hm-node-ic, .hm-check, .hm-bubble { position: relative; z-index: 2; }

/* Tracé courbe continu du parcours : SVG dessiné en JS sur les positions réelles
   des nœuds (robuste, s'adapte au resize). Derrière les nœuds (z-index 0).
   Règles globales pour que l'élément (vide en mobile) reste hors-flux. */
.hm-path-svg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; overflow: visible; }
.hm-path-svg path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.hm-path-svg .jp-base { stroke: var(--line-2); stroke-width: 9; stroke-dasharray: 1 18; opacity: .8; }
.hm-path-svg .jp-done { stroke: var(--accent); stroke-width: 9; filter: drop-shadow(0 2px 6px color-mix(in srgb, var(--accent) 45%, transparent)); }

/* ── Desktop ≥1100px : scène large, hero riche, parcours-sentier, rail ── */
@media (min-width: 1100px) {

  /* 1) Scène : plus large, rail rééquilibré, rythme vertical régulier */
  .screen-home { max-width: 1280px; }
  .hm-layout {
    grid-template-columns: minmax(0, 1fr) 348px;
    gap: clamp(30px, 3vw, 44px);
    align-items: start;
    padding-top: clamp(32px, 3.4vw, 52px);   /* la topbar mobile est masquée : on aère le haut */
    padding-bottom: 48px;
  }
  .hm-main { display: flex; flex-direction: column; gap: clamp(22px, 2.4vw, 34px); }

  /* 2) HERO bandeau premium */
  .hm-hero {
    padding: clamp(34px, 3vw, 46px) clamp(34px, 3.4vw, 52px);
    border-radius: 32px;
    box-shadow:
      0 30px 60px -28px var(--hm-halo),
      0 12px 28px -16px rgba(11,126,84,.5),
      inset 0 1px 0 rgba(255,255,255,.3);
  }
  .hm-hero-row { align-items: center; }
  .hm-hello { font-size: clamp(2rem, 2.4vw, 2.5rem); }
  .hm-hello-sub { max-width: 440px; font-size: 1.06rem; margin-top: 10px; }
  .hm-mascot { width: clamp(124px, 11vw, 162px); height: auto; }
  .hm-ar-flourish { right: clamp(150px, 14vw, 215px); top: 16px; font-size: clamp(56px, 4.6vw, 80px); color: rgba(255,255,255,.32); }
  .hm-cta { width: auto; min-width: 340px; max-width: 460px; margin-top: 24px; padding: 16px 20px; border-radius: 20px; }
  .hm-cta-play { width: 50px; height: 50px; border-radius: 15px; }
  .hm-cta-title { font-size: 1.16rem; }
  .hm-cta-sub { font-size: .84rem; }

  /* 3) Titres de section : plus affirmés (le gap flex gère l'espacement) */
  .hm-sec-h { margin: 6px 4px 2px; }
  .hm-sec-h h2 { font-size: 1.5rem; }
  .hm-more { font-size: .95rem; }

  /* 4) Modes : 4 colonnes, plus tactiles */
  .hm-modes { grid-template-columns: repeat(4, 1fr); gap: clamp(14px, 1.4vw, 20px); }
  .hm-mode { padding: clamp(18px, 1.6vw, 22px); border-radius: 24px; }
  .hm-mode-tile { width: 54px; height: 54px; border-radius: 17px; margin-bottom: 13px; }
  .hm-mode-tile svg { width: 27px; height: 27px; }
  .hm-mode-l { font-size: 1.13rem; }
  .hm-mode-d { font-size: .83rem; margin-top: 5px; }

  /* 5) PARCOURS — chemin de nœuds posé directement sur le fond de page
     (pas de panneau/rectangle : juste les nœuds + le tracé courbe). */
  .hm-path {
    position: relative;
    max-width: 1040px; margin-inline: auto;
    padding: 56px clamp(28px, 4vw, 64px) 52px;
  }

  /* Serpentin LARGE à 2 colonnes — les nœuds occupent toute la largeur,
     le tracé SVG (dessiné en JS) les relie en courbe. */
  .hm-node-wrap { margin: 0; z-index: 1; }
  .hm-node-pos { position: relative; padding-top: clamp(40px, 4vw, 64px); padding-bottom: 6px; transition: transform .14s ease; }
  .hm-node-wrap:first-child .hm-node-pos { padding-top: 12px; }
  .hm-node-wrap:nth-child(odd)  .hm-node-pos { transform: translateX(calc(var(--path-amp) * -1)); }
  .hm-node-wrap:nth-child(even) .hm-node-pos { transform: translateX(var(--path-amp)); }
  .hm-node-wrap:nth-child(odd):hover  .hm-node-pos { transform: translateX(calc(var(--path-amp) * -1)) translateY(-3px); }
  .hm-node-wrap:nth-child(even):hover .hm-node-pos { transform: translateX(var(--path-amp)) translateY(-3px); }

  /* Anneaux agrandis */
  .hm-ring { width: 132px; height: 132px; padding: 7px; box-shadow: 0 2px 6px -2px rgba(16,24,40,.18); }
  .hm-node-wrap.is-current .hm-ring { width: 150px; height: 150px; }
  .hm-node-ic { font-size: 47px; }
  .hm-node-wrap.is-current .hm-node-ic { font-size: 55px; }
  .hm-node {
    box-shadow:
      0 8px 0 var(--cd, var(--accent-2)),
      0 18px 30px -12px rgba(16,24,40,.4),
      inset 0 2px 0 rgba(255,255,255,.4);
  }
  .hm-node.is-upcoming { box-shadow: 0 7px 0 var(--line-2); opacity: .85; }

  /* Label plus présent */
  .hm-node-label { margin-top: 14px; max-width: 190px; }
  .hm-node-label .t { font-size: 1.04rem; }
  .hm-node-label .c { font-size: .8rem; }
  .hm-node-wrap.wrap-upcoming .hm-node-label .t { color: var(--ink-2, var(--muted)); }

  /* Coche or, halo, bulle proportionnés au plus gros nœud courant */
  .hm-check { width: 32px; height: 32px; right: 0; bottom: 0; border-width: 4px; }
  .hm-check svg { width: 16px; height: 16px; }
  .hm-halo { inset: -16px; border-width: 4px; }   /* reste z-index:-1, position:absolute */
  .hm-bubble { top: -54px; font-size: .92rem; padding: 9px 17px; box-shadow: 0 5px 0 var(--line-2), var(--shadow); }

  /* Étiquette en pastille (lisible par-dessus le tracé/le motif) */
  .hm-node-label {
    position: relative; z-index: 1;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    padding: 8px 15px; border-radius: 14px;
    box-shadow: 0 3px 10px -5px rgba(16,24,40,.26);
    backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  }

  /* 6) RAIL premium densifié (NON sticky : défile avec le contenu) */
  .hm-rail-card {
    padding: 24px; border-radius: 26px; margin-bottom: 18px;
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.7);
  }
  .hm-rail-card h3 { font-size: 1.1rem; margin-bottom: 16px; }
  .hm-rstat { gap: 14px; padding: 11px 0; }
  .hm-rstat + .hm-rstat { border-top: 1px solid var(--line); }
  .hm-rstat-ic { width: 46px; height: 46px; border-radius: 15px; box-shadow: 0 6px 14px -5px rgba(0,0,0,.35); }
  .hm-rstat-ic svg { width: 23px; height: 23px; }
  .hm-rstat-big { font-size: 1.3rem; }
  .hm-rstat-lbl { font-size: .82rem; }
  .hm-goal { gap: 20px; }
  .hm-goalring { width: 96px; height: 96px; box-shadow: inset 0 0 0 1px var(--line); }
  .hm-goalring::after {
    inset: 9px;
    background: radial-gradient(circle at 50% 30%, var(--surface), var(--paper));
    box-shadow: inset 0 1px 3px rgba(16,24,40,.06);
  }
  .hm-goal-pct { font-size: 1.18rem; }
  .hm-goal-big { font-size: 1.28rem; }
}

/* ── Très grand écran ≥1500px : on comble les marges, sentier plus ample ── */
@media (min-width: 1500px) {
  :root { --path-amp: 260px; }
  .screen-home { max-width: 1360px; }
  .hm-layout { grid-template-columns: minmax(0, 1fr) 372px; gap: 40px; }
  .hm-path { padding: 50px clamp(40px, 4vw, 72px) 46px; }
  .hm-hello { font-size: 2.5rem; }
}

/* reduce-motion : la règle existante neutralise déjà tout ; ce bloc par sécurité. */
.reduce-motion .hm-node-pos,
.reduce-motion .hm-mode:hover .hm-mode-tile { transition: none !important; }

/* ════════════════════════════════════════════════════════════════════
   « Ton élan » : ligne moyenne cliquable + CALENDRIER d'activité (modal)
   ════════════════════════════════════════════════════════════════════ */
.hm-rstat-btn {
  width: 100%; text-align: left; font: inherit; color: inherit;
  background: none; border: 0; cursor: pointer; border-radius: 14px;
  transition: background .15s ease;
}
.hm-rstat-btn:hover { background: var(--paper-2); }
.hm-rstat-ic.avg { background: linear-gradient(150deg, #5AD1A6, var(--accent)); }
.hm-rstat-link { color: var(--accent); font-weight: 700; }

.cal-overlay {
  position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 20px;
  background: rgba(16,24,40,.45);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  animation: cal-fade .18s ease both;
}
@keyframes cal-fade { from { opacity: 0; } }
.cal-modal {
  width: min(440px, 100%); background: var(--surface); color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 26px; padding: 24px;
  box-shadow: var(--shadow-lg); animation: cal-pop .22s cubic-bezier(.2,.9,.3,1.1) both;
}
@keyframes cal-pop { from { transform: scale(.92); opacity: 0; } }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.cal-head h3 { font-family: var(--font-round); font-weight: 600; font-size: 1.3rem; margin: 0; }
.cal-close {
  width: 38px; height: 38px; border-radius: 12px; border: 1.5px solid var(--line-2);
  background: var(--surface); color: var(--ink-2); cursor: pointer; display: grid; place-items: center;
}
.cal-close:hover { background: var(--paper-2); color: var(--ink); }
.cal-close .ico { width: 20px; height: 20px; }
.cal-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.cal-sum {
  background: var(--paper-2); border-radius: 16px; padding: 13px 6px; text-align: center;
  display: flex; flex-direction: column; gap: 2px;
}
.cal-sum b { font-family: var(--font-round); font-weight: 700; font-size: 1.35rem; color: var(--ink); line-height: 1; }
.cal-sum span { font-size: .72rem; color: var(--muted); }
.cal-grid-dow, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-grid-dow { margin-bottom: 6px; }
.cal-dow { text-align: center; font-size: .72rem; font-weight: 600; color: var(--muted); }
.cal-cell {
  aspect-ratio: 1; border-radius: 9px; display: grid; place-items: center;
  font-family: var(--font-round); font-size: .82rem; font-weight: 700; color: var(--accent-2);
  background: var(--paper-2);
}
.cal-pad { background: transparent; }
.cal-lv-0 { background: var(--paper-2); color: transparent; }
.cal-lv-1 { background: color-mix(in srgb, var(--accent) 24%, var(--surface)); }
.cal-lv-2 { background: color-mix(in srgb, var(--accent) 45%, var(--surface)); }
.cal-lv-3 { background: color-mix(in srgb, var(--accent) 68%, var(--surface)); color: #fff; }
.cal-lv-4 { background: var(--accent); color: #fff; }
.cal-today { box-shadow: 0 0 0 2px var(--gold); }
.cal-legend { display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: 18px; font-size: .72rem; color: var(--muted); }
.cal-legend i { width: 16px; height: 16px; border-radius: 5px; display: inline-block; }

/* ════════════════════════════════════════════════════════════════════
   NŪR — PAGES INTERNES accordées à l'accueil
   (Fredoka, coins arrondis, 3D doux, couleurs vives, plus d'Oswald majuscule)
   ════════════════════════════════════════════════════════════════════ */

/* En-têtes d'écran */
.app-header, .learn-header { border-bottom: 0; margin-bottom: 16px; gap: 14px; }
.screen-title {
  font-family: var(--font-round); font-weight: 600; text-transform: none;
  letter-spacing: -.4px; font-size: clamp(1.55rem, 4.5vw, 2rem);
}
.icon-btn {
  border: 1.5px solid var(--line); border-radius: 14px;
  background: var(--surface); box-shadow: var(--shadow-sm); width: 44px; height: 44px;
}
.icon-btn:hover { background: var(--paper-2); color: var(--ink); }

/* Boutons : arrondis + Fredoka ; primaire « 3D » émeraude (comme la CTA d'accueil) */
.btn { border-radius: 16px; font-family: var(--font-round); font-weight: 600; }
.btn-primary, .btn-hero {
  background: linear-gradient(150deg, var(--emerald-g1), var(--emerald-g2)); color: #fff; border: 0;
  box-shadow: 0 5px 0 var(--emerald-edge), 0 14px 24px -12px rgba(11,126,84,.55);
}
.btn-primary:hover, .btn-hero:hover { transform: translateY(-1px); filter: none; box-shadow: 0 6px 0 var(--emerald-edge), 0 18px 28px -12px rgba(11,126,84,.55); }
.btn-primary:active, .btn-hero:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--emerald-edge); }
.mini-chip { font-family: var(--font-round); background: var(--accent-tint); border-color: var(--accent-tint); color: var(--accent-2); }

/* ── Apprentissage (fiches / quiz / écriture / résultat) ── */
.learn-mode-title { font-family: var(--font-round); font-weight: 600; }
.learn-progress-text, .defi-timer { font-family: var(--font-round); }
.session-progress-track { height: 8px; border-radius: 99px; }
.session-progress-fill { background: linear-gradient(90deg, var(--emerald-g1), var(--emerald-g2)); border-radius: 99px; }
.flip-face, .mcq-question-card, .write-question-card {
  border: 1.5px solid var(--line); border-radius: 26px; background: var(--surface);
  box-shadow: 0 6px 0 var(--hm-edge), var(--shadow);
}
.card-answer { font-family: var(--font-round); font-weight: 600; }
.mcq-prompt, .write-prompt { font-family: var(--font-round); }
.mcq-btn {
  border: 1.5px solid var(--line); border-radius: 16px; font-family: var(--font-round); font-weight: 500;
  box-shadow: 0 4px 0 var(--hm-edge), var(--shadow-sm);
}
.mcq-btn:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-tint); transform: translateY(-1px); box-shadow: 0 5px 0 var(--hm-edge), var(--shadow); }
.mcq-btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--hm-edge); }
.mcq-btn.correct { background: var(--accent-tint); border-color: var(--accent); color: var(--accent-2); }
.mcq-btn.wrong { background: var(--clay-tint); border-color: var(--clay); color: var(--clay); }
.write-input { border-radius: 16px; border-width: 1.5px; font-family: var(--font-round); }
.btn-review, .btn-know { border-radius: 16px; border-width: 1.5px; font-weight: 600; box-shadow: var(--shadow-sm); }
.btn-review { background: var(--clay-tint); border-color: var(--clay); color: var(--clay); }
.btn-review:hover { background: var(--clay-tint); filter: brightness(.98); }
.btn-know { background: var(--accent-tint); border-color: var(--accent); color: var(--accent-2); }
.btn-know:hover { background: var(--accent-tint); filter: brightness(.98); }
.result-title { font-family: var(--font-round); font-weight: 600; text-transform: none; letter-spacing: -.4px; }
.result-score-big, .result-stat-num { font-family: var(--font-round); }
.result-stat { border: 1.5px solid var(--line); border-radius: 20px; box-shadow: 0 4px 0 var(--hm-edge), var(--shadow-sm); }
.btn-retry { border-radius: 16px; font-family: var(--font-round); font-weight: 600; }

/* ── Thèmes (liste + détail) ── */
.theme-card {
  border: 1.5px solid var(--line); border-radius: 22px; padding: 18px;
  box-shadow: 0 5px 0 var(--hm-edge), var(--shadow);
}
.theme-card:hover { transform: translateY(-2px); border-color: var(--line); box-shadow: 0 7px 0 var(--hm-edge), var(--shadow-lg); }
.theme-card:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--hm-edge); }
.theme-card-header { align-items: center; gap: 13px; }
.theme-emoji {
  width: 48px; height: 48px; flex-shrink: 0; border-radius: 15px; display: grid; place-items: center;
  font-size: 25px; color: #fff;
  background: linear-gradient(150deg, color-mix(in srgb, var(--c, var(--accent)) 80%, #fff), var(--c, var(--accent)));
  box-shadow: 0 4px 10px -3px rgba(0,0,0,.3);
}
.theme-name { font-family: var(--font-round); font-weight: 600; }
.theme-count, .theme-card-footer span, .theme-pct { font-family: var(--font-round); font-weight: 500; }
.theme-bar-track { height: 8px; border-radius: 99px; }
.theme-divider-title { font-family: var(--font-round); font-weight: 600; text-transform: none; letter-spacing: -.5px; }
.theme-review-btn { border-radius: 18px; }
.word-row { border: 1.5px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-sm); }
.word-row:hover { transform: translateY(-2px); border-color: var(--line); box-shadow: var(--shadow); }
.mastery-badge { font-family: var(--font-round); font-weight: 600; border-radius: 99px; }
.mastery-badge.mastery-2 { background: var(--accent-tint); border-color: var(--accent); color: var(--accent-2); }

/* ── Détail d'un mot ── */
.detail-card { border: 1.5px solid var(--line); border-radius: 26px; box-shadow: 0 6px 0 var(--hm-edge), var(--shadow); }

/* ── Progrès ── */
.progress-bar-track { height: 12px; border-radius: 99px; }
.progress-bar-fill { background: linear-gradient(90deg, var(--emerald-g1), var(--emerald-g2)); border-radius: 99px; }
.progress-bar-label span:last-child { font-family: var(--font-round); }
.stat-card { border: 1.5px solid var(--line); border-radius: 20px; padding: 18px 10px; box-shadow: 0 5px 0 var(--hm-edge), var(--shadow-sm); }
.stat-num { font-family: var(--font-round); font-weight: 700; }

/* ── Succès ── */
.badge-card { border: 1.5px solid var(--line); border-radius: 20px; box-shadow: 0 5px 0 var(--hm-edge), var(--shadow-sm); }
.badge-card.earned { border-color: var(--gold); box-shadow: 0 5px 0 var(--gold-tint), var(--shadow); }
.badge-icon { border-radius: 14px; background: var(--accent-tint); }
.badge-card.earned .badge-icon { background: var(--gold-tint); }
.badge-label { font-family: var(--font-round); font-weight: 600; }

/* ── Réglages : chaque ligne devient une carte arrondie ── */
.settings-list { border: 0; border-radius: 0; overflow: visible; gap: 10px; }
.setting-row {
  border: 1.5px solid var(--line); border-radius: 18px; background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.setting-row:last-child { border-bottom: 1.5px solid var(--line); }
.setting-label { font-family: var(--font-round); font-weight: 500; }
.setting-select { border-radius: 12px; font-family: var(--font-round); }

/* ── À propos ── */
.about-card { border: 1.5px solid var(--line); border-radius: 24px; box-shadow: 0 6px 0 var(--hm-edge), var(--shadow); }
.about-card h3 { font-family: var(--font-round); font-weight: 600; }

/* ── Desktop : pages internes centrées et aérées (comme l'accueil) ── */
@media (min-width: 1100px) {
  .screen:not(.screen-home) { max-width: 880px; margin: 0 auto; }
  .app-header, .learn-header { padding-top: clamp(32px, 3.4vw, 52px); }
}
