/* =========================================================================
   Pinpon — leçons interactives (30 oct. 2026, LECONS.md). Chargé après eleves.css (et studio.css / affiche.css) :
   tout passe par les jetons des designs (--encre, --papier, --jaune…, --trait, --rayon, --ombre), donc une leçon
   suit Autocollants, Studio (clair ou sombre) et Affiche sans rien écrire en double. Les rares différences de
   caractère (ombres dures, épaisseur des traits) sont en fin de fichier.
   ========================================================================= */

.lecon, .lecon-publique {
  --l-ombre: 4px 4px 0 var(--encre);
  --l-ombre-petite: 2px 2px 0 var(--encre);
  --l-trait-dessin: 3;
  --l-trait-solide: 2.6;
  /* Code couleur des fiches outils de Julien : radical bleu, marque du temps vert, personne rouge ; auxiliaire violet */
  --m-radical: #1E6CD6;
  --m-temps: #128A45;
  --m-personne: #D7372F;
  --m-aux: #8340D8;
  --m-pp: #D86A00;
  --m-accord: #D7372F;
  --m-juste: #128A45;
  max-width: 1080px; margin: 0 auto; padding: 8px clamp(16px, 3vw, 32px) 48px; width: 100%;
}
.ico-lecon { width: 1.25em; height: 1.25em; flex: none; }

/* --- En-tête -------------------------------------------------------------------------------------------- */
.lecon-tete { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin: 6px 0 18px; }
.lecon-matiere {
  display: inline-block; font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 999px; background: var(--papier); border: 2px solid var(--encre); margin-bottom: 8px;
}
.lecon-titre { font-size: clamp(1.9rem, 5vw, 3rem); line-height: 1.02; }
.lecon-outils { display: flex; gap: 8px; flex-wrap: wrap; }
.lecon-outil {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px; cursor: pointer;
  background: var(--papier); border: 2px solid var(--encre); font-weight: 800; font-size: .88rem; color: var(--encre);
}
.lecon-outil[aria-pressed="true"] { background: var(--encre); color: var(--papier); }
.lecon-outil:hover { transform: translateY(-1px); }

/* --- Le chemin des étapes ------------------------------------------------------------------------------- */
.lecon-chemin {
  display: flex; gap: 4px; margin: 0 0 18px; padding: 4px 2px 6px; overflow-x: auto; scrollbar-width: none;
  counter-reset: pas;
}
.lecon-chemin::-webkit-scrollbar { display: none; }
.chemin-pas {
  flex: 1 1 0; min-width: 64px; display: flex; flex-direction: column; align-items: center; gap: 5px; position: relative;
  background: none; border: 0; padding: 0; cursor: pointer; color: var(--encre); font: inherit;
}
.chemin-pas + .chemin-pas::before {
  content: ""; position: absolute; top: 21px; right: calc(50% + 24px); width: calc(100% - 44px); height: 3px; border-radius: 2px;
  background: repeating-linear-gradient(90deg, var(--encre) 0 6px, transparent 6px 11px); opacity: .35;
}
.chemin-pas.vu + .chemin-pas::before, .chemin-pas.vu + .chemin-pas.vu::before, .chemin-pas[aria-current] + .chemin-pas::before { opacity: .35; }
.chemin-pas.vu::before { background: var(--encre) !important; opacity: .8 !important; }
.chemin-rond {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--papier); border: var(--trait) solid var(--encre); transition: transform .2s, background .2s;
}
.chemin-rond .ico-lecon { width: 22px; height: 22px; }
.chemin-nom { font-size: .76rem; font-weight: 800; opacity: .7; white-space: nowrap; }
.chemin-pas.vu .chemin-rond { background: var(--c); }
.chemin-pas[aria-current] .chemin-rond { background: var(--c); transform: scale(1.14); box-shadow: var(--l-ombre-petite); }
.chemin-pas[aria-current] .chemin-nom { opacity: 1; }
.chemin-pas:hover .chemin-rond { transform: scale(1.08); }

