/* Le Labo — interface épurée, gros boutons, couleurs du club de l'enfant (variables posées par app.js) */
:root {
  --c1: #1D2738; --c2: #6E4AE0; --c3: #FFFFFF; --sur-c1: #FFFFFF; --fond: #F3F6FA; --accent: #6E4AE0;
  --m: var(--c2);
  --carte: #FFFFFF; --encre: #1D2738; --doux: #5B6879; --trait: #DCE3EC; --gris: #EEF2F6;
  --ok: #1E9E57; --ok-bg: #E3F6EA; --ko: #D9363E; --ko-bg: #FDE8E8; --jaune: #FFD23F; --etoile: #F5B400;
  --r: 18px;
  --titre: "Fredoka", "Baloo 2", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  --texte: "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--encre); font-family: var(--texte); font-size: 18px; line-height: 1.5; min-height: 100vh; transition: background .3s; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--titre); font-weight: 700; line-height: 1.15; margin: 0; text-wrap: balance; }
.page { max-width: 820px; margin: 0 auto; padding: 16px max(16px, env(safe-area-inset-right)) 120px max(16px, env(safe-area-inset-left)); }
.centre { text-align: center; }
.muted { color: var(--doux); }
.petit { font-size: 15px; }
.erreur { background: var(--ko-bg); padding: 16px; border-radius: var(--r); }

/* ---------- accueil général ---------- */
.logo { font-size: 44px; margin: 40px 0 8px; }
.dev-liens { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin: 28px 0 8px; }
.dev-lien { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; padding: 12px; border-radius: 20px; background: linear-gradient(140deg, var(--c1), var(--c2)); color: #fff; width: 130px; font-family: var(--titre); font-size: 20px; }
.dev-lien img { width: 96px; height: auto; }

/* ---------- bandeau de l'enfant ---------- */
.bandeau { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px 20px; border-radius: 26px; color: var(--sur-c1); background: linear-gradient(135deg, var(--c1) 0%, var(--c1) 55%, var(--c2) 140%); overflow: hidden; margin-bottom: 18px; min-height: 170px; }
.bandeau::after { content: ""; position: absolute; inset: auto -40px -60px auto; width: 220px; height: 220px; border-radius: 50%; background: var(--c2); opacity: .35; }
.bandeau-txt { position: relative; z-index: 1; min-width: 0; }
.bandeau-sur { margin: 0; opacity: .8; font-weight: 700; }
.bandeau h1 { font-size: clamp(28px, 7vw, 44px); }
.bandeau h1 span { color: var(--c3); text-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
.bandeau-info { display: flex; gap: 8px; margin: 12px 0 0; flex-wrap: wrap; }
.pastille { display: inline-block; padding: 3px 12px; border-radius: 99px; background: rgba(255, 255, 255, .18); font-weight: 800; font-size: 15px; border: 1px solid rgba(255, 255, 255, .3); }
.haut .pastille { background: var(--gris); border-color: var(--trait); color: var(--doux); }
.pastille.etoiles { color: var(--jaune); }
.sticker { position: relative; z-index: 1; flex: none; border: 0; background: none; padding: 0; width: clamp(110px, 28vw, 170px); animation: flotte 3.2s ease-in-out infinite; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .3)); }
.sticker img { width: 100%; display: block; }
.sticker.saute { animation: saute .7s ease; }
@keyframes flotte { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-8px) rotate(2deg); } }
@keyframes saute { 0% { transform: scale(1); } 30% { transform: translateY(-26px) scale(1.06) rotate(-6deg); } 60% { transform: translateY(0) scale(.96); } 100% { transform: scale(1); } }

.titre-section { font-size: 22px; margin: 26px 0 10px; }

/* ---------- tuiles ---------- */
.matieres { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.matiere { display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--carte); border: 2px solid var(--trait); border-radius: var(--r); text-decoration: none; transition: transform .15s, border-color .15s, box-shadow .15s; }
a.matiere:hover { transform: translateY(-3px); border-color: var(--m); box-shadow: 0 8px 18px rgba(0, 0, 0, .07); }
.matiere-ico { flex: none; width: 56px; height: 56px; display: grid; place-items: center; font-size: 30px; border-radius: 16px; background: color-mix(in srgb, var(--m) 16%, white); }
.matiere-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.matiere-txt b { font-family: var(--titre); font-size: 20px; font-weight: 600; }
.matiere-txt small { color: var(--doux); font-size: 14px; }
.jauge { display: block; height: 8px; background: var(--gris); border-radius: 9px; overflow: hidden; margin-top: 6px; }
.jauge i { display: block; height: 100%; background: var(--m); border-radius: 9px; }
.matiere.bientot, .matiere.ferme { opacity: .55; }

