/* ═══════════════════════════════════════════════════════════════════════
   English Boost — styles
   1. Thème        2. Base          3. Barre du haut   4. Boutons
   5. Accueil      6. Page du jour  7. Fenêtres (studio, Joue Modou)
   8. Exercices    9. Révisions    10. Listes (favoris, recherche)
  11. Retours (toast, confettis)  12. Mouvements     13. Mobile & accessibilité
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── 1. Thème ─── */
:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --ink: #1b2231;
  --muted: #5f6878;
  --line: #e6e2d8;
  --accent: #1f5fbf;
  --accent-ink: #ffffff;
  --accent-soft: #e8effb;
  --mark: #ffe9a8;
  --mark-ink: #1b2231;
  --good: #23905a;
  --good-soft: #e3f5ea;
  --bad: #d64545;
  --bad-soft: #fde8e8;
  --warn: #c98a00;
  --flame: #ff7a1a;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgb(20 30 50 / 5%), 0 6px 20px rgb(20 30 50 / 6%);
  --shadow-lg: 0 24px 60px rgb(10 20 40 / 28%);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.3, 1.5, .5, 1);
  --topbar-h: 60px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11141b;
    --surface: #1a1e28;
    --surface-2: #161a23;
    --ink: #e9ecf2;
    --muted: #9aa3b2;
    --line: #2a3040;
    --accent: #6ea0ff;
    --accent-ink: #0d1424;
    --accent-soft: #1e2940;
    --mark: #5a4a14;
    --mark-ink: #fff4cf;
    --good: #4cc787;
    --good-soft: #173326;
    --bad: #ff7a7a;
    --bad-soft: #3a1c1f;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%);
    --shadow-lg: 0 24px 60px rgb(0 0 0 / 55%);
    color-scheme: dark;
  }
}

/* ─── 2. Base ─── */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 64px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
h1, h2, p { margin: 0; }
button { font: inherit; cursor: pointer; color: inherit; }
button:disabled { cursor: default; }
svg { flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.skip-link:focus { left: 8px; }

.page { max-width: 780px; margin: 0 auto; padding: 32px 18px 80px; outline: none; }
.page-enter { animation: page-in 0.45s var(--ease) both; }
@keyframes page-in { from { opacity: 0; transform: translateY(14px); } }
[data-stagger] > * { animation: rise-in 0.5s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms + 80ms); }
@keyframes rise-in { from { opacity: 0; transform: translateY(16px) scale(0.98); } }

.eyebrow { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--accent); }
.lead { color: var(--muted); font-size: 1.05rem; margin-top: 12px; }
.hint { color: var(--muted); font-size: 0.9rem; margin-top: 4px; }
.count { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 6px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: 0.8rem; vertical-align: middle; }