/* --- Une étape ------------------------------------------------------------------------------------------- */
.lecon-scene { overflow-x: clip; padding: 0 6px 8px 0; margin-right: -6px; }
.etape {
  background: var(--papier); border: var(--trait) solid var(--encre); border-radius: var(--rayon); box-shadow: var(--l-ombre);
  overflow: hidden;
}
.entre-droite { animation: entre-droite .38s cubic-bezier(.2, .8, .3, 1.05) both; }
.entre-gauche { animation: entre-gauche .38s cubic-bezier(.2, .8, .3, 1.05) both; }
@keyframes entre-droite { from { opacity: 0; transform: translateX(40px) rotate(.6deg); } }
@keyframes entre-gauche { from { opacity: 0; transform: translateX(-40px) rotate(-.6deg); } }
.etape-bandeau {
  display: flex; align-items: center; gap: 14px; padding: 16px clamp(16px, 3vw, 26px);
  background: var(--c); border-bottom: var(--trait) solid var(--encre); color: #1D1A26;
  position: relative; overflow: hidden;
}
/* motif de pois dans le bandeau */
.etape-bandeau::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .18;
  background-image: radial-gradient(#fff 2px, transparent 2.5px); background-size: 18px 18px;
  -webkit-mask-image: linear-gradient(90deg, transparent 40%, #000); mask-image: linear-gradient(90deg, transparent 40%, #000);
}
.etape-pastille {
  display: grid; place-items: center; width: 52px; height: 52px; flex: none; border-radius: 16px; transform: rotate(-6deg);
  background: #fff; border: var(--trait) solid #1D1A26; color: #1D1A26;
}
.etape-pastille .ico-lecon { width: 28px; height: 28px; }
.etape-titres { flex: 1; min-width: 0; position: relative; z-index: 1; }
.etape-genre { display: block; font-size: .8rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; opacity: .8; }
.etape-bandeau h2 { font-size: clamp(1.35rem, 3.4vw, 2rem); }
.btn-ecouter {
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 7px; flex: none; cursor: pointer;
  padding: 9px 16px; border-radius: 999px; background: #fff; color: #1D1A26; border: 2px solid #1D1A26; font-weight: 800;
}
.btn-ecouter:hover { transform: translateY(-1px); }
html.lecon-parle .btn-ecouter .ico-lecon { animation: ondes .5s ease-in-out infinite alternate; }
@keyframes ondes { to { transform: scale(1.18); } }
.etape-corps { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; padding: clamp(18px, 3vw, 30px); }
.etape-corps > *, .solides > *, .solides-milieu > *, .colonnes > * { min-width: 0; }

/* Ce que la voix lit en ce moment */
.lu { outline: 3px solid var(--jaune); outline-offset: 5px; border-radius: 10px; background-color: color-mix(in srgb, var(--jaune) 16%, transparent); transition: background-color .2s; }

/* --- Pied : retour / suivant ---------------------------------------------------------------------------- */
.lecon-pied { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.lecon-compte { font-weight: 800; opacity: .6; font-size: .9rem; }
.btn-lecon {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; text-decoration: none;
  padding: 12px 22px; border-radius: 14px; border: var(--trait) solid var(--encre); box-shadow: var(--l-ombre-petite);
  background: var(--jaune); color: #1D1A26; font-weight: 800; font-size: 1.02rem; transition: transform .1s, box-shadow .1s;
}
.btn-lecon:hover:not(:disabled) { transform: translate(-1px, -1px); }
.btn-lecon:active:not(:disabled) { transform: translate(1px, 1px); box-shadow: none; }
.btn-lecon:disabled { opacity: .35; cursor: default; }
.btn-lecon-doux { background: var(--papier); color: var(--encre); }
.btn-mini {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; padding: 7px 13px; border-radius: 999px;
  background: var(--papier); color: var(--encre); border: 2px solid var(--encre); font-weight: 800; font-size: .88rem;
}
.btn-mini[aria-pressed="true"] { background: var(--encre); color: var(--papier); }
.btn-mini:hover { transform: translateY(-1px); }

/* --- Texte enrichi --------------------------------------------------------------------------------------- */
.m { font-weight: 800; }
.m-radical { color: var(--m-radical); }
.m-temps { color: var(--m-temps); }
.m-personne { color: var(--m-personne); }
.m-aux { color: var(--m-aux); }
.m-pp { color: var(--m-pp); }
.m-accord { color: var(--m-accord); text-decoration: underline wavy; text-underline-offset: 4px; text-decoration-thickness: 2px; }
.m-sujet { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 5px; }
.m-juste { color: var(--m-juste); }
.m-piege { color: var(--m-personne); text-decoration: line-through; text-decoration-thickness: 2px; }
.bloc-titre { font-size: 1.2rem; margin-bottom: 10px; }
.bloc-legende { font-size: .92rem; opacity: .75; margin: 8px 0 0; }
.bloc p { margin: 0; }
.texte-grand p { font-size: 1.3rem; line-height: 1.4; }
.texte-petit p { font-size: .92rem; opacity: .8; }
.consigne { font-weight: 800; font-size: 1.08rem; margin-bottom: 12px !important; }

/* --- Pinpon qui parle ------------------------------------------------------------------------------------ */
.bulle-pinpon { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 16px; }
.bulle-droite { grid-template-columns: 1fr auto; }
.bulle-droite .pinpon { order: 2; }
.pinpon { width: 74px; height: 80px; color: var(--encre); overflow: visible; }
.pinpon-corps { fill: var(--jaune); }
.pinpon-lampe { fill: var(--corail); }
.pinpon-rayons { opacity: 0; }
.pinpon-yeux { transform-origin: 32px 38px; animation: cligne 5s infinite; }
@keyframes cligne { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
.pinpon-bouche-ouverte { opacity: 0; transform-origin: 32px 56px; }
html.lecon-parle .pinpon-bouche { opacity: 0; }
html.lecon-parle .pinpon-bouche-ouverte { opacity: 1; animation: parle .18s ease-in-out infinite alternate; }
html.lecon-parle .pinpon-rayons { opacity: 1; animation: gyro .4s steps(2) infinite; }
@keyframes parle { from { transform: scaleY(.35); } to { transform: scaleY(1); } }
@keyframes gyro { 50% { opacity: .2; } }
.bulle-texte {
  position: relative; padding: 14px 18px; border-radius: 18px; background: var(--creme); border: 2px solid var(--encre);
  font-size: 1.12rem; line-height: 1.45;
}
.bulle-texte::before {
  content: ""; position: absolute; left: -11px; top: 50%; width: 18px; height: 18px; margin-top: -9px; transform: rotate(45deg);
  background: var(--creme); border-left: 2px solid var(--encre); border-bottom: 2px solid var(--encre);
}
.bulle-droite .bulle-texte::before { left: auto; right: -11px; transform: rotate(-135deg); }

/* --- Dessins ---------------------------------------------------------------------------------------------- */
.illustration { margin: 0; display: grid; justify-items: center; gap: 8px; }
.illustration svg { width: 100%; max-width: 520px; height: auto; }
.illustration-petit svg { max-width: 300px; }
.illustration figcaption { font-size: .92rem; opacity: .75; text-align: center; }
.dessin-lecon .d { stroke: var(--encre); stroke-width: var(--l-trait-dessin); stroke-linejoin: round; stroke-linecap: round; }
.dessin-lecon .d-fin { stroke-width: 2; opacity: .55; fill: none; }
.dessin-lecon .d-sol { stroke: var(--encre); stroke-width: var(--l-trait-dessin); stroke-linecap: round; opacity: .5; }
.dessin-lecon .d-ombre { fill: var(--encre); }
.dessin-lecon .d-texte { fill: var(--encre); font-family: var(--police-titre); font-weight: 700; }
.dessin-lecon .d-doux { opacity: .6; }
.f-papier { fill: var(--papier); } .f-encre { fill: var(--encre); } .f-jaune { fill: var(--jaune); } .f-orange { fill: var(--orange); }
.f-corail { fill: var(--corail); } .f-rose { fill: var(--rose); } .f-vert { fill: var(--vert); } .f-menthe { fill: var(--menthe); }
.f-bleu { fill: var(--bleu); } .f-ciel { fill: var(--ciel); } .f-violet { fill: var(--violet); }

/* --- Phrases à écouter ------------------------------------------------------------------------------------ */
.ecouter-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ecouter-phrase {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer; padding: 12px 16px;
  border-radius: 14px; background: var(--creme); border: 2px solid var(--encre); color: var(--encre); font-size: 1.18rem;
}
.ecouter-phrase small { display: block; margin-left: auto; font-size: .85rem; opacity: .7; }
.ecouter-hp { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; flex: none; background: var(--jaune); border: 2px solid var(--encre); color: #1D1A26; }
.ecouter-phrase:hover .ecouter-hp { transform: scale(1.1) rotate(-8deg); }

/* --- « Comment faire ? » ---------------------------------------------------------------------------------- */
.etapes-faire ol { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 12px; }
.etapes-faire li { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; font-size: 1.1rem; }
.etapes-num {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; font-weight: 800; font-family: var(--police-titre);
  background: var(--c, var(--bleu)); border: 2px solid var(--encre); color: #1D1A26; transform: rotate(-4deg);
}
.etapes-exemple { margin-top: 4px !important; padding: 6px 12px; border-radius: 10px; background: var(--creme); display: inline-block; }
.apparait { animation: apparait .4s cubic-bezier(.2, .9, .3, 1.2) both; }
@keyframes apparait { from { opacity: 0; transform: translateY(12px) scale(.97); } }

/* --- Tableaux --------------------------------------------------------------------------------------------- */
.tableau-defile { overflow-x: auto; }
.tableau-lecon table, .carnet table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 1.02rem; }
.tableau-lecon th, .carnet th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; padding: 8px 12px; background: var(--creme); border-bottom: 2px solid var(--encre); }
.tableau-lecon td, .carnet td { padding: 10px 12px; border-bottom: 1px solid color-mix(in srgb, var(--encre) 18%, transparent); }
.tableau-lecon tbody tr { animation: apparait .35s calc(var(--k, 0) * 90ms) both; }

/* --- Colonnes, encadrés ----------------------------------------------------------------------------------- */
.colonnes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; align-items: start; }
.encadre { padding: 14px 18px; border-radius: 16px; border: 2px solid var(--encre); background: color-mix(in srgb, var(--jaune) 22%, var(--papier)); }
.encadre-piege { background: color-mix(in srgb, var(--corail) 18%, var(--papier)); }
.encadre h3 { display: flex; align-items: center; gap: 8px; font-size: 1.1rem; margin-bottom: 6px; }
.encadre p { font-size: 1.08rem; }

/* --- Conjugaison ------------------------------------------------------------------------------------------ */
.conjugaison { border: 2px solid var(--encre); border-radius: 16px; overflow: hidden; background: var(--papier); }
.conjugaison-tete { padding: 10px 16px; background: var(--creme); border-bottom: 2px solid var(--encre); }
.conjugaison-tete h3 { font-size: 1.08rem; }
.conjugaison-lignes { padding: 8px 6px; display: grid; }
.conjugaison-ligne {
  display: grid; grid-template-columns: minmax(84px, 38%) 1fr; gap: 12px; padding: 6px 10px; border-radius: 10px; font-size: 1.22rem;
  animation: ligne-arrive .45s calc(var(--k) * 110ms) cubic-bezier(.2, .9, .3, 1.2) both;
}
@keyframes ligne-arrive { from { opacity: 0; transform: translateX(-16px); } }
.conj-pronom { text-align: right; opacity: .75; }
.conjugaison-outils { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 12px 12px; }
.conjugaison .cache {
  color: transparent !important; cursor: pointer; border-radius: 6px; padding: 0 4px; text-decoration: none;
  background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--m-aux) 22%, transparent) 0 5px, transparent 5px 10px);
  outline: 2px dashed var(--m-aux); outline-offset: -1px;
}

