/* Aventura (Ludoaventura) — feuille de style unique.
   Couleurs reprises des illustrations : vert prairie, parchemin, encre brune,
   rouge / jaune / bleu des piles de cartes. Thème clair uniquement : les illustrations
   sont conçues sur fond clair. */

:root {
  --vert: #3f7a46;        /* vert du bas du plateau (texte blanc dessus : contraste ≥ 4,5:1) */
  --vert-fonce: #2c5a33;
  --vert-bouton: #418320; /* vert pomme des boutons principaux (choix du 03/12/2026) ; texte blanc dessus : contraste 4,7:1 */
  --parchemin: #f6eedb;
  --parchemin-bord: #d8c7a0;
  --encre: #3b2a1e;       /* brun foncé des contours et du mot MISSION */
  --encre-douce: #5e4a3a;
  --rouge: #e3262a;
  --feu: #e8562a;         /* orange de la jauge des points */
  --rouge-texte: #a8161b; /* rouge pour du texte sur fond clair (contraste ≥ 4,5:1) */
  --jaune: #ffe600;
  --bleu: #1c3473;
  --vert-pion: #2f9e5b;
  --ciel: #8fc8ea;
  --radius: 14px;
  /* Charte v10.64 (30/11/2026) : bordures « très fin » et ombres de boutons à 1 px. Tout se règle ici. */
  --contour: 1.5px;       /* cadres, cartes, tuiles (avant : 3 px) */
  --contour-fin: 1px;     /* champs, jauges, séparateurs (avant : 2 px) */
  --contour-gras: 2px;    /* gros cadres (avant : 4 px) */
  --ombre: 1px;           /* ombre dure sous les boutons (avant : 3 à 4 px) */
  --bouton-trait: .5px;   /* trait des boutons principaux (choix du 30/11/2026) */
  --bouton-rayon: 30px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--vert); /* couleur de secours sous l'image de fond (v10.95) */
  color: var(--encre);
  font: 400 1rem/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
