/* Héros de la Grande Section. Une seule apparence, claire et tendre : c'est un monde de jeu, il ne suit pas le thème sombre.
   Mise en page : une colonne pleine hauteur pour le téléphone tenu debout ; de très grosses cibles pour des doigts de 5 ans.
   Une « peau » par univers : [data-univers="…"] ne change que les couleurs. */
:root {
  color-scheme: light;
  --fond-haut: #f1e6ff;
  --fond-bas: #ffe4f0;
  --encre: #3b2460;
  --doux: #6f5a8e;
  --carte: #ffffff;
  --trait: #dcc8f3;
  --accent: #8e4fd0;
  --accent-fonce: #6b35a8;
  --or: #f6c343;
  --juste: #2faa6a;
  --juste-fond: #dff6e9;
  --non: #b9aecb;
  --pale: #f6edff;
  --second: #e0569a;
  --second-fonce: #b93a79;
  --tiers: #1fa3a3;
  --tiers-fonce: #157a7a;
  --quart: #e8912a;
  --quart-fonce: #b96c14;
  --cinq: #3d8fe0;
  --cinq-fonce: #2a6cb3;
  --six: #7fa32b;
  --six-fonce: #5c7a17;
  --sept: #d9534a;
  --sept-fonce: #a93a33;
  --huit: #2f9e57;
  --huit-fonce: #217a40;
  --neuf: #c2410c;
  --neuf-fonce: #9a3412;
  --bois: #8d5a3b;
  --coffre: #fff3d6;
  --ombre: 0 3px 0 rgba(59, 36, 96, .14);
  --police: ui-rounded, "Nunito", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --emoji: "Apple Color Emoji", "Noto Color Emoji", "Segoe UI Emoji", sans-serif;
}
/* v0.2 : la peau de l'univers Véhicules et trains (ciel bleu, piste, garage rouge) */
[data-univers="vehicules"] {
  --fond-haut: #dff0ff;
  --fond-bas: #fff4d9;
  --encre: #1d2b4f;
  --doux: #55668a;
  --trait: #c3d6ee;
  --accent: #2f7fd6;
  --accent-fonce: #1f5fa8;
  --pale: #eaf3ff;
  --second: #f08a24;
  --second-fonce: #c66a10;
  --tiers: #3aa655;
  --tiers-fonce: #2a7f3f;
  --quart: #d9413d;
  --quart-fonce: #a82c29;
  --cinq: #8a5cd6;
  --cinq-fonce: #6a3fb3;
  --six: #1fa3a3;
  --six-fonce: #157a7a;
  --bois: #5b6b85;
  --coffre: #eef3fa;
  --ombre: 0 3px 0 rgba(29, 43, 79, .14);
}
/* Les polices d'école (voir fonts/LICENCES.md) : script et capitales, puis cursive traditionnelle à boucles. */
@font-face { font-family: "GS Ecole Script"; src: url("../fonts/ecole-script.woff2") format("woff2"); font-display: block; }
@font-face { font-family: "GS Ecole Cursive"; src: url("../fonts/ecole-cursive.woff2") format("woff2"); font-display: block; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0; color: var(--encre); font-family: var(--police); font-size: 16px; line-height: 1.45;
  background: var(--fond-bas); background: linear-gradient(180deg, var(--fond-haut), var(--fond-bas)) fixed;
  overscroll-behavior: none;
}
#app {
  position: relative; height: 100%; max-width: 34rem; margin: 0 auto; overflow: hidden;
  display: flex; flex-direction: column; gap: 12px;
  padding-block: 12px 16px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation;
}
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
button:focus-visible, a:focus-visible, select:focus-visible { outline: 4px solid var(--accent); outline-offset: 2px; }
.emoji { font-family: var(--emoji); line-height: 1; display: inline-block; }