/* --- La machine à temps composés -------------------------------------------------------------------------- */
.machine { display: grid; gap: 14px; }
.machine-entrees { display: grid; gap: 10px; }
.machine-rangee { display: grid; grid-template-columns: 70px 1fr; gap: 10px; align-items: center; }
.machine-etiquette { font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; opacity: .7; }
.machine-puces, .astuce-tests { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.puce {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; padding: 7px 13px; border-radius: 12px; font-weight: 800; font-size: .98rem;
  background: var(--papier); color: var(--encre); border: 2px solid var(--encre); transition: transform .1s, background .15s;
}
.puce:hover { transform: translateY(-2px); }
.puce[aria-pressed="true"] { background: var(--encre); color: var(--papier); }
.machine-corps {
  position: relative; display: grid; gap: 12px; padding: 22px clamp(14px, 3vw, 26px) 18px; border-radius: 20px;
  background: color-mix(in srgb, var(--violet) 16%, var(--papier)); border: var(--trait) solid var(--encre);
}
.machine-roues { position: absolute; right: 12px; top: -26px; width: 92px; height: 46px; }
.machine-roues .roue circle, .machine-roues .roue path { fill: var(--papier); stroke: var(--encre); stroke-width: 3; stroke-linecap: round; }
.machine-roues .roue-a circle:first-child { fill: var(--jaune); }
.machine-roues .roue-b circle:first-child { fill: var(--menthe); }
.roue-a { transform-origin: 30px 30px; } .roue-b { transform-origin: 82px 34px; }
.machine.tourne .roue-a { animation: roue .7s ease-out; } .machine.tourne .roue-b { animation: roue-inverse .7s ease-out; }
@keyframes roue { to { transform: rotate(180deg); } }
@keyframes roue-inverse { to { transform: rotate(-240deg); } }
.machine-sortie { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; justify-content: center; min-height: 92px; font-size: clamp(1.7rem, 5vw, 2.6rem); font-family: var(--police-titre); font-weight: 700; }
.piece {
  display: inline-flex; flex-direction: column; align-items: center; padding: 6px 16px 4px; border-radius: 14px;
  background: var(--papier); border: var(--trait) solid var(--encre); box-shadow: var(--l-ombre-petite); line-height: 1.1;
}
.piece small { font-family: var(--police); font-size: .72rem; font-weight: 800; opacity: .65; text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }
.piece-aux { background: color-mix(in srgb, var(--m-aux) 12%, var(--papier)); }
.piece-pp { flex-direction: row; flex-wrap: wrap; justify-content: center; }
.piece-pp small { flex-basis: 100%; text-align: center; }
.machine.tourne .piece { animation: piece-tombe .5s cubic-bezier(.3, 1.5, .5, 1) both; }
.machine.tourne .piece:nth-child(2) { animation-delay: .1s; } .machine.tourne .piece:nth-child(3) { animation-delay: .2s; }
.machine.tourne .m-accord { display: inline-block; animation: accord-pop .5s .55s cubic-bezier(.3, 1.8, .5, 1) both; }
@keyframes piece-tombe { from { opacity: 0; transform: translateY(-30px) rotate(-4deg); } }
@keyframes accord-pop { from { transform: scale(0); } }
.machine-explique { margin: 0; padding: 0 0 0 4px; list-style: none; counter-reset: ex; display: grid; gap: 6px; font-size: 1.02rem; }
.machine-explique li { counter-increment: ex; display: grid; grid-template-columns: 26px 1fr; gap: 8px; animation: apparait .35s calc(.35s + var(--k) * 120ms) both; }
.machine-explique li::before { content: counter(ex); display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--encre); color: var(--papier); font-size: .8rem; font-weight: 800; }
.machine-outils { display: flex; gap: 8px; flex-wrap: wrap; }

/* --- Exercices : retour commun ---------------------------------------------------------------------------- */
.retour-exercice { min-height: 1.5em; font-size: 1.04rem; margin: 6px 0 0 !important; padding: 0; }
.retour-exercice:empty { display: none; }
.retour-juste, .retour-encore { padding: 10px 14px; border-radius: 12px; border: 2px solid var(--encre); animation: apparait .3s both; }
.retour-juste { background: color-mix(in srgb, var(--vert) 22%, var(--papier)); }
.retour-encore { background: var(--creme); border-style: dashed; }
.secoue { animation: secoue .4s; }
@keyframes secoue { 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }

