/* Trois voix : le serif raconte (titres, histoire), le sans explique, le mono mesure et code.
   Espacements sur une grille de 4 px. Une seule courbe d'animation. */
@font-face { font-family: "Newsreader"; src: url("fonts/newsreader.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist"; src: url("fonts/geist.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/jetbrains-mono.woff2") format("woff2"); font-weight: 100 800; font-style: normal; font-display: swap; }

:root {
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  --fond: #faf9f5;
  --surface: #ffffff;
  --surface-2: #f2f0e9;
  --texte: #1a1915;
  --discret: #6a665b;
  --bordure: #e5e1d6;
  --bordure-forte: #cdc8ba;
  --accent: #2440e0;
  --accent-doux: #e6eaff;
  --accent-texte: #ffffff;
  --bouton: var(--accent);
  --bouton-texte: #ffffff;
  --or: #d4950a;
  --or-doux: #faefd2;
  --succes: #1a7f47;
  --succes-doux: #e5f3ea;
  --echec: #b3261e;
  --echec-doux: #fbeae8;
  --code-fond: #1a1915;
  --code-texte: #efece3;
  --scene-bloc: #8c8677;
  --voile: rgba(26, 25, 21, .45);
  --largeur: 1240px;
  --rayon: 14px;
  --courbe: cubic-bezier(.22, 1, .36, 1);
  --rebond: cubic-bezier(.34, 1.56, .64, 1);
  /* Coup de pinceau aux bords irréguliers, utilisé comme masque derrière les libellés */
  --brosse: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 48' preserveAspectRatio='none'%3E%3Cpath d='M6 10C20 5 44 8 64 6c26-3 56 1 84-1 28-2 58 1 84 3 4 1 6 5 4 9 3 5-1 10 1 15 1 5-4 9-11 9-26 3-54-1-80 2-28 3-58-1-86 1-20 1-38-1-51-3-5-1-6-6-4-10-3-5 1-10-2-15-1-3 0-5 3-6z'/%3E%3C/svg%3E");
}

/* ---------- Couleurs de peinture des types d'étapes ---------- */
.type-cours { --c: #2b59ff; --c-encre: #ffffff; --c-ombre: #1636c2; }
.type-decouverte { --c: #12c28a; --c-encre: #04261a; --c-ombre: #078a60; }
.type-entrainement { --c: #ff8a1f; --c-encre: #2a1300; --c-ombre: #c25a00; }
.type-challenge { --c: #e8106f; --c-encre: #ffffff; --c-ombre: #a1064b; }
.type-validation { --c: #ffc61a; --c-encre: #2a1f00; --c-ombre: #c08f00; }

/* Libellé posé sur un coup de pinceau de la couleur --c */
.peinture { position: relative; isolation: isolate; display: inline-block; padding: 1px 9px 2px; color: var(--c-encre, #fff); font-weight: 600; line-height: 1.35; }
.peinture::before {
  content: ""; position: absolute; inset: 0 -2px; z-index: -1; background: var(--c, var(--accent));
  -webkit-mask: var(--brosse) center / 100% 100% no-repeat; mask: var(--brosse) center / 100% 100% no-repeat;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fond: #121210;
    --surface: #1a1a17;
    --surface-2: #22221e;
    --texte: #ecebe4;
    --discret: #a19d91;
    --bordure: #2e2d28;
    --bordure-forte: #46443c;
    --accent: #7fa8ff;
    --accent-doux: #1b2740;
    --accent-texte: #0b1326;
    --bouton: #ecebe4;
    --bouton-texte: #121210;
    --or: #efb83a;
    --or-doux: #32290f;
    --succes: #56c488;
    --succes-doux: #15291d;
    --echec: #ff8b7e;
    --echec-doux: #381a17;
    --code-fond: #0b0b09;
    --voile: rgba(0, 0, 0, .6);
  }
}

:root[data-theme="dark"] {
  --fond: #121210;
  --surface: #1a1a17;
  --surface-2: #22221e;
  --texte: #ecebe4;
  --discret: #a19d91;
  --bordure: #2e2d28;
  --bordure-forte: #46443c;
  --accent: #7fa8ff;
  --accent-doux: #1b2740;
  --accent-texte: #0b1326;
  --bouton: #ecebe4;
  --bouton-texte: #121210;
  --or: #efb83a;
  --or-doux: #32290f;
  --succes: #56c488;
  --succes-doux: #15291d;
  --echec: #ff8b7e;
  --echec-doux: #381a17;
  --code-fond: #0b0b09;
  --voile: rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: var(--sans);
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
h1, h2, h3, h4 { margin: 0 0 .5em; text-wrap: balance; }
h1, h2 { font-family: var(--serif); font-weight: 500; letter-spacing: -.015em; line-height: 1.15; }
h1 { font-size: 2rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1rem; font-weight: 600; line-height: 1.3; }
p { text-wrap: pretty; }
strong, b { font-weight: 600; }
code, kbd, pre, .editeur { font-family: var(--mono); font-variant-ligatures: none; }
code { font-size: .86em; background: var(--surface-2); border: 1px solid var(--bordure); padding: .08em .36em; border-radius: 4px; }
pre { background: var(--code-fond); color: var(--code-texte); padding: 12px 16px; border-radius: 8px; overflow-x: auto; font-size: .86rem; line-height: 1.6; }
pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
kbd { font-size: .7rem; font-weight: 500; line-height: 1; padding: 4px 6px; color: var(--discret); background: var(--surface); border: 1px solid var(--bordure-forte); border-bottom-width: 2px; border-radius: 4px; }
.discret { color: var(--discret); margin: 0; font-size: .9rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.ico { width: 20px; height: 20px; flex: none; }
.ico.etoile { fill: currentColor; stroke: none; }

/* ---------- En-tête joueur ---------- */
.entete {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 56px;
  padding-inline: max(24px, calc((100% - var(--largeur)) / 2 + 24px));
  background: color-mix(in srgb, var(--fond) 86%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--bordure);
}
.marque-site { font-family: var(--serif); font-weight: 500; font-size: 1.25rem; letter-spacing: -.01em; color: var(--texte); text-decoration: none; }
.entete-gauche, .entete-droite { display: flex; align-items: center; gap: 20px; min-width: 0; }
.entete-droite { gap: 16px; }
.nav-site { display: flex; gap: 4px; }
.nav-site a { display: flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 8px; font-size: .875rem; font-weight: 500; color: var(--discret); text-decoration: none; transition: background-color .15s var(--courbe), color .15s var(--courbe); }
.nav-site a:hover { color: var(--texte); background: var(--surface-2); }
.nav-site a.actif { color: var(--texte); background: var(--surface-2); font-weight: 600; }
.nav-site a[data-nav="anglais"].actif { background: color-mix(in srgb, #e8106f 14%, var(--surface)); color: color-mix(in srgb, #e8106f 70%, var(--texte)); }
.nav-site a[data-nav="code"].actif { background: color-mix(in srgb, #2b59ff 14%, var(--surface)); color: color-mix(in srgb, #2b59ff 70%, var(--texte)); }
.bouton-son { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--discret); cursor: pointer; transition: background-color .15s var(--courbe), color .15s var(--courbe); }
.bouton-son:hover { background: var(--surface-2); color: var(--texte); }
.bouton-son .ico { width: 18px; height: 18px; }
.bouton-son[aria-pressed="false"] { color: var(--bordure-forte); }
.joueur { display: flex; align-items: center; gap: 24px; }
.niveau { display: flex; align-items: center; gap: 8px; }
.anneau { position: relative; width: 32px; height: 32px; flex: none; }
.anneau svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.anneau circle { fill: none; stroke-width: 4; }
.anneau-fond { stroke: var(--bordure); }
.anneau-plein { stroke: #ff8a1f; stroke-linecap: round; transition: stroke-dashoffset .6s var(--courbe); }
.anneau span { position: absolute; inset: 0; display: grid; place-items: center; font: 500 .75rem var(--mono); }
.joueur-infos { display: grid; line-height: 1.25; }
.joueur-infos strong { font-size: .875rem; font-weight: 500; }
.joueur-infos .xp { font: 400 .75rem var(--mono); color: var(--discret); }
.compteurs { display: flex; align-items: center; gap: 16px; }
.compteur-joueur { display: flex; align-items: center; gap: 4px; font: 500 .8125rem var(--mono); }
.compteur-joueur .ico { width: 16px; height: 16px; color: var(--discret); }
.compteur-joueur.or .ico { color: var(--or); }
.compteur-joueur.serie .ico { color: #ff6a3d; }
.compteur-joueur.insignes .ico { color: #8b3dff; }

/* ---------- Mise en page ---------- */
.app { max-width: var(--largeur); margin: 0 auto; padding: 24px 24px 64px; }
.panneau, .chapitre {
  background: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
}
.panneau { padding: 24px 28px; margin-bottom: 16px; }
.panneau > h3 { margin: 24px 0 8px; }

/* ---------- Carte ---------- */
.carte-intro { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 48px; align-items: end; padding: 20px 0 4px; }
.carte-intro h1 { font-size: clamp(2.1rem, 4.6vw, 3.1rem); letter-spacing: -.025em; line-height: 1.05; margin-bottom: 16px; }
.intro-texte p { color: var(--discret); max-width: 36rem; margin: 0; font-size: 1.0625rem; }
.reprise { display: grid; gap: 12px; background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon); padding: 20px; }
.reprise-compte { margin: 0; font: 400 .75rem var(--mono); color: var(--discret); }
.reprise-compte strong { font-size: 1.5rem; font-weight: 500; color: var(--texte); }
.jauge { height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.jauge div { height: 100%; min-width: 10px; border-radius: inherit; background: linear-gradient(90deg, #2b59ff, #8b3dff 35%, #e8106f 65%, #ff8a1f); box-shadow: inset 0 3px 0 rgba(255, 255, 255, .28); }
.reprise-suite { margin: 4px 0 0; font-weight: 500; line-height: 1.3; }
.reprise-suite .discret { display: block; font-weight: 400; font-size: .8125rem; margin-bottom: 4px; }
.reprise .bouton { justify-content: center; }

.piste-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 48px 0 16px; padding-bottom: 12px; border-bottom: 1px solid var(--bordure); }
.titre-piste { font: 600 1rem/1.3 var(--sans); margin: 0; }
.titre-piste .peinture { font-size: 1.0625rem; font-weight: 700; padding: 2px 12px 3px; margin: 0 0 0 -4px; color: var(--c-encre); }
.titre-piste span { color: var(--discret); font-weight: 400; margin-left: 4px; }
.piste-compte { margin: 0; font: 400 .75rem var(--mono); color: var(--discret); white-space: nowrap; }

.chapitre { --retrait: 44px; padding: 24px 24px 20px; margin-bottom: 12px; }
.chapitre-tete { display: flex; align-items: flex-start; gap: 16px; }
.chapitre-num { flex: none; width: var(--retrait); margin-right: -16px; padding-top: .62em; font: 400 .75rem var(--mono); color: var(--discret); }
.chapitre-titres { flex: 1; min-width: 0; }
.titre-chapitre { font: 500 1.5rem/1.15 var(--serif); letter-spacing: -.015em; margin: 0 0 4px; }
.chapitre.verrouille { background: transparent; padding-block: 16px; }
.chapitre.verrouille .titre-chapitre { font-size: 1.25rem; color: var(--discret); }
.insigne-obtenu, .insigne-cache { display: flex; align-items: center; gap: 8px; font-size: .8125rem; padding-top: .45em; }
.insigne-obtenu { font-weight: 500; }
.insigne-obtenu .ico { width: 18px; height: 18px; color: var(--or); }
.insigne-cache { color: var(--discret); }
.insigne-cache .ico { width: 16px; height: 16px; }

.chapitre-recit { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 40px; margin: 16px 0 0 var(--retrait); padding-top: 16px; border-top: 1px solid var(--bordure); }
.histoire h3, .histoire h4, .objectifs h4 { font: 500 .8125rem/1.3 var(--sans); color: var(--discret); margin: 0 0 8px; }
.histoire p { font: 400 1.125rem/1.5 var(--serif); margin: 0; max-width: 40rem; }
.objectifs ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.objectifs li { position: relative; padding-left: 16px; font-size: .9375rem; line-height: 1.45; }
.objectifs li::before { content: ""; position: absolute; left: 0; top: .7em; width: 8px; height: 1px; background: var(--discret); }

/* La ligne d'un chapitre : une étape par arrêt. La forme dit le type
   (rond : étape, losange : challenge facultatif, carré : validation),
   le remplissage dit l'état (plein : fait, cerclé : à faire, tireté : fermé). */
.sentier {
  --taille: 40px; --ecart: 8px;
  list-style: none; margin: 12px -4px 0 calc(var(--retrait) - 4px); padding: 4px;
  display: grid; grid-template-columns: repeat(var(--n, 7), minmax(96px, 1fr)); gap: var(--ecart);
  overflow-x: auto;
}
.etape { position: relative; min-width: 0; }
.etape:not(:last-child)::after {
  content: ""; position: absolute; top: calc(var(--taille) / 2 - 1px); left: calc(var(--taille) / 2);
  width: calc(100% + var(--ecart)); height: 2px; background: var(--bordure-forte);
}
.etape.fini:not(:last-child)::after { background: var(--c); height: 3px; }
.etape > a, .etape > div { position: relative; z-index: 1; display: grid; justify-items: start; padding-right: 8px; text-decoration: none; color: inherit; border-radius: 8px; }
.etape > a:hover .etape-titre { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

.pastille-etape { position: relative; display: grid; place-items: center; flex: none; width: var(--taille, 40px); height: var(--taille, 40px); color: var(--texte); text-decoration: none; }
.pastille-etape::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--sous, var(--surface)); border: 1.5px solid var(--bordure-forte); transition: background-color .15s var(--courbe), border-color .15s var(--courbe), transform .2s var(--rebond); }
.pastille-etape .ico { position: relative; width: 18px; height: 18px; transition: transform .2s var(--rebond); }
.type-validation .pastille-etape::before { border-radius: 28%; }
.type-challenge .pastille-etape::before { inset: 11%; border-radius: 22%; transform: rotate(45deg); }
.type-challenge .pastille-etape .ico { width: 16px; height: 16px; }
/* Fait : rempli de la couleur du type, avec une ombre franche dessous */
li.fini .pastille-etape, .item-tete .pastille-etape { color: var(--c-encre); }
li.fini .pastille-etape::before, .item-tete .pastille-etape::before { background: var(--c); border-color: var(--c); box-shadow: 0 3px 0 var(--c-ombre); }
/* À faire : cerclé de couleur, qui respire doucement */
li.dispo .pastille-etape { color: var(--c); }
li.dispo .pastille-etape::before { border: 2.5px solid var(--c); box-shadow: 0 3px 0 color-mix(in srgb, var(--c) 45%, transparent); }
.sentier li.dispo .pastille-etape::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--c); opacity: 0; animation: respire 2.2s var(--courbe) infinite; pointer-events: none; }
.sentier li.dispo.type-validation .pastille-etape::after { border-radius: 30%; }
@keyframes respire { 0% { transform: scale(.85); opacity: .7; } 100% { transform: scale(1.25); opacity: 0; } }
li.ferme .pastille-etape { color: var(--discret); }
li.ferme .pastille-etape::before { border-style: dashed; }
li.ferme .pastille-etape .ico { width: 16px; height: 16px; }
a:hover .pastille-etape::before, a.pastille-etape:hover::before { background: var(--surface-2); }
li.dispo a:hover .pastille-etape::before, li.dispo a.pastille-etape:hover::before { background: color-mix(in srgb, var(--c) 16%, var(--surface)); }
li.fini a:hover .pastille-etape::before, li.fini a.pastille-etape:hover::before { background: color-mix(in srgb, var(--c) 85%, #fff); border-color: transparent; }
a:hover .pastille-etape .ico, a.pastille-etape:hover .ico { transform: scale(1.15) rotate(-6deg); }
a:active .pastille-etape::before, a.pastille-etape:active::before { box-shadow: none; translate: 0 2px; }

.etape-type { margin-top: 8px; font: 600 .6875rem/1.3 var(--sans); letter-spacing: .01em; color: var(--discret); }
.etape-type .peinture { margin-left: -3px; }
.etape.ferme .etape-type .peinture { opacity: .5; }
.item-tete .discret .peinture { font-size: .8125rem; margin-right: 2px; }
.etape-titre { font-size: .875rem; font-weight: 500; line-height: 1.3; }
.etape.ferme .etape-titre { color: var(--discret); }
.etape .etoiles { margin-top: 4px; }
.etape.ferme .etoiles { display: none; }

.etoiles { display: inline-flex; gap: 1px; }
.etoiles > span { display: grid; }
.etoiles .ico { width: 12px; height: 12px; }
.etoiles .pleine { color: var(--or); }
.etoiles .vide { color: var(--bordure-forte); }

.esquisse { display: flex; align-items: center; gap: 16px; width: fit-content; margin: 12px 0 0 var(--retrait); background: linear-gradient(var(--bordure-forte), var(--bordure-forte)) center / calc(100% - 8px) 1px no-repeat; }
.esquisse i { width: 8px; height: 8px; border-radius: 50%; background: var(--fond); border: 1px solid var(--bordure-forte); }
.esquisse .type-validation { border-radius: 2px; }
.esquisse .type-challenge { border-radius: 1px; transform: rotate(45deg); }

/* ---------- Élément ---------- */
.fil { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .875rem; margin-bottom: 16px; color: var(--discret); }
.fil a { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; color: var(--texte); text-decoration: none; transition: color .15s var(--courbe); }
.fil a:hover { color: var(--accent); }
.fil .ico { width: 16px; height: 16px; }
.fil-sep { color: var(--bordure-forte); }
.item-tete { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.item-tete h1 { font-size: clamp(1.5rem, 3.4vw, 2.125rem); letter-spacing: -.02em; margin-bottom: 4px; }
.item-tete > div:nth-child(2) { flex: 1; min-width: 0; }
.item-tete .pastille-etape { --taille: 48px; }
.item-tete .pastille-etape .ico { width: 20px; height: 20px; }
.item-etoiles .ico { width: 20px; height: 20px; }

.mini-sentier { --taille: 28px; --sous: var(--fond); list-style: none; display: flex; align-items: center; gap: 12px; padding: 0; margin: 0 0 24px; }
.mini-sentier li { position: relative; }
.mini-sentier li:not(:last-child)::after { content: ""; position: absolute; top: calc(50% - 1px); left: 100%; width: 12px; height: 2px; background: var(--bordure-forte); }
.mini-sentier li.fini:not(:last-child)::after { background: var(--c); }
.mini-sentier .pastille-etape .ico { width: 12px; height: 12px; }
.mini-sentier li.dispo .pastille-etape::before { border-width: 1.5px; }
.mini-sentier li.actif .pastille-etape::before { box-shadow: 0 0 0 2px var(--fond), 0 0 0 4px var(--c); }
.mini-sentier li.fini .pastille-etape::before { box-shadow: 0 2px 0 var(--c-ombre); }
.mini-sentier li.fini.actif .pastille-etape::before { box-shadow: 0 0 0 2px var(--fond), 0 0 0 4px var(--c); }

.onglets { display: inline-flex; gap: 2px; max-width: 100%; background: var(--surface-2); border-radius: 10px; padding: 4px; margin-bottom: 16px; overflow-x: auto; }
.onglet { display: flex; align-items: center; justify-content: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 6px; text-decoration: none; color: var(--discret); font-size: .875rem; font-weight: 500; white-space: nowrap; transition: color .15s var(--courbe); }
.onglet:hover { color: var(--texte); }
.onglet.actif { background: var(--surface); color: var(--texte); box-shadow: 0 0 0 1px var(--bordure), 0 1px 2px rgba(0, 0, 0, .05); }
.onglet .ico { width: 16px; height: 16px; }
.onglet .compte { font: 400 .75rem var(--mono); color: var(--discret); }

.consigne { font-size: 1.0625rem; max-width: 46rem; }
.consigne.courte { margin-top: 0; font-size: 1rem; max-width: 60rem; }
.criteres { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; max-width: 46rem; }
.criteres li { position: relative; padding-left: 24px; }
.criteres li::before { content: ""; position: absolute; left: 0; top: .32em; width: 14px; height: 14px; border: 1.5px solid var(--bordure-forte); border-radius: 4px; }
.regles-etoiles { list-style: none; padding: 0; margin: 0 0 16px; display: flex; gap: 8px 24px; flex-wrap: wrap; font-size: .9375rem; }
.regles-etoiles li { display: flex; align-items: center; gap: 8px; }
.regles-etoiles .ico { width: 16px; height: 16px; color: var(--or); }
.sujet .histoire { padding-bottom: 20px; margin-bottom: 24px; border-bottom: 1px solid var(--bordure); }

.cours { font-size: 1.0625rem; line-height: 1.65; }
.cours > * { max-width: 46rem; }
.cours > :first-child { margin-top: 0; }
.cours h3 { margin-top: 32px; font-size: 1.125rem; }
.cours li { margin-bottom: 4px; }
.a-retenir { background: var(--surface-2); border-radius: 8px; padding: 16px 20px; margin-top: 24px; }
.a-retenir > :first-child { margin-top: 0; }
.a-retenir > :last-child { margin-bottom: 0; }

.quiz p { max-width: 46rem; }
.choix { display: flex; gap: 8px; flex-wrap: wrap; }
.bouton.choix-bouton { height: auto; min-height: 36px; padding-block: 8px; white-space: normal; text-align: left; }
.choix-bouton code { background: none; border: 0; padding: 0; font-size: .875rem; font-weight: 500; }
.choix-bouton.juste { background: var(--succes-doux); border-color: var(--succes); color: var(--succes); }
.choix-bouton.faux { background: var(--echec-doux); border-color: var(--echec); color: var(--echec); animation: secoue .3s var(--courbe); }
@keyframes secoue { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.quiz-retour { min-height: 1.5em; font-weight: 500; max-width: 46rem; }
.quiz-retour.ok { color: var(--succes); }
.quiz-retour.ko { color: var(--echec); }

/* ---------- Résoudre ---------- */
.deux-colonnes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.etiquette { display: block; font-size: .8125rem; font-weight: 500; color: var(--discret); margin-bottom: 8px; }
.editeur {
  display: block; width: 100%; min-height: 300px; resize: vertical;
  font-size: .875rem; line-height: 1.6; tab-size: 4;
  background: var(--code-fond); color: var(--code-texte); caret-color: var(--code-texte);
  border: 1px solid var(--code-fond); border-radius: 8px; padding: 12px 16px;
}
.editeur::selection { background: rgba(127, 168, 255, .35); }
.editeur:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.apercu { display: block; width: 100%; height: 300px; background: #fff; border: 1px solid var(--bordure); border-radius: 8px; }

.actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.actions.centre { justify-content: center; }
.actions #suivant { margin-left: auto; }
.raccourci { display: inline-flex; gap: 4px; }
.bouton {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 16px; border-radius: 8px; cursor: pointer;
  font: 500 .9375rem/1 var(--sans); text-decoration: none; white-space: nowrap;
  background: var(--surface); color: var(--texte);
  border: 1px solid var(--bordure-forte);
  transition: background-color .15s var(--courbe), border-color .15s var(--courbe), transform .15s var(--courbe);
}
.bouton:hover { background: var(--surface-2); }
.bouton:active { transform: scale(.98); }
.bouton:focus-visible { border-radius: 8px; }
.bouton.principal { background: var(--bouton); color: var(--bouton-texte); border-color: transparent; box-shadow: 0 3px 0 color-mix(in srgb, var(--bouton) 55%, #000); font-weight: 600; }
.bouton.principal:hover { background: color-mix(in srgb, var(--bouton) 86%, var(--fond)); }
.bouton.principal:active { transform: translateY(2px); box-shadow: 0 1px 0 color-mix(in srgb, var(--bouton) 55%, #000); }
.bouton:disabled { opacity: .6; cursor: progress; }
.bouton .ico { width: 16px; height: 16px; }
.bouton[hidden] { display: none; }

.resultats { margin-top: 16px; }
.score-partiel { font-weight: 500; margin: 0 0 8px; }
.liste-resultats { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.liste-resultats li { display: flex; align-items: flex-start; gap: 8px; padding: 8px 12px; border-radius: 8px; font-size: .9375rem; }
.liste-resultats li .ico { width: 16px; height: 16px; margin-top: 4px; }
.liste-resultats li.ok { background: var(--succes-doux); color: var(--succes); }
.liste-resultats li.ko { background: var(--echec-doux); color: var(--echec); }
.liste-resultats span { color: var(--texte); }
.liste-resultats small { display: block; color: var(--discret); font-size: .8125rem; }
.message { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px; margin-top: 8px; font-size: .9375rem; }
.message p { margin: 0; }
.message .ico { width: 16px; height: 16px; }
.message.echec { background: var(--echec-doux); color: var(--echec); }
.message.remarques { align-items: flex-start; background: var(--or-doux); color: var(--texte); }
.message.remarques .ico { color: var(--or); margin-top: 4px; }
.message.remarques ul { margin: 4px 0 0; padding-left: 16px; }
.message.reussite { background: var(--succes-doux); color: var(--succes); margin: 0 0 8px; }

/* ---------- Conseils et correction ---------- */
.liste-conseils { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; max-width: 48rem; }
.liste-conseils li { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; border-radius: 8px; border: 1px solid var(--bordure); }
.liste-conseils .ico { width: 16px; height: 16px; margin-top: 4px; }
.liste-conseils .revele { background: var(--or-doux); border-color: transparent; animation: apparait .3s var(--courbe); }
.liste-conseils .revele .ico { color: var(--or); }
.liste-conseils .cache { color: var(--discret); border-style: dashed; }
.bloque { display: flex; align-items: center; gap: 16px; color: var(--discret); }
.bloque .ico { width: 24px; height: 24px; }
.bloque h2 { color: var(--texte); margin-bottom: 4px; }
.bloque p { margin: 0; max-width: 40rem; }
.explication { font-size: 1rem; max-width: 46rem; }
@keyframes apparait { from { opacity: 0; transform: translateY(-4px); } }

/* ---------- Code fourni, aide des mondes ---------- */
.code-fourni, .aide-api { background: var(--surface-2); border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; }
.code-fourni summary, .aide-api summary { cursor: pointer; font-size: .875rem; font-weight: 500; border-radius: 4px; }
.code-fourni h4 { margin: 12px 0 8px; font-size: .8125rem; font-weight: 500; color: var(--discret); }
.code-fourni pre { margin: 0 0 4px; font-size: .8125rem; max-height: 220px; }
.aide-api dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 12px 0 4px; font-size: .9375rem; }
.aide-api dt, .aide-api dd { margin: 0; }
.aide-api dt code { background: var(--surface); }
.aide-api dd { color: var(--discret); }
.etat-fantome { font: 400 .75rem var(--mono); color: var(--discret); margin-left: 8px; }
.etat-fantome.complet { color: var(--succes); }

/* ---------- Mondes animés ---------- */
.iframe-cachee { position: absolute; width: 1px; height: 1px; border: 0; opacity: 0; pointer-events: none; }
.scene-monde { background: var(--surface-2); border-radius: 8px; min-height: 220px; display: grid; place-items: center; padding: 12px; overflow: auto; }
.scene-svg { width: 100%; height: auto; max-height: 270px; display: block; }
.scene-msg { min-height: 1.5em; font-size: .9375rem; font-weight: 500; margin: 8px 0 4px; }
.scene-msg.ok { color: var(--succes); }
.scene-msg.ko { color: var(--echec); }
.situations { display: flex; gap: 8px; flex-wrap: wrap; }
.situation { display: inline-flex; align-items: center; gap: 4px; height: 28px; font: 500 .8125rem var(--sans); padding: 0 8px; border-radius: 6px; border: 1px solid var(--bordure-forte); background: var(--surface); color: var(--texte); cursor: pointer; transition: background-color .15s var(--courbe), border-color .15s var(--courbe); }
.situation .ico { width: 16px; height: 16px; }
.situation.ok .ico { color: var(--succes); }
.situation.ko .ico { color: var(--echec); }
.situation.actif { background: var(--accent-doux); border-color: var(--accent); }

.scene-svg .sol { fill: var(--surface); stroke: var(--bordure); stroke-width: 1; }
.scene-svg .caisse rect { fill: var(--scene-bloc); stroke: none; }
.scene-svg .caisse path { stroke: var(--surface-2); stroke-width: 1.5; stroke-linecap: round; opacity: .45; }
.scene-svg .maison { fill: var(--accent); }
.scene-svg .porte { fill: var(--surface); }
.scene-svg .colis rect { fill: var(--or); stroke: none; }
.scene-svg .colis path { stroke: var(--surface); stroke-width: 1.5; }
.scene-svg .livreur circle { fill: var(--texte); stroke: var(--surface); stroke-width: 2.5; }
.scene-svg .livreur .nez { fill: var(--surface); }
.scene-svg .livreur .charge { fill: var(--or); stroke: var(--surface); stroke-width: 1; }
.scene-svg .livreur.choc circle { fill: var(--echec); }
.scene-svg .socle { fill: var(--scene-bloc); }
.scene-svg .tige { fill: var(--bordure-forte); }
.scene-svg .nom-tour { font: 500 13px var(--mono); fill: var(--discret); }
.scene-svg .disque { fill: hsl(var(--teinte) 48% 56%); stroke: none; }
.scene-svg .disque.bouge { stroke: var(--texte); stroke-width: 2.5; }
.scene-svg .caisse-tri rect { fill: var(--scene-bloc); stroke: none; transition: fill .15s var(--courbe); }
.scene-svg .caisse-tri text { font: 500 13px var(--mono); fill: #fff; }
.scene-svg .caisse-tri .indice { fill: var(--discret); font-weight: 400; font-size: 11px; }
.scene-svg .caisse-tri.vue rect { fill: var(--accent); }
.scene-svg .caisse-tri.vue text:not(.indice) { fill: var(--accent-texte); }
.scene-svg .caisse-tri.bouge rect { fill: var(--or); }
.scene-svg .caisse-tri.bouge text:not(.indice) { fill: #1a1915; }

/* Console GDScript */
pre { tab-size: 4; }
.scene-monde:has(.console) { place-items: stretch; padding: 0; overflow: hidden; }
.console { display: flex; flex-direction: column; min-height: 220px; background: var(--code-fond); color: var(--code-texte); border-radius: 8px; }
.console-tete { font: 500 .75rem var(--sans); color: #a19d91; padding: 8px 12px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.console-lignes { flex: 1; margin: 0; padding: 10px 12px; max-height: 260px; overflow: auto; background: none; font: .8125rem/1.6 var(--mono); white-space: pre-wrap; word-break: break-word; }
.console-ligne { display: block; }
.console-vide { color: #8c8677; }

/* Scène Godot */
.scene-svg.jeu { border-radius: 6px; }
.scene-svg .jeu-fond { fill: var(--surface); }
.scene-svg .jeu-grille path { stroke: var(--bordure); stroke-width: 1; }
.scene-svg .jeu-mur { fill: var(--scene-bloc); }
.scene-svg .jeu-sol { fill: var(--scene-bloc); }
.scene-svg .jeu-herbe { stroke: var(--succes); stroke-width: 4; }
.scene-svg .jeu-zone { fill: var(--accent-doux); stroke: var(--accent); stroke-width: 2; stroke-dasharray: 5 4; }
.scene-svg .jeu-but .mat { stroke: var(--texte); stroke-width: 3; stroke-linecap: round; }
.scene-svg .jeu-but .drapeau { fill: var(--echec); }
.scene-svg .jeu-piece circle { fill: var(--or); stroke: color-mix(in srgb, var(--or) 70%, #000); stroke-width: 2; }
.scene-svg .jeu-piece path { stroke: color-mix(in srgb, var(--or) 60%, #000); stroke-width: 2; stroke-linecap: round; }
.scene-svg .jeu-perso rect, .scene-svg .jeu-perso path { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.scene-svg .jeu-perso .oeil { fill: var(--surface); }
.scene-svg .jeu-hud { font: 600 15px var(--sans); fill: var(--texte); }
.scene-svg .jeu-print { font: 400 12px var(--mono); fill: var(--discret); }
.scene-svg .touche rect { fill: var(--surface); stroke: var(--bordure-forte); stroke-width: 1.5; }
.scene-svg .touche path { fill: var(--discret); stroke: var(--discret); stroke-width: 1.5; stroke-linejoin: round; }
.scene-svg .touche.on rect { fill: var(--accent); stroke: var(--accent); }
.scene-svg .touche.on path { fill: var(--accent-texte); stroke: var(--accent-texte); }

/* Vue 3D Blender : toujours sombre, comme le viewport du logiciel */
.scene-monde:has(.vue3d) { background: #393939; }
.scene-svg.vue3d { border-radius: 6px; }
.scene-svg .bl-fond { fill: #393939; }
.scene-svg .bl-grille { stroke: #4b4b4b; }
.scene-svg .bl-axe-x { stroke: #c24c50; }
.scene-svg .bl-axe-y { stroke: #74a83e; }
.scene-svg .bl-origine { fill: #e9893a; stroke: #1d1d1d; }
.scene-svg .bl-origine.actif { fill: #ffbf73; }
.scene-svg .bl-vide { fill: #8a8a8a; font-family: var(--sans); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 30; display: grid; gap: 8px; }
.toast { display: flex; align-items: center; gap: 8px; background: var(--texte); color: var(--fond); padding: 8px 12px; border-radius: 8px; font-size: .875rem; font-weight: 500; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); animation: apparait .3s var(--courbe); transition: opacity .3s var(--courbe); }
.toast .ico { width: 16px; height: 16px; }
.toast.sortie { opacity: 0; }

/* ---------- Fenêtre de réussite ---------- */
.fenetre { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: var(--voile); animation: fondu .2s var(--courbe); }
.fenetre[hidden] { display: none; }
@keyframes fondu { from { opacity: 0; } }
.fenetre-boite { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--bordure); border-radius: 16px; padding: 32px 28px 24px; text-align: center; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); animation: entree .3s var(--courbe); }
@keyframes entree { from { transform: translateY(8px); opacity: 0; } }
.fenetre-boite h2 { font-size: 1.75rem; margin: 12px 0 4px; }
.grandes-etoiles { display: flex; justify-content: center; align-items: flex-end; gap: 8px; }
.grandes-etoiles > span { display: grid; }
.grandes-etoiles .ico { width: 44px; height: 44px; }
.grandes-etoiles span:nth-child(2) .ico { width: 56px; height: 56px; }
.grandes-etoiles > span:nth-child(2) { margin-bottom: 8px; }
.grandes-etoiles .pleine { color: var(--or); animation: etoile .4s var(--courbe) both; animation-delay: var(--d); }
.grandes-etoiles .vide { color: var(--bordure); }
@keyframes etoile { from { transform: scale(.6); opacity: 0; } }
.gain { font: 400 1rem var(--mono); color: var(--discret); margin: 16px 0 4px; }
.niveau-gagne { font-weight: 500; margin: 8px 0; }
.insigne-gagne { display: flex; align-items: center; gap: 12px; text-align: left; background: var(--or-doux); border-radius: 8px; padding: 12px 16px; margin-top: 16px; }
.insigne-gagne .ico { width: 24px; height: 24px; color: var(--or); }
.insigne-gagne strong { font-weight: 500; }
.insigne-gagne span { display: block; font-size: .875rem; color: var(--discret); }
.fenetre-boite .actions { margin-top: 24px; }

/* ---------- Compte ---------- */
.bouton-compte { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--bordure-forte); border-radius: 8px; background: var(--surface); color: var(--texte); font: 500 .8125rem var(--sans); cursor: pointer; max-width: 160px; transition: background-color .15s var(--courbe); }
.bouton-compte:hover { background: var(--surface-2); }
.bouton-compte .ico { width: 16px; height: 16px; flex: none; }
.bouton-compte.connecte .ico { color: #12a877; }
.compte-nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compte-boite { position: relative; text-align: left; width: min(440px, 100%); max-height: calc(100svh - 32px); overflow-y: auto; }
.compte-boite h2 { margin: 0 0 12px; font-size: 1.5rem; padding-right: 32px; }
.compte-boite > p { color: var(--discret); font-size: .9375rem; }
.fermer-compte { position: absolute; top: 16px; right: 16px; display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--discret); cursor: pointer; }
.fermer-compte:hover { background: var(--surface-2); color: var(--texte); }
.compte-onglets { display: flex; width: 100%; margin-bottom: 12px; }
.compte-onglets .onglet { flex: 1; border: 0; background: none; cursor: pointer; font-family: var(--sans); }
.compte-onglets .onglet.actif { background: var(--surface); }
.compte-form { display: grid; gap: 12px; margin-top: 8px; }
.compte-form .bouton { justify-content: center; height: 40px; }
.champ { display: grid; gap: 4px; font-size: .8125rem; font-weight: 600; color: var(--discret); }
.champ input { height: 42px; padding: 0 12px; border: 2px solid var(--bordure-forte); border-radius: 10px; background: var(--surface-2); color: var(--texte); font: 500 1rem var(--sans); }
.champ input:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.compte-erreur { margin: 0; min-height: 1.2em; color: var(--echec); font-size: .875rem; font-weight: 500; }
.compte-erreur:empty { display: none; }
.lien-discret { border: 0; background: none; padding: 4px 0; margin-top: 8px; color: var(--discret); font: 500 .875rem var(--sans); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.lien-discret:hover { color: var(--texte); }
.code-recup { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 14px 16px; margin: 12px 0; border-radius: 12px; background: var(--or-doux); }
.code-recup code { flex: 1; background: none; border: 0; padding: 0; font: 700 1.0625rem var(--mono); letter-spacing: .02em; white-space: nowrap; color: var(--texte); }
.case { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.case input { width: 18px; height: 18px; accent-color: var(--accent); }
.synchro { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: .875rem; color: var(--discret); }
.synchro .ico { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.synchro.ok { background: var(--succes-doux); color: var(--succes); }
.synchro.hors-ligne { background: var(--or-doux); color: var(--texte); }
.synchro.hors-ligne .ico { color: var(--or); }
.compte-actions { display: grid; gap: 8px; margin: 16px 0 4px; }
.compte-actions .bouton { justify-content: flex-start; }
.compte-bas { justify-content: space-between; margin-top: 20px; }
.compte-bas .lien-discret { margin: 0; }
.compte-form.danger { padding: 12px 14px; border-radius: 12px; background: var(--echec-doux); margin-top: 12px; }
.compte-form.danger p { margin: 0; font-size: .875rem; color: var(--echec); }
.bouton.danger { background: var(--echec); color: #fff; border-color: transparent; }
.bouton.danger:hover { background: color-mix(in srgb, var(--echec) 85%, #000); }
.discret.petit { font-size: .8125rem; margin-top: 12px; }

/* ---------- Effets ---------- */
.fx-toile { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 60; pointer-events: none; }
.fx-flotte { position: fixed; z-index: 61; transform: translate(-50%, -50%); pointer-events: none; font: 800 1rem var(--sans); color: #ff8a1f; text-shadow: 0 2px 0 var(--fond), 0 0 12px var(--fond); white-space: nowrap; animation: flotte 1.4s var(--courbe) forwards; }
@keyframes flotte { 0% { opacity: 0; transform: translate(-50%, -20%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -60%) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, 120%) scale(1); } }
.fx-secoue { animation: secoue-fort .4s var(--courbe); }
@keyframes secoue-fort { 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }
.fenetre-boite .grandes-etoiles .pleine { animation: etoile-pop .55s var(--rebond) both; animation-delay: calc(var(--d) * 1.5 + .35s); }
@keyframes etoile-pop { 0% { transform: scale(0) rotate(-40deg); opacity: 0; } 70% { transform: scale(1.25) rotate(8deg); opacity: 1; } 100% { transform: scale(1) rotate(0); } }
.fenetre-boite .gain { font-weight: 700; font-size: 1.125rem; color: #ff8a1f; }

/* ---------- Anglais : chemin ---------- */
.anglais-intro { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 48px; align-items: end; padding: 20px 0 4px; }
.anglais-intro h1 { font-size: clamp(2.1rem, 4.6vw, 3.1rem); letter-spacing: -.025em; line-height: 1.05; margin-bottom: 16px; }
.unite { --u: #2b59ff; margin-top: 40px; }
.unite-tete {
  position: relative; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 20px 24px; border-radius: 18px; background: var(--u); color: var(--u-encre); box-shadow: 0 4px 0 var(--u-ombre);
}
.unite-num { margin: 0 0 2px; font: 700 .8125rem var(--sans); opacity: .82; }
.unite-tete h2 { font-size: 1.625rem; margin: 0 0 2px; }
.unite-tete p { margin: 0; }
.unite-mots { position: relative; z-index: 1; flex: none; }
.unite-mots summary { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 12px; cursor: pointer; list-style: none; font-weight: 600; font-size: .875rem; border: 2px solid color-mix(in srgb, var(--u-encre) 35%, transparent); }
.unite-mots summary::-webkit-details-marker { display: none; }
.unite-mots summary:hover { background: color-mix(in srgb, var(--u-encre) 12%, transparent); }
.unite-mots summary .ico { width: 18px; height: 18px; }
.unite-mots ul { position: absolute; right: 0; top: calc(100% + 8px); z-index: 5; width: 280px; list-style: none; margin: 0; padding: 8px; background: var(--surface); color: var(--texte); border: 1px solid var(--bordure); border-radius: 14px; box-shadow: 0 12px 32px rgba(0, 0, 0, .16); display: grid; gap: 2px; animation: apparait .2s var(--courbe); }
.unite-mots li { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: .9375rem; }
.unite-mots li span { color: var(--discret); }
.mot-ecoute { border: 0; background: none; padding: 6px 8px; border-radius: 8px; font: 600 .9375rem var(--sans); color: var(--texte); cursor: pointer; text-align: left; }
.mot-ecoute:hover { background: color-mix(in srgb, var(--u) 14%, var(--surface)); color: color-mix(in srgb, var(--u) 75%, var(--texte)); }

.chemin { list-style: none; margin: 0; padding: 40px 0 16px; display: grid; justify-items: center; gap: 28px; }
.noeud { position: relative; display: grid; justify-items: center; gap: 8px; transform: translateX(var(--x)); }
.noeud.actuel { margin-top: 36px; }
.noeud > a, .noeud > span[aria-disabled] { display: block; border-radius: 50%; text-decoration: none; }
.noeud-rond {
  display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%;
  background: var(--surface-2); color: var(--bordure-forte); box-shadow: 0 6px 0 var(--bordure-forte);
  transition: transform .2s var(--rebond), box-shadow .1s var(--courbe), translate .1s var(--courbe);
}
.noeud-rond .ico { width: 30px; height: 30px; stroke-width: 2.5; }
.noeud.dispo .noeud-rond, .noeud.fait .noeud-rond { background: var(--u); color: var(--u-encre); box-shadow: 0 6px 0 var(--u-ombre), inset 0 -4px 0 rgba(0, 0, 0, .08), inset 0 5px 0 rgba(255, 255, 255, .22); }
.noeud.parfait .noeud-rond { background: #ffc61a; color: #2a1f00; box-shadow: 0 6px 0 #c08f00, inset 0 5px 0 rgba(255, 255, 255, .3); }
.noeud > a:hover .noeud-rond { transform: scale(1.06); }
.noeud > a:active .noeud-rond { translate: 0 5px; box-shadow: 0 1px 0 var(--u-ombre); }
.noeud.actuel .noeud-rond { outline: 4px solid color-mix(in srgb, var(--u) 30%, transparent); outline-offset: 6px; animation: noeud-pulse 2s var(--courbe) infinite; }
@keyframes noeud-pulse { 50% { outline-offset: 10px; outline-color: color-mix(in srgb, var(--u) 12%, transparent); } }
.noeud-nom { font-size: .8125rem; font-weight: 600; color: var(--discret); }
.noeud.dispo .noeud-nom, .noeud.fait .noeud-nom { color: var(--texte); }
.bulle {
  position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%); white-space: nowrap;
  padding: 6px 14px; border-radius: 10px; background: var(--surface); color: var(--u-ombre); border: 2px solid var(--bordure); font: 800 .8125rem var(--sans); letter-spacing: .02em; text-transform: uppercase;
  animation: bulle 1.6s ease-in-out infinite;
}
:root[data-theme="dark"] .bulle { color: var(--u); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bulle { color: var(--u); } }
.bulle::after { content: ""; position: absolute; top: 100%; left: 50%; width: 10px; height: 10px; background: var(--surface); border: 2px solid var(--bordure); border-top: 0; border-left: 0; transform: translate(-50%, -5px) rotate(45deg); }
@keyframes bulle { 50% { transform: translate(-50%, -5px); } }
.unite.fermee .unite-tete { background: var(--surface-2); color: var(--discret); box-shadow: 0 4px 0 var(--bordure-forte); }
.unite.fermee .unite-mots summary { border-color: var(--bordure-forte); }
.unite-verrou { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; color: var(--discret); font-size: .875rem; }
.unite-verrou .ico { width: 16px; height: 16px; }

/* ---------- Anglais : en-tête, compteurs, objectif ---------- */
.objectif-jour { display: flex; align-items: center; gap: 14px; }
.anneau-obj { position: relative; width: 52px; height: 52px; flex: none; display: grid; place-items: center; color: #ff8a1f; }
.anneau-obj svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.anneau-obj circle { fill: none; stroke-width: 5; }
.anneau-obj .fond { stroke: var(--surface-2); }
.anneau-obj .plein { stroke: #ff8a1f; stroke-linecap: round; transition: stroke-dashoffset .6s var(--courbe); }
.anneau-obj .ico { width: 20px; height: 20px; }
.objectif-choix { display: flex; align-items: center; gap: 8px; font-size: .8125rem; color: var(--discret); margin-top: 2px; }
.objectif-choix select, .en-voix-panneau select { font: 500 .8125rem var(--sans); color: var(--texte); background: var(--surface); border: 1px solid var(--bordure-forte); border-radius: 6px; padding: 3px 6px; }
.semaine { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.semaine li { display: grid; justify-items: center; gap: 2px; font: 500 .6875rem var(--mono); color: var(--discret); }
.semaine li span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); border: 2px solid transparent; }
.semaine li.entame span { border-color: #ff8a1f; }
.semaine li.plein span { background: #ff8a1f; color: #2a1300; box-shadow: 0 2px 0 #c25a00; }
.semaine li.plein .ico { width: 14px; height: 14px; }
.semaine li.auj { color: var(--texte); font-weight: 700; }

.en-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 24px; }
.en-stat { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 2px solid var(--bordure); border-bottom-width: 4px; border-radius: 16px; background: var(--surface); color: var(--texte); text-decoration: none; transition: transform .15s var(--rebond), border-color .15s var(--courbe); }
.en-stat:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--s) 45%, var(--bordure)); }
.en-stat-ico { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 12px; background: var(--s); color: var(--s-encre); box-shadow: 0 3px 0 var(--s-ombre); }
.en-stat-ico .ico { width: 22px; height: 22px; stroke-width: 2.4; }
.en-stat strong { font: 800 1.5rem/1 var(--sans); }
.en-stat .sur { font: 500 .875rem var(--mono); color: var(--discret); }
.en-stat small { display: block; margin-top: 3px; font-size: .8125rem; color: var(--discret); }
.en-stat.mots { --s: #12c28a; --s-encre: #04261a; --s-ombre: #078a60; }
.en-stat.verbes { --s: #e8106f; --s-encre: #fff; --s-ombre: #a1064b; }
.en-stat.revision { --s: #8b3dff; --s-encre: #fff; --s-ombre: #5d1ccc; }
.en-stat.lecons { --s: #2b59ff; --s-encre: #fff; --s-ombre: #1636c2; }

.en-barre:first-child { margin-top: 0; }
.en-barre { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 24px 0 8px; padding-bottom: 12px; border-bottom: 1px solid var(--bordure); }
.en-onglets { display: flex; gap: 4px; overflow-x: auto; }
.en-onglets a { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 10px; color: var(--discret); text-decoration: none; font-weight: 600; font-size: .9375rem; white-space: nowrap; transition: background-color .15s var(--courbe), color .15s var(--courbe); }
.en-onglets a:hover { background: var(--surface-2); color: var(--texte); }
.en-onglets a.actif { background: color-mix(in srgb, #e8106f 13%, var(--surface)); color: color-mix(in srgb, #e8106f 75%, var(--texte)); }
.en-onglets .ico { width: 18px; height: 18px; }
.pastille-nb { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #8b3dff; color: #fff; font: 700 .6875rem/20px var(--sans); text-align: center; }
.en-voix { position: relative; flex: none; }
.en-voix summary { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 10px; cursor: pointer; list-style: none; color: var(--discret); font-size: .875rem; font-weight: 500; }
.en-voix summary::-webkit-details-marker { display: none; }
.en-voix summary:hover, .en-voix[open] summary { background: var(--surface-2); color: var(--texte); }
.en-voix summary .ico { width: 18px; height: 18px; }
.en-voix-panneau { position: absolute; right: 0; top: calc(100% + 8px); z-index: 6; width: 300px; display: grid; gap: 8px; padding: 16px; background: var(--surface); border: 1px solid var(--bordure); border-radius: 14px; box-shadow: 0 12px 32px rgba(0, 0, 0, .16); animation: apparait .2s var(--courbe); }
.en-voix-panneau label { font-size: .8125rem; font-weight: 600; display: flex; justify-content: space-between; }
.en-voix-panneau select { width: 100%; padding: 6px 8px; }
.en-voix-panneau input[type="range"] { width: 100%; accent-color: #e8106f; }
.en-voix-panneau .bouton { justify-content: center; margin-top: 4px; }
.en-voix-panneau .discret { font-size: .8125rem; }

.en-contenu { padding-top: 8px; }
.en-section { margin-top: 24px; }
.en-section-tete { margin-bottom: 16px; }
.en-section-tete h2 { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.en-section-tete .discret { max-width: 46rem; }
.compte-titre { font: 500 .875rem var(--mono); color: var(--discret); }
.unite-outils { display: flex; gap: 8px; flex-wrap: wrap; position: relative; z-index: 2; }
.unite-mots ul.astuces { width: 340px; gap: 8px; padding: 14px 16px; list-style: disc; padding-left: 32px; }
.unite-mots ul.astuces li { display: list-item; font-size: .9375rem; line-height: 1.5; }

/* Niveaux A1 à C1 */
.niveaux { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 8px 0 20px; }
.niveau-puce { display: grid; gap: 1px; padding: 10px 14px; border: 2px solid var(--bordure); border-bottom-width: 4px; border-radius: 14px; background: var(--surface); color: var(--texte); text-decoration: none; transition: transform .15s var(--rebond), border-color .15s var(--courbe); }
.niveau-puce:hover { transform: translateY(-2px); }
.niveau-puce strong { font: 800 1.125rem var(--sans); }
.niveau-puce span { font-size: .75rem; color: var(--discret); }
.niveau-puce small { font: 500 .75rem var(--mono); color: var(--discret); margin-top: 2px; }
.niveau-puce.actif { background: #e8106f; border-color: #a1064b; color: #fff; }
.niveau-puce.actif span, .niveau-puce.actif small { color: rgba(255, 255, 255, .85); }
.niveau-puce.ferme:not(.actif) { opacity: .6; }
.niveau-verrou { display: flex; gap: 16px; align-items: flex-start; padding: 20px 24px; margin-bottom: 24px; border-radius: 18px; background: var(--surface); border: 2px dashed var(--bordure-forte); }
.niveau-verrou > .ico { width: 28px; height: 28px; color: var(--discret); flex: none; margin-top: 4px; }
.niveau-verrou h2 { margin-bottom: 4px; }
.niveau-verrou p { margin: 0 0 16px; color: var(--discret); max-width: 44rem; }
.niveau-verrou .bouton-gros { --u: #e8106f; --u-encre: #fff; --u-ombre: #a1064b; }
.niveau-tag { margin-left: 8px; padding: 0 6px; border-radius: 6px; background: rgba(255, 255, 255, .25); font: 700 .6875rem var(--mono); }
.verbe-irr.etat { color: #5d1ccc; }
.carte-verbe.maitrise .verbe-irr.etat { color: rgba(255, 255, 255, .85); }
.note-groupe { margin: -8px 0 16px; max-width: 46rem; }

/* Verbes et temps */
.grille-temps { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.carte-temps { display: flex; flex-direction: column; gap: 10px; padding: 0 0 16px; border-radius: 16px; background: var(--surface); border: 2px solid var(--bordure); overflow: hidden; }
.carte-temps > :not(.carte-temps-tete) { margin-inline: 16px; }
.carte-temps-tete { padding: 14px 16px 12px; background: var(--u); color: var(--u-encre); }
.carte-temps-tete h3 { font: 600 1.25rem/1.2 var(--serif); margin: 0; }
.carte-temps-tete p { margin: 2px 0 0; font-size: .8125rem; opacity: .85; }
.exemple-temps { margin: 0; font-weight: 600; font-size: 1rem; }
.carte-temps .discret { flex: 1; font-size: .875rem; }
.carte-temps-actions { display: flex; gap: 8px; }
.carte-temps-actions .bouton { flex: 1; justify-content: center; }
.carte-temps .bouton.principal { --bouton: var(--u); --bouton-texte: var(--u-encre); }

.grille-verbes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.carte-verbe { position: relative; display: grid; gap: 4px; padding: 12px 14px; border: 2px solid var(--bordure); border-bottom-width: 4px; border-radius: 14px; background: var(--surface); color: var(--texte); text-decoration: none; transition: transform .15s var(--rebond), border-color .15s var(--courbe); height: 100%; }
.carte-verbe:hover { transform: translateY(-2px); border-color: color-mix(in srgb, #e8106f 40%, var(--bordure)); }
.carte-verbe.maitrise { background: #e8106f; border-color: #a1064b; color: #fff; }
.verbe-base { font: 700 1.125rem var(--sans); }
.verbe-fr { font-size: .8125rem; color: var(--discret); }
.carte-verbe.maitrise .verbe-fr, .carte-verbe.maitrise .verbe-irr { color: rgba(255, 255, 255, .85); }
.verbe-ok { position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #fff; color: #e8106f; }
.verbe-ok .ico { width: 14px; height: 14px; stroke-width: 3; }
.verbe-irr { font-size: .6875rem; font-weight: 600; color: #c25a00; }
.points-formes { display: flex; gap: 4px; margin-top: 4px; }
.points-formes i { width: 100%; height: 6px; border-radius: 3px; background: var(--surface-2); }
.points-formes i.vu { background: color-mix(in srgb, #e8106f 30%, var(--surface-2)); }
.points-formes i.ok { background: #e8106f; }
.carte-verbe.maitrise .points-formes i { background: #fff; }

.verbe-tete { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 20px 24px; margin-bottom: 16px; border-radius: 18px; background: var(--u); color: var(--u-encre); box-shadow: 0 4px 0 var(--u-ombre); }
.verbe-tete h1 { margin: 0; font-size: clamp(1.75rem, 4vw, 2.5rem); }
.verbe-tete .discret { color: inherit; opacity: .85; }
.verbe-tete .bouton-gros { background: var(--surface); color: var(--texte); box-shadow: 0 4px 0 color-mix(in srgb, var(--u-ombre) 70%, #000); }
.formes { list-style: none; margin: 0 0 24px; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.formes li { display: grid; gap: 6px; padding: 12px; border-radius: 14px; border: 2px solid var(--bordure); background: var(--surface); }
.formes li.ok { border-color: color-mix(in srgb, var(--succes) 50%, var(--bordure)); }
.forme-nom { font-size: .75rem; font-weight: 600; color: var(--discret); }
.forme-mot { display: flex; align-items: center; gap: 6px; border: 0; background: none; padding: 0; font: 700 1.125rem var(--sans); color: var(--texte); cursor: pointer; text-align: left; }
.forme-mot .ico { width: 16px; height: 16px; color: #e8106f; flex: none; }
.forme-etat { display: flex; align-items: center; gap: 4px; font-size: .75rem; color: var(--discret); }
.formes li.ok .forme-etat { color: var(--succes); font-weight: 600; }
.forme-etat .ico { width: 14px; height: 14px; }
.grille-conj { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.conj { padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 2px solid var(--bordure); }
.conj h3 { margin: 0 0 8px; }
.conj h3 a { color: color-mix(in srgb, var(--u) 80%, var(--texte)); text-decoration: none; }
.conj h3 a:hover { text-decoration: underline; }
.conj table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.conj th { text-align: left; font-weight: 500; color: var(--discret); padding: 3px 8px 3px 0; width: 72px; }
.conj td { font-weight: 600; padding: 3px 0; }
.conj-plus { display: flex; gap: 8px; margin: 6px 0 0; font-size: .875rem; }
.conj-plus span { display: grid; place-items: center; width: 18px; height: 18px; flex: none; border-radius: 5px; background: var(--u); color: var(--u-encre); font-weight: 800; font-size: .75rem; }

.cours-temps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cours-bloc { padding: 16px 20px; border-radius: 16px; background: var(--surface); border: 2px solid var(--bordure); }
.cours-bloc h3 { margin: 0 0 8px; color: color-mix(in srgb, var(--u) 75%, var(--texte)); }
.cours-bloc p { margin: 0; }
.tableau-ex { margin-top: 10px; border-collapse: collapse; }
.tableau-ex td { padding: 3px 8px 3px 0; font-weight: 600; }
.tableau-ex .mot-ecoute { padding: 4px; display: grid; }
.tableau-ex .ico { width: 16px; height: 16px; color: var(--u); }
.signaux { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.signaux li { padding: 4px 12px; border-radius: 999px; background: color-mix(in srgb, var(--u) 14%, var(--surface)); color: color-mix(in srgb, var(--u) 70%, var(--texte)); font-weight: 600; font-size: .9375rem; }
.piege { display: flex; gap: 10px; align-items: flex-start; }
.piege .ico { width: 20px; height: 20px; color: var(--or); margin-top: 2px; }

/* Vocabulaire et révision */
.filtres { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filtre { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 999px; border: 2px solid var(--bordure); color: var(--discret); text-decoration: none; font-weight: 600; font-size: .875rem; }
.filtre:hover { color: var(--texte); }
.filtre.actif { background: var(--texte); border-color: var(--texte); color: var(--fond); }
.filtre .compte { font: 500 .75rem var(--mono); opacity: .8; }
.groupe-mots { margin-bottom: 20px; }
.groupe-mots h3 { margin: 0 0 8px; }
.liste-mots { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 6px; }
.liste-mots li { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; border-radius: 12px; background: var(--surface); border: 1px solid var(--bordure); }
.liste-mots .mot-ecoute { display: grid; padding: 6px; }
.liste-mots .mot-ecoute .ico { width: 16px; height: 16px; color: var(--u, #8b3dff); }
.mot-en { font-weight: 700; }
.mot-fr { color: var(--discret); font-size: .9375rem; }
.solidite { display: flex; gap: 2px; }
.solidite i { width: 6px; height: 14px; border-radius: 2px; background: var(--surface-2); }
.solidite i.ok { background: var(--u, #8b3dff); }
.mot-etat { min-width: 56px; text-align: right; font-size: .75rem; font-weight: 600; color: var(--discret); }
.liste-mots li.revoir .mot-etat { color: #8b3dff; }
.liste-mots li.appris .mot-etat { color: var(--succes); }
.liste-mots li.nouveau { opacity: .6; }
.liste-mots.faibles li { grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.4fr) auto; }
.liste-mots.faibles .mot-etat { color: var(--echec); min-width: 70px; }
.grille-rev { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.carte-rev { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 20px; border-radius: 18px; background: var(--surface); border: 2px solid var(--bordure); border-bottom-width: 4px; }
.carte-rev h3 { margin: 4px 0 0; font: 600 1.25rem/1.2 var(--serif); }
.carte-rev p { margin: 0 0 8px; flex: 1; color: var(--discret); font-size: .9375rem; }
.carte-rev-ico { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--u); color: var(--u-encre); box-shadow: 0 3px 0 var(--u-ombre); }
.carte-rev-ico .ico { width: 24px; height: 24px; }
.carte-rev.srs { --u: #8b3dff; --u-encre: #fff; --u-ombre: #5d1ccc; }
.carte-rev.cartes { --u: #12c28a; --u-encre: #04261a; --u-ombre: #078a60; }
.carte-rev.irr { --u: #ff8a1f; --u-encre: #2a1300; --u-ombre: #c25a00; }
.carte-rev .bouton-gros[aria-disabled] { background: var(--surface-2); color: var(--bordure-forte); box-shadow: 0 4px 0 var(--bordure); cursor: default; }

/* Exercices : phrase à trou, cartes mémoire */
.session-nom { font: 600 .875rem var(--sans); color: var(--discret); white-space: nowrap; }
.phrase-trou { font-size: 1.375rem; font-weight: 500; line-height: 1.6; margin: 0 0 20px; }
.trou { display: inline-block; min-width: 110px; margin: 0 6px; padding: 0 8px; border-bottom: 3px solid var(--u); color: var(--discret); font-size: .9rem; text-align: center; }
.retour-regle { font-size: .875rem !important; opacity: .85; }
.fin-nouveaux { margin: -16px 0 28px; font-weight: 700; color: var(--succes); }
.carte-memoire { position: relative; display: block; width: min(420px, 100%); height: 240px; margin: 8px auto 0; padding: 0; border: 0; background: none; cursor: pointer; perspective: 1000px; }
.carte-memoire .face { position: absolute; inset: 0; display: grid; place-content: center; gap: 8px; text-align: center; border-radius: 22px; font: 700 2.25rem var(--sans); backface-visibility: hidden; transition: transform .5s var(--rebond); }
.carte-memoire .face small { font: 500 .875rem var(--sans); opacity: .75; }
.carte-memoire .avant { background: var(--u); color: var(--u-encre); box-shadow: 0 6px 0 var(--u-ombre); }
.carte-memoire .arriere { background: var(--surface); color: var(--texte); border: 2px solid var(--bordure); box-shadow: 0 6px 0 var(--bordure-forte); transform: rotateY(180deg); }
.carte-memoire.retournee .avant { transform: rotateY(-180deg); }
.carte-memoire.retournee .arriere { transform: rotateY(0); }
.cartes-boutons .bouton-gros { flex: 1; }

/* ---------- Anglais : leçon ---------- */
.lecon { --u: #2b59ff; max-width: 680px; margin: 0 auto; min-height: calc(100svh - 56px - 88px); display: flex; flex-direction: column; }
.lecon-haut { display: flex; align-items: center; gap: 16px; padding: 8px 0 24px; }
.lecon-quitter { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--discret); flex: none; }
.lecon-quitter:hover { background: var(--surface-2); color: var(--texte); }
.lecon-barre { flex: 1; height: 16px; border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.lecon-barre > div { height: 100%; min-width: 16px; border-radius: inherit; background: var(--u); box-shadow: inset 0 4px 0 rgba(255, 255, 255, .3); transition: width .5s var(--rebond); }
.coeurs { display: flex; align-items: center; gap: 6px; font: 700 1rem var(--sans); color: #ff2e55; flex: none; }
.coeurs .ico { width: 24px; height: 24px; fill: currentColor; }
.lecon-corps { flex: 1; animation: entree-ex .35s var(--courbe); }
@keyframes entree-ex { from { opacity: 0; transform: translateX(24px); } }
.lecon-consigne { font-size: clamp(1.5rem, 4vw, 1.875rem); margin-bottom: 24px; }
.lecon-source { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.lecon-source.ecoute-seule { justify-content: center; gap: 16px; padding: 12px 0; }
.bulle-source { position: relative; margin: 0; padding: 12px 18px; border: 2px solid var(--bordure); border-radius: 16px; font-size: 1.1875rem; font-weight: 500; background: var(--surface); }
.ecoute-gros, .ecoute-lent { display: grid; place-items: center; border: 0; cursor: pointer; border-radius: 16px; background: var(--u); color: var(--u-encre); box-shadow: 0 4px 0 var(--u-ombre); transition: translate .1s var(--courbe), box-shadow .1s var(--courbe); }
.ecoute-gros { width: 56px; height: 56px; }
.ecoute-gros .ico { width: 28px; height: 28px; }
.ecoute-lent { width: 44px; height: 44px; background: color-mix(in srgb, var(--u) 22%, var(--surface)); color: color-mix(in srgb, var(--u) 75%, var(--texte)); box-shadow: 0 4px 0 color-mix(in srgb, var(--u) 40%, var(--bordure-forte)); }
.ecoute-lent .ico { width: 24px; height: 24px; }
.ecoute-seule .ecoute-gros { width: 120px; height: 96px; border-radius: 22px; }
.ecoute-seule .ecoute-gros .ico { width: 48px; height: 48px; }
.ecoute-seule .ecoute-lent { width: 72px; height: 72px; border-radius: 20px; }
.ecoute-seule .ecoute-lent .ico { width: 32px; height: 32px; }
.ecoute-gros:active, .ecoute-lent:active { translate: 0 3px; box-shadow: 0 1px 0 var(--u-ombre); }
.parle .ico { animation: parle .5s var(--rebond); }
@keyframes parle { 40% { transform: scale(1.25); } }

.options { display: grid; gap: 12px; }
.carte-choix, .tuile {
  display: flex; align-items: center; gap: 12px; border: 2px solid var(--bordure-forte); border-bottom-width: 4px; border-radius: 14px;
  background: var(--surface); color: var(--texte); font: 500 1.0625rem var(--sans); cursor: pointer; text-align: left;
  transition: background-color .12s var(--courbe), border-color .12s var(--courbe), transform .12s var(--courbe), translate .08s var(--courbe);
}
.carte-choix { padding: 14px 16px; }
.carte-choix:hover:not(:disabled), .tuile:hover:not(:disabled) { background: var(--surface-2); }
.carte-choix:active:not(:disabled), .tuile:active:not(:disabled) { translate: 0 2px; border-bottom-width: 2px; margin-bottom: 2px; }
.carte-choix.choisie { border-color: var(--u); background: color-mix(in srgb, var(--u) 12%, var(--surface)); color: color-mix(in srgb, var(--u) 75%, var(--texte)); }
.touche-num { display: grid; place-items: center; width: 26px; height: 26px; flex: none; border: 2px solid var(--bordure); border-radius: 8px; font: 600 .75rem var(--mono); color: var(--discret); }
.carte-choix.choisie .touche-num { border-color: var(--u); color: inherit; }
.carte-choix:disabled, .tuile:disabled { cursor: default; }

.zone-reponse { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px; min-height: 120px; padding: 8px 0; margin-bottom: 24px;
  background: repeating-linear-gradient(transparent 0 54px, var(--bordure) 54px 56px); }
.banque { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tuile { padding: 8px 14px; font-size: 1rem; animation: tuile-pose .25s var(--rebond); }
@keyframes tuile-pose { from { transform: scale(.7); opacity: .3; } }
.tuile.vide { color: transparent; background: var(--surface-2); border-color: var(--surface-2); cursor: default; animation: none; }
.paires { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.colonne { display: grid; gap: 12px; align-content: start; }
.tuile.paire { justify-content: center; min-height: 56px; text-align: center; animation: none; }
.tuile.paire.choisie { border-color: var(--u); background: color-mix(in srgb, var(--u) 12%, var(--surface)); color: color-mix(in srgb, var(--u) 75%, var(--texte)); }
.tuile.paire.rate { border-color: var(--echec); background: var(--echec-doux); color: var(--echec); }
.tuile.paire.trouvee { opacity: .35; border-bottom-width: 2px; margin-top: 2px; }
.tuile.paire.vient { animation: trouvee .45s var(--rebond); border-color: var(--succes); color: var(--succes); opacity: 1; }
@keyframes trouvee { 0% { transform: scale(1); } 40% { transform: scale(1.08); } 100% { transform: scale(1); } }
.saisie { width: 100%; height: 56px; padding: 0 16px; border: 2px solid var(--bordure-forte); border-radius: 14px; background: var(--surface-2); color: var(--texte); font: 500 1.125rem var(--sans); }
.saisie:focus { outline: none; border-color: var(--u); background: var(--surface); }

/* Pied collé en bas, fond étendu sur toute la largeur de l'écran sans débordement */
.lecon-pied { --pied: var(--fond); --trait: var(--bordure); position: sticky; bottom: 0; margin: 24px 0 -64px; padding: 20px 0 24px; background: var(--pied); box-shadow: 0 0 0 100vmax var(--pied), 0 -2px 0 100vmax var(--trait); clip-path: inset(-2px -100vmax 0); }
.lecon-pied-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; }
.lecon-pied.ok { --pied: var(--succes-doux); --trait: var(--succes-doux); animation: pied .3s var(--courbe); }
.lecon-pied.ko { --pied: var(--echec-doux); --trait: var(--echec-doux); animation: pied .3s var(--courbe); }
@keyframes pied { from { transform: translateY(40px); } }
.retour { display: flex; align-items: center; gap: 14px; min-width: 0; }
.retour strong { display: block; font-size: 1.25rem; font-weight: 700; }
.retour p { margin: 2px 0 0; font-size: 1rem; }
.lecon-pied.ok .retour { color: var(--succes); }
.lecon-pied.ko .retour { color: var(--echec); }
.retour-ico { display: grid; place-items: center; width: 52px; height: 52px; flex: none; border-radius: 50%; background: var(--surface); animation: etoile-pop .45s var(--rebond); }
.retour-ico .ico { width: 30px; height: 30px; stroke-width: 3; }
.bouton-gros {
  display: inline-flex; align-items: center; justify-content: center; height: 50px; padding: 0 28px; min-width: 150px; flex: none;
  border: 0; border-radius: 14px; cursor: pointer; text-decoration: none;
  font: 800 .9375rem var(--sans); letter-spacing: .04em; text-transform: uppercase;
  background: var(--u); color: var(--u-encre); box-shadow: 0 4px 0 var(--u-ombre);
  transition: translate .08s var(--courbe), box-shadow .08s var(--courbe), filter .15s var(--courbe);
}
.bouton-gros:hover:not(:disabled) { filter: brightness(1.07); }
.bouton-gros:active:not(:disabled) { translate: 0 4px; box-shadow: 0 0 0 var(--u-ombre); }
.bouton-gros:disabled { background: var(--surface-2); color: var(--bordure-forte); box-shadow: 0 4px 0 var(--bordure); cursor: default; }
.bouton-gros.neutre { background: var(--surface); color: var(--discret); border: 2px solid var(--bordure-forte); box-shadow: 0 4px 0 var(--bordure-forte); }
.lecon-pied.ok .bouton-gros { background: #1db45a; color: #fff; box-shadow: 0 4px 0 #128a42; }
.lecon-pied.ko .bouton-gros { background: #ff3b47; color: #fff; box-shadow: 0 4px 0 #c41d29; }
.lecon-pied:not(.ok):not(.ko) .bouton-gros.neutre:disabled { text-transform: none; letter-spacing: 0; font-weight: 600; border: 0; }

.lecon-fin { flex: 1; display: grid; justify-items: center; align-content: center; text-align: center; padding: 24px 0 48px; animation: entree .4s var(--courbe); }
.fin-ico { display: grid; place-items: center; width: 120px; height: 120px; border-radius: 36px; background: #ffc61a; color: #2a1f00; box-shadow: 0 8px 0 #c08f00; margin-bottom: 24px; animation: fin-ico .7s var(--rebond) both; }
.fin-ico .ico { width: 64px; height: 64px; stroke-width: 1.8; }
.fin-ico.echec { background: #ff2e55; color: #fff; box-shadow: 0 8px 0 #b8122f; }
.fin-ico.echec .ico { fill: currentColor; }
@keyframes fin-ico { 0% { transform: scale(0) rotate(-25deg); } 100% { transform: scale(1) rotate(0); } }
.lecon-fin h1 { font-size: clamp(1.875rem, 5vw, 2.5rem); margin-bottom: 8px; }
.lecon-fin > p { color: var(--discret); margin: 0 0 28px; max-width: 30rem; }
.fin-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 140px)); gap: 12px; margin-bottom: 32px; }
.fin-stat { border-radius: 16px; border: 2px solid var(--s); background: var(--s); overflow: hidden; animation: entree .4s var(--rebond) both; }
.fin-stat:nth-child(2) { animation-delay: .1s; }
.fin-stat:nth-child(3) { animation-delay: .2s; }
.fin-stat p { margin: 0; padding: 4px 8px 5px; font: 800 .75rem var(--sans); letter-spacing: .04em; text-transform: uppercase; color: #fff; }
.fin-stat > div { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 8px; background: var(--surface); border-radius: 14px; color: var(--s); }
.fin-stat strong { font: 800 1.25rem var(--sans); }
.fin-stat .ico { width: 20px; height: 20px; stroke-width: 2.5; }
.fin-stat.xp { --s: #ff8a1f; }
.fin-stat.precision { --s: #12a877; }
.fin-stat.temps { --s: #2b59ff; }
.fin-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Écrans étroits ---------- */
@media (max-width: 900px) {
  .carte-intro, .anglais-intro { grid-template-columns: 1fr; gap: 24px; align-items: start; }
  .en-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chapitre-recit { grid-template-columns: 1fr; gap: 16px; }
}
@media (max-width: 720px) {
  .entete { padding-inline: 16px; }
  .joueur { gap: 16px; }
  .joueur-infos .xp { display: none; }
  .compteurs { gap: 12px; }
  .app { padding: 16px 16px 48px; }
  .panneau { padding: 20px 16px; }
  .piste-tete { margin-top: 32px; }
  .chapitre { --retrait: 0px; padding: 16px; }
  .chapitre-tete { flex-wrap: wrap; gap: 4px 8px; }
  .chapitre-num { width: 100%; margin: 0; padding: 0; }
  .titre-chapitre { font-size: 1.375rem; }
  .insigne-obtenu, .insigne-cache { width: 100%; padding-top: 4px; }

  /* La ligne passe à la verticale : un arrêt par rangée. */
  .sentier { --taille: 36px; --ecart: 16px; grid-template-columns: 1fr; margin: 16px 0 0; padding: 0; overflow: visible; }
  .etape:not(:last-child)::after { top: calc(var(--taille) / 2); left: calc(var(--taille) / 2 - 1px); width: 2px; height: calc(100% + var(--ecart)); }
  .etape > a, .etape > div { grid-template-columns: var(--taille) minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding-right: 0; }
  .etape .pastille-etape { grid-row: 1 / span 2; align-self: start; }
  .etape-type { grid-column: 2; margin: 0; align-self: end; }
  .etape-titre { grid-column: 2; align-self: start; }
  .etape .etoiles { grid-column: 3; grid-row: 1 / span 2; margin: 0; }

  .mini-sentier { flex-wrap: wrap; gap: 8px; }
  .mini-sentier li:not(:last-child)::after { display: none; }
  .onglets { display: flex; }
  .onglet { flex: 1; padding: 0 8px; gap: 4px; }
  .deux-colonnes { grid-template-columns: 1fr; }
  .editeur { min-height: 220px; }
  .bouton { height: 40px; }
  .aide-api dl { grid-template-columns: 1fr; gap: 4px; }
  .aide-api dd { margin-bottom: 8px; }
  .item-tete { gap: 12px; align-items: flex-start; }
  .item-tete .pastille-etape { --taille: 40px; }
  .item-tete .pastille-etape .ico { width: 18px; height: 18px; }
  .item-etoiles .ico { width: 16px; height: 16px; }
  .actions #suivant { margin-left: 0; }
  .raccourci { display: none; }

  .entete-gauche { gap: 8px; }
  .marque-site { display: none; }
  .nav-site a { padding: 0 10px; }
  .entete-droite { gap: 8px; }
  .bouton-compte { width: 32px; padding: 0; justify-content: center; }
  .bouton-compte .compte-nom { display: none; }
  .unite-tete { flex-direction: column; padding: 16px 18px; }
  .unite-mots ul { left: 0; right: auto; width: min(280px, calc(100vw - 64px)); }
  .noeud { transform: translateX(calc(var(--x) * .7)); }
  .lecon-pied { margin-bottom: -48px; padding: 16px 0; }
  .lecon-pied-in { flex-wrap: wrap; }
  .lecon-pied-in .bouton-gros { width: 100%; }
  .lecon-pied:not(.ok):not(.ko) .retour { display: none; }
  .fin-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; }
  .en-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
  .niveaux { display: flex; overflow-x: auto; margin-inline: -16px; padding: 2px 16px 6px; scrollbar-width: none; }
  .niveau-puce { flex: none; min-width: 112px; padding: 8px 12px; }
  .en-stat { padding: 10px 12px; gap: 10px; }
  .en-stat-ico { width: 36px; height: 36px; }
  .en-stat strong { font-size: 1.25rem; }
  .en-onglets a { padding: 0 10px; gap: 6px; }
  .en-onglets a span:not(.pastille-nb) { display: none; }
  .en-onglets a.actif span:not(.pastille-nb) { display: inline; }
  .formes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cours-temps, .grille-rev { grid-template-columns: 1fr; }
  .liste-mots { grid-template-columns: 1fr; }
  .verbe-tete { padding: 16px 18px; }
  .unite-mots ul.astuces { width: min(320px, calc(100vw - 64px)); }
  .touche-num { display: none; }
}
@media (max-width: 420px) {
  .joueur-infos { display: none; }
  .compteur-joueur.insignes { display: none; }
}