/* Fond vert feuillage (v10.95) : image fixe derrière tous les écrans (sauf la scène peinte de l'accueil, qui a son propre décor).
   Un pseudo-élément fixe plutôt que background-attachment: fixed, ignoré par iOS. cover = centre toujours rempli, bords rognés. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: var(--vert) url("../img/fond-vert.webp") center / cover no-repeat;
}
h2, h3 { font-family: "Rockwell", "Roboto Slab", "Georgia", serif; line-height: 1.15; margin: 0; }
:focus-visible { outline: 3px solid var(--jaune); outline-offset: 3px; box-shadow: 0 0 0 6px var(--encre); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 20;
  background: var(--encre); color: #fff; padding: 10px 14px; border-radius: 8px; font-weight: 700; text-decoration: none;
}
.skip:focus { top: 12px; }
main { flex: 1; display: flex; flex-direction: column; }
main:focus { outline: none; }
[hidden] { display: none !important; }

/* ---------- Boutons ---------- */
.btn {
  font: inherit; font-weight: 800; cursor: pointer; letter-spacing: .02em;
  min-height: 52px; padding: 12px 26px; border-radius: 12px;
  border: var(--contour) solid var(--encre);
}
.btn-principal {
  background: var(--vert-bouton); color: #fff; font-size: 1.1rem;
  box-shadow: 0 var(--ombre) 0 var(--encre);
  text-shadow: 0 1px 0 rgb(0 0 0 / .35);
}
.btn-principal:hover { filter: brightness(1.06); }
/* Bouton bleu (v6.44) : Partie rapide solo. Blanc sur #1c3473 : contraste 11,7:1. */
.btn-bleu { background: var(--bleu); color: #fff; box-shadow: 0 var(--ombre) 0 var(--encre); }
.btn-bleu:hover { filter: brightness(1.15); }
.btn-bleu:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--encre); }
.btn-jaune { background: var(--jaune); color: var(--encre); box-shadow: 0 var(--ombre) 0 var(--encre); }
.btn-jaune:hover { filter: brightness(1.04); }
.btn-jaune:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--encre); }
.btn-secondaire { background: #fff; color: var(--encre); box-shadow: 0 var(--ombre) 0 var(--encre); }
.btn-bonne { background: #1f7a3a; color: #fff; box-shadow: 0 var(--ombre) 0 var(--encre); }
.btn-mauvaise { background: #fff; color: var(--rouge-texte); box-shadow: 0 var(--ombre) 0 var(--encre); }
.btn-bonne::before { content: "✔ "; }
.btn-mauvaise::before { content: "✘ "; }
.btn-principal:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--encre); }

/* ---------- Accueil : composition façon boîte du jeu ---------- */
.accueil {
  flex: 1;
  display: grid;
  place-items: center;
  /* Décor peint : ciel, montagnes, prairie. Couleur de prairie en secours sous l'image. */
  background: #b4ca58 url("../img/fond.webp") center 58% / cover no-repeat;
  overflow: hidden;
}
.scene {
  position: relative;
  width: min(100vw, calc(100dvh - 40px), 820px);
  aspect-ratio: 1;
}
.calque { position: absolute; height: auto; pointer-events: none; user-select: none; }
.arche { left: 15%; top: 14%; width: 72%; filter: drop-shadow(0 6px 8px rgb(0 0 0 / .18)); }
.perso { left: 25%; top: 39%; width: 30%; }
.herbe { left: -2%; bottom: 0; width: 24%; }
.accueil-actions {
  position: absolute; right: 4%; bottom: 7%; width: 44%;
  display: flex; flex-direction: column; align-items: stretch; gap: 10px; text-align: center;
}
.accueil-actions .btn { font-size: clamp(.95rem, 3vw, 1.2rem); padding-inline: 12px; }

/* Écrans en hauteur (téléphones, tablettes debout) : la scène occupe tout l'écran,
   l'arche est agrandie et l'aventurier (coupé à la taille sur l'illustration) sort par le bas. */
@media (max-aspect-ratio: 4/5) {
  .accueil { display: flex; align-items: stretch; background-position: center bottom; }
  .scene { flex: 1; width: 100%; aspect-ratio: auto; min-height: 420px; }
  /* Le décor (carré) couvre l'écran par la hauteur : l'horizon reste à ~58 % de la hauteur,
     on pose donc la base de l'arche juste sous l'horizon. */
  .arche { left: 4%; width: 92%; top: auto; bottom: 39%; }
  .perso { left: 2%; width: 56%; top: auto; bottom: -14%; }
  .herbe { left: -6%; width: 34%; }
  /* v10.93 : relevés au-dessus du bouton plein écran (fixe, en bas à droite : 8 px + 38 px) qui passait sur « Mini-jeux ». */
  .accueil-actions { right: 4%; bottom: max(5%, calc(56px + env(safe-area-inset-bottom))); width: 54%; }
}

/* ---------- Préparation de la partie ----------
   Un seul écran à la fois (v4.6) : il occupe la hauteur de la fenêtre, sans défiler.
   La page est limitée à la hauteur de l'écran ; le contenu de l'étape (.etape-corps) prend la place libre
   et les grilles (aventuriers, aventures) se dimensionnent pour y tenir ; les boutons restent en bas. */
body:has(#ecran-preparation:not([hidden])) { height: 100vh; height: 100dvh; overflow: hidden; }
body:has(#ecran-preparation:not([hidden])) main { min-height: 0; }
body:has(#ecran-preparation:not([hidden])) .pied { padding-block: 4px calc(4px + env(safe-area-inset-bottom)); font-size: .8rem; }
.preparation {
  flex: 1; min-height: 0; width: 100%; max-width: 1100px; margin: 0 auto; padding: 8px 12px 8px;
  display: flex; flex-direction: column;
}
.preparation .barre { margin-bottom: 8px; }
.prepa-progres { justify-self: end; margin: 0; color: #fff; font-weight: 700; font-size: .85rem; text-align: right; line-height: 1.2; }
.prepa { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.etape { flex: 1; min-height: 0; min-width: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; padding: 10px 12px; }
.etape:focus { outline: none; }
.etape legend {
  float: left; width: 100%; display: flex; align-items: center; gap: 10px;
  font: 700 clamp(1rem, 3.6vw, 1.2rem)/1.2 "Rockwell", "Roboto Slab", Georgia, serif;
}
.etape legend + * { clear: both; }
.etape-num {
  flex: none; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--rouge); color: #fff; border: var(--contour-fin) solid var(--encre); font-family: system-ui, sans-serif; font-size: 1rem;
}
/* Nom du joueur dans le titre, souligné de sa couleur. */
.legende-joueur { display: inline-flex; align-items: center; gap: 8px; border-bottom: var(--contour-gras) solid var(--c); padding-bottom: 2px; }
.legende-joueur img { width: 34px; height: 37px; border-radius: 8px; flex: none; }
.etape-corps { flex: 1; min-height: 0; overflow: auto; }
.etape-actions { flex: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; } /* v11.5 : boutons de validation centrés (avant : à droite) */
.etape-actions .btn { min-height: 48px; padding: 8px 22px; }
.etape-actions .btn-principal { flex: 0 1 260px; }

/* 1. Nombre de joueurs : 4 grands boutons centrés. */
.etape[data-etape="1"] .etape-corps { display: block; }
.nb-joueurs { display: flex; gap: 12px; width: min(100%, 480px); }
.nb-joueurs label { flex: 1; position: relative; }
.nb-joueurs input, .aventure input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.nb-joueurs span {
  display: grid; place-items: center; height: clamp(64px, 18vw, 96px); border-radius: 14px; cursor: pointer;
  background: #fff; border: var(--contour) solid var(--parchemin-bord); font: 800 clamp(1.6rem, 6vw, 2.4rem)/1 system-ui, sans-serif;
}
.nb-joueurs input:checked + span { background: var(--encre); color: #fff; border-color: var(--encre); }
.nb-joueurs input:focus-visible + span { outline: 3px solid var(--rouge); outline-offset: 3px; }
.aventure:has(input:focus-visible)::after { outline: 3px solid var(--encre); outline-offset: -10px; border-radius: 8px; }

/* 2. Aventuriers et 4. aventures : grilles qui remplissent la place libre (lignes de hauteur égale).
   Écran haut (portrait) : 3 colonnes ; sinon (paysage, carré) : 5 colonnes. */
.aventuriers, .aventures {
  height: 100%; display: grid; gap: clamp(4px, 1.2vmin, 10px);
  grid-template-columns: repeat(5, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr);
}
@media (max-aspect-ratio: 3/4) { .aventuriers, .aventures { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.etape[data-etape="2"] .etape-corps { overflow: hidden; }
.joueur-rouge { --c: var(--rouge); }
.joueur-jaune { --c: #f2c400; }
.joueur-bleu { --c: #2e55c9; }
.joueur-vert { --c: var(--vert-pion); }
.aventurier {
  position: relative; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 1px;
  padding: 4px 4px 6px; font: inherit; color: var(--encre); cursor: pointer; text-align: center; line-height: 1.1;
  background: #fff; border: var(--contour-gras) solid var(--parchemin-bord); border-radius: 12px;
}
.aventurier img { flex: 1 1 0; min-height: 0; width: 100%; object-fit: contain; border-radius: 10px; margin-bottom: 2px; }
.aventurier-nom { font: 700 clamp(.78rem, 2.2vmin, .98rem)/1.1 "Rockwell", "Roboto Slab", Georgia, serif; }
.aventurier-titre { font-size: clamp(.62rem, 1.6vmin, .72rem); color: var(--encre-douce); }
@media (max-height: 620px) { .aventurier-titre { display: none; } }
/* Cadres de couleur dessinés À L'INTÉRIEUR de la carte (bordure + ombre « inset ») :
   la grille coupe ce qui dépasse (overflow: hidden), un cadre extérieur était rogné
   sur les cartes du bord (v4.7). */
.aventurier.pris { border-color: var(--c); }
.aventurier[aria-pressed="true"] { border-color: var(--encre); box-shadow: inset 0 0 0 4px var(--c); }
.aventurier:focus-visible { outline-offset: -8px; box-shadow: inset 0 0 0 4px var(--c, var(--encre)); }
.aventurier:disabled { cursor: not-allowed; opacity: .55; }
.aventurier-pris:not(:empty) {
  position: absolute; top: 2px; right: 2px; min-width: 28px; padding: 1px 5px; border-radius: 99px;
  background: var(--c); color: #fff; border: var(--contour-fin) solid var(--encre); font-weight: 800; font-size: .75rem;
  text-shadow: 0 1px 0 var(--encre);
}
.joueur-jaune .aventurier-pris:not(:empty) { color: var(--encre); text-shadow: none; }

/* 3. Réglages des cartes du joueur : packs et questions (plusieurs). */
.reglage { margin-bottom: clamp(6px, 1.6vmin, 14px); }
.reglage-titre { margin: 0 0 6px; font-weight: 700; }
.reglage-titre span { font-weight: 400; color: var(--encre-douce); font-size: .85rem; }
.packs { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.pack { position: relative; }
.pack input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
/* Choix « entourés » (v5.6) : pas de case à cocher ; un choix non retenu est seulement entouré, fond transparent,
   un choix retenu se remplit de couleur (brun foncé, texte blanc : contraste ≥ 4,5:1). */
.pack span {
  display: inline-flex; align-items: center; min-height: 40px; padding: 4px 14px; cursor: pointer;
  border: var(--contour-fin) solid var(--encre-douce); border-radius: 99px; background: transparent; color: var(--encre); font-weight: 600;
  transition: background-color .15s, color .15s, border-color .15s;
}
.pack:hover span { border-color: var(--encre); }
.pack input:checked + span { background: var(--encre); color: #fff; border-color: var(--encre); }
.pack input:focus-visible + span { outline: 3px solid var(--rouge); outline-offset: 3px; }
/* Matière (v5.7) : le titre et les choix sur une même ligne. Nombres 1 à 10 : petites pastilles rondes. */
.reglage-duo { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; }
.reglage-duo > [hidden] { display: none; }
/* Écran de la matière : choix en grand, l'un sous l'autre, centrés. */
.reglages-joueur .reglage.choix-matiere { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; min-height: 100%; margin: 0; }
.choix-matiere[hidden] { display: none; }
.choix-matiere .reglage-ligne { flex-direction: column; gap: 8px; }
.reglage-aide { margin: 0; font-size: .9rem; color: var(--encre-douce); text-align: center; }
.choix-matiere .packs { justify-content: center; }
.reglages-joueur .choix-matiere .pack span { min-height: 52px; padding: 6px 22px; font-size: 1.15rem; }
/* v6.49 : écran peu haut (téléphone carré, paysage) — Français + Orthographe/Conjugaison + niveau doivent tenir :
   chaque titre à gauche de ses choix, boutons plus bas. */
@container (max-height: 420px) {
  .reglages-joueur .reglage.choix-matiere { gap: 8px; }
  .choix-matiere .reglage-ligne { flex-direction: row; justify-content: center; gap: 4px 8px; }
  .reglages-joueur .choix-matiere .pack span { min-height: 38px; padding: 2px 14px; font-size: 1rem; }
  .choix-matiere .reglage-aide { width: 100%; font-size: .8rem; }
}
/* v7.3 : 4 choix en français (… Phonèmes) : sur écran étroit ET bas (téléphone carré), boutons plus serrés
   pour qu'Orthographe, Conjugaison, Grammaire et Phonèmes tiennent sur 2 lignes sans faire défiler. */
@container (max-height: 420px) and (max-width: 520px) {
  .reglages-joueur .reglage.choix-matiere { gap: 5px; }
  .reglages-joueur .choix-matiere .pack span { min-height: 34px; padding: 1px 11px; font-size: .95rem; }
  .choix-matiere .packs { gap: 4px 6px; }
}
/* Histoire (4 matières) : sur un écran peu haut (téléphone carré), le titre « Matière » est masqué à l'œil
   (le titre de l'écran dit déjà « quelle matière ? ») mais reste lu par les lecteurs d'écran. */
@container (max-height: 420px) {
  #matiere-titre { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
/* Écran étroit ET bas : « En français : » aussi (les choix Orthographe, Conjugaison… parlent d'eux-mêmes). */
@container (max-height: 420px) and (max-width: 520px) {
  #francais-titre { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
.reglage-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.reglage-ligne .reglage-titre { margin: 0; }
.nombres .pack span { min-width: 44px; justify-content: center; padding: 4px 8px; }
.pack span b { font-size: 1.15em; margin-right: 4px; }
.reglages-matiere[hidden], .reglage[hidden] { display: none; }
/* Conjugaison (v5.8) : une ligne par mode, le nom du mode à gauche, ses temps à droite. */
.temps-modes { display: flex; flex-direction: column; gap: 5px; }
.mode-ligne { display: flex; align-items: center; gap: 8px; }
.mode-ligne[hidden] { display: none; }
.aide-gauche { text-align: left; font-style: italic; }
.reglage-aide[hidden] { display: none; }
.mode-nom { flex: none; width: 6.6em; font-weight: 700; font-size: .85rem; color: var(--encre-douce); }
.mode-ligne .packs { flex: 1; min-width: 0; }
.mode-nom .court { display: none; }
/* Petits écrans : pastilles plus serrées (cible ≥ 24 px, WCAG 2.5.8), nom du mode plus étroit. */
@media (max-width: 520px) {
  .reglages-joueur .pack span { min-height: 32px; padding: 1px 10px; font-size: .9rem; }
  .reglages-joueur .packs { gap: 5px 6px; }
  .reglages-joueur .reglage { margin-bottom: 6px; }
  .reglages-joueur .reglage-titre { font-size: .92rem; }
  .nombres .pack span { min-width: 34px; padding: 1px 6px; }
  /* Écran des temps (v6.0) : le nom du mode au-dessus de ses temps. */
  .mode-ligne { flex-direction: column; align-items: flex-start; gap: 3px; }
  .mode-nom { width: auto; }
}
/* Téléphones étroits (360 px) : les deux boutons côte à côte, titre « Temps » retiré (les modes suffisent). */
/* Téléphones étroits et peu hauts (360 × 640…) : temps serrés, nom du mode abrégé à gauche. */
@media (max-width: 520px) and (max-height: 760px) {
  .mode-ligne { flex-direction: row; align-items: center; gap: 6px; }
  .mode-nom { width: 3.6em; font-size: .74rem; }
  .mode-nom .long { display: none; }
  .mode-nom .court { display: inline; }
  .temps-modes .pack span { min-height: 28px; padding: 0 8px; font-size: .82rem; }
  .temps-modes .packs { gap: 3px 4px; }
  .temps-modes { gap: 4px; }
}
@media (max-width: 420px) {
  .etape-actions { flex-wrap: nowrap; }
  .etape-actions .btn { min-height: 44px; padding: 4px 10px; font-size: .95rem; }
  .etape-actions .btn-secondaire { font-size: .8rem; line-height: 1.15; }
  .titre-temps { display: none; }
}
/* Écrans peu hauts (téléphone en paysage, format carré) : boutons un peu plus serrés (cible ≥ 24 px, WCAG 2.5.8). */
@media (max-height: 620px) {
  .pack span { padding: 2px 10px; font-size: .9rem; }
  .reglage-titre { margin-bottom: 3px; font-size: .92rem; }
  .reglage-titre span { display: none; }
  .etape { gap: 6px; padding: 8px 10px; }
  .etape-actions { flex-wrap: nowrap; }
  .etape-actions .btn { min-height: 40px; padding: 4px 12px; font-size: .95rem; }
  .pack span { min-height: 30px; }
  .nombres .pack span { min-width: 36px; padding: 2px 6px; }
  .temps-modes { gap: 3px; }
  .temps-modes .pack span { min-height: 26px; padding: 0 8px; font-size: .8rem; }
  .temps-modes .packs { gap: 3px 4px; }
  .mode-ligne { flex-direction: row; align-items: center; }
  .mode-nom { font-size: .72rem; width: 3.6em; }
  .mode-nom .long { display: none; }
  .mode-nom .court { display: inline; }
  .reglage-duo { gap: 4px 12px; }
  .titre-temps { display: none; } /* les noms des modes suffisent */
  .packs { gap: 5px 6px; }
  .legende-joueur img { width: 28px; height: 31px; }
  .etape-actions .btn-secondaire { white-space: nowrap; font-size: .85rem; }
  .preparation .barre { margin-bottom: 4px; }
  .preparation .btn-retour { min-height: 36px; padding: 2px 12px; }
}
/* Message « doit cocher… » : posé au-dessus des boutons, sans pousser le contenu (rien ne défile). */
.etape-actions { position: relative; }
.reglage-alerte {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); margin: 0; z-index: 2; pointer-events: none; /* le choix dessous reste touchable (le message disparaît alors) */
  padding: 6px 10px; border-radius: 10px; background: #fff; border: var(--contour-fin) solid var(--rouge-texte);
  color: var(--rouge-texte); font-weight: 700; box-shadow: 0 4px 10px rgb(0 0 0 / .2);
}
.reglage-alerte:empty { display: none; }

/* ---------- Étape 3 : les réglages remplissent l'écran (v6.4) ----------
   Les choix sont centrés et grandissent avec la place libre (unités cqh / cqi du conteneur .reglages-joueur),
   pour ne pas laisser un écran presque vide. --rangs = nombre de lignes de boutons de l'écran :
   la hauteur d'un bouton = la place libre (moins les titres) divisée par ce nombre, entre 30 px et 150 px
   (cible tactile ≥ 24 px, WCAG 2.2 critère 2.5.8). */
.reglages-joueur { container-type: size; }
.reglages-remplir {
  --rangs: 4;
  --cols: 2; /* boutons par ligne : le texte ne dépasse pas la largeur d'un bouton (2 lignes au plus) */
  --larg: min(100cqi, 760px);
  --h: clamp(30px, calc((100cqh - 5.2rem) / var(--rangs) - 2cqh), 150px); /* 5,2 rem : les titres et les espaces */
  height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center;
  gap: clamp(6px, 3cqh, 28px);
}
.reglages-remplir[hidden] { display: none; }
.reglages-remplir .reglage { width: min(100%, var(--larg)); margin: 0; }
.reglages-remplir .reglage-titre { text-align: center; font-size: clamp(.92rem, 3.6cqh, 1.35rem); }
.reglages-remplir .reglage-titre { margin-bottom: clamp(3px, 1cqh, 8px); }
@container (max-width: 520px) { .reglages-remplir .reglage-titre span { display: none; } } /* titres sur une seule ligne */
.reglages-remplir .packs { display: grid; gap: clamp(5px, 1.6cqh, 14px) clamp(6px, 1.6cqi, 14px); }
.reglages-joueur .reglages-remplir .pack span {
  width: 100%; height: var(--h); min-height: 0; justify-content: center; text-align: center; line-height: 1.1;
  padding: 2px 8px; font-size: clamp(.85rem, min(calc(var(--h) * .36), calc(var(--larg) / var(--cols) / 6.5)), 1.9rem);
}
/* Mathématiques (v7.0) : les 4 signes seuls dans des ronds sur une ligne, puis unités (1 à 5 / 6 à 10),
   dizaines (10 à 50 / 60 à 90) et centaines (100 à 500 / 600 à 900), 5 par ligne : 7 lignes de boutons
   et 4 titres (d'où les 9 rem retirés de la hauteur). */
#reglages-maths {
  --rangs: 7; --titres: 9rem; --cols: 5; --larg: min(100cqi, 640px);
  --h: clamp(28px, calc((100cqh - var(--titres)) / var(--rangs) - 1.2cqh), 110px);
  gap: clamp(4px, 1.4cqh, 18px);
}
/* v6.14 : les groupes de nombres dépendent du niveau (Facile : unités ; Moyen : + dizaines ;
   Difficile : + centaines ; Expert : + « 1000+ »), d'où un nombre de lignes et de titres différent. */
#reglages-maths[data-niveau="facile"] { --rangs: 3; --titres: 4.5rem; }
#reglages-maths[data-niveau="moyen"] { --rangs: 5; --titres: 7rem; }
#reglages-maths[data-niveau="expert"] { --rangs: 8; --titres: 12.5rem; }
#reglages-maths #milliers { display: flex; justify-content: center; }
#reglages-maths #milliers .pack { width: min(40%, 220px); }
.pack[hidden] { display: none; }
#reglages-maths .packs { gap: clamp(4px, 1cqh, 10px) clamp(5px, 1.4cqi, 12px); }
#signes { grid-template-columns: repeat(4, minmax(0, 1fr)); justify-items: center; }
#signes .pack { width: 100%; display: flex; justify-content: center; }
.reglages-joueur #reglages-maths #signes .pack span {
  width: min(var(--h), 100%); height: auto; aspect-ratio: 1; padding: 0; border-radius: 50%;
}
.reglages-joueur #signes .pack span b { margin: 0; font-size: clamp(1.2rem, calc(var(--h) * .6), 3rem); line-height: 1; }
#reglages-maths .nombres { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.reglages-joueur #reglages-maths .nombres .pack span { font-size: clamp(.95rem, min(calc(var(--h) * .45), 5.5cqi), 2.2rem); font-weight: 800; min-width: 0; padding: 0 2px; }
/* Titre du groupe et son bouton « Tout sélectionner » sur une même ligne. */
.reglage-tete { display: flex; align-items: center; justify-content: center; gap: 6px 12px; margin-bottom: clamp(2px, .8cqh, 8px); }
.reglages-remplir .reglage-tete .reglage-titre { margin: 0; }
.reglage-titre em { font-style: normal; font-weight: 400; color: var(--encre-douce); font-size: .85em; }
.btn-tout {
  flex: none; min-height: 28px; padding: 2px 12px; border-radius: 99px; cursor: pointer;
  border: var(--contour-fin) solid var(--encre-douce); background: #fff; color: var(--encre); font: inherit; font-size: .85rem; font-weight: 700;
}
.btn-tout:hover { border-color: var(--encre); }
.btn-tout:focus-visible { outline: 3px solid var(--rouge); outline-offset: 2px; }
.btn-tout .court { display: none; }
/* Écrans peu hauts (téléphone carré ou en paysage) : chaque groupe de nombres sur une seule ligne
   (4 lignes de boutons au lieu de 7), pour tout voir sans défiler. */
@container (max-height: 460px) {
  #reglages-maths { --rangs: 4; --titres: 6.4rem; --h: clamp(26px, calc((100cqh - var(--titres)) / var(--rangs) - 1cqh), 70px); gap: 3px; }
  #reglages-maths[data-niveau="facile"] { --rangs: 2; --titres: 3.4rem; }
  #reglages-maths[data-niveau="moyen"] { --rangs: 3; --titres: 5rem; }
  #reglages-maths[data-niveau="expert"] { --rangs: 5; --titres: 8rem; }
  #milliers-titre { display: none; } /* « 1000+ » se suffit à lui-même : une ligne de gagnée */
  #reglages-maths .nombres { grid-template-columns: repeat(10, minmax(0, 1fr)); }
  .reglages-joueur #reglages-maths .nombres .pack span { font-size: clamp(.8rem, min(calc(var(--h) * .42), 3.2cqi), 1.6rem); }
  #reglages-maths .reglage-tete { margin-bottom: 2px; }
  #reglages-maths .reglage-titre { font-size: .9rem; }
  #reglages-maths .btn-tout { min-height: 24px; padding: 0 10px; }
}
@container (max-width: 520px) {
  .btn-tout .long { display: none; }
  .btn-tout .court { display: inline; }
  /* Orthographe (v6.27) : le titre est court, « Tout sélectionner » tient en entier à côté. */
  #ortho-packs .btn-tout .long, #reglages-ortho .btn-tout .long { display: inline; }
  #ortho-packs .btn-tout .court, #reglages-ortho .btn-tout .court { display: none; }
  .reglages-remplir .reglage-titre { font-size: .95rem; }
}

/* Orthographe (v6.16) : deux écrans.
   Thèmes (17, v6.39) : 4 familles encadrées (3, 5, 5 et 4 thèmes) ; en largeur 5 par ligne (4 lignes de boutons
   + 4 têtes de famille), en hauteur 3 par ligne (7 lignes). Questions : voir plus bas (familles, v6.33). */
#ortho-packs { --rangs: 4; --cols: 5; --larg: min(100cqi, 1100px);
  --h: clamp(26px, calc((100cqh - 11.5rem) / var(--rangs) - 1.8cqh), 96px); }
#packs { display: flex; flex-direction: column; gap: clamp(4px, 1.2cqh, 12px); }
#ortho-packs .famille .packs { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(4px, 1cqh, 10px) clamp(5px, 1.4cqi, 12px); }
/* Questions (v6.33, choix de l'utilisateur, test A/B) : 3 familles encadrées, 3 boutons par ligne
   (5 lignes de boutons + 3 têtes de famille : d'où les 9 rem retirés de la hauteur). */
#reglages-ortho { --rangs: 5; --cols: 3; --larg: min(100cqi, 820px);
  --h: clamp(26px, calc((100cqh - 9.5rem) / var(--rangs) - 1.6cqh), 96px); }
#types-questions { display: flex; flex-direction: column; gap: clamp(4px, 1.2cqh, 12px); }
#reglages-ortho .famille .packs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(4px, 1cqh, 10px) clamp(5px, 1.4cqi, 12px); }
#reglages-ortho .famille, #ortho-packs .famille { border: var(--contour-fin) solid var(--parchemin-bord); background: #fffaf0; border-radius: 12px; padding: clamp(3px, 1cqh, 10px) clamp(5px, 1.2cqi, 12px); }
.famille-tete { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: clamp(2px, .8cqh, 8px); }
.famille-nom { margin: 0; font-weight: 800; font-size: clamp(.8rem, 2.8cqh, 1.1rem); color: var(--encre-douce); }
.reglages-joueur .btn-tout-famille { min-height: 24px; padding: 0 12px; font-size: .8rem; }
.reglages-joueur #reglages-ortho .pack span, .reglages-joueur #ortho-packs .pack span { border-radius: 18px; } /* boutons hauts : coins arrondis plutôt qu'ovales */
/* 19 packs et 12 questions (v6.17) : texte un peu plus petit que sur les autres écrans pour que « Lieux et constructions »
   tienne dans un bouton, même sur téléphone carré (3 lignes au plus). */
.reglages-joueur #ortho-packs .pack span, .reglages-joueur #reglages-ortho .pack span {
  font-size: clamp(.7rem, min(calc(var(--h) * .3), calc(var(--larg) / var(--cols) / 8.5)), 1.7rem);
  line-height: 1; padding: 1px 4px; hyphens: auto;
}
#ortho-packs .pack, #reglages-ortho .pack { display: flex; } /* sinon un nom sur 3 lignes décale son bouton vers le bas (alignement sur la ligne de base) */
@container (max-aspect-ratio: 1/1) {
  #ortho-packs { --rangs: 7; --cols: 3; --h: clamp(26px, calc((100cqh - 15rem) / var(--rangs) - 1.4cqh), 96px); }
  #ortho-packs .famille .packs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Grammaire (v6.54) : 8 jeux ; 4 par ligne en largeur (2 lignes), 2 par ligne en hauteur (4 lignes). */
#reglages-gram { --rangs: 2; --cols: 4; --larg: min(100cqi, 900px);
  --h: clamp(30px, calc((100cqh - 5.2rem) / var(--rangs) - 2cqh), 110px); }
#jeux-gram { grid-template-columns: repeat(4, minmax(0, 1fr)); }
#reglages-gram .pack { display: flex; }
.reglages-joueur #reglages-gram .pack span { border-radius: 18px; }
@container (max-aspect-ratio: 1/1) {
  #reglages-gram { --rangs: 4; --cols: 2; }
  #jeux-gram { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Conjugaison, écran des temps (v6.6) : chaque mode choisi est un cadre qui entoure SES temps,
   rangés en colonne (un temps sous l'autre), pour ne pas confondre les temps de deux modes.
   Écran plus large que haut : les cadres côte à côte ; sinon 2 colonnes, l'indicatif (8 temps) à gauche,
   les autres modes empilés à droite. Les boutons grandissent avec la place libre. */
#conj-temps { height: 100%; display: flex; flex-direction: column; gap: clamp(4px, 1.6cqh, 14px); }
#conj-temps .reglage { margin: 0; }
#conj-temps .reglage-ligne { justify-content: center; flex-wrap: nowrap; }
/* Écran étroit : sans le mot « Modes » (les cadres le disent) ; très étroit : les 4 modes en 2 × 2. */
@container (max-width: 520px) {
  #modes-conj-titre { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}
@container (max-width: 400px) {
  #modes-conj { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 6px; width: 100%; }
  #modes-conj .pack span { width: 100%; justify-content: center; min-height: 30px; }
}
#conj-temps > .reglage:last-child { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#temps-conj {
  --ht: clamp(24px, calc((100cqh - 10rem) / 8 - 1cqh), 64px); /* v6.49 : place pour la ligne des groupes */
  flex: 1; min-height: 0; display: grid; gap: clamp(6px, 1.6cqi, 16px); align-content: safe center;
  grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); grid-template-rows: auto;
}
#temps-conj .mode-ligne {
  display: flex; flex-direction: column; align-items: stretch; gap: clamp(2px, .8cqh, 8px); align-self: start;
  border: var(--contour) solid var(--encre); border-radius: 16px; padding: clamp(4px, 1cqh, 10px) clamp(4px, 1cqi, 10px);
  background: rgb(255 255 255 / .55);
}
#temps-conj .mode-ligne[hidden] { display: none; }
#temps-conj .mode-nom { width: auto; text-align: center; color: var(--encre); font-size: clamp(.78rem, calc(var(--ht) * .42), 1.3rem); }
#temps-conj .mode-nom .long { display: inline; }
#temps-conj .mode-nom .court { display: none; }
#temps-conj .packs { display: grid; grid-template-columns: 1fr; gap: clamp(2px, .7cqh, 8px); }
#temps-conj .pack span {
  width: 100%; height: var(--ht); min-height: 0; padding: 0 6px; justify-content: center; text-align: center; line-height: 1.05;
  border-radius: 12px; font-size: clamp(.74rem, min(calc(var(--ht) * .4), 3.2cqi), 1.25rem);
}
@container (max-aspect-ratio: 1/1) {
  #temps-conj { --ht: clamp(24px, calc((100cqh - 19rem) / 8 - 1cqh), 64px); grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-columns: auto; }
  #temps-conj .mode-ligne[data-mode="indicatif"] { grid-column: 1; grid-row: 1 / span 3; }
  #temps-conj .pack span { font-size: clamp(.78rem, min(calc(var(--ht) * .42), 5cqi), 1.25rem); }
}
/* Écran très bas (téléphone en paysage, format carré) : dans leur cadre, les 8 temps de l'indicatif
   et les 4 du subjonctif passent sur deux colonnes (4 lignes au plus). */
@container (max-height: 380px) and (min-aspect-ratio: 1/1) {
  #temps-conj { --ht: clamp(24px, calc((100cqh - 12rem) / 4 - 1cqh), 48px); }
  #temps-conj .mode-ligne { grid-column: auto; }
  #temps-conj [data-mode="indicatif"] .packs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Indicatif | Subjonctif | Conditionnel au-dessus de l'Impératif. */
  #temps-conj { grid-template-columns: 2fr 1fr 1fr; grid-auto-flow: row; }
  #temps-conj [data-mode="indicatif"] { grid-column: 1; grid-row: 1 / span 2; }
  #temps-conj [data-mode="subjonctif"] { grid-column: 2; grid-row: 1 / span 2; }
  #temps-conj [data-mode="conditionnel"] { grid-column: 3; grid-row: 1; }
  #temps-conj [data-mode="imperatif"] { grid-column: 3; grid-row: 2; }
}
/* … et assez large (téléphone en paysage) : les 4 cadres sur une ligne, le subjonctif aussi sur 2 colonnes. */
@container (max-height: 380px) and (min-width: 600px) {
  #temps-conj { grid-template-columns: 2fr 1fr 2fr 1fr; } /* ordre du HTML : indicatif, conditionnel, subjonctif, impératif */
  #temps-conj .mode-ligne { grid-row: 1 !important; grid-column: auto !important; }
  #temps-conj [data-mode="subjonctif"] .packs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Conjugaison (v6.49) : les groupes de verbes sur l'écran des temps, à côté des modes ; le niveau sur l'écran de la matière. */
#conj-temps .conj-haut { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: clamp(4px, 1.2cqh, 10px) clamp(14px, 3cqi, 32px); }
#groupes .pack span { min-width: 3.2em; justify-content: center; }

/* Phonèmes (v7.3), écran des sons : présenté comme l'écran des temps de la conjugaison. Les catégories en haut,
   puis un cadre par catégorie choisie, ses sons sur deux colonnes : « [p] pomme », lettres du son en gras.
   En largeur : les cadres côte à côte ; en hauteur : Consonnes | Voyelles côte à côte (symbole au-dessus du mot),
   Semi-voyelles en dessous. Les boutons grandissent avec la place libre (9 lignes au plus : les consonnes). */
#phon-sons { height: 100%; display: flex; flex-direction: column; gap: clamp(4px, 1.6cqh, 14px); }
#phon-sons .reglage { margin: 0; }
#phon-sons .conj-haut .reglage-ligne { justify-content: center; flex-wrap: wrap; }
#phon-sons .conj-haut { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: clamp(4px, 1.2cqh, 10px) clamp(10px, 2cqi, 24px); }
#phon-sons .conj-haut .reglage-ligne { width: auto; }
#phon-sons > .reglage:last-child { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#sons-phon {
  --ht: clamp(24px, calc((100cqh - 11rem) / 9 - 1cqh), 60px);
  flex: 1; min-height: 0; display: flex; flex-direction: row; gap: clamp(6px, 1.6cqi, 16px); align-items: flex-start; justify-content: center;
}
#sons-phon .phon-cadre {
  flex: 2 1 0; min-width: 0; display: flex; flex-direction: column; align-items: stretch; gap: clamp(2px, .8cqh, 8px);
  border: var(--contour) solid var(--encre); border-radius: 16px; padding: clamp(4px, 1cqh, 10px) clamp(4px, 1cqi, 10px);
  background: rgb(255 255 255 / .55);
}
#sons-phon .phon-cadre[data-cat="semi"] { flex-grow: 1.15; }
#sons-phon[data-nb="1"] .phon-cadre { flex: 0 1 min(100%, 560px); } /* une seule catégorie : cadre pas trop large */
#sons-phon .phon-cadre[hidden] { display: none; }
.phon-tete { display: flex; align-items: center; justify-content: center; gap: 8px; }
#sons-phon .mode-nom { width: auto; text-align: center; color: var(--encre); font-size: clamp(.78rem, calc(var(--ht) * .42), 1.3rem); }
#sons-phon .btn-tout-famille { min-height: 24px; padding: 0 10px; font-size: .78rem; }
#sons-phon .packs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2px, .7cqh, 8px) clamp(3px, .8cqi, 8px); }
#sons-phon .pack { display: flex; }
#sons-phon .pack span {
  width: 100%; height: var(--ht); min-height: 0; padding: 0 6px; justify-content: center; text-align: center; line-height: 1.05;
  border-radius: 12px; font-size: clamp(.74rem, min(calc(var(--ht) * .4), 2.6cqi), 1.2rem); gap: .35em; white-space: nowrap;
}
.phon-api { font-weight: 800; margin: 0 !important; font-size: 1em !important; font-family: "Charis SIL", "Doulos SIL", "DejaVu Sans", "Segoe UI", system-ui, sans-serif; }
.phon-ex { font-style: normal; font-weight: 500; }
.phon-ex strong { font-weight: 900; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 2px; }
@container (max-aspect-ratio: 1/1) or (max-width: 640px) {
  #sons-phon { --ht: clamp(30px, calc((100cqh - 13rem) / 9 - 1cqh), 64px); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; }
  #sons-phon .phon-cadre[data-cat="semi"] { grid-column: 1 / -1; }
  #sons-phon .phon-cadre[data-cat="semi"] .packs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #sons-phon[data-nb="1"] .phon-cadre { grid-column: 1 / -1; }
  /* Deux cadres côte à côte, deux colonnes chacun : le symbole au-dessus du mot. */
  #sons-phon:not([data-nb="1"]) .phon-cadre:not([data-cat="semi"]) .pack span { flex-direction: column; gap: 0; padding: 0 2px; font-size: clamp(.72rem, min(calc(var(--ht) * .3), 3.6cqi), 1.1rem); }
}
/* Téléphone en paysage ou carré : peu de hauteur ; les boutons restent touchables, le cadre défile s'il le faut. */
@container (max-height: 460px) {
  #sons-phon { --ht: clamp(26px, calc((100cqh - 8rem) / 9 - .5cqh), 44px); overflow-y: auto; }
}
@container (max-width: 400px) {
  #cats-phon-titre { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}
/* Phonèmes (v7.3), écran des jeux : 6 jeux, 3 par ligne en largeur, 2 par ligne en hauteur. */
#reglages-phon { --rangs: 2; --cols: 3; --larg: min(100cqi, 820px);
  --h: clamp(30px, calc((100cqh - 5.2rem) / var(--rangs) - 2cqh), 110px); }
#jeux-phon { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#reglages-phon .pack { display: flex; }
.reglages-joueur #reglages-phon .pack span { border-radius: 18px; }
@container (max-aspect-ratio: 1/1) {
  #reglages-phon { --rangs: 3; --cols: 2; }
  #jeux-phon { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 4. Aventures : la grille au-dessus, le résumé de l'aventure choisie en dessous. */
.etape-aventure { display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.etape-aventure .aventures { flex: 1; min-height: 0; height: auto; }
.aventure {
  position: relative; min-height: 0; display: flex; flex-direction: column; cursor: pointer; overflow: hidden;
  background: #fff; border: var(--contour-gras) solid var(--parchemin-bord); border-radius: 12px;
}
.aventure img { flex: 1 1 0; min-height: 0; width: 100%; object-fit: cover; display: block; }
.aventure-nom { font: 700 clamp(.72rem, 2vmin, 1rem)/1.15 "Rockwell", "Roboto Slab", Georgia, serif; padding: 3px 6px 0; }
.aventure-diff { font-size: clamp(.62rem, 1.6vmin, .78rem); font-weight: 700; padding: 0 6px 4px; color: var(--encre-douce); }
.aventure-diff::before { content: "●"; margin-right: 4px; }
.diff-facile::before { color: #2f8a4e; }
.diff-moyen::before { color: #c98a00; }
.diff-difficile::before { color: var(--rouge); }
/* Aventure choisie : cadre dessiné À L'INTÉRIEUR de la carte (pseudo-élément au-dessus de l'image),
   car la grille coupe ce qui dépasse (v5.3, même correction que pour les aventuriers en v4.7). */
.aventure::after {
  content: ""; position: absolute; inset: 0; border-radius: 8px; pointer-events: none; z-index: 1;
}
.aventure:has(input:checked) { border-color: var(--encre); }
.aventure:has(input:checked)::after { box-shadow: inset 0 0 0 4px var(--rouge); }
.aventure-detail { flex: none; padding-top: 6px; border-top: var(--contour-fin) dashed var(--parchemin-bord); }
.aventure-detail h3 { font-size: 1.05rem; margin-bottom: 2px; }
.aventure-detail p { margin: 0 0 4px; max-width: 60em; font-size: .92rem; line-height: 1.3; }
/* L'histoire est coupée à 2 lignes pour que tout tienne à l'écran. */
.aventure-histoire { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.a-venir { color: var(--encre-douce); font-style: italic; }
.detail-objectif { font-size: 1rem; }
.detail-objectif strong { color: var(--rouge-texte); }

/* ---------- Plateau ---------- */
.plateau-ecran { width: 100%; max-width: 1280px; margin: 0 auto; padding: 8px 12px 16px; }
.barre { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin-bottom: 10px; color: #fff; }
.barre h2 { font-size: clamp(1.1rem, 4.6vw, 1.8rem); text-align: center; text-shadow: 0 2px 0 var(--vert-fonce); }
.barre h2:focus { outline: none; }
.btn-retour {
  justify-self: start; font: inherit; font-weight: 700; color: #fff; cursor: pointer;
  background: var(--vert-fonce); border: var(--contour-fin) solid #fff; border-radius: 99px; padding: 6px 14px; min-height: 44px;
  white-space: nowrap;
}
.table { display: grid; gap: 14px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) {
  .table { grid-template-columns: minmax(0, 1fr) 300px; }
}

.plateau {
  position: relative; margin: 0; border-radius: var(--radius); overflow: hidden;
  border: var(--contour-gras) solid var(--parchemin); box-shadow: 0 6px 18px rgb(0 0 0 / .3);
  background: var(--ciel);
}
.plateau img { display: block; width: 100%; height: auto; }
/* Parchemin blanc du plateau (v11.17 : les 10 plateaux l'ont au même endroit, x 38,5 à 58 %, y 62,5 à 82 %).
   v11.18 (choix du 03/12/2026, disposition E de la page de test) : la flamme (ou la construction de l'aventure) occupe le parchemin ;
   le comptage est une pastille posée juste dessous (voir .points-plateau). Aucune écriture sur le parchemin.
   Tailles en cqw (% de la largeur du plateau) pour suivre l'image à toutes les tailles. */
.plateau { container-type: inline-size; }
.parchemin-cadre {
  position: absolute; left: 37.9%; top: 63.6%; width: 21.6%; height: 18.1%; z-index: 3;
  padding: .4cqw; border-radius: .8cqw;
}
.cases { list-style: none; margin: 0; padding: 0; }
.case { position: absolute; width: 1px; height: 1px; }
.pions { position: absolute; inset: 0; pointer-events: none; z-index: 4; } /* personnages devant l'encadré des points */
/* Pion : le personnage debout sur la case. Le point (left/top) est sous ses pieds ;
   un socle ovale à la couleur du joueur l'identifie. Dessins : js/figurines.js. */
.pion {
  position: absolute; width: clamp(24px, 4.6%, 58px); aspect-ratio: 1 / 2;
  transform: translate(-50%, -94%);
  /* Le déplacement d'une case à l'autre suit la route (js/plateau.js → marcher), sans transition CSS. */
}
.pion.devant { z-index: 1; } /* les deux personnages du premier rang passent devant ceux du fond */
.pion-actif { z-index: 3; }
.socle {
  position: absolute; left: -6%; right: -6%; bottom: -4%; height: 15%; border-radius: 50%;
  background: var(--c); border: var(--contour-fin) solid var(--encre); box-shadow: 0 3px 4px rgb(0 0 0 / .35);
}
.pion-actif .socle { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--encre), 0 4px 6px rgb(0 0 0 / .4); }
/* Arrivée des personnages sur le plateau : seulement quand ils sont posés (classe « arrive », retirée ensuite).
   Sinon, la fin de l'animation « Bravo ! » / « Oups ! » relançait cette arrivée au moment du dé :
   le personnage disparaissait puis réapparaissait sur sa croix (corrigé en v4.5). */
.figurine { position: absolute; inset: 0 0 4% 0; }
.pion.arrive .figurine { animation: poser .5s ease-out backwards; }
.figurine-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.pion.arrive:nth-child(2) .figurine { animation-delay: .08s; }
.pion.arrive:nth-child(3) .figurine { animation-delay: .16s; }
.pion.arrive:nth-child(4) .figurine { animation-delay: .24s; }
@keyframes poser { from { transform: translateY(-40%); opacity: 0; } }
/* Le personnage regarde dans le sens de la marche (propriété « scale », indépendante des animations). */
.pion.gauche .figurine-svg { scale: -1 1; }
/* Marche : les jambes se balancent en alternance, le corps se dandine et monte et descend à chaque pas.
   Chaque personnage est son illustration découpée en corps + 2 jambes (js/figurines.js, outils/personnages.py) ;
   le point de pivot (hanche) est donné dans le SVG. Les bras tiennent des objets : ils restent avec le corps. */
.pion.marche .jambe-g { animation: pas .3s ease-in-out infinite alternate; }
.pion.marche .jambe-d { animation: pas .3s ease-in-out infinite alternate-reverse; }
.pion.marche .corps { animation: dandine .3s ease-in-out infinite alternate; }
.pion.marche .figurine-svg { animation: hop .15s ease-in-out infinite alternate; }
@keyframes pas { from { transform: rotate(-16deg); } to { transform: rotate(16deg); } }
@keyframes dandine { from { transform: rotate(-3deg); } to { transform: rotate(3deg); } }
@keyframes hop { to { transform: translateY(-3%); } }
@media (prefers-reduced-motion: reduce) { .figurine, .pion.arrive .figurine, .pion.marche .figurine-svg, .pion.marche .figurine-svg * { animation: none; } }
.pion-rouge { --c: var(--rouge); }
.pion-jaune { --c: #f2c400; }
.pion-bleu { --c: #2e55c9; }
.pion-vert { --c: var(--vert-pion); }

/* Comptage des points : pastille posée sous le parchemin (v11.18 ; avant : encadré en haut à gauche).
   L'icône est la forme de l'aventure (flamme, pierre…) ; titre, unité et nom de l'aventure restent pour les lecteurs d'écran. */
.points-plateau {
  position: absolute; left: 38.2%; top: 82%; width: 21.1%; z-index: 3;
  display: flex; align-items: center; gap: .8cqw; padding: .4cqw 1cqw;
  background: rgb(246 238 219 / .95); border: var(--contour) solid var(--encre); border-radius: 99px;
  box-shadow: 0 .3cqw 0 rgb(0 0 0 / .25);
}
.points-icone { flex: none; width: max(12px, 2.6cqw); height: auto; aspect-ratio: 1; }
.points-plateau .points-valeur { display: flex; align-items: baseline; gap: .5cqw; white-space: nowrap; font-size: max(11px, 2.4cqw); margin: 0; line-height: 1; }
.points-plateau .points-sur { font-size: max(9px, 1.32cqw); }
.points-plateau .jauge { flex: 1; min-width: 0; height: max(5px, .4cqw); margin: 0; }
.points-plateau .jauge span { background: var(--feu); }
.points-plateau .jauge.atteint span { background: #1f7a3a; }
.points-valeur.gagne { animation: gonfle .6s ease-out; }
/* Construction de l'aventure sur le parchemin : les étapes apparaissent au fil des points.
   Le dessin (200 × 120) est recadré pour remplir le cadre (preserveAspectRatio « slice », posé par js/plateau.js). */
.construction {
  width: 100%; height: 100%; border-radius: .5cqw; overflow: hidden; background: #3d2416; border: .22cqw solid var(--encre);
}
.construction svg { display: block; width: 100%; height: 100%; }
.construction .etape { opacity: .14; filter: grayscale(1); transition: opacity .4s, filter .4s; } /* en filigrane : ce qu'il reste à construire */
.construction .etape.vue { opacity: 1; filter: none; }
.construction .etape.nouvelle { animation: pose-etape .7s ease-out; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes pose-etape { from { transform: translateY(-18px) scale(.8); opacity: 0; } }
/* v11.18 : plus de contour doré quand l'objectif est atteint (demande du 03/12/2026). */
/* Envol des points (v10.15) : calque au-dessus du plateau, formes qui volent, éclat à l'arrivée, image qui reçoit. */
.envol-couche { position: absolute; inset: 0; z-index: 6; pointer-events: none; overflow: hidden; }
.envol-forme { position: absolute; transform-origin: 50% 50%; will-change: transform; filter: drop-shadow(0 3px 3px rgb(0 0 0 / .35)); }
.envol-eclat { position: absolute; border: var(--contour-gras) solid #ffd23f; border-radius: 50%; transform-origin: 50% 50%; }
.construction.recoit { animation: construction-recoit .34s ease-out; }
@keyframes construction-recoit { 40% { transform: scale(1.08); box-shadow: 0 0 0 5px #ffd23f; } }
@media (prefers-reduced-motion: reduce) { .construction.recoit { animation: none; } }
@media (prefers-reduced-motion: reduce) { .construction .etape.nouvelle { animation: none; } }
@keyframes gonfle { 40% { transform: scale(1.35); } }

/* Dé en 3D qui roule sur le plateau (cube CSS de 6 faces). */
.de-plateau {
  position: absolute; left: 50%; top: 58%; z-index: 5; width: clamp(48px, 9cqw, 96px); aspect-ratio: 1;
  margin: calc(clamp(48px, 9cqw, 96px) / -2) 0 0 calc(clamp(48px, 9cqw, 96px) / -2);
  perspective: 600px;
}
/* Le dé se range en glissant quand il cacherait le message (js/plateau.js → degagerDe). */
.de-plateau { transition: top .3s ease-out, left .3s ease-out; }
@media (prefers-reduced-motion: reduce) { .de-plateau { transition: none; } }
.de3d { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; }
.de3d .face {
  position: absolute; inset: 0; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 14%; gap: 2%;
  background: #fffdf6; border: var(--contour) solid var(--encre); border-radius: 18%;
  box-shadow: inset -5px -6px 0 rgb(0 0 0 / .12);
  /* Les faces tournées vers l'arrière sont masquées : leurs coins carrés ne dépassent plus
     des coins arrondis de la face visible (v4.4). */
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.de3d-fort .face { background: #fff3c4; }
.de3d .face i { width: 70%; aspect-ratio: 1; border-radius: 50%; place-self: center; background: #000; } /* points noirs (v5.1) */
.face-avant { transform: translateZ(calc(clamp(48px, 9cqw, 96px) / 2)); }
.face-arriere { transform: rotateY(180deg) translateZ(calc(clamp(48px, 9cqw, 96px) / 2)); }
.face-droite { transform: rotateY(90deg) translateZ(calc(clamp(48px, 9cqw, 96px) / 2)); }
.face-gauche { transform: rotateY(-90deg) translateZ(calc(clamp(48px, 9cqw, 96px) / 2)); }
.face-haut { transform: rotateX(90deg) translateZ(calc(clamp(48px, 9cqw, 96px) / 2)); }
.face-bas { transform: rotateX(-90deg) translateZ(calc(clamp(48px, 9cqw, 96px) / 2)); }
.de-plateau::after {
  content: ""; position: absolute; left: 10%; right: 10%; bottom: -14%; height: 18%; border-radius: 50%;
  background: rgb(0 0 0 / .35); filter: blur(4px); z-index: -1;
}
.de-gain {
  position: absolute; left: 118%; top: 50%; margin: 0; transform: translateY(-50%);
  font: 800 clamp(1.3rem, 4cqw, 2.6rem)/1 "Rockwell", "Roboto Slab", Georgia, serif; color: #fff;
  text-shadow: 0 2px 0 var(--encre), 0 0 8px var(--encre);
}
.de-plateau.pose .de-gain { animation: monte .8s ease-out; }
@keyframes monte { from { opacity: 0; transform: translate(-40%, -50%) scale(.6); } }
@media (prefers-reduced-motion: reduce) { .de-plateau.pose .de-gain { animation: none; } }

/* Réaction à la réponse, posée sur le pion du joueur. */
.reaction { position: absolute; z-index: 6; width: 0; height: 0; pointer-events: none; }
.reaction-texte {
  position: absolute; left: 0; bottom: clamp(18px, 3.4cqw, 40px); transform: translateX(-50%); white-space: nowrap;
  padding: 3px 10px; border-radius: 99px; border: var(--contour) solid var(--encre);
  font: 800 clamp(.85rem, 2.2cqw, 1.4rem)/1.1 "Rockwell", "Roboto Slab", Georgia, serif;
  animation: bulle 1.5s ease-out forwards;
}
.reaction.bonne .reaction-texte { background: #1f7a3a; color: #fff; }
.reaction.mauvaise .reaction-texte { background: #fff; color: var(--rouge-texte); }
@keyframes bulle {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(.6); }
  20% { opacity: 1; transform: translate(-50%, 0) scale(1.1); }
  80% { opacity: 1; transform: translate(-50%, -6px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -14px) scale(1); }
}
.reaction i {
  position: absolute; left: -4px; top: -4px; width: 8px; height: 12px; border-radius: 2px; opacity: 0;
  animation: confetti 1.1s ease-out forwards;
}
@keyframes confetti {
  0% { opacity: 1; transform: translate(0, 0) rotate(0); }
  100% { opacity: 0; transform: translate(var(--dx), calc(var(--dy) + 40px)) rotate(540deg); }
}
.pion.saute .figurine { animation: saute .7s ease-out; }
@keyframes saute { 30% { transform: translateY(-30%); } 55% { transform: none; } 70% { transform: translateY(-12%); } }
.pion.secoue .figurine { animation: secoue .6s ease-in-out; }
@keyframes secoue { 20%, 60% { transform: translateX(-12%) rotate(-6deg); } 40%, 80% { transform: translateX(12%) rotate(6deg); } }
@media (prefers-reduced-motion: reduce) {
  .pion.saute .figurine, .pion.secoue .figurine, .reaction i { animation: none; }
  .reaction i { display: none; }
  .reaction-texte { animation: none; }
}

/* Message écrit sur le plateau : points gagnés et joueur suivant. */
.bandeau {
  position: absolute; left: 50%; top: 30%; z-index: 4; transform: translate(-50%, -50%);
  max-width: 82%; margin: 0; padding: clamp(6px, 1.4cqw, 16px) clamp(10px, 2.4cqw, 28px); text-align: center;
  background: var(--encre); color: #fff; border: var(--contour) solid #fff; border-radius: 14px;
  font: 800 clamp(.9rem, 2.6cqw, 1.7rem)/1.25 "Rockwell", "Roboto Slab", Georgia, serif;
  box-shadow: 0 6px 18px rgb(0 0 0 / .45);
}
.bandeau.montre { animation: apparait .35s ease-out; }
@keyframes apparait { from { opacity: 0; transform: translate(-50%, -30%) scale(.9); } }
@media (prefers-reduced-motion: reduce) { .bandeau.montre, .points-valeur.gagne { animation: none; } }
/* Petit plateau (téléphone) : le message passe en bas pour ne cacher ni les points ni le dé. */
@container (max-width: 620px) {
  .bandeau { top: auto; bottom: 3%; transform: translateX(-50%); max-width: 92%; }
  .bandeau.montre { animation-name: apparait-bas; }
}
@keyframes apparait-bas { from { opacity: 0; transform: translate(-50%, 20%); } }

/* ---------- Tour de jeu ---------- */
.tour-joueur { display: flex; align-items: center; gap: 10px; }
.tour-joueur img { width: 56px; height: 62px; border-radius: 10px; border: var(--contour) solid var(--c); background: #fff; }
.tour-joueur p { margin: 0; font-size: 1.1rem; }
.carte-piochee {
  margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; border: var(--contour) solid var(--encre);
  background: #fff; box-shadow: inset 0 0 0 5px var(--c);
}
.carte-piochee p { margin: 0; }
.carte-entete { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
/* Titre de la carte = son thème (ex. « Numérique · Mot mélangé »), écrit gros (v6.27). */
.carte-titre { font-weight: 800; font-size: 1.3rem; line-height: 1.25; }
.btn-ecouter {
  flex: none; font: inherit; font-weight: 700; cursor: pointer; min-height: 44px; padding: 6px 12px;
  background: var(--encre); color: #fff; border: var(--contour-fin) solid var(--encre); border-radius: 99px;
}
.btn-ecouter:disabled { opacity: .5; cursor: not-allowed; }
/* « Écouter » et « Voir le mot » l'un sous l'autre, même largeur. */
.carte-outils { flex: none; display: flex; flex-direction: column; gap: 6px; }
.carte-outils .btn-ecouter { white-space: nowrap; }
.carte-outils [hidden] { display: none; }
#btn-phrase .court { display: none; }
/* Carte étroite (panneau à droite du plateau sur ordinateur) : « 💬 Phrase » au lieu de « Phrase d'exemple » (v6.40). */
.carte-piochee { container-type: inline-size; }
@container (max-width: 420px) {
  #btn-phrase .long { display: none; }
  #btn-phrase .court { display: inline; }
}
.carte-consigne { margin-top: 8px !important; font-weight: 600; }
.carte-mot {
  margin: 6px 0 !important; text-align: center; font: 800 clamp(1.5rem, 6vw, 2.1rem)/1.2 "Rockwell", "Roboto Slab", Georgia, serif;
  letter-spacing: .04em; overflow-wrap: anywhere;
}
.carte-mot.cache { letter-spacing: .15em; color: var(--encre-douce); }
.carte-mot.montre { letter-spacing: .12em; } /* lettre manquante (B_NANE), lettres mélangées (v6.17) */
.carte-mot.lettre { font-size: 4rem; }
.carte-reponse { margin: 0 0 8px !important; text-align: center; font-weight: 700; color: #1f5a2f; }
.carte-mot.calcul { letter-spacing: .02em; font-size: clamp(1.3rem, 5.4vw, 2rem); overflow-wrap: normal; }
.carte-reponse.fausse { color: var(--rouge-texte); }
.carte-reponse.alerte { color: var(--rouge-texte); font-weight: 600; }
/* Mot mélangé (v6.52) : lettres à toucher en haut, une case par lettre en bas. Cases de 52 px au plus,
   plus petites si le mot est long ou la carte étroite (--n = nombre de lettres). */
.carte-lettres { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 10px 0 8px; }
.carte-lettres[hidden] { display: none; }
.lettres-rangee { width: 100%; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; container-type: inline-size; }
.lettres-reponse { padding-top: 12px; border-top: var(--contour-fin) dashed var(--parchemin-bord); }
/* Taille d'une case : partage la largeur entre les lettres, entre 32 px (au-delà, passage à la ligne) et 52 px. */
.lettre-tuile, .lettre-trou, .lettre-case {
  --t: clamp(32px, calc((100cqw - (var(--n, 6) - 1) * 6px) / var(--n, 6)), 52px);
  flex: none; width: var(--t); height: var(--t); padding: 0; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font: 800 calc(var(--t) * .55)/1 "Rockwell", "Roboto Slab", Georgia, serif; color: var(--encre);
}
.lettre-tuile { background: #fff; border: var(--contour) solid var(--encre); box-shadow: 0 var(--ombre) 0 var(--encre); cursor: pointer; touch-action: manipulation; }
.lettre-tuile:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--encre); }
.lettre-trou { border: var(--contour) dashed var(--parchemin-bord); }
.lettre-case { border: var(--contour) dashed var(--encre-douce); background: var(--parchemin); }
.lettre-case.suivante { border-style: solid; border-color: var(--bleu); box-shadow: 0 0 0 3px rgba(28, 52, 115, .25); }
.lettre-case.pleine { border-style: solid; border-color: var(--encre); background: #fff; box-shadow: 0 var(--ombre) 0 var(--encre); cursor: pointer; touch-action: manipulation; }
.lettre-volante {
  position: fixed; z-index: 50; pointer-events: none; display: flex; align-items: center; justify-content: center;
  background: #fff; border: var(--contour) solid var(--encre); border-radius: 10px; color: var(--encre); font-weight: 800;
  font-family: "Rockwell", "Roboto Slab", Georgia, serif; transition: left .2s ease, top .2s ease, width .2s ease, height .2s ease;
}
.btn-remettre { min-height: 44px; padding: 6px 16px; }
.btn-remettre:disabled { opacity: .5; cursor: default; }
/* ---------- Grammaire (v6.54) : boutons de réponse, mots en bulles, colonnes à relier ---------- */
.carte-gram { margin: 10px 0 8px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.carte-gram[hidden] { display: none; }
.gram-mot { margin: 0 !important; font: 800 clamp(1.5rem, 6vw, 2rem)/1.2 "Rockwell", "Roboto Slab", Georgia, serif; text-align: center; overflow-wrap: anywhere; }
.gram-phrase { margin: 0 !important; font-size: 1.2rem; line-height: 1.7; text-align: center; }
.gram-trou { display: inline-block; min-width: 3.2em; border-bottom: var(--contour) solid var(--bleu); margin: 0 .2em; vertical-align: baseline; }
.gram-trou.rempli { min-width: 0; padding: 0 .3em; border-radius: 6px; border: var(--contour-fin) solid currentColor; font-weight: 800; }
.gram-trou.juste, .gram-ligne.juste .gram-bulle { color: #1f5a2f; }
.gram-trou.fausse { color: var(--rouge-texte); }
.gram-cible { background: var(--jaune); color: var(--encre); font-weight: 800; padding: 0 .25em; border-radius: 6px; box-shadow: 0 0 0 2px var(--encre); }
.gram-choix { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: 100%; }
.gram-bouton {
  min-height: 48px; min-width: 88px; padding: 6px 14px; font: 700 1.1rem/1.2 system-ui, sans-serif; color: var(--encre); cursor: pointer;
  background: #fff; border: var(--contour) solid var(--encre); border-radius: 12px; box-shadow: 0 var(--ombre) 0 var(--encre); touch-action: manipulation;
}
.gram-bouton:active:not(:disabled), .gram-bulle:active:not(:disabled), .gram-mot-relier:active:not(:disabled) { transform: translateY(1px); box-shadow: 0 1px 0 var(--encre); }
.gram-bouton:disabled, .gram-bulle:disabled, .gram-mot-relier:disabled { cursor: default; }
.gram-bouton.bonne, .gram-bulle.bonne { background: #e3f3e6; border-color: #1e7b45; color: #1f5a2f; box-shadow: 0 4px 0 #1e7b45; }
.gram-bouton.fausse, .gram-bulle.fausse { background: #fbe6e6; border-color: var(--rouge-texte); color: var(--rouge-texte); box-shadow: 0 4px 0 var(--rouge-texte); }
.gram-bulle.bonne { text-decoration: line-through; text-decoration-thickness: 2px; }
/* Mots en bulles (Remettre la phrase, Trouve l'erreur). */
.gram-bulles, .gram-ligne { width: 100%; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 6px; }
.gram-ligne { min-height: 52px; padding: 10px 4px 0; border-top: var(--contour-fin) dashed var(--parchemin-bord); }
.gram-bulle {
  min-height: 44px; padding: 4px 12px; font: 700 1.1rem/1.2 system-ui, sans-serif; color: var(--encre); cursor: pointer;
  background: #fff; border: var(--contour) solid var(--encre); border-radius: 99px; box-shadow: 0 var(--ombre) 0 var(--encre); touch-action: manipulation;
  overflow-wrap: anywhere; max-width: 100%;
}
.gram-bulle.trou { visibility: visible; color: transparent; background: none; border-style: dashed; border-color: var(--parchemin-bord); box-shadow: none; cursor: default; display: inline-flex; align-items: center; }
.gram-bulle.posee { background: var(--parchemin); }
span.gram-bulle.posee { display: inline-flex; align-items: center; cursor: default; }
.gram-ligne.fausse .gram-bulle { border-color: var(--rouge-texte); color: var(--rouge-texte); }
.gram-ligne.juste .gram-bulle { border-color: #1e7b45; }
.gram-suivant { width: 56px; height: 44px; border: var(--contour) solid var(--bleu); border-radius: 99px; box-shadow: 0 0 0 3px rgba(28, 52, 115, .25); }
.gram-fin { font: 800 1.4rem/1 system-ui, sans-serif; align-self: flex-end; padding-bottom: 6px; }
/* Relier les paires : deux colonnes, les traits dessinés entre elles (SVG). */
.gram-relier { position: relative; width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) clamp(28px, 12%, 72px) minmax(0, 1fr); align-items: stretch; }
.gram-col { display: flex; flex-direction: column; gap: 6px; }
.gram-col:first-child { grid-column: 1; }
.gram-col:last-child { grid-column: 3; }
.gram-traits { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.gram-mot-relier {
  position: relative; min-height: 40px; padding: 4px 8px; display: flex; align-items: center; justify-content: center; gap: 6px;
  font: 700 1rem/1.15 system-ui, sans-serif; color: var(--encre); cursor: pointer; text-align: center;
  background: #fff; border: var(--contour) solid var(--encre); border-radius: 10px; box-shadow: 0 var(--ombre) 0 var(--encre); touch-action: manipulation;
}
.gram-texte { min-width: 0; overflow-wrap: anywhere; }
.gram-mot-relier.choisi { background: var(--jaune); box-shadow: 0 0 0 3px var(--bleu); }
.gram-mot-relier.lie { border-color: var(--lien); box-shadow: 0 3px 0 var(--lien); }
.gram-mot-relier.juste { background: #e3f3e6; }
.gram-mot-relier.fausse { background: #fbe6e6; }
.gram-num { flex: none; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--lien); color: #fff; font: 800 .8rem/1 system-ui, sans-serif; }
.gram-relier.corrige .gram-num { display: none; }
/* Phonèmes (v7.3) dans la carte : le mot en grand, les lettres du son en couleur, encadrées et en gras. */
.phon-mot { font-size: clamp(1.8rem, 8vw, 2.6rem); letter-spacing: .02em; }
.phon-lettres { background: #ffe9a8; color: var(--rouge-texte); font-weight: 900; padding: 0 .08em; border-radius: 6px; box-shadow: 0 0 0 3px var(--rouge-texte); }
.phon-trou { min-width: 1.6em; }
.gram-bouton .phon-api { font-size: 1.15em !important; }
.gram-bouton .phon-ex, .gram-mot-relier .phon-ex { font-size: .85em; color: var(--encre-douce); }
.gram-bouton.bonne .phon-ex, .gram-bouton.fausse .phon-ex { color: inherit; }
/* Trier les mots : deux colonnes, chacune avec son son en tête (bouton « ranger ici »). */
.phon-colonnes { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.phon-colonne { display: flex; flex-direction: column; gap: 6px; border: var(--contour) dashed var(--parchemin-bord); border-radius: 14px; padding: 6px; min-height: 120px; }
.phon-col-tete {
  min-height: 48px; padding: 4px 8px; font: 700 1.1rem/1.2 system-ui, sans-serif; color: var(--encre); cursor: pointer;
  background: #fff; border: var(--contour) solid var(--encre); border-radius: 10px; box-shadow: 0 var(--ombre) 0 var(--encre); touch-action: manipulation;
}
.phon-col-tete:disabled { cursor: default; opacity: 1; }
.phon-reste:has(.choisi) ~ .phon-colonnes .phon-col-tete:not(:disabled) { background: var(--jaune); box-shadow: 0 0 0 3px var(--bleu); }
.phon-col-mots { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.gram-bulle.choisi { background: var(--jaune); box-shadow: 0 0 0 3px var(--bleu); }
.phon-reste { min-height: 44px; }
.phon-aide { margin: 0 !important; font-size: .9rem; color: var(--encre-douce); }
/* Réponse écrite par le joueur (calcul, v5.7) : la case et « Valider » sur une ligne. */
.carte-saisie { margin: 4px 0 8px; }
.carte-saisie label { display: block; font-weight: 700; margin-bottom: 4px; }
.saisie-ligne { display: flex; gap: 8px; }
.saisie-ligne input {
  flex: 1 1 0; width: 0; min-width: 0; min-height: 48px; padding: 6px 12px; font: 700 1.3rem/1.2 system-ui, sans-serif; color: var(--encre);
  background: #fff; border: var(--contour) solid var(--encre); border-radius: 10px;
}
.saisie-ligne input:disabled { background: var(--parchemin); }
.saisie-ligne input[aria-invalid="true"] { border-color: var(--rouge-texte); }
.saisie-ligne .btn { flex: none; min-height: 48px; padding: 6px 16px; }
.saisie-ligne .btn:disabled { opacity: .6; cursor: default; }
/* Contour de focus serré sur la case de réponse (v6.26) : le contour général (3 px + 3 px d'écart + ombre de 6 px)
   débordait sur le cadre de couleur de la carte, surtout sur téléphone quand la carte est en grand au-dessus du clavier.
   Ici : contour jaune collé à la case (son bord foncé fait déjà le contraste), qui reste dans la marge intérieure de la carte. */
.saisie-ligne input:focus-visible { outline: 3px solid var(--jaune); outline-offset: 0; box-shadow: none; }
.carte-mot.conj { font-size: clamp(1.3rem, 5.4vw, 1.9rem); letter-spacing: .02em; }
.temps-carte { display: inline-block; padding: 0 8px; border-radius: 99px; background: var(--parchemin); border: 1px solid var(--parchemin-bord); font-size: .9rem; }
/* Correction et « ? » (tableau de conjugaison) côte à côte. */
.carte-correction { display: flex; align-items: center; justify-content: center; gap: 8px; }
.carte-correction .carte-reponse { margin-bottom: 0 !important; }
.carte-correction:has(.carte-reponse:not([hidden])) { margin-bottom: 8px; }
.btn-aide {
  flex: none; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; font: 900 1.4rem/1 system-ui, sans-serif;
  background: var(--jaune); color: var(--encre); border: var(--contour) solid var(--encre); box-shadow: 0 var(--ombre) 0 var(--encre);
}
.btn-aide[aria-expanded="true"] { background: var(--encre); color: #fff; }
.btn-aide[hidden] { display: none; }
.carte-tableau {
  list-style: none; margin: 0 0 8px; padding: 8px 12px; display: grid; grid-template-rows: repeat(3, auto); grid-auto-flow: column; gap: 2px 14px;
  background: var(--parchemin); border: var(--contour-fin) solid var(--parchemin-bord); border-radius: 10px; font-weight: 600;
}
.carte-tableau[hidden] { display: none; }
/* Colonne je / tu / il, puis nous / vous / ils ; une seule colonne si la carte est étroite. */
/* Une seule colonne seulement si la carte est trop étroite pour deux (v6.2 : deux colonnes gagnent de la hauteur). */
.carte-piochee { container-type: inline-size; }
@container (max-width: 340px) { .carte-tableau { grid-template-rows: none; grid-auto-flow: row; } }
@container (max-width: 440px) { .carte-tableau { font-size: .88rem; gap: 0 10px; padding: 6px 10px; } }
.carte-tableau .demande { color: var(--rouge-texte); font-weight: 800; }
.carte-mot .muette { color: var(--rouge-texte); text-decoration: underline wavy; text-underline-offset: 4px; }
.carte-boutons { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.btn-voir {
  display: block; margin: 0; font: inherit; font-weight: 700; cursor: pointer; min-height: 40px; padding: 4px 14px;
  background: #fff; color: var(--encre); border: var(--contour-fin) solid var(--encre); border-radius: 99px;
}
.tour-consigne { margin: 10px 0 0; font-weight: 600; min-height: 1.4em; }
.tour-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.tour-actions .btn { flex: 1 1 auto; min-height: 48px; padding: 10px 14px; font-size: 1rem; }

/* ---------- Panneau de la table de jeu ---------- */
.panneau {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
@media (min-width: 900px) { .panneau { grid-template-columns: 1fr; } }
.bloc {
  background: var(--parchemin); border: var(--contour) solid var(--encre); border-radius: var(--radius);
  padding: 12px 14px; box-shadow: 0 3px 0 rgb(0 0 0 / .25);
}
.bloc h3 { font-size: 1.05rem; margin-bottom: 8px; letter-spacing: .02em; }
.points { text-align: center; }
.points-valeur { margin: 0; font: 800 2.6rem/1 "Rockwell", "Roboto Slab", Georgia, serif; color: var(--rouge); } /* une seule écriture, en rouge (pas d’ombre décalée qui doublait le chiffre) */
.points-sur { font-size: 1.3rem; color: var(--encre); text-shadow: none; }
.jauge { height: 12px; margin: 10px 0 0; background: #fff; border: var(--contour-fin) solid var(--encre); border-radius: 99px; overflow: hidden; }
.jauge.atteint span { background: #1f7a3a; }
.jauge span { display: block; height: 100%; width: 0; background: var(--rouge); transition: width .4s; }
.points-objectif { margin: 8px 0 0; font-size: .95rem; font-weight: 600; color: var(--encre); }

.joueurs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.joueurs li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; font-weight: 600; }
.joueur-couleur { font-weight: 400; color: var(--encre-douce); }
#joueurs li.actif { background: #fff; border-radius: 10px; box-shadow: 0 0 0 2px var(--encre); }
#joueurs li { padding: 3px 6px; }
.joueur-case { font-size: .78rem; font-weight: 700; color: var(--encre); background: #fff; border: 1px solid var(--parchemin-bord); border-radius: 99px; padding: 1px 8px; }
.portrait-mini { width: 34px; height: 37px; border-radius: 8px; border: var(--contour) solid var(--c); background: #fff; }
.pion-mini { width: 22px; height: 22px; border-radius: 50%; border: var(--contour-fin) solid #1d1510; box-shadow: inset -2px -3px 0 rgb(0 0 0 / .2); }

/* Dés : faces blanches à points de couleur (comme le dé illustré sur la boîte).
   Les points sont placés sur une grille 3 × 3 (js/des.js → POINTS). */
.des { display: flex; gap: 12px; justify-content: center; }
.de-btn {
  flex: 1; max-width: 130px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font: inherit; color: var(--encre); cursor: pointer; padding: 8px 4px 6px;
  background: #fff; border: var(--contour-fin) solid var(--parchemin-bord); border-radius: 12px;
}
.de-btn:hover:not(:disabled) { border-color: var(--encre); }
.de-btn:disabled { cursor: default; opacity: .55; }
.de-btn.a-lancer { border-color: var(--encre); box-shadow: 0 0 0 4px var(--rouge); opacity: 1; }
.de {
  display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 7px; gap: 2px;
  width: 58px; height: 58px; margin-bottom: 4px;
  background: #fff; border: var(--contour) solid var(--encre); border-radius: 12px;
  box-shadow: inset -4px -5px 0 #d9d2c4, 0 3px 0 rgb(0 0 0 / .25);
  transform: rotate(-6deg);
}
.de-fort { transform: rotate(7deg); background: #fff3c4; box-shadow: inset -4px -5px 0 #e6d38f, 0 3px 0 rgb(0 0 0 / .25); }
.de i { width: 10px; height: 10px; border-radius: 50%; place-self: center; background: var(--encre); }
.de i:nth-of-type(3n+1) { background: var(--rouge); }
.de i:nth-of-type(3n+2) { background: var(--bleu); }
.de i:nth-of-type(3n) { background: #c99a00; }
.de.roule { animation: rouler .6s ease-out; }
@keyframes rouler {
  0% { transform: rotate(0) scale(1); }
  40% { transform: rotate(200deg) scale(1.15); }
  100% { transform: rotate(360deg) scale(1); }
}
@media (prefers-reduced-motion: reduce) { .de.roule { animation: none; } }
.de-nom { font-size: .9rem; }
.de-faces { font-size: .78rem; color: var(--encre-douce); }
.de-resultat { margin: 10px 0 0; text-align: center; font-weight: 700; min-height: 1.4em; }

/* Piles de cartes : couleurs des emplacements du plateau. */
.cartes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 64px)); justify-content: center; gap: 10px; }
.pile { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: .72rem; font-weight: 700; text-align: center; line-height: 1.15; }
.carte {
  position: relative; display: block; width: 100%; max-width: 54px; aspect-ratio: 5 / 7; border-radius: 6px;
  border: 3px solid var(--parchemin); outline: 2px solid var(--encre);
  box-shadow: 3px 3px 0 var(--parchemin), 3px 3px 0 2px var(--encre), 6px 6px 0 var(--parchemin), 6px 6px 0 2px var(--encre);
  margin: 2px 8px 8px 0;
}
.pile.a-piocher .carte { animation: piocher 1.2s ease-in-out infinite; }
@keyframes piocher { 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .pile.a-piocher .carte { animation: none; outline-width: 4px; } }
.pile-rouge .carte { background: var(--rouge); }
.pile-jaune .carte { background: var(--jaune); }
.pile-bleu .carte { background: var(--bleu); }
.pile-vert .carte { background: var(--vert-pion); }

.ambiance { display: flex; gap: 8px; }
.ambiance-btn {
  flex: 1; font: inherit; font-weight: 700; cursor: pointer; min-height: 44px; border-radius: 10px;
  background: #fff; color: var(--encre); border: var(--contour-fin) solid var(--encre);
}
.ambiance-btn[aria-pressed="true"] { background: var(--encre); color: #fff; }

/* ---------- Fin de partie ---------- */
.fin {
  max-width: min(460px, calc(100vw - 32px)); border: var(--contour-gras) solid var(--encre); border-radius: var(--radius);
  padding: 22px; text-align: center; background: var(--parchemin); color: var(--encre);
}
.fin::backdrop { background: rgb(0 0 0 / .5); }
.fin-icone { font-size: 3.5rem; margin: 0; line-height: 1; }
.fin h2 { font-size: 1.7rem; margin: 8px 0; }
.fin.gagne h2 { color: #1f7a3a; }
.fin.perdu h2 { color: var(--rouge-texte); }
.fin-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 16px; }

/* ---------- Menu de la partie (v6.22) ---------- */
.menu-icone { font-size: 1.15em; line-height: 1; }
.menu-partie { position: fixed; inset: 0; margin: auto; width: min(360px, calc(100vw - 32px)); padding: 18px 22px 22px; }
.menu-partie h2 { margin: 0 0 14px; }
.menu-actions { display: flex; flex-direction: column; gap: 10px; }
.menu-actions .btn { width: 100%; }
.menu-actions[hidden], .menu-confirmer[hidden] { display: none; }
.menu-confirmer p { margin: 0 0 14px; font-weight: 700; line-height: 1.4; }
.menu-fermer {
  position: absolute; top: 6px; right: 6px; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: transparent; color: var(--encre); font: inherit; font-size: 1.3rem; cursor: pointer;
}
.menu-fermer:hover { background: rgb(0 0 0 / .08); }
@media (max-height: 420px) {
  .menu-partie { padding: 10px 16px 14px; }
  .menu-partie h2 { font-size: 1.3rem; margin-bottom: 8px; }
  .menu-actions { gap: 6px; }
  .menu-actions .btn { min-height: 44px; padding-block: 4px; }
}

/* ---------- Pied de page + version ---------- */
.pied { text-align: center; color: #fff; font-size: .9rem; padding: 10px 16px calc(14px + env(safe-area-inset-bottom)); text-shadow: 0 1px 3px rgb(0 0 0 / .7); } /* v10.95 : transparent, le fond vert passe dessous */
/* Lien obligatoire vers les mentions légales (LCEN), commun au site ludo-aventura.fr. */
.pied-lien { color: #fff; text-underline-offset: 2px; }
/* Petits téléphones : le nom du jeu est déjà en haut de l'écran ; le retirer garde le pied sur une ligne. */
@media (max-width: 440px) { .pied-marque, .pied-sep { display: none; } }
.pied p { margin: 0; display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; }
.version-badge {
  font: inherit; font-size: .85rem; cursor: pointer; color: #fff;
  background: none; border: 1px solid #fff; border-radius: 99px; padding: 2px 10px; min-height: 28px;
}
/* v10.91 : le badge de l'administrateur est aussi dans Paramètres › Aide (fond clair) : texte et trait foncés. */
#panneau-aide .version-badge { color: var(--encre); border-color: var(--encre); font-weight: 700; }
.version-dialog {
  max-width: min(520px, calc(100vw - 32px)); max-height: 80vh; border: var(--contour) solid var(--encre); border-radius: var(--radius);
  padding: 20px 22px; background: var(--parchemin); color: var(--encre);
}
.version-dialog::backdrop { background: rgb(0 0 0 / .45); }
.version-dialog h2 { font-size: 1.4rem; margin-bottom: .5em; }
.version-dialog h3 { font-size: 1.05rem; margin: 0 0 .3em; }
.version-dialog time { font-family: system-ui, sans-serif; font-weight: 400; font-size: .85rem; color: var(--encre-douce); margin-left: 6px; }
.version-list { list-style: none; padding: 0; margin: 0 0 16px; }
.version-list > li { margin-bottom: 14px; }
.version-list ul { margin: 0; padding-left: 20px; }
.version-close { font: inherit; font-weight: 700; min-height: 44px; padding: 8px 20px; border-radius: 10px; border: var(--contour-fin) solid var(--encre); background: var(--encre); color: #fff; cursor: pointer; }

/* ---------- Téléphones et tablettes en hauteur (v6.2) : le jeu tient dans l'écran, sans défiler ----------
   La page a la hauteur de l'écran ; le plateau prend la largeur qu'il peut en laissant au moins
   --tour-min de hauteur au tour de jeu. Quand le contenu du tour ne tient plus (correction, tableau « ? »),
   l'encadré « remonte » sur le plateau (classe .tour-monte posée par js/plateau.js → ajusterTour). */
/* Tous les écrans (v6.8) : la page du plateau a la hauteur de l'écran et ne défile jamais. */
body:has(#ecran-plateau:not([hidden])) { height: 100vh; height: 100dvh; overflow: hidden; }
body:has(#ecran-plateau:not([hidden])) main { min-height: 0; }
body:has(#ecran-plateau:not([hidden])) .pied { padding-block: 2px calc(2px + env(safe-area-inset-bottom)); font-size: .8rem; }
.plateau-ecran:not([hidden]) { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: env(safe-area-inset-top, 0px) 10px 4px; }
/* Boutons posés sur le plateau, en haut à droite (v10.18) : plein écran et menu. */
.plateau-outils { position: absolute; z-index: 5; top: 6px; right: 6px; display: flex; gap: 6px; }
.plateau-outils .btn-retour { min-height: 38px; padding: 2px 12px; box-shadow: 0 2px 6px rgb(0 0 0 / .35); }
/* Plein écran (v10.21) : en bas à droite de l'écran, dans la zone du pied de page, pour ne rien cacher du plateau.
   Posé en « fixed » : il est hors de .table (qui contient sa mise en page), donc il reste calé sur l'écran. */
.btn-plein-ecran { position: fixed; z-index: 5; right: max(10px, env(safe-area-inset-right)); bottom: calc(8px + env(safe-area-inset-bottom)); min-width: 38px; min-height: 38px; padding: 2px 8px; box-shadow: 0 2px 6px rgb(0 0 0 / .35); }
.btn-plein-ecran[hidden] { display: none; }
/* Écrans larges (ordinateur, tablette et téléphone en paysage) : plateau à gauche, aussi grand que la hauteur
   le permet, tour de jeu à droite sur toute la hauteur. Si le contenu du tour ne tient plus (correction,
   tableau « ? »), l'encadré s'élargit vers la gauche, par-dessus le plateau (.tour-monte, js/plateau.js). */
@media (min-width: 900px) {
  .table { flex: 1; min-height: 0; position: relative; container-type: size; align-items: center; }
  .table .plateau { justify-self: center; align-self: start; width: min(100%, 100cqh * 1.339); } /* v10.18 : le haut du plateau est en haut de l'écran */
  .panneau { align-self: stretch; min-height: 0; display: flex; flex-direction: column; justify-content: center; }
  .panneau .tour { flex: 0 1 auto; min-height: 0; overflow: auto; position: relative; }
  /* top: 52px (v10.18) : le bouton Menu, sur le plateau en haut à droite, reste visible et touchable au-dessus de l'encadré élargi. */
  .table.tour-monte .panneau { position: absolute; top: 52px; right: 0; bottom: 0; width: min(100%, 560px); z-index: 6; }
}
/* Ordinateur seulement (v10.70, demande du 30/11/2026) : le plateau est un peu réduit (92 %) et centré en hauteur,
   au lieu d'être plaqué en haut de l'écran. Tablettes et téléphones (pointeur tactile) : inchangés. */
@media (min-width: 900px) and (hover: hover) and (pointer: fine) {
  .table .plateau { align-self: center; width: min(100%, 100cqh * 1.339 * .92); }
  /* Le bouton Menu est descendu avec le plateau : l'encadré élargi commence plus bas pour ne pas le couvrir. */
  .table.tour-monte .panneau { top: calc(4% + 52px); }
}
/* Écrans larges mais bas (téléphone en paysage) : tour de jeu plus serré. */
@media (min-width: 900px) and (max-height: 560px) {
  .panneau .tour { padding: 8px 10px; }
  .tour h3 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .tour-joueur img { width: 40px; height: 44px; border-width: var(--contour-fin); }
  .tour .carte-piochee { margin-top: 6px; padding: 8px 10px; }
  .tour .tour-actions .btn { min-height: 40px; padding: 4px 12px; }
  .table.tour-monte .tour-joueur { display: none; }
  .plateau-outils { top: 4px; right: 4px; }
  .plateau-outils .btn-retour { min-height: 32px; }
  .table.tour-monte .panneau { width: min(100%, 640px); }
  .tour .carte-outils { flex-direction: row; } /* « Écouter » et « Voir le mot » côte à côte */
  .tour #btn-phrase .long { display: none; } /* « 💬 Phrase » : tient sur la même ligne (v6.40) */
  .tour #btn-phrase .court { display: inline; }
  .tour .carte-outils .btn-ecouter { min-height: 36px; padding: 2px 10px; }
  .tour .carte-mot { margin: 2px 0 !important; font-size: clamp(1.4rem, 7vh, 2rem); }
  .tour .carte-consigne { margin-top: 2px !important; }
  .tour .tour-consigne { margin-top: 2px; min-height: 0; }
  .tour .tour-actions { margin-top: 4px; }
  .tour .carte-tableau { font-size: .85rem; line-height: 1.25; padding: 4px 10px; margin-top: 4px; }
  .tour .carte-reponse { margin-bottom: 4px !important; line-height: 1.25; }
  body:has(#ecran-plateau:not([hidden])) .pied { padding-block: 0 env(safe-area-inset-bottom); font-size: .72rem; }
}
/* Questions en paysage peu haut, écran de moins de 900 px (844×390, 667×375) (ligne 592 du backlog, 30/11/2026) :
   « Écouter » et « Voir le mot » côte à côte (comme au-delà de 900 px), pour que le clavier des voyelles / consonnes tienne sans défiler. */
@media (max-width: 899px) and (min-aspect-ratio: 3/2) and (max-height: 430px) {
  .tour .carte-outils { flex-direction: row; }
  .tour #btn-phrase .long { display: none; }
  .tour #btn-phrase .court { display: inline; }
  .tour .carte-outils .btn-ecouter { min-height: 36px; padding: 2px 10px; }
}
/* Même paysage peu haut, toutes largeurs : « Relier les paires » (6 lignes) aux lignes plus basses (28 px, au-dessus du minimum
   de 24 px des cibles tactiles, WCAG 2.2 critère 2.5.8), et carte du monde du quiz un peu plus petite. */
@media (min-aspect-ratio: 3/2) and (max-height: 430px) {
  .tour .carte-gram { margin: 4px 0 2px; }
  .tour .gram-col { gap: 3px; }
  .tour .gram-mot-relier { min-height: 28px; padding: 1px 8px; }
  .tour .gram-num { width: 18px; height: 18px; font-size: .7rem; }
  .tour .carte-quiz svg { max-height: 32vh; }
  .tour .carte-quiz + .savoir-options .btn-option { font-size: .85rem; line-height: 1.1; } /* « République démocratique du Congo » sur 3 lignes tient */
}
/* Dans tous les cas, les boutons d'action restent visibles en bas de l'encadré (v6.8) :
   si le contenu ne tenait pas, c'est lui qui passe dessous, jamais les boutons. */
.tour .tour-actions:not(:empty) { position: sticky; bottom: -1px; z-index: 2; background: var(--parchemin); padding-block: 4px; }
@media (max-width: 899px) {
  .table { --tour-min: 132px; flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: stretch; gap: 8px; position: relative; container-type: size; }
  .table .plateau { flex: none; align-self: center; width: min(100cqw, (100cqh - var(--tour-min) - 8px) * 1.339); }
  .panneau { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .panneau .tour { flex: 1; min-height: 0; overflow: auto; padding: 8px 10px; position: relative; } /* relative : les textes pour lecteurs d'écran (absolus) restent dans l'encadré */
  .tour h3 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); } /* « Tour de jeu » : pour les lecteurs d'écran */
  .tour-joueur img { width: 40px; height: 44px; border-width: var(--contour-fin); }
  .tour-joueur p { font-size: 1rem; }
  .tour .carte-piochee { margin-top: 6px; padding: 8px 10px; }
  .tour .tour-consigne { margin-top: 4px; min-height: 0; }
  .tour .tour-actions { margin-top: 6px; }
  .tour .tour-actions .btn { min-height: 44px; padding: 6px 12px; }
  /* L'encadré remonte sur le plateau : il occupe toute la zone de jeu. */
  /* … seulement de la hauteur nécessaire : le haut du plateau reste visible si possible. */
  .table.tour-monte .panneau { position: absolute; left: 0; right: 0; bottom: 0; max-height: calc(100% - 48px); z-index: 6; } /* v10.18 : 48 px de plateau restent visibles en haut (bouton Menu) */
  .table.tour-monte .panneau .tour { flex: 0 1 auto; }
  /* v6.27 : la carte ne dit plus « Carte n° 1 de Léa » : « À Léa de jouer » reste visible, sur une ligne fine (sans portrait). */
  .table.tour-monte .tour-joueur img { display: none; }
  .table.tour-monte .tour-joueur p { font-size: .9rem; line-height: 1.2; }
  .table.tour-monte .tour .carte-titre { font-size: 1.15rem; }
  .table.tour-monte .tour .carte-piochee { margin-top: 0; }
  .tour .carte-mot { margin: 2px 0 !important; }
  .tour .carte-consigne { margin-top: 4px !important; }
  .tour .carte-correction:has(.carte-reponse:not([hidden])) { margin-bottom: 4px; }
  .tour .carte-reponse { font-size: .95rem; line-height: 1.3; }
  .tour .carte-entete .btn-ecouter { min-height: 40px; padding: 4px 10px; }
}

/* ---------- Problèmes de mathématiques (v9.0, js/problemes.js) ----------
   L'énoncé remplace la formule : texte lisible, thème en petit au-dessus. */
.carte-consigne.probleme { font-weight: 500; font-size: clamp(1rem, 3.9vw, 1.25rem); line-height: 1.45; text-align: left; }
.probleme-theme { display: block; font-size: .78em; font-weight: 800; letter-spacing: .03em; color: var(--encre-douce); text-transform: uppercase; margin-bottom: 2px; }

/* ---------- Pavé numérique (v9.0, js/plateau.js → pave) ----------
   Toute réponse en nombre se tape ici : case de réponse en haut, puis 7 8 9 ⌫ / 4 5 6 C / 1 2 3 OK / 0 , OK.
   Les conteneurs .saisie-ligne et .pave s'effacent (display: contents) : leurs boutons se rangent dans la grille. */
.carte-saisie.avec-pave {
  display: grid; gap: 6px; grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-areas: "lab lab lab lab" "champ champ champ champ" "k7 k8 k9 ret" "k4 k5 k6 eff" "k1 k2 k3 ok" "k0 k0 virg ok";
  max-width: 420px; width: 100%; margin-inline: auto;
}
.carte-saisie.avec-pave label { grid-area: lab; margin: 0; }
.carte-saisie.avec-pave .saisie-ligne, .carte-saisie.avec-pave .pave { display: contents; }
.carte-saisie.avec-pave #reponse-joueur { grid-area: champ; width: 100%; text-align: center; font-size: 1.6rem; caret-color: var(--rouge); }
.carte-saisie.avec-pave #btn-valider-reponse { grid-area: ok; min-height: 0; height: 100%; padding: 4px; font-size: 1.3rem; }
.pave[hidden] { display: none !important; }
.touche {
  font: 800 clamp(1.25rem, 4.5vw, 1.6rem)/1 system-ui, sans-serif; color: var(--encre); cursor: pointer;
  min-height: clamp(44px, 7.2vh, 62px); border-radius: 10px; border: var(--contour-fin) solid var(--encre);
  background: #fff; box-shadow: 0 var(--ombre) 0 var(--encre); touch-action: manipulation; -webkit-user-select: none; user-select: none;
}
body:not(.question-plein) .touche { min-height: clamp(40px, 5.2vh, 50px); }
body:not(.question-plein) .carte-saisie.avec-pave { gap: 5px; max-width: 340px; }
body:not(.question-plein) .carte-saisie.avec-pave #reponse-joueur { min-height: 42px; font-size: 1.4rem; }
.touche:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--encre); }
.touche-outil { background: var(--parchemin); }
.touche[data-touche="7"] { grid-area: k7; } .touche[data-touche="8"] { grid-area: k8; } .touche[data-touche="9"] { grid-area: k9; }
.touche[data-touche="4"] { grid-area: k4; } .touche[data-touche="5"] { grid-area: k5; } .touche[data-touche="6"] { grid-area: k6; }
.touche[data-touche="1"] { grid-area: k1; } .touche[data-touche="2"] { grid-area: k2; } .touche[data-touche="3"] { grid-area: k3; }
.touche[data-touche="0"] { grid-area: k0; } .touche[data-touche=","] { grid-area: virg; }
.touche[data-touche="retour"] { grid-area: ret; } .touche[data-touche="tout"] { grid-area: eff; }

/* ---------- Clavier à lettres (v9.3, js/plateau.js → clavier, js/clavier-lettres.js) ----------
   Réponse en lettres : une case par signe de la réponse, puis 18 lettres (ou plus) sur 6 colonnes,
   la rangée é è ê / - / ’, puis ⌫ / Tout effacer / espace / Valider. La vraie case de réponse reste
   dans la page (lecteurs d'écran, clavier physique) mais ne se voit plus. */
.carte-saisie.avec-clavier { display: flex; flex-direction: column; gap: 6px; max-width: 460px; width: 100%; margin-inline: auto; }
.carte-saisie.avec-clavier label,
.carte-saisie.avec-clavier .saisie-ligne { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.carte-saisie.avec-clavier #btn-valider-reponse { display: none; }
.clavier[hidden] { display: none !important; }
.clavier { display: flex; flex-direction: column; gap: 6px; }
.cases-reponse {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 10px; min-height: 44px;
  padding: 4px; border-radius: 10px; text-transform: uppercase;
}
.carte-saisie:has(#reponse-joueur:focus) .cases-reponse { outline: 3px solid var(--jaune); box-shadow: 0 0 0 5px var(--encre); }
.cases-mot { display: flex; gap: 3px; }
/* Largeur d'une case : calculée par js/plateau.js (--case) pour que le mot le plus long tienne sur une ligne. */
.case-l {
  width: var(--case, 30px); height: calc(var(--case, 30px) * 1.3); display: grid; place-items: center;
  border: var(--contour-fin) solid var(--encre); border-radius: 6px; background: #fff; color: var(--encre);
  font: 800 calc(var(--case, 30px) * .62)/1 system-ui, sans-serif;
}
.case-sep { width: calc(var(--case, 30px) * .62); border-style: dashed; background: var(--parchemin); }
.case-l.active { border-color: var(--rouge); box-shadow: 0 0 0 2px var(--rouge); }
.espace-tape { color: var(--encre-douce); font-weight: 400; }
.ligne-reponse {
  min-width: 8em; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 4px 12px;
  border: var(--contour-fin) solid var(--encre); border-radius: 10px; background: #fff; font: 800 1.45rem/1 system-ui, sans-serif;
}
.curseur-lettres { display: inline-block; width: 2px; height: 1.1em; margin-left: 2px; background: var(--rouge); animation: curseur-lettres 1s steps(1) infinite; }
@keyframes curseur-lettres { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .curseur-lettres { animation: none; } }
/* Les touches prennent leur taille de texte sur la largeur du clavier (unités cqi), pas sur celle de l'écran :
   le même clavier tient dans le panneau étroit de l'ordinateur et en plein écran sur téléphone. */
.clavier { container-type: inline-size; }
.clavier-grille { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.clavier-rangee { display: flex; gap: 6px; }
.clavier-rangee .touche { flex: 1 1 0; min-width: 0; padding: 0 2px; }
.clavier .touche { min-height: clamp(40px, 6vh, 54px); font-size: clamp(1rem, 6.4cqi, 1.45rem); }
.clavier .touche-outil { font-size: clamp(.9rem, 5cqi, 1.2rem); }
.clavier .touche-petit { font-size: clamp(.68rem, 3.5cqi, .95rem); line-height: 1.1; }
.clavier .touche-espace { flex-grow: 2; font-size: clamp(.8rem, 4.2cqi, 1rem); font-weight: 700; }
.clavier .touche-valider { flex-grow: 2; background: var(--vert); color: #fff; font-size: clamp(.85rem, 4.8cqi, 1.15rem); }
body:not(.question-plein) .clavier .touche { min-height: clamp(36px, 5vh, 46px); }
body:not(.question-plein) .carte-saisie.avec-clavier { gap: 5px; }

/* ---------- Question en plein écran sur téléphone et tablette (v9.0, js/plateau.js → majPlein) ----------
   Dès qu'une question apparaît, l'encadré du tour de jeu couvre tout l'écran (plus de plateau) ;
   il le rend quand le dé se lance. Le bloc « saisie au clavier » ci-dessous garde la priorité
   (un clavier ouvert pour une réponse en lettres réduit la zone visible). */
body.question-plein { overflow: hidden; }
body.question-plein:not(.saisie-clavier) .panneau {
  position: fixed; z-index: 40; inset: 0; height: 100dvh; width: auto; max-height: none; margin: 0;
  display: flex; flex-direction: column;
  padding: max(6px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  background: var(--vert);
}
body.question-plein:not(.saisie-clavier) .panneau .tour { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; width: min(100%, 820px); margin-inline: auto; box-shadow: none; padding: 8px; }
body.question-plein:not(.saisie-clavier) .tour-joueur img { width: 34px; height: 38px; }
body.question-plein:not(.saisie-clavier) .tour-joueur p { font-size: .95rem; }
body.question-plein:not(.saisie-clavier) .tour .carte-piochee { flex: 1 0 auto; margin-top: 6px; display: flex; flex-direction: column; padding: 10px 12px 12px; }
body.question-plein:not(.saisie-clavier) .tour .carte-mot:not(.cache) { font-size: clamp(1.6rem, 7vw, 2.6rem); margin: 8px 0 !important; }
body.question-plein:not(.saisie-clavier) .tour .carte-consigne.probleme { font-size: clamp(1.05rem, 4.4vw, 1.45rem); }
/* Le pavé descend en bas de la carte, sous la question. */
body.question-plein:not(.saisie-clavier) .carte-saisie.avec-pave { margin-top: auto; padding-top: 8px; }
body.question-plein:not(.saisie-clavier) .carte-saisie.avec-clavier { margin-top: auto; padding-top: 8px; }
body.question-plein:not(.saisie-clavier) .tour .carte-reponse { font-size: clamp(1rem, 3.6vw, 1.25rem); }
/* Écran large ou carré (tablette en paysage, téléphone carré) : la question à gauche, le pavé à droite. */
@media (min-aspect-ratio: 1/1) {
  body.question-plein:not(.saisie-clavier) .tour .carte-piochee:has(.carte-saisie.avec-pave:not([hidden])),
  body.question-plein:not(.saisie-clavier) .tour .carte-piochee:has(.carte-saisie.avec-clavier:not([hidden])) {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 14px; align-content: start;
  }
  body.question-plein:not(.saisie-clavier) .tour .carte-piochee:has(.carte-saisie.avec-pave:not([hidden])) > * { grid-column: 1; }
  body.question-plein:not(.saisie-clavier) .tour .carte-piochee:has(.carte-saisie.avec-clavier:not([hidden])) > * { grid-column: 1; }
  body.question-plein:not(.saisie-clavier) .tour .carte-piochee:has(.carte-saisie.avec-pave:not([hidden])) > .carte-entete { grid-column: 1 / -1; }
  body.question-plein:not(.saisie-clavier) .tour .carte-piochee:has(.carte-saisie.avec-clavier:not([hidden])) > .carte-entete { grid-column: 1 / -1; }
  body.question-plein:not(.saisie-clavier) .tour .carte-piochee:has(.carte-saisie.avec-pave:not([hidden])) > .carte-saisie { grid-column: 2; grid-row: 2 / span 12; margin: 0; align-self: center; }
  body.question-plein:not(.saisie-clavier) .tour .carte-piochee:has(.carte-saisie.avec-clavier:not([hidden])) > .carte-saisie { grid-column: 2; grid-row: 2 / span 12; margin: 0; align-self: center; }
  body.question-plein:not(.saisie-clavier) .carte-saisie.avec-pave .touche { min-height: clamp(40px, 11vh, 62px); }
  body.question-plein:not(.saisie-clavier) .clavier .touche { min-height: clamp(32px, 8vh, 50px); }
}
/* Écran large et bas (téléphone carré ou en paysage) : pavé resserré, « Ta réponse » seulement pour les lecteurs d'écran. */
@media (min-aspect-ratio: 1/1) and (max-height: 560px) {
  body.question-plein:not(.saisie-clavier) .carte-saisie.avec-pave { gap: 5px; }
  body.question-plein:not(.saisie-clavier) .carte-saisie.avec-pave .touche { min-height: clamp(34px, 9vh, 48px); }
  body.question-plein:not(.saisie-clavier) .carte-saisie.avec-pave label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  body.question-plein:not(.saisie-clavier) .carte-saisie.avec-pave { grid-template-areas: "champ champ champ champ" "k7 k8 k9 ret" "k4 k5 k6 eff" "k1 k2 k3 ok" "k0 k0 virg ok"; }
  body.question-plein:not(.saisie-clavier) .carte-saisie.avec-pave #reponse-joueur { min-height: 40px; font-size: 1.35rem; }
  body.question-plein:not(.saisie-clavier) .tour .carte-consigne.probleme { font-size: clamp(.95rem, 2.1vw, 1.15rem); line-height: 1.35; }
  body.question-plein:not(.saisie-clavier) .clavier, body.question-plein:not(.saisie-clavier) .carte-saisie.avec-clavier { gap: 4px; }
  body.question-plein:not(.saisie-clavier) .clavier .touche { min-height: clamp(30px, 6.2vh, 44px); }
  body.question-plein:not(.saisie-clavier) .case-l { height: min(calc(var(--case, 30px) * 1.3), 5.6vh); }
  /* v10.49 : une longue réponse d'Histoire (« L'armure de plates », « Le pont d'Arcole ») tient sur 4 lignes de cases :
     lignes resserrées pour que « Valider » reste visible sur un écran carré de 480 px. */
  body.question-plein:not(.saisie-clavier) .cases-reponse { gap: 3px 10px; padding: 2px; }
}

/* ---------- Saisie au clavier sur écran tactile (v6.13, js/plateau.js → majSaisie) ----------
   Pendant que le joueur écrit sa réponse, la carte se pose par-dessus le plateau et occupe exactement
   la partie de l'écran visible au-dessus du clavier (--vv-haut, --vv-h, lus par l'API Visual Viewport).
   La question est au centre, la case de réponse et « Valider » juste au-dessus du clavier. */
body.saisie-clavier .panneau {
  position: fixed; z-index: 40; left: 0; right: 0; top: var(--vv-haut, 0px); height: var(--vv-h, 100dvh);
  width: auto; max-height: none; margin: 0; display: flex; flex-direction: column;
  padding: max(6px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) 6px max(8px, env(safe-area-inset-left));
  background: var(--vert);
}
body.saisie-clavier .panneau .tour { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; box-shadow: none; padding: 6px; }
body.saisie-clavier .tour-joueur, body.saisie-clavier .tour-consigne, body.saisie-clavier .tour-actions:empty { display: none; }
body.saisie-clavier .tour .carte-piochee { flex: 1 0 auto; margin: 0; display: flex; flex-direction: column; }
/* La question occupe l'espace libre, centrée, en grand. */
body.saisie-clavier .tour .carte-mot { flex: 1 0 auto; display: flex; align-items: center; justify-content: center; margin: 4px 0 !important; font-size: clamp(1.6rem, 9vw, 2.6rem); }
body.saisie-clavier .carte-saisie { margin: 4px 0 0; }
/* La carte garde une marge intérieure plus grande que son cadre de couleur (5 px) + le contour de focus (3 px) :
   la case et « Valider » ne touchent jamais le cadre (capture du 09/11/2026). */
body.saisie-clavier .tour .carte-piochee { padding: 10px 12px 12px; }
body.saisie-clavier .carte-correction:has(.carte-reponse:not([hidden])) { margin: 4px 0 0; }
/* Très peu de hauteur (téléphone en paysage) : on resserre tout, la case de réponse reste visible. */
body.saisie-basse .tour .carte-piochee { padding: 9px 10px; }
body.saisie-basse .tour .carte-entete .btn-ecouter { min-height: 34px; padding: 0 10px; }
body.saisie-basse .tour .carte-consigne { margin-top: 0 !important; }
body.saisie-basse .tour .carte-mot { font-size: 1.5rem; margin: 0 !important; }
body.saisie-basse .carte-saisie label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
body.saisie-basse .saisie-ligne input, body.saisie-basse .saisie-ligne .btn { min-height: 44px; }

/* ---------- Ludo, le guide (v6.9, js/ludo.js) ----------
   Le petit Ludo (portrait rond) est posé à gauche du pied de page : il ne recouvre jamais le jeu.
   Sur l'accueil, il est caché : le grand Ludo de l'illustration le remplace (il se touche aussi). */
.pied { position: relative; min-height: 54px; display: flex; flex-direction: column; justify-content: center; }
body:has(#ecran-preparation:not([hidden])) .pied, body:has(#ecran-plateau:not([hidden])) .pied { min-height: 52px; }
.ludo-bouton {
  position: absolute; left: max(8px, env(safe-area-inset-left)); top: 50%; translate: 0 -50%;
  width: 46px; height: 46px; padding: 0; border-radius: 50%; cursor: pointer;
  background: var(--parchemin); border: var(--contour) solid #fff; box-shadow: 0 2px 6px rgb(0 0 0 / .35);
}
/* v10.93 : « Qui joue ? » (mini-jeux, défi, partie rapide) : plus d'étiquette « Joueur 1 · pion rouge » au-dessus du nom. */
.fenetre-joueurs .cj-etiq { display: none; }
.ludo-bouton img { display: block; width: 100%; height: 100%; border-radius: 50%; }
.ludo-bouton:hover { scale: 1.06; }
.ludo-bouton.parle { border-color: var(--jaune); }
/* v10.91 (demande du 02/12/2026) : l'accueil n'a plus de pied de page (plus de version : elle est dans Paramètres › Aide), ce qui
   rend de la place en bas de l'écran. La pastille de Ludo y reste, en bas à gauche, comme sur chaque page : le pied devient
   un point fixe sans fond, et la pastille se pose au ras du bas de l'écran. */
body:has(#ecran-accueil:not([hidden])) .pied { position: fixed; z-index: 6; left: 0; bottom: 0; width: 0; min-height: 0; padding: 0; background: none; }
body:has(#ecran-accueil:not([hidden])) .pied p { display: none; }
body:has(#ecran-accueil:not([hidden])) .ludo-bouton { top: auto; bottom: max(8px, env(safe-area-inset-bottom)); translate: none; }
.calque.perso.ludo-touchable { pointer-events: auto; cursor: pointer; }

/* Bulle de bande dessinée : fond clair, gros trait d'encre, petite queue tournée vers Ludo. */
.ludo-bulle {
  position: fixed; z-index: 50; left: 8px; top: 8px; max-width: calc(100vw - 16px);
  background: #fffdf6; color: var(--encre); border: var(--contour) solid var(--encre); border-radius: 22px;
  padding: 10px 14px 12px; box-shadow: 4px 5px 0 rgb(0 0 0 / .25);
  animation: ludo-apparait .25s ease-out;
}
.ludo-bulle[hidden] { display: none; }
.ludo-nom { margin: 0 0 2px; font: 800 .8rem/1 system-ui, sans-serif; text-transform: uppercase; letter-spacing: .06em; color: #a11d1d; }
.ludo-texte { margin: 0; font-weight: 600; font-size: clamp(.95rem, 2.6vw, 1.05rem); line-height: 1.35; }
.ludo-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 10px; }
.ludo-actions:empty { display: none; }
.ludo-actions .btn { min-height: 40px; padding: 6px 14px; font-size: .95rem; }
/* Queue de la bulle : un triangle bordé d'encre (deux couches). */
.ludo-bulle[data-queue]:not([data-queue=""])::before,
.ludo-bulle[data-queue]:not([data-queue=""])::after { content: ""; position: absolute; border: solid transparent; }
.ludo-bulle[data-queue="bas-gauche"]::before { left: 16px; bottom: -19px; border-width: 19px 14px 0 2px; border-top-color: var(--encre); }
.ludo-bulle[data-queue="bas-gauche"]::after { left: 19px; bottom: -13px; border-width: 14px 10px 0 1px; border-top-color: #fffdf6; }
.ludo-bulle[data-queue="bas"]::before { left: calc(50% - 12px); bottom: -19px; border-width: 19px 12px 0; border-top-color: var(--encre); }
.ludo-bulle[data-queue="bas"]::after { left: calc(50% - 8px); bottom: -13px; border-width: 14px 8px 0; border-top-color: #fffdf6; }
.ludo-bulle[data-queue="gauche"]::before { left: -20px; top: 55%; border-width: 10px 20px 10px 0; border-right-color: var(--encre); }
.ludo-bulle[data-queue="gauche"]::after { left: -13px; top: calc(55% + 4px); border-width: 6px 14px 6px 0; border-right-color: #fffdf6; }
/* Bulle étroite (ligne 589 : posée entre « Mon compte » et le rouage) : les deux boutons rapetissent pour tenir sur une ligne (sinon ils passent à la ligne). */
.ludo-bulle.etroite .ludo-actions { gap: 6px; }
.ludo-bulle.etroite .ludo-actions .btn { padding: 4px 8px; font-size: .78rem; white-space: nowrap; }
@keyframes ludo-apparait { from { opacity: 0; scale: .9; } to { opacity: 1; scale: 1; } }

/* Flèche rouge qui grandit et rétrécit, pointe sur l'endroit à toucher (elle ne bloque pas le toucher). */
.ludo-fleche { position: fixed; z-index: 49; width: 48px; height: 64px; pointer-events: none;
  transform-origin: 50% 100%; animation: ludo-pulse .7s ease-in-out infinite alternate;
  filter: drop-shadow(0 2px 2px rgb(0 0 0 / .35)); }
.ludo-fleche[hidden] { display: none; }
.ludo-fleche svg { display: block; }
.ludo-fleche.vers-haut { transform-origin: 50% 0; }
.ludo-fleche.vers-haut svg { rotate: 180deg; }
@keyframes ludo-pulse { from { scale: .78; } to { scale: 1.15; } }
@media (prefers-reduced-motion: reduce) { .ludo-fleche, .ludo-bulle { animation: none; } }
/* Petits écrans (hauteur réduite) : bulle plus compacte pour cacher le moins possible du jeu. */
@media (max-height: 560px), (max-width: 380px) {
  .ludo-bulle { padding: 6px 10px 8px; border-radius: 16px; }
  .ludo-texte { font-size: .9rem; line-height: 1.25; }
  .ludo-actions { margin-top: 6px; }
  .ludo-actions .btn { min-height: 36px; padding: 4px 12px; font-size: .88rem; }
}

/* Très petits écrans : « Tout » / « Aucun » aussi en orthographe. */
@container (max-width: 330px) {
  #ortho-packs .btn-tout .long, #reglages-ortho .btn-tout .long { display: none; }
  #ortho-packs .btn-tout .court, #reglages-ortho .btn-tout .court { display: inline; }
}

/* Questions et thèmes d'orthographe sur écran peu haut (téléphone carré, paysage) : le nom de la famille et son « Tout »
   passent à gauche des boutons, pour gagner les lignes de titres (v6.33, thèmes v6.39). */
@container (max-height: 420px) {
  /* Thèmes : 5 boutons par ligne, il faut toute la largeur : le nom de la famille reste au-dessus, en petit. */
  #ortho-packs { --h: clamp(24px, calc((100cqh - 9.8rem) / var(--rangs) - 1cqh), 60px); gap: 3px; }
  #ortho-packs .famille { padding: 1px 5px 3px; border-radius: 9px; }
  #ortho-packs .famille-tete { margin: 0 0 1px; }
  #ortho-packs .famille-nom { font-size: .72rem; line-height: 1.1; }
  /* « Tout » de la famille : 20 px de haut, seul sur sa ligne (exception d'espacement du critère WCAG 2.2 2.5.8). */
  .reglages-joueur #ortho-packs .btn-tout-famille { min-height: 20px; padding: 0 10px; font-size: .7rem; line-height: 1; }
  #ortho-packs .famille .packs { gap: 3px 5px; }
  #ortho-packs .reglage-tete { margin-bottom: 2px; }
  #packs { gap: 4px; }
  .reglages-joueur #ortho-packs .pack span { font-size: clamp(.66rem, calc(var(--h) * .32), .95rem); line-height: 1; padding: 1px 2px; hyphens: manual; }
  #reglages-ortho { --h: clamp(24px, calc((100cqh - 6.4rem) / var(--rangs) - 1.2cqh), 60px); }
  #reglages-ortho .famille { display: grid; grid-template-columns: 6.2rem 1fr; align-items: center; gap: 6px; padding: 3px 6px; }
  #reglages-ortho .famille-tete { flex-direction: column; align-items: flex-start; gap: 2px; margin: 0; }
  #reglages-ortho .famille-nom { font-size: .78rem; line-height: 1.1; }
  #reglages-ortho .famille .packs { gap: 3px 5px; }
  #reglages-ortho .reglage-tete { margin-bottom: 2px; }
  #types-questions { gap: 4px; }
  .reglages-joueur #reglages-ortho .pack span { font-size: clamp(.7rem, calc(var(--h) * .42), .95rem); }
}

/* Questions d'orthographe sur téléphone étroit ET peu haut (v6.51) : téléphone en portrait 360 × 640, ou page agrandie
   par le zoom / la taille du texte d'Android. La famille à gauche des boutons ne laisse alors que ~25 px par bouton :
   les noms débordaient. Ici le nom de la famille et son « Tout » restent au-dessus, sur une seule ligne compacte,
   et les 3 boutons par ligne prennent toute la largeur. */
@container (max-height: 420px) and (max-width: 399.98px) {
  #reglages-ortho { --h: clamp(26px, calc((100cqh - 8.6rem) / var(--rangs) - 1cqh), 60px); }
  #reglages-ortho .famille { display: block; padding: 2px 5px 4px; border-radius: 9px; }
  #reglages-ortho .famille-tete { flex-direction: row; align-items: center; gap: 6px; margin: 0 0 2px; }
  #reglages-ortho .famille-nom { font-size: .72rem; line-height: 1.1; }
  .reglages-joueur #reglages-ortho .btn-tout-famille { min-height: 20px; padding: 0 10px; font-size: .7rem; line-height: 1; }
  .reglages-joueur #reglages-ortho .pack span { font-size: clamp(.62rem, min(calc(var(--h) * .3), 3.4cqi), .85rem); line-height: 1.05; padding: 1px 2px; hyphens: manual; overflow-wrap: normal; }
}

/* ---------- Étoiles, coffres et progression (v6.36) ---------- */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 1.6em; height: 1.6em; flex: none; display: inline-block; vertical-align: middle; }
/* Couleurs des coffres (icône #i-coffre et grand coffre de la fenêtre) : bois, argent, or. */
.coffre-jour, .coffre-coffre-jour { --bois: #a0612b; --bois-clair: #c98445; --bois-fonce: #6e3f18; --metal: #5a4636; --metal-clair: #e9d9c4; --serrure: #ffd23f; }
.coffre-simple, .coffre-coffre-simple { --bois: #8a5a2b; --bois-clair: #b07a45; --bois-fonce: #5c3a17; --metal: #5a4636; --metal-clair: #d9c8b0; --serrure: #c9b28a; } /* coffre simple (v6.46) : bois brut */
.coffre-argent, .coffre-coffre-argent { --bois: #8f9ba6; --bois-clair: #c9d2da; --bois-fonce: #5f6b75; --metal: #4a545d; --metal-clair: #f4f7fa; --serrure: #ffffff; }
.coffre-or, .coffre-coffre-or { --bois: #d99a12; --bois-clair: #ffc93c; --bois-fonce: #a36f00; --metal: #8d5f00; --metal-clair: #fff1b8; --serrure: #fff3b0; }
/* Méga coffre (5 jours d'affilée, v6.38) : violet, ferrures dorées, pierre bleue sur le couvercle. */
.coffre-mega, .coffre-coffre-mega { --bois: #6b3fa0; --bois-clair: #9b6fd6; --bois-fonce: #44246c; --metal: #d99a12; --metal-clair: #fff1b8; --serrure: #ffd23f; }
.coffre-grand .gemme { display: none; }
.coffre-grand.coffre-mega .gemme { display: inline; }

/* Accueil : barre en haut (étoiles + niveau, défi du jour, coffre). */
.accueil { position: relative; }
.accueil-haut {
  position: absolute; z-index: 2; top: calc(8px + env(safe-area-inset-top)); left: 8px; right: 8px;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; pointer-events: none;
}
.pastille {
  pointer-events: auto; position: relative; display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-weight: 800; color: var(--encre); cursor: pointer; min-height: 48px; padding: 4px 12px 4px 6px;
  background: var(--parchemin); border: var(--contour) solid var(--encre); border-radius: 99px; box-shadow: 0 3px 0 rgb(0 0 0 / .3);
}
.pastille .ico { width: 34px; height: 34px; }
/* v9.5 : niveau, étoiles et pierres précieuses empilés (une seule petite étoile, devant le total). */
.pastille-etoiles { padding: 3px 14px 3px 12px; border-radius: 22px; }
.pe-pile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; }
.pe-niveau { display: flex; flex-direction: column; gap: 3px; font-size: .78rem; line-height: 1; white-space: nowrap; }
.mini-jauge { display: block; width: 64px; height: 8px; background: #fff; border: var(--contour-fin) solid var(--encre); border-radius: 99px; overflow: hidden; }
.mini-jauge span { display: block; height: 100%; width: 0; background: #f2b705; }
.pe-total { display: inline-flex; align-items: center; gap: 3px; font: 800 1.05rem/1 "Rockwell", "Roboto Slab", Georgia, serif; }
.pastille .pe-total .ico { width: 17px; height: 17px; }
.pe-gemmes { display: inline-flex; align-items: center; gap: 3px; font: 800 .85rem/1 system-ui, sans-serif; color: #12687b; }
.pastille .pe-gemmes .ico { width: 16px; height: 16px; }
.total-gemmes { margin: 2px 0 0; display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 700; }
.total-gemmes .ico { width: 30px; height: 30px; }
.total-gemmes strong { font: 800 1.5rem/1 "Rockwell", "Roboto Slab", Georgia, serif; color: #12687b; }
.gain-gemmes, .fin-gemmes { display: flex; align-items: center; justify-content: center; gap: 4px; font-weight: 800; color: #12687b; }
.gain-gemmes .ico, .fin-gemmes .ico { width: 26px; height: 26px; }
.fin-gemmes { margin: 4px 0; }
.pastille-coffre { font-size: .85rem; white-space: nowrap; }
.badge {
  position: absolute; top: -8px; right: -6px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 99px;
  background: var(--rouge); color: #fff; font: 800 .85rem/20px system-ui, sans-serif; border: var(--contour-fin) solid #fff; text-align: center;
}
.pastille-coffre.a-ouvrir .ico { animation: coffre-appel 1.6s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes coffre-appel { 0%, 70%, 100% { transform: none; } 75% { transform: rotate(-9deg) scale(1.08); } 85% { transform: rotate(9deg) scale(1.08); } 92% { transform: rotate(-4deg); } }

@media (max-height: 560px) {
  .pastille { min-height: 44px; padding-block: 2px; }
  .pastille .ico { width: 28px; height: 28px; }
}
/* Téléphones : le texte du coffre est caché (l'icône animée et la pastille du nombre de coffres restent). */
/* v9.4 : jusqu'à 520 px (au lieu de 440) depuis l'arrivée de la pastille du compte, pour que la barre tienne
   sur les téléphones carrés (480 px). */
@media (max-width: 520px) { .pastille-coffre span:not(.badge) { display: none; } .pastille-coffre { padding-right: 6px; } .accueil-haut { gap: 6px; } }
/* v9.5 (17/11/2026, choix B de la page A/B) : sur téléphone, défi du jour, coffre et compte deviennent des
   boutons ronds à icône seule (48 px, cible tactile confortable) ; le texte du défi reste lu par les lecteurs
   d'écran. Le bloc des étoiles reste à gauche, les trois icônes sont regroupées à droite. */
@media (max-width: 520px) {
  .pastille-etoiles { margin-right: auto; }
  .pastille-coffre, .pastille-compte { width: 48px; height: 48px; min-height: 48px; padding: 0; justify-content: center; flex: none; }
}
@media (max-width: 380px) { .pe-niveau .mini-jauge { width: 48px; } }

/* Compte (v9.4, js/compte.js) : pastille en haut de l'accueil et écran « Mon compte ». */
.pastille-compte { font-size: .85rem; white-space: nowrap; }
.pastille-compte.connecte::after {
  content: ""; position: absolute; top: -3px; right: -3px; width: 14px; height: 14px; border-radius: 50%;
  background: #1f7a3a; border: var(--contour-fin) solid #fff;
}
/* Téléphones et écrans moyens : l'icône seule (le nom reste lu par les lecteurs d'écran). */
/* Sous 1024 px (téléphones, y compris en paysage, et tablettes) : l'icône seule. Le texte est masqué à la vue
   seulement (pas display: none), pour que le bouton garde son nom pour les lecteurs d'écran. */
@media (max-width: 1023px) {
  .pastille-compte #compte-pastille-texte { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .pastille-compte { padding-right: 6px; }
}
/* v10.58 (demande du 26/11/2026) : le rouage « Paramètres » est un bouton rond à icône seule (48 px), dans le coin opposé à
   « Mon compte » (la barre est en space-between) ; son nom reste lu par les lecteurs d'écran. */
.pastille-parametres { width: 48px; height: 48px; min-height: 48px; padding: 0; justify-content: center; flex: none; }
@media (max-height: 560px) { .pastille-parametres { width: 44px; height: 44px; min-height: 44px; } }
.compte-carte { display: grid; gap: 10px; }
.compte-carte h3 { margin-bottom: 0; }
.compte-carte .petit { margin: 0; }
.compte-message { margin: 0; padding: 10px 12px; border-radius: 12px; border: var(--contour-fin) solid var(--encre); background: #fff; font-weight: 700; line-height: 1.35; }
.compte-message.ok { border-color: #1f7a3a; color: #145128; }
.compte-message.erreur { border-color: var(--rouge-texte); color: var(--rouge-texte); }
.btn-google { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; }
.g-logo { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #fff; border: var(--contour-fin) solid var(--encre); font: 800 1rem/1 system-ui, sans-serif; color: #1a56c4; }
.compte-ou { margin: 2px 0; display: flex; align-items: center; gap: 10px; color: var(--encre-douce); font-size: .9rem; }
.compte-ou::before, .compte-ou::after { content: ""; flex: 1; border-top: var(--contour-fin) solid var(--parchemin-bord); }
.compte-form { display: grid; gap: 6px; }
.compte-form label { font-weight: 700; }
.compte-form input[type="email"], .compte-form input[type="password"], .compte-form input[type="text"] {
  font: inherit; font-size: 1rem; min-height: 48px; padding: 8px 12px; width: 100%; min-width: 0;
  border: var(--contour-fin) solid var(--encre); border-radius: 10px; background: #fff; color: var(--encre);
}
.compte-form .compte-voir { display: flex; align-items: center; gap: 8px; font-weight: 400; min-height: 44px; }
.compte-voir input { width: 22px; height: 22px; }
.petit-inline { font-weight: 400; font-size: .85rem; color: var(--encre-douce); }
.compte-boutons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.compte-boutons .btn { flex: 1 1 160px; min-height: 48px; padding: 8px 14px; }
.compte-carte > .btn { min-height: 48px; padding: 8px 14px; }
.lien-bouton {
  justify-self: start; font: inherit; font-weight: 700; color: var(--bleu); background: none; border: 0; padding: 8px 0;
  min-height: 44px; text-decoration: underline; cursor: pointer;
}
.compte-qui { margin: 0; overflow-wrap: anywhere; }
#compte-corps button:disabled { opacity: .6; cursor: progress; }
/* v9.9 : parcours de création de compte (boutons pleine largeur, écrans d'annonce centrés). */
.compte-large { width: 100%; min-height: 52px; padding: 10px 16px; margin-top: 6px; }
.compte-annonce { text-align: center; justify-items: center; padding-top: 22px; padding-bottom: 22px; }
.compte-annonce p { margin: 0; max-width: 34em; line-height: 1.45; overflow-wrap: anywhere; }
.compte-annonce .lien-bouton { justify-self: center; }
.compte-icone { font-size: 3rem; line-height: 1; }
#ecran-compte .compte-carte { max-width: 560px; width: 100%; margin-inline: auto; }
/* v10.3 : fenêtre de connexion au lancement, centrée (même habillage que le menu de la partie). */
.fenetre-compte { position: fixed; inset: 0; margin: auto; width: min(380px, calc(100vw - 32px)); max-height: calc(100dvh - 24px); overflow-y: auto; padding: 18px 22px 20px; }
.fenetre-compte-ico { width: 64px; height: 64px; color: var(--encre); }
.fenetre-compte h2 { margin: 4px 0 8px; font-size: 1.5rem; }
.fenetre-compte p { margin: 0 0 14px; line-height: 1.4; }
.fenetre-compte .menu-actions .btn { min-height: 52px; }
.fenetre-compte .fenetre-compte-note { margin: 12px 0 0; font-size: .88rem; color: var(--encre-douce); }
/* Téléphone à l'horizontale ou carré bas : on resserre pour tout garder sans défiler. */
@media (max-height: 520px) {
  .fenetre-compte { padding: 10px 16px 12px; }
  .fenetre-compte-ico { width: 40px; height: 40px; }
  .fenetre-compte h2 { font-size: 1.25rem; margin: 0 0 4px; }
  .fenetre-compte p { margin-bottom: 8px; font-size: .95rem; }
  .fenetre-compte .menu-actions { gap: 6px; }
  .fenetre-compte .menu-actions .btn { min-height: 44px; padding-block: 4px; }
  .fenetre-compte .fenetre-compte-note { margin-top: 6px; }
}

/* v10.9 : pseudo (écran « Mon compte » et fenêtre « Choisis ton pseudo »). */
.compte-pseudo { display: grid; gap: 4px; }
.compte-pseudo .lien-bouton { justify-self: start; }
.compte-form > .petit { margin: 0; }
.fenetre-pseudo .compte-form { text-align: left; }
.fenetre-pseudo .compte-message { margin: 4px 0 0; }
.fenetre-pseudo .menu-actions { margin-top: 8px; }
.fenetre-pseudo .menu-actions .btn { min-height: 48px; }
@media (max-height: 520px) {
  .fenetre-pseudo h2 { font-size: 1.15rem; }
  .fenetre-pseudo #fenetre-pseudo-texte { font-size: .9rem; margin-bottom: 6px; }
  .fenetre-pseudo .compte-form input[type="text"] { min-height: 40px; padding-block: 4px; }
  .fenetre-pseudo .menu-actions { margin-top: 4px; }
  .fenetre-pseudo .menu-actions .btn { min-height: 40px; }
}

/* Écrans « Mes coffres », « Défi du jour ». */
.page { width: 100%; max-width: 640px; margin: 0 auto; padding: 8px 12px 16px; }
.page-corps { display: grid; gap: 12px; }
.carte-page {
  background: var(--parchemin); border: var(--contour) solid var(--encre); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: 0 3px 0 rgb(0 0 0 / .25);
}
.carte-page h3 { font-size: 1.15rem; margin-bottom: 10px; }
.carte-page .petit { margin: 6px 0 0; font-size: .92rem; color: var(--encre-douce); }
.resume-etoiles { text-align: center; }
.ico-geant { width: 76px; height: 76px; }
.gros-total { margin: 4px 0; font-size: 1.15rem; display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.gros-total strong { font: 800 2.4rem/1 "Rockwell", "Roboto Slab", Georgia, serif; color: var(--rouge-texte); }
.niveau-titre { margin: 8px 0 0; font: 800 1.3rem/1.2 "Rockwell", "Roboto Slab", Georgia, serif; }
.jauge-etoiles { height: 16px; margin: 8px 0 0; }
.jauge-etoiles span { display: block; height: 100%; background: #f2b705; }
.chemin-coffres, .journal, .taches-jour, .regles-etoiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.chemin-coffres li, .journal li, .taches-jour li {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #fff; border: var(--contour-fin) solid var(--parchemin-bord); border-radius: 12px;
}
.chemin-coffres li:not(.atteint) .ico { opacity: .55; filter: grayscale(.4); }
.chemin-coffres .ico, .taches-jour .ico, .journal .ico { width: 36px; height: 36px; }
.palier { display: flex; flex-direction: column; flex: 1; line-height: 1.2; }
.palier span { font-size: .85rem; color: var(--encre-douce); }
.etat { font-size: .88rem; font-weight: 700; color: var(--encre-douce); text-align: right; }
.etat.fait { color: #1f7a3a; }
/* Défi quitté avant la fin (v6.47) : plus de récompense aujourd'hui. */
.etat.quitte, .defi-type small.quitte, .defi-recompense.quitte, .fin-quitte { color: var(--rouge-texte); }
.fin-quitte { font-weight: 700; margin: 6px 0; }
.btn-petit {
  font: inherit; font-weight: 800; cursor: pointer; min-height: 44px; padding: 6px 16px; border-radius: 10px;
  border: var(--contour-fin) solid var(--encre); background: var(--rouge); color: #fff; box-shadow: 0 var(--ombre) 0 var(--encre); margin-left: auto;
}
.btn-petit:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--encre); }
.j-texte { flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.j-texte small { color: var(--encre-douce); }
.j-gain { white-space: nowrap; color: #1f7a3a; }
.regles-etoiles li { display: flex; gap: 10px; align-items: flex-start; line-height: 1.35; font-size: .95rem; }
.regles-etoiles .ico { width: 30px; height: 30px; flex: none; }
/* Bouton « Comment gagner des étoiles ? » et sa fenêtre (v6.42). */
.btn-comment {
  font: inherit; font-weight: 700; font-size: .95rem; cursor: pointer; min-height: 44px; margin-top: 10px; padding: 6px 14px;
  display: inline-flex; align-items: center; gap: 8px; background: #fff; color: var(--encre);
  border: var(--contour-fin) solid var(--encre); border-radius: 999px; box-shadow: 0 var(--ombre) 0 var(--encre);
}
.btn-comment:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--encre); }
.btn-comment .rond {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--rouge); color: #fff; font-weight: 800; font-size: .9rem;
}
.comment-gagner .regles-etoiles { text-align: left; margin: 6px 0 4px; }
.taches-jour .t-nom { flex: 1; font-weight: 700; }
.taches-jour li.fait { background: #eef7ef; border-color: #9ccaa5; }
.taches-jour .etat { margin-left: auto; }
/* Série de jours d'affilée vers le méga coffre (v6.38) : 5 cases, cochées jusqu'au jour atteint. */
.serie-mega { display: flex; align-items: center; gap: 12px; }
.serie-mega > .ico { width: 52px; height: 52px; }
.serie-cases { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.serie-cases li {
  display: grid; place-items: center; min-height: 40px; border-radius: 10px; font-weight: 800; font-size: .9rem;
  background: #fff; border: var(--contour-fin) dashed var(--parchemin-bord); color: var(--encre-douce);
}
.serie-cases li.fait { background: #f2b705; border: var(--contour-fin) solid var(--encre); color: var(--encre); }
.serie-cases li.mega { border-color: #6b3fa0; }
.serie-cases li.mega .ico { width: 28px; height: 28px; }
.prochain { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; }
.prochain .ico { width: 36px; height: 36px; }

/* Fenêtre d'ouverture d'un coffre. */
.coffre-fenetre { width: min(380px, calc(100vw - 32px)); }
.coffre-scene { position: relative; display: block; margin: 34px auto 0; padding: 0; border: 0; background: none; cursor: pointer; width: 190px; max-width: 60vw; }
.coffre-scene.ouvert { cursor: default; }
.coffre-grand { display: block; width: 100%; height: auto; overflow: visible; }
/* Ouverture par devant (v6.38) : le couvercle fermé s'aplatit vers la charnière (y = 60 dans le dessin),
   puis le dessous du couvercle se relève derrière ; lueur, trésor et étoiles sortent de l'intérieur. */
.couvercle-ferme, .couvercle-ouvert { transform-box: view-box; transform-origin: 80px 60px; }
.couvercle-ouvert { transform: scaleY(0); }
.coffre-eclat, .coffre-tresor { opacity: 0; }
.coffre-eclat { transform-box: view-box; transform-origin: 80px 66px; transform: scale(.3); transition: opacity .3s .25s, transform .6s .25s; }
.coffre-scene.tremble .coffre-grand { animation: tremble .12s linear infinite; }
@keyframes tremble { 0% { transform: rotate(-3deg); } 50% { transform: rotate(3deg) translateY(-2px); } 100% { transform: rotate(-3deg); } }
.coffre-scene.ouvert .couvercle-ferme { animation: couvercle-se-leve .2s ease-in forwards; }
.coffre-scene.ouvert .couvercle-ouvert { animation: couvercle-derriere .35s cubic-bezier(.3, 1.6, .5, 1) .2s forwards; }
.coffre-scene.ouvert .coffre-tresor { opacity: 1; transition: opacity .2s .15s; }
.coffre-scene.ouvert .coffre-eclat { opacity: 1; transform: none; }
.coffre-scene.ouvert .coffre-grand { animation: coffre-saute .5s ease-out; }
@keyframes couvercle-se-leve { to { transform: scaleY(0); } }
@keyframes couvercle-derriere { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes coffre-saute { 0% { transform: none; } 30% { transform: translateY(-6px) scale(1.04, .97); } 60% { transform: scale(.98, 1.03); } 100% { transform: none; } }
/* Les étoiles sortent par l'ouverture du coffre (à 44 % de la hauteur du dessin) et montent en éventail. */
.coffre-volees { position: absolute; left: 50%; top: 44%; width: 0; height: 0; pointer-events: none; }
.coffre-volees span { position: absolute; left: -14px; top: -14px; width: 28px; height: 28px; opacity: 0;
  animation: envol 1.2s cubic-bezier(.2, .8, .3, 1) calc(.3s + var(--d)) forwards; transform: rotate(var(--a)); }
.coffre-volees span .ico { transform: rotate(calc(-1 * var(--a))); }
.coffre-volees .ico { width: 28px; height: 28px; }
@keyframes envol { 0% { opacity: 0; transform: rotate(var(--a)) translateY(0) scale(.4); } 15% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; transform: rotate(var(--a)) translateY(-140px) scale(1.1); } }
.coffre-gain { min-height: 3em; margin: 10px 0 0; font-size: 1.05rem; }
.coffre-gain strong { display: block; font: 800 1.8rem/1.2 "Rockwell", "Roboto Slab", Georgia, serif; color: var(--rouge-texte); }
.gain-niveau { display: block; font-weight: 800; color: #1f7a3a; }
@media (prefers-reduced-motion: reduce) {
  .pastille-coffre.a-ouvrir .ico, .coffre-scene.tremble .coffre-grand, .coffre-scene.ouvert .coffre-grand, .coffre-volees span { animation: none; }
  .coffre-volees span { opacity: 1; }
  .coffre-scene.ouvert .couvercle-ferme { animation: none; transform: scaleY(0); }
  .coffre-scene.ouvert .couvercle-ouvert { animation: none; transform: none; }
  .coffre-eclat, .coffre-scene.ouvert .coffre-tresor { transition: none; }
}

/* Fin de partie : étoiles gagnées. */
.fin-etoiles { margin-top: 10px; padding: 10px; background: #fff; border: var(--contour-fin) solid var(--parchemin-bord); border-radius: 12px; }
.fin-etoiles p { margin: 4px 0; }
.fin-gain { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 1.5rem; }
.fin-gain strong { font-family: "Rockwell", "Roboto Slab", Georgia, serif; color: var(--rouge-texte); }
.ico-gain { width: 40px; height: 40px; }
.fin-bonus { font-weight: 800; color: #1f7a3a; display: flex; align-items: center; justify-content: center; gap: 6px; }
.fin-niveau { font-weight: 800; }
.fin-etoiles .petit { font-size: .9rem; color: var(--encre-douce); }
.btn-fin-coffre { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; min-height: 48px; padding: 6px 16px; }

/* Retour à l'accueil après une partie gagnée (v9.8) : « ⭐ +19 étoiles » au centre, sans encadré ;
   les étoiles s'envolent vers le compteur du haut (js/recompenses.js → animerGain). Halo clair pour rester lisible sur l'illustration. */
.gain-accueil { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 60; margin: 0; pointer-events: none;
  display: flex; align-items: center; gap: 10px; font-size: clamp(1.6rem, 6vw, 2.4rem); white-space: nowrap;
  animation: gain-arrive .35s ease-out both; transition: opacity .45s ease, transform .45s ease; }
/* v10.22 : texte jaune clair à contour brun foncé (lisible sur le ciel, l'herbe et le bouton rouge « Commencer l'aventure »),
   à la place du rouge à halo blanc qui se confondait avec le bouton. */
.gain-accueil strong { font-family: "Rockwell", "Roboto Slab", Georgia, serif; color: #fff3a8;
  -webkit-text-stroke: .14em var(--encre); paint-order: stroke fill;
  text-shadow: 0 2px 0 var(--encre), 0 3px 8px rgb(0 0 0 / .55); }
.gain-accueil .ico-gain { width: 1.6em; height: 1.6em; filter: drop-shadow(0 2px 3px rgb(0 0 0 / .55)); }
.gain-accueil.part { opacity: 0; transform: translate(-50%, -60%); }
@keyframes gain-arrive { from { opacity: 0; transform: translate(-50%, -50%) scale(.7); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.etoile-volante { position: fixed; z-index: 61; pointer-events: none; transform-origin: center; will-change: transform; }
.pe-total.recoit { animation: compteur-recoit .25s ease-out; }
@keyframes compteur-recoit { 50% { transform: scale(1.25); } }
@media (prefers-reduced-motion: reduce) { .gain-accueil, .pe-total.recoit { animation: none; } .gain-accueil { transition: none; } }

/* ---------- Défi du jour (v6.37) ---------- */
.defi-types { border: 0; margin: 0 0 6px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.defi-type { position: relative; }
.defi-type input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.defi-type > span {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 6px; min-height: 92px; cursor: pointer; text-align: center;
  background: #fff; border: var(--contour) solid var(--parchemin-bord); border-radius: 14px;
}
.defi-type .ico { width: 34px; height: 34px; }
.defi-type small { font-weight: 700; color: var(--encre-douce); }
.defi-type small.fait { color: #1f7a3a; }
.defi-type input:checked + span { border-color: var(--encre); background: #fff7d6; box-shadow: 0 var(--ombre) 0 var(--encre); }
.defi-type input:focus-visible + span { outline: 3px solid var(--rouge); outline-offset: 3px; }
.defi-choix { border: 0; margin: 8px 0 0; padding: 0; }
.defi-choix legend { font-weight: 800; margin-bottom: 4px; padding: 0; }
.defi-valider { margin-top: 6px; }
/* Partie rapide (v6.43). */
/* v6.45 : « Tout » / « Aucune » juste à côté du mot « Matières ». */
.titre-choix { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.titre-choix .legende { font-weight: 800; }
.rapide-matieres .btn-tout { min-height: 32px; }
#btn-lancer-rapide { width: 100%; margin-top: 10px; }
.defi-valider .btn { width: 100%; margin-top: 10px; }
.defi-valider .btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.defi-recompense { margin: 10px 0 0; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.defi-recompense.fait { color: #1f7a3a; }

/* ---------- Géographie et Histoire (v7.0, js/savoirs-carte.js) ---------- */
.carte-savoir { margin: 8px 0; display: flex; flex-direction: column; gap: 8px; }
.carte-savoir[hidden] { display: none; }
.carte-savoir button:not(.btn) { font: inherit; color: var(--encre); }
.carte-savoir button { cursor: pointer; touch-action: manipulation; }
.carte-savoir button:disabled { cursor: default; }
/* Réponses proposées (choix multiples, vrai ou faux, qui suis-je ?) : grands boutons, 2 par ligne si la place le permet. */
.savoir-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: 6px; }
.btn-option {
  min-height: 44px; padding: 6px 10px; border-radius: 10px; border: var(--contour) solid var(--encre); background: #fff;
  box-shadow: 0 var(--ombre) 0 var(--encre); font-weight: 700 !important; overflow-wrap: anywhere; line-height: 1.2;
}
.btn-option:not(:disabled):active { transform: translateY(1px); box-shadow: 0 1px 0 var(--encre); }
.btn-option.bonne { background: #d7f0dc; border-color: #1f5a2f; color: #1f5a2f; }
.btn-option.fausse { background: #fbe0e0; border-color: var(--rouge-texte); color: var(--rouge-texte); text-decoration: line-through; }
.btn-option:disabled:not(.bonne):not(.fausse) { opacity: .55; }
.savoir-sujet { text-align: center; }
.savoir-question { font-weight: 600; }
.savoir-affirmation { text-align: center; font-size: 1.1rem; }
.drapeau { display: inline-block; width: 64px; height: 48px; object-fit: cover; border: 1px solid #0003; border-radius: 3px; vertical-align: middle; background: #fff; }
.drapeau.grand { width: 120px; height: 90px; }
/* Relier : deux colonnes ; une pastille numérotée de couleur montre les paires reliées. */
.relier { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.relier-col { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.relier-g, .relier-d {
  display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 4px 8px; text-align: left; line-height: 1.15;
  border: var(--contour-fin) solid var(--encre); border-radius: 10px; background: #fff; font-weight: 600 !important; overflow-wrap: anywhere;
}
.relier-texte { min-width: 0; flex: 1; }
.relier-g.choisi { border-color: var(--bleu); box-shadow: 0 0 0 3px rgba(28, 52, 115, .3); background: #eef2ff; }
.puce-lien {
  flex: none; width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font: 800 .85rem/1 system-ui, sans-serif; background: var(--encre); color: #fff;
}
.puce-lien.vide { background: transparent; border: var(--contour-fin) dashed var(--parchemin-bord); }
.relie.lien-1 { --l: #c0392b; } .relie.lien-2 { --l: #1c3473; } .relie.lien-3 { --l: #1f6f3a; }
.relie.lien-4 { --l: #8e44ad; } .relie.lien-5 { --l: #b35400; } .relie.lien-6 { --l: #006d77; }
.relie { border-color: var(--l); background: color-mix(in srgb, var(--l) 10%, #fff); }
.relie .puce-lien { background: var(--l); }
.relier-g.bonne, .classer-ligne.bonne .classer-texte, .ordre-case.bonne { outline: 3px solid #1f5a2f; outline-offset: -1px; }
.relier-g.fausse, .classer-ligne.fausse .classer-texte, .ordre-case.fausse { outline: 3px dashed var(--rouge-texte); outline-offset: -1px; }
.relier.avec-images .relier-g { justify-content: flex-start; }
.relier.avec-images .drapeau { width: 52px; height: 39px; }
.btn-savoir-ok { align-self: center; min-height: 44px; min-width: 120px; }
.btn-savoir-ok:disabled { opacity: .5; }
.savoir-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.savoir-actions .btn { min-height: 44px; }
.savoir-actions .btn:disabled { opacity: .5; }
/* Remettre dans l'ordre : éléments à toucher, puis les cases numérotées du plus ancien au plus récent. */
.ordre-pioche { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.ordre-el {
  min-height: 44px; padding: 4px 10px; border: var(--contour) solid var(--encre); border-radius: 10px; background: #fff;
  box-shadow: 0 var(--ombre) 0 var(--encre); font-weight: 700 !important; line-height: 1.15;
}
.ordre-el[data-pris] { visibility: hidden; }
.ordre-sens { text-align: center; font-size: .85rem; color: var(--encre-douce); font-weight: 600; }
.ordre-cases { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ordre-case {
  width: 100%; display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 8px; text-align: left;
  border: var(--contour-fin) solid var(--encre); border-radius: 10px; background: #fff; font-weight: 700 !important;
}
.ordre-case.vide { border-style: dashed; border-color: var(--encre-douce); background: var(--parchemin); }
.ordre-num { flex: none; width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--encre); color: #fff; font-size: .85rem; }
/* Classer : une ligne par élément, deux boutons (une colonne chacun). */
.classer { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.classer-ligne { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.classer-texte { flex: 1 1 110px; font-weight: 700; padding: 2px 4px; border-radius: 6px; min-width: 0; overflow-wrap: anywhere; }
.classer-choix { display: flex; gap: 4px; flex: 1 1 200px; }
.btn-col {
  flex: 1 1 0; min-width: 0; min-height: 44px; padding: 2px 6px; border: var(--contour-fin) solid var(--encre); border-radius: 10px; background: #fff;
  font-size: .85rem !important; line-height: 1.1; overflow-wrap: anywhere;
}
.btn-col[aria-pressed="true"].col-0 { background: var(--bleu); border-color: var(--bleu); color: #fff; }
.btn-col[aria-pressed="true"].col-1 { background: var(--encre-douce); border-color: var(--encre-douce); color: #fff; }
/* Qui suis-je ? : les indices dévoilés, les points encore possibles. */
.indices { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.indices li { background: var(--parchemin); border-radius: 8px; padding: 4px 8px; }
.indice-num { font-weight: 800; margin-right: 4px; }
.indices-points { text-align: center; }
.btn-indice { align-self: center; min-height: 44px; }

/* Géographie et Histoire, écran des jeux (v7.0) : familles encadrées comme les thèmes d'orthographe.
   Géographie : 11 jeux en 3 familles (3, 4 et 4) → 4 par ligne en largeur (3 lignes), 3 par ligne en hauteur (5 lignes). */
#savoir-jeux { --rangs: 3; --cols: 4; --larg: min(100cqi, 1000px);
  --h: clamp(26px, calc((100cqh - 10.5rem) / var(--rangs) - 1.8cqh), 96px); }
/* v7.8 : avec 4 périodes d'histoire, la liste dépasse la hauteur sur téléphone ; centrée avec « height: 100% »,
   son haut sortait au-dessus de la zone qui défile (Préhistoire impossible à atteindre). min-height : centrée
   quand elle tient, sinon elle grandit et tout se fait défiler. */
#savoir-jeux { height: auto; min-height: 100%; }
#savoir-liste { display: flex; flex-direction: column; gap: clamp(4px, 1.2cqh, 12px); }
#savoir-liste .famille[hidden] { display: none; }
#savoir-jeux .famille .packs { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(4px, 1cqh, 10px) clamp(5px, 1.4cqi, 12px); }
#savoir-jeux .famille { border: var(--contour-fin) solid var(--parchemin-bord); background: #fffaf0; border-radius: 12px; padding: clamp(3px, 1cqh, 10px) clamp(5px, 1.2cqi, 12px); }
.reglages-joueur #savoir-jeux .pack span {
  border-radius: 18px; font-size: clamp(.7rem, min(calc(var(--h) * .3), calc(var(--larg) / var(--cols) / 8)), 1.5rem);
  line-height: 1.05; padding: 1px 4px; hyphens: auto;
}
#savoir-jeux .pack { display: flex; }
#savoir-jeux .btn-tout .long { display: inline; }
#savoir-jeux .btn-tout .court { display: none; }
@container (max-aspect-ratio: 1/1) {
  #savoir-jeux { --rangs: 5; --cols: 3; --h: clamp(26px, calc((100cqh - 13rem) / var(--rangs) - 1.4cqh), 96px); }
  #savoir-jeux .famille .packs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@container (max-width: 330px) {
  #savoir-jeux .btn-tout .long { display: none; }
  #savoir-jeux .btn-tout .court { display: inline; }
}
@container (max-height: 420px) {
  #savoir-jeux { --h: clamp(24px, calc((100cqh - 9.8rem) / var(--rangs) - 1cqh), 60px); gap: 3px; }
  #savoir-jeux .famille { padding: 1px 5px 3px; border-radius: 9px; }
  #savoir-jeux .famille-tete { margin: 0 0 1px; }
  #savoir-jeux .famille-nom { font-size: .72rem; line-height: 1.1; }
  .reglages-joueur #savoir-jeux .btn-tout-famille { min-height: 20px; padding: 0 10px; font-size: .7rem; line-height: 1; }
  #savoir-jeux .famille .packs { gap: 3px 5px; }
  #savoir-jeux .reglage-tete { margin-bottom: 2px; }
  #savoir-liste { gap: 4px; }
  .reglages-joueur #savoir-jeux .pack span { font-size: clamp(.66rem, calc(var(--h) * .34), .95rem); line-height: 1; padding: 1px 2px; }
}
/* v7.2 (demande du 12/11/2026 : les noms étaient coupés par le contour) : chaque jeu est une tuile aux coins
   arrondis (plus une pilule), l'icône et le nom dans deux blocs séparés, le nom jamais coupé au milieu d'un mot.
   En largeur : 4 tuiles par ligne (une famille = une ligne), icône au-dessus du nom.
   En hauteur (téléphone) : 2 tuiles par ligne, icône à gauche du nom, sur une seule ligne. */
#savoir-jeux { --rangs: 3; --cols: 4; }
#savoir-jeux .famille .packs { grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); }
.reglages-joueur #savoir-jeux .pack span {
  flex-direction: column; gap: 2px; border-radius: 14px; padding: 4px 6px; hyphens: manual;
  overflow-wrap: normal; word-break: normal; line-height: 1.1;
  font-size: clamp(.8rem, min(calc(var(--h) * .22), calc(var(--larg) / var(--cols) / 9)), 1.3rem);
}
#savoir-jeux .pack-icone { font-style: normal; font-size: 1.5em; line-height: 1; }
#savoir-jeux .pack-nom { font-weight: 700; margin: 0; font-size: 1em; white-space: nowrap; }
@container (max-aspect-ratio: 1/1) {
  #savoir-jeux { --rangs: 6; --cols: 2; --h: clamp(30px, calc((100cqh - 13rem) / var(--rangs) - 1.2cqh), 72px); }
  #savoir-jeux .famille .packs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reglages-joueur #savoir-jeux .pack span {
    flex-direction: row; justify-content: flex-start; gap: 8px; padding: 2px 10px; text-align: left;
    font-size: clamp(.8rem, min(calc(var(--h) * .36), calc(var(--larg) / 2 / 10)), 1.2rem);
  }
  #savoir-jeux .pack-icone { font-size: 1.35em; }
}
@container (max-height: 420px) {
  #savoir-jeux { --h: clamp(26px, calc((100cqh - 9.8rem) / var(--rangs) - 1cqh), 60px); }
  .reglages-joueur #savoir-jeux .pack span { font-size: clamp(.68rem, min(calc(var(--h) * .34), calc(var(--larg) / var(--cols) / 10)), .95rem); padding: 1px 6px; gap: 5px; flex-direction: row; justify-content: center; }
  #savoir-jeux .pack-icone { font-size: 1.2em; }
}
/* Écrans peu hauts (téléphone carré, paysage) : cartes de géographie plus serrées, pour tout voir sans défiler. */
@media (max-height: 600px) {
  .carte-savoir { gap: 5px; margin: 4px 0; }
  .relier-col, .relier { gap: 4px; }
  .relier-g, .relier-d { min-height: 34px; padding: 2px 6px; font-size: .9rem; }
  .relier.avec-images .drapeau { width: 40px; height: 30px; }
  .puce-lien { width: 22px; height: 22px; font-size: .8rem; }
  .btn-option { min-height: 38px; padding: 3px 8px; }
  .btn-savoir-ok, .savoir-actions .btn, .btn-indice { min-height: 38px; }
  .ordre-pioche { gap: 4px; }
  .ordre-el { min-height: 34px; padding: 2px 8px; font-size: .9rem; }
  .ordre-cases { gap: 3px; }
  .ordre-case { min-height: 30px; padding: 1px 6px; font-size: .9rem; }
  .ordre-num { width: 20px; height: 20px; }
  .ordre-sens { font-size: .75rem; line-height: 1.1; }
  .classer { gap: 3px; }
  .btn-col { min-height: 34px; font-size: .8rem !important; }
  .drapeau.grand { width: 96px; height: 72px; }
  .indices li { padding: 2px 6px; font-size: .9rem; }
}
/* Si la carte ne tient pas dans l'encadré (6 paires sur un téléphone carré), elle défile dans l'encadré
   et « OK » reste toujours visible en bas (comme les boutons du tour, v6.8). */
.tour .carte-savoir .btn-savoir-ok, .tour .carte-savoir .savoir-actions { position: sticky; bottom: 2px; z-index: 2; }
.tour .carte-savoir .savoir-actions { background: #fff; padding-block: 2px; }
.tour .carte-savoir .btn-savoir-ok { box-shadow: 0 var(--ombre) 0 var(--encre), 0 0 0 6px #fff; }
/* OK pas encore possible : bouton plein (pas transparent, il peut passer par-dessus la carte qui défile). */
.carte-savoir .btn-savoir-ok:disabled, .carte-savoir .savoir-actions .btn:disabled { opacity: 1; background: #e4d9c6; color: #5e4a3a; text-shadow: none; box-shadow: 0 0 0 6px #fff; }
/* Crédits (v7.0) : bouton du pied de page qui ressemble au lien « Mentions légales ». */
.pied-bouton { font: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; min-height: 24px; }
.credits-liste { text-align: left; padding-left: 20px; margin: 12px 0; line-height: 1.4; }
.credits-liste a { color: var(--bleu); }
/* Toucher sur la carte (v7.1) : la carte prend la largeur de la carte à jouer, sans dépasser la moitié de l'écran en hauteur. */
.carte-geo { display: flex; justify-content: center; position: relative; }
/* v7.2 : touch-action none → pincer sur la carte la zoome elle seule (pas la page) ; on fait défiler la page à côté. */
.carte-geo svg { width: 100%; max-height: min(52vh, 520px); height: auto; background: #cfe7f5; border: var(--contour-fin) solid var(--encre); border-radius: 8px; touch-action: none; user-select: none; -webkit-user-select: none; }
.carte-geo.zoomee svg { cursor: grab; }
/* Boutons de zoom dans le coin de la carte : 44 px (taille de cible recommandée, WCAG 2.5.5). */
.carte-zoom { position: absolute; top: 6px; right: 6px; display: flex; flex-direction: column; gap: 6px; }
.carte-savoir .carte-zoom .btn-zoom { width: 44px; height: 44px; border-radius: 12px; border: var(--contour-fin) solid var(--encre); background: #fffaf0; color: var(--encre);
  font: 800 1.5rem/1 system-ui, sans-serif; display: grid; place-items: center; padding: 0; box-shadow: 0 2px 0 var(--encre); }
.carte-savoir .carte-zoom .btn-zoom[hidden] { display: none; }
.carte-savoir .carte-zoom .btn-zoom:disabled { opacity: .4; box-shadow: none; }
.btn-zoom:focus-visible { outline: 3px solid var(--rouge); outline-offset: 2px; }
.carte-geo .zone { fill: #f3ead2; stroke: var(--encre); stroke-width: 1; vector-effect: non-scaling-stroke; cursor: pointer; }
.carte-geo .zone.cible:hover, .carte-geo .zone.cible:focus-visible { fill: var(--jaune); outline: none; }
.carte-geo .zone:focus-visible { stroke-width: 3; }
.carte-geo .zone.bonne { fill: #3aa55c; }
.carte-geo .zone.fausse { fill: #e3262a; }
@media (max-height: 600px) { .carte-geo svg { max-height: 46vh; } .carte-savoir .carte-zoom .btn-zoom { width: 36px; height: 36px; font-size: 1.2rem; } .carte-zoom { gap: 4px; } }

/* v8.0 : Quiz de géographie et d'histoire — phrases longues sur une colonne ; carte du quiz (zone en vert, pas à toucher). */
.savoir-options.longues { grid-template-columns: 1fr; }
.savoir-options.longues .btn-option { text-align: left; }
.carte-quiz .zone { cursor: default; }
.carte-quiz + .savoir-options { margin-top: 8px; }
.carte-quiz svg { max-height: min(44vh, 460px); }
@media (max-height: 600px) { .carte-quiz svg { max-height: 38vh; } }

/* ---------- Baby jeux (v9.1 : js/baby.js, js/baby-carte.js, js/baby-ecran.js) ---------- */
/* Bouton de l'accueil : jaune, texte brun foncé (contraste élevé), sous « Partie rapide solo ». */
.btn-baby { background: var(--jaune); color: var(--encre); box-shadow: 0 var(--ombre) 0 var(--encre); }
.btn-baby:hover { filter: brightness(1.05); }
.btn-baby:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--encre); }
/* Écran des réglages : lettres et chiffres en petites pastilles, jeux en liste. */
.baby-grille { gap: 6px !important; }
.baby-grille .pack span { min-width: 2.9em; justify-content: center; padding: 4px 8px; font-weight: 800; gap: 3px; }
.baby-min { font-weight: 600; opacity: .8; }
.baby-jeux .pack span { font-weight: 600; }

/* Carte d'un baby jeu */
.baby { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.baby .gram-bouton { min-width: 64px; min-height: 60px; }
.baby-gros { font: 800 clamp(1.6rem, 6vw, 2.1rem)/1 system-ui, sans-serif; }
.baby-de { width: 54px; height: 54px; }
.baby-de rect { fill: #fff; stroke: var(--encre); stroke-width: 3; }
.baby-de circle { fill: var(--encre); }
.baby-des { display: inline-flex; gap: 6px; }
.baby-main { height: 130px; width: auto; }
.baby-main.miroir { transform: scaleX(-1); } /* 1re main de 6 à 10 : pouce vers l'extérieur */
.baby-mains { display: inline-flex; gap: 4px; align-items: flex-end; }
.baby-objets { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 6px; max-width: 15em; font-size: clamp(1.5rem, 6vw, 2rem); line-height: 1.15; }
.baby-encore { margin: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.baby-encore .baby-objets { max-width: 9em; }
.baby-ajout { display: inline-flex; align-items: center; gap: 8px; } /* le « + » reste avec les objets reçus, même quand ça passe à la ligne */
.baby-plus { font: 800 2rem/1 system-ui, sans-serif; }
.baby-objets.arrive { animation: baby-arrive 1s ease-out; }
@keyframes baby-arrive { from { transform: translateX(60px); opacity: 0; } }
.baby-panier .baby-objets { font-size: 1.25rem; max-width: 6.5em; }
/* Suite à compléter (v10.8) : à plat dans un bandeau, sans relief ni ombre, pour ne pas ressembler aux boutons de réponse (en relief, plus bas). */
.baby-suite { margin: 0; padding: 10px 12px; width: 100%; box-sizing: border-box; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  background: var(--parchemin); border-radius: 14px; }
.baby-case { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 50px; padding: 0 6px;
  border: var(--contour-fin) solid var(--parchemin-bord); border-radius: 10px; background: transparent; color: var(--encre-douce); font: 700 1.6rem/1 system-ui, sans-serif; cursor: default; }
.baby-case.trou { border: var(--contour) dashed var(--bleu); color: var(--bleu); background: #fff; font-weight: 800; }
.baby-case.juste, .baby-case.fausse { border: var(--contour) solid #1e7b45; color: #1f5a2f; background: #e3f3e6; font-weight: 800; }
/* Invite entre la suite et les réponses : même ligne pointillée que dans « Remettre la phrase ». */
.baby-invite { margin: 0; width: 100%; padding-top: 10px; border-top: var(--contour-fin) dashed var(--parchemin-bord); text-align: center; font-weight: 700; color: var(--encre-douce); }
.baby-oreille { margin: 0; font-size: 3rem; line-height: 1; }
.baby-image { margin: 0; font-size: clamp(3.5rem, 14vw, 4.5rem); line-height: 1; }
.baby-motimage { margin: 0; font-size: 1.5rem; }
.baby-modele { margin: 0; font: 800 clamp(2.2rem, 8vw, 2.8rem)/1 system-ui, sans-serif; display: flex; align-items: center; gap: 8px; }
.baby-modele.baby-son { font-size: 1.5rem; flex-wrap: wrap; justify-content: center; }
.baby-modele small { font-size: .95rem; font-weight: 600; color: var(--encre-douce); }
.baby-compte { margin: 0; font-weight: 700; color: var(--encre-douce); }
/* Arène : les jetons se baladent un peu autour de leur place, penchés. */
.baby-arene { position: relative; width: 100%; height: clamp(190px, 32vh, 290px); border: var(--contour) dashed var(--parchemin-bord); border-radius: 16px;
  background: #fffbef; overflow: hidden; touch-action: manipulation; }
.baby-jeton {
  position: absolute; left: calc(34px + (100% - 68px) * var(--x)); top: calc(30px + (100% - 60px) * var(--y));
  transform: translate(-50%, -50%) rotate(var(--rot)); animation: baby-balade var(--dur) ease-in-out infinite alternate;
  min-width: 46px; height: 46px; padding: 0 6px; border-radius: 12px; border: var(--contour) solid var(--encre); background: #fff; color: var(--encre);
  font: 800 1.5rem/1 system-ui, sans-serif; cursor: pointer; box-shadow: 0 var(--ombre) 0 var(--encre);
}
@keyframes baby-balade { to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--rot)); } }
.baby-jeton.trouve { background: #e3f3e6; border-color: #1e7b45; color: #1f5a2f; box-shadow: 0 0 0 4px #1e7b45; animation: none; cursor: default; }
.baby-jeton.rate { opacity: .4; animation: none; cursor: default; text-decoration: line-through; }
.baby-jeton.souligne { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 4px; }
/* Bulles (v10.18) : la taille (--d) suit le chiffre, la couleur (--teinte) change à chaque chiffre ; elles restent là où on les laisse. */
.baby-arene.bulles { height: clamp(200px, 34vh, 290px); }
.baby-arene.bulles .baby-jeton {
  width: var(--d, 58px); height: var(--d, 58px); min-width: 0; padding: 0; border-radius: 50%;
  left: calc(var(--d) / 2 + 10px + (100% - var(--d) - 20px) * var(--x)); top: calc(var(--d) / 2 + 8px + (100% - var(--d) - 16px) * var(--y));
  font-size: calc(var(--d) * .42); border-color: hsl(var(--teinte, 210) 60% 32%); color: hsl(var(--teinte, 210) 75% 16%);
  background: radial-gradient(circle at 32% 30%, #fff 0 16%, hsl(var(--teinte, 210) 90% 86%) 55%, hsl(var(--teinte, 210) 70% 64%)); box-shadow: none;
}
/* Mauvais jeton : il tremble sans quitter sa place (la secousse utilise « translate », la balade continue en dessous). */
.baby-jeton.secoue { animation: baby-balade var(--dur) ease-in-out infinite alternate, baby-secoue .4s; }
@keyframes baby-secoue { 0%, 100% { translate: 0 0; } 25% { translate: -8px 0; } 75% { translate: 8px 0; } }
/* Baby jeux, réponse donnée (v10.18) : sur téléphone et tablette, le jeu (bulles, jetons, mains…) se cache et il ne reste que le message
   (« Bravo ! » ou « Presque ! … ») et le bouton « J'ai compris » : rien n'est coupé, rien à faire défiler. */
@media (max-width: 899px), (pointer: coarse) {
  .carte-piochee.baby-repondue .carte-gram { display: none; }
}
/* Remettre dans l'ordre et ranger dans les paniers */
.baby-rangee { width: 100%; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; min-height: 60px; }
.baby-ligne { padding-top: 10px; border-top: var(--contour-fin) dashed var(--parchemin-bord); }
.baby-tuile { min-width: 56px; height: 56px; padding: 0 8px; border-radius: 12px; border: var(--contour) solid var(--encre); background: #fff; color: var(--encre);
  font: 800 1.6rem/1 system-ui, sans-serif; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 var(--ombre) 0 var(--encre); }
.baby-tuile.vide { visibility: hidden; }
.baby-tuile.attente { border-style: dashed; border-color: var(--bleu); box-shadow: none; background: transparent; cursor: default; }
.baby-tuile.posee { background: var(--parchemin); }
.baby-tuile.choisi { background: var(--jaune); box-shadow: 0 0 0 3px var(--bleu); }
.baby-tuile.juste { background: #e3f3e6; border-color: #1e7b45; color: #1f5a2f; box-shadow: none; }
.baby-tuile.fausse { background: #fbe6e6; border-color: var(--rouge-texte); color: var(--rouge-texte); box-shadow: none; }
.baby-tuile.petite { min-width: 44px; height: 44px; font-size: 1.3rem; }
.baby-paniers { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.baby-panier-col { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.baby-panier-tete { min-height: 48px; border-radius: 12px; border: var(--contour) solid var(--encre); background: #fff; color: var(--encre); font: 800 1rem/1.1 system-ui, sans-serif; cursor: pointer; }
.baby-panier-tete:disabled { cursor: default; opacity: .75; }
.baby-panier-dedans { min-height: 56px; display: flex; flex-wrap: wrap; justify-content: center; align-content: flex-start; gap: 6px; padding: 6px; border: var(--contour-fin) dashed var(--parchemin-bord); border-radius: 12px; }
.baby-aide { margin: 0; color: var(--encre-douce); font-weight: 600; }
/* Fabrique à mots : voyelles (rouge) à gauche, consonnes (bleu) à droite, sons (jaune) dessous. */
.baby-mot { margin: 0; min-height: 58px; width: 100%; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2px;
  padding: 4px 8px; border-bottom: var(--contour) solid var(--encre); font: 800 clamp(1.7rem, 7vw, 2.2rem)/1.1 system-ui, sans-serif; letter-spacing: .04em; overflow-wrap: anywhere; }
.baby-piece.son { color: var(--bleu); text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 5px; }
.baby-mot-vide { color: var(--parchemin-bord); }
.baby-fabrique-cols { width: 100%; display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 5fr); gap: 8px; }
.baby-fab-col { min-width: 0; width: 100%; }
.baby-fab-titre { margin: 0 0 4px; font-weight: 800; font-size: .85rem; color: var(--encre-douce); text-align: center; }
.baby-touches { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.baby-touche { min-width: 40px; height: 40px; padding: 0 6px; border-radius: 10px; border: var(--contour-fin) solid var(--encre); background: #fff; color: var(--encre);
  font: 800 1.1rem/1 system-ui, sans-serif; cursor: pointer; box-shadow: 0 2px 0 var(--encre); }
.baby-touche:active { transform: translateY(1px); box-shadow: none; }
.baby-touche.voy { background: #fdebe8; color: var(--rouge-texte); border-color: var(--rouge-texte); }
.baby-touche.cons { background: #eef2fb; color: var(--bleu); border-color: var(--bleu); }
.baby-touche.son { background: #fff6c2; }
.baby-fab-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.baby-fab-actions .btn { padding: 8px 14px; font-size: 1rem; }
@media (prefers-reduced-motion: reduce) {
  .baby-jeton, .baby-objets.arrive { animation: none !important; }
}
/* Relier (grandes / petites lettres, dés / chiffres) : lettres et chiffres en grand, centrés. */
.baby .gram-mot-relier { justify-content: center; font: 800 1.6rem/1 system-ui, sans-serif; min-height: 64px; }
.baby .gram-mot-relier .baby-de { width: 40px; height: 40px; }

/* Réglages de Lettres et de Chiffres dans « Personnaliser » (v10.41, js/baby-reglages.js ; ex-écran Baby jeux de la v9.2).
   Le panneau remplit la zone de réglages et défile à l'intérieur si l'écran est bas ; rien ne dépasse en largeur. */
.reglages-joueur .reglages-baby { height: 100%; min-height: 0; justify-content: flex-start; align-items: stretch; overflow-y: auto; overflow-x: hidden;
  padding: 2px clamp(4px, 1.5cqi, 12px) 6px; }
.reglages-baby .baby-reglages { width: min(100%, 760px); margin-inline: auto; display: flex; flex-direction: column; gap: clamp(4px, 1.2cqh, 12px); }
.baby-reglages .defi-choix { margin: 0; min-width: 0; border: 0; padding: 0; }
.baby-reglages .defi-choix legend, .baby-reglages .titre-choix { margin-bottom: clamp(2px, .6vh, 6px); font-weight: 800; }
.baby-reglages .titre-choix { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.baby-ecritures { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px !important; }
.reglages-joueur .baby-reglages .pack span { height: auto; min-height: clamp(30px, 5vh, 44px); width: 100%; padding: 2px 6px; justify-content: center; text-align: center; line-height: 1.15; font-size: clamp(.8rem, 2vh, 1rem); }
/* Lettres : 7 par ligne sur téléphone, 9 sur tablette et ordinateur ; chiffres : 5 par ligne. */
.baby-grille { display: grid !important; gap: clamp(4px, .9vh, 8px) 6px !important; }
.baby-grille.lettres { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.baby-grille.chiffres { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (min-width: 600px) { .baby-grille.lettres { grid-template-columns: repeat(9, minmax(0, 1fr)); } }
.reglages-joueur .baby-grille .pack span { min-width: 0; padding: 2px; border-radius: 12px; font-weight: 800; font-size: clamp(.95rem, 2.6vh, 1.3rem); white-space: nowrap; }
.reglages-joueur .baby-grille.chiffres .pack span { min-height: clamp(36px, 6vh, 54px); font-size: clamp(1.1rem, 3.2vh, 1.6rem); }
/* Jeux : 2 colonnes. */
.baby-jeux { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(4px, 1vh, 10px) 8px !important; }
.reglages-joueur .baby-jeux .pack span { border-radius: 14px; padding: 2px 8px; gap: 6px; font-weight: 600; }
.baby-reglages .pack .baby-ico { font-style: normal; display: inline; border: 0; padding: 0; min-height: 0; background: none; }
@media (max-height: 620px) {
  .baby-reglages .btn-tout { min-height: 26px; padding-block: 0; }
  .reglages-joueur .baby-reglages .pack span { min-height: 28px; }
  .reglages-joueur .baby-grille .pack span { min-height: 26px; font-size: .9rem; border-radius: 9px; }
  .reglages-joueur .baby-jeux .pack span { font-size: .74rem; }
}

/* ---------- Mini-jeux (v10.41, js/minijeux.js) : la liste, puis le jeu et son résultat ---------- */
/* v10.92 (demande du 02/12/2026) : tuiles illustrées (images 200 × 154 avec le nom du jeu) ; --t = largeur de la tuile (148 px, validée par l'utilisateur ; 124 px
   sur téléphone, où les lignes défilent). La pastille « i » (rouge, 22 % de la largeur, validée) est sur le coin haut droit, l'étoile « favori » sur le coin haut gauche. */
.minijeu-case { --t: 148px; position: relative; width: var(--t); flex: none; }
.minijeu-carte { position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: 13%; background: none; box-shadow: none; font: inherit; line-height: 0; cursor: pointer; }
.minijeu-img { display: block; width: 100%; height: auto; }
.minijeu-carte:hover { filter: brightness(1.05); }
.minijeu-carte:active { transform: translateY(1px); }
/* La pastille « i » : ronde, fond rouge, « i » blanc, sur le coin haut droit de la tuile ; la zone à toucher dépasse de 10 px tout autour. */
.minijeu-info { position: absolute; top: calc(var(--t) * -.085); left: calc(var(--t) * .845); width: calc(var(--t) * .22); height: calc(var(--t) * .22); padding: 0; display: grid; place-items: center; border-radius: 50%;
  border: var(--contour-fin) solid var(--encre); background: var(--rouge); color: #fff; font: italic 800 calc(var(--t) * .13)/1 Georgia, "Times New Roman", serif; cursor: pointer; }
.minijeu-info::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; }
.minijeu-info:hover { filter: brightness(1.1); }
/* v10.91 (demande du 02/12/2026) : la liste en lignes par catégorie, une étoile « favori » en haut à gauche de chaque tuile (comme le « i » en haut à droite)
   et une recherche. Téléphone : chaque ligne défile de droite à gauche ; tablette et ordinateur : la ligne passe à la ligne, sans défilement horizontal. */
.mj-recherche { display: grid; justify-items: center; gap: 4px; margin: 0 8px 8px; }
.mj-recherche-etiquette { font-weight: 800; font-size: .9rem; }
.mj-recherche-champ { width: 100%; max-width: 420px; min-height: 44px; box-sizing: border-box; padding: 8px 16px; border: var(--contour) solid var(--encre); border-radius: 22px; background: #fff; color: var(--encre); font: inherit; font-size: 1rem; }
.mj-recherche-champ:focus-visible { outline: 3px solid var(--bleu); outline-offset: 2px; }
.minijeux, .mj-contenu, .mj-ligne { min-width: 0; max-width: 100%; }
#ecran-minijeux { max-width: 1400px; } /* ordinateur : Lettres, Chiffres et Quiz (12 tuiles) tiennent sur une seule ligne */
.carte-page.minijeux { padding-inline: 8px; } /* sans cela, la ligne s'élargit à son contenu au lieu de défiler */
/* Séparateur entre catégories (v10.94, choix de l'utilisateur du 02/12/2026) : bandes de fond alternées, vert puis ocre, 16 px entre deux bandes, titre à 1,4 rem */
.mj-ligne { margin: 0 0 16px; padding: 10px 0 4px; border-radius: 12px; }
.mj-ligne:nth-of-type(odd) { background: rgba(63, 122, 70, .25); }
.mj-ligne:nth-of-type(even) { background: rgba(181, 101, 29, .22); }
.carte-page .mj-ligne-titre { margin: 0; padding: 0 12px; font-size: 1.4rem; text-align: left; } /* « .carte-page » : sinon la règle .carte-page h3 impose 1,15 rem */
.mj-rail { display: flex; flex-wrap: wrap; gap: 14px 22px; padding: 14px 14px 8px; }
.mj-nombre, .mj-aucun { margin: 0; padding: 0 12px; text-align: center; font-weight: 700; }
.minijeu-fav { position: absolute; top: calc(var(--t) * -.085); left: calc(var(--t) * -.065); width: calc(var(--t) * .22); height: calc(var(--t) * .22); padding: 0; display: grid; place-items: center; border-radius: 50%;
  border: var(--contour-fin) solid var(--encre); background: #fff; color: var(--encre); font: 800 calc(var(--t) * .13)/1 system-ui, sans-serif; cursor: pointer; }
/* v11.5 : étoile SVG (remplace le caractère ★/☆, trop pointu) ; 65 % de la pastille. Vide : contour brun seul ; favori : pleine. */
.minijeu-etoile { display: block; width: 65%; height: 65%; overflow: visible; fill: none; stroke: currentColor; stroke-width: 6.8; stroke-linejoin: round; }
.minijeu-fav[aria-pressed="true"] .minijeu-etoile { fill: currentColor; stroke: none; }
.minijeu-fav::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; }
.minijeu-fav[aria-pressed="true"] { background: #ffd23f; }
.minijeu-fav:hover { filter: brightness(1.05); }
.minijeu-fav:active { transform: scale(.92); }
.quiz-theme { margin: 0 0 8px; font-weight: 800; font-size: 1.1rem; text-align: center; }
@media (max-width: 600px), (max-height: 520px) and (orientation: landscape) {
  .mj-ligne .mj-rail { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; padding-right: 28px; scroll-padding-inline: 16px; scroll-snap-type: x proximity; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent); }
  .mj-ligne .mj-rail::-webkit-scrollbar { display: none; }
  .mj-ligne .minijeu-case { scroll-snap-align: start; }
  .minijeu-case { --t: 124px; }
}

.minijeu-info:active { transform: scale(.92); }
.minijeu-info-fenetre { max-height: calc(100dvh - 24px); overflow-y: auto; }
.minijeu-info-fenetre h2 { margin-top: 0; }
.minijeu-info-fenetre p { margin: 0 0 10px; font-size: 1.05rem; }
.minijeu-info-img { display: block; margin: 0 auto; width: auto; max-width: 100%; height: auto; max-height: min(52dvh, 420px); border: var(--contour) solid var(--encre); border-radius: 12px; background: #fff; }
.minijeu { display: grid; gap: 10px; justify-items: center; text-align: center; }
.minijeu-qui { margin: 0; min-height: 1.2em; color: var(--encre-douce); font-weight: 700; }
.minijeu-consigne { margin: 0; font-size: 1.1rem; font-weight: 700; }
.minijeu-jeu { width: 100%; }
/* v10.60 : « Les sons » — le cadre du jeu prend toute la largeur de la carte. Sans cela, la grille centrée (justify-items) le
   réduisait à la taille de son contenu : colonnes de 40 px, « [ə] » écrit lettre par lettre en hauteur. */
.minijeu .carte-gram, .minijeu #minijeu-fin { width: 100%; }
.minijeu .gram-col { gap: 8px; }
.minijeu .gram-mot-relier { min-height: 48px; font-size: 1.15rem; }
.minijeu-fin { padding-block: 12px; }
.minijeu-bravo { margin: 0; font-size: 1.5rem; font-weight: 800; }
.minijeu-resultat { margin: 0; font-size: 1.2rem; }
.minijeu-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
@media (prefers-reduced-motion: reduce) { .minijeu-carte:active, .minijeu-info:active, .minijeu-fav:active { transform: none; } }

/* ---------- v10.13 (demande du 18/11/2026) : Histoire et Géographie présentées comme les temps de la conjugaison ----------
   Un cadre par famille : son nom et « Tout » en haut, ses jeux l'un sous l'autre. js/plateau.js (rangerSavoir) range les
   cadres en colonnes (.colonne) de hauteur voisine, dans l'ordre, et fournit --nc (colonnes), --col-fam / --col-jeux
   (familles et jeux de la colonne la plus chargée) : la hauteur des boutons (--ht) en découle, pour que tout tienne sans
   défiler. Nombre de colonnes voulu (--c) : une par famille en largeur ; 2 (3 sur tablette) en hauteur ; 3 à 6 sur une zone peu haute.
   Si la place manque vraiment (téléphone en paysage), la zone défile comme avant : rien n'est coupé. */
#savoir-jeux { --larg: min(100cqi, 1100px); height: auto; min-height: 100%; justify-content: flex-start; }
#savoir-jeux .reglage { display: flex; flex-direction: column; flex: 1 0 auto; }
#savoir-liste {
  --c: var(--nb-fam, 7);
  --reserve: 6rem; --hh: 5.6rem; --plafond: 56px; /* titre « Jeux », marges ; en-tête d'un cadre ; hauteur maximale d'un bouton */
  --ht: clamp(24px, calc((100cqh - var(--reserve) - var(--col-fam, 1) * var(--hh)) / var(--col-jeux, 6) - 1cqh), var(--plafond));
  --gap-col: clamp(5px, 1.2cqi, 14px);
  --res: 26px; /* bordure et marges d'un cadre + marges d'un bouton : largeur qui n'est pas pour le texte */
  flex: 1 0 auto; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  gap: var(--gap-col); align-items: start; align-content: safe center;
}
#savoir-liste .famille[hidden] { display: none; }
#savoir-liste .colonne { min-width: 0; display: flex; flex-direction: column; gap: var(--gap-col); }
#savoir-jeux .famille { min-width: 0; display: flex; flex-direction: column; gap: clamp(2px, .7cqh, 8px); border: var(--contour) solid var(--encre); border-radius: 16px; background: rgb(255 255 255 / .55); padding: clamp(4px, 1cqh, 10px) clamp(4px, 1cqi, 10px); }
#savoir-jeux .famille-tete { flex-direction: column; justify-content: flex-start; align-items: center; gap: 3px; margin: 0; }
#savoir-jeux .famille-nom { text-align: center; color: var(--encre); line-height: 1.1;
  font-size: clamp(.7rem, min(calc(var(--ht) * .32), calc((var(--larg) / var(--nc, var(--c)) - var(--gap-col) - var(--res)) / 9.4)), 1.05rem); }
.reglages-joueur #savoir-jeux .btn-tout-famille { min-height: 24px; padding: 0 10px; font-size: .72rem; line-height: 1; }
#savoir-jeux .famille .packs { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(2px, .7cqh, 8px); }
#savoir-jeux .pack { min-width: 0; }
.reglages-joueur #savoir-jeux .pack span {
  flex-direction: row; justify-content: flex-start; gap: .35em; text-align: left; height: var(--ht); min-height: 0; min-width: 0;
  padding: 0 clamp(3px, .8cqi, 8px); border-radius: 12px; line-height: 1; overflow: hidden;
  font-size: clamp(.62rem, min(calc(var(--ht) * .4), calc((var(--larg) / var(--nc, var(--c)) - var(--gap-col) - var(--res)) / 9.4)), 1.1rem);
}
#savoir-jeux .pack-icone { font-size: 1.15em; flex: none; }
#savoir-jeux .pack-nom { min-width: 0; }
/* En hauteur : 2 colonnes (3 sur une tablette). */
@container (max-aspect-ratio: 1/1) {
  #savoir-liste { --c: 2; --reserve: 4.2rem; --hh: 3.6rem; --plafond: 54px; }
  #savoir-jeux .famille-tete { flex-direction: row; flex-wrap: wrap; justify-content: space-between; gap: 2px 6px; }
  #savoir-jeux .famille-nom { text-align: left; }
}
@container (max-aspect-ratio: 1/1) and (min-width: 600px) { #savoir-liste { --c: 3; } }
/* Zone peu haute (format carré, petit téléphone, paysage) : cadres plus serrés, 3 colonnes ; 4 si la zone fait 400 px de large ; 6 à partir de 600. */
@container (max-height: 480px) {
  #savoir-liste { --c: 3; --reserve: 3rem; --hh: 2.6rem; --plafond: 40px; --res: 18px; }
  #savoir-jeux .famille { border-width: var(--contour-fin); border-radius: 12px; padding: 3px 4px; gap: 2px; }
  #savoir-jeux .famille-tete { flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1px 4px; }
  #savoir-jeux .famille-nom { text-align: left; font-size: .66rem; }
  .reglages-joueur #savoir-jeux .btn-tout-famille { min-height: 24px; padding: 0 6px; font-size: .62rem; }
  #savoir-jeux .famille .packs { gap: 2px; }
  .reglages-joueur #savoir-jeux .pack span { font-size: clamp(.58rem, min(calc(var(--ht) * .4), calc((var(--larg) / var(--nc, var(--c)) - var(--gap-col) - var(--res)) / 9.4)), .95rem); gap: .25em; padding: 0 3px; border-radius: 9px; }
}
@container (max-height: 480px) and (min-width: 400px) { #savoir-liste { --c: 4; } }
@container (max-height: 480px) and (min-width: 600px) { #savoir-liste { --c: 6; } }
/* ===== v10.92 : préparation de la partie sur UN seul écran (demande du 02/12/2026, apparence D de outils/propositions-preparation.html) =====
   js/selecteur.js ajoute à chaque case son bouton illustré (img/preparation/) et dore les étoiles du niveau ; les cases rondes
   et leur texte restent dans la page (texte caché à l'œil, lu par les lecteurs d'écran). Tailles : --h-img suit la hauteur ET la largeur
   de la zone (container-type: size de .reglages-joueur) pour que tout tienne sans faire défiler, du téléphone carré à l'ordinateur. */
.reglages-joueur .reglage.choix-matiere.ecran-unique {
  --h-img: clamp(26px, min(calc((100cqh - 7rem) / 6.2), 12.5cqi), 66px);
  --star: clamp(22px, min(calc(var(--h-img) * .8), 8.4cqi), 46px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(3px, 1.4cqh, 10px); min-height: 100%; margin: 0;
}
.reglages-joueur .reglage.choix-matiere.ecran-unique > * { width: 100%; max-width: 760px; }
.ecran-unique #reglage-matiere { order: 1; }
.ecran-unique #sep-precis { order: 2; }
.ecran-unique #reglage-francais, .ecran-unique #reglage-type-maths, .ecran-unique #reglage-mode-savoir { order: 3; }
.ecran-unique #reglage-niveau-prog, .ecran-unique #reglage-niveau-maths, .ecran-unique #reglage-niveau-ortho, .ecran-unique #reglage-niveau-conj,
.ecran-unique #reglage-niveau-gram, .ecran-unique #reglage-niveau-savoir { order: 4; }
.ecran-unique #reglage-nb-signes { order: 5; }
.reglages-joueur .reglage.choix-matiere.ecran-unique .reglage-ligne { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.reglages-joueur .reglage.choix-matiere.ecran-unique .reglage-ligne[hidden], .ecran-unique .sep-precis[hidden] { display: none; }
.reglages-joueur .reglage.choix-matiere.ecran-unique .packs { justify-content: center; gap: calc(var(--h-img) * .16) calc(var(--h-img) * .2); }
.reglages-joueur .reglage.choix-matiere.ecran-unique .reglage-titre {
  position: static; width: auto; height: auto; overflow: visible; clip-path: none; clip: auto; white-space: normal; margin: 0;
  font-family: "Rockwell", "Roboto Slab", Georgia, serif; font-weight: 800; font-size: clamp(.9rem, 2.6cqh, 1.1rem); text-align: center;
}
/* Les titres des exercices sont remplacés par « Et plus précisément : » ; ils restent lus par les lecteurs d'écran. */
.ecran-unique #francais-titre, .ecran-unique #type-maths-titre, .ecran-unique #mode-savoir-titre {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.ecran-unique .sep-precis { margin: 0; text-align: center; font-weight: 600; font-size: clamp(.9rem, 2.6cqh, 1.05rem); color: var(--encre); }
.ecran-unique .reglage-aide { font-size: clamp(.72rem, 2.2cqh, .9rem); }

/* Bouton illustré : l'image remplace le texte de la case ; le choix retenu est cerné de brun, un peu plus grand, avec un ✓. */
.reglages-joueur .reglage .pack.pack-illustre { line-height: 0; }
.reglages-joueur .reglage .pack.pack-illustre > span {
  position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.pack-illustre input, .pack-etoile input { z-index: 2; } /* la case reste au-dessus de l'image : le toucher tombe sur elle */
.pack-img { display: block; height: var(--h-img); width: auto; max-width: 100%; opacity: .9; user-select: none; -webkit-user-drag: none; pointer-events: none;
  transition: opacity .15s, transform .15s, filter .15s; }
.pack-illustre:hover .pack-img { opacity: 1; transform: translateY(-1px); }
.pack-illustre input:checked + .pack-img {
  opacity: 1; transform: scale(1.04);
  filter: drop-shadow(0 0 1px var(--encre)) drop-shadow(0 0 1px var(--encre)) drop-shadow(0 0 3px var(--encre));
}
.pack-illustre:has(input:checked)::after {
  content: "✓"; position: absolute; top: -6px; right: -5px; width: clamp(15px, calc(var(--h-img) * .4), 24px); height: clamp(15px, calc(var(--h-img) * .4), 24px); border-radius: 50%;
  background: var(--encre); color: #fff; display: grid; place-items: center; border: 2px solid #fff; font: 800 clamp(.6rem, calc(var(--h-img) * .22), .85rem)/1 system-ui, sans-serif; pointer-events: none;
}
.pack-illustre input:focus-visible + .pack-img { outline: 3px solid var(--rouge); outline-offset: 3px; border-radius: 14px; }
@media (prefers-reduced-motion: reduce) { .pack-img { transition: none; } }

/* Niveau en étoiles : celles jusqu'au niveau choisi sont dorées, le niveau est écrit dans l'étoile retenue. */
.reglages-joueur .reglage.choix-matiere.ecran-unique .packs.niveaux-prog { flex-wrap: nowrap; justify-content: center; gap: 0; width: 100%; }
.reglages-joueur .reglage .niveaux-prog .pack-etoile > span {
  position: relative; display: grid; place-items: center; min-width: 0; width: calc(var(--star) * 1.04); height: calc(var(--star) * 1.1); min-height: 0;
  padding: 0; border: 0; border-radius: 0; background: none; color: transparent; font-size: 0; overflow: visible;
}
.pack-etoile > span::before {
  content: "★"; position: absolute; inset: 0; display: grid; place-items: center; font: 400 var(--star)/1 system-ui, "Segoe UI Symbol", sans-serif;
  color: #e6dcc4; -webkit-text-stroke: 1px #b9a97f; transition: color .15s, transform .15s;
}
.pack-etoile.doree > span::before { color: #f5b400; -webkit-text-stroke: 1.2px #8a5a00; }
.pack-etoile:hover > span::before { transform: scale(1.1); }
.pack-etoile input:checked + span::before { transform: scale(1.2); }
.pack-etoile input:checked + span::after {
  content: attr(data-n); position: absolute; inset: 0; display: grid; place-items: center; font: 800 calc(var(--star) * .36)/1 system-ui, sans-serif; color: var(--encre);
  margin: 0; padding-top: 2px;
}
.pack-etoile input:focus-visible + span { outline: 3px solid var(--rouge); outline-offset: 1px; border-radius: 8px; }

/* « Je suis ma progression » : les matières en boutons illustrés, comme l'écran de la partie personnalisée. */
.reglages-joueur .reglage.choix-suivre { --h-img: clamp(30px, min(calc((100cqh - 6rem) / 3.6), 12cqi), 74px); }
.reglages-joueur .choix-suivre .packs { gap: calc(var(--h-img) * .2) calc(var(--h-img) * .25); }


/* v10.21 : sur téléphone (zone de jeu sur une colonne), le drapeau d'une question suit la hauteur de la zone de jeu
   (.table est un conteneur, cqh) : la carte tient mieux sous le plateau, la correction n'est plus coupée en bas. */
@media (max-width: 899px) {
  .table .drapeau.grand { height: clamp(36px, 9cqh, 72px); width: auto; aspect-ratio: 4 / 3; }
}

/* ---------- Mon compte › Mes joueurs (v10.26, demande du 23/11/2026, backlog lignes 438 à 449) ----------
   Proposition A : une colonne de cartes, jauges en barre coupée en 10 (un trait tous les 10 points). */
.joueurs-section { max-width: 560px; width: 100%; margin: 0 auto; display: grid; gap: 10px; }
.joueurs-entete { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.joueurs-entete h3 { margin: 0; font-size: 1.15rem; color: #fff; }
.joueurs-entete .petit { margin: 0; color: #e9f3e6; font-size: .92rem; }
.joueurs-liste { display: grid; gap: 10px; }
.joueur-carte { display: grid; gap: 10px; min-width: 0; }
.joueur-tete { display: flex; align-items: center; gap: 10px; }
.joueur-avatar { width: 56px; height: 56px; border-radius: 50%; border: var(--contour) solid var(--encre); background: #fff; object-fit: cover; object-position: top; flex: none; }
.joueur-qui { flex: 1; min-width: 0; }
.joueur-nom { margin: 0; font-size: 1.1rem; font-weight: 800; overflow-wrap: anywhere; }
.joueur-qui .petit { margin: 0; }
.joueur-niv { background: var(--encre); color: #fff; border-radius: 10px; padding: 2px 10px; font-weight: 800; font-size: .88rem; white-space: nowrap; }
.joueur-jauges { display: grid; gap: 6px; }
.jm { --col: var(--encre); display: grid; grid-template-columns: 5.6rem minmax(0, 1fr) 6.2rem; align-items: center; gap: 6px 10px; font-size: .92rem; }
.jm-nom { font-weight: 700; }
.jm-val { font-variant-numeric: tabular-nums; font-weight: 800; white-space: nowrap; text-align: right; }
.jm-barre { position: relative; height: 14px; background: #e5dcc3; border: 1px solid var(--parchemin-bord); border-radius: 8px; overflow: hidden; }
.jm-barre i { display: block; height: 100%; background: var(--col); }
.jm-barre::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(59, 42, 30, .3) calc(10% - 1px) 10%); }
.m-francais { --col: #c4452b; }
.m-maths { --col: #2e55c9; }
.m-histoire { --col: #9a6a14; }
.m-geographie { --col: #1f7a3a; }
.joueur-form { display: grid; gap: 8px; }
.joueur-form input[type="text"] { font: inherit; padding: 8px 10px; border: var(--contour) solid var(--parchemin-bord); border-radius: 10px; background: #fff; color: var(--encre); min-height: 44px; }
.joueur-form input[aria-invalid="true"] { border-color: var(--rouge-texte); }
.perso-choix { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; }
.perso-bouton { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px; min-height: 44px; border: var(--contour) solid var(--parchemin-bord); border-radius: 12px; background: #fff; color: var(--encre); font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer; }
.perso-bouton img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; object-position: top; }
.perso-bouton[aria-pressed="true"] { border-color: var(--encre); background: var(--encre); color: #fff; }
.joueur-ajout { border: var(--contour) dashed var(--parchemin-bord); border-radius: 16px; background: rgba(246, 238, 219, .9); color: var(--encre-douce); font: inherit; font-weight: 800; min-height: 64px; padding: 12px; cursor: pointer; }
.joueur-ajout:hover { background: var(--parchemin); }
@media (max-width: 380px) { .jm { grid-template-columns: 4.6rem minmax(0, 1fr) 5.6rem; } }

/* ---------- Préparation › Qui joue ? (v10.29, js/choix-joueurs.js) ---------- */
.choix-joueurs { width: min(100%, 520px); margin: 0 auto; text-align: left; }
.cj-places { display: flex; flex-direction: column; gap: 10px; }
.cj-ligne {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 8px 10px; border-radius: 14px; background: #fff; color: var(--encre);
  border: var(--contour) solid var(--c, var(--encre));
}
.cj-ligne.vide { border-style: dashed; }
.cj-avatar { width: 58px; height: 58px; flex: none; object-fit: contain; border-radius: 10px; }
.cj-qui { flex: 1 1 0; min-width: 0; }
.cj-etiq { font-size: .8rem; font-weight: 700; }
.cj-nom { font-size: 1.15rem; font-weight: 800; overflow-wrap: anywhere; }
.cj-niv { font-size: .8rem; overflow-wrap: anywhere; }
.cj-btn { flex: none; min-height: 44px; padding: 6px 12px; }
.cj-ajouter { margin-top: 10px; width: 100%; min-height: 48px; }
.cj-choix { margin-top: 10px; padding: 10px; border-radius: 14px; background: #fff; color: var(--encre); border: var(--contour-fin) solid var(--encre); }
.cj-titre { margin: 0 0 8px; font-weight: 700; }
.cj-profils { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.cj-profil {
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; min-height: 44px;
  padding: 6px; border-radius: 12px; border: var(--contour-fin) solid var(--encre); background: #fff7e0; color: var(--encre); font: inherit; cursor: pointer;
}
.cj-profil[aria-pressed="true"] { background: var(--encre); color: #fff; }
.cj-profil[disabled] { opacity: .5; cursor: not-allowed; }
.cj-profil img { width: 52px; height: 52px; object-fit: contain; }
.cj-pnom { font-weight: 800; overflow-wrap: anywhere; }
.cj-profil small { font-size: .72rem; }
.fenetre-joueurs { max-width: min(94vw, 560px); }
/* v11.13 : même écart entre la dernière bulle joueur et « C’est parti » qu'entre « C’est parti » et « Annuler »
   (= l'écart de .menu-actions : 10 px, 6 px sur écran peu haut). */
.fenetre-joueurs .choix-joueurs { margin-bottom: 10px; }
@media (max-height: 520px) { .fenetre-joueurs .choix-joueurs { margin-bottom: 6px; } }
/* Écrans peu hauts (téléphone en paysage, format carré) : lignes serrées pour que 4 joueurs tiennent. */
@media (max-height: 640px) {
  .cj-places { gap: 4px; }
  .cj-ligne { padding: 3px 8px; gap: 8px; border-width: var(--contour-fin); }
  .cj-avatar { width: 40px; height: 40px; }
  .cj-etiq, .cj-niv { font-size: .7rem; line-height: 1.15; }
  .cj-nom { font-size: 1rem; line-height: 1.1; }
  .cj-btn { min-height: 36px; padding: 2px 10px; }
  .cj-ajouter { min-height: 40px; margin-top: 4px; }
}

/* v10.45 : la poubelle (retire le joueur de la partie) est tout à droite de la ligne : à côté du nom sur écran étroit
   (les boutons de préparation passent dessous), après les boutons de préparation sur écran large. */
.cj-retirer { margin-left: auto; align-self: center; }
@media (min-width: 760px) { .cj-retirer { order: 5; } }

/* v10.36 (demande du 24/11/2026) : à côté de chaque joueur, « Suivre ma progression » et « Personnaliser », et ce qui est prêt.
   Écran étroit : les 2 boutons sont sous le nom, sur toute la largeur (aucun débordement) ; écran large : sur la même ligne. */
.cj-ligne { flex-wrap: wrap; }
.cj-parcours { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; }
.cj-parcours-btn { flex: 1 1 8.5rem; min-width: 0; font-size: .95rem; line-height: 1.15; }
.cj-resume { flex: 1 1 100%; margin: 0; font-size: .8rem; font-weight: 700; color: var(--encre-douce); overflow-wrap: anywhere; }
.cj-resume.pret { color: #1f6a34; }
@media (min-width: 760px) {
  .choix-joueurs { width: min(100%, 860px); }
  .cj-parcours { flex: 0 1 auto; flex-wrap: nowrap; }
  .cj-parcours-btn { flex: 0 1 auto; white-space: nowrap; }
  .cj-resume { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); } /* l'état reste dit aux lecteurs d'écran */
  .cj-ligne:has(.cj-resume.pret) .cj-niv::after { content: " · ✓ prêt"; color: #1f6a34; font-weight: 700; }
}
@media (max-height: 640px) {
  .cj-parcours { gap: 3px 6px; }
  .cj-parcours-btn { font-size: .85rem; min-height: 34px; padding: 1px 6px; }
  .cj-resume { font-size: .7rem; line-height: 1.1; }
}
/* 3 ou 4 joueurs sur écran étroit : chaque ligne se compacte (plus de ligne « pion » ni de niveaux ; « ✓ prêt » après le nom) pour tout garder sans défiler. */
@media (max-width: 759px) {
  .cj-places:has(.cj-ligne:nth-child(3)) .cj-etiq,
  .cj-places:has(.cj-ligne:nth-child(3)) .cj-niv { display: none; }
  .cj-places:has(.cj-ligne:nth-child(3)) .cj-resume { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .cj-places:has(.cj-ligne:nth-child(3)) .cj-ligne:has(.cj-resume.pret) .cj-nom::after { content: " ✓ prêt"; color: #1f6a34; font-size: .8rem; font-weight: 700; }
  .cj-places:has(.cj-ligne:nth-child(3)) .cj-ligne:has(.cj-resume.pret) .cj-nom[data-matiere]::after { content: " ✓ " attr(data-matiere); } /* v10.45 : la matière à la place des niveaux */
  .cj-places:has(.cj-ligne:nth-child(3)) .cj-ligne { padding-block: 6px; gap: 4px 8px; }
  .cj-places:has(.cj-ligne:nth-child(3)) .cj-parcours-btn { flex: 1 1 0; font-size: .82rem; line-height: 1.05; min-height: 34px; padding: 1px 4px; }
  .cj-places:has(.cj-ligne:nth-child(3)) ~ .etape-actions .prepa-aide { font-size: .8rem; }
}
.etape-actions-joueurs { align-items: center; }
.prepa-aide { flex: 1 1 14rem; margin: 0; font-size: .9rem; color: var(--encre-douce); font-weight: 600; text-align: left; }
.prepa-aide[hidden], #btn-valider-joueurs[hidden] { display: none; }
/* « Suivre ma progression » : les 4 matières avec le niveau déjà atteint (étape 2, v10.36). */
.reglages-joueur .reglage.choix-suivre { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-height: 100%; margin: 0; }
.choix-suivre[hidden] { display: none; }
.choix-suivre .packs { justify-content: center; }
.reglages-joueur .choix-suivre .pack-suivre span { flex-direction: column; justify-content: center; gap: 2px; min-width: 9.5rem; min-height: 64px; padding: 6px 18px; border-radius: 18px; font-size: 1.15rem; text-align: center; }
.pack-suivre small { font-size: .78rem; font-weight: 600; opacity: .85; }
@container (max-height: 420px) {
  .reglages-joueur .reglage.choix-suivre { gap: 6px; }
  .reglages-joueur .choix-suivre .pack-suivre span { min-height: 48px; min-width: 8rem; padding: 2px 12px; font-size: 1rem; }
  .choix-suivre .reglage-aide { font-size: .8rem; }
}
/* « Personnaliser » : niveaux 1 à 10 en pastilles rondes. */
.niveaux-prog .pack span { min-width: 44px; justify-content: center; padding: 4px 8px; }
@container (max-height: 420px) { #niveau-prog-titre { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } }

/* v10.28 : réussite de chaque joueur sur l'écran de fin (backlog ligne 446) */
.fin-joueurs { margin: .5rem 0 0; }
.fin-joueurs-titre { margin: 0 0 .35rem; font-weight: 700; }
.fin-joueurs-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.fin-joueurs-liste li { display: flex; align-items: center; gap: .5rem; padding: .3rem .6rem; border-radius: .6rem; background: #f3ece2; }
.fin-joueurs-liste .fj-nom { font-weight: 700; flex: 1 1 auto; text-align: left; }
.fin-joueurs-liste .fj-pts { font-variant-numeric: tabular-nums; }
.fin-joueurs-liste li.reussi { background: #e3f3e0; }
.fin-joueurs-liste li.manque { background: #f7ece3; }

/* v10.30 (backlog lignes 447, 453, 454) : trésor de chaque joueur dans sa carte (Mon compte), en-tête des écrans
   « Mes étoiles » / « Ma progression », gains de chacun en fin de partie, note du coffre à ouvrir. */
.joueur-tresor { display: grid; gap: 8px; padding: 8px 10px; border-radius: 12px; background: #fff7e0; border: var(--contour-fin) solid var(--parchemin-bord); }
.jt-ligne { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-weight: 700; }
.jt-ligne > span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.jt-ligne .ico { width: 22px; height: 22px; }
.jt-ligne strong { font: 800 1.15rem/1 "Rockwell", "Roboto Slab", Georgia, serif; }
.jt-gemmes { color: #12687b; }
.jt-niveau { background: #f2b705; color: var(--encre); border-radius: 99px; padding: 1px 10px; font-size: .88rem; }
.joueur-tresor .compte-boutons { margin: 0; }
.jt-coffres .ico { width: 26px; height: 26px; }
.tresor-de { margin: 0 auto; max-width: 560px; width: 100%; display: flex; align-items: center; gap: 8px; color: #fff; font-size: 1.05rem; }
.tresor-de img { width: 40px; height: 40px; border-radius: 50%; border: var(--contour-fin) solid #fff; background: #fff; object-fit: cover; object-position: top; }
.fin-gains-joueurs { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; gap: .3rem; }
.fin-gains-joueurs li { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .7rem; padding: .3rem .6rem; border-radius: .6rem; background: #f3ece2; }
.fin-gains-joueurs .fg-nom { font-weight: 700; flex: 1 1 auto; text-align: left; min-width: 0; overflow-wrap: anywhere; }
.fin-gains-joueurs span { display: inline-flex; align-items: center; gap: 3px; font-weight: 800; }
.fin-gains-joueurs .ico { width: 18px; height: 18px; }
.fin-gains-joueurs .fg-gemmes { color: #12687b; }
.fin-coffre-note { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 6px 0 0; font-weight: 700; }
.fin-coffre-note .ico { width: 28px; height: 28px; flex: none; }
/* v10.91 (demande du 02/12/2026) : un coffre qui remue dans l'angle bas droit de « Mon compte » quand un coffre attend d'être ouvert
   (classe posée par js/recompenses.js → majAccueil ; l'angle haut droit porte déjà le point vert « connecté »). Sans coffre : rien. */
.compte-coffre {
  position: absolute; right: -10px; bottom: -10px; width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: 50%; background: var(--parchemin); border: var(--contour-fin) solid var(--encre); box-shadow: 0 2px 0 rgb(0 0 0 / .3); pointer-events: none;
}
.compte-coffre[hidden] { display: none; }
.pastille .compte-coffre .ico { width: 20px; height: 20px; animation: coffre-appel 1.6s ease-in-out infinite; transform-origin: 50% 90%; }
@media (prefers-reduced-motion: reduce) { .pastille .compte-coffre .ico { animation: none; } }
/* v10.91 : sur téléphone, le bonhomme de « Mon compte » n'était pas au centre de la pastille (6 px de marge à droite seulement). */
@media (max-width: 520px) { .pastille.pastille-compte { padding: 0; } }
.pastille-compte.recoit { animation: compte-recoit .3s ease-out; }
@keyframes compte-recoit { 50% { transform: scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .pastille-compte.recoit { animation: none; } }

/* ---------- Mon compte en 4 onglets (v10.32, demande du 23/11/2026, backlog lignes 459 à 466) ---------- */
/* Onglets « icône + texte » (proposition A de la page de test). */
.btn-danger { background: var(--rouge-texte); color: #fff; box-shadow: 0 var(--ombre) 0 var(--encre); }
.btn-danger:hover { filter: brightness(1.08); }
.compte-onglets { display: flex; gap: 4px; max-width: 560px; width: 100%; margin-inline: auto; }
.compte-onglets button {
  flex: 1 1 0; min-width: 0; min-height: 56px; padding: 4px 2px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font: inherit; font-weight: 800; font-size: .8rem; line-height: 1.1; cursor: pointer; color: #fff;
  background: rgb(0 0 0 / .22); border: var(--contour) solid transparent; border-radius: 12px; overflow-wrap: anywhere; /* assombri : texte blanc lisible (contraste AA) */
}
.compte-onglets button svg { width: 22px; height: 22px; flex: none; }
.compte-onglets button[aria-selected="true"] { background: var(--parchemin); color: var(--encre); border-color: var(--encre); }
.compte-panneau { display: grid; gap: 12px; min-width: 0; }
.compte-panneau[hidden] { display: none; }
.panneau-titre { color: #fff; font-size: 1.15rem; max-width: 560px; width: 100%; margin-inline: auto; }
.rgpd-liste { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; }
.rgpd-danger { border-color: var(--rouge-texte); }
.rgpd-danger h3 { color: var(--rouge-texte); }
.aide-liens { display: grid; gap: 10px; }
.aide-lien { display: flex; align-items: center; justify-content: center; text-align: center; text-decoration: none; min-height: 48px; padding: 8px 14px; }
.confirmer h2 { color: var(--rouge-texte); font-size: 1.4rem; overflow-wrap: anywhere; }
.confirmer p { margin: 0; line-height: 1.4; }

/* Carte d'un joueur, fermée : visage, nom + crayon, niveau ; en bas « Statistiques » à gauche et la poubelle à droite. */
.joueur-nomligne { display: flex; align-items: center; gap: 6px; min-width: 0; }
.icone-btn {
  position: relative; flex: none; width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  background: #fff; color: var(--encre); border: var(--contour-fin) solid var(--parchemin-bord); border-radius: 50%; cursor: pointer;
}
.icone-btn svg { width: 60%; height: 60%; }
.icone-btn::after { content: ""; position: absolute; inset: -6px; } /* zone de toucher de 44 px, icône de 32 px */
.icone-btn:hover { background: var(--parchemin); }
.icone-btn.suppr { color: var(--rouge-texte); }
.joueur-pied { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stats-btn {
  font: inherit; font-weight: 800; font-size: .9rem; color: var(--encre); display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 14px; background: #fff; border: var(--contour-fin) solid var(--encre); border-radius: 999px; cursor: pointer;
}
.stats-btn svg { width: 18px; height: 18px; transition: transform .2s; }
.stats-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.joueur-stats { border-top: var(--contour-fin) dashed var(--parchemin-bord); padding-top: 10px; display: grid; gap: 10px; }
.joueur-stats[hidden] { display: none; }
.jm-bloc { display: grid; gap: 2px; }
.jm-detail { margin: 0; font-size: .85rem; color: var(--encre-douce); }
.js-resume { display: flex; flex-wrap: wrap; gap: 6px 14px; font-weight: 700; align-items: center; }
.js-resume .btn { min-height: 44px; padding: 6px 14px; }
/* v10.36 : « Mes coffres » = un coffre sans texte (zone de toucher 48 px) ; « ? » = petit rond rouge (zone de toucher 44 px, rond visible 24 px). */
.js-resume .btn-icone { min-width: 48px; min-height: 48px; padding: 4px; margin-left: auto; display: inline-grid; place-items: center; }
.js-resume .btn-icone .ico { width: 34px; height: 34px; }
.jt-etoiles { display: inline-flex; align-items: center; gap: 4px; }
.aide-etoiles {
  position: relative; display: inline-grid; place-items: center; width: 24px; height: 24px; padding: 0; margin-left: 2px; cursor: pointer;
  border-radius: 50%; border: 0; background: var(--rouge); color: #fff; font-family: inherit; font-weight: 800; font-size: .9rem; line-height: 1;
}
.aide-etoiles::after { content: ""; position: absolute; inset: -10px; } /* zone de toucher de 44 px */
.aide-etoiles:focus-visible { outline: 3px solid var(--encre); outline-offset: 2px; }
.joueur-coffres { margin: 0; }
.joueur-coffres .btn { width: 100%; min-height: 48px; padding: 8px 14px; }
.joueurs-annonce { margin: 0; color: #fff; font-weight: 700; }
.joueur-retour { justify-self: start; background: none; border: 0; color: var(--encre); font: inherit; font-weight: 800; min-height: 44px; padding: 0; cursor: pointer; text-decoration: underline; }

/* ---------- Accueil : bouton « Défi du jour » (v10.36) et fenêtre de choix des profils (js/defi-jour.js) ---------- */
.btn-defi { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; line-height: 1.1; }
.btn-defi .bd-ligne { display: inline-flex; align-items: center; gap: 6px; }
.btn-defi .ico { width: 1.5em; height: 1.5em; flex: none; }
.btn-defi .bd-sous { display: inline-flex; align-items: center; gap: 4px; font-size: .72em; font-weight: 800; letter-spacing: 0; }
.btn-defi .bd-sous .ico { width: 1.2em; height: 1.2em; }
.fenetre-defi h2 { display: flex; align-items: center; justify-content: center; gap: 8px; }
.fenetre-defi h2 .ico { width: 36px; height: 36px; }
.dj-etat { margin: 0 0 8px; font-weight: 800; color: var(--rouge-texte); }
.dj-liste { display: flex; flex-direction: column; gap: 7px; text-align: left; }
.dj-ligne {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 60px; padding: 5px 10px; cursor: pointer;
  font: inherit; color: var(--encre); background: #fff; border: var(--contour) solid var(--parchemin-bord); border-radius: 12px;
}
.dj-ligne[aria-pressed="true"] { border-color: var(--encre); box-shadow: inset 0 0 0 3px var(--c, var(--rouge)); }
.dj-ligne[disabled] { opacity: .5; cursor: not-allowed; }
.dj-avatar { width: 46px; height: 50px; flex: none; object-fit: contain; }
.dj-qui { flex: 1 1 0; min-width: 0; }
.dj-nom { display: block; font-weight: 800; overflow-wrap: anywhere; }
.dj-jour { display: block; font-size: .75rem; color: var(--encre-douce); }
.dj-coche { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border: var(--contour) solid var(--encre); border-radius: 8px; background: #fff; color: #fff; font-weight: 800; }
.dj-ligne[aria-pressed="true"] .dj-coche { background: var(--c, var(--rouge)); }
/* v10.44 : « Étoiles ×3 » en gros, de travers (−9°), jaune du jeu à contour brun, tout en haut de la fenêtre. */
.fenetre-defi { overflow-x: hidden; }
.dj-gain {
  display: flex; align-items: center; justify-content: center; gap: .15em; margin: 4px 0 14px; line-height: 1; white-space: nowrap;
  font: 900 clamp(24px, 9vw, 40px) Rockwell, "Roboto Slab", Georgia, serif; text-transform: uppercase; color: var(--jaune);
  transform: rotate(-9deg);
  text-shadow: -2px -2px 0 var(--encre), 2px -2px 0 var(--encre), -2px 2px 0 var(--encre), 2px 2px 0 var(--encre), 0 var(--ombre) 0 var(--encre), 0 var(--ombre) 0 var(--encre), 0 5px 0 var(--encre);
}
.dj-gain .ico { width: .9em; height: .9em; flex: none; }
@media (max-height: 640px) {
  .dj-liste { gap: 4px; }
  .dj-ligne { min-height: 46px; padding: 2px 8px; border-width: var(--contour-fin); }
  .dj-avatar { width: 34px; height: 38px; }
  .fenetre-defi h2 .ico { width: 28px; height: 28px; }
  .dj-gain { font-size: 26px; margin: 0 0 8px; }
}

/* Accueil sur écran large et peu haut (téléphone en paysage) : cinq boutons compacts, plus larges, pour tenir dans l'écran (v10.36). */
@media (max-height: 480px) and (min-aspect-ratio: 3/2) {
  .accueil-actions { width: 62%; right: 2%; bottom: max(3%, calc(56px + env(safe-area-inset-bottom))); gap: 5px; }
  .accueil-actions .btn { min-height: 38px; padding: 3px 8px; font-size: .9rem; border-width: var(--contour-fin); box-shadow: 0 var(--ombre) 0 var(--encre); }
  .accueil-actions .btn-defi { flex-direction: row; gap: 8px; }
  .accueil-actions .btn-defi .ico { width: 1.3em; height: 1.3em; }
}

/* ---------- Mini-jeux de multiplication (v10.44, js/mj-etoiles.js et js/mj-aventure.js) ----------
   Charte Aventura : cartes parchemin, contours bruns de 3 px, ombre dure sous les boutons, titres Rockwell, boutons rouges. */
.mj-jeu { display: grid; gap: 10px; text-align: left; }
.mj-jeu h3 { font-size: 1.2rem; margin: 0; }
.mj-regle { margin: 0; font-size: .98rem; }
.mj-puces { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.mj-puce { min-height: 48px; font: 800 1.25rem/1 "Rockwell", "Roboto Slab", Georgia, serif; background: #fff; color: var(--encre); cursor: pointer;
  border: var(--contour) solid var(--encre); border-radius: 12px; box-shadow: 0 var(--ombre) 0 var(--encre); }
.mj-puce[aria-pressed="true"] { background: var(--encre); color: #fff; }
.mj-puce:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--encre); }
.mj-lien { justify-self: start; background: none; border: 0; padding: 6px 2px; font: inherit; font-weight: 700; color: var(--encre-douce); text-decoration: underline; cursor: pointer; min-height: 36px; }
.mj-jeu .btn { justify-self: center; }
.mj-hud { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; font-weight: 700; }
.mj-hud p { margin: 0; }
.mj-coeurs { color: var(--rouge); letter-spacing: 2px; font-size: 1.25rem; }
.mj-coeurs .perdu { color: rgb(59 42 30 / .25); }
/* Course aux étoiles */
.mj-etoiles-liste { list-style: none; display: flex; justify-content: center; gap: 14px; margin: 0; padding: 0; }
.mj-etoile { display: grid; justify-items: center; font-weight: 800; font-size: .85rem; }
.mj-etoile svg { width: 40px; height: 40px; }
.mj-barre { height: 12px; border: var(--contour-fin) solid var(--encre); border-radius: 99px; background: #fff; overflow: hidden; }
.mj-barre span { display: block; height: 100%; width: 0; background: var(--jaune); transition: width .3s; }
.mj-question { display: grid; grid-template-columns: 1fr auto 1.2fr; align-items: center; gap: 10px; }
.mj-calcul { margin: 0; text-align: right; white-space: nowrap; font: 800 clamp(1.6rem, 7vw, 2.2rem)/1 "Rockwell", "Roboto Slab", Georgia, serif; }
.mj-egal { font: 800 2rem/1 "Rockwell", "Roboto Slab", Georgia, serif; }
.mj-reponses { display: grid; gap: 8px; }
.mj-reponse { min-height: 52px; font: 800 1.35rem/1 "Rockwell", "Roboto Slab", Georgia, serif; background: #fff; color: var(--encre); cursor: pointer;
  border: var(--contour) solid var(--encre); border-radius: 12px; box-shadow: 0 var(--ombre) 0 var(--encre); }
.mj-reponse:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--encre); }
.mj-reponse.bonne { background: #1f7a3a; color: #fff; }
.mj-reponse.bonne::before { content: "✔ "; }
.mj-reponse.mauvaise { color: var(--rouge-texte); text-decoration: line-through; }
.mj-retour { margin: 0; min-height: 1.5em; text-align: center; font-weight: 700; }
/* Aventure des multiplications */
.mj-canvas { display: block; width: 100%; aspect-ratio: 5 / 3; height: auto; border: var(--contour) solid var(--encre); border-radius: 14px; background: #8fc8ea; touch-action: none; }
.mj-cible { margin: 0; text-align: center; font-weight: 700; }
.mj-cible strong { display: inline-block; min-width: 2.2em; padding: 0 12px; text-align: center; background: #fff; border: var(--contour) solid var(--encre); border-radius: 12px; font: 800 1.4rem/1.4 "Rockwell", "Roboto Slab", Georgia, serif; }
.mj-manette { display: flex; justify-content: space-between; gap: 10px; }
.mj-manette-dir { display: flex; gap: 10px; }
.mj-manette .btn { touch-action: none; user-select: none; -webkit-user-select: none; min-width: 64px; }
.mj-manette .btn.appuye { transform: translateY(1px); box-shadow: 0 1px 0 var(--encre); }
.mj-clavier { text-align: center; }
@media (pointer: coarse) { .mj-clavier { display: none; } }
@media (max-height: 560px) { .mj-jeu .btn { min-height: 44px; padding-block: 6px; } .mj-reponse { min-height: 44px; } .mj-puce { min-height: 40px; } }
@media (prefers-reduced-motion: reduce) { .mj-barre span { transition: none; } .mj-puce:active, .mj-reponse:active, .mj-manette .btn.appuye { transform: none; } }

/* ---------- Évaluation d'une matière (v10.49, js/plateau.js → lancerEvaluation, js/evaluation.js) ----------
   Sans plateau : la question occupe l'écran, avec en haut la matière, le numéro de la question et 10 pastilles. */
.jm-pied { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.btn-evaluer { min-height: 44px; padding: 4px 14px; font-size: .9rem; }
.eval-entete { display: grid; gap: 4px; justify-items: center; text-align: center; margin: 0 0 8px; }
.eval-entete[hidden] { display: none; }
.eval-titre { margin: 0; font-weight: 800; font-size: 1.05rem; }
.eval-compte { margin: 0; font-weight: 700; color: var(--encre-douce); }
.eval-pastilles { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; max-width: 100%; }
.eval-pastilles i.debut-serie { margin-left: 8px; } /* v11.15 : un petit écart entre les séries de 5 questions */
.eval-pastilles i { width: 14px; height: 14px; border-radius: 50%; border: var(--contour-fin) solid var(--encre); background: #fff; }
.eval-pastilles i.fait { background: var(--encre); }
.eval-pastilles i.en-cours { background: #f4c542; }
.eval-quitter { min-height: 40px; padding: 2px 12px; font-size: .85rem; }
.mode-eval .plateau { display: none; }
.mode-eval .tour-joueur { display: none; }
.mode-eval .table { grid-template-columns: 1fr; justify-items: center; }
.mode-eval .panneau { width: min(100%, 720px); }
.eval-fin { max-height: calc(100dvh - 24px); overflow: auto; }
.eval-liste { list-style: none; margin: 10px 0 14px; padding: 0; display: grid; gap: 8px; text-align: left; }
.eval-liste li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 10px; background: #fff; border: var(--contour-fin) solid var(--parchemin-bord); border-radius: 10px; }
.eval-liste li.monte strong { color: #1f7a3a; }
.eval-liste li.serie { background: transparent; border: 0; padding: 4px 2px 0; font-weight: 800; }
.eval-liste li.demande { display: block; }
.eval-liste fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 4px; }
.eval-liste legend { font-weight: 800; padding: 0; margin-bottom: 4px; }
.eval-liste label { display: flex; align-items: center; gap: 8px; min-height: 40px; font-weight: 700; cursor: pointer; }
/* « Évaluer » reste sur la ligne du détail de SA matière (pas en dessous), et chaque matière est séparée de la suivante. */
.jm-pied { flex-wrap: nowrap; }
.jm-pied .jm-detail { flex: 1 1 auto; min-width: 0; }
.jm-pied .btn-evaluer { flex: none; }
.joueur-jauges .jm-bloc { padding-bottom: 8px; border-bottom: 1px dashed var(--parchemin-bord); }
.joueur-jauges .jm-bloc:last-child { border-bottom: 0; padding-bottom: 0; }
.mode-eval #tour-titre { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Mini-jeu « Quiz » (v10.51, js/mj-quiz.js) ---------- */
.quiz { display: grid; gap: 12px; width: 100%; }
.quiz-niveaux { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.quiz-info { margin: 0; color: var(--encre-douce); font-weight: 700; }
.quiz-entete { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-weight: 800; }
.quiz-chrono { font-variant-numeric: tabular-nums; font-size: 1.3rem; }
.quiz-barre { height: 12px; border: var(--contour-fin) solid var(--encre); border-radius: 99px; background: #fff; overflow: hidden; }
.quiz-barre i { display: block; height: 100%; width: 100%; background: var(--bleu); }
.quiz-barre i.urgent { background: var(--rouge-texte); }
/* Les pages : la nouvelle question est dessous, l'ancienne se tourne autour de son bord gauche (comme une page de livre) puis disparaît. */
.quiz-pages { position: relative; perspective: 1400px; }
.quiz-page { display: grid; gap: 10px; padding: 12px; background: var(--parchemin); border: var(--contour) solid var(--encre); border-radius: 14px; box-shadow: 0 var(--ombre) 0 var(--encre); backface-visibility: hidden; }
.quiz-page.sortante { position: absolute; inset: 0; z-index: 2; transform-origin: left center; animation: quiz-tourne 700ms ease-in forwards; pointer-events: none; }
@keyframes quiz-tourne { from { transform: rotateY(0); filter: brightness(1); } to { transform: rotateY(90deg); filter: brightness(.75); } }
.quiz-question { margin: 0; font-size: 1.15rem; line-height: 1.25; }
.quiz-sujet:empty { display: none; }
.quiz-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.quiz-options.longues { grid-template-columns: 1fr; }
/* Réponses : bonne = vert ; fausse touchée = rouge (plus de texte barré) ; le signe ✓ / ✗ évite de ne compter que sur la couleur. */
.quiz-page .btn-option.bonne { background: #1f7a3a; border-color: #14501f; color: #fff; opacity: 1; }
.quiz-page .btn-option.fausse { background: #c62828; border-color: #7f1818; color: #fff; text-decoration: none; opacity: 1; }
.quiz-page .btn-option.bonne::before { content: '✓ '; }
.quiz-page .btn-option.fausse::before { content: '✗ '; }
.quiz-annonce { margin: 0; min-height: 1.4em; font-weight: 700; }
.quiz-attente { margin: 0; font-weight: 700; }
.quiz-contexte { color: var(--encre-douce); font-size: .95rem; }
.quiz-score { font-size: 1.5rem; }
.quiz-felicitations { color: #1f5a2f; }
@media (max-width: 420px) { .quiz-options:not(.longues) { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .quiz-page.sortante { animation: none; } }
/* Écrans bas (téléphone carré ou en paysage) : le quiz resserre ses marges et sa carte pour que les 4 réponses restent visibles pendant le chronomètre. */
@media (max-height: 600px) {
  .quiz { gap: 6px; }
  .quiz-page { padding: 8px; gap: 6px; }
  .quiz-question { font-size: 1rem; }
  .quiz-sujet .carte-geo svg { max-height: 24vh; }
  .quiz-sujet .carte-geo .carte-zoom .btn-zoom { width: 30px; height: 30px; font-size: 1rem; }
  .quiz-sujet .indices li { padding: 1px 6px; font-size: .85rem; }
  .quiz-annonce { min-height: 1.2em; font-size: .9rem; }
  #minijeu-corps .quiz .minijeu-qui, .carte-page.minijeu:has(.quiz) .minijeu-qui { display: none; }
}

/* ---------- Mini-jeu « Chasse aux lettres » (v10.54, js/mj-reperes.js) ---------- */
/* Polices hébergées sur le site (fonts/LISEZMOI.txt) : lettres d'imprimerie (Andika) et cursive à boucles (Playwrite FR Trad). */
@font-face { font-family: "Ludo Imprimerie"; src: url("../fonts/lettres-imprimerie.woff") format("woff"); font-display: swap; }
@font-face { font-family: "Ludo Cursive"; src: url("../fonts/lettres-cursive.woff") format("woff"); font-display: swap; }
.rep { container-type: inline-size; width: 100%; text-align: center; }
.rep-police-imp { font-family: "Ludo Imprimerie", Verdana, Arial, sans-serif; }
.rep-police-cur { font-family: "Ludo Cursive", "Playwrite FR Trad", cursive; }
/* Préparation */
.rep-prep { display: grid; gap: clamp(6px, 1.8cqw, 12px); }
.rep-record { margin: 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; background: #fff; border: var(--contour-fin) solid var(--encre); border-radius: 10px; font-weight: 800; font-size: clamp(.85rem, 3.4cqw, 1rem); }
.rep-corps, .rep-col-lettres, .rep-col-options { display: grid; gap: clamp(6px, 1.8cqw, 12px); min-width: 0; }
.rep-q { margin: 0; font-weight: 800; font-size: clamp(.95rem, 3.8cqw, 1.1rem); }
.rep-touches { display: grid; grid-template-columns: repeat(7, 1fr); gap: clamp(3px, 1.2cqw, 8px); }
.rep-touche { display: grid; place-items: center; min-height: clamp(40px, 10cqw, 52px); padding: 0; line-height: 1; font-size: clamp(1rem, 4.6cqw, 1.4rem); color: var(--encre); background: #fff;
  border: var(--contour-fin) solid var(--encre); border-radius: 10px; box-shadow: 0 var(--ombre) 0 var(--encre); cursor: pointer; }
.rep-touche[aria-pressed="true"] { background: var(--encre); color: #fff; transform: translateY(1px); box-shadow: 0 1px 0 var(--encre); }
.rep-touche.rep-hasard { grid-column: 1 / -1; font: 800 clamp(.9rem, 3.6cqw, 1.1rem) system-ui, sans-serif; border-radius: 12px; }
.rep-seg { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.rep-seg button { min-height: 44px; padding: 4px 12px; font: 800 clamp(.85rem, 3.4cqw, 1rem) system-ui, sans-serif; color: var(--encre); background: #fff; border: var(--contour-fin) solid var(--encre); border-radius: 10px; cursor: pointer; }
.rep-seg button[aria-pressed="true"] { background: var(--encre); color: #fff; }
.rep-seg .rep-cursive { font-family: "Ludo Cursive", "Playwrite FR Trad", cursive; font-size: 1.05rem; }
.rep-jouer { justify-self: center; min-width: 60%; }
/* Écran large ou carré : lettres à gauche, options et bouton à droite, sans rien faire défiler */
@container (min-width: 380px) {
  .rep-prep { gap: 8px; }
  .rep-corps { grid-template-columns: 1.2fr 1fr; column-gap: 16px; align-items: center; }
  .rep-touches { grid-template-columns: repeat(6, 1fr); }
  .rep-touche { min-height: 36px; font-size: .95rem; }
  .rep-seg { flex-direction: column; align-items: stretch; gap: 5px; }
  .rep-seg button { min-height: 40px; }
}
/* Partie */
.rep-jeu { display: flex; flex-direction: column; }
.rep-hud { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: clamp(6px, 2.4cqw, 14px); padding: clamp(6px, 2cqw, 12px); background: #1f7a3a; color: #fff; border: var(--contour) solid var(--encre); border-bottom-width: 0; border-radius: 14px 14px 0 0; }
.rep-cible { display: flex; align-items: center; gap: 8px; }
.rep-cible small { font: 800 clamp(.7rem, 3cqw, .95rem) system-ui, sans-serif; line-height: 1.1; text-align: left; }
.rep-lettre-cible { min-width: clamp(40px, 14cqw, 76px); height: clamp(40px, 14cqw, 76px); padding: 0 8px; display: grid; place-items: center; background: #fff; color: var(--encre); border: var(--contour) solid var(--encre); border-radius: 14px;
  font-size: clamp(1.6rem, 8.5cqw, 3rem); line-height: 1; box-shadow: 0 3px 0 rgb(0 0 0 / .35); white-space: nowrap; }
.rep-lettre-cible.rep-police-cur { height: auto; min-height: clamp(40px, 14cqw, 76px); padding: 8px 12px; font-size: clamp(1.1rem, 5cqw, 1.9rem); line-height: 2.1; } /* hampes et jambes de la cursive : le cadre grandit */
.rep-temps { display: grid; gap: 4px; justify-items: center; font: 800 clamp(1rem, 4.6cqw, 1.5rem) "Rockwell", "Roboto Slab", Georgia, serif; }
.rep-barre { width: 100%; height: clamp(8px, 2.2cqw, 12px); background: rgb(255 255 255 / .35); border: var(--contour-fin) solid rgb(0 0 0 / .35); border-radius: 99px; overflow: hidden; }
.rep-barre span { display: block; height: 100%; width: 100%; background: #fff; }
.rep-compte { text-align: right; font: 800 clamp(1.1rem, 5cqw, 1.7rem) "Rockwell", "Roboto Slab", Georgia, serif; line-height: 1.1; }
.rep-aire { position: relative; background: var(--parchemin); border: var(--contour) solid var(--encre); border-radius: 0 0 14px 14px; overflow: hidden; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.rep-let { position: absolute; left: calc(var(--x) * 100% - var(--L) / 2); top: calc(var(--y) * 100% - var(--L) / 2); width: var(--L); height: var(--L); padding: 0; margin: 0; display: grid; place-items: center;
  font-size: calc(var(--L) * .64); line-height: 1; color: #111; background: transparent; border: 0; cursor: pointer; font-family: inherit; -webkit-tap-highlight-color: transparent; }
.rep-cursive-aire .rep-let { font-size: calc(var(--L) * .46); } /* la cursive à boucles a de grandes hampes et jambes : plus petite pour rester dans son emplacement */
.rep-let:focus-visible { outline: 3px solid var(--bleu); outline-offset: 2px; box-shadow: none; border-radius: 12px; }
.rep-vide { visibility: hidden; pointer-events: none; }
.rep-entre { animation: rep-entre .22s ease-out; }
@keyframes rep-entre { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }
.rep-fb { position: absolute; z-index: 5; pointer-events: none; transform: translate(-50%, -50%); padding: 2px 8px; border-radius: 99px; color: #fff; font: 800 clamp(1rem, 4.6cqw, 1.5rem) system-ui, sans-serif; white-space: nowrap; animation: rep-monte .65s ease-out forwards; }
.rep-fb-bon { background: #1f7a3a; }
.rep-fb-mauvais { background: var(--rouge-texte); }
@keyframes rep-monte { to { opacity: 0; transform: translate(-50%, -190%); } }
.rep-depart { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; background: rgb(0 0 0 / .35); color: #fff; font: 800 clamp(2.5rem, 16cqw, 5rem) "Rockwell", "Roboto Slab", Georgia, serif; }
@media (prefers-reduced-motion: reduce) { .rep-entre, .rep-fb { animation: none; } }
/* « Attrape le chiffre » (v10.63) : 10 chiffres + « Au hasard » sur 5 colonnes, au lieu des 7 / 6 colonnes des 26 lettres. */
.mj-chiffres .rep-touches { grid-template-columns: repeat(5, 1fr); }
.mj-chiffres .rep-touche:not(.rep-hasard) { font-size: clamp(1.2rem, 6cqw, 1.7rem); }
/* « Alphabet dans l'ordre » (v10.72) : les lettres sont des bulles comme aux « Les bulles » ; une lettre double (Aa) est un peu plus petite. */
.mj-alphabet .mjb-lettre { font-size: calc(var(--d) * .46); }
.mj-alphabet .mjb-lettre.rep-police-imp { font-family: "Ludo Imprimerie", Verdana, Arial, sans-serif; }
.mj-alphabet .mjb-lettre.rep-police-cur { font-family: "Ludo Cursive", "Playwrite FR Trad", cursive; font-weight: 400; font-size: calc(var(--d) * .36); padding-bottom: 6%; }
/* « Compte les objets » (v10.72) : zone des objets (prend la place restante) au-dessus d'un pavé de 1 à 10 sur 2 rangées. */
.mjc-corps { display: flex; flex-direction: column; gap: clamp(4px, 1.4cqw, 10px); min-height: 0; }
.mjc-aire { flex: 1 1 auto; min-height: 0; height: auto; }
.mjc-pave, .mj-compte .rep-touches.mjc-pave { flex: none; grid-template-columns: repeat(5, 1fr); }
.mj-compte .mjc-pave .rep-touche { font-size: clamp(1.2rem, 6cqw, 1.7rem); }
.mjc-objet { position: absolute; left: calc(var(--x) * 100%); top: calc(var(--y) * 100%); width: var(--d); height: var(--d); transform: translate(-50%, -50%);
  display: grid; place-items: center; font-size: calc(var(--d) * .8); line-height: 1; pointer-events: none; user-select: none; }
/* « Le chiffre qui manque » (v10.74) : une suite de 4 cases au centre de la zone, au-dessus du même pavé de 1 à 10. */
.mjm-aire { flex: 1 1 auto; min-height: 0; height: auto; display: grid; place-items: center; }
.mj-manque .mjc-pave .rep-touche { font-size: clamp(1.2rem, 6cqw, 1.7rem); }
.mj-lmanque .mjc-pave, .mj-lentends .mjc-pave, .mj-syllabes .mjc-pave, .mj-ecritures .mjc-pave, .mj-premiere .mjc-pave { grid-template-columns: repeat(4, 1fr); }
.mj-lmanque .mjc-pave .rep-touche, .mj-lentends .mjc-pave .rep-touche, .mj-syllabes .mjc-pave .rep-touche, .mj-ecritures .mjc-pave .rep-touche, .mj-premiere .mjc-pave .rep-touche { font-size: clamp(1.4rem, 8cqw, 2rem); }
/* « Voyelle ou consonne » (v10.88) : deux grands boutons sous une grande lettre. */
.mj-voyelle .mjc-pave { grid-template-columns: repeat(2, 1fr); }
.mj-voyelle .mjc-pave .rep-touche { font-size: clamp(1.2rem, 6cqw, 1.7rem); }
.mj-voyelle .mjm-case { width: clamp(72px, 30cqw, 150px); font-size: clamp(2.4rem, 16cqw, 5rem); }
.mjm-suite { display: flex; gap: clamp(6px, 2.4cqw, 16px); justify-content: center; width: 100%; }
.mjm-case { display: grid; place-items: center; width: clamp(48px, 20cqw, 110px); aspect-ratio: 1; max-height: 70%; border: var(--contour, 2px) solid currentColor; border-radius: 16px;
  background: #fffaf0; font-size: clamp(1.8rem, 9cqw, 3.4rem); font-weight: 700; line-height: 1; }
.mjm-case.mjm-trou { border-style: dashed; background: transparent; color: #b71c1c; }
/* « Où y en a-t-il le plus ? » (v10.78) : deux grands paniers-boutons côte à côte (l'un sous l'autre en écran étroit et haut) ; les objets sont rangés en grille. */
.mjp-corps { display: flex; flex-direction: column; min-height: 0; }
.mjp-aire { flex: 1 1 auto; min-height: 0; height: auto; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(8px, 3cqw, 20px); padding: clamp(4px, 1.5cqw, 12px); }
.mjp-panier { display: grid; place-items: center; min-height: 0; min-width: 0; padding: 4px; border: var(--contour, 2px) solid var(--encre); border-radius: 20px; background: #fffaf0; color: var(--encre); font-family: inherit; cursor: pointer; container-type: size; }
.mjp-panier:focus-visible { outline: 3px solid var(--bleu); outline-offset: 2px; }
.mjp-grille { display: grid; grid-template-columns: repeat(var(--c), 1fr); grid-template-rows: repeat(var(--l), 1fr); width: 100%; height: 100%; place-items: center; pointer-events: none; }
.mjp-objet { font-size: min(calc(70cqw / var(--c)), calc(70cqh / var(--l)), 4rem); line-height: 1; user-select: none; }
.mjp-panier.mjp-juste { background: #c8e6c9; border-color: #2e7d32; }
.mjp-panier:disabled.mjp-faux { opacity: .35; cursor: default; }
@media (max-aspect-ratio: 3/4) { .mjp-aire { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; } }
/* « J'en ajoute » (v10.79) : la phrase, puis les objets de départ + les objets ajoutés (entourés), au-dessus du même pavé de 1 à 10. */
.mja-aire { flex: 1 1 auto; min-height: 0; height: auto; display: grid; place-items: center; container-type: size; }
.mja-scene { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(4px, 2cqh, 14px); width: 100%; max-height: 100%; padding: 0 6px; text-align: center; }
.mja-phrase { margin: 0; font-weight: 700; font-size: clamp(.95rem, min(5.4cqw, 11cqh), 1.9rem); line-height: 1.2; }
.mja-ligne { display: flex; align-items: center; justify-content: center; gap: clamp(4px, 2cqw, 14px); flex-wrap: wrap; }
.mja-groupe { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; max-width: 46cqw; }
.mja-objet { font-size: clamp(1.3rem, min(7cqw, 18cqh), 3rem); line-height: 1.1; user-select: none; }
.mja-objet.mja-ajoute { border-radius: 50%; box-shadow: 0 0 0 2px #2e7d32; background: #e8f5e9; }
.mja-plus { font-size: clamp(1.4rem, min(8cqw, 20cqh), 3rem); font-weight: 700; color: #2e7d32; line-height: 1; }
.mja-entre { animation: mja-entre .25s ease-out; }
@keyframes mja-entre { from { transform: scale(.4); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .mja-entre { animation: none; } }
.mj-ajoute .mjc-pave .rep-touche { font-size: clamp(1.2rem, 6cqw, 1.7rem); }
/* « Les doigts » (v10.81) : la consigne et une ou deux mains (dessins de Baby jeux), au-dessus du même pavé de 1 à 10. */
.mjd-aire { flex: 1 1 auto; min-height: 0; height: auto; display: grid; place-items: center; container-type: size; }
.mjd-scene { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(4px, 2cqh, 14px); width: 100%; max-height: 100%; padding: 0 6px; text-align: center; }
.mjd-phrase { margin: 0; font-weight: 700; font-size: clamp(.95rem, min(5.4cqw, 11cqh), 1.9rem); line-height: 1.2; }
.mjd-mains { display: flex; justify-content: center; max-width: 100%; }
.mjd-mains .baby-main { height: clamp(60px, min(52cqh, 34cqw), 230px); max-width: 46cqw; }
.mj-doigts .mjc-pave .rep-touche { font-size: clamp(1.2rem, 6cqw, 1.7rem); }
/* « Relier dés et chiffres » (v10.82) : deux colonnes de 4 tuiles-boutons (dés à gauche, chiffres à droite) ; la tuile choisie est cerclée de bleu, une paire juste passe au vert. */
.mjr-corps { display: flex; flex-direction: column; min-height: 0; }
.mjr-aire { flex: 1 1 auto; min-height: 0; height: auto; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(10px, 8cqw, 60px); padding: clamp(4px, 1.5cqw, 12px) clamp(8px, 6cqw, 48px); container-type: size; }
.mjr-col { display: grid; grid-template-rows: repeat(4, minmax(0, 1fr)); gap: clamp(6px, 2cqh, 14px); min-height: 0; min-width: 0; }
.mjr-tuile { display: grid; place-items: center; min-height: 0; min-width: 0; padding: 2px; border: var(--contour, 2px) solid var(--encre); border-radius: 16px; background: #fffaf0; color: var(--encre); font-family: inherit; font-weight: 700; cursor: pointer; }
.mjr-tuile:focus-visible { outline: 3px solid var(--bleu); outline-offset: 2px; }
.mjr-chiffre { font-size: clamp(1.6rem, min(14cqh, 12cqw), 3.2rem); line-height: 1; }
/* « Grandes et petites » (v10.87) : mêmes tuiles que « Relier dés et chiffres », avec une lettre dedans. */
.mjr-tuile.mjg-lettre { font-size: clamp(1.6rem, min(14cqh, 12cqw), 3.2rem); line-height: 1; }
.mjr-de .baby-des { display: grid; place-items: center; height: 100%; }
.mjr-de .baby-de { height: min(100%, 22cqh, 30cqw); width: auto; aspect-ratio: 1; max-height: 100%; }
.mjr-tuile.mjr-choisi { outline: 4px solid var(--bleu); outline-offset: 1px; background: #e3f0ff; }
.mjr-tuile.mjr-relie { background: #2e7d32; color: #fff; border-color: #1b5e20; cursor: default; outline: none; }
.mjr-tuile.mjr-relie .baby-de rect { fill: #e8f5e9; }
/* « J'entends le chiffre » (v10.83) : un gros bouton 🔊 au centre, le pavé 1 à 10 dessous (comme « Les doigts »). */
.mje-aire { flex: 1 1 auto; min-height: 0; height: auto; display: grid; place-items: center; container-type: size; }
.mje-scene { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(6px, 3cqh, 18px); width: 100%; max-height: 100%; padding: 0 6px; text-align: center; }
.mje-phrase { margin: 0; font-weight: 700; font-size: clamp(.95rem, min(5.4cqw, 11cqh), 1.9rem); line-height: 1.2; }
.mje-ecoute { width: clamp(64px, min(46cqh, 40cqw), 180px); aspect-ratio: 1; border-radius: 50%; border: var(--contour, 2px) solid var(--encre); background: #fffaf0; font-size: clamp(2rem, min(22cqh, 20cqw), 5rem); line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0; }
.mje-ecoute:focus-visible { outline: 3px solid var(--bleu); outline-offset: 2px; }
.mj-entends .mjc-pave .rep-touche { font-size: clamp(1.2rem, 6cqw, 1.7rem); }
/* « La première lettre » (v10.86) : l'image et le bouton 🔊 côte à côte ; le mot s'écrit dessous après la bonne réponse. */
.mjp-ligne { display: flex; align-items: center; justify-content: center; gap: clamp(8px, 4cqw, 28px); min-height: 0; }
.mjp-image { margin: 0; font-size: clamp(2.6rem, min(34cqh, 26cqw), 7rem); line-height: 1; }
.mjp-ecoute.mje-ecoute { width: clamp(48px, min(26cqh, 22cqw), 120px); font-size: clamp(1.4rem, min(13cqh, 11cqw), 3.2rem); }
.mjp-mot { margin: 0; min-height: 1.2em; font-weight: 700; letter-spacing: .06em; font-size: clamp(1rem, min(6cqw, 10cqh), 2rem); line-height: 1.2; }
.mjp-mot strong { color: var(--vert, #2e7d32); }
/* « Du plus petit au plus grand » : 4 tuiles-boutons (forme des cases du « Chiffre qui manque ») ; une tuile rangée passe au vert et garde son rang. */
.mjo-corps { display: flex; flex-direction: column; min-height: 0; }
.mjo-aire { flex: 1 1 auto; min-height: 0; height: auto; display: grid; place-items: center; }
.mjo-tuile { position: relative; color: var(--encre); font-family: inherit; cursor: pointer; padding: 0; }
.mjo-tuile:focus-visible { outline: 3px solid var(--bleu); outline-offset: 2px; }
.mjo-tuile.mjo-range { background: #2e7d32; color: #fff; border-color: #1b5e20; cursor: default; }
.mjo-tuile.mjo-range::after { content: attr(data-rang); position: absolute; top: 4px; right: 6px; font-size: .35em; opacity: .85; }
.mjo-entre { animation: mjo-entre .25s ease-out; }
@keyframes mjo-entre { from { transform: scale(.5); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .mjo-entre { animation: none; } }
.mjc-pave .rep-touche:disabled.mjc-faux { opacity: .35; cursor: default; }
.mjc-pave .rep-touche.mjc-juste { background: #2e7d32; color: #fff; border-color: #1b5e20; }
/* « Les bulles » (v10.66) : bulles rondes numérotées dans la zone de jeu de la Chasse aux lettres ; taille (--d) et couleur (--teinte) suivent le rang. */
.mjb-niveaux { display: grid; grid-template-columns: repeat(5, 1fr); gap: clamp(3px, 1.2cqw, 8px); }
.mjb-niveau { display: grid; gap: 1px; align-content: center; min-height: clamp(44px, 11cqw, 58px); padding: 2px; }
.mjb-niv-n { font: 800 clamp(.62rem, 2.6cqw, .95rem) system-ui, sans-serif; white-space: nowrap; }
.mjb-niv-p { font: 700 clamp(.65rem, 2.6cqw, .85rem) system-ui, sans-serif; opacity: .85; }
@media (max-height: 520px) { .mjb-niveau { min-height: 34px; } }
.mjb-regle { margin: 0 auto; max-width: 34em; text-align: center; font-weight: 700; font-size: clamp(.95rem, 3.8cqw, 1.1rem); }
.mjb-bulle { position: absolute; left: calc(var(--x) * 100%); top: calc(var(--y) * 100%); width: var(--d); height: var(--d); transform: translate(-50%, -50%);
  display: grid; place-items: center; padding: 0; border-radius: 50%; cursor: pointer; font: 800 calc(var(--d) * .42)/1 system-ui, sans-serif;
  border: 2px solid hsl(var(--teinte) 60% 32%); color: hsl(var(--teinte) 75% 16%);
  background: radial-gradient(circle at 32% 30%, #fff 0 16%, hsl(var(--teinte) 90% 86%) 55%, hsl(var(--teinte) 70% 64%)); }
.mjb-bulle:focus-visible { outline: 3px solid var(--bleu); outline-offset: 2px; }
.mjb-entre { animation: mjb-entre .25s ease-out; }
.mjb-eclate { animation: mjb-eclate .22s ease-out forwards; pointer-events: none; }
.mjb-eclate-vite { visibility: hidden; pointer-events: none; }
.mjb-secoue { animation: mjb-secoue .4s; }
@keyframes mjb-entre { from { transform: translate(-50%, -50%) scale(.4); opacity: 0; } }
@keyframes mjb-eclate { to { transform: translate(-50%, -50%) scale(1.35); opacity: 0; } }
@keyframes mjb-secoue { 0%, 100% { translate: 0 0; } 25% { translate: -8px 0; } 75% { translate: 8px 0; } }
@media (prefers-reduced-motion: reduce) { .mjb-entre, .mjb-eclate, .mjb-secoue { animation: none; } }

/* ---------- Paramètres › Sons (v10.61, demande du 26/11/2026) : curseurs de volume et vibration à 4 niveaux ---------- */
/* v10.67 (30/11/2026) : page épurée, sans textes d'aide ; vibration en une rangée de 4 choix égaux, texte centré. */
.sons-carte { padding-block: 4px; }
.sons-reglage { display: grid; gap: 4px; min-width: 0; border: 0; margin: 0; padding: 16px 0; border-bottom: var(--contour-fin) solid var(--parchemin-bord); }
.sons-reglage:last-child { border-bottom: 0; }
.sons-entete { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sons-entete label, .sons-vib legend { font-weight: 800; padding: 0; }
.sons-valeur { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--encre-douce); }
.sons-reglage input[type="range"] { width: 100%; min-height: 44px; margin: 0; accent-color: var(--encre); }
.sons-vib legend { margin-bottom: 10px; }
.sons-choix { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: var(--contour) solid var(--encre); border-radius: 12px; overflow: hidden; background: #fff; }
.sons-choix label { position: relative; display: block; }
.sons-choix label + label { border-left: var(--contour-fin) solid var(--encre); }
.sons-choix input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.sons-choix span { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 4px 6px; text-align: center; font-weight: 700; font-size: .95rem; }
.sons-choix input:checked + span { background: var(--encre); color: #fff; }
.sons-choix input:focus-visible + span { outline: 3px solid var(--rouge); outline-offset: -3px; }
@media (max-width: 400px) {
  .sons-choix { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sons-choix label:nth-child(odd) { border-left: 0; }
  .sons-choix label:nth-child(n+3) { border-top: var(--contour-fin) solid var(--encre); }
}

/* ---------- Boutons : charte v10.64 (choix de l'utilisateur, 30/11/2026, backlog lignes 575 et 576) ----------
   « Bois » (style 5 de la page de test) : Commencer l'aventure, Défi du jour, Mini-jeux.
   « Relief doux » (style 2) : boutons secondaires, bonne / mauvaise réponse, tuiles de mini-jeux, pastille « i ».
   Ombre 1 px, trait 0,5 px, arrondi 30 px, brillance 65 %, grain 45 %.
   Texture = image SVG (bruit) dont l'opacité est déjà réglée (45 %) : aucune image à charger. Les autres boutons gardent leur
   forme mais héritent des traits fins et de l'ombre de 1 px ci-dessus. */
:root {
  --tex-bois: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.012 .35' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .2  0 0 0 0 .1  0 0 0 0 .02  0 0 0 .585 -.0675'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.btn-principal, .btn-bleu, .btn-baby {
  border: var(--bouton-trait) solid var(--encre); border-radius: var(--bouton-rayon);
  background-image: var(--tex-bois); background-size: 200px 120px; background-blend-mode: multiply;
  box-shadow: inset 0 2px 0 rgb(255 255 255 / .4), inset 0 -3px 0 rgb(0 0 0 / .28), 0 var(--ombre) 0 var(--encre);
}
.btn-principal { background-color: var(--vert-bouton); }
.btn-bleu { background-color: var(--bleu); }
.btn-baby { background-color: var(--jaune); }
.btn-principal:active, .btn-bleu:active, .btn-baby:active {
  box-shadow: inset 0 2px 0 rgb(255 255 255 / .4), inset 0 -3px 0 rgb(0 0 0 / .28), 0 0 0 var(--encre);
}
.btn-secondaire, .btn-bonne, .btn-mauvaise, .minijeu-info {
  --col: #fff; --col-l: color-mix(in srgb, var(--col) 72%, white); --col-d: color-mix(in srgb, var(--col) 58%, black);
  border: var(--bouton-trait) solid var(--col-d); border-radius: var(--bouton-rayon);
  background-image: linear-gradient(rgb(255 255 255 / .49), transparent 55%), linear-gradient(var(--col-l), var(--col));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .55), 0 var(--ombre) 1.6px rgb(0 0 0 / .3);
}
.btn-bonne { --col: #1f7a3a; }
.minijeu-info { --col: var(--rouge); border-radius: 50%; }
.btn-secondaire:active, .btn-bonne:active, .btn-mauvaise:active {
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .55), 0 0 0 rgb(0 0 0 / .3);
}

/* ---------- Aucun défilement d'écran (v10.63, demande du 30/11/2026) ----------
   La page ne défile JAMAIS : le corps a exactement la hauteur visible de l'écran (dvh = sans la barre d'adresse du navigateur),
   le pied de page en fait partie, et chaque écran se dimensionne dans la place restante (petit écran = petit jeu).
   Seules les pages à contenu long (Mon compte, Mes coffres) gardent un défilement DANS leur cadre, jamais sur la page. */
html { height: 100%; overflow: hidden; overscroll-behavior: none; }
body { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; overscroll-behavior: none; }
main { min-height: 0; overflow: hidden; }
/* Écrans « page » : la barre du haut + le corps qui prend la place restante. */
.page { flex: 1; min-height: 0; display: flex; flex-direction: column; padding-bottom: 8px; }
.page > .barre { flex: none; }
.page-corps { flex: 1; min-height: 0; align-content: start; overflow: hidden; }
#ecran-compte .page-corps, #ecran-coffres .page-corps { overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }
/* Liste des mini-jeux (v10.91) : des lignes par catégorie ; la liste défile DANS son cadre (verticalement), jamais la page. */
#ecran-minijeux .page-corps { overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }
/* Pied de page plus bas sur les petits écrans (le bouton Ludo reste dedans). */
@media (max-height: 720px) {
  .page { padding-bottom: 3px; }
  .pied, body:has(#ecran-preparation:not([hidden])) .pied, body:has(#ecran-plateau:not([hidden])) .pied { min-height: 40px; padding-block: 2px calc(2px + env(safe-area-inset-bottom)); font-size: .8rem; }
  .ludo-bouton { width: 34px; height: 34px; border-width: 2px; }
}
/* Chasse aux lettres : la préparation rétrécit avec la hauteur (jamais de défilement). */
@media (max-height: 680px) {
  .rep-prep, .rep-corps, .rep-col-lettres, .rep-col-options { gap: 5px; }
  .rep-touches { gap: 4px; }
  .rep-touche { min-height: 32px; font-size: .95rem; box-shadow: 0 2px 0 var(--encre); }
  .rep-seg button { min-height: 34px; }
  .rep-q { font-size: .9rem; }
  .rep-record { padding: 1px 10px; }
  .rep-jouer { min-height: 42px; padding-block: 6px; }
}
@media (max-height: 520px) {
  .rep-touche { min-height: 24px; font-size: .8rem; border-width: 1.5px; border-radius: 7px; }
  .rep-seg { gap: 3px; }
  .rep-seg button { min-height: 28px; padding-block: 1px; font-size: .8rem; }
  .rep-q { font-size: .8rem; }
  .rep-jouer { min-height: 34px; padding-block: 2px; font-size: .95rem; }
  #titre-minijeu { font-size: 1rem; }
  .page > .barre { margin-bottom: 4px; }
}
/* La fabrique à mots : les touches et le mot rétrécissent avec la hauteur. */
@media (max-height: 760px) {
  .baby-touche { min-width: 34px; height: 34px; padding: 0 4px; font-size: 1rem; }
  .baby-touches { gap: 3px; }
  .baby-mot { min-height: 44px; font-size: clamp(1.4rem, 6vw, 1.9rem); }
  .minijeu { gap: 6px; }
}
@media (max-height: 600px) {
  .baby-touche { min-width: 28px; height: 28px; font-size: .9rem; border-radius: 7px; }
  .baby-mot { min-height: 36px; font-size: 1.4rem; padding-block: 0; }
  .baby-fab-titre { margin: 0 0 2px; font-size: .75rem; }
}
/* Quiz : l'écran de préparation (matière, période, niveau, bouton) tient sans défiler. */
@media (max-height: 800px) {
  .quiz { gap: 6px; }
  .quiz .defi-choix { gap: 4px; margin: 0; padding-block: 2px; }
  .quiz .pack span { min-height: 34px; padding: 2px 10px; font-size: .9rem; }
  .quiz-info { font-size: .85rem; }
  #quiz-lancer { min-height: 42px; padding-block: 6px; }
}
@media (max-height: 640px) {
  .quiz .pack span { min-height: 28px; padding: 1px 8px; font-size: .8rem; }
  #quiz-lancer { min-height: 36px; padding-block: 3px; }
}
/* Boutons des mini-jeux : un peu moins hauts quand l'écran est court. */
@media (max-height: 600px) { #minijeu-corps .btn { min-height: 38px; padding-block: 4px; } .baby-touche { min-width: 26px; height: 26px; } }
@media (max-height: 460px) and (min-width: 600px) {
  .quiz-choix { grid-template-columns: 1fr 1fr; align-items: start; column-gap: 12px; }
  .quiz-choix .quiz-info, .quiz-choix #quiz-lancer { grid-column: 1 / -1; }
  #minijeu-corps .btn { min-height: 32px; padding-block: 2px; }
}
/* Cadres rétrécis par js/ajuste-ecran.js : jamais de défilement. */
.sans-defilement { overflow: hidden !important; }
/* Écran peu haut mais large (paysage, carré) : réglages Lettres / Chiffres sur 2 colonnes (écriture + lettres à gauche, jeux à droite). */
@media (max-height: 520px) and (min-width: 440px) {
  .reglages-baby .baby-reglages { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 16px; row-gap: 4px; align-items: start; }
  .reglages-baby .baby-reglages > .defi-choix:last-child { grid-column: 2; grid-row: 1 / span 2; }
  .reglages-baby .baby-jeux { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 4px !important; }
  .reglages-joueur .reglages-baby .baby-jeux .pack span { font-size: .72rem; min-height: 24px; padding: 1px 4px; gap: 3px; }
  .reglages-baby .baby-reglages { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
  .reglages-baby .baby-grille.lettres { grid-template-columns: repeat(9, minmax(0, 1fr)); }
}
/* Questions Baby jeux (attrape, bulles…) en paysage ou écran très court : l'arène et le modèle rétrécissent, la carte tient sans défiler. */
@media (max-height: 520px) and (min-width: 560px) {
  .baby-arene:not(.bulles) { height: clamp(80px, 25vh, 150px); }
  .baby-modele { font-size: clamp(1.4rem, 6.5vh, 2rem); }
  .baby-jeton { min-width: 38px; height: 38px; font-size: 1.2rem; }
}
/* Pavé numérique et clavier : un peu plus bas quand l'écran est très court (paysage) ou étroit et peu haut (320×568), pour tenir sans défiler. */
@media (min-aspect-ratio: 1/1) and (max-height: 420px) {
  body.question-plein:not(.saisie-clavier) .carte-saisie.avec-pave .touche { min-height: clamp(24px, 6.4vh, 32px); }
  body.question-plein:not(.saisie-clavier) .carte-saisie.avec-pave #reponse-joueur { min-height: 30px; font-size: 1.2rem; }
  body.question-plein:not(.saisie-clavier) .carte-saisie.avec-pave { gap: 3px; }
  body.question-plein:not(.saisie-clavier) .carte-piochee .carte-entete .btn { min-height: 32px; padding-block: 1px; font-size: .9rem; }
  body.question-plein:not(.saisie-clavier) .clavier .touche { min-height: clamp(26px, 6vh, 34px); }
}
@media (max-aspect-ratio: 1/1) and (max-height: 600px) {
  .touche, body.question-plein .touche { min-height: clamp(34px, 6.2vh, 46px); }
  .carte-saisie.avec-pave { gap: 4px; }
}
@media (min-aspect-ratio: 1/1) and (max-height: 390px) {
  body.question-plein:not(.saisie-clavier) .carte-saisie.avec-pave .touche { min-height: 22px; font-size: 1.1rem; }
  body.question-plein:not(.saisie-clavier) .carte-saisie.avec-pave #reponse-joueur { min-height: 28px; font-size: 1.1rem; }
  body.question-plein:not(.saisie-clavier) .carte-piochee .carte-entete .btn { min-height: 28px; }
}

/* ---------- v10.94 (demande du 02/12/2026) : vrai parchemin et panneaux en bois ---------- */
/* Vrai parchemin sur les GRANDES surfaces : fenêtres, cartes des écrans, blocs de préparation.
   Deux images (v10.99) : img/parchemin-h.webp (horizontal) et img/parchemin-v.webp (vertical). js/parchemin.js pose data-parchemin="v" ou "h"
   selon la forme de chaque surface (plus haute que large = vertical) : le parchemin n'est jamais étiré d'un format à l'autre.
   Le parchemin reste fixe : si le contenu dépasse, c'est le contenu qui défile dans la surface, jamais l'image.
   Cadre en « border-image » : les bords déchirés gardent leur forme, le centre s'étire un peu.
   Les petits éléments (boutons, cases, pastilles, champs) gardent la couleur unie --parchemin pour rester lisibles. */
.fin, .version-dialog, .carte-page, .bloc {
  /* Épaisseur de bordure d'origine conservée (aucun changement de mise en page) ; le parchemin est dessiné par-dessus, dans la marge intérieure. */
  border-style: solid; border-color: transparent; border-image: url("../img/parchemin-h.webp") 24 fill / 10px / 0 stretch;
  border-radius: 0; box-shadow: none;
  background-color: var(--parchemin); background-clip: content-box; /* repli si l'image ne charge pas ; jamais sous les bords déchirés */
}
:is(.fin, .version-dialog, .carte-page, .bloc)[data-parchemin="v"] { border-image-source: url("../img/parchemin-v.webp"); border-image-slice: 20 fill; }
/* v11.13 (demande du 03/12/2026) : la carte « Tour de jeu » est le parchemin lui-même, avec ses bords irréguliers (plus de bulle rectangulaire
   aux coins arrondis, plus de liseré de couleur : la couleur du joueur reste sur son portrait et sur le cadre de la question).
   L'ombre suit la forme déchirée (drop-shadow) au lieu d'un rectangle. */
.bloc.tour { background-color: transparent; /* sinon la couleur de secours dépasse des coins déchirés */ filter: drop-shadow(0 3px 4px rgb(0 0 0 / .3)); }
.table.tour-monte .bloc.tour { filter: drop-shadow(0 -4px 8px rgb(0 0 0 / .35)); }
/* Le texte posé directement sur le parchemin (« À Léa de jouer », « Tour de jeu ») garde une pastille claire : lisible sur les craquelures de l'image,
   et l'audit de contraste (axe) le mesure sur du parchemin et non sur le vert du fond. */
.bloc.tour .tour-joueur p, .bloc.tour h3 { width: fit-content; max-width: 100%; padding: 1px 8px; border-radius: 8px; background: rgb(246 238 219 / .9); }

/* Boutons de l'accueil : panneaux en bois illustrés (img/accueil/panneau-*.webp), texte dans l'image + texte masqué pour les lecteurs d'écran. */
.btn-panneau {
  display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; line-height: 0;
  filter: drop-shadow(0 3px 3px rgb(0 0 0 / .35)); transition: transform .08s ease, filter .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn-panneau img { display: block; width: 100%; height: auto; pointer-events: none; user-select: none; }
.btn-panneau:hover { filter: drop-shadow(0 3px 3px rgb(0 0 0 / .35)) brightness(1.07); }
.btn-panneau:active { transform: translateY(2px) scale(.99); }
.btn-panneau:focus-visible { outline: 3px solid var(--jaune); outline-offset: 3px; border-radius: 12px; }
@media (max-height: 480px) and (min-aspect-ratio: 3/2) {
  /* téléphone en paysage : trois panneaux plus étroits pour tenir en hauteur */
  .accueil-actions .btn-panneau { width: min(100%, 23vh * 4.4); align-self: flex-end; }
}

/* ---------- Didacticiel de Ludo (v10.99, js/didacticiel.js) ----------
   Réglages choisis sur la page de test du 02/12/2026 : voile noir à 62 % (zone à toucher en clair), bulle BD à trait de 2 px
   dont la queue part de la bouche de Ludo, flèche pleine jaune qui pulse, Ludo à gauche (150 px au plus). */
.dida { position: fixed; inset: 0; z-index: 60; pointer-events: none; overflow: hidden; }
.dida[hidden] { display: none; }
.dida-bloc { position: absolute; pointer-events: auto; }
.dida-bloc[hidden] { display: none; }
.dida-trou { position: absolute; pointer-events: none; transition: left .3s ease, top .3s ease, width .3s ease, height .3s ease; }
.dida.sans-transition .dida-trou { transition: none; }
.dida-queue { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.dida-ludo { position: absolute; bottom: 0; overflow: hidden; pointer-events: none; }
.dida-ludo img { display: block; width: 100%; height: auto; }
.dida-ludo.droite img { transform: scaleX(-1); }
.dida-fleche { position: absolute; pointer-events: none; filter: drop-shadow(0 3px 2px rgb(0 0 0 / .45)); }
.dida-fleche-anim { width: 100%; height: 100%; transform-origin: 50% 50%; animation: ludo-pulse .7s ease-in-out infinite alternate; }
.dida-bulle { position: absolute; pointer-events: auto; box-sizing: border-box; background: #fffdf6; color: var(--encre);
  border: 2px solid var(--encre); border-radius: 18px; padding: 10px 14px 12px; box-shadow: 4px 5px 0 rgb(0 0 0 / .25); max-width: calc(100vw - 16px); }
.dida-bulle.apparait { animation: dida-apparait .25s ease-out; }
@keyframes dida-apparait { from { opacity: 0; } to { opacity: 1; } }
.dida-nom { margin: 0 0 2px; font: 800 .75rem/1 system-ui, sans-serif; text-transform: uppercase; letter-spacing: .08em; color: #a11d1d; }
.dida-texte { margin: 0; font-weight: 650; font-size: 17px; line-height: 1.3; }
.dida-bulle.petit .dida-texte { font-size: 15px; line-height: 1.25; }
.dida-reste { color: transparent; }
.dida-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dida-bas { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.dida-compteur { font-size: .78rem; font-weight: 800; opacity: .7; }
.dida-actions { display: flex; gap: 6px; }
.dida-actions .btn { min-height: 38px; padding: 4px 12px; font-size: .88rem; }
.dida-actions .btn[hidden] { display: none; }
.dida-bulle.petit .dida-bas { margin-top: 6px; }
@media (prefers-reduced-motion: reduce) { .dida-fleche-anim, .dida-bulle.apparait { animation: none; } .dida-trou { transition: none; } }

/* v11.3 (demande du 02/12/2026) : page « Mini-jeux ». Le parchemin est fixe à la taille de l'écran (jamais une carte de 2 000 px qui défile et se déforme) :
   c'est la carte qui défile à l'intérieur, l'image du parchemin reste en place. */
#ecran-minijeux .page-corps { display: flex; flex-direction: column; overflow: hidden; }
#ecran-minijeux .carte-page.minijeux { flex: 0 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }

/* ---------- Écran Solo / Multijoueur (v11.5, demande du 03/12/2026) ----------
   Proposition A de la page de test : panneaux de bois, Solo bleu #3ca2e2, Multijoueur vert #2fc175, contour 1 px, ombre 1 px,
   arrondi 13 px, inclinaison 1,5°, texture 0,6, clous. Texte limité par la largeur du panneau (cqi) : « Multijoueur » ne se coupe jamais. */
.mode-corps { display: grid; place-items: center; align-content: center; padding: 8px 12px; }
.mode-choix { width: min(100%, 560px); display: grid; gap: clamp(16px, 4vh, 34px); }
.mode-cell { container-type: inline-size; min-width: 0; }
.btn-mode {
  --c: #3ca2e2; --cl: color-mix(in srgb, var(--c) 68%, #fff); --cd: color-mix(in srgb, var(--c) 55%, #000);
  position: relative; isolation: isolate; width: 100%; min-width: 0; min-height: clamp(84px, 17vh, 130px); cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: .45em; padding: .5em .8em; text-align: left;
  font: 800 min(28px, 7.2cqi) Rockwell, "Roboto Slab", Georgia, serif; letter-spacing: 0;
  color: #fff3d6; text-shadow: 0 1px 1px rgb(0 0 0 / .45); -webkit-text-stroke: .5px #3b1d12; paint-order: stroke fill;
  background:
    repeating-linear-gradient(92deg, rgb(0 0 0 / .072) 0 2px, transparent 2px 9px),
    repeating-linear-gradient(88deg, rgb(255 255 255 / .084) 0 1px, transparent 1px 13px),
    linear-gradient(var(--cl), var(--c) 45%, var(--cd));
  border: 1px solid #3b1d12; border-radius: 5.2px 14.3px 6.5px 11.7px / 10.4px 5.2px 11.7px 6.5px;
  box-shadow: 0 1px 1.5px rgb(0 0 0 / .4), inset 0 2px 0 rgb(255 255 255 / .35), inset 0 -3px 0 rgb(0 0 0 / .18);
  transform: rotate(1.5deg); transition: transform .08s ease, filter .15s ease; -webkit-tap-highlight-color: transparent;
}
.mode-cell:nth-child(even) .btn-mode { transform: rotate(-1.5deg); }
.btn-mode.mode-multi { --c: #2fc175; }
.btn-mode:hover { filter: brightness(1.07); }
.btn-mode:active { transform: translateY(2px) scale(.99); }
.btn-mode:focus-visible { outline: 3px solid var(--jaune); outline-offset: 3px; }
.btn-mode::before { /* quatre clous aux coins */
  content: ""; position: absolute; inset: 7px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(circle, #c9ccd1 0 30%, #555 38% 62%, transparent 66%) left top / 11px 11px no-repeat,
    radial-gradient(circle, #c9ccd1 0 30%, #555 38% 62%, transparent 66%) right top / 11px 11px no-repeat,
    radial-gradient(circle, #c9ccd1 0 30%, #555 38% 62%, transparent 66%) left bottom / 11px 11px no-repeat,
    radial-gradient(circle, #c9ccd1 0 30%, #555 38% 62%, transparent 66%) right bottom / 11px 11px no-repeat;
}
.btn-mode .mode-ico { flex: none; display: block; height: 2em; }
.btn-mode .mode-ico svg { display: block; height: 100%; width: auto; overflow: visible; }
.btn-mode .mode-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.05; }
.btn-mode .mode-txt b { font-weight: 800; white-space: nowrap; }
.btn-mode .mode-txt small { font: 700 .5em system-ui, sans-serif; opacity: .95; margin-top: .2em; letter-spacing: .02em; -webkit-text-stroke: 0; }
@media (prefers-reduced-motion: reduce) { .btn-mode { transition: none; } }