/* --- Trier ------------------------------------------------------------------------------------------------ */
.trier-reserve { display: flex; flex-wrap: wrap; gap: 9px; min-height: 52px; padding: 10px; border-radius: 14px; background: var(--creme); margin-bottom: 12px; }
.trier-reserve:empty { display: none; }
.etiquette {
  cursor: grab; padding: 9px 16px; border-radius: 12px; font-weight: 800; font-size: 1.08rem; touch-action: none; user-select: none;
  background: var(--papier); color: var(--encre); border: 2px solid var(--encre); box-shadow: var(--l-ombre-petite); transition: transform .12s;
}
.etiquette:hover { transform: translateY(-2px) rotate(-1deg); }
.etiquette.choisie { transform: translateY(-4px) rotate(-2deg) scale(1.06); background: var(--jaune); color: #1D1A26; }
.etiquette.tenue { opacity: .35; }
.etiquette.placee { cursor: default; box-shadow: none; background: color-mix(in srgb, var(--vert) 26%, var(--papier)); animation: apparait .3s both; }
.etiquette.fantome { position: fixed; z-index: 50; pointer-events: none; transform: translate(-50%, -50%) rotate(-3deg) scale(1.08); }
.trier-boites { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.trier-boite { border: var(--trait) solid var(--encre); border-radius: 16px; overflow: hidden; cursor: pointer; background: var(--papier); }
.trier-boite h4 { margin: 0; padding: 9px 14px; background: var(--c); color: #1D1A26; border-bottom: 2px solid var(--encre); font-family: var(--police-titre); font-size: 1.1rem; }
.trier-contenu { display: flex; flex-wrap: wrap; gap: 8px; min-height: 76px; padding: 12px; }

/* --- Questions -------------------------------------------------------------------------------------------- */
.qcm { padding: 16px 18px; border-radius: 16px; background: var(--creme); border: 2px solid color-mix(in srgb, var(--encre) 30%, transparent); }
.qcm + .qcm { margin-top: -6px; }
.qcm-question { font-weight: 800; font-size: 1.1rem; margin-bottom: 10px !important; }
.qcm-phrase, .astuce-phrase { font-size: clamp(1.25rem, 3.4vw, 1.6rem); margin: 4px 0 14px !important; line-height: 1.5; }
.trou {
  display: inline-block; min-width: 3.4em; text-align: center; padding: 0 10px; border-radius: 10px;
  border: 2px dashed var(--encre); background: var(--papier); font-weight: 800;
}
.trou.rempli { border-style: solid; background: color-mix(in srgb, var(--vert) 22%, var(--papier)); animation: accord-pop .35s cubic-bezier(.3, 1.8, .5, 1); }
.trou.essai.sonne-faux { background: var(--creme); border-style: dashed; text-decoration: line-through; text-decoration-thickness: 2px; }
.qcm-choix { display: flex; flex-wrap: wrap; gap: 9px; }
.choix {
  cursor: pointer; min-width: 64px; padding: 10px 18px; border-radius: 12px; font-weight: 800; font-size: 1.08rem;
  background: var(--papier); color: var(--encre); border: 2px solid var(--encre); box-shadow: var(--l-ombre-petite); transition: transform .1s;
}
.choix:hover:not(:disabled) { transform: translateY(-2px); }
.choix.juste { background: var(--vert); color: #1D1A26; }
.choix.montree { outline: 3px solid var(--vert); outline-offset: 3px; }
/* une erreur ne se montre jamais en rouge : grisée, en pointillés */
.choix.faux { opacity: .5; border-style: dashed; box-shadow: none; text-decoration: line-through; }
.choix:disabled { cursor: default; }
.astuce { display: grid; gap: 4px; }
.astuce-etiquette { font-size: .82rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; opacity: .7; margin-right: 4px; }
.astuce-verdict { display: inline-block; margin-left: 10px; padding: 2px 10px; border-radius: 999px; font-size: .9rem; font-weight: 800; border: 2px solid var(--encre); vertical-align: middle; animation: apparait .3s both; }
.astuce-verdict.sonne-bien { background: var(--vert); color: #1D1A26; }
.astuce-verdict.sonne-faux { background: var(--creme); border-style: dashed; }
.astuce > .qcm { margin-top: 10px; }

/* --- Fin de la leçon -------------------------------------------------------------------------------------- */
.lecon-fin {
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 16px 20px; border-radius: 18px;
  background: color-mix(in srgb, var(--jaune) 40%, var(--papier)); border: var(--trait) solid var(--encre); box-shadow: var(--l-ombre-petite);
  animation: apparait .5s cubic-bezier(.2, .9, .3, 1.3) both;
}
.lecon-fin .bulle-pinpon { display: block; }
.lecon-fin h3 { font-size: 1.35rem; }
.lecon-fin-etoile { display: grid; justify-items: center; color: #B8860B; font-size: 1.2rem; }
.lecon-fin-etoile .ico-lecon { width: 52px; height: 52px; fill: #FFD43B; stroke: var(--encre); animation: etoile-tourne 1s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes etoile-tourne { from { transform: scale(0) rotate(-200deg); } }

/* --- Éclat d'étoiles -------------------------------------------------------------------------------------- */
.eclat { position: absolute; z-index: 60; width: 0; height: 0; pointer-events: none; }
.eclat-etoile { position: absolute; width: 18px; height: 18px; margin: -9px; animation: eclat .8s ease-out forwards; }
.eclat-etoile svg { width: 100%; height: 100%; fill: var(--jaune); stroke: var(--encre); stroke-width: 1.4; }
@keyframes eclat { 0% { transform: translate(0, 0) scale(.3); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(1) rotate(90deg); opacity: 0; } }

/* --- Mon mémo --------------------------------------------------------------------------------------------- */
.memo { display: grid; gap: 16px; }
.memo-fiche { border: var(--trait) solid var(--encre); border-radius: 18px; overflow: hidden; background: var(--papier); }
.memo-tete { padding: 14px 20px 12px; background: var(--orange); color: #1D1A26; border-bottom: var(--trait) solid var(--encre); }
.memo-matiere { font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; opacity: .8; }
.memo-tete h3 { font-size: 1.6rem; }
.memo-retiens { margin: 16px 20px 6px !important; padding: 12px 16px; border-radius: 12px; background: color-mix(in srgb, var(--jaune) 32%, var(--papier)); font-size: 1.18rem; font-weight: 800; border: 2px solid var(--encre); }
.memo-retiens span { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; opacity: .7; }
.memo-lignes { margin: 8px 20px; padding-left: 22px; display: grid; gap: 6px; font-size: 1.06rem; }
.memo-lignes li::marker { color: var(--orange); }
.memo-exemples { margin: 8px 20px 16px; padding: 10px 14px; border-left: 4px solid var(--orange); background: var(--creme); border-radius: 0 10px 10px 0; display: grid; gap: 4px; font-size: 1.08rem; }
.memo-source { margin: 0 20px 14px !important; font-size: .8rem; opacity: .6; }
.memo-outils { display: flex; gap: 10px; flex-wrap: wrap; }
.memo-entrainement h3 { display: flex; align-items: center; gap: 8px; font-size: 1.15rem; margin-bottom: 10px; }
.memo-jeux { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.memo-jeu {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px; padding: 12px 16px; border-radius: 14px; text-decoration: none;
  background: color-mix(in srgb, var(--menthe) 22%, var(--papier)); border: 2px solid var(--encre); box-shadow: var(--l-ombre-petite); color: var(--encre);
}
.memo-jeu small { grid-column: 1; opacity: .7; font-size: .85rem; }
.memo-jeu .ico-lecon { grid-row: 1 / span 2; grid-column: 2; }
.memo-jeu:hover { transform: translate(-1px, -1px); }

/* --- Signaler une erreur ---------------------------------------------------------------------------------- */
.lecon-dialogue { width: min(520px, calc(100vw - 32px)); padding: 0; border: var(--trait) solid var(--encre); border-radius: var(--rayon); background: var(--papier); color: var(--encre); box-shadow: var(--l-ombre); }
.lecon-dialogue::backdrop { background: rgba(20, 18, 30, .45); }
.signaler-form { display: grid; gap: 12px; padding: 20px 22px; }
.signaler-form h2 { display: flex; align-items: center; gap: 8px; font-size: 1.35rem; }
.signaler-aide { margin: 0; font-size: .92rem; opacity: .8; }
.signaler-form label { display: grid; gap: 5px; font-weight: 800; font-size: .95rem; }
.signaler-form select, .signaler-form textarea { width: 100%; padding: 9px 12px; border-radius: 10px; border: 2px solid var(--encre); background: var(--papier); font-weight: 600; resize: vertical; }
.signaler-boutons { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.signaler-merci { margin: 0; padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--vert) 22%, var(--papier)); font-weight: 800; }

/* =========================================================================================================
   Bloc « solides »
   ========================================================================================================= */
.solides { display: grid; gap: 14px; }
.solides-tete { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; }
.bascule { display: inline-flex; padding: 3px; border-radius: 14px; border: 2px solid var(--encre); background: var(--papier); }
.bascule button { cursor: pointer; padding: 7px 16px; border: 0; border-radius: 10px; background: none; font-weight: 800; color: var(--encre); }
.bascule button[aria-pressed="true"] { background: var(--encre); color: var(--papier); }
.solides-nom { margin: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; font-size: 1.2rem; }
.solides-nom b { font-family: var(--police-titre); font-size: 1.35rem; }
.solides-nom small { flex-basis: 100%; font-size: .88rem; opacity: .7; }
.solides-extra { padding: 2px 10px; border-radius: 999px; background: var(--jaune); color: #1D1A26; border: 2px solid var(--encre); font-size: .85rem; font-weight: 800; animation: accord-pop .4s cubic-bezier(.3, 1.8, .5, 1) both; }
.solides-milieu { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 14px; align-items: stretch; }
.solides-dessin {
  position: relative; border-radius: 18px; border: 2px solid var(--encre); overflow: hidden;
  background-color: var(--creme); background-image: radial-gradient(color-mix(in srgb, var(--encre) 14%, transparent) 1.2px, transparent 1.5px); background-size: 22px 22px;
}
.solides-dessin > svg { display: block; width: 100%; height: auto; touch-action: none; cursor: grab; user-select: none; }
.solides-dessin.tenu > svg { cursor: grabbing; }
.solides-aide { white-space: nowrap; position: absolute; left: 10px; bottom: 8px; display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 800; opacity: .55; pointer-events: none; }
.sol-face { stroke: none; transition: fill .2s; }
.sol-base { fill: var(--orange); }
.sol-lat { fill: var(--ciel); }
.sol-face.voile { fill-opacity: .42; }
.sol-face.derriere { fill-opacity: .18; }
.sol-face.allumee { fill: var(--jaune); fill-opacity: .9; }
.sol-ombre { fill: #10101A; pointer-events: none; }
.sol-arete { stroke: var(--encre); stroke-width: var(--l-trait-solide); stroke-linecap: round; }
.sol-arete.cachee { stroke-dasharray: 7 7; stroke-width: 2; opacity: .75; }
.sol-arete.fantome { stroke-width: 1.5; opacity: .3; }
.sol-arete.allumee { stroke: var(--corail); stroke-width: 6; opacity: 1; }
.sol-point { fill: var(--encre); }
.sol-point.allume { fill: var(--corail); stroke: var(--encre); stroke-width: 2; }
.sol-lettre { fill: var(--encre); font: 800 18px var(--police-titre); text-anchor: middle; paint-order: stroke; stroke: var(--creme); stroke-width: 4px; }
.sol-nombre circle { fill: var(--jaune); stroke: var(--encre); stroke-width: 2.5; }
.sol-nombre text { fill: #1D1A26; font: 800 14px var(--police); text-anchor: middle; }
.sol-nombre.dernier { animation: nombre-pop .35s cubic-bezier(.3, 1.8, .5, 1); transform-box: fill-box; }
@keyframes nombre-pop { from { opacity: 0; } }
.solides.compte-en-cours .compteur-compter { pointer-events: none; opacity: .5; }

.compteurs { display: grid; gap: 10px; align-content: start; }
.compteur-sol {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 10px; padding: 10px 12px; border-radius: 14px;
  background: var(--papier); border: 2px solid var(--encre); transition: background .3s;
}
.compteur-nom { font-weight: 800; }
.compteur-valeur:has(.devine) { grid-column: 1 / -1; }
.compteur-valeur b { font-family: var(--police-titre); font-size: 2rem; line-height: 1; }
.compteur-sol.trouve { background: color-mix(in srgb, var(--vert) 24%, var(--papier)); }
.compteur-compter { grid-column: 1 / -1; display: inline-flex; align-items: center; gap: 6px; justify-self: start; cursor: pointer; padding: 4px 10px; border-radius: 999px; border: 1.5px solid var(--encre); background: var(--creme); color: var(--encre); font-size: .8rem; font-weight: 800; }
.compteur-compter .ico-lecon { width: 16px; height: 16px; }
.devine { display: flex; align-items: center; gap: 4px; }
.devine input { width: 48px; padding: 4px; text-align: center; font-weight: 800; font-size: 1.15rem; border: 2px solid var(--encre); border-radius: 8px; background: var(--papier); -moz-appearance: textfield; appearance: textfield; }
.devine input::-webkit-inner-spin-button { -webkit-appearance: none; }
.devine button { cursor: pointer; min-width: 30px; height: 32px; border-radius: 8px; border: 2px solid var(--encre); background: var(--papier); color: var(--encre); font-weight: 800; }
.devine .devine-ok { background: var(--jaune); color: #1D1A26; padding: 0 8px; }

.solides-bases { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.solides-famille { flex-basis: 100%; font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; opacity: .6; margin-top: 4px; }
.solides-bases .puce { font-size: .9rem; padding: 6px 11px 6px 8px; }
.solides-bases .puce svg { width: 20px; height: 20px; }
.solides-bases .puce polygon { fill: var(--orange); stroke: currentColor; stroke-width: .14; stroke-linejoin: round; }
.solides-reglages { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; padding-top: 4px; }
.glissiere { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: .9rem; margin-right: 6px; }
.glissiere input { accent-color: var(--encre); width: 130px; }
.interrupteur { cursor: pointer; padding: 6px 12px; border-radius: 999px; border: 2px solid var(--encre); background: var(--papier); color: var(--encre); font-weight: 800; font-size: .86rem; }
.interrupteur[aria-pressed="true"] { background: var(--bleu); color: #10101A; }

.carnet { padding: 14px 16px; border-radius: 16px; background: var(--creme); border: 2px dashed var(--encre); }
.carnet tbody tr.nouvelle { animation: carnet-ligne 1.2s ease-out; }
@keyframes carnet-ligne { 0% { background: var(--jaune); } 100% { background: transparent; } }
.carnet-secret { display: grid; gap: 10px; margin-top: 12px; }
.carnet-regle { padding: 12px 16px; border-radius: 14px; background: var(--jaune); color: #1D1A26; border: 2px solid var(--encre); font-size: 1.1rem; animation: apparait .4s both; }

.solides-mini { gap: 6px; justify-items: center; text-align: center; }
.solides-mini .solides-milieu { grid-template-columns: 1fr; width: 100%; }
.solides-mini .solides-dessin { border: 0; background: none; }
.solides-mini .solides-dessin > svg { max-height: 230px; }
.solides-mini .solides-nom { justify-content: center; }

/* --- Téléphone --------------------------------------------------------------------------------------------- */
@media (max-width: 720px) {
  .solides-milieu { grid-template-columns: 1fr; }
  .compteurs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .compteur-sol { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 8px 6px; }
  .compteur-nom { font-size: .85rem; }
  .compteur-compter { justify-self: center; font-size: 0; padding: 5px 8px; }
  .compteur-compter .ico-lecon { width: 18px; height: 18px; }
  .devine { flex-wrap: wrap; justify-content: center; }
  .devine input { width: 38px; }
  .devine .devine-ok { padding: 0 6px; }
  .compteur-valeur:has(.devine) { justify-self: center; }
  .devine .devine-moins, .devine .devine-plus { display: none; }
  .chemin-nom { display: none; }
  .chemin-pas[aria-current] .chemin-nom { display: block; }
  .chemin-pas { min-width: 46px; }
  .chemin-rond { width: 38px; height: 38px; }
  .chemin-pas + .chemin-pas::before { top: 18px; right: calc(50% + 21px); width: calc(100% - 38px); }
  .etape-pastille { width: 42px; height: 42px; border-radius: 13px; }
  .btn-ecouter span { display: none; }
  .btn-ecouter { padding: 9px; }
  .machine-rangee { grid-template-columns: 1fr; gap: 4px; }
  .lecon-fin { grid-template-columns: auto 1fr; }
  .lecon-fin-etoile { grid-column: 1 / -1; }
  .pinpon { width: 58px; height: 64px; }
  .bulle-texte { font-size: 1.02rem; }
  .lecon-outil span { display: none; }
  .lecon-outil { padding: 9px; }
}

/* --- Mode tableau (TBI) : tout un cran plus grand ------------------------------------------------------------ */
.lecon--tableau { max-width: 1400px; font-size: 1.2em; }
.lecon--tableau .solides-milieu { grid-template-columns: minmax(0, 1fr) 260px; }

/* --- Moins d'animations si l'élève le demande ------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .lecon *, .lecon *::before, .lecon *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* La copie pour l'impression n'existe qu'au moment d'imprimer */
@media screen { .impression-memo { display: none; } }

/* --- Imprimer le mémo seul ------------------------------------------------------------------------------- */
@media print {
  /* La fiche est copiée tout en haut du body (.impression-memo) : tout le reste disparait, rien n'est coupé */
  html.imprime-memo body > *:not(.impression-memo) { display: none !important; }
  html.imprime-memo body { display: block; min-height: 0; background: #fff !important; }
  .impression-memo { display: block; padding: 0; }
  .impression-memo .memo-fiche { box-shadow: none; break-inside: avoid; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .impression-memo * { animation: none !important; transition: none !important; }
}

/* =========================================================================================================
   Studio : traits fins, ombres douces, rien de penché
   ========================================================================================================= */
html[data-theme^="studio"] .lecon { --l-ombre: var(--ombre); --l-ombre-petite: 0 1px 2px rgba(20, 24, 40, .08); --l-trait-dessin: 1.8; --l-trait-solide: 1.8; }
html[data-theme^="studio"] .lecon :where(.lecon-matiere, .lecon-outil, .chemin-rond, .btn-ecouter, .btn-mini, .ecouter-phrase, .ecouter-hp, .etapes-num, .encadre,
  .conjugaison, .conjugaison-tete, .puce, .piece, .retour-juste, .retour-encore, .etiquette, .trier-boite, .trier-boite h4, .trou, .choix, .astuce-verdict,
  .memo-fiche, .memo-tete, .memo-retiens, .memo-jeu, .bascule, .solides-dessin, .compteur-sol, .compteur-compter, .devine input, .devine button,
  .interrupteur, .carnet-regle, .solides-extra, .lecon-fin, .bulle-texte, .etape-pastille, .signaler-form select, .signaler-form textarea) { border-width: 1px; border-color: var(--ligne); }
html[data-theme^="studio"] .lecon .etape, html[data-theme^="studio"] .lecon .machine-corps { border-width: 1px; border-color: var(--ligne); }
html[data-theme^="studio"] .lecon .etape-bandeau { border-bottom: 0; color: #fff; }
html[data-theme^="studio"] .lecon .etape-bandeau::after { opacity: .12; }
html[data-theme^="studio"] .lecon .etape-pastille { transform: none; border: 0; background: rgba(255, 255, 255, .22); color: #fff; }
html[data-theme^="studio"] .lecon .btn-ecouter { background: rgba(255, 255, 255, .95); border: 0; }
html[data-theme^="studio"] .lecon .etapes-num { transform: none; color: #fff; border: 0; }
html[data-theme^="studio"] .lecon .chemin-pas[aria-current] .chemin-rond, html[data-theme^="studio"] .lecon .chemin-pas.vu .chemin-rond { color: #fff; border-color: transparent; }
html[data-theme^="studio"] .lecon .btn-lecon { border: 0; background: var(--bleu); color: #fff; box-shadow: var(--ombre); }
html[data-theme^="studio"] .lecon .btn-lecon-doux { background: var(--papier); color: var(--encre); border: 1px solid var(--ligne); }
html[data-theme^="studio"] .lecon .choix.juste, html[data-theme^="studio"] .lecon .astuce-verdict.sonne-bien { color: #fff; }
html[data-theme^="studio"] .lecon .puce[aria-pressed="true"], html[data-theme^="studio"] .lecon .bascule button[aria-pressed="true"] { background: var(--bleu); color: #fff; border-color: var(--bleu); }
html[data-theme^="studio"] .lecon .interrupteur[aria-pressed="true"] { background: color-mix(in srgb, var(--bleu) 16%, var(--papier)); color: var(--bleu); border-color: var(--bleu); }
html[data-theme^="studio"] .lecon .memo-tete, html[data-theme^="studio"] .lecon .trier-boite h4 { color: #fff; }
html[data-theme^="studio"] .lecon .sol-nombre circle { stroke-width: 1.5; }
html[data-theme^="studio"] .lecon .dessin-lecon .d-ombre { display: none; }
html[data-theme^="studio"] .lecon .etiquette.choisie, html[data-theme^="studio"] .lecon .etiquette:hover, html[data-theme^="studio"] .lecon .etapes-num { transform: none; }
html[data-theme="studio-sombre"] .lecon {
  --m-radical: #6FA8FF; --m-temps: #4FD08A; --m-personne: #FF7A70; --m-aux: #B794FF; --m-pp: #FFA552; --m-accord: #FF7A70; --m-juste: #4FD08A;
}
html[data-theme="studio-sombre"] .lecon .sol-ombre { fill: #000; }
html[data-theme="studio-sombre"] .lecon .solides-extra, html[data-theme="studio-sombre"] .lecon .carnet-regle { color: #1D1A26; }

/* =========================================================================================================
   Affiche : papier blanc, aplats d'encre, aucune ombre, vert = juste
   ========================================================================================================= */
html[data-theme="affiche"] .lecon {
  --l-ombre: none; --l-ombre-petite: none; --l-trait-dessin: 2.4; --l-trait-solide: 2.2;
  --m-radical: #0078BF; --m-temps: #00A95C; --m-personne: #E3007F; --m-aux: #765BA7; --m-pp: #FF6C2F; --m-accord: #E3007F; --m-juste: #00A95C;
}
html[data-theme="affiche"] .lecon .lecon-titre { text-shadow: .06em .045em 0 var(--rose-fluo); font-stretch: 80%; }
html[data-theme="affiche"] .lecon .etape-bandeau::after { opacity: 0; }
html[data-theme="affiche"] .lecon .etape-pastille, html[data-theme="affiche"] .lecon .etapes-num, html[data-theme="affiche"] .lecon .etiquette.choisie,
html[data-theme="affiche"] .lecon .etiquette:hover { transform: none; }
html[data-theme="affiche"] .lecon .etape-bandeau, html[data-theme="affiche"] .lecon .memo-tete, html[data-theme="affiche"] .lecon .trier-boite h4 { background-image: var(--grain-encre); background-blend-mode: multiply; }
html[data-theme="affiche"] .lecon .btn-lecon:not(.btn-lecon-doux) { background: var(--jaune-riso); }
html[data-theme="affiche"] .lecon .choix.juste { background: var(--juste); color: #fff; }
html[data-theme="affiche"] .lecon .lu { outline-color: var(--rose-fluo); background-color: color-mix(in srgb, var(--jaune-riso) 25%, transparent); }
html[data-theme="affiche"] .lecon .sol-ombre { fill: #1C1B1A; }
html[data-theme="affiche"] .lecon .lecon-fin-etoile .ico-lecon { fill: var(--jaune-riso); }

/* --- Groupes (une colonne de « colonnes ») --------------------------------------------------------------- */
.groupe { display: grid; gap: 12px; align-content: start; }
.groupe-cadre { padding: 14px 16px; border-radius: 16px; border: 2px solid var(--encre); background: var(--creme); }
html[data-theme^="studio"] .lecon .groupe-cadre { border: 1px solid var(--ligne); }

/* --- Leçon déjà terminée : l'élève le voit, et peut la refaire autant qu'il veut ---------------------------- */
.lecon-terminee {
  display: inline-flex; align-items: center; gap: 5px; margin-left: 8px; padding: 3px 10px; border-radius: 999px; vertical-align: top;
  font-size: .78rem; font-weight: 800; background: var(--vert); color: #1D1A26; border: 2px solid var(--encre);
}
.lecon-terminee .ico-lecon { width: 15px; height: 15px; }
html[data-theme^="studio"] .lecon .lecon-terminee { border: 0; color: #fff; }

/* =========================================================================================================
   Réponse à taper, remise en ordre (31 oct.)
   ========================================================================================================= */
.saisie-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.saisie-ligne input {
  width: min(260px, 100%); padding: 10px 14px; border-radius: 12px; border: 2px solid var(--encre); background: var(--papier); color: var(--encre);
  font-size: 1.2rem; font-weight: 800;
}
.saisie-ligne input.juste { background: color-mix(in srgb, var(--vert) 24%, var(--papier)); }
.saisie-ligne .btn-lecon { padding: 9px 18px; }
.saisie-unite { font-weight: 800; font-size: 1.15rem; }
.ordre-liste { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; counter-reset: o; }
.ordre-item {
  counter-increment: o; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 8px 10px 8px 12px;
  border-radius: 12px; background: var(--papier); border: 2px solid var(--encre); font-size: 1.08rem; animation: apparait .25s both;
}
.ordre-item::before { content: counter(o); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--creme); border: 2px solid var(--encre); font-weight: 800; font-size: .85rem; }
.ordre-item.mal-place { border-style: dashed; opacity: .7; }
.ordre-item.placee { background: color-mix(in srgb, var(--vert) 20%, var(--papier)); }
.ordre-fleches { display: flex; gap: 4px; }
.ordre-fleches button { width: 34px; height: 32px; border-radius: 8px; border: 2px solid var(--encre); background: var(--creme); color: var(--encre); cursor: pointer; font-size: .8rem; }
.ordre-fleches button:disabled { opacity: .25; cursor: default; }

/* =========================================================================================================
   Blocs de mathématiques (maths.js)
   ========================================================================================================= */
.fraction-bloc, .numeration, .droite-bloc, .angle-bloc { display: grid; gap: 12px; }
.fraction-dessins { display: grid; gap: 14px; }
.fraction-une { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.fraction-une .fraction-svg { flex: 0 1 auto; }
.fraction-svg { width: 100%; max-width: 220px; height: auto; }
.fraction-barre { max-width: 520px; flex-basis: 420px !important; }
.fraction-svg .part { fill: var(--papier); stroke: var(--encre); stroke-width: 3; transition: fill .15s; }
.fraction-svg .part.coloriee { fill: var(--orange); }
.fraction-svg .part.cliquable { cursor: pointer; }
.fraction-svg .part.cliquable:hover { fill: color-mix(in srgb, var(--orange) 35%, var(--papier)); }
.fraction-svg .part.cliquable.coloriee:hover { fill: var(--orange); }
.fraction-texte { display: inline-flex; align-items: center; gap: 10px; font-family: var(--police-titre); font-size: 1.6rem; font-weight: 700; }
.fr { display: inline-flex; flex-direction: column; align-items: center; line-height: 1; }
.fr i { display: block; width: 100%; min-width: 24px; height: 3px; background: currentColor; margin: 4px 0; border-radius: 2px; }
.fraction-egal { display: inline-flex; align-items: center; gap: 8px; opacity: .8; font-size: .9em; }
.fraction-commandes { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.fraction-reglage { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: .9rem; }
.fraction-reglage button { width: 34px; height: 34px; border-radius: 10px; border: 2px solid var(--encre); background: var(--papier); color: var(--encre); font-weight: 800; font-size: 1.1rem; cursor: pointer; }
@media (max-width: 560px) { .fraction-une { grid-template-columns: 1fr; justify-items: center; } }

.num-table { border-collapse: separate; border-spacing: 0; margin: 0 auto; font-size: 1.05rem; }
.num-table th, .num-table td { border: 2px solid var(--encre); text-align: center; padding: 6px 4px; min-width: 46px; }
.num-table th { background: var(--creme); font-size: .82rem; }
.num-table .num-classe { background: color-mix(in srgb, var(--ciel) 40%, var(--papier)); }
.num-table .num-classe.num-dec, .num-table th.num-dec { background: color-mix(in srgb, var(--rose) 35%, var(--papier)); }
.num-table th.num-unite { background: color-mix(in srgb, var(--jaune) 55%, var(--papier)); }
.num-table td { height: 54px; font-family: var(--police-titre); font-size: 1.7rem; font-weight: 700; background: var(--papier); }
.num-table td.num-unite { border-right-width: 5px; }
.num-chiffre { display: inline-block; }
.num-chiffre.bouge-gauche { animation: num-gauche .45s cubic-bezier(.2, .9, .3, 1.2); }
.num-chiffre.bouge-droite { animation: num-droite .45s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes num-gauche { from { transform: translateX(46px); opacity: .3; } }
@keyframes num-droite { from { transform: translateX(-46px); opacity: .3; } }
.numeration-nombre { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; margin: 0; font-size: 1.6rem; font-family: var(--police-titre); }
.numeration-ops { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; }

.droite-dessin { border-radius: 16px; background: var(--creme); border: 2px solid var(--encre); padding: 6px; }
.droite-svg { display: block; width: 100%; height: auto; touch-action: none; user-select: none; }
.droite-axe { stroke: var(--encre); stroke-width: 3; }
.droite-fleche { fill: var(--encre); }
.droite-grad { stroke: var(--encre); stroke-width: 1.6; opacity: .7; }
.droite-grad.grande { stroke-width: 2.6; opacity: 1; }
.droite-nb { fill: var(--encre); font: 800 15px var(--police); text-anchor: middle; }
.droite-point circle { fill: var(--corail); stroke: var(--encre); stroke-width: 2.5; }
.droite-point text { fill: var(--encre); font: 800 15px var(--police-titre); text-anchor: middle; }
.droite-curseur { cursor: grab; }
.droite-curseur path { fill: var(--jaune); stroke: var(--encre); stroke-width: 2.5; stroke-linejoin: round; }
.droite-curseur line { stroke: var(--encre); stroke-width: 2.5; stroke-dasharray: 4 3; }
.droite-curseur.juste path { fill: var(--vert); }
.droite-valeur { margin: 0; font-size: 1.05rem; }

.angle-dessin { border-radius: 16px; background: var(--creme); border: 2px solid var(--encre); }
.angle-svg { display: block; width: 100%; max-width: 560px; height: auto; margin: 0 auto; touch-action: none; user-select: none; }
.angle-cote { stroke: var(--encre); stroke-width: 4; stroke-linecap: round; }
.angle-sommet { fill: var(--encre); }
.angle-poignee { fill: var(--jaune); stroke: var(--encre); stroke-width: 3; cursor: grab; }
.angle-arc, .angle-droit { fill: none; stroke: var(--corail); stroke-width: 4; }
.angle-svg[data-genre="droit"] .angle-droit { stroke: var(--vert); fill: color-mix(in srgb, var(--vert) 30%, transparent); }
.rap-fond { fill: color-mix(in srgb, var(--ciel) 25%, transparent); stroke: var(--encre); stroke-width: 1.5; }
.rap-grad { stroke: var(--encre); stroke-width: 1.2; }
.rap-nb { fill: var(--encre); font: 700 11px var(--police); text-anchor: middle; }
.angle-info { margin: 0; font-size: 1.1rem; }
html[data-theme^="studio"] .lecon :where(.saisie-ligne input, .ordre-item, .ordre-item::before, .ordre-fleches button, .fraction-reglage button, .num-table th, .num-table td, .droite-dessin, .angle-dessin) { border-width: 1px; border-color: var(--ligne); }
html[data-theme^="studio"] .lecon .fraction-svg .part { stroke-width: 1.5; }

/* =========================================================================================================
   Page « Déclic ! J'apprends » (apprendre.php) et barre au-dessus d'une leçon (lecon.php)
   ========================================================================================================= */
.japprends { max-width: 1080px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 32px) 40px; width: 100%; }
.japprends-tete { display: flex; align-items: center; gap: 16px; margin: 4px 0 8px; }
.japprends-tete .pinpon { width: 72px; height: 78px; flex: none; }
.japprends-sur { margin: 0; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: .85rem; opacity: .7; }
.japprends-sous { margin: 0 0 22px; font-size: 1.08rem; opacity: .85; max-width: 70ch; }
.japprends h2 { font-size: 1.35rem; margin: 28px 0 12px; display: flex; align-items: center; gap: 10px; }
.japprends h2::before { content: ""; width: 14px; height: 14px; border-radius: 4px; background: var(--c); border: 2px solid var(--encre); }
.japprends-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.carte-lecon {
  display: grid; grid-template-rows: auto 1fr auto; text-decoration: none; color: var(--encre); overflow: hidden;
  background: var(--papier); border: var(--trait) solid var(--encre); border-radius: var(--rayon); box-shadow: 4px 4px 0 var(--encre); transition: transform .12s;
}
.carte-lecon:hover { transform: translate(-2px, -2px) rotate(-.4deg); }
.carte-lecon-haut { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; background: var(--c); border-bottom: var(--trait) solid var(--encre); color: #1D1A26; font-weight: 800; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.carte-lecon-corps { padding: 14px 16px 6px; }
.carte-lecon h3 { font-size: 1.3rem; margin-bottom: 6px; }
.carte-lecon p { margin: 0; font-size: .95rem; opacity: .8; }
.carte-lecon-pied { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 16px 14px; font-weight: 800; font-size: .88rem; }
.carte-lecon-go { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--jaune); border: 2px solid var(--encre); color: #1D1A26; }
.carte-lecon-fini { display: inline-flex; align-items: center; gap: 5px; color: var(--m-juste, #128A45); }
.carte-lecon-fini .ico { width: 16px; height: 16px; }
.carte-lecon.est-terminee .carte-lecon-go { background: var(--papier); color: var(--encre); }
.carte-lecon.bientot { opacity: .5; pointer-events: none; box-shadow: none; border-style: dashed; }
html[data-theme^="studio"] .carte-lecon { box-shadow: var(--ombre); border: 1px solid var(--ligne); }
html[data-theme^="studio"] .carte-lecon-haut { border-bottom: 0; color: #fff; }
html[data-theme^="studio"] .carte-lecon:hover { transform: translateY(-2px); }
html[data-theme^="studio"] .japprends h2::before { border: 0; }
html[data-theme="affiche"] .carte-lecon { box-shadow: none; }
html[data-theme="affiche"] .carte-lecon:hover { transform: none; }
.lecon-barre { max-width: 1080px; margin: 0 auto 4px; padding: 0 clamp(16px, 3vw, 32px); width: 100%; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.page-lecon-tableau .lecon-barre { max-width: 1400px; }

/* --- Vitrine publique des leçons (lecons_publiques.php, /lecons-interactives/) ---------------------------------- */
.lecon-publique { max-width: 860px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 32px); width: 100%; display: grid; gap: 14px; }
.lecon-publique .titre-geant { margin: 0; }
.lecon-publique .fiche-etiquettes { display: flex; flex-wrap: wrap; gap: 8px; }
.lecon-publique-etapes { margin: 0; padding-left: 22px; display: grid; gap: 4px; }
.lecon-publique-essayer { max-width: 1080px; margin: 34px auto 10px; padding: 0 clamp(16px, 3vw, 32px); width: 100%; font-size: 1.6rem; }
.japprends-domaine { font-size: 1.05rem; margin: 18px 0 10px; opacity: .75; text-transform: uppercase; letter-spacing: .05em; }

/* =========================================================================================================
   Grammaire (code des fiches de Julien) : GS / GP / GCP en trois couleurs (GCP en pointillé = facultatif),
   noyau encadré, attribut surligné, CDV / CIV, classes de mots ; maths : chiffre et unité (31 oct.)
   ========================================================================================================= */
.lecon, .lecon-publique {
  --g-gs: #1E6CD6; --g-gp: #D7372F; --g-gcp: #128A45;
  --c-det: #C25A00; --c-nom: #1E6CD6; --c-adj: #128A45; --c-pronom: #8340D8; --c-verbe: #D7372F; --c-adverbe: #0E8A86; --c-connecteur: #6B6F80; --c-prep: #9A5B13;
}
html[data-theme="studio-sombre"] .lecon { --g-gs: #6FA8FF; --g-gp: #FF7A70; --g-gcp: #4FD08A; --c-det: #FFA552; --c-nom: #6FA8FF; --c-adj: #4FD08A; --c-pronom: #B794FF; --c-verbe: #FF7A70; --c-adverbe: #4FD0C8; --c-connecteur: #A9B0C0; --c-prep: #E0A060; }
html[data-theme="affiche"] .lecon { --g-gs: #0078BF; --g-gp: #E3007F; --g-gcp: #00A95C; --c-nom: #0078BF; --c-verbe: #E3007F; --c-adj: #00A95C; --c-pronom: #765BA7; --c-det: #FF6C2F; }
.m-gs, .m-gp, .m-gcp { font-weight: 700; padding: 0 3px; border-radius: 5px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.m-gs { color: var(--g-gs); background: color-mix(in srgb, var(--g-gs) 12%, transparent); border-bottom: 3px solid var(--g-gs); }
.m-gp { color: var(--g-gp); background: color-mix(in srgb, var(--g-gp) 10%, transparent); border-bottom: 3px solid var(--g-gp); }
.m-gcp { color: var(--g-gcp); background: color-mix(in srgb, var(--g-gcp) 10%, transparent); border-bottom: 3px dashed var(--g-gcp); }
.m-noyau { font-weight: 800; outline: 2px solid currentColor; outline-offset: 1px; border-radius: 4px; padding: 0 2px; }
.m-cdv { font-weight: 800; color: var(--c-pronom); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.m-civ { font-weight: 800; color: var(--c-det); text-decoration: underline dotted; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.m-attribut { font-weight: 800; background: color-mix(in srgb, var(--jaune) 55%, transparent); border-radius: 4px; padding: 0 3px; }
.m-det { color: var(--c-det); } .m-nom { color: var(--c-nom); } .m-adj { color: var(--c-adj); } .m-pronom { color: var(--c-pronom); }
.m-verbe { color: var(--c-verbe); } .m-adverbe { color: var(--c-adverbe); } .m-connecteur { color: var(--c-connecteur); } .m-prep { color: var(--c-prep); }
.m-chiffre { color: var(--m-radical); font-variant-numeric: tabular-nums; }
.m-unite { color: var(--c-adverbe); }

/* --- Bloc « manipuler » : supprimer / déplacer un groupe ------------------------------------------------ */
.manipuler { display: grid; gap: 10px; }
.manipuler-phrase { margin: 0 !important; font-size: clamp(1.2rem, 3vw, 1.5rem); line-height: 2.1; }
.manipuler-groupe {
  font: inherit; cursor: pointer; padding: 2px 10px; border-radius: 10px; border: 2px dashed color-mix(in srgb, var(--encre) 45%, transparent);
  transition: transform .1s;
}
.manipuler-groupe:not(.m) { background: var(--papier); color: inherit; }
.manipuler-groupe.m { border-bottom-width: 3px; }
.manipuler-groupe:hover { transform: translateY(-2px); }
.manipuler-groupe[aria-pressed="true"] { border-style: solid; border-color: var(--encre); box-shadow: var(--l-ombre-petite); }
.manipuler-outils { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.manipuler-outils .puce:disabled { opacity: .35; cursor: default; }
.manipuler-obtenue { margin: 0 !important; padding: 10px 14px; border-radius: 12px; font-size: 1.2rem; border: 2px solid var(--encre); animation: apparait .3s both; }
.manipuler-obtenue.sonne-bien { background: color-mix(in srgb, var(--vert) 18%, var(--papier)); }
.manipuler-obtenue.sonne-faux { background: var(--creme); border-style: dashed; }
.manipuler-fin { margin: 0 !important; }