/* ─── 3. Barre du haut ─── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1040px; margin: 0 auto; padding: 0 18px; height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.12rem; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.brand > span:last-child > span { color: var(--accent); }
.brand-mark {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px;
  background: linear-gradient(135deg, #2b6fd6, #143f85); color: #fff; font-size: 0.78rem; letter-spacing: 0;
  transition: transform 0.4s var(--spring);
}
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.08); }

.mainnav { display: flex; gap: 4px; }
.mainnav a {
  position: relative; display: flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 99px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.92rem;
  transition: color 0.2s, background 0.2s;
}
.mainnav a:hover { color: var(--ink); background: var(--surface); }
.mainnav a.is-active { color: var(--accent); background: var(--accent-soft); }
.mainnav a.is-active svg { animation: nav-pop 0.4s var(--spring); }
@keyframes nav-pop { 50% { transform: scale(1.25); } }
.nav-badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px;
  background: var(--bad); color: #fff; font-size: 0.68rem; display: grid; place-items: center;
  animation: badge-in 0.5s var(--spring);
}
@keyframes badge-in { from { transform: scale(0); } }

.topbar-tools { display: flex; align-items: center; gap: 8px; }
.streak-chip {
  display: flex; align-items: center; gap: 4px; padding: 5px 11px; border-radius: 99px;
  background: var(--surface); border: 1px solid var(--line); font-weight: 700; font-size: 0.9rem;
}
.flame { display: inline-block; filter: grayscale(1); opacity: 0.5; }
.flame.is-lit { filter: none; opacity: 1; animation: flicker 2.4s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(0); } 30% { transform: scale(1.12) rotate(-4deg); } 60% { transform: scale(0.96) rotate(3deg); } }
.speed-btn {
  display: flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 5px 11px; border-radius: 99px; font-size: 0.85rem; font-weight: 600;
}
.speed-btn svg { width: 18px; height: 18px; }
.speed-btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* ─── 4. Boutons ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent; border-radius: 99px; padding: 11px 20px;
  font-weight: 650; text-decoration: none; white-space: nowrap;
  transition: transform 0.15s var(--ease), box-shadow 0.2s, background 0.2s, border-color 0.2s;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); }
.btn-small { padding: 7px 14px; font-size: 0.88rem; }
.btn-small svg { width: 14px; height: 14px; }
.btn-lg { padding: 14px 26px; font-size: 1.02rem; }
.btn-again { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.btn-knew { background: var(--good); color: #fff; }

.icon-btn {
  flex: none; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--accent);
  display: grid; place-items: center; padding: 0;
  transition: transform 0.15s var(--ease), border-color 0.2s, background 0.2s, color 0.2s;
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { border-color: var(--accent); transform: scale(1.06); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn.is-playing { background: var(--accent); color: var(--accent-ink); animation: pulse-ring 1.2s ease-out infinite; }
@keyframes pulse-ring { from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); } to { box-shadow: 0 0 0 12px transparent; } }
.mic-btn { color: var(--bad); }
.mic-btn.is-listening { background: var(--bad); color: #fff; border-color: var(--bad); animation: listen-ring 1s ease-out infinite; }
@keyframes listen-ring { from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--bad) 50%, transparent); } to { box-shadow: 0 0 0 14px transparent; } }
.fav-btn { color: var(--muted); }
.fav-btn.is-on { color: #f5a300; border-color: #f5c24d; background: color-mix(in srgb, #ffc53d 16%, var(--surface)); }
.fav-btn.is-on svg { fill: currentColor; }
.fav-btn.pop { animation: star-pop 0.5s var(--spring); }
@keyframes star-pop { 40% { transform: scale(1.4) rotate(18deg); } }

.round-btn {
  width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); font-size: 1rem; transition: transform 0.15s var(--ease);
}
.round-btn:hover:not(:disabled) { transform: scale(1.08); }
.round-btn:disabled { opacity: 0.35; }
.round-main { width: 60px; height: 60px; background: var(--accent); color: var(--accent-ink); border-color: transparent; font-size: 1.2rem; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }

/* Retour du micro */
.say-fb { display: block; font-size: 0.86rem; font-weight: 600; min-height: 0; }
.say-fb:empty { display: none; }
.say-fb[class*="is-"] { margin-top: 8px; padding: 6px 10px; border-radius: 10px; animation: rise-in 0.35s var(--ease); }
.say-fb.is-listening { background: var(--accent-soft); color: var(--accent); }
.say-fb.is-great { background: var(--good-soft); color: var(--good); }
.say-fb.is-close { background: color-mix(in srgb, #ffc53d 22%, var(--surface)); color: var(--warn); }
.say-fb.is-retry { background: var(--bad-soft); color: var(--bad); }

/* ─── 5. Accueil ─── */
.hero h1 { font-size: clamp(2rem, 5.5vw, 2.8rem); line-height: 1.1; letter-spacing: -0.025em; margin-top: 10px; max-width: 16ch; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.hero-next { color: var(--muted); font-size: 0.95rem; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 32px; }
.stat {
  display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.stat strong { display: block; font-size: 1.5rem; line-height: 1.1; letter-spacing: -0.02em; }
.stat strong span { color: var(--muted); font-size: 1rem; font-weight: 600; }
.stat small { color: var(--muted); font-size: 0.82rem; line-height: 1.3; display: block; }
.stat-icon { font-size: 1.9rem; width: 48px; text-align: center; }
.ring { width: 48px; height: 48px; transform: rotate(-90deg); flex: none; }
.ring circle { fill: none; stroke-width: 7; }
.ring-track { stroke: var(--line); }
.ring-value {
  stroke: var(--good); stroke-linecap: round; stroke-dasharray: var(--len); stroke-dashoffset: var(--off);
  animation: ring-fill 1.2s 0.3s var(--ease) both;
}
@keyframes ring-fill { from { stroke-dashoffset: var(--len); } }

.review-cta {
  display: flex; align-items: center; gap: 16px; margin-top: 16px; padding: 16px 18px; border-radius: var(--radius);
  background: linear-gradient(120deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #8e4ec6));
  color: #fff; text-decoration: none; box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 30%, transparent);
  animation: rise-in 0.6s 0.25s var(--ease) both; transition: transform 0.2s var(--ease);
}
.review-cta:hover { transform: translateY(-2px); }
.review-cta strong { display: block; font-size: 1.05rem; }
.review-cta small { opacity: 0.88; }
.review-cta-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: rgb(255 255 255 / 18%); }
.review-cta-icon svg { animation: spin-slow 3s linear infinite; }
@keyframes spin-slow { to { transform: rotate(360deg); } }
.review-cta-go { margin-left: auto; font-size: 1.4rem; transition: transform 0.2s var(--ease); }
.review-cta:hover .review-cta-go { transform: translateX(4px); }
@media (prefers-color-scheme: dark) { .review-cta { color: #0d1424; } .review-cta-icon { background: rgb(255 255 255 / 30%); } }

.chapter { margin-top: 48px; }
.chapter-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.chapter h2 { font-size: 1.3rem; letter-spacing: -0.01em; }
.chapter h2 span { color: var(--muted); font-weight: 500; font-size: 0.92rem; margin-right: 6px; }
.chapter-count { color: var(--muted); font-size: 0.85rem; font-weight: 700; }
.chapter-count.is-complete { color: var(--good); }
.chapter-sub { color: var(--muted); font-size: 0.92rem; margin-top: 2px; }
.day-grid { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.day-card {
  position: relative; display: flex; align-items: center; gap: 12px; height: 100%;
  padding: 13px 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  color: var(--ink); text-decoration: none; overflow: hidden;
  transition: border-color 0.2s, transform 0.2s var(--ease), box-shadow 0.2s;
}
.day-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 10px 24px rgb(20 30 50 / 10%); }
.day-card.is-next { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.day-num {
  flex: none; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 0.9rem;
  background: var(--accent-soft); color: var(--accent);
  transition: transform 0.3s var(--spring);
}
.day-card:hover .day-num { transform: scale(1.1) rotate(-6deg); }
.day-card.is-done .day-num { background: var(--good); color: #fff; }
.day-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.day-text strong { font-size: 0.95rem; line-height: 1.3; }
.day-text small { color: var(--muted); font-size: 0.8rem; }
.day-emojis { font-size: 0.9rem; letter-spacing: 1px; opacity: 0.35; transition: opacity 0.2s, transform 0.3s var(--spring); }
.day-card:hover .day-emojis { opacity: 1; transform: scale(1.15); }

/* ─── 6. Page du jour ─── */
.back { display: inline-flex; font-size: 0.9rem; text-decoration: none; margin-bottom: 20px; font-weight: 600; transition: transform 0.2s var(--ease); }
.back:hover { transform: translateX(-3px); }
.page-head h1, .lesson-head h1 { font-size: clamp(1.8rem, 5vw, 2.4rem); line-height: 1.12; letter-spacing: -0.02em; margin-top: 6px; }
.lesson-en { color: var(--muted); font-style: italic; margin-top: 2px; }
.scene-tag {
  display: inline-block; margin-top: 14px; padding: 5px 12px; border-radius: 99px;
  background: var(--surface); border: 1px solid var(--line); font-size: 0.88rem;
}

.steps {
  position: sticky; top: calc(var(--topbar-h) + 8px); z-index: 10;
  display: flex; justify-content: center; gap: 4px; margin-top: 28px; padding: 5px; overflow-x: auto;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 99px; box-shadow: var(--shadow);
  scrollbar-width: none;
}
.step {
  flex: 1; justify-content: center; display: flex; align-items: center; gap: 7px; white-space: nowrap;
  border: none; background: none; padding: 7px 14px 7px 8px; border-radius: 99px; font-weight: 600; font-size: 0.9rem; color: var(--muted);
  transition: background 0.25s, color 0.25s;
}
.step span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--line); font-size: 0.75rem; transition: background 0.25s, color 0.25s; }
.step:hover { color: var(--ink); }
.step.is-active { background: var(--accent-soft); color: var(--accent); }
.step.is-active span { background: var(--accent); color: var(--accent-ink); }

.block { margin-top: 44px; }
.block h2 { display: flex; align-items: center; gap: 10px; font-size: 1.35rem; letter-spacing: -0.01em; }
.step-num { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-size: 0.9rem; }
.block-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.scene-tools { display: flex; gap: 8px; flex-wrap: wrap; }

/* Mots */
.word-grid { list-style: none; padding: 0; margin: 16px 0 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.word-cell { position: relative; }
.word-tile {
  width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 16px 6px 14px; border-radius: var(--radius); text-align: center;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--ink);
  transition: border-color 0.2s, transform 0.25s var(--ease), box-shadow 0.25s;
}
.word-tile:hover { border-color: hsl(var(--h) 70% 55%); transform: translateY(-3px); box-shadow: 0 12px 26px hsl(var(--h) 60% 40% / 14%); }
.word-tile strong { font-size: 0.95rem; line-height: 1.2; }
.word-tile small { color: var(--muted); font-size: 0.78rem; line-height: 1.25; }
.wt-emoji { font-size: 2.1rem; line-height: 1.2; display: inline-block; margin-bottom: 4px; }
.word-cell .fav-btn { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border: none; background: transparent; opacity: 0; }
.word-cell .fav-btn svg { width: 15px; height: 15px; }
.word-cell:hover .fav-btn, .word-cell .fav-btn.is-on, .word-cell .fav-btn:focus-visible { opacity: 1; }
.word-cell.flash .word-tile { animation: flash-tile 1.6s var(--ease); }
@keyframes flash-tile { 0%, 40% { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); transform: scale(1.05); } }

/* Expressions */
.expr-list { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; }
.expr {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease);
}
.expr:hover { transform: translateX(2px); }
.expr-body { flex: 1; min-width: 0; }
.expr-en { font-weight: 650; font-size: 1.05rem; }
.expr-fr { color: var(--muted); }
.expr-tip { font-size: 0.85rem; margin-top: 6px; padding-left: 10px; border-left: 3px solid var(--mark); color: var(--muted); }
.expr-actions { display: flex; gap: 6px; }
.expr.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0%, 30% { background: var(--accent-soft); border-color: var(--accent); } }

/* Scène */
.dialogue { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.line, .rp-line { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "who who" "bubble play"; gap: 4px 8px; max-width: 88%; }
.line.is-me, .rp-line.is-me { align-self: flex-end; grid-template-columns: auto 1fr; grid-template-areas: "who who" "play bubble"; }
.who { grid-area: who; font-size: 0.78rem; font-weight: 700; color: var(--muted); padding: 0 6px; }
.is-me .who { text-align: right; }
.bubble {
  grid-area: bubble; padding: 10px 14px; border-radius: 18px 18px 18px 4px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s var(--ease);
}
.is-me .bubble { border-radius: 18px 18px 4px 18px; background: var(--accent-soft); border-color: transparent; }
.play-line { grid-area: play; align-self: center; width: 32px; height: 32px; }
.play-line svg { width: 13px; height: 13px; }
.is-playing .bubble { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); transform: scale(1.015); }
.line-en { font-size: 1.02rem; }
.line-fr { color: var(--muted); font-size: 0.9rem; margin-top: 2px; }
.hide-fr .line .line-fr { display: none; }
mark { background: var(--mark); color: var(--mark-ink); border-radius: 4px; padding: 0 2px; cursor: pointer; }

/* Carte exercices */
.practice-card {
  display: flex; align-items: center; gap: 18px; margin-top: 16px; padding: 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--ink); text-decoration: none;
  transition: border-color 0.2s, transform 0.25s var(--ease);
}
.practice-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.practice-icons { display: flex; font-size: 1.6rem; }
.practice-icons span { display: grid; place-items: center; width: 44px; height: 44px; margin-left: -10px; border-radius: 50%; background: var(--surface-2); border: 2px solid var(--surface); transition: transform 0.3s var(--spring); }
.practice-icons span:first-child { margin-left: 0; }
.practice-card:hover .practice-icons span { transform: translateY(-4px); }
.practice-card:hover .practice-icons span:nth-child(2) { transition-delay: 0.05s; }
.practice-card:hover .practice-icons span:nth-child(3) { transition-delay: 0.1s; }
.practice-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.practice-text small { color: var(--muted); }
.practice-best { color: var(--good) !important; font-weight: 700; }

/* Journal de Modou (étape Écoute) */
.jr-card { margin-top: 16px; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.jr-player { display: flex; align-items: center; gap: 16px; }
.jr-play { width: 64px; height: 64px; margin: 0; flex: none; }
.jr-play svg { width: 24px; height: 24px; margin-left: 3px; }
.jr-play:disabled { opacity: 0.4; }
.jr-pause { font-size: 1.1rem; letter-spacing: -2px; }
.jr-info { flex: 1; min-width: 0; }
.jr-episode { font-weight: 700; }
.jr-episode-fr { color: var(--muted); font-size: 0.88rem; }
.jr-bar { height: 6px; margin: 10px 0 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.jr-bar span { display: block; width: 0; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--good)); transition: width 0.5s var(--ease); }
.jr-status { color: var(--muted); font-size: 0.85rem; }
.jr-reveal { margin-top: 14px; }
.jr-text { display: flex; flex-direction: column; gap: 4px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.jr-text.is-revealed { animation: page-in 0.5s var(--ease); }
.jr-line, .jr-proof-line {
  display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 8px 12px; border-radius: 12px;
  border: 1px solid transparent; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.jr-line:hover, .jr-proof-line:hover { background: var(--surface-2); }
.jr-line.is-playing { background: var(--accent-soft); border-color: var(--accent); }
.jr-en { font-size: 1.02rem; }
.jr-fr { color: var(--muted); font-size: 0.88rem; }
.hide-fr .jr-text .jr-fr { display: none; }
.jr-questions { list-style: none; display: flex; flex-direction: column; gap: 14px; margin-top: 18px; padding: 0; }
.jr-q { padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); transition: border-color 0.3s; }
.jr-q.is-right { border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.jr-q.is-wrong { border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.jr-q-type { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.jr-q-en { font-weight: 650; font-size: 1.05rem; margin-top: 4px; }
.jr-q-fr { color: var(--muted); font-size: 0.88rem; }
.jr-options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.jr-option { flex: 1 1 180px; padding: 10px 14px; font-size: 0.95rem; }
.jr-option small { color: var(--muted); font-weight: 400; }
.jr-option.is-picked { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.jr-proof { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.jr-proof-label { font-size: 0.85rem; font-weight: 700; color: var(--bad); }
.jr-q.is-right .jr-proof-label { color: var(--good); }
.jr-proof-line { margin-top: 4px; background: var(--surface-2); }
.jr-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 16px; }
.jr-score { font-size: 1.4rem; font-weight: 800; display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; }
.jr-score small { font-size: 0.9rem; font-weight: 500; color: var(--muted); }
.jr-score.is-perfect { color: var(--good); }

.finish { margin-top: 52px; padding-top: 28px; border-top: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.pager { width: 100%; display: flex; justify-content: space-between; gap: 12px; font-size: 0.9rem; margin-top: 18px; }
.pager a { text-decoration: none; font-weight: 600; }

/* ─── 7. Fenêtres (studio des mots, Joue Modou) ─── */
.modal {
  width: min(580px, calc(100vw - 24px)); max-height: calc(100dvh - 24px);
  padding: 0; border: none; border-radius: 24px; overflow: hidden;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg);
}
.modal[open] { display: flex; flex-direction: column; animation: modal-in 0.4s var(--spring); }
.modal::backdrop { background: rgb(10 14 24 / 60%); backdrop-filter: blur(5px); animation: fade-in 0.3s; }
@keyframes modal-in { from { opacity: 0; transform: scale(0.9) translateY(24px); } }
@keyframes fade-in { from { opacity: 0; } }
.modal-top { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; flex: none; }
.modal-label { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.modal-close { border: none; background: none; color: var(--muted); font-size: 1.1rem; width: 36px; height: 36px; border-radius: 50%; transition: background 0.2s, transform 0.2s; }
.modal-close:hover { background: var(--line); transform: rotate(90deg); }
.modal-actions { display: flex; justify-content: center; align-items: center; gap: 14px; padding: 10px 16px 20px; flex: none; }
.dots { display: flex; justify-content: center; gap: 6px; padding: 14px 0 4px; }
.dots span { width: 8px; height: 8px; border-radius: 99px; background: var(--line); transition: width 0.35s var(--ease), background 0.3s; }
.dots .is-past { background: var(--good); }
.dots .is-now { width: 28px; background: var(--accent); }

/* Scène animée d'un mot */
.stage {
  position: relative; overflow: hidden; margin: 0 16px; min-height: 370px; border-radius: 20px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 28px 20px; text-align: center; cursor: pointer;
  background: radial-gradient(circle at 50% 30%, hsl(var(--h) 85% 72% / 45%), transparent 65%),
              linear-gradient(160deg, hsl(var(--h) 70% 96%), hsl(calc(var(--h) + 40) 70% 90%));
  color: #1b2231;
  animation: stage-in 0.5s var(--ease);
}
@keyframes stage-in { from { opacity: 0.4; transform: scale(0.97); } }
@media (prefers-color-scheme: dark) {
  .stage {
    background: radial-gradient(circle at 50% 30%, hsl(var(--h) 80% 55% / 35%), transparent 65%),
                linear-gradient(160deg, hsl(var(--h) 35% 18%), hsl(calc(var(--h) + 40) 35% 13%));
    color: #f1f3f8;
  }
}
.st-burst {
  position: absolute; top: 30%; left: 50%; width: 140px; height: 140px; margin: -70px 0 0 -70px;
  border-radius: 50%; border: 3px solid hsl(var(--h) 80% 60%); opacity: 0;
  animation: burst 0.9s 0.15s ease-out both;
}
@keyframes burst { from { transform: scale(0.2); opacity: 0.9; } to { transform: scale(2.4); opacity: 0; } }
.st-emoji-wrap { animation: emoji-in 0.55s var(--spring) both; }
@keyframes emoji-in { from { transform: scale(0) rotate(-25deg); opacity: 0; } }
.st-emoji { display: inline-block; font-size: clamp(4.5rem, 18vw, 6.5rem); line-height: 1.1; filter: drop-shadow(0 8px 12px rgb(0 0 0 / 18%)); }
.st-word { position: relative; font-size: clamp(2rem, 9vw, 3rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; padding-bottom: 6px; }
.st-word span { display: inline-block; animation: letter-in 0.5s calc(0.35s + var(--i) * 55ms) var(--spring) both; }
@keyframes letter-in { from { opacity: 0; transform: translateY(-40px) rotate(-12deg) scale(0.6); filter: blur(4px); } }
.st-word::after {
  content: ""; position: absolute; left: 10%; right: 10%; bottom: 0; height: 4px; border-radius: 4px;
  background: hsl(var(--h) 80% 55%); transform-origin: left;
  animation: underline 0.5s calc(0.6s + var(--n) * 55ms) ease-out both;
}
@keyframes underline { from { transform: scaleX(0); } }
.st-fr, .st-example { opacity: 0; transform: translateY(14px); transition: opacity 0.45s, transform 0.45s var(--spring); }
.st-fr { font-size: 1.25rem; font-weight: 600; }
.st-fr::before { content: "🇫🇷 "; }
.st-example { font-size: 1.05rem; max-width: 34ch; margin-top: 6px; font-style: italic; }
.show-fr .st-fr, .show-ex .st-example { opacity: 1; transform: none; }
.st-hl {
  font-style: normal; font-weight: 700; padding: 0 3px; border-radius: 4px;
  background: linear-gradient(hsl(var(--h) 90% 65% / 55%), hsl(var(--h) 90% 65% / 55%)) no-repeat left / 0% 100%;
  transition: background-size 0.6s 0.35s ease-out;
}
.show-ex .st-hl { background-size: 100% 100%; }

/* Cartes à retourner */
.studio-quiz { padding: 0 16px; overflow-y: auto; }
.flip-grid { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.flip-grid li { animation: rise-in 0.45s calc(var(--i) * 50ms) var(--spring) both; }
.flip { width: 100%; aspect-ratio: 3 / 4; border: none; padding: 0; background: none; perspective: 600px; }
.flip-inner { position: relative; display: block; width: 100%; height: 100%; transition: transform 0.6s var(--spring); transform-style: preserve-3d; }
.flip:hover .flip-inner { transform: rotateY(12deg); }
.flip.is-flipped .flip-inner { transform: rotateY(180deg); }
.flip-face {
  position: absolute; inset: 0; border-radius: 12px; backface-visibility: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px;
}
.flip-front { background: hsl(var(--h) 70% 92%); color: #1b2231; }
.flip-front small { font-size: 0.72rem; line-height: 1.2; text-align: center; }
.flip-emoji { font-size: 1.9rem; }
.flip-back { background: hsl(var(--h) 65% 42%); color: #fff; transform: rotateY(180deg); font-size: 0.9rem; text-align: center; }

/* Joue Modou */
.roleplay { height: min(720px, calc(100dvh - 24px)); }
.rp-chat { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 4px 16px 16px; }
.rp-line { animation: bubble-in 0.45s var(--spring) both; }
.rp-line .bubble { grid-column: 1 / -1; }
.rp-line.is-me { grid-template-areas: "who" "bubble"; grid-template-columns: 1fr; }
.rp-line:not(.is-me) { grid-template-areas: "who" "bubble"; grid-template-columns: 1fr; }
@keyframes bubble-in { from { opacity: 0; transform: translateY(16px) scale(0.92); } }
.rp-line:not(.is-me) { transform-origin: left bottom; }
.rp-line.is-me { transform-origin: right bottom; }
.rp-badge { display: inline-block; margin-top: 6px; padding: 2px 9px; border-radius: 99px; font-size: 0.78rem; font-weight: 700; animation: badge-in 0.4s var(--spring); }
.rp-badge.is-great { background: var(--good); color: #fff; }
.rp-badge.is-close { background: #ffc53d; color: #3a2a00; }
.rp-badge.is-retry { background: var(--bad); color: #fff; }
.rp-panel { flex: none; border-top: 1px solid var(--line); padding: 14px 16px 18px; background: var(--surface-2); min-height: 76px; }
.rp-intro { align-self: center; text-align: center; max-width: 40ch; padding: 14px 16px; border-radius: 16px; background: var(--surface-2); border: 1px dashed var(--line); color: var(--muted); font-size: 0.92rem; animation: rise-in 0.5s var(--spring); }
.rp-intro strong { display: block; color: var(--ink); margin-bottom: 4px; }
.rp-wait { color: var(--muted); font-size: 0.9rem; display: flex; align-items: center; gap: 10px; }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: typing 1s infinite; }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-5px); opacity: 1; } }
.turn { animation: rise-in 0.4s var(--spring); }
.turn-label { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); }
.turn-fr { font-size: 1.1rem; font-weight: 600; margin-top: 4px; }
.turn-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; justify-content: center; }
.turn-actions .btn svg { width: 18px; height: 18px; }
.rp-end { text-align: center; animation: rise-in 0.5s var(--spring); }
.rp-score { font-size: 2.4rem; font-weight: 800; color: var(--accent); }

/* ─── 8. Exercices ─── */
.quiz-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.quiz-head .eyebrow { flex-basis: 100%; }
.quiz-progress { flex: 1; height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; }
.quiz-progress span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--good)); transition: width 0.5s var(--ease); }
.quiz-count { font-weight: 700; color: var(--muted); font-size: 0.9rem; }

.q-card {
  padding: 28px 22px; border-radius: 22px; text-align: center;
  background: linear-gradient(170deg, hsl(var(--h) 70% 97%), var(--surface) 60%);
  border: 1px solid var(--line); box-shadow: var(--shadow);
  animation: card-in 0.5s var(--spring);
}
@media (prefers-color-scheme: dark) { .q-card { background: linear-gradient(170deg, hsl(var(--h) 30% 18%), var(--surface) 60%); } }
@keyframes card-in { from { opacity: 0; transform: translateX(40px) rotate(2deg); } }
.q-card.is-wrong { animation: shake-x 0.45s; }
.q-card.is-right { animation: pop-card 0.45s var(--spring); }
@keyframes shake-x { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
@keyframes pop-card { 50% { transform: scale(1.03); } }
.q-type { font-weight: 700; color: var(--muted); font-size: 0.9rem; }
.q-visual { margin: 18px 0 8px; }
.q-emoji { display: inline-block; font-size: 4.5rem; line-height: 1.1; animation: emoji-in 0.6s var(--spring) both; }
.q-fr { font-size: 1.3rem; font-weight: 700; margin-top: 6px; }
.q-fr-small { font-size: 1.1rem; margin: 14px 0 6px; }
.q-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.q-option {
  padding: 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface);
  font-weight: 700; font-size: 1.05rem; transition: border-color 0.2s, transform 0.15s var(--ease), background 0.2s;
}
.q-option:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-2px); }
.q-option.is-right { border-color: var(--good); background: var(--good-soft); color: var(--good); animation: pop-card 0.4s var(--spring); }
.q-option.is-wrong { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); animation: shake-x 0.4s; }
.q-option:disabled:not(.is-right):not(.is-wrong) { opacity: 0.45; }

.listen-big {
  position: relative; width: 96px; height: 96px; margin: 22px auto 18px; display: grid; place-items: center;
  border-radius: 50%; border: none; background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 35%, transparent); transition: transform 0.2s var(--spring);
}
.listen-big svg { width: 34px; height: 34px; margin-left: 4px; }
.listen-big:hover { transform: scale(1.06); }
.listen-big .ripple { position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--accent); opacity: 0; }
.listen-big.is-playing .ripple { animation: ripple 1.2s ease-out 2; }
@keyframes ripple { from { transform: scale(1); opacity: 0.8; } to { transform: scale(1.7); opacity: 0; } }
.q-form { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.q-input {
  flex: 1; min-width: 200px; max-width: 340px; padding: 12px 16px; border-radius: 99px; font: inherit; font-size: 1.1rem; text-align: center;
  border: 2px solid var(--line); background: var(--surface); color: var(--ink); transition: border-color 0.2s, box-shadow 0.2s;
}
.q-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.order-answer {
  min-height: 62px; margin: 14px 0; padding: 10px; border-radius: 14px; border: 2px dashed var(--line);
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; transition: border-color 0.2s;
}
.order-answer:not(:empty) { border-color: var(--accent); border-style: solid; background: var(--accent-soft); }
.order-bank { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; min-height: 44px; margin-bottom: 14px; }
.chip {
  padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  font-weight: 600; box-shadow: 0 2px 0 var(--line); animation: chip-in 0.3s var(--spring);
  transition: transform 0.15s var(--ease);
}
.chip:hover { transform: translateY(-2px); }
@keyframes chip-in { from { transform: scale(0.6); opacity: 0; } }

.q-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 16px; min-height: 52px; }
.q-footer:empty { display: none; }
.q-result { display: flex; flex-direction: column; animation: rise-in 0.35s var(--spring); }
.q-result.is-right strong { color: var(--good); font-size: 1.1rem; }
.q-result.is-wrong strong { color: var(--bad); font-size: 1.1rem; }
.q-result span { color: var(--muted); }

.result { text-align: center; padding: 30px 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.result h1 { font-size: 2rem; letter-spacing: -0.02em; }
.result .hero-actions { justify-content: center; }
.result-stars { display: flex; gap: 8px; font-size: 3.4rem; line-height: 1; }
.result-stars span { color: var(--line); animation: star-in 0.6s calc(0.2s + var(--i) * 0.18s) var(--spring) both; }
.result-stars span.is-on { color: #ffc53d; text-shadow: 0 4px 14px rgb(255 180 0 / 40%); }
@keyframes star-in { from { transform: scale(0) rotate(-90deg); opacity: 0; } }
.result-score { font-size: 1.2rem; color: var(--muted); }
.result-score strong { font-size: 3rem; color: var(--ink); letter-spacing: -0.03em; }
.result-split { display: flex; gap: 12px; margin: 6px 0; }
.result-split span { padding: 6px 14px; border-radius: 99px; font-weight: 700; }
.result-split .is-knew { background: var(--good-soft); color: var(--good); }
.result-split .is-again { background: var(--bad-soft); color: var(--bad); }

/* ─── 9. Révisions ─── */
.review-card { perspective: 1200px; max-width: 520px; margin: 0 auto; animation: card-in 0.45s var(--spring); }
.review-inner { position: relative; display: grid; min-height: 320px; transition: transform 0.7s var(--spring); transform-style: preserve-3d; }
.review-card.is-flipped .review-inner { transform: rotateY(180deg); }
.review-face {
  grid-area: 1 / 1; backface-visibility: hidden; border-radius: 24px; padding: 26px 22px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center;
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.review-front { background: linear-gradient(165deg, hsl(var(--h) 70% 95%), var(--surface) 70%); }
.review-back { background: linear-gradient(165deg, var(--surface) 30%, hsl(var(--h) 70% 94%)); transform: rotateY(180deg); }
@media (prefers-color-scheme: dark) {
  .review-front { background: linear-gradient(165deg, hsl(var(--h) 30% 20%), var(--surface) 70%); }
  .review-back { background: linear-gradient(165deg, var(--surface) 30%, hsl(var(--h) 30% 20%)); }
}
.review-kind { position: absolute; top: 14px; left: 18px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.review-emoji { font-size: 4.2rem; line-height: 1.1; display: inline-block; animation-iteration-count: 1 !important; }
.review-fr { font-size: 1.45rem; font-weight: 700; }
.review-ask { color: var(--muted); }
.review-en { font-size: clamp(1.6rem, 6vw, 2.2rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.review-fr-small { color: var(--muted); }
.review-example { font-style: italic; color: var(--muted); max-width: 36ch; }
.review-tools { display: flex; gap: 8px; margin-top: 8px; }
.review-card .say-fb { text-align: center; }
.review-card.leave-right { animation: leave-right 0.35s var(--ease) forwards; }
.review-card.leave-left { animation: leave-left 0.35s var(--ease) forwards; }
@keyframes leave-right { to { opacity: 0; transform: translateX(80px) rotate(6deg); } }
@keyframes leave-left { to { opacity: 0; transform: translateX(-80px) rotate(-6deg); } }
.review-actions { display: flex; justify-content: center; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.review-actions .btn { min-width: 170px; }
.review-actions .btn svg { width: 18px; height: 18px; }
.review-keys { text-align: center; margin-top: 18px; font-size: 0.8rem; }

.empty { text-align: center; padding: 40px 0; display: flex; flex-direction: column; align-items: center; }
.empty h1 { font-size: 1.8rem; letter-spacing: -0.02em; margin-top: 8px; }
.empty .lead { max-width: 42ch; }
.empty .hero-actions { justify-content: center; }
.empty-art { font-size: 4.5rem; line-height: 1.1; animation: float 3s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-10px) rotate(4deg); } }

/* ─── 10. Listes (favoris, recherche) ─── */
.item-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.item-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.item-badge { font-size: 1.6rem; width: 40px; text-align: center; flex: none; }
.item-text { flex: 1; min-width: 0; }
.item-en { font-weight: 700; }
.item-fr { color: var(--muted); font-size: 0.9rem; }
.item-day { font-size: 0.8rem; font-weight: 700; text-decoration: none; padding: 4px 10px; border-radius: 99px; background: var(--accent-soft); white-space: nowrap; }
.item-actions { display: flex; gap: 6px; }
.search-box {
  display: flex; align-items: center; gap: 10px; margin-top: 20px; padding: 0 18px; border-radius: 99px;
  background: var(--surface); border: 2px solid var(--line); color: var(--muted); transition: border-color 0.2s, box-shadow 0.2s;
}
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); color: var(--accent); }
.search-box input { flex: 1; border: none; background: none; outline: none; padding: 14px 0; font: inherit; font-size: 1.05rem; color: var(--ink); }
.search-box + .hint { margin: 10px 4px 0; }

/* ─── 11. Retours (toast, confettis) ─── */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 50; transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  padding: 11px 18px; border-radius: 99px; background: var(--ink); color: var(--bg); font-weight: 600; font-size: 0.92rem;
  box-shadow: var(--shadow-lg); transition: opacity 0.3s, transform 0.4s var(--spring); max-width: calc(100vw - 32px);
}
.toast.is-shown { opacity: 1; transform: translate(-50%, 0); }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; }
.confetti span {
  position: absolute; width: 9px; height: 14px; border-radius: 2px;
  animation: confetti 1.5s cubic-bezier(.15, .7, .4, 1) both;
}
@keyframes confetti {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  100% { transform: translate(var(--dx), calc(var(--dy) + 420px)) rotate(var(--r)); opacity: 0; }
}

/* ─── 12. Mouvements : chaque mot bouge selon son sens ─── */
.st-emoji, .review-emoji, .word-tile:hover .wt-emoji {
  animation-duration: 1.4s; animation-delay: 0.55s; animation-iteration-count: 2;
  animation-timing-function: ease-in-out; animation-fill-mode: both;
}
.word-tile:hover .wt-emoji, .review-emoji { animation-delay: 0s; animation-iteration-count: 1; }
:is(.st-emoji, .review-emoji, .word-tile:hover .wt-emoji).motion-pop    { animation-name: m-pop; }
:is(.st-emoji, .review-emoji, .word-tile:hover .wt-emoji).motion-bounce { animation-name: m-bounce; }
:is(.st-emoji, .review-emoji, .word-tile:hover .wt-emoji).motion-fly    { animation-name: m-fly; }
:is(.st-emoji, .review-emoji, .word-tile:hover .wt-emoji).motion-rise   { animation-name: m-rise; }
:is(.st-emoji, .review-emoji, .word-tile:hover .wt-emoji).motion-fall   { animation-name: m-fall; }
:is(.st-emoji, .review-emoji, .word-tile:hover .wt-emoji).motion-spin   { animation-name: m-spin; }
:is(.st-emoji, .review-emoji, .word-tile:hover .wt-emoji).motion-shake  { animation-name: m-shake; }
:is(.st-emoji, .review-emoji, .word-tile:hover .wt-emoji).motion-pulse  { animation-name: m-pulse; }
:is(.st-emoji, .review-emoji, .word-tile:hover .wt-emoji).motion-swing  { animation-name: m-swing; transform-origin: 50% 0; }
:is(.st-emoji, .review-emoji, .word-tile:hover .wt-emoji).motion-grow   { animation-name: m-grow; }
:is(.st-emoji, .review-emoji, .word-tile:hover .wt-emoji).motion-shrink { animation-name: m-shrink; }
:is(.st-emoji, .review-emoji, .word-tile:hover .wt-emoji).motion-slide  { animation-name: m-slide; }
:is(.st-emoji, .review-emoji, .word-tile:hover .wt-emoji).motion-left   { animation-name: m-left; }
:is(.st-emoji, .review-emoji, .word-tile:hover .wt-emoji).motion-wave   { animation-name: m-wave; transform-origin: 70% 90%; }

@keyframes m-pop    { 30% { transform: scale(1.35); } 60% { transform: scale(0.9); } }
@keyframes m-bounce { 25% { transform: translateY(-35%); } 50% { transform: none; } 70% { transform: translateY(-12%); } }
@keyframes m-fly    { 45% { transform: translate(180%, -90%) rotate(-10deg); opacity: 0; } 50% { transform: translate(-180%, 90%); opacity: 0; } }
@keyframes m-rise   { 50% { transform: translateY(-30%) scale(1.05); } }
@keyframes m-fall   { 0% { transform: translateY(-80%); opacity: 0; } 55% { transform: translateY(8%); opacity: 1; } 75% { transform: translateY(-8%); } }
@keyframes m-spin   { to { transform: rotate(360deg); } }
@keyframes m-shake  { 10%, 50%, 90% { transform: translateX(-10%) rotate(-7deg); } 30%, 70% { transform: translateX(10%) rotate(7deg); } }
@keyframes m-pulse  { 20% { transform: scale(1.22); } 40% { transform: scale(1); } 60% { transform: scale(1.15); } }
@keyframes m-swing  { 25% { transform: rotate(16deg); } 75% { transform: rotate(-16deg); } }
@keyframes m-grow   { 0% { transform: scale(0.5); } 60% { transform: scale(1.5); } }
@keyframes m-shrink { 50% { transform: scale(0.4); } }
@keyframes m-slide  { 0% { transform: translateX(-160%); opacity: 0; } 60% { transform: translateX(8%); opacity: 1; } }
@keyframes m-left   { 0% { transform: translateX(160%); opacity: 0; } 60% { transform: translateX(-8%); opacity: 1; } }
@keyframes m-wave   { 20%, 60% { transform: rotate(22deg); } 40%, 80% { transform: rotate(-10deg); } }

/* ─── 13. Mobile & accessibilité ─── */
@media (max-width: 760px) {
  :root { --topbar-h: 54px; }
  /* Un flou sur la barre du haut piégerait la barre d'onglets « fixed » à l'intérieur. */
  .topbar { backdrop-filter: none; background: var(--bg); }
  .steps { gap: 2px; padding: 4px; }
  .step { padding: 7px 6px; font-size: 0.8rem; gap: 4px; }
  .step span { display: none; }
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  /* La navigation passe en barre d'onglets en bas de l'écran. */
  .mainnav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; justify-content: space-around; gap: 0;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
  }
  .mainnav a { flex-direction: column; gap: 2px; padding: 6px 10px; font-size: 0.7rem; border-radius: 14px; flex: 1; }
  .mainnav a.is-active { background: none; }
  .mainnav a.is-active svg { transform: translateY(-1px); }
  .nav-badge { position: absolute; top: 0; right: calc(50% - 26px); }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .speed-btn span { display: none; }
  .stats { grid-template-columns: 1fr; gap: 8px; }
  .stat { padding: 12px 14px; }
  .word-grid { grid-template-columns: repeat(2, 1fr); }
  .word-cell .fav-btn { opacity: 1; }
  .flip-grid { grid-template-columns: repeat(3, 1fr); }
  .stage { min-height: 300px; }
  .line, .rp-line { max-width: 100%; }
  .pager { flex-direction: column; align-items: center; }
  .practice-card { flex-wrap: wrap; }
  .practice-card .btn { width: 100%; }
  .item-row { flex-wrap: wrap; }
  .item-actions { margin-left: 52px; }
  .expr { flex-wrap: wrap; }
  .expr-body { flex-basis: calc(100% - 60px); }
  .expr-actions { margin-left: 52px; }
  .q-options { grid-template-columns: 1fr; }
  .review-actions .btn { min-width: 0; flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