/* ----- Barre du haut ----- */
.barre { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex: 0 0 auto; position: relative; z-index: 2; }
.rond {
  position: relative; flex: 0 0 auto; width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--trait);
  background: var(--carte); box-shadow: var(--ombre); font-size: 26px; display: grid; place-items: center; padding: 0;
}
.rond.fantome { visibility: hidden; }
.rond.parle { background: var(--or); border-color: #d99a16; }
.rond.parents { opacity: .55; transition: transform 1.5s linear, opacity .2s; }
.rond.parents.appui { transform: rotate(180deg) scale(1.15); opacity: 1; }
.pastille {
  position: absolute; right: -4px; bottom: -4px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px;
  background: var(--accent); color: #fff; font-size: 14px; font-weight: 800; line-height: 24px; text-align: center;
}
.chemin { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 5px; }
.pas { width: 14px; height: 14px; border-radius: 50%; background: var(--carte); border: 2px solid var(--trait); flex: 0 1 auto; }
.pas.fait { background: var(--or); border-color: #d99a16; }
.pas.ici { background: var(--accent); border-color: var(--accent-fonce); transform: scale(1.25); }

/* ----- Démarrage et accueil ----- */
.titre { margin: 8px 0 0; text-align: center; font-size: 1.5rem; line-height: 1.15; font-weight: 800; position: relative; z-index: 1; text-wrap: balance; }
/* v0.6.1 : le rappel du son, et la question « est-ce que tu m'entends ? » */
.rappel-son { position: relative; z-index: 1; align-self: center; margin: 0; padding: 8px 16px; border-radius: 20px; background: var(--carte); border: 2px solid var(--or); font-weight: 700; font-size: 1rem; text-align: center; }
.gros-bouton.oreille-test { width: 170px; height: 116px; border-radius: 58px; font-size: 66px; animation: battre 1.2s ease-in-out infinite; margin-bottom: 8%; }
.alerte-voix { border: 3px solid #c0392b; border-radius: 12px; padding: 12px; background: #fff4f2; font-weight: 700; }
.dessin-aide { max-width: 320px; align-self: center; width: 100%; }
.dessin-aide svg { width: 100%; height: auto; display: block; }
.boutons-aide { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 10px; }
.boutons-aide .gros-bouton { height: 76px; }
/* le cadre du décor : le décor au fond, ce qui passe devant lui, puis le guide */
.scene-accueil { position: relative; flex: 1 1 auto; min-height: 110px; overflow: hidden; border-radius: 22px; display: flex; align-items: flex-end; justify-content: center; }
.decor { position: absolute; inset: 0; opacity: .95; pointer-events: none; z-index: 0; }
.decor svg { width: 100%; height: 100%; display: block; }
/* v2.3.1 : le dessin est en absolu dans la boîte du guide (calé en bas par preserveAspectRatio) : sur iOS 15, une hauteur en %
   dans une boîte étirée par flex ne marchait pas et le guide était invisible */
.guide { position: relative; z-index: 1; flex: 1 1 auto; min-height: 0; }
.guide svg { position: absolute; left: 15%; bottom: 0; width: 70%; height: min(100%, 300px); display: block; filter: drop-shadow(0 4px 0 rgba(59, 36, 96, .12)); }
.scene-accueil .guide { position: absolute; left: 0; right: 0; bottom: 0; top: 6%; }
.scene-accueil .guide svg { left: 0; width: 100%; height: 100%; }
.lune { position: absolute; top: 10px; right: 16px; font-family: var(--emoji); font-size: 52px; z-index: 1; }
/* v0.4 : des décors qui vivent, lentement (rien de tout cela pendant les jeux) */
.rayons-soleil { transform-box: fill-box; transform-origin: center; animation: tourner 32s linear infinite; }
.drapeau, .fanion { transform-box: fill-box; transform-origin: left center; animation: flotter 2.8s ease-in-out infinite alternate; }
.fanion:nth-of-type(2) { animation-delay: -1.3s; }
.arc-en-ciel path { stroke-dasharray: 1; stroke-dashoffset: 0; opacity: .85; animation: arc 18s ease-in-out infinite; }
.passant { position: absolute; z-index: 0; bottom: 1%; left: -90px; width: 74px; pointer-events: none; animation: traverser 9s linear forwards; }
.passant svg { width: 100%; height: auto; display: block; }
.passant-princesses { width: 132px; left: -140px; bottom: 3%; animation-duration: 13s; }
.passant.retour { animation-name: revenir; }
.passant.retour svg { transform: scaleX(-1); }
@keyframes flotter { from { transform: skewY(-7deg) scaleX(1); } to { transform: skewY(7deg) scaleX(.9); } }
@keyframes arc { 0% { stroke-dashoffset: 1; opacity: 0; } 8% { opacity: .85; } 30% { stroke-dashoffset: 0; } 78% { stroke-dashoffset: 0; opacity: .85; } 92%, 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes traverser { from { left: -140px; } to { left: 100%; } }
@keyframes revenir { from { left: 100%; } to { left: -140px; } }
.gros-bouton {
  align-self: center; position: relative; z-index: 1; flex: 0 0 auto; min-width: 150px; height: 92px; padding: 0 28px;
  border-radius: 46px; border: 0; background: var(--juste); color: #fff; font-size: 44px; box-shadow: 0 6px 0 #1e7f4c;
  display: grid; place-items: center;
}
.icone { display: block; width: 52px; height: 52px; }
.icone svg { width: 100%; height: 100%; display: block; }
.valider .icone { width: 44px; height: 44px; }
.gros-bouton:active { transform: translateY(4px); box-shadow: 0 2px 0 #1e7f4c; }
.ecran-demarrage .gros-bouton { animation: battre 1.4s ease-in-out infinite; margin-bottom: 8%; }
.ecran-demarrage .gros-bouton { animation: battre 1.4s ease-in-out infinite; margin-bottom: 8%; }
/* « Joue avec moi » : le guide compose la séance */
.joue {
  position: relative; z-index: 1; flex: 0 0 auto; height: 68px; border: 0; border-radius: 34px; background: var(--juste); color: #fff;
  box-shadow: 0 6px 0 #1e7f4c; display: flex; align-items: center; justify-content: center; gap: 14px; font-size: 30px; padding: 0 20px;
}
.joue .icone { width: 40px; height: 40px; }
.joue:active { transform: translateY(4px); box-shadow: 0 2px 0 #1e7f4c; }
.joue.montre { outline: 6px solid var(--or); outline-offset: 3px; }
.joue:disabled { background: #b9aecb; box-shadow: 0 6px 0 #9c8fb3; opacity: .7; }
/* les boutons des mondes : deux rangées ; leur forme dit dans quel univers on est */
.portes { position: relative; z-index: 1; flex: 0 0 auto; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.portes.trois { grid-template-columns: repeat(6, 1fr); }
.portes.trois .porte { grid-column: span 2; }
/* la dernière rangée, si elle n'est pas pleine, est centrée : un bouton au milieu (sept mondes), ou deux côte à côte (huit) */
.portes.n7 .porte:nth-child(7) { grid-column: 3 / span 2; }
.portes.n8 .porte:nth-child(7) { grid-column: 2 / span 2; }
.portes.n8 .porte:nth-child(8) { grid-column: 4 / span 2; }
/* neuf mondes : trois rangées pleines */
.porte { --c: var(--accent); --cf: var(--accent-fonce); position: relative; min-width: 0; min-height: 96px; padding: 0; color: var(--encre); display: flex; align-items: center; justify-content: center; }
.porte-sons { --c: var(--second); --cf: var(--second-fonce); }
.porte-formes { --c: var(--tiers); --cf: var(--tiers-fonce); }
.porte-lettres { --c: var(--quart); --cf: var(--quart-fonce); }
.porte-problemes { --c: var(--cinq); --cf: var(--cinq-fonce); }
.porte-histoires { --c: var(--six); --cf: var(--six-fonce); }
.porte-temps { --c: var(--sept); --cf: var(--sept-fonce); }
.porte-nature { --c: var(--huit); --cf: var(--huit-fonce); }
.porte-musique { --c: var(--neuf); --cf: var(--neuf-fonce); }
.porte .dedans { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 36px; min-width: 0; }
.porte .chiffres { font-size: 30px; font-weight: 800; letter-spacing: .04em; color: var(--cf); }
.mini-formes { display: block; width: 78px; }
.mini-formes svg { display: block; width: 100%; height: auto; }
.mini-perles { display: flex; gap: 3px; }
.mini-perles svg { width: 28px; height: 28px; display: block; }
.mini-lettres { display: flex; align-items: baseline; gap: 10px; color: var(--cf); }
.mini-lettres .lettre { font-size: 38px; line-height: 1.1; }
.mini-lettres .lettre.g-cursive { font-size: 30px; line-height: 1.1; }
.porte.montre { outline: 6px solid var(--or); outline-offset: 4px; transform: scale(1.04); }
.porte:disabled { filter: grayscale(1); opacity: .6; }
/* avec cinq ou six mondes, trois boutons par rangée : leur contenu se resserre */
.portes.trois .dedans { font-size: 28px; gap: 5px; }
.portes.trois .chiffres { font-size: 21px; letter-spacing: 0; }
.portes.trois .mini-formes { width: 48px; }
.portes.trois .mini-perles svg { width: 19px; height: 19px; }
.portes.trois .mini-lettres { gap: 6px; }
.portes.trois .mini-lettres .lettre { font-size: 28px; }
.portes.trois .mini-lettres .lettre.g-cursive { font-size: 22px; }
/* chez les princesses (par défaut) : un médaillon ovale au cadre doré, surmonté d'une petite couronne */
.portes { padding-top: 18px; row-gap: 30px; }
.porte {
  border-radius: 50%; border: 5px solid var(--or); background: #fff; background: radial-gradient(ellipse at 50% 40%, #fff 45%, var(--pale));
  box-shadow: 0 0 0 3px #d99a16, inset 0 0 0 5px var(--c), 0 7px 0 2px #b97f10;
}
.porte:active { transform: translateY(4px); box-shadow: 0 0 0 3px #d99a16, inset 0 0 0 5px var(--c), 0 3px 0 2px #b97f10; }
.porte .orne { position: absolute; top: -24px; left: 50%; width: 46px; margin-left: -23px; color: var(--c); }
.porte .orne svg { width: 100%; height: auto; display: block; }
/* au garage : une borne de bord de route, corps blanc et chapeau de couleur */
[data-univers="vehicules"] .portes { padding-top: 0; row-gap: 12px; }
[data-univers="vehicules"] .porte {
  min-height: 108px; border-radius: 46px 46px 12px 12px; border: 4px solid #33415f; background: #fff; box-shadow: 0 6px 0 #33415f;
  overflow: hidden; align-items: flex-end; padding-bottom: 12px;
}
[data-univers="vehicules"] .porte:active { transform: translateY(4px); box-shadow: 0 2px 0 #33415f; }
[data-univers="vehicules"] .porte .orne { top: 0; left: 0; right: 0; width: auto; margin: 0; height: 36%; background: var(--c); border-bottom: 4px solid #33415f; }

/* le choix de l'univers */
.guides { position: relative; z-index: 1; flex: 1 1 auto; min-height: 0; display: flex; align-items: flex-end; justify-content: center; gap: 4%; }
.guides .guide { position: absolute; top: 0; bottom: 0; width: 46%; }
.guides .guide svg { left: 0; width: 100%; height: 100%; }
.ecran-univers { justify-content: center; }
.liste-univers { display: grid; grid-template-columns: 1fr; gap: 18px; flex: 1 1 auto; min-height: 0; align-content: center; }
.carte-univers {
  min-height: 0; height: min(38vh, 300px); border-radius: 28px; border: 4px solid #6b35a8; background: linear-gradient(180deg, #f1e6ff, #ffe4f0);
  box-shadow: 0 6px 0 #6b35a8; display: flex; align-items: center; justify-content: space-evenly; gap: 10px; padding: 12px; font-size: 76px;
}
/* v2.4 : trois univers ou plus : des cartes moins hautes (hauteur fixe : iOS 15 ne sait pas étirer le portrait autrement) */
.liste-univers.n3 { gap: 14px; }
.liste-univers.n3 .carte-univers { height: min(25vh, 220px); font-size: 64px; }
/* v2.5 : quatre univers ou plus : une grille de carrés, deux par rangée (le guide au-dessus, l'emblème en dessous). Hauteur fixe,
   calculée sur la largeur de l'écran (iOS 15 ne sait pas étirer le portrait autrement). */
.liste-univers.n4, .liste-univers.n5, .liste-univers.n6 { grid-template-columns: 1fr 1fr; gap: 14px; }
.liste-univers.n4 .carte-univers, .liste-univers.n5 .carte-univers, .liste-univers.n6 .carte-univers {
  height: min(calc((min(100vw, 34rem) - 46px) / 2), 36vh); flex-direction: column; justify-content: center; gap: 2px; padding: 8px; font-size: 32px; border-radius: 24px;
}
.liste-univers.n5 .carte-univers, .liste-univers.n6 .carte-univers { height: min(calc((min(100vw, 34rem) - 46px) / 2), 26vh); font-size: 26px; }
.liste-univers.n4 .carte-univers .portrait, .liste-univers.n5 .carte-univers .portrait, .liste-univers.n6 .carte-univers .portrait { height: 72%; }
/* v2.6 : un nombre impair de cartes : la dernière, seule sur sa rangée, est centrée */
.liste-univers.n5 .carte-univers:last-child { grid-column: 1 / -1; justify-self: center; width: calc(50% - 7px); }
.carte-univers.u-secours { border-color: #2a4f9e; box-shadow: 0 6px 0 #2a4f9e; background: linear-gradient(180deg, #dce9ff, #fff1ec); }
.carte-univers.u-ferme { border-color: #b8392e; box-shadow: 0 6px 0 #b8392e; background: linear-gradient(180deg, #dcf0ff, #fbf3df); }
.carte-univers.u-dinosaures { border-color: #3b7a21; box-shadow: 0 6px 0 #3b7a21; background: linear-gradient(180deg, #e3f5d3, #fff3d9); }
.carte-univers.u-vehicules { border-color: #1f5fa8; box-shadow: 0 6px 0 #1f5fa8; background: linear-gradient(180deg, #dff0ff, #fff4d9); }
.carte-univers .portrait { height: 100%; display: block; }
.carte-univers .portrait svg { height: 100%; width: auto; display: block; }
.carte-univers:active { transform: translateY(4px); }
.carte-univers.montre { outline: 6px solid var(--or); outline-offset: 3px; transform: scale(1.03); }
[data-univers="vehicules"] .coffre { border-radius: 10px; border-top: 24px solid #e23b3b; }

/* ----- Jeu ----- */
.scene { flex: 1 1 0; min-height: 0; position: relative; display: grid; place-items: center; border-radius: 22px; }
.scene.vide { flex: 0 0 4%; }
.zone-objets { background: rgba(255, 255, 255, .6); border: 2px dashed var(--trait); display: block; max-height: 380px; margin-block: auto; }
.objet {
  position: absolute; width: 58px; height: 58px; margin: -29px 0 0 -29px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; font-size: 36px; display: grid; place-items: center;
}
/* v0.5.1 : moins il y a d'objets, plus ils sont gros (la grille est choisie d'après leur nombre, dans outils.js) */
.t-moyen .objet { width: 68px; height: 68px; margin: -34px 0 0 -34px; font-size: 46px; }
.t-grand .objet { width: 84px; height: 84px; margin: -42px 0 0 -42px; font-size: 58px; }
.t-moyen .numero, .t-grand .numero { top: -4px; right: -4px; }
.plateau.t-moyen .emoji.petit { font-size: 31px; }
.plateau.t-grand .emoji.petit { font-size: 38px; }
.objet.compte { background: var(--juste-fond); box-shadow: 0 0 0 3px var(--juste); }
.numero {
  position: absolute; top: -8px; right: -8px; min-width: 26px; height: 26px; border-radius: 13px; background: var(--juste); color: #fff;
  font-size: 16px; font-weight: 800; line-height: 26px; text-align: center; font-family: var(--police);
}
.grand-mot {
  width: min(48vw, 190px); aspect-ratio: 1; max-width: 100%; border-radius: 28px; border: 3px solid var(--trait); background: var(--carte);
  box-shadow: var(--ombre); font-size: min(26vw, 104px); display: grid; place-items: center; padding: 0;
}
.grand-mot.oreille { background: var(--or); border-color: #d99a16; animation: battre 1.6s ease-in-out infinite; }
.scene.montre .grand-mot { outline: 6px solid var(--or); outline-offset: 3px; }
.zone-objets.montre { border: 4px solid var(--or); }
.bande { display: flex; justify-content: center; gap: 6px; width: 100%; }
.case {
  flex: 1 1 0; min-width: 0; max-width: 72px; aspect-ratio: 4 / 5; border-radius: 12px; border: 3px solid var(--trait); background: var(--carte);
  display: grid; place-items: center; font-size: clamp(24px, 8.5vw, 40px); font-weight: 800; font-variant-numeric: tabular-nums;
}
.case.trou { border-style: dashed; border-color: var(--accent); color: var(--accent); background: var(--pale); }
.case.rempli { border-style: solid; border-color: var(--juste); color: var(--juste); background: var(--juste-fond); }
.case.montre { transform: translateY(-6px); border-color: var(--or); box-shadow: 0 6px 0 var(--or); }

.choix { flex: 0 0 auto; display: grid; gap: 12px; grid-template-columns: repeat(3, 1fr); }
.choix-2, .choix-4 { grid-template-columns: repeat(2, 1fr); }
.carte {
  min-width: 0; min-height: 118px; border-radius: 22px; border: 3px solid var(--trait); background: var(--carte); box-shadow: var(--ombre);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8px; font-size: 58px;
  transition: transform .12s;
}
.choix-4 .carte { min-height: 96px; }
.carte:active { transform: scale(.96); }
.carte.montre { border-color: var(--or); box-shadow: 0 0 0 5px var(--or); transform: scale(1.05); }
.carte.juste { border-color: var(--juste); background: var(--juste-fond); box-shadow: 0 0 0 5px var(--juste); animation: sauter .5s; }
.carte.non { border-color: var(--non); background: #f1edf6; opacity: .45; animation: secouer .4s; }
.chiffre { font-size: 64px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.ronds { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; max-width: 100%; }
.rond-point { border-radius: 50%; background: var(--accent); display: block; }
.ronds.petits { max-width: 62px; }
.ronds.petits .rond-point { width: 9px; height: 9px; background: var(--doux); }
.ronds.gros { gap: 8px; max-width: 76px; }
.ronds.gros .rond-point { width: 26px; height: 26px; }
.rond-point.allume { background: var(--or); box-shadow: 0 0 0 3px #d99a16; }
.carte-groupe { min-height: 0; height: min(40vh, 240px); padding: 6px; }
.plateau { position: relative; display: block; width: 100%; height: 100%; border-radius: 16px; background: var(--pale); }
.emoji.petit { position: absolute; font-size: 24px; transform: translate(-50%, -50%); }
.choix-groupe { flex: 1 1 auto; align-content: center; }

/* v0.6 : les mots et les histoires */
.duo-scene { position: relative; cursor: default; }
.duo-scene .accessoire { position: absolute; right: -18px; bottom: -14px; font-size: .56em; background: var(--carte); border: 3px solid var(--trait); border-radius: 50%; padding: 8px; box-shadow: var(--ombre); }
.grand-mot.livre { animation: none; }
.forme-image { display: grid; place-items: center; font-size: clamp(44px, 15vw, 62px); }
.choix-etapes { grid-template-columns: repeat(3, 1fr); margin-block: auto; }
.choix-etapes.choix-4 { grid-template-columns: repeat(2, 1fr); }
.carte-etape { position: relative; min-height: 0; aspect-ratio: 1; font-size: clamp(50px, 17vw, 72px); }
.choix-etapes.choix-4 .carte-etape { aspect-ratio: 4 / 3; min-height: 0; }
.carte-etape.range { border-color: var(--juste); background: var(--juste-fond); }
.carte-etape.secoue { animation: secouer .4s; }
.carte-etape .numero { top: 6px; right: 6px; min-width: 32px; height: 32px; border-radius: 16px; font-size: 19px; line-height: 32px; }
/* v0.7 : le temps et l'espace */
.semaine { display: flex; justify-content: center; gap: 5px; width: 100%; }
.jour-case { flex: 1 1 0; min-width: 0; max-width: 56px; aspect-ratio: 4 / 5; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: clamp(20px, 6.5vw, 30px); border: 3px solid rgba(0, 0, 0, .14); }
.semaine .jour-case.ici { transform: translateY(-10px) scale(1.12); box-shadow: 0 0 0 4px var(--encre); }
.semaine .jour-case.montre { transform: translateY(-10px) scale(1.12); box-shadow: 0 0 0 5px var(--or); }
.semaine.grise .jour-case:not(.montre) { background-color: #b9aecb !important; }
.carte-jour { gap: 8px; }
.carte-jour .jour-case { flex: 0 0 auto; width: 58px; max-width: none; font-size: 30px; }
.jour-mot { font-family: "GS Ecole Script", var(--police); font-size: clamp(17px, 5.4vw, 23px); line-height: 1.1; color: var(--encre); }
/* « Où est-il ? » : de grandes images, deux par rangée (la troisième au milieu) */
.choix-position { grid-template-columns: repeat(2, 1fr); margin-block: auto; }
.choix-position.choix-3 .carte:last-child { grid-column: 1 / -1; justify-self: center; width: calc(50% - 6px); }
.carte-position { min-height: 0; padding: 6px; }
.pos { position: relative; display: block; width: min(37vw, 150px); aspect-ratio: 1; }
.pos-ref { position: absolute; inset: 0; z-index: 1; }
.pos-ref svg { width: 100%; height: 100%; display: block; }
.pos-animal { position: absolute; z-index: 2; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: min(12.4vw, 50px); }
.pos-table.p-sur .pos-animal { left: 32%; top: 30%; }
.pos-table.p-sous .pos-animal { left: 32%; top: 75%; }
.pos-table.p-cote .pos-animal { left: 81%; top: 75%; }
.pos-boite.p-sur .pos-animal { top: 34%; }
.pos-boite.p-devant .pos-animal { top: 79%; }
.pos-boite.p-derriere .pos-animal { top: 46%; z-index: 0; }
.pos-boite.p-cote .pos-animal, .pos-boite.p-droite .pos-animal { left: 83%; top: 75%; }
.pos-boite.p-gauche .pos-animal { left: 17%; top: 75%; }
.pos-boites.p-entre .pos-animal { top: 75%; }
.pos-boites.p-cote .pos-animal { left: 82%; top: 75%; }
.pos-boites.p-sur .pos-animal { left: 18%; top: 38%; }
/* le chemin de flèches : le quadrillage, la bande des flèches choisies, les quatre flèches et le bouton vert */
.scene-fl { display: grid; place-items: center; }
.grille-fl { --r: 4; --cote: min(calc((min(100vw, 34rem) - 54px) / 4), calc((100vh - 300px) / var(--r)), 86px); display: grid; grid-template-columns: repeat(4, var(--cote)); grid-auto-rows: var(--cote); gap: 6px; }
.grille-fl.r3 { --r: 3; }
.case-fl { position: relative; border-radius: 14px; border: 3px solid var(--trait); background: var(--carte); display: grid; place-items: center; font-size: calc(var(--cote) * .56); }
.case-fl.mur { background: #e3f3df; border-color: #b9d8b0; }
.case-fl.trace { background: var(--pale); border-color: var(--accent); border-style: dashed; }
.case-fl.but { border-color: var(--or); background: #fff8e2; }
.case-fl.montre { box-shadow: 0 0 0 5px var(--or); }
.case-fl.juste { border-color: var(--juste); background: var(--juste-fond); box-shadow: 0 0 0 5px var(--juste); }
.case-fl.occupee .cible-fl { display: none; }
.pion-fl.secoue { animation: secouer .4s 2; }
.rang-fl { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; }
.bande-fl { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 18px; background: rgba(255, 255, 255, .6); border: 2px dashed var(--trait); }
.pas-fl { flex: 1 1 0; min-width: 0; max-width: 44px; aspect-ratio: 1; border-radius: 11px; border: 2px dashed var(--trait); display: grid; place-items: center; }
.pas-fl.plein { border: 0; background: var(--accent); }
.pas-fl.actif { box-shadow: 0 0 0 4px var(--or); transform: scale(1.1); }
.fl { display: grid; place-items: center; width: 100%; height: 100%; }
.fl svg { width: 68%; height: 68%; display: block; }
.fl.vers-g svg { transform: rotate(180deg); }
.fl.vers-h svg { transform: rotate(-90deg); }
.fl.vers-b svg { transform: rotate(90deg); }
.pad-fl { flex: 1 1 auto; min-width: 0; display: flex; gap: 8px; border-radius: 22px; }
.fl-btn { flex: 1 1 0; min-width: 0; height: 66px; padding: 0; border: 0; border-radius: 18px; background: var(--accent); box-shadow: 0 5px 0 var(--accent-fonce); }
.fl-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--accent-fonce); }
.fl-btn .fl svg { width: 44px; height: 44px; }
.pad-fl.montre { box-shadow: 0 0 0 5px var(--or); }
.go-fl { flex: 0 0 78px; height: 66px; padding: 0; border: 0; border-radius: 33px; background: var(--juste); box-shadow: 0 5px 0 #1e7f4c; display: grid; place-items: center; }
.go-fl .icone { width: 40px; height: 40px; }
.go-fl:active { transform: translateY(3px); box-shadow: 0 2px 0 #1e7f4c; }
.go-fl.montre { outline: 5px solid var(--or); outline-offset: 3px; }
.efface-fl { flex: 0 0 54px; height: 54px; padding: 0; border: 0; border-radius: 50%; background: var(--doux); box-shadow: 0 4px 0 #4d3c68; display: grid; place-items: center; }
.efface-fl .icone { width: 30px; height: 30px; }
.efface-fl:active { transform: translateY(3px); box-shadow: 0 1px 0 #4d3c68; }
/* v0.8 : le vivant, la matière et les objets */
.scene-corps { display: grid; place-items: center; }
.corps { position: relative; width: 240px; height: 340px; cursor: pointer; }
.corps-dessin svg { width: 100%; height: 100%; display: block; }
.marque-corps { position: absolute; width: 15%; aspect-ratio: 1; margin: -7.5% 0 0 -7.5%; border-radius: 50%; pointer-events: none; opacity: 0; transition: opacity .2s; }
.marque-corps.montre { opacity: 1; box-shadow: 0 0 0 5px var(--or); background: rgba(246, 195, 67, .3); }
.corps.juste .marque-corps.montre { box-shadow: 0 0 0 5px var(--juste); background: rgba(47, 170, 106, .25); }
.marque-corps.non { opacity: 1; box-shadow: 0 0 0 4px var(--non); }
.scene-flot { display: grid; place-items: center; }
.bac { position: relative; width: 100%; max-width: 420px; aspect-ratio: 3 / 2; max-height: 100%; }
.bac.montre { outline: 5px solid var(--or); outline-offset: 4px; border-radius: 16px; }
.bac-dessin svg { position: absolute; left: 0; bottom: 0; width: 100%; height: 76%; display: block; }
.objet-flot { position: absolute; left: 50%; top: 2%; font-size: clamp(48px, 15vw, 70px); transform: translateX(-50%); transition: top 1.2s cubic-bezier(.4, 0, .6, 1); }
.objet-flot.o0-2 { left: 34%; }
.objet-flot.o1-2 { left: 66%; }
.objet-flot.tombe.flotte { top: 30%; animation: bercer 1.6s ease-in-out 1.2s infinite; }
.objet-flot.tombe.coule { top: 68%; }
@keyframes bercer { 0%, 100% { margin-top: 0; } 50% { margin-top: 5px; } }
.carte-flot .dessin svg { width: min(30vw, 120px); height: auto; display: block; }
.carte.choisi { border-color: var(--non); background: #f1edf6; }
.forme-picto { display: grid; place-items: center; padding: 10px; }
.forme-picto svg { width: 100%; height: 100%; display: block; }
/* v0.9 : la musique */
.scene-musique { display: grid; place-items: center; }
.grand-mot.musique { background: #ffe9c2; border-color: #f0b54a; animation: none; }
.scene-musique.joue-musique .grand-mot.musique { animation: battre .5s ease-in-out infinite; box-shadow: 0 0 0 6px var(--or); }
.carte .dessin-flute svg { width: min(22vw, 84px); height: auto; display: block; }
.carte .dessin-long svg, .carte .dessin-court svg { width: min(30vw, 120px); height: auto; display: block; }
.dessin-rythme { display: block; width: 100%; height: auto; max-height: 64px; }
.dessin-rythme .coup { fill: var(--accent); transition: fill .1s; }
.dessin-rythme .coup.allume { fill: var(--or); }
.carte-rythme { padding: 10px 14px; }

.carte-rythme .dessin svg.dessin-rythme { width: 100%; height: 54px; max-height: none; }
.grand-rythme svg.dessin-rythme { width: 100%; height: auto; }
.choix-rythme { grid-template-columns: 1fr; }
.choix-rythme .carte { min-height: 76px; }
.scene-rythme { display: grid; place-items: center; }
.grand-rythme { width: 100%; max-width: 420px; padding: 18px; border-radius: 22px; background: var(--carte); border: 3px solid var(--trait); box-shadow: var(--ombre); }
.grand-rythme .dessin-rythme { max-height: 110px; }
.grand-rythme.juste { border-color: var(--juste); background: var(--juste-fond); }
.tambourin { width: 150px; height: 150px; border-radius: 50%; border: 0; background: #e5484d; box-shadow: 0 8px 0 #a82c29, inset 0 0 0 10px #f6c343; font-size: 76px; display: grid; place-items: center; padding: 0; }
.tambourin.frappe { animation: frapper .18s; }
@keyframes frapper { 50% { transform: translateY(6px) scale(.95); box-shadow: 0 2px 0 #a82c29, inset 0 0 0 10px #f6c343; } }
/* v0.5 : les problèmes. Une histoire se joue : les objets arrivent, s'en vont, entrent dans la cachette ou en ressortent. */
.zone-objets .objet { transition: transform .6s ease-in-out, opacity .5s; }
.avec-cachette .objet { width: 50px; height: 50px; margin: -25px 0 0 -25px; font-size: 34px; }
.avec-cachette.t-moyen .objet { width: 58px; height: 58px; margin: -29px 0 0 -29px; font-size: 40px; }
.avec-cachette.t-grand .objet { width: 76px; height: 76px; margin: -38px 0 0 -38px; font-size: 52px; }
.objet.pas-encore { opacity: 0; transform: scale(.3); pointer-events: none; }
.objet.parti { opacity: 0; transform: translateY(-70px) scale(.6); pointer-events: none; }
.objet.dedans { opacity: 0; pointer-events: none; }
.objet.sorti { box-shadow: 0 0 0 3px var(--non); background: rgba(255, 255, 255, .7); }
.cachette {
  position: absolute; left: 50%; bottom: 5%; width: 48%; height: 36%; margin-left: -24%; border-radius: 22px 22px 12px 12px;
  border: 5px solid var(--bois); border-top-width: 18px; background: var(--bois); box-shadow: inset 0 0 0 3px var(--or); transition: background .4s;
}
.cachette::after { content: ""; position: absolute; left: 50%; top: 38%; width: 26px; height: 26px; margin-left: -13px; border-radius: 50%; background: var(--or); box-shadow: 0 0 0 3px #d99a16; }
.cachette.ouverte { background: var(--coffre); }
.cachette.ouverte::after { display: none; }
[data-univers="vehicules"] .cachette { border-radius: 8px; border-top: 24px solid #e23b3b; background: #9fb4d3 repeating-linear-gradient(0deg, #7d93b5 0 3px, #9fb4d3 3px 16px); }
[data-univers="vehicules"] .cachette::after { display: none; }
[data-univers="vehicules"] .cachette.ouverte { background: var(--coffre); }
/* il en manque : des amis, et sous chacun son objet ou une place vide */
.manque { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 6px; width: 100%; padding: 14px 6px; border-radius: 22px; background: rgba(255, 255, 255, .6); border: 2px dashed var(--trait); }
.duo { flex: 0 0 auto; width: 58px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.duo .ami { font-size: 42px; }
.duo .objet-donne { font-size: 32px; }
.manque-petit .duo { width: 64px; }
.manque-petit .ami { font-size: 52px; }
.manque-petit .objet-donne { font-size: 42px; }
.manque-petit .place-vide { width: 46px; height: 46px; }
.manque-petit:not(.aligne) .ami { width: 62px; }
.place-vide { position: relative; display: block; width: 38px; height: 38px; border-radius: 50%; border: 3px dashed var(--accent); background: var(--pale); }
.place-vide.compte { border-style: solid; border-color: var(--juste); background: var(--juste-fond); }
/* tant que rien n'est rangé : les amis d'un côté, les objets regroupés de l'autre, et pas de places vides */
.manque:not(.aligne) .duo { display: contents; }
.manque:not(.aligne) .ami { order: 1; width: 52px; text-align: center; }
.manque:not(.aligne)::after { content: ""; order: 2; flex: 0 0 100%; height: 10px; }
.manque:not(.aligne) .objet-donne { order: 3; }
.manque:not(.aligne) .place-vide { display: none; }
/* le partage */
.zone-reserve { flex: 1 1 0; padding: 8px; background: rgba(255, 255, 255, .6); border: 2px dashed var(--trait); }
.zone-reserve .reserve-partage { border: 0; background: none; min-height: 0; width: 100%; padding: 0; }
.objet-part { flex: 0 0 auto; width: 46px; height: 46px; padding: 0; border: 0; background: none; font-size: 34px; display: grid; place-items: center; }
.amis-part { flex: 0 0 auto; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.amis-part.amis-3 { grid-template-columns: repeat(3, 1fr); }
.part { min-width: 0; min-height: 190px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border-radius: 22px; border: 3px solid var(--trait); background: var(--carte); }
.part.juste { border-color: var(--juste); background: var(--juste-fond); box-shadow: 0 0 0 4px var(--juste); }
.ami-part { flex: 0 0 auto; width: 80px; height: 80px; padding: 0; border: 0; border-radius: 50%; background: var(--pale); box-shadow: var(--ombre); font-size: 52px; display: grid; place-items: center; }
.ami-part:active { transform: scale(.94); }
.ami-part.montre { outline: 6px solid var(--or); outline-offset: 2px; }
.assiette { width: 100%; min-height: 92px; display: flex; flex-wrap: wrap; justify-content: center; align-content: flex-start; }
.reserve-partage.t-grand .objet-part, .amis-part:not(.amis-3) .assiette .objet-part { width: 54px; height: 54px; font-size: 42px; }
.amis-3 .objet-part { width: 33px; height: 40px; font-size: 26px; }
.amis-3 .ami-part { width: 68px; height: 68px; font-size: 44px; }
/* le chemin : dix cases, un dé qui dit de combien on avance (ou recule) */
.scene-piste { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; }
.de-piste { display: flex; align-items: center; gap: 14px; padding: 10px 20px; border-radius: 22px; background: var(--carte); border: 3px solid var(--trait); box-shadow: var(--ombre); }
.de-piste.montre { border-color: var(--or); box-shadow: 0 0 0 5px var(--or); }
.fleche { display: block; width: 46px; height: 46px; padding: 8px; border-radius: 50%; background: var(--accent); }
.fleche svg { width: 100%; height: 100%; display: block; }
.fleche.recule { transform: scaleX(-1); }
.de-piste .ronds.gros { max-width: none; flex-wrap: nowrap; gap: 6px; }
.de-piste .ronds.gros .rond-point { width: 22px; height: 22px; }
.piste { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; width: 100%; }
.case-piste { position: relative; min-width: 0; aspect-ratio: 1; padding: 0; border-radius: 16px; border: 3px solid var(--trait); background: var(--carte); box-shadow: var(--ombre); display: grid; place-items: center; }
.numero-case { font-size: 30px; font-weight: 800; color: var(--doux); font-variant-numeric: tabular-nums; }
.case-piste .pion { position: absolute; inset: 0; display: none; place-items: center; font-size: 40px; }
.case-piste.occupee { border-color: var(--accent); background: var(--pale); }
.case-piste.occupee .pion { display: grid; }
.case-piste.occupee .numero-case { position: absolute; top: 2px; left: 7px; font-size: 15px; }
.case-piste.juste { border-color: var(--juste); background: var(--juste-fond); box-shadow: 0 0 0 5px var(--juste); }
.case-piste.non { opacity: .45; animation: secouer .4s; }
/* v0.4 : les lettres, dans leurs polices d'école */
.lettre { font-family: "GS Ecole Script", var(--police); font-size: 62px; line-height: 1.15; font-weight: 400; color: var(--encre); display: inline-block; }
/* la cursive a de grandes boucles, vers le haut et vers le bas : on lui laisse une ligne très haute pour qu'elle ne déborde pas */
.lettre.g-cursive { font-family: "GS Ecole Cursive", "GS Ecole Script", cursive; font-size: 50px; line-height: 2.6; }
.carte-lettre, .choix-4 .carte.carte-lettre { min-height: 146px; padding-block: 0; }
.grande-lettre { cursor: default; }
.grande-lettre .lettre { font-size: min(27vw, 108px); }
.grande-lettre .lettre.g-cursive { font-size: min(15vw, 60px); }
.forme-lettre { display: grid; place-items: center; }
.forme-lettre .lettre { font-size: 58px; }
.forme-lettre .lettre.g-cursive { font-size: 40px; }
/* v0.3 : les formes à trouver */
.scene.grille-formes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-content: center; place-items: stretch; }
.forme { min-width: 0; aspect-ratio: 1; max-height: 132px; justify-self: center; width: 100%; max-width: 132px; padding: 4px; border-radius: 20px; border: 3px solid var(--trait); background: var(--carte); box-shadow: var(--ombre); }
.forme svg { width: 100%; height: 100%; display: block; }
.forme.trouve { border-color: var(--juste); background: var(--juste-fond); box-shadow: 0 0 0 4px var(--juste); }
.forme.non { border-color: var(--non); opacity: .4; animation: secouer .4s; }
/* les motifs */
.collier { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 4px; width: 100%; padding: 14px 6px; border-radius: 22px; background: rgba(255, 255, 255, .6); border: 2px dashed var(--trait); }
.perle { flex: 0 0 auto; width: 42px; height: 42px; display: grid; place-items: center; transition: transform .15s; }
.perle svg { width: 100%; height: 100%; display: block; }
.perle.montre { transform: scale(1.3) translateY(-4px); filter: drop-shadow(0 0 4px #d99a16); }
.perle.suite { border-radius: 50%; border: 3px dashed var(--accent); color: var(--accent); background: var(--pale); font-weight: 800; font-size: 24px; }
.collier-voiture .perle { width: 48px; }
.collier-voiture .perle.suite { border-radius: 12px; height: 38px; }
.carte .dessin { display: block; width: 76px; height: 76px; }
.carte .dessin svg { width: 100%; height: 100%; display: block; }
/* la balance */
.balances { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; }
.balance { flex: 1 1 0; min-width: 0; max-width: 300px; padding: 8px; border-radius: 22px; background: rgba(255, 255, 255, .6); border: 2px solid var(--trait); }
.balance svg { width: 100%; height: auto; display: block; }
.balance.montre { border-color: var(--or); box-shadow: 0 0 0 5px var(--or); }
/* les longueurs */
.choix-barre { grid-template-columns: 1fr; gap: 10px; margin-block: auto; }
.carte-barre { position: relative; min-height: 64px; padding: 10px 12px; align-items: stretch; font-size: 16px; }
.barre-zone { display: block; width: 100%; }
.longueur { display: block; height: 32px; border-radius: 6px; box-shadow: inset 0 -5px rgba(0, 0, 0, .18); background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, .28) 0 6px, transparent 6px 16px); }
.longueur-train { border-radius: 8px 16px 4px 4px; background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, .55) 0 14px, transparent 14px 22px); background-size: 100% 12px; background-repeat: no-repeat; background-position: 0 7px; border-bottom: 6px dotted #2b2f3a; height: 38px; }
.carte-barre.range { border-color: var(--juste); background: var(--juste-fond); }
.carte-barre.secoue { animation: secouer .4s; }

/* le coffre */
.scene-coffre { display: flex; align-items: stretch; gap: 10px; flex: 1 1 0; }
.cible {
  flex: 0 0 76px; align-self: center; height: 96px; border-radius: 18px; border: 3px solid var(--accent); background: var(--carte);
  display: grid; place-items: center; font-size: 60px; font-weight: 800; color: var(--accent);
}
.coffre {
  flex: 1 1 auto; min-width: 0; border-radius: 26px 26px 14px 14px; border: 5px solid var(--bois); border-top-width: 16px; background: var(--coffre);
  box-shadow: inset 0 0 0 3px var(--or); padding: 8px; display: flex; flex-wrap: wrap; align-content: flex-start; justify-content: center; gap: 4px;
}
.coffre.juste { background: var(--juste-fond); box-shadow: inset 0 0 0 3px var(--juste), 0 0 0 5px var(--juste); }
.coffre.secoue { animation: secouer .4s; }
.reserve {
  flex: 0 0 auto; min-height: 128px; border-radius: 22px; border: 2px dashed var(--trait); background: rgba(255, 255, 255, .6); padding: 8px;
  display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 4px;
}
.objet.libre { position: static; margin: 0; width: 52px; height: 52px; font-size: 36px; }
.validation { flex: 0 0 auto; display: grid; place-items: center; }
.valider { height: 76px; font-size: 36px; }

/* ----- Fin de séance et trésors ----- */
.ecran-fin { justify-content: flex-end; }
.tresor-gagne { text-align: center; font-family: var(--emoji); font-size: 96px; line-height: 1; animation: sauter .8s ease-out 2; position: relative; z-index: 1; }
.ecran-fin .gros-bouton { margin-bottom: 6%; }
.confettis span { position: absolute; top: -10%; font-family: var(--emoji); font-size: 34px; animation: tomber 2.6s linear infinite; }
/* v0.5 : la salle des trésors. Un décor d'intérieur et six étagères de six ; tout tient à l'écran, chaque trésor a sa place. */
.compte-tresors { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 22px; background: var(--carte); border: 2px solid var(--trait); border-radius: 22px; padding: 8px 16px; }
.salle {
  flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; border-radius: 22px; border: 4px solid var(--or);
  /* le mur du château : un papier peint à rayures douces */
  background: #f8edfc repeating-linear-gradient(90deg, rgba(180, 129, 224, .13) 0 16px, rgba(180, 129, 224, 0) 16px 32px);
}
.salle-haut { flex: 0 0 12%; min-height: 54px; }
.salle-haut svg { width: 100%; height: 100%; display: block; }
.etageres { position: relative; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding: 0 12px 10px; }
.etagere { position: relative; flex: 1 1 0; min-height: 0; display: grid; grid-template-columns: repeat(6, 1fr); align-items: end; padding: 0 4px 13px; }
/* la planche : dorée, avec un liseré de velours */
.etagere::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 11px; border-radius: 5px; background: #e2aa2c; background: linear-gradient(#fbe08a, #d99a16); box-shadow: 0 3px 0 #8a55c4, 0 6px 5px rgba(59, 36, 96, .18); }
.tresor { position: relative; z-index: 1; min-width: 0; height: 100%; max-height: 84px; border: 0; background: none; padding: 0; display: grid; place-items: end center; font-size: clamp(30px, 11vw, 46px); }
.tresor .emoji { line-height: 1.08; filter: drop-shadow(0 2px 1px rgba(0, 0, 0, .22)); }
.tresor.absent::before { content: ""; width: 58%; max-width: 32px; aspect-ratio: 1; margin-bottom: 5px; border-radius: 50%; border: 2px dashed rgba(59, 36, 96, .28); }
.tresor.touche .emoji { animation: sauter .5s; }
.tresor.absent.touche::before { animation: secouer .4s; }
.tresor.nouveau .emoji { animation: poser-tresor .9s cubic-bezier(.3, 1.4, .5, 1) both, sauter .8s ease-out .9s 2; }
.tresor.nouveau::after { content: ""; position: absolute; left: 12%; right: 12%; bottom: -3px; height: 6px; border-radius: 3px; background: var(--juste); }
@keyframes poser-tresor { from { transform: translateY(-130px) scale(1.7); opacity: 0; } to { transform: none; opacity: 1; } }
/* au garage : un mur d'atelier, des étagères en métal sur des montants percés */
[data-univers="vehicules"] .salle {
  border-color: #5b6b85;
  background: #edf1f7 repeating-linear-gradient(0deg, rgba(91, 107, 133, .14) 0 2px, rgba(91, 107, 133, 0) 2px 28px);
}
[data-univers="vehicules"] .etageres { padding: 0 20px 10px; }
[data-univers="vehicules"] .etageres::before, [data-univers="vehicules"] .etageres::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 10px; background: #7d8ca6 radial-gradient(circle, #edf1f7 2px, rgba(237, 241, 247, 0) 2.6px) 0 0 / 10px 16px;
}
[data-univers="vehicules"] .etageres::before { left: 8px; }
[data-univers="vehicules"] .etageres::after { right: 8px; }
[data-univers="vehicules"] .etagere::after { left: -6px; right: -6px; border-radius: 2px; background: #a9b5c8; background: linear-gradient(#dfe6f0, #8a97ad); box-shadow: 0 3px 0 #5b6b85, 0 6px 5px rgba(29, 43, 79, .2); }

/* ----- L'écran d'ouverture : le logo arrive dans un ciel bleu, entre les rayons du soleil et les nuages ----- */
.splash { position: fixed; inset: 0; z-index: 50; overflow: hidden; display: grid; place-items: center; background: #3f86ee; background: linear-gradient(180deg, #6fd3ff, #3f86ee); transition: opacity .45s; }
.splash.part { opacity: 0; pointer-events: none; }
.rayons {
  position: absolute; left: 50%; top: 50%; width: 170vmax; height: 170vmax; margin: -85vmax 0 0 -85vmax;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .2) 0deg 9deg, rgba(255, 255, 255, 0) 9deg 30deg);
  -webkit-mask-image: radial-gradient(circle, #000 12%, transparent 62%); mask-image: radial-gradient(circle, #000 12%, transparent 62%);
  animation: tourner 26s linear infinite;
}
.nuage { position: absolute; left: 0; width: 120px; height: 38px; border-radius: 40px; background: #fff; opacity: .92; animation: deriver 16s linear infinite; }
.nuage::before, .nuage::after { content: ""; position: absolute; background: #fff; border-radius: 50%; }
.nuage::before { width: 52px; height: 52px; left: 18px; top: -24px; }
.nuage::after { width: 40px; height: 40px; left: 60px; top: -16px; }
.nuage.n1 { top: 14%; animation-duration: 15s; animation-delay: -6s; }
.nuage.n2 { top: 30%; width: 90px; height: 30px; animation-duration: 21s; animation-delay: -13s; opacity: .8; }
.nuage.n3 { top: 76%; animation-duration: 18s; animation-delay: -2s; }
.splash-coeur { position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 0 16px; }
.splash-logo { width: min(68vw, 320px); height: auto; display: block; filter: drop-shadow(0 8px 6px rgba(20, 50, 120, .3)); animation: logo-arrive 2.3s cubic-bezier(.3, 1.3, .5, 1) both; }
.splash-nom { margin: 0; color: #fff; font-size: 1.45rem; font-weight: 800; text-align: center; text-shadow: 0 2px 0 rgba(20, 50, 120, .35); animation: nom-arrive 1s ease-out 1s both; }
@keyframes tourner { to { transform: rotate(360deg); } }
@keyframes deriver { from { transform: translateX(-140px); } to { transform: translateX(110vw); } }
@keyframes logo-arrive { 0% { transform: scale(.15) rotate(-14deg); opacity: 0; } 35% { transform: scale(1.14) rotate(3deg); opacity: 1; } 55% { transform: scale(.94) rotate(-1deg); } 75% { transform: scale(1.05); } 100% { transform: scale(1); } }
@keyframes nom-arrive { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ----- Espace parents (ici, on lit) ----- */
.ecran-porte, .ecran-parents, .ecran-aide-son { overflow-y: auto !important; -webkit-user-select: text; user-select: text; }
.feuille { background: var(--carte); border-radius: 18px; padding: 18px 16px 28px; display: flex; flex-direction: column; gap: 10px; }
.feuille h1 { font-size: 1.5rem; margin: 0; line-height: 1.2; }
.feuille h2 { font-size: 1.15rem; margin: 14px 0 0; line-height: 1.25; }
.feuille h3 { font-size: 1rem; margin: 8px 0 0; }
.feuille p, .feuille ul { margin: 0; }
.feuille ul { padding-left: 1.2em; display: flex; flex-direction: column; gap: 6px; }
.note { color: var(--doux); font-size: .92rem; }
.champ { display: flex; flex-direction: column; gap: 4px; }
.champ label { font-weight: 700; }
select { font: inherit; color: var(--encre); background: #faf6ff; border: 2px solid var(--trait); border-radius: 10px; padding: 10px; width: 100%; }
.tableau { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--trait); vertical-align: top; }
th small { display: block; font-weight: 400; color: var(--doux); }
.versions { display: flex; flex-direction: column; gap: 8px; }
.versions details { border: 2px solid var(--trait); border-radius: 12px; padding: 0 12px; background: #fff; }
.versions summary { cursor: pointer; font-weight: 700; padding: 12px 0; }
.versions details p { margin: 0 0 10px; }
.reponses { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.reponse, .secondaire, .danger { min-height: 52px; border-radius: 12px; border: 2px solid var(--trait); background: #faf6ff; font-weight: 700; padding: 8px 14px; }
.reponse { font-size: 1.4rem; }
.danger { border-color: #c0392b; color: #c0392b; background: #fff; }
.lien { border: 0; background: none; color: var(--accent-fonce); font-weight: 700; padding: 8px 0; text-decoration: underline; }
a { color: var(--accent-fonce); }

@keyframes battre { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
@keyframes sauter { 0% { transform: scale(1); } 40% { transform: scale(1.14); } 100% { transform: scale(1); } }
@keyframes secouer { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }
@keyframes tomber { 0% { transform: translateY(0) rotate(0); opacity: 1; } 100% { transform: translateY(115vh) rotate(260deg); opacity: .2; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
/* petits téléphones : on resserre */
@media (max-height: 640px) {
  .carte { min-height: 96px; font-size: 48px; }
  .carte-lettre, .choix-4 .carte.carte-lettre { min-height: 112px; }
  .lettre.g-cursive { font-size: 38px; }
  .forme-lettre .lettre.g-cursive { font-size: 34px; }
  .chiffre { font-size: 52px; }
  .porte { min-height: 78px; }
  [data-univers="vehicules"] .porte { min-height: 88px; }
  .joue { height: 58px; }
  .t-moyen .objet { width: 54px; height: 54px; margin: -27px 0 0 -27px; font-size: 38px; }
  .avec-cachette .objet { width: 42px; height: 42px; margin: -21px 0 0 -21px; font-size: 28px; }
  .avec-cachette.t-moyen .objet { width: 50px; height: 50px; margin: -25px 0 0 -25px; font-size: 34px; }
  .avec-cachette.t-grand .objet { width: 60px; height: 60px; margin: -30px 0 0 -30px; font-size: 42px; }
  .emoji.petit { font-size: 21px; }
  .plateau.t-moyen .emoji.petit { font-size: 28px; }
  .plateau.t-grand .emoji.petit { font-size: 32px; }
  .t-grand .objet { width: 66px; height: 66px; margin: -33px 0 0 -33px; font-size: 46px; }
  .part { min-height: 150px; }
  .ami-part { width: 64px; height: 64px; font-size: 42px; }
  .scene-piste { gap: 14px; }
  .portes { row-gap: 26px; }
  .gros-bouton { height: 76px; }
}
/* v0.9 : ces dessins-là ne sont pas carrés (doit venir après « .carte .dessin ») */
.carte.carte-rythme .dessin { width: 100%; height: auto; }
.carte.carte-dessin .dessin { width: auto; height: auto; }
/* v1.0 : les doigts, les groupements, « de plus », les syllabes magiques */
.deux-mains { display: flex; justify-content: center; gap: 4%; width: 100%; }
.main-dessin { position: relative; display: block; width: min(42vw, 190px); border-radius: 18px; }
.main-dessin svg { width: 100%; height: auto; display: block; }
.main-dessin.montre { box-shadow: 0 0 0 5px var(--or); }
.main-dessin.cachee svg { opacity: 0; }
.main-dessin.cachee { background: var(--pale); border: 3px dashed var(--accent); }
.main-dessin.cachee::after { content: "?"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 64px; font-weight: 800; color: var(--accent); }
.doigt.allume { fill: var(--or); stroke: #d99a16; }
.groupes .places { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; max-width: 64px; }
.groupes .place-vide { width: 26px; height: 26px; font-size: 18px; line-height: 20px; text-align: center; }
.manque-petit.groupes .place-vide { width: 32px; height: 32px; font-size: 22px; line-height: 26px; }
.groupes:not(.aligne) .places { display: none; }
.groupes:not(.aligne) .duo { display: flex; }
.groupes:not(.aligne)::after { display: none; }
.place-vide.rempli { border-style: solid; border-color: var(--juste); background: var(--juste-fond); }
.de-plus { width: 100%; display: flex; flex-direction: column; gap: 14px; padding: 14px; border-radius: 22px; background: rgba(255, 255, 255, .6); border: 2px dashed var(--trait); }
.ligne-plus { display: flex; align-items: center; gap: 10px; min-height: 56px; border-radius: 16px; padding: 4px 6px; }
.ligne-plus.montre { box-shadow: 0 0 0 4px var(--or); }
.ligne-plus .qui { font-size: 44px; flex: 0 0 auto; }
.rang-plus { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; }
.objet-plus { font-size: 30px; }
.objet-plus.ajoute { background: var(--juste-fond); border-radius: 50%; box-shadow: 0 0 0 2px var(--juste); }
.objet-plus.barre { opacity: .3; filter: grayscale(1); }
.mystere { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; border: 3px dashed var(--accent); color: var(--accent); font-size: 30px; font-weight: 800; background: var(--pale); }
.bulle { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; font-size: 34px; }
.deux-mots { display: flex; justify-content: center; gap: 6%; width: 100%; }
.grand-mot.petit-mot { width: min(40vw, 160px); font-size: min(22vw, 88px); }
.grand-mot.petit-mot.montre { outline: 6px solid var(--or); outline-offset: 3px; }
/* v1.0.3 : le test des sons, dans l'espace parents */
.test-sons { margin: 14px 0; padding: 10px 14px; border-radius: 14px; background: var(--pale); border: 2px solid var(--trait); }
.test-sons > summary { font-weight: 800; cursor: pointer; }
.correctifs { list-style: none; padding: 0; margin: 6px 0 12px; }
.correctif { padding: 8px 0; border-bottom: 1px solid var(--trait); }
.boutons-test { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.petit-test { padding: 6px 12px; font-size: 15px; }
.petit-test.maintenant { font-weight: 800; }
.grille-syllabes { display: flex; flex-wrap: wrap; gap: 6px; }
.syllabe-test { min-width: 48px; padding: 8px 10px; border-radius: 10px; border: 2px solid var(--trait); background: var(--carte); font-size: 17px; }
/* v1.1 : les solides, les écrits */
.carte.carte-solide .dessin { width: min(26vw, 112px); height: min(26vw, 112px); }
.papier { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 62px; padding: 6px 6px 8px; border-radius: 4px; background: #fff; border: 2px solid #c9bfd6; box-shadow: 2px 2px 0 #e6dcf2; font-size: 30px; }
.papier .lignes { display: block; width: 100%; height: 20px; background: repeating-linear-gradient(180deg, #b9aecb 0 2px, transparent 2px 6px); }
/* v1.2 : le rang. La file est verticale (du drapeau du haut vers celui du bas) : sur un téléphone tenu debout, huit cases
   côte à côte seraient trop petites pour un doigt d'enfant. */
.file-rang { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.file-rang .file { flex: 1 1 0; min-height: 0; width: min(46vw, 170px); display: flex; flex-direction: column; gap: 5px; }
.file-rang .carte { flex: 1 1 0; min-height: 0; max-height: 84px; padding: 0; border-radius: 14px; font-size: clamp(26px, 5vh, 44px); flex-direction: row; }
.drapeau { flex: 0 0 auto; font-size: clamp(26px, 4.5vh, 38px); line-height: 1; border-radius: 10px; padding: 2px 6px; }
.drapeau.montre { box-shadow: 0 0 0 4px var(--or); }
/* v1.3 : les mois (l'année en deux rangées de six), les motifs cousins */
.annee { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px 5px; width: 100%; max-width: 360px; margin-inline: auto; }
.mois-case { display: grid; place-items: center; min-width: 0; aspect-ratio: 5 / 4; border-radius: 10px; color: #fff; font-weight: 800; font-size: clamp(13px, 4vw, 18px); border: 3px solid rgba(0, 0, 0, .14); transition: transform .15s; }
.annee .mois-case.ici { transform: scale(1.12); box-shadow: 0 0 0 3px var(--encre); }
.annee .mois-case.montre { transform: scale(1.18); box-shadow: 0 0 0 4px var(--or); }
.annee.grise .mois-case:not(.montre) { background-color: #b9aecb !important; }
.carte-mois { gap: 8px; }
.carte-mois .mois-case { width: 64px; aspect-ratio: 5 / 4; font-size: 19px; }
.collier.complet { gap: 6px 3px; }
.collier.complet .perle { width: min(9vw, 36px); height: min(9vw, 36px); }
.collier-voiture.complet .perle { width: min(10vw, 40px); }
.choix-motif { grid-template-columns: 1fr; gap: 10px; margin-block: auto; }
.carte.carte-motif { min-height: 72px; padding: 8px 6px; }
.mini-motif { display: flex; flex-wrap: nowrap; justify-content: center; align-items: center; gap: 3px; width: 100%; }
.mini-motif .perle { width: min(9vw, 36px); height: min(9vw, 36px); }
.mini-motif.mini-voiture .perle { width: min(9.6vw, 40px); }
.mini-motif .emoji { font-size: min(8vw, 32px); line-height: 1; }
/* v1.3 : le téléphone tenu à l'horizontale. Seulement sur un téléphone (écran tactile, peu haut) : sur une tablette ou un
   ordinateur, l'appli tient dans sa colonne. Le jeu reste en place derrière. */
.paysage { display: none; }
@media (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
  .paysage { display: flex; position: fixed; inset: 0; z-index: 1000; flex-direction: row; align-items: center; justify-content: center; gap: 5vw; padding: 16px max(24px, env(safe-area-inset-right)) 16px max(24px, env(safe-area-inset-left)); background: linear-gradient(180deg, var(--fond-haut), var(--fond-bas)); color: var(--encre); text-align: left; }
  .paysage-tel { flex: 0 0 auto; width: min(52vh, 220px); height: min(52vh, 220px); }
  .paysage-tel svg { width: 100%; height: 100%; display: block; overflow: visible; }
  .paysage-corps { transform-origin: 60px 61px; transform-box: view-box; animation: tourner 2.6s ease-in-out infinite; }
  .paysage-fleche { animation: clignote 2.6s ease-in-out infinite; }
  .paysage-texte { max-width: 22em; margin: 0; text-wrap: balance; font-size: clamp(18px, 5.4vh, 26px); font-weight: 800; line-height: 1.35; }
  .en-paysage body { overflow: hidden; }
}
@keyframes tourner { 0%, 18% { transform: rotate(-90deg); } 55%, 100% { transform: rotate(0deg); } }
@keyframes clignote { 0%, 18% { opacity: 1; } 55%, 100% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .paysage-corps, .paysage-fleche { animation: none; } }
/* v1.4 : le globe */
.grand-globe { display: grid; place-items: center; padding: 6px; }
.grand-globe svg { width: 88%; height: 88%; display: block; }
/* v1.5 : les bacs du tri */
.carte.carte-bac .dessin { width: min(24vw, 96px); height: min(24vw, 96px); }
/* v1.6 : les émojis embarqués (Noto) : une image de la taille d'une lettre, à la place de l'émoji du téléphone */
img.emo { display: inline-block; width: 1em; height: 1em; vertical-align: -0.125em; border: 0; -webkit-user-drag: none; user-select: none; pointer-events: none; }
.emoji > img.emo:only-child { display: block; vertical-align: top; }
/* v1.7 : les jeux à glisser. Le plateau est carré ; les pièces du bac sont un peu plus petites que leur place, et reprennent
   leur taille quand on les tient. */
.scene-glisser { flex: 0 0 auto; display: grid; place-items: center; }
.plateau-glisser { position: relative; width: min(84vw, 44vh, 360px); aspect-ratio: 1; max-width: 100%; border-radius: 18px; background: var(--carte); border: 3px solid var(--trait); box-shadow: var(--ombre); overflow: visible; }
.plateau-glisser .fantome { position: absolute; inset: 0; border-radius: 15px; background-size: 100% 100%; filter: grayscale(.35); pointer-events: none; }
.place-glisser { position: absolute; box-sizing: border-box; }
.plateau-glisser:not(.bloc) .place-glisser:not(.place-forme) { outline: 2px dashed var(--trait); outline-offset: -2px; }
.place-forme svg { width: 100%; height: 100%; display: block; overflow: visible; }
.plateau-glisser.attend .place-glisser:not(.prise) { cursor: pointer; }
.plateau-glisser.attend:not(.bloc) .place-glisser:not(.prise) { outline: 3px dashed var(--accent); outline-offset: -3px; }
.plateau-glisser.fini { box-shadow: 0 0 0 5px var(--juste); }
.bac-pieces { flex: 1 1 auto; min-height: 0; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 12px; padding: 6px 0; }
.piece-glisser { position: relative; flex: 0 0 auto; box-sizing: border-box; border-radius: 4px; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; transition: transform .25s ease; background-repeat: no-repeat; }
.piece-glisser svg { width: 100%; height: 100%; display: block; overflow: visible; pointer-events: none; }
.piece-glisser[style*="background-image"] { box-shadow: 0 2px 0 rgba(40, 20, 70, .25), 0 0 0 2px #fff; }
.piece-glisser.tenue { transition: none; z-index: 50; cursor: grabbing; filter: drop-shadow(0 8px 10px rgba(40, 20, 70, .35)); }
.piece-glisser.choisie { box-shadow: 0 0 0 4px var(--or); transform: translateY(-4px); }
.piece-glisser.aidee { box-shadow: 0 0 0 5px var(--or); }
.piece-glisser.posee { position: absolute; margin: 0; border-radius: 0; cursor: default; box-shadow: none; z-index: 1; }
.piece-glisser.secoue { animation: secouer .4s; }
/* la balance à équilibrer : un fléau qui penche, deux plateaux qui restent horizontaux */
.scene-balance { flex: 0 0 auto; display: grid; place-items: center; }
.balance-eq { position: relative; width: min(90vw, 360px); height: 230px; max-width: 100%; }
.balance-eq .pied { position: absolute; left: 50%; bottom: 0; width: 70px; height: 150px; transform: translateX(-50%); background: linear-gradient(var(--bois), var(--bois)) center top / 12px 100% no-repeat; }
.balance-eq .pied::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 14px; border-radius: 8px; background: var(--bois); }
.balance-eq .fleau { position: absolute; left: 50%; top: 74px; width: 80%; height: 10px; border-radius: 5px; background: var(--bois); transform-origin: 50% 50%; transform: translateX(-50%); transition: transform .45s ease; }
.balance-eq .fleau::after { content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; border-radius: 50%; background: var(--or); transform: translate(-50%, -50%); }
.plat { position: absolute; top: 84px; width: 40%; min-height: 70px; display: flex; flex-wrap: wrap-reverse; align-items: flex-start; justify-content: center; align-content: flex-start; gap: 3px; padding: 4px 4px 12px; border-bottom: 8px solid var(--bois); border-radius: 0 0 40% 40% / 0 0 22px 22px; transition: transform .45s ease; }
.plat-g { left: 0; } .plat-d { right: 0; }
.objet-pese { font-size: 54px; }
.balance-eq.droite .fleau::after { background: var(--juste); }
.balance-eq.juste .plat { border-bottom-color: var(--juste); }
.balance-eq.secoue { animation: secouer .4s; }
.reserve-cubes { gap: 8px; }
.cube { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 6px; background: var(--cinq); box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .2); touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
.cube.gros { width: 68px; background: var(--quart); background-image: linear-gradient(90deg, transparent calc(50% - 1px), rgba(0, 0, 0, .25) calc(50% - 1px), rgba(0, 0, 0, .25) calc(50% + 1px), transparent calc(50% + 1px)); }
.cube.tenue { position: relative; z-index: 50; cursor: grabbing; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .3)); }
.plat .cube { width: 26px; height: 26px; } .plat .cube.gros { width: 52px; }
/* v1.8 : les jeux à tracer. Le chemin est gris clair, avec des pointillés qui avancent dans le sens du tracé ; le point vert
   marque le départ ; l'encre de l'enfant est de la couleur de l'univers. Pour les lettres, les trois lignes du cahier. */
.scene-tracer { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.signe-modele { font-size: 34px; font-weight: 900; line-height: 1; color: var(--doux); }
.signe-modele.cursive { font-family: "GS Ecole Cursive", "GS Ecole Script", cursive; font-weight: 400; font-size: 40px; line-height: 1.6; padding-bottom: 14px; }
.plateau-tracer { width: min(88vw, 52vh, 380px); aspect-ratio: 1; max-width: 100%; border-radius: 18px; background: var(--carte); border: 3px solid var(--trait); box-shadow: var(--ombre); }
.plateau-tracer.fini { box-shadow: 0 0 0 5px var(--juste); }
.plateau-tracer.secoue { animation: secouer .4s; }
.tracer-svg { width: 100%; height: 100%; display: block; touch-action: none; user-select: none; -webkit-user-select: none; overflow: visible; }
.tracer-svg .ligne-ecriture { stroke: #c9daf2; stroke-width: .6; }
.tracer-svg .ligne-ecriture.milieu { stroke-dasharray: 2 2; }
.tracer-svg .ligne-ecriture.base { stroke: #8fb3e3; stroke-width: .9; }
.tracer-svg .modele { fill: none; stroke: #e2d8ee; stroke-linecap: round; stroke-linejoin: round; }
.tracer-svg circle.modele { fill: #e2d8ee; stroke: none; }
.tracer-svg .fourmis { fill: none; stroke: #b9a7d6; stroke-width: 1.4; stroke-linecap: round; stroke-dasharray: .1 4; animation: fourmis 1s linear infinite; }
@keyframes fourmis { to { stroke-dashoffset: -4.1; } }
.tracer-svg .encre { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.tracer-svg .encre-point { fill: var(--accent); }
.tracer-svg .encre-demo { fill: none; stroke: var(--or); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.tracer-svg circle.encre-demo { fill: var(--or); stroke: none; }
.tracer-svg .main-demo { fill: var(--quart); stroke: #fff; stroke-width: 1.2; }
.tracer-svg .depart circle { fill: #2faa6a; stroke: #fff; stroke-width: 1.4; }
.tracer-svg .depart text { fill: #fff; font: 800 6px var(--police); }
.tracer-svg .depart.appelle circle { animation: appelle .5s 2; transform-box: fill-box; transform-origin: center; }
@keyframes appelle { 50% { transform: scale(1.6); } }
@media (prefers-reduced-motion: reduce) { .tracer-svg .fourmis { animation: none; } }
/* v1.9 : la salle de jeux. Le bouton du bandeau (une petite borne et le nombre de jetons), la salle (des néons, une rangée de
   bornes), le jeton qui tombe dans la fente, et les trois jeux. */
.borne-bouton { overflow: visible; }
.mini-borne { display: block; width: 26px; height: 44px; }
.mini-borne svg { width: 100%; height: 100%; display: block; }
.pastille.jetons { background: var(--or); color: #5a3d00; }
.jeton { display: inline-block; width: 1.2em; height: 1.2em; vertical-align: -0.25em; }
.jeton svg { width: 100%; height: 100%; display: block; }
.jeton-gagne { display: flex; align-items: center; gap: 6px; font-weight: 900; font-size: 30px; color: #b07a00; animation: poser-tresor .9s .6s cubic-bezier(.3, 1.4, .5, 1) both; }
.jeton-gagne .jeton { width: 46px; height: 46px; }
.compte-jetons { display: flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; background: var(--carte); border: 2px solid var(--trait); font-weight: 900; font-size: 24px; color: var(--encre); }
.compte-jetons .jeton { width: 30px; height: 30px; }
.titre-salle { font-size: 34px; }
.ecran-bonus { background: linear-gradient(180deg, #2a1d4a, #46306f 60%, #5a3f86); }
.ecran-bonus .barre .rond { background: #fff; }
.salle-jeux { position: relative; flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center; min-height: 0; }
.neons { position: absolute; inset: 4% 4% auto; height: 14px; border-radius: 8px; background: repeating-linear-gradient(90deg, #ff6fb5 0 18px, #ffd34d 18px 36px, #5ad1ff 36px 54px); filter: drop-shadow(0 0 8px #ff6fb5); opacity: .85; }
.rangee-bornes { display: flex; justify-content: center; align-items: flex-end; gap: 3%; width: 100%; padding: 0 1%; }
.borne-jeu { position: relative; flex: 0 0 auto; width: min(30%, 33vh, 150px); aspect-ratio: 100 / 170; max-width: 100%; border: 0; padding: 0; background: none; cursor: pointer; transition: transform .15s; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .45)); }
.borne-jeu:active { transform: scale(.96); }
.borne-jeu.montre { transform: translateY(-8px) scale(1.04); filter: drop-shadow(0 0 14px #ffd34d); }
.borne-jeu.secoue { animation: secouer .4s; }
.borne-dessin, .borne-dessin svg { display: block; width: 100%; height: 100%; }
.borne-ecran { position: absolute; left: 18%; top: 18.8%; width: 64%; height: 31.8%; display: grid; place-items: center; font-size: min(10vw, 44px); border-radius: 6px; background: radial-gradient(circle, rgba(120, 220, 255, .25), transparent 70%); animation: ecran-brille 2.4s ease-in-out infinite; }
@keyframes ecran-brille { 50% { background-color: rgba(120, 220, 255, .12); } }
.borne-jeu .fente { animation: fente 1.6s ease-in-out infinite; }
@keyframes fente { 50% { opacity: .35; } }
.jeton-qui-tombe { position: absolute; left: 40%; top: 58%; width: 20%; aspect-ratio: 1; opacity: 0; pointer-events: none; }
.jeton-qui-tombe svg { width: 100%; height: 100%; display: block; }
.borne-jeu.insere .jeton-qui-tombe { animation: jeton-tombe .8s ease-in forwards; }
@keyframes jeton-tombe { 0% { opacity: 1; transform: translateY(-140%) scale(1.3); } 70% { opacity: 1; transform: translateY(20%) scale(.6) scaleX(.3); } 100% { opacity: 0; transform: translateY(30%) scale(.4) scaleX(.2); } }
.zone-bonus { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.fin-bonus { display: grid; place-items: center; animation: poser-tresor .6s cubic-bezier(.3, 1.4, .5, 1) both; }
/* le memory */
.grille-memo { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: min(88vw, 340px, 52vh); max-width: 100%; }
.carte-memo { position: relative; aspect-ratio: 1; border: 0; padding: 0; background: none; perspective: 600px; cursor: pointer; }
.carte-memo .dos, .carte-memo .avant { position: absolute; inset: 0; border-radius: 16px; display: grid; place-items: center; backface-visibility: hidden; transition: transform .35s; box-shadow: var(--ombre); }
.carte-memo .dos { background: repeating-linear-gradient(45deg, var(--accent) 0 10px, var(--accent-fonce) 10px 20px); border: 3px solid #fff; }
.carte-memo .avant { background: var(--carte); border: 3px solid var(--trait); transform: rotateY(180deg); font-size: min(11vw, 46px); }
.carte-memo.retournee .dos { transform: rotateY(180deg); }
.carte-memo.retournee .avant { transform: rotateY(0); }
.carte-memo.trouvee .avant { border-color: var(--juste); background: var(--juste-fond); }
/* le coloriage */
.cadre-coloriage { width: min(88vw, 360px, 50vh); aspect-ratio: 1; max-width: 100%; border-radius: 18px; background: #fff; border: 3px solid var(--trait); box-shadow: var(--ombre); padding: 6px; }
.dessin-coloriage { width: 100%; height: 100%; display: block; }
.dessin-coloriage .zone { stroke: #3b2460; stroke-width: 2.4; stroke-linejoin: round; cursor: pointer; transition: fill .15s; }
.dessin-coloriage .trait { fill: none; stroke: #3b2460; stroke-width: 2.4; stroke-linecap: round; pointer-events: none; }
.palette { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; width: min(88vw, 340px); }
.pot { aspect-ratio: 1; border-radius: 50%; border: 3px solid rgba(0, 0, 0, .15); box-shadow: var(--ombre); cursor: pointer; padding: 0; }
.pot.choisi { box-shadow: 0 0 0 4px var(--carte), 0 0 0 7px var(--encre); transform: scale(1.08); }
.zone-coloriage.expose .palette { display: none; }
/* la course */
.zone-course { gap: 10px; }
.cadre-circuit { position: relative; height: min(58vh, 520px); aspect-ratio: 300 / 420; max-width: 92vw; }
.circuit-svg { width: 100%; height: 100%; display: block; border-radius: 18px; box-shadow: var(--ombre); }
.circuit-svg .revient { animation: clignote-voiture .3s 3; }
@keyframes clignote-voiture { 50% { opacity: .2; } }
.decompte { position: absolute; inset: 0; display: grid; place-items: center; font-size: 64px; font-weight: 900; color: #fff; text-shadow: 0 3px 0 #3b2460, 0 0 14px rgba(0, 0, 0, .4); pointer-events: none; }
.decompte.saute { animation: poser-tresor .5s cubic-bezier(.3, 1.4, .5, 1); }
.pedale { flex: 0 0 auto; width: 104px; height: 104px; border-radius: 50%; border: 6px solid #fff; background: radial-gradient(circle at 40% 35%, #6be39b, var(--juste) 60%, #1f7a4b); box-shadow: 0 6px 0 #1f7a4b, var(--ombre); display: grid; place-items: center; touch-action: none; user-select: none; -webkit-user-select: none; cursor: pointer; }
.pedale.appuye { transform: translateY(5px); box-shadow: 0 1px 0 #1f7a4b; }
.pedale:disabled { opacity: .5; }
.fleche-pedale { width: 0; height: 0; border-left: 22px solid transparent; border-right: 22px solid transparent; border-bottom: 34px solid #fff; transform: translateY(-4px); }
.tours { display: flex; gap: 6px; }
.tour { width: 26px; height: 26px; border-radius: 50%; background: rgba(255, 255, 255, .7); border: 2px solid var(--trait); }
.tour.fait { background: repeating-conic-gradient(#222 0 25%, #fff 0 50%) 0 0 / 10px 10px; border-color: #222; }
@media (prefers-reduced-motion: reduce) { .borne-ecran, .borne-jeu .fente { animation: none; } }
/* v2.1 : le numéro de version sous l'engrenage (pour les parents), et le memory éducatif dans les mondes */
.coin-parents { position: relative; display: block; flex: 0 0 auto; }
.version-mini { position: absolute; left: 50%; top: calc(100% + 2px); transform: translateX(-50%); font-size: 11px; font-weight: 700; color: var(--doux); opacity: .75; white-space: nowrap; pointer-events: none; }
.scene-memo { flex: 1 1 auto; display: grid; place-items: center; }
.grille-memo-6 { grid-template-columns: repeat(3, 1fr); width: min(88vw, 340px, 46vh); }
.grille-memo-8 { grid-template-columns: repeat(4, 1fr); width: min(92vw, 380px, 48vh); gap: 8px; }
.grille-memo-12 { grid-template-columns: repeat(3, 1fr); width: min(86vw, 330px, 52vh); }
.grille-memo.fini .avant { border-color: var(--juste); }
.memo-chiffre { font-size: min(13vw, 54px); font-weight: 900; color: var(--accent-fonce); line-height: 1; }
.grille-memo-8 .memo-chiffre { font-size: min(11vw, 44px); }
.memo-quantite { display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: 1px; width: 88%; height: 88%; font-size: min(5.6vw, 22px); line-height: 1; }
.memo-quantite.q1, .memo-quantite.q2 { font-size: min(9vw, 36px); }
.memo-quantite.q3, .memo-quantite.q4 { font-size: min(7.4vw, 30px); }
.memo-lettre .lettre { font-size: min(11vw, 44px); line-height: 1.2; }
.memo-lettre .lettre.g-cursive { font-size: min(8vw, 32px); line-height: 1.5; }
.carte-memo-mot .avant, .carte-memo-image .avant { font-size: min(11vw, 46px); }
.grille-memo.grille-salle-16 { grid-template-columns: repeat(4, 1fr); width: min(90vw, 360px, 50vh); gap: 8px; }
.grille-salle-16 .carte-memo .avant { font-size: min(9vw, 36px); }
/* v2.1.1 : l'état de la voix, dans l'espace parents */
.diag-voix { margin: 14px 0; padding: 10px 14px; border-radius: 14px; background: var(--pale); border: 2px solid var(--trait); }
.diag-voix > summary { font-weight: 800; cursor: pointer; }
/* v2.2 : la course refaite (la jauge de vitesse aux couleurs de la route, le dérapage) et le mode test de la salle */
.cadre-circuit { height: min(52vh, 480px); }
.jauge { position: relative; flex: 0 0 auto; width: min(80vw, 320px); height: 26px; border-radius: 13px; background: #2b2240; border: 3px solid #fff; box-shadow: var(--ombre); overflow: hidden; }
.jauge .seg { position: absolute; top: 0; bottom: 0; transition: opacity .2s, filter .2s; }
.jauge .seg.interdit { opacity: .28; filter: grayscale(.6); background-image: repeating-linear-gradient(135deg, rgba(0, 0, 0, .35) 0 5px, transparent 5px 10px) !important; }
.jauge .aiguille { position: absolute; top: -3px; bottom: -3px; width: 8px; margin-left: -4px; border-radius: 4px; background: #fff; box-shadow: 0 0 0 2px #2b2240; transition: left .05s linear; }
.jauge.trop .aiguille { background: #ffe1e1; animation: secouer .25s infinite; }
.circuit-svg .ma-voiture.glisse { filter: drop-shadow(0 0 3px rgba(255, 255, 255, .9)); }
.bandeau-essai { align-self: center; padding: 6px 14px; border-radius: 999px; background: #ffd34d; color: #3b2460; font-weight: 800; font-size: 14px; }
@media (prefers-reduced-motion: reduce) { .jauge.trop .aiguille { animation: none; } }
/* v2.3 : la salle d'arcade vivante (neuf bornes en perspective, l'avatar de dos, les chemins fléchés, la course et le zoom).
   Les positions et tailles sont posées en pixels par bonus.js d'après la taille de la scène. */
.salle-jeux { position: relative; display: block; flex: 1 1 auto; min-height: 0; overflow: hidden; border-radius: 18px; }
.scene-arcade { position: absolute; inset: 0; }
.scene-arcade.zoom { transition: transform .95s cubic-bezier(.55, 0, .85, .45); }
.decor-arcade { position: absolute; inset: 0; z-index: 0; }
.decor-arcade svg { width: 100%; height: 100%; display: block; }
.scene-arcade .neons { inset: 3% 6% auto; height: 10px; z-index: 1; }
.chemins-salle { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; overflow: visible; }
.chemin { fill: none; stroke-width: 6; stroke-linecap: round; stroke-dasharray: 1 13; opacity: .6; }
.fleche-chemin { fill: none; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; animation: fleche-chemin 1.2s ease-in-out infinite; }
@keyframes fleche-chemin { 0%, 100% { opacity: .3; } 40% { opacity: 1; } }
.montre-course .chemin-course, .montre-memory .chemin-memory, .montre-coloriage .chemin-coloriage { stroke-width: 9; opacity: 1; }
.montre-course .fleche-course, .montre-memory .fleche-memory, .montre-coloriage .fleche-coloriage { stroke-width: 5; }
.en-route .chemin, .en-route .fleche-chemin { opacity: .25; animation: none; }
.scene-arcade .borne-jeu { position: absolute; width: auto; max-width: none; aspect-ratio: auto; flex: none; }
.scene-arcade .borne-jeu::before { content: ''; position: absolute; inset: -8px -6px; }
.scene-arcade .borne-ecran { font-size: var(--ecran, 28px); }
.borne-jeu.jouable { animation: halo-borne 1.6s ease-in-out infinite; }
@keyframes halo-borne { 0%, 100% { filter: drop-shadow(0 0 4px #3ddc84) drop-shadow(0 6px 8px rgba(0, 0, 0, .45)); } 50% { filter: drop-shadow(0 0 14px #3ddc84) drop-shadow(0 0 4px #b8ffd6); } }
.borne-jeu.jouable.montre { animation: none; filter: drop-shadow(0 0 16px #ffd34d); }
.borne-dort { cursor: default; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .4)); }
.borne-dort .borne-dessin { filter: grayscale(1) brightness(.55); }
.borne-dort .housse { position: absolute; inset: -3% -5% 7%; pointer-events: none; }
.borne-dort .housse svg { width: 100%; height: 100%; display: block; overflow: visible; }
.borne-dort .zzz { animation: zzz 3s ease-in-out infinite; }
@keyframes zzz { 50% { opacity: .35; transform: translateY(-3px); } }
.avatar-salle { position: absolute; pointer-events: none; }
.avatar-corps { width: 100%; height: 100%; transform-origin: 50% 100%; transform: rotate(var(--penche, 0deg)); animation: respire 2.4s ease-in-out infinite; }
.avatar-corps svg { width: 100%; height: 100%; display: block; overflow: visible; }
@keyframes respire { 50% { transform: rotate(var(--penche, 0deg)) scaleY(1.03); } }
.avatar-salle.court .avatar-corps { animation: trot .26s ease-in-out infinite alternate; }
@keyframes trot { from { transform: rotate(var(--penche, 0deg)) translateY(0); } to { transform: rotate(calc(var(--penche, 0deg) * -0.3)) translateY(-9%); } }
.avatar-salle.non .avatar-corps { animation: secouer .4s 2; }
.voile-zoom { position: absolute; inset: 0; z-index: 20; background: #fff; opacity: 0; pointer-events: none; transition: opacity .45s .5s; }
.voile-zoom.allume { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .borne-jeu.jouable { animation: none; filter: drop-shadow(0 0 10px #3ddc84); }
  .fleche-chemin, .borne-dort .zzz, .avatar-corps { animation: none; }
}

.scene-arcade.zoom .avatar-salle { opacity: 0; transition: opacity .35s .15s; }
/* ----- v2.4 : la peau de l'univers Dinosaures (vert tendre, terre, pierre) ----- */
[data-univers="dinosaures"] {
  --fond-haut: #e3f5d3;
  --fond-bas: #fff3d9;
  --encre: #2b3a1d;
  --doux: #5d6d47;
  --trait: #cde3b4;
  --accent: #4f9a2f;
  --accent-fonce: #3b7a21;
  --pale: #eef8e4;
  --second: #f08a24;
  --second-fonce: #c66a10;
  --tiers: #2f8fc4;
  --tiers-fonce: #226b94;
  --quart: #d9534a;
  --quart-fonce: #a93a33;
  --cinq: #8a5cd6;
  --cinq-fonce: #6a3fb3;
  --six: #1fa3a3;
  --six-fonce: #157a7a;
  --bois: #8a6a3b;
  --coffre: #fdf3dc;
  --ombre: 0 3px 0 rgba(43, 58, 29, .14);
}
/* les boutons des mondes : des œufs tachetés, surmontés d'une petite crête */
[data-univers="dinosaures"] .portes { padding-top: 18px; row-gap: 28px; }
[data-univers="dinosaures"] .porte {
  border-radius: 50% 50% 46% 46% / 60% 60% 40% 40%; border: 5px solid #8a6a3b;
  background: radial-gradient(circle at 22% 70%, rgba(233, 185, 106, .45) 0 6px, transparent 7px), radial-gradient(circle at 80% 30%, rgba(233, 185, 106, .4) 0 5px, transparent 6px), radial-gradient(ellipse at 50% 40%, #fffdf6 45%, #fbefd2) #fff8e6;
  box-shadow: inset 0 0 0 5px var(--c), 0 6px 0 #6b4f2a;
}
[data-univers="dinosaures"] .porte:active { transform: translateY(4px); box-shadow: inset 0 0 0 5px var(--c), 0 2px 0 #6b4f2a; }
/* la cachette : l'entrée d'une grotte ; le partage : un nid */
[data-univers="dinosaures"] .cachette { border-radius: 50% 50% 12px 12px / 64% 64% 12px 12px; border: 6px solid #8a7560; border-top-width: 6px; background: #3a2e24; box-shadow: inset 0 -10px 0 #2a2119; }
[data-univers="dinosaures"] .cachette::after { display: none; }
[data-univers="dinosaures"] .cachette.ouverte { background: var(--coffre); }
[data-univers="dinosaures"] .coffre { border-radius: 14px 14px 40px 40px; border-top: 16px solid #a0723f; }
/* la grotte aux trésors : un mur de pierre, des étagères taillées dans la roche */
[data-univers="dinosaures"] .salle {
  border-color: #8a7560;
  background: radial-gradient(circle at 20% 30%, rgba(138, 117, 96, .14) 0 18px, transparent 19px) 0 0 / 90px 70px, radial-gradient(circle at 70% 80%, rgba(138, 117, 96, .12) 0 12px, transparent 13px) 0 0 / 70px 60px #efe7d9;
}
[data-univers="dinosaures"] .etagere::after { border-radius: 6px 6px 3px 3px; height: 12px; background: #b5a389; background: linear-gradient(#d6c8b1, #8f7d64); box-shadow: 0 3px 0 #6e5d48, 0 6px 5px rgba(43, 58, 29, .2); }
/* le serpent des longueurs (des écailles et une tête qui regarde à droite) et la famille qui passe */
.longueur-serpent { position: relative; height: 26px; border-radius: 13px 16px 16px 13px; background-image: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, .35) 0 3px, transparent 3.5px); background-size: 14px 13px; box-shadow: inset 0 -5px rgba(0, 0, 0, .18); }
.longueur-serpent::after { content: ""; position: absolute; right: 6px; top: 6px; width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: inset -2px 0 0 #24301e; }
.passant-dinosaures { width: 190px; left: -200px; bottom: 2%; animation-name: traverser-dino; animation-duration: 17s; }
.passant-dinosaures.retour { animation-name: revenir-dino; }
@keyframes traverser-dino { from { left: -200px; } to { left: 100%; } }
@keyframes revenir-dino { from { left: 100%; } to { left: -200px; } }
.passant-dinosaures .bebe { transform-box: fill-box; transform-origin: 50% 100%; animation: trottine .32s ease-in-out infinite alternate; }
.passant-dinosaures .p2 .bebe { animation-delay: -.12s; }
.passant-dinosaures .p3 .bebe { animation-delay: -.22s; animation-duration: .26s; }
@keyframes trottine { to { transform: translateY(-3px); } }
.passant-dinosaures .trebuche { transform-box: fill-box; transform-origin: 80% 100%; animation: trebuche 17s linear forwards; }
@keyframes trebuche { 0%, 44% { transform: none; } 46% { transform: rotate(28deg) translateY(3px); } 52% { transform: rotate(28deg) translateY(3px); } 55%, 100% { transform: none; } }
.fumee circle { transform-box: fill-box; transform-origin: center; animation: fumee 6s ease-in-out infinite; }
.fumee circle:nth-child(2) { animation-delay: -2s; }
.fumee circle:nth-child(3) { animation-delay: -4s; }
@keyframes fumee { 0% { transform: translateY(8px) scale(.6); opacity: 0; } 30% { opacity: .9; } 100% { transform: translateY(-14px) scale(1.15); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .fumee circle, .passant-dinosaures .bebe, .passant-dinosaures .trebuche { animation: none; } .fumee circle { opacity: .8; } }
/* ----- v2.5 : la peau de l'univers de la ferme (ciel clair, rouge grange, bois et paille) ----- */
[data-univers="ferme"] {
  --fond-haut: #dcf0ff;
  --fond-bas: #fbf3df;
  --encre: #3a2a1c;
  --doux: #6e5a45;
  --trait: #ecd9bd;
  --accent: #c9473a;
  --accent-fonce: #a8352b;
  --pale: #fff4e6;
  --second: #3d8fe0;
  --second-fonce: #2a6cb3;
  --tiers: #3aa655;
  --tiers-fonce: #2a7f3f;
  --quart: #e8912a;
  --quart-fonce: #b96c14;
  --cinq: #8a5cd6;
  --cinq-fonce: #6a3fb3;
  --six: #1fa3a3;
  --six-fonce: #157a7a;
  --bois: #9a6338;
  --coffre: #fff4e6;
  --ombre: 0 3px 0 rgba(58, 42, 28, .14);
}
/* les boutons des mondes : de petites granges en planches, avec un toit de la couleur du monde */
[data-univers="ferme"] .portes { padding-top: 22px; row-gap: 30px; }
[data-univers="ferme"] .porte {
  border-radius: 6px 6px 12px 12px; border: 4px solid #7a4a2a;
  background: repeating-linear-gradient(90deg, rgba(122, 74, 42, .08) 0 2px, transparent 2px 22px) #fffaf2;
  box-shadow: inset 0 0 0 4px var(--c), 0 6px 0 #7a4a2a;
}
[data-univers="ferme"] .porte:active { transform: translateY(4px); box-shadow: inset 0 0 0 4px var(--c), 0 2px 0 #7a4a2a; }
[data-univers="ferme"] .porte .orne { top: -24px; left: -8px; right: -8px; width: auto; margin: 0; height: 30px; }
[data-univers="ferme"] .porte .orne svg { width: 100%; height: 100%; }
/* la cachette : une porte de grange rouge à croix blanche ; le partage : un panier */
[data-univers="ferme"] .cachette { border-radius: 6px; border: 5px solid #fff; border-top-width: 5px; box-shadow: 0 0 0 3px #a8352b;
  background: linear-gradient(45deg, transparent 46%, #fff 46% 54%, transparent 54%), linear-gradient(-45deg, transparent 46%, #fff 46% 54%, transparent 54%) #c9473a; }
[data-univers="ferme"] .cachette::after { display: none; }
[data-univers="ferme"] .cachette.ouverte { background: var(--coffre); }
[data-univers="ferme"] .coffre { border-radius: 10px 10px 30px 30px; border-top: 16px solid #c99a5b; }
/* la grange aux trésors : un mur de planches, des étagères en bois */
[data-univers="ferme"] .salle { border-color: #9a6338; background: repeating-linear-gradient(90deg, rgba(122, 74, 42, .12) 0 2px, transparent 2px 30px) #f7ead6; }
[data-univers="ferme"] .etagere::after { border-radius: 3px; height: 11px; background: #b07a48; background: linear-gradient(#cf9a63, #8d5a3b); box-shadow: 0 3px 0 #6e4426, 0 6px 5px rgba(58, 42, 28, .2); }
/* le bâton des longueurs (rapporté par Biscuit) */
.longueur-baton { height: 20px; border-radius: 10px; background-image: repeating-linear-gradient(90deg, rgba(0, 0, 0, .14) 0 2px, transparent 2px 26px), linear-gradient(rgba(255, 255, 255, .3), transparent 50%, rgba(0, 0, 0, .15)); box-shadow: inset 0 -3px rgba(0, 0, 0, .15); }
/* les trois petits cochons : ils arrivent un par un, plongent dans la flaque ; le troisième hésite au bord */
.passant-ferme { left: 0; right: 0; width: 100%; bottom: 1%; animation-name: scene-cochons; animation-duration: 13s; }
.passant-ferme.retour { animation-name: scene-cochons; }
@keyframes scene-cochons { from { opacity: 1; } to { opacity: 1; } }
.passant-ferme .c1, .passant-ferme .c2, .passant-ferme .c3, .passant-ferme .saut, .passant-ferme .boue, .passant-ferme .gouttes { transform-box: view-box; animation-duration: 13s; animation-timing-function: linear; animation-fill-mode: both; }
.passant-ferme .c1 { animation-name: cochon1; }
.passant-ferme .c2 { animation-name: cochon2; }
.passant-ferme .c3 { animation-name: cochon3; }
.passant-ferme .c1 .saut { animation-name: saut1; }
.passant-ferme .c2 .saut { animation-name: saut2; }
.passant-ferme .c3 .saut { animation-name: saut3; }
.passant-ferme .c1 .boue { animation-name: boue1; }
.passant-ferme .c2 .boue { animation-name: boue2; }
.passant-ferme .c3 .boue { animation-name: boue3; }
.passant-ferme .gouttes { animation-name: gouttes; }
@keyframes cochon1 { 0% { transform: translateX(-260px); } 30% { transform: translateX(-10px); } 34% { transform: translateX(32px); } 60% { transform: translateX(46px); } 100% { transform: translateX(200px); } }
@keyframes cochon2 { 0% { transform: translateX(-280px); } 40% { transform: translateX(28px); } 44% { transform: translateX(78px); } 66% { transform: translateX(90px); } 100% { transform: translateX(260px); } }
@keyframes cochon3 { 0% { transform: translateX(-300px); } 50% { transform: translateX(72px); } 52%, 66% { transform: translateX(80px); } 70% { transform: translateX(132px); } 82% { transform: translateX(142px); } 100% { transform: translateX(320px); } }
@keyframes saut1 { 0%, 30% { transform: none; } 32% { transform: translateY(-20px); } 34%, 100% { transform: none; } }
@keyframes saut2 { 0%, 40% { transform: none; } 42% { transform: translateY(-20px); } 44%, 100% { transform: none; } }
@keyframes saut3 { 0%, 52% { transform: none; } 55% { transform: translate(-3px, -3px); } 58% { transform: none; } 61% { transform: translate(-3px, -3px); } 64%, 66% { transform: none; } 68% { transform: translateY(-26px); } 70%, 100% { transform: none; } }
@keyframes boue1 { 0%, 33% { opacity: 0; } 35%, 100% { opacity: 1; } }
@keyframes boue2 { 0%, 43% { opacity: 0; } 45%, 100% { opacity: 1; } }
@keyframes boue3 { 0%, 69% { opacity: 0; } 71%, 100% { opacity: 1; } }
@keyframes gouttes { 0%, 33% { opacity: 0; transform: none; } 35% { opacity: 1; transform: translateY(-6px); } 38% { opacity: 0; transform: none; } 43% { opacity: 0; } 45% { opacity: 1; transform: translateY(-6px); } 48% { opacity: 0; transform: none; } 69% { opacity: 0; } 71% { opacity: 1; transform: translateY(-9px); } 75%, 100% { opacity: 0; transform: none; } }
.queue-biscuit { transform-box: fill-box; transform-origin: 0% 100%; animation: remue .5s ease-in-out infinite alternate; }
@keyframes remue { to { transform: rotate(-12deg); } }
@media (prefers-reduced-motion: reduce) { .queue-biscuit { animation: none; } }
/* ----- v2.6 : la peau du quartier des secours (bleu police, rouge pompier, blanc des secours) ----- */
[data-univers="secours"] {
  --fond-haut: #dce9ff;
  --fond-bas: #fff1ec;
  --encre: #1f2a44;
  --doux: #55627e;
  --trait: #cbd8ee;
  --accent: #2a4f9e;
  --accent-fonce: #1f3c7a;
  --pale: #edf3ff;
  --second: #d9413d;
  --second-fonce: #a8322f;
  --tiers: #3aa655;
  --tiers-fonce: #2a7f3f;
  --quart: #e8912a;
  --quart-fonce: #b96c14;
  --cinq: #8a5cd6;
  --cinq-fonce: #6a3fb3;
  --six: #1fa3a3;
  --six-fonce: #157a7a;
  --bois: #5b6b85;
  --coffre: #eef3fa;
  --ombre: 0 3px 0 rgba(31, 42, 68, .14);
}
/* les boutons des mondes : les portes roulantes de la caserne, surmontées de la coiffure de Sam pour ce monde */
[data-univers="secours"] .portes { padding-top: 18px; row-gap: 28px; }
[data-univers="secours"] .porte {
  border-radius: 14px 14px 8px 8px; border: 4px solid #2b3a55;
  background: repeating-linear-gradient(0deg, #f4f6fa 0 12px, #dfe5ee 12px 14px);
  box-shadow: inset 0 0 0 4px var(--c), 0 6px 0 #2b3a55;
}
[data-univers="secours"] .porte:active { transform: translateY(4px); box-shadow: inset 0 0 0 4px var(--c), 0 2px 0 #2b3a55; }
/* la cachette : une porte roulante rouge de la caserne ; le partage : une trousse */
[data-univers="secours"] .cachette { border-radius: 8px; border: 5px solid #8f2522; border-top-width: 14px; background: repeating-linear-gradient(0deg, #d9413d 0 10px, #b8322f 10px 12px); box-shadow: none; }
[data-univers="secours"] .cachette::after { display: none; }
[data-univers="secours"] .cachette.ouverte { background: var(--coffre); }
[data-univers="secours"] .coffre { border-radius: 12px; border-top: 18px solid #d9413d; }
/* le vestiaire aux trésors : un mur carrelé, des étagères rouges */
[data-univers="secours"] .salle { border-color: #2a4f9e; background: repeating-linear-gradient(0deg, rgba(42, 79, 158, .1) 0 2px, transparent 2px 26px), repeating-linear-gradient(90deg, rgba(42, 79, 158, .1) 0 2px, transparent 2px 26px) #f2f6fd; }
[data-univers="secours"] .etagere::after { border-radius: 3px; background: #d9413d; background: linear-gradient(#ef6a62, #b8322f); box-shadow: 0 3px 0 #8f2522, 0 6px 5px rgba(31, 42, 68, .2); }
/* le tuyau des longueurs (avec son embout de cuivre) */
.longueur-tuyau { position: relative; height: 18px; border-radius: 9px 4px 4px 9px; background-image: repeating-linear-gradient(90deg, rgba(0, 0, 0, .12) 0 2px, transparent 2px 12px); box-shadow: inset 0 -4px rgba(0, 0, 0, .18); }
.longueur-tuyau::after { content: ""; position: absolute; right: -10px; top: 2px; width: 12px; height: 14px; border-radius: 2px 5px 5px 2px; background: #d9a53b; box-shadow: inset 0 -3px rgba(0, 0, 0, .2); }
/* la parade des secours, et les gyrophares qui clignotent */
.passant-secours { width: 230px; left: -240px; bottom: 1%; animation-name: traverser-parade; animation-duration: 14s; }
.passant-secours.retour { animation-name: revenir-parade; }
@keyframes traverser-parade { from { left: -240px; } to { left: 100%; } }
@keyframes revenir-parade { from { left: 100%; } to { left: -240px; } }
.passant-secours .gyro, .gyro-quartier rect { animation: gyro .5s steps(1) infinite; }
.passant-secours .gyro:nth-of-type(2n) { animation-delay: -.25s; }
@keyframes gyro { 50% { fill: #ff5a5a; } }
/* la scène où Sam enfile sa tenue avant les jeux d'un monde */
.ecran-tenue { justify-content: center; }
.scene-tenue { flex: 0 0 auto; height: min(60vh, 460px); cursor: pointer; }
.guide.enfile svg { animation: enfiler .6s cubic-bezier(.3, 1.4, .5, 1) both; transform-origin: 50% 100%; }
@keyframes enfiler { from { transform: scale(.6) rotate(-8deg); opacity: 0; } to { transform: none; opacity: 1; } }
.bulle-tenue { align-self: center; margin: 0; padding: 10px 18px; border-radius: 20px; background: var(--carte); border: 3px solid var(--accent); font-weight: 800; font-size: 1.15rem; text-align: center; }
@media (prefers-reduced-motion: reduce) { .passant-secours .gyro, .gyro-quartier rect, .guide.enfile svg { animation: none; } }