.carte-rev { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: var(--r); background: var(--carte); border: 2px solid var(--accent); text-decoration: none; margin-bottom: 8px; }
.carte-rev small { display: block; color: var(--doux); font-size: 14px; }
.carte-rev span:nth-child(2) { flex: 1; }
.rev-ico { font-size: 30px; }
.fleche { font-size: 22px; color: var(--accent); }

/* ---------- en-tête de page ---------- */
.haut { display: flex; align-items: center; gap: 12px; margin: 4px 0 18px; }
.haut h1 { font-size: clamp(22px, 5vw, 30px); flex: 1; color: var(--m); }
.btn-rond { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--trait); background: var(--carte); text-decoration: none; font-size: 20px; font-weight: 800; }

/* ---------- chapitres ---------- */
.chapitres { display: grid; gap: 10px; }
.chapitre { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--carte); border: 2px solid var(--trait); border-left: 8px solid var(--m); border-radius: var(--r); text-decoration: none; }
.chapitre:hover { background: color-mix(in srgb, var(--m) 6%, white); }
.chap-num { flex: none; width: 46px; height: 46px; display: grid; place-items: center; font-size: 26px; border-radius: 14px; background: color-mix(in srgb, var(--m) 14%, white); font-family: var(--titre); font-weight: 700; }
.chap-txt { flex: 1; min-width: 0; }
.chap-txt b { display: block; font-family: var(--titre); font-weight: 600; font-size: 19px; }
.points { display: flex; gap: 5px; margin-top: 6px; }
.points i { width: 22px; height: 8px; border-radius: 9px; background: var(--gris); }
.points i.p1 { background: color-mix(in srgb, var(--m) 45%, white); }
.points i.p2 { background: color-mix(in srgb, var(--m) 70%, white); }
.points i.p3 { background: var(--m); }
.tag-go { background: var(--m); color: #fff; font-weight: 800; font-size: 13px; padding: 3px 10px; border-radius: 99px; animation: pulse 1.6s infinite; }
.coche { color: var(--ok); font-size: 24px; font-weight: 800; }
@keyframes pulse { 50% { transform: scale(1.08); } }

/* ---------- leçon ---------- */
.lecon { background: var(--carte); border: 2px solid color-mix(in srgb, var(--m) 50%, white); border-radius: var(--r); margin-bottom: 12px; }
.lecon summary { cursor: pointer; padding: 14px 18px; font-family: var(--titre); font-size: 20px; font-weight: 600; color: var(--m); list-style: none; }
.lecon summary::-webkit-details-marker { display: none; }
.lecon summary::after { content: "▾"; float: right; transition: transform .2s; }
.lecon[open] summary::after { transform: rotate(180deg); }
.lecon-in { padding: 0 18px 16px; }
.lecon-intro { font-size: 19px; }
.lecon-points { padding-left: 22px; }
.lecon-points li { margin: 6px 0; }
.lecon-ex { background: color-mix(in srgb, var(--m) 8%, white); border-radius: 14px; padding: 12px 14px; margin: 10px 0; }
.lecon-ex b { color: var(--m); }
.lecon-astuce { background: #FFF6D6; border-radius: 14px; padding: 10px 14px; }
.lexique { margin-top: 10px; }
.lexique p { margin: 6px 0; }
.mot-lex { border: 0; background: color-mix(in srgb, var(--m) 18%, white); border-radius: 8px; padding: 0 8px; font-weight: 800; }

/* ---------- paliers ---------- */
.paliers { display: grid; gap: 10px; }
.palier { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r); background: var(--carte); border: 2px solid var(--trait); text-decoration: none; }
a.palier:hover { border-color: var(--m); }
.palier.ferme { opacity: .5; }
.palier.reussi { border-color: color-mix(in srgb, var(--m) 50%, white); }
.pal-num { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--m); color: #fff; font-family: var(--titre); font-size: 20px; font-weight: 700; }
.palier.ferme .pal-num { background: var(--gris); }
.pal-txt { flex: 1; }
.pal-txt b { display: block; font-family: var(--titre); font-weight: 600; font-size: 19px; }
.pal-txt small { color: var(--doux); }
.etoiles3 i { font-style: normal; color: var(--trait); font-size: 22px; }
.etoiles3 i.on { color: var(--etoile); }

/* ---------- activité ---------- */
.act-titre { margin: 0 0 8px; color: var(--doux); font-weight: 700; font-size: 15px; }
.act-tete { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.act-barre { flex: 1; height: 14px; background: var(--carte); border: 2px solid var(--trait); border-radius: 99px; overflow: hidden; }
.act-barre i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--m), var(--c2)); border-radius: 99px; transition: width .4s; }
.act-cpt { font-weight: 800; color: var(--doux); min-width: 42px; text-align: right; }
.act-carte { background: var(--carte); border-radius: 24px; padding: 20px; border: 2px solid var(--trait); box-shadow: 0 6px 20px rgba(0, 0, 0, .05); }
.act-carte.entree { animation: entre .35s ease; }
@keyframes entre { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }

.consigne { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.consigne-txt { flex: 1; margin: 0; font-size: 20px; font-weight: 700; min-width: 200px; }
.verbe { border: 0; padding: 0 6px; border-radius: 8px; background: color-mix(in srgb, var(--m) 20%, white); color: var(--encre); font-weight: 900; text-decoration: underline dotted; text-underline-offset: 4px; }
mark.piege { background: linear-gradient(transparent 55%, var(--jaune) 55%); color: inherit; font-weight: 900; padding: 0 2px; }
.verbe-def { flex-basis: 100%; margin: 0; padding: 10px 14px; background: var(--gris); border-radius: 12px; font-size: 16px; font-weight: 600; }
.btn-voix { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--trait); background: var(--carte); font-size: 20px; }
.btn-voix.petit { width: auto; height: auto; border-radius: 99px; padding: 4px 14px; font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.btn-audio { display: block; margin: 4px auto 14px; border: 0; border-radius: 99px; padding: 14px 28px; background: var(--m); color: #fff; font-size: 22px; font-weight: 800; box-shadow: 0 4px 0 rgba(0, 0, 0, .2); }
.btn-audio:active { transform: translateY(3px); box-shadow: none; }

.lecture { background: #FFFBEF; border: 2px solid #F3E3B5; border-radius: 16px; padding: 14px 16px; margin-bottom: 14px; font-size: 19px; line-height: 1.7; }
.lecture p { margin: 6px 0; }
.enonce { font-size: 22px; text-align: center; margin: 6px 0 16px; font-weight: 700; }
.enonce.grand { font-size: clamp(34px, 9vw, 52px); letter-spacing: .02em; }
.enonce .emo { font-size: 1.6em; }
.enonce svg { max-width: 100%; height: auto; }
.indice { background: #FFF6D6; border-radius: 12px; padding: 10px 14px; margin: 0 0 12px; font-size: 17px; animation: entre .3s ease; }
.aide-type { color: var(--doux); font-size: 15px; margin: 0 0 8px; text-align: center; }

/* choix */
.choix { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.choix.grand { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.choix-btn { padding: 14px 12px; border-radius: 16px; border: 2px solid var(--trait); background: var(--carte); font-size: 20px; font-weight: 700; min-height: 58px; transition: transform .1s, border-color .15s, background .15s; box-shadow: 0 3px 0 var(--trait); }
.choix.grand .choix-btn { font-size: clamp(34px, 9vw, 46px); padding: 10px; min-height: 84px; }
.choix-btn:hover { border-color: var(--m); }
.choix-btn:active { transform: translateY(2px); box-shadow: none; }
.choix-btn.sel { border-color: var(--m); background: color-mix(in srgb, var(--m) 12%, white); }
.choix-btn.juste { border-color: var(--ok); background: var(--ok-bg); animation: tada .5s; }
.choix-btn.faux { border-color: var(--ko); background: var(--ko-bg); animation: non .4s; }
.choix-btn.solution { outline: 3px dashed var(--ok); outline-offset: 2px; }
.fige .choix-btn:not(.juste):not(.faux) { opacity: .6; }
@keyframes tada { 30% { transform: scale(1.07); } 60% { transform: scale(.97); } }
@keyframes non { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* saisie */
.saisie { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.champ { font: inherit; font-size: 24px; font-weight: 700; padding: 12px 16px; border-radius: 14px; border: 2px solid var(--trait); width: min(100%, 360px); text-align: center; background: #fff; color: var(--encre); }
.champ.court { width: 150px; }
.champ:focus { border-color: var(--m); outline: none; }
.affixe { font-size: 22px; font-weight: 800; }
.saisie.juste .champ { border-color: var(--ok); background: var(--ok-bg); }
.saisie.faux .champ { border-color: var(--ko); background: var(--ko-bg); animation: non .4s; }
.solution-txt { text-align: center; margin: 12px 0 0; font-size: 19px; }

/* ordre */
.ordre-ligne, .ordre-reserve { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; min-height: 62px; padding: 10px; border-radius: 16px; }
.ordre-ligne { border: 2px dashed var(--trait); background: var(--gris); margin-bottom: 12px; position: relative; }
.ordre-ligne:empty::before { content: attr(data-vide); color: var(--doux); font-size: 15px; align-self: center; }
.ordre-ligne.juste { border-color: var(--ok); background: var(--ok-bg); }
.ordre-ligne.faux { border-color: var(--ko); background: var(--ko-bg); }
.etiq { padding: 10px 16px; border-radius: 12px; border: 2px solid var(--m); background: var(--carte); font-size: 20px; font-weight: 800; box-shadow: 0 3px 0 color-mix(in srgb, var(--m) 40%, white); }
.ordre-ligne .etiq { background: color-mix(in srgb, var(--m) 14%, white); }

/* classer */
.classer { display: grid; gap: 8px; }
.classer-ligne { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border-radius: 14px; border: 2px solid var(--trait); }
.classer-mot { flex: 1 1 120px; font-weight: 800; font-size: 20px; }
.classer-cats { display: flex; gap: 6px; flex-wrap: wrap; }
.cat-btn { padding: 8px 12px; border-radius: 10px; border: 2px solid var(--trait); background: var(--carte); font-weight: 700; font-size: 16px; }
.cat-btn.sel { border-color: var(--m); background: color-mix(in srgb, var(--m) 16%, white); }
.cat-btn.solution { outline: 3px dashed var(--ok); }
.classer-ligne.juste { border-color: var(--ok); background: var(--ok-bg); }
.classer-ligne.faux { border-color: var(--ko); background: var(--ko-bg); }

/* relier */
.relier { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.relier-col { display: grid; gap: 8px; align-content: start; }
.rel { padding: 12px; border-radius: 14px; border: 2px solid var(--trait); background: var(--carte); font-weight: 700; font-size: 18px; min-height: 54px; }
.rel.actif { border-color: var(--m); box-shadow: 0 0 0 3px color-mix(in srgb, var(--m) 30%, white); }
.rel.juste { border-color: var(--ok); }
.rel.faux { border-color: var(--ko); }

/* trous */
.trous { font-size: 21px; line-height: 2.2; text-align: center; }
.trou { font: inherit; font-weight: 800; padding: 2px 8px; border-radius: 10px; border: 2px solid var(--m); background: color-mix(in srgb, var(--m) 10%, white); color: var(--encre); }
.trou.juste { border-color: var(--ok); background: var(--ok-bg); }
.trou.faux { border-color: var(--ko); background: var(--ko-bg); }

/* droite graduée */
.droite { padding: 40px 18px 46px; }
.axe { position: relative; height: 4px; background: var(--encre); border-radius: 4px; }
.cran { position: absolute; top: -18px; width: 30px; height: 40px; margin-left: -15px; border: 0; background: none; padding: 0; }
.cran::before { content: ""; position: absolute; left: 14px; top: 10px; width: 3px; height: 20px; background: var(--encre); border-radius: 2px; }
.cran:hover::before { background: var(--m); }
.cran.sel::after, .cran.juste::after, .cran.faux::after { content: "▼"; position: absolute; left: 4px; top: -18px; font-size: 20px; color: var(--m); }
.cran.juste::after { color: var(--ok); }
.cran.faux::after { color: var(--ko); }
.cran-lab { position: absolute; top: 40px; left: 50%; transform: translateX(-50%); font-weight: 800; font-size: 16px; white-space: nowrap; }

/* retour / pied */
.msg-doux { min-height: 1em; margin: 10px 0 0; text-align: center; color: var(--ko); font-weight: 700; }
.retour { margin-top: 14px; padding: 14px 16px; border-radius: 16px; font-size: 18px; animation: entre .3s; }
.retour.juste { background: var(--ok-bg); color: #155C35; }
.retour.faux { background: var(--ko-bg); color: #8A1C22; }
.act-pied { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 14px; padding: 13px 22px; font-size: 19px; font-weight: 800; background: var(--m); color: #fff; text-decoration: none; box-shadow: 0 4px 0 color-mix(in srgb, var(--m) 60%, black); }
.btn:active { transform: translateY(3px); box-shadow: none; }
.btn.second { background: var(--carte); color: var(--encre); border: 2px solid var(--trait); box-shadow: 0 3px 0 var(--trait); }
.btn:disabled { opacity: .4; }

/* bilan + avis */
.bilan { text-align: center; padding: 6px 0 4px; }
.bilan h2 { font-size: 30px; margin: 6px 0; }
.bilan-etoiles { font-size: 64px; letter-spacing: 6px; }
.bilan-etoiles span { color: var(--trait); display: inline-block; }
.bilan-etoiles span.on { color: var(--etoile); animation: pop .6s backwards; }
@keyframes pop { 0% { transform: scale(0) rotate(-90deg); } 70% { transform: scale(1.3); } 100% { transform: scale(1); } }
.avis { margin-top: 18px; border-top: 2px dashed var(--trait); padding-top: 14px; }
.avis-titre { font-family: var(--titre); font-size: 20px; margin: 0 0 8px; text-align: center; }
.avis fieldset { border: 0; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.avis legend { width: 100%; text-align: center; font-weight: 800; margin-bottom: 6px; }
.avis label > input[type=radio] { position: absolute; opacity: 0; }
.avis label > span { display: inline-block; padding: 8px 16px; border-radius: 99px; border: 2px solid var(--trait); background: var(--carte); font-weight: 800; font-size: 18px; cursor: pointer; }
.avis fieldset:first-of-type label > span { font-size: 30px; padding: 4px 14px; }
.avis input:checked + span { border-color: var(--m); background: color-mix(in srgb, var(--m) 15%, white); transform: scale(1.06); }
.avis input:focus-visible + span { outline: 3px solid var(--accent); }
.avis-mot { display: block; text-align: center; font-weight: 800; }
.avis-mot input { display: block; width: 100%; margin-top: 6px; font: inherit; padding: 10px 14px; border-radius: 12px; border: 2px solid var(--trait); }

/* cartes mémo */
.flash-zone { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.flash { position: relative; width: min(100%, 460px); aspect-ratio: 3/2; border: 0; padding: 0; background: none; perspective: 1000px; }
.face { position: absolute; inset: 0; display: grid; place-items: center; padding: 18px; border-radius: 24px; font-size: clamp(22px, 5vw, 30px); font-weight: 800; text-align: center; backface-visibility: hidden; transition: transform .5s; box-shadow: 0 8px 24px rgba(0, 0, 0, .1); }
.recto { background: var(--carte); border: 3px solid var(--m); }
.verso { background: var(--m); color: #fff; transform: rotateY(180deg); }
.flash.retournee .recto { transform: rotateY(-180deg); }
.flash.retournee .verso { transform: rotateY(0); }
.flash-pied { justify-content: center; }

/* ---------- raton ---------- */
.raton { position: fixed; left: max(10px, env(safe-area-inset-left)); bottom: max(10px, env(safe-area-inset-bottom)); z-index: 40; display: flex; align-items: flex-end; gap: 6px; pointer-events: none; }
.raton-tete { pointer-events: auto; width: 74px; height: 74px; border-radius: 50%; border: 3px solid var(--c2); background: var(--c1); padding: 0; overflow: hidden; box-shadow: 0 6px 16px rgba(0, 0, 0, .25); }
.raton-tete img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.raton-bulle { order: 2; max-width: 230px; margin-bottom: 40px; background: #fff; border: 2px solid var(--c1); border-radius: 16px 16px 16px 4px; padding: 8px 12px; font-weight: 800; font-size: 16px; box-shadow: 0 4px 12px rgba(0, 0, 0, .12); animation: entre .25s; }
.raton[data-humeur="bravo"] .raton-tete { animation: saute .7s; }
.raton[data-humeur="fete"] .raton-tete { animation: tourne 1s ease 2; }
.raton[data-humeur="oups"] .raton-tete, .raton[data-humeur="rate"] .raton-tete { animation: non .5s; }
.raton[data-humeur="indice"] .raton-tete { animation: penche 1s ease; }
.raton[data-humeur="coucou"] .raton-tete { animation: coucou 1s ease; }
.raton[data-humeur="courage"] .raton-tete { animation: penche 1s ease; }
@keyframes tourne { 0% { transform: rotate(0); } 50% { transform: rotate(180deg) scale(1.2); } 100% { transform: rotate(360deg); } }
@keyframes penche { 30%, 70% { transform: rotate(-14deg); } }
@keyframes coucou { 20% { transform: rotate(-12deg); } 40% { transform: rotate(10deg); } 60% { transform: rotate(-8deg); } 80% { transform: rotate(5deg); } }
.activite ~ * .raton, .raton[hidden] { display: none; }

.confettis { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confettis i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px; animation-name: tombe; animation-timing-function: linear; animation-fill-mode: forwards; }
@keyframes tombe { to { top: 110vh; transform: rotate(720deg) translateX(40px); } }
.balle { position: absolute; bottom: 10vh; left: -60px; font-size: 54px; animation: rebond 2.6s linear forwards; }
@keyframes rebond { 0% { left: -60px; bottom: 10vh; } 20% { bottom: 45vh; } 40% { bottom: 10vh; } 60% { bottom: 35vh; } 80% { bottom: 10vh; } 100% { left: 110vw; bottom: 22vh; transform: rotate(720deg); } }

@media (max-width: 520px) {
  body { font-size: 17px; }
  .act-carte { padding: 16px 14px; border-radius: 20px; }
  .bandeau { padding: 18px 16px; min-height: 150px; }
  .raton-tete { width: 60px; height: 60px; }
  .act-pied .btn { flex: 1; }
  .relier { gap: 8px; }
  .rel { font-size: 16px; padding: 10px 8px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- visuels des exercices ---------- */
.collec { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 6px; font-size: clamp(28px, 7vw, 40px); max-width: 520px; margin: 0 auto; }
.collec .sep5 { width: 14px; }
.boite10 { display: inline-grid; grid-template-columns: repeat(5, 44px); gap: 4px; padding: 6px; background: #1D2738; border-radius: 10px; }
.boite10 i { height: 44px; background: #fff; border-radius: 6px; position: relative; }
.boite10 i.plein::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--m); }
.blocs { display: flex; align-items: flex-end; justify-content: center; gap: 6px; flex-wrap: wrap; }
.barre10 { display: inline-flex; flex-direction: column-reverse; gap: 1px; }
.barre10 i, .cubes i { width: 18px; height: 18px; background: var(--m); border: 1px solid rgba(0,0,0,.35); border-radius: 3px; display: block; }
.cubes { display: inline-grid; grid-template-columns: repeat(2, 18px); gap: 2px; margin-left: 10px; align-content: end; }
.argent { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
.piece { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 50%; font-weight: 900; font-size: 16px; background: radial-gradient(circle at 35% 30%, #FFF3B0, #D4A017); border: 4px solid #B8860B; color: #3A2A00; }
.piece.p2 { background: radial-gradient(circle at 35% 30%, #FFF3B0 40%, #C0C0C0 42%); width: 68px; height: 68px; border-color: #9a9a9a; }
.piece.p1 { background: radial-gradient(circle at 35% 30%, #EEE 40%, #E8C547 42%); border-color: #C9A227; }
.billet { display: grid; place-items: center; width: 110px; height: 58px; border-radius: 8px; font-weight: 900; font-size: 20px; color: #1D2738; border: 2px solid rgba(0,0,0,.25); }
.billet.b5 { background: #D9D9D9; } .billet.b10 { background: #F4A3A3; } .billet.b20 { background: #9EC5F7; } .billet.b50 { background: #F7C77E; }
.quad { border-collapse: collapse; margin: 0 auto; font-size: 18px; }
.quad th { width: 40px; height: 32px; color: var(--doux); }
.quad td { width: 46px; height: 46px; border: 2px solid var(--trait); text-align: center; font-size: 28px; background: #fff; }
.barres { display: grid; gap: 10px; max-width: 520px; margin: 0 auto; }
.barre-l { display: flex; align-items: center; gap: 10px; }
.barre-nom { font-weight: 900; width: 22px; }
.barre-l i { display: block; height: 24px; border-radius: 6px; }
.regle-box { max-width: 560px; margin: 0 auto 30px; position: relative; padding-top: 4px; }
.crayon { height: 22px; background: linear-gradient(90deg, #F4D35E 0 88%, #EE964B 88% 96%, #1D2738 96%); border-radius: 4px 14px 14px 4px; margin-bottom: 4px; }
.regle { position: relative; height: 34px; background: #FFF6D6; border: 2px solid #C9A227; border-radius: 4px; }
.regle .g { position: absolute; top: 0; width: 2px; height: 12px; background: #1D2738; }
.regle .g b { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); font-size: 12px; }
.mot-grand { font-size: clamp(36px, 10vw, 56px); font-weight: 900; letter-spacing: .04em; }
.syll { color: var(--m); }
.syll2 { color: #D9363E; }
.maison-nb { display: inline-grid; grid-template-columns: 1fr 1fr; gap: 3px; background: var(--m); padding: 4px; border-radius: 10px; font-size: 26px; font-weight: 900; }
.maison-nb .toit { grid-column: 1 / -1; background: #fff; border-radius: 6px; padding: 2px 16px; }
.maison-nb span { background: #fff; border-radius: 6px; padding: 2px 14px; min-width: 50px; }
.op { font-size: clamp(34px, 9vw, 50px); font-weight: 900; letter-spacing: .03em; }
.choix-btn small.lab { display: block; font-size: 14px; font-weight: 700; color: var(--doux); letter-spacing: 0; margin-top: 2px; }
.choix.grand .choix-btn svg { width: 64px; height: 64px; }
.frac { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; line-height: 1.05; margin: 0 4px; }
.frac sup { border-bottom: 3px solid currentColor; padding: 0 4px; font-size: .8em; vertical-align: 0; }
.frac sub { font-size: .8em; vertical-align: 0; padding: 0 4px; }
.bande { display: flex; max-width: 420px; margin: 0 auto; border: 2px solid #1D2738; border-radius: 6px; overflow: hidden; }
.bande i { flex: 1; height: 44px; border-right: 2px solid #1D2738; background: #fff; }
.bande i:last-child { border-right: 0; }
.bande i.plein { background: var(--m); }
.tab { border-collapse: collapse; margin: 0 auto; font-size: 17px; }
.tab caption { font-weight: 800; margin-bottom: 6px; }
.tab th, .tab td { border: 2px solid var(--trait); padding: 6px 10px; text-align: center; background: #fff; }
.tab th { background: var(--gris); }
.grille-aire { display: inline-grid; gap: 2px; padding: 3px; background: #1D2738; border-radius: 4px; }
.grille-aire i { width: 28px; height: 28px; background: color-mix(in srgb, var(--m) 30%, white); }
.diag { display: flex; align-items: flex-end; justify-content: center; gap: 14px; flex-wrap: wrap; padding: 8px; border-bottom: 3px solid #1D2738; max-width: 460px; margin: 0 auto; }
.diag > p { width: 100%; text-align: center; margin: 0 0 6px; }
.diag-col { display: flex; flex-direction: column; align-items: center; font-size: 15px; }
.diag-col i { width: 40px; background: var(--m); border-radius: 6px 6px 0 0; }
.diag-col b { order: -1; }
.plaque100 { display: inline-block; width: 60px; height: 60px; background: var(--m); border: 1px solid rgba(0,0,0,.35); border-radius: 4px; background-image: linear-gradient(rgba(0,0,0,.25) 1px, transparent 1px), linear-gradient(90deg, rgba(0,0,0,.25) 1px, transparent 1px); background-size: 6px 6px; }
