/* ===== Charte Petit Meeple v2 ===== */
@font-face { font-family: "Baloo 2"; src: url("/fonts/baloo2.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("/fonts/nunito.woff2") format("woff2"); font-weight: 200 1000; font-display: swap; }
@font-face { font-family: "Andika"; src: url("/fonts/andika-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Andika"; src: url("/fonts/andika-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  /* Palette : principale, secondaires, neutres */
  --violet: #6A3DF0; --violet-fonce: #5229D6; --orange: #FF9F3C; --cyan: #20B7E5;
  --creme: #FFF9F0; --gris-clair: #E5E7EB; --gris: #9CA3AF; --encre: #2D2440; --gris-texte: #5B5670;
  /* Couleurs par matière */
  --fr: #8B5CF6; --ma: #0EA5E9; --sc: #10B981; --hg: #F59E0B; --en: #EC4899; --hi: #F59E0B; --ge: #14B8A6; --em: #3B5BDB;
  /* Jetons appliqués (l'univers de l'enfant les surcharge) */
  --fond1: var(--creme); --fond2: #F1ECFF; --primaire: var(--violet); --accent: var(--orange); --carte: #ffffff; --texte-carte: var(--encre);
  --texte: var(--encre); --doux: var(--gris-texte); --bon: #15803D; --faux: #D92D3A; --rayon: 20px;
  --ombre: 0 6px 18px rgba(45, 36, 64, .10); --bord: 2px solid #EFEAFB;
  --c-sujet: #1f9d55; --c-verbe: #e8590c; --decor: none;
  --titres: "Baloo 2", "Nunito", system-ui, sans-serif;
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
/* touch-action: manipulation : le toucher réagit tout de suite (pas d'attente d'un double-tap pour zoomer). */
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; }
body {
  margin: 0; min-height: 100vh; color: var(--texte);
  background: var(--fond1);
  -webkit-tap-highlight-color: transparent;
}
/* Fond et décor sur une couche fixe à part : elle n'est pas redessinée à chaque changement
   de page (sur iPad, redessiner le décor sur toute la hauteur de la page coûtait cher). */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: var(--decor), linear-gradient(160deg, var(--fond1), var(--fond2));
  background-size: 420px 420px, cover;
  transform: translateZ(0);
}
/* Indicateur discret quand le serveur met du temps à répondre. */
html.reseau-attente body::after {
  content: ""; position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 2000; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--primaire), transparent); background-size: 50% 100%; background-repeat: no-repeat;
  animation: attente 1s linear infinite;
}
@keyframes attente { from { background-position: -50% 0; } to { background-position: 150% 0; } }
body.parent { --fond1: #F7F7FA; --fond2: #F7F7FA; --decor: none; --primaire: var(--violet); --accent: var(--orange); --ombre: 0 1px 3px rgba(45, 36, 64, .08); --bord: 1px solid var(--gris-clair); }
body.andika, body.andika .champ, body.andika .bouton, body.andika .mot, body.andika .touche { font-family: "Andika", "Nunito", sans-serif; }
body.andika .consigne, body.andika .lecon-contenu { letter-spacing: .02em; }
body.dys { font-family: Verdana, "Comic Sans MS", sans-serif; letter-spacing: .04em; word-spacing: .12em; line-height: 1.6; }
a { color: var(--primaire); }
h1, h2, h3, h4 { line-height: 1.15; font-family: var(--titres); font-weight: 800; }
h1 { font-size: 2rem; } h2 { font-size: 1.55rem; }
.titre-icone { display: flex; align-items: center; gap: 10px; }
.titre-icone svg { flex: none; }
.ecran { max-width: 980px; margin: 0 auto; padding: 12px 16px 120px; animation: glisse .15s ease-out; }
@keyframes glisse { from { opacity: .4; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.chargement { text-align: center; padding: 40px; color: var(--doux); }
.centre { text-align: center; }
.petit { font-size: .9rem; color: var(--doux); }
.grand { font-size: 1.25rem; }
.geant { font-size: 2.2rem; font-weight: 700; margin: .3em 0; }
.emoji-geant { font-size: 3.2rem; line-height: 1; display: block; }
.emoji-moyen { font-size: 2rem; line-height: 1; }
.info { background: #FFF1DD; color: var(--encre); border: 1px solid #FFD9A8; border-radius: 12px; padding: 10px 14px; }
.erreur-texte { color: var(--faux); min-height: 1em; }
.rangee { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 8px 0; }
.rangee.centre { justify-content: center; }
.rangee.fin { justify-content: flex-end; }

/* ===== Cartes, boutons, champs ===== */
.carte { background: var(--carte); color: var(--texte-carte); border-radius: var(--rayon); box-shadow: var(--ombre); border: var(--bord); padding: 18px; margin: 14px 0; }
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 10px 20px;
  border: 0; border-radius: 999px; background: var(--primaire); color: #fff; font-size: 1.1rem; font-weight: 700; cursor: pointer;
  text-decoration: none; box-shadow: inset 0 -4px 0 rgba(0,0,0,.22), 0 4px 10px rgba(45,36,64,.15); transition: transform .08s, box-shadow .08s, filter .15s;
  font-family: var(--titres); letter-spacing: .01em;
}
.bouton:active { transform: translateY(2px); box-shadow: inset 0 2px 4px rgba(0,0,0,.25); filter: brightness(.92); }
.bouton:focus-visible, .tuile:focus-visible, .choix-btn:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
@media (hover: hover) { .bouton:hover { filter: brightness(1.06); } }
.bouton:disabled { background: #C9C5D6; color: #fff; box-shadow: none; cursor: default; }
.bouton.secondaire { background: #fff; color: var(--primaire); box-shadow: inset 0 0 0 2px var(--primaire); }
.bouton.orange { background: var(--orange); color: var(--encre); }
.bouton.cyan { background: var(--cyan); color: var(--encre); }
.bouton.danger { background: var(--faux); }
.bouton.gros { font-size: 1.2rem; min-height: 58px; padding: 12px 28px; margin: 10px auto; display: flex; width: min(100%, 420px); }
.bouton.petit { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.bouton-rond { width: 44px; height: 44px; border-radius: 50%; border: 2px solid #EFEAFB; background: #fff; font-size: 1.2rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: var(--encre); cursor: pointer; box-shadow: var(--ombre); flex: none; }
.bouton-rond.petit { width: 32px; height: 32px; font-size: .9rem; margin-left: 8px; vertical-align: middle; }
.lien { background: none; border: 0; color: var(--primaire); text-decoration: underline; cursor: pointer; font-size: .95rem; padding: 8px; font-family: inherit; }
.champ { width: 100%; font-size: 1.05rem; padding: 12px 16px; border: 2px solid #D9D3F2; border-radius: 14px; background: #fff; color: var(--encre); font-family: inherit; }
.champ:invalid:not(:placeholder-shown):not(:focus) { border-color: var(--faux); }
.champ:focus { outline: none; border-color: var(--primaire); box-shadow: 0 0 0 4px rgba(106, 61, 240, .15); }
.champ.court { width: 130px; }
.champ.tres-court { width: 64px; text-align: center; }
textarea.champ { resize: vertical; }
.champ-groupe { display: block; margin: 10px 0; flex: 1 1 160px; }
.label { display: block; font-weight: 700; margin-bottom: 4px; }
.champ-groupe small { display: block; color: var(--doux); margin-top: 4px; }
.case { display: flex; gap: 8px; align-items: center; padding: 6px 0; cursor: pointer; }
.case > span { flex: 1; }
.case input { width: 22px; height: 22px; accent-color: var(--primaire); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; border-radius: 999px; background: #fff; border: 2px solid #EFEAFB; color: var(--encre); font-weight: 800; font-size: .9rem; text-decoration: none; box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.chip.gros { font-size: 1.05rem; padding: 6px 14px; }
.chip.alerte { background: #ffe3e3; color: var(--faux); animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.08); } }

/* ===== Messages ===== */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; background: var(--encre); font-weight: 700; color: #fff; padding: 12px 20px; border-radius: 14px; z-index: 1000; transition: all .25s; max-width: 92vw; box-shadow: var(--ombre); }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.toast.succes { background: var(--bon); }
.toast.erreur { background: var(--faux); }
.modale-fond { position: fixed; inset: 0; background: rgba(20, 24, 40, .45); display: flex; align-items: center; justify-content: center; z-index: 900; padding: 16px; animation: apparait .15s; }
.modale-fond.sortie { opacity: 0; transition: opacity .2s; }
.modale { background: #fff; color: var(--encre); border-radius: 22px; padding: 22px; width: min(420px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 20px 50px rgba(0,0,0,.3); animation: zoom .2s ease-out; }
@keyframes apparait { from { opacity: 0; } }
@keyframes zoom { from { transform: scale(.92); opacity: 0; } }

/* ===== Connexion ===== */
.connexion { max-width: 480px; }
.vitrine { text-align: center; padding: 20px 0 0; }
.titre-logo { margin: 0; }
.vitrine p { font-size: 1.1rem; }
.logo-pm { display: flex; justify-content: center; }
.logo-image { display: block; height: auto; max-width: 100%; }
.logo-pm.grand .logo-image { width: 340px; animation: logo-flotte 4s ease-in-out infinite; }
@keyframes logo-flotte { 50% { transform: translateY(-6px); } }
.logo-pm.petit { margin-top: 10px; }
.logo-pm.petit .logo-image { width: 190px; }
@keyframes flotte { 50% { transform: translateY(-8px) rotate(-3deg); } }
.pied { text-align: center; font-size: .85rem; }

/* ===== Profils ===== */
.titre-profils { margin-top: 18px; font-size: 2.2rem; }
.grille-profils { display: flex; flex-wrap: wrap; gap: 26px; justify-content: center; margin-top: 30px; }
.profil { display: flex; flex-direction: column; align-items: center; gap: 10px; text-decoration: none; color: inherit; font-weight: 700; font-size: 1.15rem; transition: transform .15s; }
@media (hover: hover) { .profil:hover, .profil:focus { transform: scale(1.06); } }
.avatar { position: relative; display: inline-flex; align-items: center; justify-content: center; border-radius: 28%; background: #C4B5FD; box-shadow: var(--ombre); border: 3px solid #fff; flex: none; }
.avatar.petit { width: 40px; height: 40px; font-size: 1.5rem; border-radius: 30%; }
.avatar.moyen { width: 70px; height: 70px; font-size: 2.6rem; }
.avatar.grand { width: 120px; height: 120px; font-size: 4.6rem; }
.avatar-acc { position: absolute; top: -18%; right: -14%; font-size: .55em; transform: rotate(12deg); }
.cadenas-avatar { background: #F1ECFF; }

/* ===== En-tête enfant ===== */
.entete-enfant { display: flex; align-items: center; gap: 10px; padding: 6px 0; position: sticky; top: 0; z-index: 10; }
.entete-enfant .qui { display: flex; align-items: center; gap: 8px; font-family: var(--titres); font-weight: 800; font-size: 1.3rem; text-decoration: none; color: inherit; flex: 1; min-width: 0; }
.entete-enfant .qui span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compteurs { display: flex; gap: 6px; }
.salut { font-family: var(--titres); font-size: 1.5rem; font-weight: 800; margin: 8px 0; }

/* ===== Tuiles de l'accueil ===== */
/* Accueil : rangées de tuiles de même largeur ; le nombre de colonnes (--c1 téléphone, --c2 tablette, --c3 ordinateur)
   est calculé selon le nombre de tuiles, la dernière ligne est centrée : jamais de trou d'un seul côté. */
.tuiles { --c: var(--c1, 2); --gap: 12px; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--gap); margin-top: 12px; }
.tuiles > .tuile { flex: 0 0 calc((100% - (var(--c) - 1) * var(--gap)) / var(--c)); min-width: 0; }
@media (min-width: 600px) { .tuiles { --c: var(--c2, 4); --gap: 14px; } }
@media (min-width: 900px) { .tuiles { --c: var(--c3, 5); } }
.tuiles + .tuiles { margin-top: 14px; }
/* Accueil : outils rangés en groupes titrés (S'entraîner, Mes points, Mes récompenses) */
.groupes { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 22px; }
.groupe { --teinte: #6A3DF0; background: color-mix(in srgb, var(--teinte) 9%, rgba(255,255,255,.75)); border: 2px solid color-mix(in srgb, var(--teinte) 22%, transparent); border-radius: 26px; padding: 8px 12px 14px; min-width: 0; display: flex; flex-direction: column; }
.groupe-entrainer { --teinte: #FF9F3C; }
.groupe-points { --teinte: #6A3DF0; }
.groupe-recompenses { --teinte: #20B7E5; }
.groupe-titre { margin: 2px 6px 8px; font-family: "Baloo 2", sans-serif; font-size: 1.15rem; font-weight: 800; color: color-mix(in srgb, var(--teinte) 70%, #2D2440); }
.groupe-tuiles { flex: 1; display: grid; grid-template-columns: repeat(min(var(--n), 3), minmax(0, 1fr)); gap: 12px; }
@media (min-width: 600px) { .groupe-tuiles { grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 14px; } }
@media (min-width: 900px) {
  .groupes { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .groupe { grid-column: span var(--span); }
  .groupe-recompenses .tuile { min-height: 150px; }
}
.tuile { background: var(--carte); color: var(--texte-carte); border-radius: 24px; padding: 18px 12px; text-decoration: none; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; box-shadow: var(--ombre); border: 2px solid #EFEAFB; transition: transform .12s; border-bottom: 6px solid #E4DDF8; }
.tuile:active { transform: scale(.97); }
@media (hover: hover) { .tuile:hover { transform: translateY(-3px); } }
.tuile-icone svg { display: block; filter: drop-shadow(0 3px 0 rgba(45,36,64,.12)); }
.tuile-titre { font-family: var(--titres); font-weight: 800; font-size: 1.25rem; line-height: 1.1; }
.tuile-sous { font-size: .85rem; color: var(--doux); }
.tuile.grande { min-height: 150px; justify-content: center; border-bottom-width: 8px; }
.tuile.grande .tuile-titre { font-size: 1.6rem; }
.tuile.grande .tuile-sous { font-size: .95rem; }
.tuile-texte { display: flex; flex-direction: column; gap: 4px; }
@media (min-width: 600px) {
  .tuile.grande { min-height: 190px; flex-direction: row; gap: 18px; padding: 22px 20px; }
  .tuile.grande .tuile-icone svg { width: 96px; height: 96px; }
  .tuile.grande .tuile-texte { text-align: left; }
  .tuile.grande .tuile-titre { font-size: 2rem; }
}
.tuile.petite { padding: 10px 6px 8px; border-radius: 18px; border-bottom-width: 5px; gap: 2px; justify-content: center; }
.tuile.petite .tuile-titre { font-size: 1rem; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.tuile.petite .tuile-sous { font-size: .75rem; }
@media (min-width: 600px) { .tuile.petite .tuile-titre { font-size: 1.1rem; } }
.groupe-tuiles .tuile .tuile-titre { overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
@media (max-width: 599px) { .groupe-tuiles .tuile { padding: 12px 4px 10px; border-radius: 20px; } .groupe-tuiles .tuile .tuile-titre { font-size: 1rem; } .groupe-tuiles .tuile .tuile-sous { font-size: .75rem; } .groupe-tuiles .tuile-icone :is(svg,img) { width: 44px; height: 44px; } }
.tuile.matiere-fr { border-bottom-color: var(--fr); background: linear-gradient(180deg, #fff 55%, #F3EEFF); }
.tuile.matiere-ma { border-bottom-color: var(--ma); background: linear-gradient(180deg, #fff 55%, #E7F7FE); }
.tuile.matiere-an { border-bottom-color: var(--en); background: linear-gradient(180deg, #fff 55%, #FDE7F3); }
.tuile.matiere-hi { border-bottom-color: var(--hi); background: linear-gradient(180deg, #fff 55%, #FFF4DB); }
.tuile.matiere-ge { border-bottom-color: var(--ge); background: linear-gradient(180deg, #fff 55%, #DFF7F3); }
.tuile.matiere-em { border-bottom-color: var(--em); background: linear-gradient(180deg, #fff 55%, #E5EBFF); }
.tuile.matiere-sc { border-bottom-color: var(--sc); background: linear-gradient(180deg, #fff 55%, #DDF7EC); }
.tuile.bientot { opacity: .8; }

/* ===== Jauge de la semaine : plateau de jeu de 7 cases, 3 paliers ===== */
.jauge { display: block; text-decoration: none; color: var(--texte-carte); padding: 12px 22px 64px; background: var(--carte); border-radius: var(--rayon); box-shadow: var(--ombre); border: 2px solid #EFEAFB; margin: 10px 0; }
.jauge.compacte { padding: 10px 22px 26px; }
.jauge-titre { display: flex; justify-content: space-between; gap: 10px; font-family: var(--titres); font-weight: 800; font-size: 1.1rem; margin-bottom: 34px; }
.jauge-titre b { color: var(--primaire); white-space: nowrap; }
.piste { position: relative; height: 26px; margin-left: 14px; }
.depart { position: absolute; left: -18px; top: 50%; width: 26px; height: 26px; transform: translateY(-50%); border-radius: 50%; background: #fff; border: 3px solid var(--encre); z-index: 1; }
.cases { display: flex; gap: 5px; height: 100%; }
.case-plateau { flex: 1; border-radius: 9px; border: 3px solid var(--encre); transition: background .6s; }
.jalon { position: absolute; top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; z-index: 2; }
.jalon-icone { display: flex; padding: 4px; background: #fff; border-radius: 50%; border: 3px solid var(--encre); }
.jalon-icone svg { display: block; filter: grayscale(1) opacity(.45); transition: filter .3s, transform .3s; }
.jalon.atteint .jalon-icone { background: #FFF4CC; }
.jalon.atteint .jalon-icone svg { filter: none; }
.jalon-nom { position: absolute; top: 58px; font-size: .78rem; line-height: 1.15; text-align: center; white-space: nowrap; font-weight: 700; color: var(--texte-carte); }
.jalon.j-or { transform: translate(-100%, -50%); align-items: flex-end; }
.jalon.j-or .jalon-nom { right: 0; text-align: right; }
.pion { position: absolute; top: -46px; width: 50px; transform: translateX(-50%); z-index: 3; transition: left .6s ease-out; animation: flotte 2.5s infinite; pointer-events: none; }
.pion svg { width: 100%; display: block; overflow: visible; }
.jauge.compacte .pion { width: 44px; top: -42px; }
.jauge.compacte .jalon-icone { padding: 2px; }
.paliers { list-style: none; padding: 0; }
.paliers li { display: flex; gap: 8px; align-items: center; padding: 8px; border-radius: 10px; flex-wrap: wrap; }
.paliers li.atteint { background: #EAF8EF; }
.paliers .emoji svg { display: block; }
.paliers .emoji { font-size: 1.6rem; }
.cagnotte .geant { color: var(--primaire); font-family: var(--titres); }

/* ===== Matières et leçons ===== */
.domaine { margin: 18px 0 6px; font-size: 1.2rem; }
.sous-titre { margin-top: 26px; }
.liste-notions { display: grid; gap: 8px; }
.notion { display: flex; justify-content: space-between; align-items: center; background: var(--carte); color: var(--texte-carte); padding: 14px 16px; border-radius: 16px; text-decoration: none; box-shadow: 0 2px 8px rgba(45,36,64,.06); border: 2px solid #EFEAFB; border-left: 8px solid var(--primaire); font-weight: 700; }
.matiere-fr .notion { border-left-color: var(--fr); }
.matiere-ma .notion { border-left-color: var(--ma); }
.matiere-an .notion { border-left-color: var(--en); }
.matiere-hi .notion { border-left-color: var(--hi); } .matiere-ge .notion { border-left-color: var(--ge); } .matiere-em .notion { border-left-color: var(--em); } .matiere-sc .notion { border-left-color: var(--sc); }
.notion-etoiles { color: #F5A400; letter-spacing: 2px; white-space: nowrap; }
.lecon-contenu { font-size: 1.2rem; line-height: 1.6; }
.lecon-contenu .exemple { background: #f8f9fa; border-radius: 10px; padding: 10px 14px; }
.lecon-contenu table.conj { border-collapse: collapse; width: 100%; }
.lecon-contenu table.conj td, .lecon-contenu table.conj th { border: 1px solid #dee2e6; padding: 6px; text-align: center; }
.sujet { color: var(--c-sujet); font-weight: 700; text-decoration: underline; text-decoration-color: var(--c-sujet); }
.verbe { color: var(--c-verbe); font-weight: 700; }

/* ===== Exercice ===== */
.barre-exo { display: flex; align-items: center; gap: 10px; }
.titre-exo { flex: 1; font-weight: 700; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.score-live { font-weight: 800; font-size: 1.2rem; }
.progression { display: flex; gap: 5px; margin: 10px 0; }
.pastille { flex: 1; height: 8px; border-radius: 99px; background: rgba(0,0,0,.1); transition: background .2s; }
.pastille.ok { background: var(--bon); }
.pastille.ko { background: var(--faux); }
.carte-question { text-align: center; min-height: 320px; transition: box-shadow .2s; }
.carte-question.reussi { box-shadow: 0 0 0 4px var(--bon), var(--ombre); }
.carte-question.secousse { animation: secousse .35s; }
@keyframes secousse { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.consigne { font-size: 1.3rem; font-weight: 800; margin-top: 0; }
.visuel { margin: 10px 0; overflow-x: auto; }
.visuel .fig { max-width: 100%; height: auto; width: 200px; color: var(--texte-carte); }
.visuel .fig.large { width: 380px; }
.visuel .horloge { width: 200px; }
.visuel .enonce, .visuel .texte-lecture { text-align: left; font-size: 1.15rem; line-height: 1.6; background: #f8f9fa; padding: 12px 16px; border-radius: 12px; }
.trou { display: inline-block; min-width: 1.6em; border-bottom: 3px dashed var(--primaire); color: var(--primaire); }
.posee { display: inline-block; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 2rem; text-align: right; line-height: 1.3; }
.posee .op { margin-right: 14px; }
.posee .barre { border-top: 3px solid currentColor; height: 6px; }
/* Soustraction posée par cassage : chiffres cassés barrés, nouvelles valeurs en petit au-dessus */
.cassage { border-collapse: collapse; margin: 0 auto; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 2rem; line-height: 1.25; }
.cassage td { min-width: 1.4em; text-align: center; padding: 0 2px; border-left: 1px dashed #d0d4db; }
.cassage td:first-child { border-left: none; min-width: .9em; }
.cassage tr.nouveau td { font-size: 1.05rem; font-weight: 800; color: #E8590C; height: 1.3em; vertical-align: bottom; }
.cassage s { text-decoration-color: #E8590C; text-decoration-thickness: 3px; }
.cassage tr.resultat td { border-top: 3px solid currentColor; height: 1.25em; }
.correction-visuel { margin: 8px 0; }
.lecon-contenu table.nombres-en { border-collapse: collapse; width: 100%; table-layout: fixed; }
.lecon-contenu table.nombres-en td { border: 1px solid #dee2e6; padding: 0; text-align: center; }
.lecon-contenu .dire { all: unset; display: block; width: 100%; box-sizing: border-box; padding: 6px 2px; cursor: pointer; font-size: .95rem; line-height: 1.2; }
.lecon-contenu .dire b { display: block; font-size: 1.2rem; color: var(--en); }
.lecon-contenu .dire:hover, .lecon-contenu .dire:focus-visible { background: #FDE7F3; }
.division { display: inline-flex; font-size: 2rem; font-family: ui-monospace, monospace; }
.division .diviseur { border-left: 3px solid; border-bottom: 3px solid; padding: 0 12px; margin-left: 12px; }
.script { font-family: "Comic Sans MS", "Chalkboard SE", cursive; }
.choix { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-top: 14px; }
.choix.gros .choix-btn { font-size: 2rem; min-height: 80px; }
.choix-btn { background: #F4F1FD; color: var(--encre); border-radius: 18px; box-shadow: inset 0 0 0 2px #DDD4FA, inset 0 -4px 0 #DDD4FA; font-family: inherit; font-size: 1.2rem; min-height: 60px; }
.choix-btn.bonne { background: var(--bon); color: #fff; box-shadow: inset 0 -4px 0 #0F5E2C; animation: pop .25s; }
.choix-btn.mauvaise { background: var(--faux); color: #fff; box-shadow: inset 0 -4px 0 #A71E2A; }
@keyframes pop { 50% { transform: scale(1.08); } }
.saisie-nombre { font-size: 2.2rem; font-weight: 800; min-height: 64px; border: 3px solid #dee2e6; border-radius: 16px; margin: 12px auto; max-width: 260px; display: flex; align-items: center; justify-content: center; background: #fff; color: #212529; }
.saisie-nombre.bonne { border-color: var(--bon); color: var(--bon); }
.saisie-nombre.mauvaise { border-color: var(--faux); color: var(--faux); }
.clavier { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 300px; margin: 10px auto; }
.touche { min-height: 58px; font-size: 1.6rem; font-weight: 800; border: 0; border-radius: 16px; background: #F4F1FD; color: var(--encre); box-shadow: inset 0 -4px 0 #DDD4FA; cursor: pointer; font-family: inherit; }
.touche:active { transform: translateY(2px); box-shadow: inset 0 -1px 0 #DDD4FA; }
.touche.effacer { background: #FFF1DD; }
.valider { margin-top: 8px; }
.saisie-texte { font-size: 1.5rem; text-align: center; max-width: 420px; margin: 10px auto; display: block; }
.saisie-texte.bonne { border-color: var(--bon); }
.saisie-texte.mauvaise { border-color: var(--faux); }
.phrase-mots { font-size: 1.5rem; line-height: 2.4; }
.mot { font-size: 1.4rem; border: 2px solid transparent; background: #f8f9fa; border-radius: 10px; padding: 4px 10px; margin: 2px; cursor: pointer; font-family: inherit; color: #212529; }
.mot:hover { border-color: var(--primaire); }
.mot.bonne { background: var(--bon); color: #fff; }
.mot.mauvaise { background: var(--faux); color: #fff; }
.correction { margin-top: 16px; padding: 14px; border-radius: 16px; background: #FFF1DD; color: var(--encre); border: 2px solid #FFD9A8; text-align: left; animation: glisse .2s; }
.explication { font-size: 1.05rem; }
.diff { font-size: 1.4rem; font-weight: 700; letter-spacing: 1px; }
.lettre-ok { color: var(--bon); }
.lettre-faute { color: var(--faux); text-decoration: underline wavy; }
.barre { text-decoration: line-through; }
.ecouter { background: var(--cyan); color: var(--encre); }
.cible { color: var(--primaire); }
u.cible { text-decoration-thickness: 3px; }

/* Fin de série */
.fin { padding: 30px 18px; }
.etoiles { font-size: 3.4rem; letter-spacing: 6px; }
.etoile { color: #dee2e6; display: inline-block; }
.etoile.allumee { color: #FFC21A; -webkit-text-stroke: 2px var(--encre); animation: etoile .5s backwards; }
@keyframes etoile { from { transform: scale(0) rotate(-90deg); } }
.points-gagnes { display: inline-block; font-family: var(--titres); font-size: 1.5rem; font-weight: 800; color: var(--encre); background: #FFE7C2; border-radius: 999px; padding: 2px 16px; animation: pop .4s; }

/* ===== Défi ===== */
.liste-defi { list-style: none; padding: 0; display: grid; gap: 10px; }
.item-defi { display: flex; align-items: center; gap: 12px; background: #f8f9fa; border-radius: 14px; padding: 10px 12px; flex-wrap: wrap; }
.item-defi.fait { background: #ebfbee; }
.item-defi .puce { font-size: 1.6rem; }
.item-texte { flex: 1; display: flex; flex-direction: column; min-width: 160px; }
.item-texte small { color: var(--doux); }
.barre-temps { height: 16px; background: #e9ecef; border-radius: 99px; overflow: hidden; }
.barre-temps div { height: 100%; background: linear-gradient(90deg, var(--primaire), var(--accent)); transition: width .4s; }
.deblocage .cadenas { font-size: 5rem; animation: deverrouille .8s ease-out; }
@keyframes deverrouille { 0% { transform: scale(.5) rotate(-20deg); } 60% { transform: scale(1.3) rotate(10deg); } 100% { transform: none; } }

/* ===== Boutique, look ===== */
.grille-articles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.article { background: var(--carte); color: var(--texte-carte); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; box-shadow: var(--ombre); }
.article.trop-cher { opacity: .7; }
.prix { font-weight: 800; color: var(--encre); background: #FFE7C2; border-radius: 999px; padding: 2px 10px; }
.liste-simple { padding-left: 20px; }
.liste-simple li { margin: 6px 0; }
.grille-perso { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.perso-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 16px; border: 3px solid transparent; background: #f8f9fa; cursor: pointer; font-family: inherit; color: #212529; }
.perso-item.choisi { border-color: var(--primaire); background: #F1ECFF; }
.perso-item.verrouille { opacity: .8; }
.perso-item small { font-size: .75rem; }
.prix-perso { position: absolute; top: -6px; right: -4px; background: var(--orange); color: var(--encre); font-size: .7rem; font-weight: 800; padding: 2px 6px; border-radius: 99px; }
.pastille-couleur { width: 40px; height: 40px; border-radius: 12px; display: block; }
.apercu-look { display: inline-flex; align-items: flex-end; gap: 6px; }
.apercu-compagnon { font-size: 3rem; animation: flotte 2.5s infinite; }
.grille-univers { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin: 16px 0; }
.tuile-univers { border: 2px solid #EFEAFB; border-radius: 22px; padding: 10px 10px 12px; font-size: 1.1rem; cursor: pointer; display: flex; flex-direction: column; gap: 8px; align-items: center; color: var(--encre); background: #fff; box-shadow: var(--ombre); transition: transform .12s; font-family: var(--titres); font-weight: 800; }
@media (hover: hover) { .tuile-univers:hover { transform: translateY(-3px) rotate(-1deg); } }
.carte-mission-image svg, .mini-meeple svg { width: 100%; display: block; }
.carte-mission-nom { background: #F1ECFF; border-radius: 999px; padding: 2px 14px; }
.mini-meeple { width: 70px; display: block; }
.meeple-moyen { display: inline-block; width: 150px; }
.meeple-grand { display: inline-block; width: 220px; }
.meeple-moyen svg, .meeple-grand svg { width: 100%; display: block; overflow: visible; }
.deblocage .meeple-grand { animation: deverrouille .8s ease-out; }
.apercu-look .meeple-moyen { width: 120px; }

/* ===== Compagnon ===== */
.compagnon { position: fixed; right: 14px; bottom: 14px; z-index: 50; display: flex; flex-direction: column; align-items: flex-end; pointer-events: none; }
.compagnon-corps { pointer-events: auto; position: relative; background: none; border: 0; padding: 0; width: 96px; cursor: pointer; animation: respire 3s ease-in-out infinite; filter: drop-shadow(0 4px 6px rgba(45,36,64,.2)); }
.guide-meeple svg { width: 100%; display: block; overflow: visible; }
.compagnon-animal { position: absolute; left: -14px; bottom: -2px; font-size: 1.9rem; width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; background: #fff; border-radius: 50%; border: 3px solid var(--encre); }
@keyframes respire { 50% { transform: translateY(-4px) scale(1.03); } }
.compagnon.content .compagnon-corps { animation: saute .5s ease-out 2; }
.compagnon.triste .compagnon-corps { animation: penche .6s ease-in-out; }
@keyframes saute { 40% { transform: translateY(-22px) rotate(-8deg); } }
@keyframes penche { 50% { transform: rotate(-14deg); } }
.bulle { max-width: 240px; background: #fff; color: var(--encre); padding: 10px 14px; border-radius: 20px 20px 4px 20px; margin-bottom: 6px; box-shadow: var(--ombre); border: 3px solid var(--encre); font-family: var(--titres); font-weight: 700; font-size: 1.05rem; line-height: 1.2; opacity: 0; transform: translateY(8px) scale(.9); transition: all .2s; }
.compagnon.parle .bulle { opacity: 1; transform: none; }
.exercice ~ .compagnon .compagnon-corps { width: 72px; }

/* ===== Confettis ===== */
.confettis { position: fixed; inset: 0; pointer-events: none; z-index: 800; overflow: hidden; }
.confetti { position: absolute; top: -30px; width: 10px; height: 14px; border-radius: 2px; font-size: 1.6rem; animation: tombe linear forwards; }
@keyframes tombe { to { transform: translate(var(--derive), 110vh) rotate(720deg); } }

/* ===== Salle de jeux ===== */
.grille-jeux { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.jeu-tuile { border: 2px solid #EFEAFB; background: var(--carte); color: var(--texte-carte); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 6px; align-items: center; box-shadow: var(--ombre); cursor: pointer; font-family: inherit; font-size: 1rem; }
.jeu-tuile:disabled { opacity: .5; }
.jeu-actif { max-width: 600px; }
.barre-jeu { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.barre-jeu b { flex: 1; }
.surface-jeu { display: flex; flex-direction: column; align-items: center; gap: 10px; touch-action: none; }
.canvas-jeu { border-radius: 16px; box-shadow: var(--ombre); background: #fff; touch-action: none; }
.croix { display: grid; grid-template-areas: ". h ." "g . d" ". b ."; gap: 6px; }
.fleche { width: 62px; height: 52px; border: 0; border-radius: 14px; background: rgba(255,255,255,.9); font-size: 1.4rem; box-shadow: 0 4px 0 #ced4da; }
.f-haut { grid-area: h; } .f-bas { grid-area: b; } .f-gauche { grid-area: g; } .f-droite { grid-area: d; }
.question-jeu { font-size: 1.4rem; font-weight: 800; background: #fff; color: #212529; padding: 8px 16px; border-radius: 14px; box-shadow: var(--ombre); }
.grille-paires { display: grid; gap: 8px; width: min(100%, 480px); }
.carte-paire { aspect-ratio: 1; border: 0; border-radius: 14px; background: var(--primaire); font-size: 2rem; cursor: pointer; position: relative; transition: transform .25s; transform-style: preserve-3d; }
.carte-paire .face { display: none; }
.carte-paire.retournee { background: #fff; transform: rotateY(180deg); }
.carte-paire.retournee .face { display: inline; transform: rotateY(180deg); }
.carte-paire.retournee .dos { display: none; }
.carte-paire.trouvee { background: #d3f9d8; }

/* ===== Espace parent ===== */
.entete-parent { display: flex; align-items: center; gap: 12px; }
.entete-parent h1 { flex: 1; font-size: 1.5rem; margin: 12px 0; }
body.parent .carte { border-radius: 14px; }
body.parent .bouton { border-radius: 12px; box-shadow: none; font-size: 1rem; }
body.parent .bouton.secondaire { box-shadow: inset 0 0 0 1.5px var(--primaire); }
body.parent .avatar { border-width: 2px; }
.grille-enfants { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.enfant-carte { display: flex; flex-direction: column; align-items: center; gap: 8px; text-decoration: none; text-align: center; }
.enfant-carte.archive { opacity: .6; }
.onglets { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: thin; }
.onglet { white-space: nowrap; padding: 9px 14px; border-radius: 999px; background: #fff; color: var(--gris-texte); text-decoration: none; font-weight: 700; border: 1px solid var(--gris-clair); }
.onglet.actif { background: var(--primaire); color: #fff; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.stat { background: #fff; border-radius: 14px; padding: 14px; display: flex; flex-direction: column; align-items: center; border: 1px solid var(--gris-clair); text-align: center; }
.stat-emoji { font-size: 1.5rem; }
.stat b { font-size: 1.4rem; }
.stat small { color: var(--doux); }
details.jour { border-bottom: 1px solid #f1f3f5; padding: 6px 0; }
details summary { cursor: pointer; padding: 4px 0; }
.reponses { list-style: none; padding-left: 10px; font-size: .9rem; }
.reponses .ok { color: var(--bon); }
.reponses .ko { color: var(--faux); }
.mise-en-avant { border: 2px solid var(--primaire); }
.periode { margin: 6px 0 10px; }
.periode-titre { display: block; color: var(--doux); font-weight: 700; margin-top: 6px; }
.liste-cases .case { border-bottom: 1px solid #f1f3f5; }
.bouton.flottant { position: fixed; bottom: 20px; right: 20px; z-index: 30; box-shadow: var(--ombre); }
.formulaire h4 { margin: 18px 0 6px; }
.ligne-achat { border-bottom: 1px solid #f1f3f5; padding-bottom: 8px; }
.pin-points { display: flex; gap: 14px; justify-content: center; margin: 16px 0; }
.pin-points span { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--primaire); }
.pin-points span.plein { background: var(--primaire); }
.pin-points.secousse { animation: secousse .35s; }
.clavier.pin .touche { min-height: 56px; }
.legal { max-width: 760px; }
.hors-ligne { background: #ffe8cc; }

@media (max-width: 480px) {
  .avatar.grand { width: 96px; height: 96px; font-size: 3.6rem; }
  .geant { font-size: 1.8rem; }
  .compagnon-corps { width: 70px; }
  .compagnon-animal { width: 36px; height: 36px; font-size: 1.4rem; }
  .logo-pm.grand .logo-image { width: 280px; }
  .jauge { padding-left: 18px; padding-right: 18px; }
  .jalon-nom { font-size: .7rem; }
  .bouton.flottant { left: 16px; right: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Aperçu parent : leçons et exercices sans enregistrement */
.bandeau-apercu { background: #FFF4E5; color: #7A4A00; border: 1.5px solid #FFCF91; border-radius: 12px; padding: 8px 14px; font-weight: 700; margin: 8px 0; text-align: center; }
.apercu-lien { display: flex; gap: 14px; align-items: center; text-decoration: none; color: inherit; margin: 12px 0; }
.apercu-lien .emoji-geant { font-size: 2.4rem; }
.apercu-notion { flex-wrap: wrap; gap: 8px; }
.apercu-notion .notion-titre { color: inherit; text-decoration: none; flex: 1 1 220px; }
.apercu-notion .notion-titre small { color: var(--doux); font-weight: 600; }
.apercu-notion .rangee { margin: 0; }
.choix-classe .bouton { min-width: 64px; justify-content: center; }

/* Cagnotte : épargne, objectifs, argent de poche */
.total-cagnotte .titre-icone { display: inline-flex; gap: 8px; align-items: center; }
.total-cagnotte .titre-icone h2 { margin: 0; }
.total-cagnotte .geant { color: var(--primaire); font-family: var(--titres); }
.barre-partage { display: flex; height: 18px; border-radius: 99px; overflow: hidden; border: 2px solid var(--encre); margin: 6px auto 12px; max-width: 420px; background: #fff; }
.barre-partage span { display: block; height: 100%; transition: width .5s; }
.part-epargne { background: var(--violet); }
.part-dispo { background: var(--orange); }
.pots { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 460px; margin: 0 auto 8px; }
.pot { border-radius: 18px; padding: 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.pot b { font-family: var(--titres); font-size: 1.4rem; }
.pot-epargne { background: #F1ECFF; border: 2px solid var(--violet); }
.pot-dispo { background: #FFF1DD; border: 2px solid var(--orange); }
.objectif { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 16px; background: #f8f9fa; margin: 10px 0; }
.objectif.atteint { background: #EAF8EF; }
.objectif-corps { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.objectif-corps .rangee { margin: 2px 0 0; }
.barre-objectif { height: 16px; background: #fff; border: 2px solid var(--encre); border-radius: 99px; overflow: hidden; }
.barre-objectif div { height: 100%; background: linear-gradient(90deg, var(--violet), var(--cyan)); transition: width .5s; }
.objectif.atteint .barre-objectif div { background: var(--bon); }
.choix-valeur { font-family: var(--titres); font-size: 1.8rem; min-width: 130px; text-align: center; }
.choix-nombre { text-align: center; }
.choix-nombre .rangee.fin { justify-content: flex-end; }
.liste-choix { display: grid; gap: 8px; margin: 8px 0 14px; }
.choix-objectif { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 14px; border: 2px solid #EFEAFB; background: #fff; cursor: pointer; font-family: inherit; font-size: 1rem; text-align: left; color: var(--encre); }
.choix-objectif span:nth-child(2) { flex: 1; font-weight: 700; }
.choix-objectif:hover { border-color: var(--primaire); }
.ajout-objectif .idee { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.perso-item.mini { padding: 4px 8px; font-size: 1.4rem; }
.liste-simple.sans-puce { list-style: none; padding-left: 0; }
.ligne-demande { justify-content: space-between; border-bottom: 1px solid var(--gris-clair); padding-bottom: 8px; }
/* ---------- Croque-multiples (jeu de labyrinthe des tables) ---------- */
.croque-choix, .croque-fin { width: min(100%, 520px); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.croque-fin { position: absolute; z-index: 5; top: 8px; left: 50%; transform: translateX(-50%); width: min(94%, 480px); }
.surface-jeu { position: relative; }
.croque-meeple { width: 110px; }
.croque-tables { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.croque-barre { display: flex; align-items: center; gap: 10px; width: min(100%, 560px); justify-content: space-between; }
.croque-vies { font-size: 1.3rem; letter-spacing: 2px; }
.croque-niveau { font-family: "Baloo 2", Nunito, sans-serif; font-weight: 800; }
.croque-voix { width: 40px; height: 40px; font-size: 1.1rem; }
.croque-consigne { font-family: "Baloo 2", Nunito, sans-serif; text-align: center; width: min(100%, 560px); font-size: 1.25rem; transition: background .2s; }
.croque-consigne.bon { background: #E6FCF5; color: #0B5D44; }
.croque-consigne.faux { background: #FFF0F0; color: #9B1C1C; font-size: 1.05rem; }
.croque-bande { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; width: min(100%, 560px); }
.croque-case { text-align: center; font-family: "Baloo 2", Nunito, sans-serif; font-weight: 800; border-radius: 10px; padding: 2px 0; background: rgba(255,255,255,.7); color: #9CA3AF; border: 2px dashed #D6D0E6; }
.croque-case.trouve { background: var(--accent, #FF9F3C); color: #2D2440; border: 2px solid #2D2440; }
.croque-table { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px 18px; font-family: "Baloo 2", Nunito, sans-serif; font-weight: 700; font-size: 1.1rem; }
.croque-croix .fleche { width: 66px; height: 54px; }
@media (hover: hover) and (pointer: fine) { .croque-croix { display: none; } }
@media (max-height: 760px) and (max-width: 600px) {
  .croque-croix { grid-template-areas: "g h b d"; }
  .croque-croix .fleche { width: 62px; height: 48px; }
  .croque-consigne { padding: 4px 12px; font-size: 1.1rem; }
  .croque-barre .croque-vies { font-size: 1.05rem; }
}

/* ===== Leçons : Je comprends / Je retiens l'essentiel / Je m'entraîne ===== */
.lecon-complete .carte { margin: 14px 0; }
.lecon-contenu .rubrique { display: flex; align-items: center; gap: 10px; margin: -4px 0 12px; font-family: var(--titres); font-size: 1.35rem; }
.lecon-contenu .rubrique span:last-child { color: #fff; padding: 2px 16px; border-radius: 999px; }
.lecon-contenu .rubrique-icone { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #fff; border: 3px solid currentColor; font-size: 1.35rem; }
.rubrique.r-comprends { color: #1f9d55; } .rubrique.r-comprends span:last-child { background: #1f9d55; }
.rubrique.r-retiens { color: #E8590C; } .rubrique.r-retiens span:last-child { background: #E8590C; }
.rubrique.r-entraine { color: var(--violet); } .rubrique.r-entraine span:last-child { background: var(--violet); }
.lecon-comprends { border-top: 5px solid #1f9d55; }
.lecon-retiens { border-top: 5px solid #E8590C; }
.lecon-a-toi { border-top: 5px solid var(--violet); }
.lecon-contenu .sous-titre { font-family: var(--titres); font-size: 1.15rem; margin: 18px 0 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lecon-contenu .cache { display: none; }
.comprends-texte h4 { margin: 12px 0 4px; color: #1f9d55; font-size: 1.1rem; }
.comprends-texte h4::before { content: "■ "; }
.comprends-texte .ex { color: #E8590C; font-weight: 700; }
.exemple-resolu { border: 2px solid #EFEAFB; border-radius: 14px; padding: 12px 14px; margin: 12px 0; background: #FCFBFF; }
.exemple-resolu .exemple-tete { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.exemple-resolu .niveau { font-size: .9rem; color: var(--doux); }
.exemple-resolu .enonce-exemple { margin: 4px 0 8px; }
.exemple-resolu ol.etapes { margin: 6px 0; padding-left: 1.6em; }
.exemple-resolu ol.etapes li { margin: 4px 0; }
.exemple-resolu .reponse-exemple { background: #EAF8EF; border-left: 5px solid var(--bon); border-radius: 8px; padding: 8px 12px; margin: 8px 0 4px; }
.exemple-resolu .rangee { margin-top: 8px; }
.lecon-piege { border-left: 6px solid var(--accent); padding-left: 12px; margin-top: 16px; }
.lecon-piege .faux { background: #FDECEE; border-radius: 8px; padding: 8px 12px; }
.lecon-piege .juste { background: #EAF8EF; border-radius: 8px; padding: 8px 12px; }
.bulle-meeple { display: flex; align-items: flex-end; justify-content: center; gap: 6px; margin-top: 14px; }
.bulle-meeple .bulle-texte { position: relative; border: none; box-shadow: none; opacity: 1; transform: none; font-family: inherit; font-size: 1.1rem; line-height: 1.45; background: #FFF3D6; border-radius: 18px; padding: 12px 18px; margin: 0 0 24px; font-weight: 600; text-align: center; max-width: 520px; }
.bulle-meeple .bulle-texte::after { content: ""; position: absolute; right: -14px; bottom: 14px; border: 10px solid transparent; border-left: 16px solid #FFF3D6; }
.bulle-meeple .bulle-mascotte { width: 86px; flex: none; }
.bulle-meeple .bulle-mascotte svg { width: 100%; height: auto; display: block; }
.question-a-toi { margin: 10px 0; }
.question-a-toi details { background: #F3EEFF; border-radius: 10px; padding: 6px 12px; }
.question-a-toi summary { cursor: pointer; font-weight: 700; color: var(--violet-fonce); }
.question-a-toi .corrige { padding: 6px 0 2px; }
.lecon-contenu .petit-mot { text-align: center; font-weight: 700; color: var(--violet-fonce); margin: 14px 0 0; }
.lecon-contenu table.conj { margin: 6px 0; }
.lecon-contenu .bouton.ecouter { padding: 2px 10px; }
/* Schémas de synthèse : étiquette colorée → idée → signe */
.schema-fleches { display: grid; grid-template-columns: minmax(0, 1.2fr) auto minmax(0, 1.2fr) auto minmax(0, .6fr); align-items: center; gap: 10px 6px; margin: 8px 0; }
.schema-fleches .etiq { color: #fff; font-weight: 800; text-align: center; border-radius: 10px; padding: 8px 6px; font-size: 1rem; line-height: 1.2; text-transform: uppercase; }
.schema-fleches .boite { border: 2px solid; border-radius: 10px; padding: 8px 6px; text-align: center; background: #fff; color: var(--texte-carte); }
.schema-fleches .boite.signe { font-size: 1.7rem; font-weight: 800; line-height: 1; }
.schema-fleches .fl { font-size: 1.4rem; font-weight: 800; }
.schema-cartes { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 8px 0; }
.schema-cartes .sc { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.schema-cartes .etiq { color: #fff; font-weight: 800; border-radius: 10px; padding: 6px 14px; text-transform: uppercase; font-size: 1rem; text-align: center; }
.schema-cartes .fl { font-size: 1.3rem; font-weight: 800; line-height: 1; }
.schema-cartes .boite { border: 2px solid; border-radius: 12px; padding: 8px 12px; text-align: center; background: #fff; color: var(--texte-carte); font-style: italic; }
.entoure { border: 2px solid #E8590C; border-radius: 50%; padding: 0 4px; font-style: normal; font-weight: 700; color: #E8590C; }
.c-vert { color: #2f9e44; } .etiq.c-vert, .c-vert .etiq { background: #2f9e44; } .boite.c-vert, .c-vert .boite, .c-vert table { border-color: #2f9e44; }
.c-bleu { color: #1c7ed6; } .etiq.c-bleu, .c-bleu .etiq { background: #1c7ed6; } .boite.c-bleu, .c-bleu .boite, .c-bleu table { border-color: #1c7ed6; }
.c-rouge { color: #e03131; } .etiq.c-rouge, .c-rouge .etiq { background: #e03131; } .boite.c-rouge, .c-rouge .boite, .c-rouge table { border-color: #e03131; }
.c-violet { color: #6741d9; } .etiq.c-violet, .c-violet .etiq { background: #6741d9; } .boite.c-violet, .c-violet .boite, .c-violet table { border-color: #6741d9; }
.c-rose { color: #d6336c; } .etiq.c-rose, .c-rose .etiq { background: #d6336c; } .boite.c-rose, .c-rose .boite, .c-rose table { border-color: #d6336c; }
.c-orange { color: #e8590c; } .etiq.c-orange, .c-orange .etiq { background: #e8590c; } .boite.c-orange, .c-orange .boite, .c-orange table { border-color: #e8590c; }
.schema-fleches.court { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.6fr); }
.schema-fleches .boite { border-width: 2px; border-style: solid; }
.schema-gn { display: flex; align-items: stretch; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.schema-gn .sc { flex: 1 1 150px; display: flex; flex-direction: column; gap: 4px; }
.schema-gn .etiq { color: #fff; font-weight: 800; border-radius: 10px; padding: 6px 10px; text-align: center; font-size: .95rem; }
.schema-gn .boite { flex: 1; border: 2px solid; border-radius: 12px; padding: 8px; text-align: center; font-style: italic; background: #fff; color: var(--texte-carte); }
.schema-gn .plus { align-self: center; font-size: 1.8rem; font-weight: 800; color: var(--cyan); }
.grille-encadres .encadre-conj.large { grid-column: 1 / -1; }
.grille-encadres { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 8px 0; }
.encadre-conj { border: 3px solid; border-radius: 14px; padding: 0 10px 10px; background: #fff; }
.encadre-conj .etiq { display: table; margin: -1px auto 8px; color: #fff; font-weight: 800; border-radius: 0 0 10px 10px; padding: 4px 14px; }
.encadre-conj table { width: 100%; border-collapse: collapse; color: var(--texte-carte); }
.encadre-conj td { padding: 3px 4px; vertical-align: top; }
.encadre-conj b { color: #e03131; }
.encadre-conj b.surligne, .surligne { background: #D0EBFF; border-radius: 4px; padding: 0 3px; font-weight: 600; color: var(--texte-carte); }
.radical { border: 2px solid currentColor; padding: 0 2px; }
.lecon-contenu span.term { color: #E8590C; font-weight: 700; }
@media (max-width: 520px) { .schema-fleches { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, .5fr); gap: 8px 3px; } .schema-fleches .etiq { font-size: .8rem; } .schema-fleches .boite { font-size: .95rem; padding: 6px 3px; } }

/* Réglage parent : tables de multiplication vues en classe */
.liste-cases.tables-vues { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.liste-cases.tables-vues .case { border-bottom: 0; }

/* Leçons de maths : opérations posées et tableaux de numération */
.tab-posee { border-collapse: collapse; margin: 10px auto; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.5rem; }
.tab-posee th { font-family: inherit; font-size: .8rem; padding: 0 10px; color: #fff; border-radius: 6px 6px 0 0; }
.tab-posee th.col-c { background: #1f9d55; } .tab-posee th.col-d { background: #E8590C; } .tab-posee th.col-u { background: #20B7E5; }
.tab-posee td { text-align: center; padding: 0 10px; min-width: 1.2em; }
.tab-posee tr.total td { border-top: 3px solid currentColor; font-weight: 700; }
.tab-posee tr.total td.signe-op { border-top: 0; }
.tab-posee td.signe-op { padding-right: 4px; }
.tab-posee .ret { color: #d6336c; font-size: .6em; font-weight: 700; }

/* ---------- Exercices manipulables ---------- */
.manip { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.manip .valider { margin-top: 6px; }
.manip.fige { pointer-events: none; }
.manip.fige.bonne { outline: 4px solid #2f9e44; outline-offset: 6px; border-radius: 16px; }
.manip.fige.mauvaise { outline: 4px solid #e03131; outline-offset: 6px; border-radius: 16px; }
.etiquette-zone { font-weight: 800; font-size: .85rem; color: #6A3DF0; text-transform: uppercase; letter-spacing: .04em; align-self: flex-start; }
.plateau-monnaie { min-height: 70px; width: 100%; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; padding: 10px; border: 3px dashed #c5b5ff; border-radius: 16px; background: #f8f5ff; }
.plateau-monnaie .vide { color: #868e96; margin: 0; }
.petit-plateau { min-height: 48px; }
.palette-monnaie { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.jeton { background: none; border: 0; padding: 2px; cursor: pointer; border-radius: 10px; transition: transform .12s; line-height: 0; }
.jeton:hover, .jeton:focus-visible { transform: translateY(-3px) scale(1.06); }
.jeton:active { transform: scale(.94); }
.rangee-monnaie { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; align-items: center; }
.etiquette-prix { display: inline-block; background: #fff3bf; border: 3px solid #fab005; border-radius: 10px; padding: 0 12px; font-weight: 800; font-size: .7em; transform: rotate(-4deg); }
.horloge-manip svg { max-width: 72vw; height: auto; cursor: grab; }
.balance-manip svg { width: 340px; max-width: 100%; height: auto; }
.balance-manip svg g { transition: transform .4s; }
.etat-balance { font-weight: 700; margin: 0; min-height: 1.4em; }
.regle-manip { width: 100%; overflow-x: auto; }
.regle-manip svg, svg.regle { width: 100%; height: auto; cursor: pointer; }
table.quadrillage { border-collapse: collapse; margin: 0 auto; }
table.quadrillage th { font-weight: 800; color: #6A3DF0; padding: 2px 6px; }
table.quadrillage td { width: 46px; height: 46px; border: 2px solid #ced4da; padding: 0; text-align: center; font-size: 1.5rem; }
table.quadrillage td button { width: 100%; height: 100%; border: 0; background: #fff; font-size: 1.5rem; cursor: pointer; }
table.quadrillage td button:hover { background: #f3f0ff; }
table.quadrillage td.choisie button { background: #ffd43b; }
table.petit-quad td { width: 36px; height: 36px; }
@media (max-width: 420px) { table.quadrillage td { width: 40px; height: 40px; } }
.fraction-manip svg { width: 320px; max-width: 100%; height: auto; }
.fraction-manip .part:hover { opacity: .85; }
.frac { display: inline-flex; flex-direction: column; align-items: center; line-height: 1; vertical-align: middle; font-weight: 800; }
.frac sup { border-bottom: 3px solid currentColor; padding: 0 4px; font-size: .8em; vertical-align: baseline; }
.frac sub { font-size: .8em; vertical-align: baseline; }
.tas { font-size: 1.8rem; letter-spacing: 2px; text-align: center; min-height: 2.2rem; }
.assiettes { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.assiette { background: #fff; border: 3px solid #ffd8a8; border-radius: 50% / 30%; padding: 8px 14px; min-width: 120px; text-align: center; }
.assiette .visage { font-size: 2rem; }
.assiette .contenu { font-size: 1.3rem; min-height: 2rem; max-width: 140px; word-break: break-all; }
.diag-manip { display: grid; gap: 3px; align-items: end; width: min(420px, 100%); }
.diag-manip .graduation { font-size: .8rem; font-weight: 700; color: #868e96; text-align: right; padding-right: 4px; }
.diag-manip .cellule { height: 30px; border: 2px dashed #dee2e6; background: #fff; border-radius: 4px; cursor: pointer; }
.diag-manip .cellule.pleine { background: var(--c); border: 2px solid rgba(0,0,0,.25); }
.diag-manip .pied { text-align: center; } .diag-manip .pied .emoji { font-size: 1.5rem; display: block; }
table.tableau-donnees { border-collapse: collapse; margin: 0 auto; }
table.tableau-donnees th, table.tableau-donnees td { border: 2px solid #ced4da; padding: 3px 6px; text-align: center; }
table.tableau-donnees .emoji { font-size: 1.4rem; }
table.tableau-donnees td { font-weight: 800; font-size: 1.2rem; }
.selection-manip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: min(460px, 100%); }
.carte-choix { background: #fff; border: 3px solid #e9ecef; border-radius: 16px; padding: 6px; cursor: pointer; transition: transform .12s, border-color .12s; }
.carte-choix svg { width: 100%; height: auto; max-height: 110px; }
.carte-choix.choisie { border-color: #6A3DF0; background: #f3f0ff; transform: scale(1.04); }
.selection-manip.correction .carte-choix.choisie { border-color: #2f9e44; background: #ebfbee; }
.selection-manip.correction .carte-choix.grise { opacity: .45; }
.cent-cases { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; width: min(420px, 100%); }
.cent-cases button { aspect-ratio: 1; border: 1px solid #dee2e6; background: #fff; font-weight: 700; font-size: .85rem; padding: 0; cursor: pointer; border-radius: 4px; }
.cent-cases button.cc-depart { background: #c5f6fa; border-color: #1098ad; }
.cent-cases button.cc-choisie { background: #ffd43b; }
.compas-manip svg { width: 300px; max-width: 86vw; height: auto; }
.correction-visuel svg { max-width: 100%; height: auto; }

/* ---------- Décors de l'univers (js/decors.js) : leçons et exercices ---------- */
.decor-scene { display: block; width: 100%; height: auto; }
.decor-bandeau { max-width: 720px; margin: 0 auto -18px; pointer-events: none; position: relative; z-index: 1;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.carte.avec-coin { position: relative; }
.decor-coin { position: absolute; top: -16px; right: 14px; width: 46px; transform: rotate(8deg); pointer-events: none; filter: drop-shadow(0 2px 2px rgba(45,36,64,.15)); }
.decor-coin svg { display: block; width: 100%; height: auto; }
.lecon-complete > .carte:first-of-type { position: relative; z-index: 2; }
.carte-question.avec-decor { display: flex; flex-direction: column; overflow: hidden; }
.fin.avec-decor { overflow: hidden; }
.carte-question.avec-decor > .decor-sol { order: 99; margin: auto -18px -18px; padding-top: 14px; pointer-events: none; }
.fin.avec-decor > .decor-sol { margin: 16px -18px -30px; pointer-events: none; }
.progression.avec-decor { position: relative; margin: 20px 50px 20px 20px; }
.progression .marcheur { position: absolute; top: 50%; height: 34px; transform: translate(-50%, -50%); transition: left .5s ease-out; pointer-events: none; z-index: 1; }
.progression .but { position: absolute; top: 50%; right: -52px; width: 48px; transform: translateY(-58%); pointer-events: none; }
.progression .marcheur svg { display: block; height: 100%; width: auto; }
.progression .but svg { display: block; width: 100%; height: auto; }
@media (prefers-reduced-motion: reduce) { .progression .marcheur { transition: none; } }

/* ===== Tableau des leçons par notion (une ligne par notion, une colonne par classe) ===== */
.choix-vue { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.choix-vue .bouton { flex: 1 1 140px; justify-content: center; }
.tn-cadre { --tn: var(--primaire); background: var(--carte); color: var(--texte-carte); border-radius: var(--rayon); box-shadow: var(--ombre); border: var(--bord); margin: 12px 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tn-cadre.matiere-fr { --tn: var(--fr); } .tn-cadre.matiere-ma { --tn: var(--ma); } .tn-cadre.matiere-an { --tn: var(--en); } .tn-cadre.matiere-hi { --tn: var(--hi); } .tn-cadre.matiere-ge { --tn: var(--ge); } .tn-cadre.matiere-em { --tn: var(--em); } .tn-cadre.matiere-sc { --tn: var(--sc); }
.tableau-notions { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; min-width: 620px; }
.tableau-notions th, .tableau-notions td { padding: 8px; border-bottom: 1px solid #EFEAFB; vertical-align: top; text-align: left; }
.tableau-notions thead th { font-family: var(--titres); font-size: 1.05rem; text-align: center; color: var(--tn); border-bottom: 3px solid var(--tn); position: sticky; top: 0; background: var(--carte); }
.tableau-notions th.tn-fil { width: 190px; font-weight: 800; position: sticky; left: 0; background: var(--carte); z-index: 1; box-shadow: 1px 0 0 #EFEAFB; text-align: left; }
.tableau-notions thead th.tn-fil { z-index: 2; color: var(--doux); font-size: .9rem; }
.tableau-notions tr.tn-domaine th { background: color-mix(in srgb, var(--tn) 12%, var(--carte)); color: var(--tn); font-family: var(--titres); font-size: .95rem; padding: 4px 8px; }
.tableau-notions tr.tn-domaine th span { position: sticky; left: 8px; }
.tableau-notions .tn-actuelle { background: color-mix(in srgb, var(--accent) 10%, var(--carte)); }
.tableau-notions thead th.tn-actuelle { color: var(--texte-carte); }
.tn-lecon { display: flex; align-items: flex-start; gap: 6px; padding: 6px 8px; margin-bottom: 6px; border-radius: 12px; text-decoration: none; color: inherit; background: color-mix(in srgb, var(--tn) 8%, var(--carte)); border: 2px solid color-mix(in srgb, var(--tn) 30%, transparent); font-size: .88rem; font-weight: 700; line-height: 1.25; }
.tn-lecon:last-child { margin-bottom: 0; }
@media (hover: hover) { .tn-lecon:hover { border-color: var(--tn); } }
.tn-num { display: none; }
.tn-titre { flex: 1; }
.tn-etoiles { color: #F5A400; font-size: .75rem; white-space: nowrap; }
.tn-pas-vue { display: block; text-align: center; color: var(--gris); font-size: 1.4rem; line-height: 1; }
.tn-aide { display: none; margin: 0; padding: 8px 12px; font-size: .85rem; color: var(--doux); }
/* Téléphone : chaque leçon devient une pastille, le tableau tient dans la largeur. */
@media (max-width: 600px) {
  .tableau-notions { min-width: 0; }
  .tableau-notions th, .tableau-notions td { padding: 6px 3px; text-align: center; }
  .tableau-notions th.tn-fil { width: 36%; font-size: .82rem; line-height: 1.2; padding-left: 8px; }
  .tableau-notions thead th { font-size: .85rem; }
  .tn-lecon { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 34px; min-height: 34px; padding: 2px; margin: 1px; gap: 0; border-radius: 50%; }
  .tn-titre { display: none; }
  .tn-num { display: block; font-size: .9rem; }
  .tn-etoiles { font-size: .5rem; letter-spacing: -1px; }
  .tn-aide { display: block; }
}
.tn-autres h3 { margin-top: 0; }
.tn-ligne { margin: 8px 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tn-groupe { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tn-groupe small { color: var(--doux); }
.tn-chip { text-decoration: none; }

/* ===== Leçons vues : lien « voir » et aperçu de la leçon par-dessus la liste ===== */
.ligne-lecon { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid #f1f3f5; }
.ligne-lecon .case { flex: 1; border-bottom: 0; }
.voir-lecon { flex: none; border: 1.5px solid #E3DAFD; background: #F6F2FF; color: var(--violet-fonce); border-radius: 999px; padding: 4px 10px; font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
@media (hover: hover) { .voir-lecon:hover { border-color: var(--violet); } }
html.panneau-ouvert, html.panneau-ouvert body { overflow: hidden; }
.panneau-lecon { position: fixed; inset: 0; z-index: 950; overflow-y: auto; -webkit-overflow-scrolling: touch; background: #F7F7FA; padding: 0 16px 32px; animation: apparait .15s; }
.panneau-lecon > * { max-width: 860px; margin-left: auto; margin-right: auto; }
.panneau-entete { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px; padding: 12px 0; background: #F7F7FA; border-bottom: 1px solid var(--gris-clair); }
.panneau-entete .bouton { flex: none; white-space: nowrap; }
.panneau-entete b { font-family: var(--titres); font-size: 1.1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Exercices imposés : jours de la semaine */
.jours-semaine { display: flex; flex-wrap: wrap; gap: 2px 12px; }
.jours-semaine[hidden], .champ[hidden] { display: none; }

/* ===== Points de la semaine : une scène par univers (js/progression.js) ===== */
.scene-semaine { max-width: 560px; margin: 8px auto 4px; text-align: center; }
.pg-cadre { position: relative; }
.pg-scene svg { display: block; width: 100%; height: auto; overflow: visible; }
.pg-trace { stroke-dasharray: 1; stroke-dashoffset: 1; animation: pg-dessin 1.2s ease-out forwards; }
@keyframes pg-dessin { to { stroke-dashoffset: 0; } }
.pg-case, .pg-pas { animation: pg-pop .4s ease-out both; }
@keyframes pg-pop { 0% { opacity: 0; } 100% { opacity: 1; } }
.pg-lave { animation: pg-monte 1.4s ease-out both; }
@keyframes pg-monte { from { transform: translateY(160px); } to { transform: none; } }
.pg-scintille { animation: pg-scintille 2.4s ease-in-out infinite; }
@keyframes pg-scintille { 50% { opacity: .25; } }
.pg-oeuf-bouge { animation: pg-bouge 1.6s ease-in-out infinite; }
@keyframes pg-bouge { 0%, 60%, 100% { transform: rotate(0); } 70% { transform: rotate(-9deg); } 80% { transform: rotate(8deg); } 90% { transform: rotate(-4deg); } }
.pg-envol { animation: pg-vole 3s ease-in-out infinite; }
@keyframes pg-vole { 50% { transform: translateY(-6px); } }
.pg-banniere { animation: pg-hisse 1.4s ease-out .6s both; }
@keyframes pg-hisse { from { transform: translate(0, -26px); } to { transform: translate(0, -60px); } }
.pg-jalon { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.pg-icone { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #fff; border: 3px solid #D9D3EA; box-shadow: 0 2px 6px rgba(0,0,0,.15); filter: grayscale(1); opacity: .8; }
.pg-emoji { font-size: 22px; line-height: 1; }
.pg-jalon.atteint .pg-icone { filter: none; opacity: 1; border-color: #F5A400; animation: pg-gagne .5s ease-out 1.1s both; }
@keyframes pg-gagne { 0% { transform: scale(.6); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
.pg-nom { margin-top: 2px; font-size: .68rem; font-weight: 800; line-height: 1.1; color: #2D2440; background: rgba(255,255,255,.9); border-radius: 8px; padding: 1px 6px; white-space: nowrap; }
.pg-rang { display: flex; justify-content: center; gap: 14px; margin-top: -14px; }
.pg-rang .pg-jalon { position: static; transform: none; }
.pg-jalon.cote { flex-direction: row; gap: 4px; transform: translate(-20px, -50%); }
.pg-pion { position: absolute; z-index: 1; width: 38px; transform: translate(-50%, -82%); pointer-events: none; }
.pg-pion svg { width: 100%; height: auto; display: block; }
.pg-total { margin: 6px 0 0; font-family: var(--titres); font-size: 1.1rem; color: var(--texte-carte); }
.pg-total b { font-size: 1.9rem; color: var(--primaire); }
.pg-encore { margin: 0; font-size: .9rem; color: var(--texte-doux, #6B6480); }
.scene-semaine.compacte .pg-icone { width: 30px; height: 30px; border-width: 2px; }
.scene-semaine.compacte .pg-emoji { font-size: 16px; }
.scene-semaine.compacte .pg-total b { font-size: 1.4rem; }
@media (prefers-reduced-motion: reduce) { .scene-semaine * { animation: none !important; stroke-dashoffset: 0 !important; } }
@media (max-width: 480px) { .pg-icone { width: 32px; height: 32px; } .pg-emoji { font-size: 17px; } .pg-nom { font-size: .58rem; } .pg-pion { width: 30px; } .pg-total b { font-size: 1.5rem; } }
.jauge.jauge-scene { padding: 12px 16px 12px; }
.jauge-scene .jauge-titre { margin-bottom: 6px; }
.jauge-scene .pg-total { display: none; }
.jauge-scene.compacte .scene-semaine { max-width: 320px; }
/* Accueil : scène à gauche, paliers à droite ; l'un sous l'autre sur téléphone */
.jauge.jauge-deux { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 22px; align-items: center; padding: 16px 20px; }
@media (max-width: 700px) { .jauge.jauge-deux { grid-template-columns: 1fr; gap: 12px; padding: 12px; } }
.jauge-deux .scene-semaine { max-width: none; margin: 0; }
.jauge-deux .pg-total, .jauge-deux .pg-encore, .jauge-deux .pg-rang { display: none; }
.jauge-deux .pg-icone { width: 44px; height: 44px; }
.jauge-deux .pg-pion { width: 56px; }
.js-recap { display: flex; flex-direction: column; gap: 8px; }
.js-titre { font-family: var(--titres); font-weight: 800; font-size: 1.25rem; }
.js-total { font-family: var(--titres); font-weight: 700; color: var(--doux); }
.js-total b { font-size: 2.6rem; line-height: 1; color: var(--primaire); margin-right: 4px; }
.js-palier { display: flex; align-items: center; gap: 12px; padding: 6px 10px; border-radius: 14px; background: #F6F3FC; border: 2px solid transparent; }
.js-palier.prochain { border: 2px dashed #F5A400; background: #FFF6E0; }
.js-icone svg { display: block; filter: grayscale(1); opacity: .55; }
.js-palier.atteint .js-icone svg { filter: none; opacity: 1; }
.js-texte { display: flex; flex-direction: column; line-height: 1.2; }
.js-texte small { color: var(--doux); }
.js-ok { margin-left: auto; font-size: 1.3rem; }
.js-privilege { font-style: normal; font-size: .85rem; color: var(--texte-carte); margin-top: 2px; }
.js-barre { display: block; height: 10px; border-radius: 6px; background: #EEE; overflow: hidden; }
.js-barre i { display: block; height: 100%; background: linear-gradient(90deg, #FFD23F, #F5A400); }
.js-encore { margin: 0; color: var(--doux); }
@media (max-width: 480px) { .jauge-deux .pg-icone { width: 34px; height: 34px; } .jauge-deux .pg-pion { width: 40px; } }

/* ---------- Histoire, géographie, EMC ---------- */
.figure-monde { margin: 10px auto; text-align: center; max-width: 560px; }
.figure-monde svg { width: 100%; height: auto; }
.figure-monde figcaption { font-size: .85rem; color: var(--doux); margin-top: 4px; }
.carte-svg, .frise-svg, .bande-saisons { width: 100%; height: auto; max-width: 560px; display: block; margin: 0 auto; }
.carte-svg.france { max-width: 440px; }
.visuel .carte-svg, .visuel .frise-svg { max-width: 520px; }
.rangee-paysages { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.rangee-paysages .figure-monde { margin: 0; }
.paysage-svg { width: 100%; max-width: 320px; height: auto; border-radius: 10px; display: block; margin: 0 auto; }
.carte-choix .paysage-svg { max-height: 110px; }
.symbole-svg { width: 100%; height: auto; }
.symbole-grand { width: min(220px, 70%); margin: 0 auto; }
.symbole-moyen { width: min(180px, 60%); margin: 0 auto; }
.drapeau-svg { width: 160px; max-width: 60%; height: auto; }
.arbre-saison { display: inline-block; }
.lecon-symboles { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); width: 100%; }
.lecon-symboles .carte-choix { cursor: default; }
.lecon-symboles svg { max-height: 90px; }
.affirmation, .situation { font-size: 1.15rem; font-weight: 700; text-align: center; background: #fff; border: 2px dashed #D9D3F2; border-radius: 14px; padding: 12px 14px; margin: 6px 0; }
.texte-carte { display: block; font-size: .92rem; font-weight: 700; line-height: 1.3; text-align: left; padding: 4px; }
.calendrier-mois { border-collapse: collapse; margin: 6px auto; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 6px rgba(0,0,0,.08); font-weight: 700; }
.calendrier-mois caption { font: 800 1.1rem "Baloo 2", sans-serif; padding: 4px; }
.calendrier-mois th { background: #F1ECFF; padding: 4px 6px; font-size: .85rem; text-transform: capitalize; }
.calendrier-mois td { width: 2.2em; height: 2em; text-align: center; border: 1px solid #EFEAFB; }
.calendrier-mois td.we { background: #FFF4E6; }
.calendrier-mois td.vide { background: #FAFAFA; }
.calendrier-mois td.entoure { outline: 3px solid #E03131; outline-offset: -4px; border-radius: 50%; }
.calendrier-mois td.surligne { background: #FFE066; }
/* Widget « zones » : toucher une zone d'une carte ou d'une frise */
.zones-manip { width: min(560px, 100%); margin: 0 auto; }
.zones-manip svg { width: 100%; height: auto; touch-action: manipulation; }
.zones-manip .zone:hover, .zones-manip .zone:focus { opacity: .8; outline: none; }
.zones-manip path.zone.zone-choisie, .zones-manip rect.zone.zone-choisie, .zones-manip ellipse.zone.zone-choisie { fill: #FFD43B !important; }
.zones-manip circle.zone.zone-choisie { fill: rgba(255, 212, 59, .55); stroke: #F08C00; stroke-width: 3; }
.zones-manip path.zone[fill="none"].zone-choisie { fill: none !important; stroke: rgba(255, 212, 59, .75); }
/* Widget « ranger » */
.ranger-cartes { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.carte-ranger { position: relative; background: #fff; border: 3px solid #e9ecef; border-radius: 14px; padding: 10px 14px; font: 700 1rem Nunito, sans-serif; color: var(--encre); cursor: pointer; }
.carte-ranger.choisie { border-color: #6A3DF0; background: #f3f0ff; opacity: .7; }
.carte-ranger.choisie::after { content: attr(data-rang); position: absolute; top: -10px; right: -10px; width: 24px; height: 24px; border-radius: 50%; background: #6A3DF0; color: #fff; font-weight: 800; font-size: .85rem; display: flex; align-items: center; justify-content: center; }
.ranger-resultat { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; list-style: none; padding: 8px; margin: 8px 0; background: #F8F9FA; border-radius: 12px; min-height: 44px; counter-reset: rg; }
.ranger-resultat li { background: #fff; border: 2px solid #D0BFFF; border-radius: 10px; padding: 4px 10px; font-weight: 700; counter-increment: rg; }
.ranger-resultat li::before { content: counter(rg) ". "; color: #6A3DF0; font-weight: 800; }
.ranger-resultat li.vide { border: 0; background: none; color: var(--doux); font-weight: 600; }
.ranger-resultat li.vide::before { content: ""; }
/* Widget « bandes » (drapeau à colorier) */
.bandes-manip { text-align: center; }
.bandes-manip .drapeau-svg { width: 240px; max-width: 80%; }
.palette { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 8px; }
.pot { display: inline-flex; align-items: center; gap: 6px; border: 3px solid #e9ecef; border-radius: 999px; background: #fff; padding: 6px 12px; font: 700 .95rem Nunito, sans-serif; cursor: pointer; color: var(--encre); }
.pot .goutte { width: 20px; height: 20px; border-radius: 50%; background: var(--pot); border: 2px solid var(--encre); }
.pot.choisi { border-color: #6A3DF0; background: #f3f0ff; }
.rose-lecon { width: 150px; margin: 8px auto; }
.rose-lecon svg { width: 100%; height: auto; }

/* ---------- Sciences CE1 ---------- */
.carte-emoji { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; min-width: 96px; padding: 8px 10px; border-radius: 14px; background: #fff; border: 2px solid #D3F9D8; }
.carte-emoji .ce-e { font-size: 2.6rem; line-height: 1.1; }
.carte-emoji .ce-t { font-weight: 700; font-size: .95rem; text-align: center; color: var(--texte-carte, #333); }
.chaine-alim { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 6px; margin: 10px 0; }
.chaine-alim .ca-etre { display: flex; flex-direction: column; align-items: center; min-width: 70px; padding: 6px 8px; border-radius: 14px; background: #EBFBEE; border: 2px solid #8CE99A; }
.chaine-alim .ca-e { font-size: 2.2rem; line-height: 1.1; }
.chaine-alim small { font-weight: 700; font-size: .85rem; color: #2b8a3e; text-align: center; }
.chaine-alim .ca-fl { font-size: 1.4rem; font-weight: 800; color: #2f9e44; }
.chaine-alim .cache-q { background: #FFF5F5; border-color: #FFA8A8; border-style: dashed; }
.chaine-alim .cache-q small { color: #e03131; }
.cycle-svg { display: block; width: 100%; max-width: 300px; height: auto; margin: 6px auto; }
.stade-svg { display: inline-block; width: 64px; height: 64px; vertical-align: middle; }
.tableau-regimes, .tableau-urgences { width: 100%; border-collapse: separate; border-spacing: 0; margin: 8px 0; border-radius: 12px; overflow: hidden; background: #fff; color: var(--texte-carte, #333); font-size: .95rem; }
.tableau-regimes th, .tableau-regimes td, .tableau-urgences th, .tableau-urgences td { padding: 6px 8px; border-bottom: 1px solid #E9ECEF; text-align: left; vertical-align: top; }
.tableau-regimes th { background: #2f9e44; color: #fff; }
.tableau-urgences th { color: #fff; text-align: center; }
.tableau-urgences td { text-align: center; }
.tableau-urgences .u15 { background: #1c7ed6; } .tableau-urgences .u18 { background: #e03131; } .tableau-urgences .u112 { background: #6741d9; }
.familles-alim { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 8px 0; }
.familles-alim .fa { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px; border: 2px solid; border-radius: 12px; text-align: center; color: var(--texte-carte, #333); }
.familles-alim .fa-e { font-size: 1.6rem; letter-spacing: 2px; }
.familles-alim small { font-size: .8rem; }
.panneau-danger { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 27px; background: #FFD43B; clip-path: polygon(50% 0, 100% 100%, 0 100%); font-size: .9rem; padding-top: 6px; vertical-align: middle; }

/* ---------- Anglais CE1 ---------- */
.lecon-contenu .dire.mot-en, .dire.mot-en { all: unset; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; margin: 2px 0; padding: 2px 10px; border-radius: 999px; background: #FDE7F3; color: #A61E4D; font-weight: 700; line-height: 1.4; }
.lecon-contenu .dire.mot-en:hover, .lecon-contenu .dire.mot-en:focus-visible { background: #FCC2D7; }
.lecon-contenu .dire.mot-en.jour { background: var(--en); color: #fff; padding: 6px 10px; border-radius: 10px; font-size: .95rem; }
.moments-en { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 8px 0; }
.moment-en, .visage-en, .jour-en { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.moment-en small { font-size: .8rem; }
.moment-svg { width: 100%; max-width: 190px; height: auto; display: block; margin: 0 auto; }
.visages-en { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 8px; margin: 8px 0; }
.visage-en .ve-e { font-size: 2.4rem; line-height: 1; }
.jours-en { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 6px; margin: 8px 0; }
.emploi-temps { width: 100%; max-width: 320px; border-collapse: collapse; margin: 8px auto; background: #fff; color: var(--texte-carte, #333); }
.emploi-temps th { color: #fff; padding: 4px 10px; text-align: left; width: 50%; font-size: .95rem; }
.emploi-temps td { border: 1px solid #DEE2E6; padding: 2px 10px; font-weight: 700; }
.emploi-temps tr.surligne td { background: #FFE066; }
.emploi-temps .et-e { font-size: 1.3rem; vertical-align: middle; }
.tableau-ing { width: 100%; border-collapse: collapse; margin: 8px 0; color: var(--texte-carte, #333); }
.tableau-ing td { padding: 4px; text-align: center; vertical-align: middle; border-bottom: 1px solid #F1F3F5; }
.tableau-ing .ti-fl { color: var(--en); font-weight: 800; font-size: 1.2rem; }
.bulles-en { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.bulle-en { display: flex; align-items: center; gap: 8px; }
.bulle-en .be-nom { font-weight: 800; min-width: 52px; }
.bulle-en .be-txt { position: relative; background: #fff; border: 2px solid var(--en); border-radius: 14px; padding: 6px 12px; color: var(--texte-carte, #333); }

/* ✖️ Table de multiplication à trous (tuiles à poser) */
.manip-table-trous { gap: 12px; }
.entete-table { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; font-family: var(--titres); font-size: 1.25rem; }
.etapes-trous { display: flex; gap: 5px; }
.etapes-trous .etape { width: 14px; height: 14px; border-radius: 50%; background: #E5E7EB; }
.etapes-trous .etape.faite { background: var(--bon); }
.etapes-trous .etape.actuelle { background: var(--accent); box-shadow: 0 0 0 3px #FFE3C2; }
.grille-table { display: grid; grid-template-columns: 1fr; gap: 6px 28px; }
@media (min-width: 340px) { .grille-table { grid-template-columns: 1fr 1fr; grid-template-rows: repeat(5, auto); grid-auto-flow: column; } }
.ligne-table { display: flex; align-items: center; gap: 10px; font: 800 1.45rem/1 "Baloo 2", Nunito, sans-serif; color: var(--texte-carte); min-height: 50px; }
.ligne-table .calcul { min-width: 6.2em; text-align: right; white-space: nowrap; }
.ligne-table .resultat { display: inline-flex; align-items: center; justify-content: center; min-width: 64px; height: 46px; color: var(--primaire); }
.trou-table { position: relative; min-width: 64px; height: 46px; border: 3px dashed #B9A8F5; border-radius: 12px; background: #F8F6FF; font: inherit; color: var(--gris); cursor: pointer; padding: 0 8px; }
.trou-table.choisi { border-color: var(--accent); border-style: solid; box-shadow: 0 0 0 4px #FFE3C2; }
.trou-table.rempli { border-style: solid; border-color: var(--primaire); background: #fff; color: var(--encre); }
.trou-table.juste { border-color: var(--bon); background: #EBFBEE; color: var(--bon); box-shadow: none; }
.trou-table.faux { border-color: var(--faux); background: #FFF0F0; color: var(--faux); text-decoration: line-through; box-shadow: none; }
.trou-table .correct { position: absolute; top: -12px; right: -14px; background: var(--bon); color: #fff; border-radius: 10px; padding: 2px 6px; font-size: .85rem; text-decoration: none; }
.tuiles-table { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 560px; }
.tuile-nombre { min-width: 58px; height: 52px; padding: 0 10px; border: none; border-radius: 12px; background: var(--accent); color: #fff; font: 800 1.45rem/1 "Baloo 2", Nunito, sans-serif; cursor: grab; box-shadow: 0 4px 0 #D97F1E; touch-action: none; user-select: none; -webkit-user-select: none; }
.tuile-nombre:active { transform: translateY(2px); box-shadow: 0 2px 0 #D97F1E; }
.tuile-nombre.posee { opacity: .25; box-shadow: none; cursor: default; }
.tuile-nombre.fantome { position: fixed; z-index: 1000; pointer-events: none; transform: translate(-50%, -50%) scale(1.1); display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 8px 18px rgba(0,0,0,.25); }
/* Entraînement bonus */
.tuile.bonus { border-bottom-color: #FF9F3C; background: linear-gradient(180deg, #fff 55%, #FFF1DD); }
.bouton.bonus-lien { display: inline-block; margin: 8px 0; background: #FF9F3C; text-decoration: none; }
.ecran.bonus .tuile-icone { display: flex; justify-content: center; }
/* Parcours des tables en 3 étapes */
.etape-parcours { background: var(--primaire); color: #fff; font: 800 .85rem Nunito, sans-serif; }
.chemin-tables { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.pastille-table { padding: 3px 10px; border-radius: 999px; background: #F1F3F5; color: var(--gris-texte); font: 800 .9rem Nunito, sans-serif; }
.pastille-table.finie { background: #EBFBEE; color: var(--bon); }
.pastille-table.en-cours { background: var(--accent); color: #fff; }
.clavier-table { max-width: 300px; }
.options-parcours { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.option-parcours { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.option-parcours .case { border: none; padding: 0; margin: 0; }
.option-parcours input[type="number"] { width: 4.5em; }
.option-parcours input[type="date"] { width: auto; min-width: 9.5em; }
.option-parcours select { width: auto; }
/* Téléphone : la table tient en deux colonnes à côté du clavier */
@media (max-width: 559px) {
  .grille-table { gap: 4px 10px; }
  .ligne-table { font-size: 1.1rem; gap: 6px; min-height: 42px; }
  .ligne-table .calcul { min-width: 0; }
  .ligne-table .resultat, .trou-table { min-width: 48px; height: 40px; }
}

/* ---------- Aide, support et signalement d'erreurs ---------- */
.bouton-signaler { background: transparent; border: 2px dashed #D9D2F0; color: var(--doux); border-radius: 999px; padding: 6px 14px; font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer; }
.bouton-signaler:hover { border-color: var(--faux); color: var(--faux); }
.barre-exo .bouton-signaler { padding: 6px 10px; font-size: 1.1rem; line-height: 1; }
.signalement h2 { margin-top: 0; }
.types-erreur { display: grid; gap: 8px; margin: 8px 0 12px; }
.types-erreur .choix-type { background: #fff; color: var(--encre); border: 2px solid #EFEAFB; box-shadow: none; text-align: left; }
.types-erreur .choix-type.choisi { border-color: var(--violet); background: #F1ECFF; }
.aide .faq details { border-bottom: 1px solid #EFEAFB; padding: 4px 0; }
.aide .faq summary { cursor: pointer; font-weight: 700; padding: 8px 0; }
.aide .faq p { margin: 0 0 10px; color: var(--doux); }
.liste-tickets { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.liste-tickets a { display: grid; gap: 2px; padding: 10px 14px; border-radius: 14px; background: #faf8ff; text-decoration: none; color: var(--encre); border: 2px solid transparent; }
.liste-tickets a.non-lu { border-color: var(--orange); background: #FFF4E6; }
.liste-tickets a.erreur-peda { background: #FFF5F5; }
.liste-tickets small { color: var(--doux); }
.fil-messages { display: grid; gap: 10px; margin: 12px 0; }
.fil-messages .msg { padding: 10px 14px; border-radius: 16px; max-width: 90%; }
.fil-messages .msg.parent { background: #F1ECFF; justify-self: end; }
.fil-messages .msg.equipe { background: #E7F8FD; justify-self: start; }
.fil-messages .msg p { margin: 4px 0 0; white-space: pre-wrap; }
.fil-messages .msg small { color: var(--doux); }
.contexte { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: .9rem; background: #faf8ff; padding: 10px 14px; border-radius: 12px; margin: 8px 0; }
.contexte dt { font-weight: 700; color: var(--doux); }
.contexte dd { margin: 0; word-break: break-word; }
