/* « Devoirs et suivi scolaire Mathéo » : design hérité de la démo V2 validée (tableau de stade, cahier Seyès,
   cartes de la charte) et composants de l'application finale. */
:root {
  color-scheme: light;
  --pelouse: #17683c;
  --pelouse-claire: #2b8a52;
  --craie: #ffffff;
  --encre: #182640;
  --encre-douce: #4a5874;
  --fond: #edf3ee;
  --surface: #ffffff;
  --surface-2: #f4f8f4;
  --trait: #d3ddd5;
  --carton-jaune: #ffcf2e;
  --carton-jaune-fonce: #c99700;
  --carton-jaune-texte: #2a2000;
  --seyes: #b9d1ee;
  --seyes-fin: #dde9f7;
  --marge: #e2575c;
  --succes: #1c8a4b;
  --succes-fond: #e3f4e9;
  --indice-fond: #fff4cf;
  --erreur: #c13b43;
  --erreur-fond: #fbe7e8;
  --voile: rgba(9, 32, 20, 0.96);
  --ombre: 0 6px 18px rgba(18, 48, 32, 0.12);

  --f-titre: "Big Shoulders Display", "Arial Narrow", "Roboto Condensed", sans-serif;
  --f-texte: "Lexend", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-cahier: "Playwrite FR Trad", "Segoe Script", "Comic Sans MS", cursive;

  --rayon: 16px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --pelouse: #145a34;
    --pelouse-claire: #2a7d4c;
    --encre: #e7efe9;
    --encre-douce: #a7b8ad;
    --fond: #0c1611;
    --surface: #14221a;
    --surface-2: #1a2c21;
    --trait: #2b3f32;
    --seyes: #2f4b6b;
    --seyes-fin: #22364d;
    --marge: #c55259;
    --succes: #4dc27f;
    --succes-fond: #173826;
    --indice-fond: #3a3112;
    --erreur: #f07078;
    --erreur-fond: #3d1c20;
    --voile: rgba(3, 12, 7, 0.97);
    --ombre: 0 6px 18px rgba(0, 0, 0, 0.45);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --pelouse: #145a34;
  --pelouse-claire: #2a7d4c;
  --encre: #e7efe9;
  --encre-douce: #a7b8ad;
  --fond: #0c1611;
  --surface: #14221a;
  --surface-2: #1a2c21;
  --trait: #2b3f32;
  --seyes: #2f4b6b;
  --seyes-fin: #22364d;
  --marge: #c55259;
  --succes: #4dc27f;
  --succes-fond: #173826;
  --indice-fond: #3a3112;
  --erreur: #f07078;
  --erreur-fond: #3d1c20;
  --voile: rgba(3, 12, 7, 0.97);
  --ombre: 0 6px 18px rgba(0, 0, 0, 0.45);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  padding-inline: 16px;
  background: var(--fond);
  color: var(--encre);
  font-family: var(--f-texte);
  font-size: 18px;
  line-height: 1.5;
}

h1, h2, h3 { text-wrap: balance; margin: 0; }
p { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--carton-jaune); outline-offset: 3px; border-radius: 8px; }

.cadre {
  max-width: 980px;
  margin: 0 auto;
  padding-block: 16px 48px;
  display: grid;
  gap: 24px;
}
.cadre.en-guide { padding-block-end: 220px; }

/* ---------- Tableau d'affichage ---------- */
.tableau {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 14px 18px;
  border-radius: var(--rayon);
  color: var(--craie);
  background-color: var(--pelouse);
  background-image:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0 48px, transparent 48px 96px),
    linear-gradient(var(--craie), var(--craie));
  background-size: auto, 2px 100%;
  background-position: 0 0, 50% 0;
  background-repeat: repeat, no-repeat;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.25);
}
.tableau-marque {
  display: flex;
  align-items: center;
  gap: 12px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: var(--craie);
}
.tableau-nom {
  font-family: var(--f-titre);
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
}
.pastille-demo {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--carton-jaune);
  color: var(--carton-jaune-texte);
  padding: 3px 10px;
  border-radius: 6px;
}
/* Contexte scolaire discret dans l'en-tête (« CM1 — 2026-2027 ») — étape 5A. */
.contexte-scolaire {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  opacity: 0.85;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.18);
  white-space: nowrap;
}
.tableau-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.stat {
  background: rgba(0, 0, 0, 0.22);
  border-radius: 10px;
  padding: 6px 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.stat b { font-family: var(--f-titre); font-size: 1.3rem; font-weight: 800; letter-spacing: 0.02em; }

/* ---------- Écrans ---------- */
.ecran { display: grid; gap: 22px; }
.entete-ecran { display: grid; gap: 6px; }
.titre-ecran {
  font-family: var(--f-titre);
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 2.8rem);
  line-height: 1.05;
  letter-spacing: 0.01em;
}
.titre-ecran:focus { outline: none; }
.titre-geant { font-size: clamp(2.6rem, 8vw, 4rem); text-align: center; }
.sous-titre { color: var(--encre-douce); max-width: 60ch; }
.mention { color: var(--encre-douce); font-size: 0.9rem; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 10px 22px;
  border-radius: 999px;
  border: 2px solid transparent;
  font-weight: 600;
  font-size: 1.02rem;
  cursor: pointer;
  text-align: center;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.btn:active { transform: translateY(2px); }
.btn-principal {
  background: var(--carton-jaune);
  color: var(--carton-jaune-texte);
  box-shadow: 0 4px 0 var(--carton-jaune-fonce);
}
.btn-principal:active { box-shadow: 0 2px 0 var(--carton-jaune-fonce); }
.btn-secondaire { background: var(--surface); color: var(--encre); border-color: var(--trait); }
.btn-secondaire:hover { border-color: var(--pelouse-claire); }
.btn-demo { background: var(--pelouse); color: var(--craie); box-shadow: 0 4px 0 #0d3d22; }
.btn-danger { background: var(--erreur-fond); color: var(--erreur); border-color: var(--erreur); }
.btn-grand { min-height: 64px; font-size: 1.15rem; padding-inline: 28px; }
.btn-petit { min-height: 44px; padding: 6px 16px; font-size: 0.95rem; }
.lien {
  background: none;
  border: 0;
  padding: 6px 0;
  color: var(--pelouse-claire);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.rangee-actions, .rangee-secondaire { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.pastille {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--trait);
  font-size: 0.9rem;
  font-weight: 600;
}
.pastille-ok { background: var(--succes-fond); color: var(--succes); border-color: transparent; }
.pastille-defi { background: var(--carton-jaune); color: var(--carton-jaune-texte); border-color: transparent; justify-self: start; }

/* ---------- Jauge ---------- */
.jauge {
  display: grid;
  gap: 12px;
  padding: 18px 20px;
  background: var(--surface);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
}
.jauge-ballons { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; }
.ballon {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px dashed var(--trait);
  display: grid;
  place-items: center;
  font-size: clamp(1rem, 4vw, 1.7rem);
  line-height: 1;
}
.ballon.plein { border: 2px solid var(--pelouse-claire); background: var(--succes-fond); }
.ballon.pop { animation: pop 380ms ease-out; }
/* Ballons qui viennent d'être gagnés : ils « poussent » l'un après l'autre dès l'affichage (aucun minuteur JavaScript) */
.ballon.nouveau { animation: pop 380ms ease-out both; animation-delay: calc(300ms + var(--rang, 0) * 160ms); }
.jauge-palier { display: grid; gap: 10px; }
.jauge.pleine { box-shadow: 0 0 0 4px var(--carton-jaune), var(--ombre); }
.jauge-texte { font-variant-numeric: tabular-nums; }
.jauge-texte b { font-family: var(--f-titre); font-size: 1.5rem; font-weight: 800; }

@keyframes pop { 0% { transform: scale(0.4); } 70% { transform: scale(1.18); } 100% { transform: scale(1); } }

/* ---------- Tableau de bord ---------- */
.banniere-pochette {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-radius: var(--rayon);
  background: var(--indice-fond);
  border: 2px solid var(--carton-jaune);
}
.tuiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tuile {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 16px;
  align-items: center;
  text-align: left;
  min-height: 120px;
  padding: 18px 20px;
  border-radius: var(--rayon);
  border: 2px solid var(--trait);
  background: var(--surface);
  box-shadow: var(--ombre);
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease;
}
.tuile:hover { transform: translateY(-2px); border-color: var(--pelouse-claire); }
.tuile-emoji {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--pelouse);
  font-size: 2rem;
}
.tuile-titre { font-family: var(--f-titre); font-weight: 800; font-size: 1.7rem; line-height: 1.05; }
.tuile-sous { color: var(--encre-douce); font-size: 0.95rem; }
.surligne {
  position: relative;
  z-index: 2;
  border-color: var(--carton-jaune);
  animation: halo 1.4s ease-in-out infinite;
}
@keyframes halo {
  0%, 100% { box-shadow: 0 0 0 4px var(--carton-jaune), var(--ombre); }
  50% { box-shadow: 0 0 0 10px rgba(255, 207, 46, 0.35), var(--ombre); }
}

/* ---------- Cahier (papier Seyès) ---------- */
.pile { display: grid; gap: 18px; }
.cahier, .consigne-ecole {
  display: grid;
  gap: 8px;
  padding: 16px 20px 18px 72px;
  border-radius: var(--rayon);
  background-color: var(--surface);
  background-image:
    linear-gradient(90deg, transparent 54px, var(--marge) 54px, var(--marge) 56px, transparent 56px),
    repeating-linear-gradient(180deg, transparent 0 31px, var(--seyes) 31px 32px),
    repeating-linear-gradient(180deg, transparent 0 7px, var(--seyes-fin) 7px 8px);
  box-shadow: var(--ombre);
  line-height: 32px;
}
.cahier-etiquette { font-size: 0.85rem; font-weight: 600; color: var(--encre-douce); letter-spacing: 0.02em; }
.cahier-titre { font-family: var(--f-cahier); font-weight: 400; font-size: 1.35rem; line-height: 48px; color: var(--encre); }
.cahier-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding-top: 8px; line-height: 1.4; }

/* ---------- Jeu ---------- */
.suivi-questions { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; }
.suivi-questions li {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid var(--trait);
  background: var(--surface);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.suivi-questions li.en-cours { border-color: var(--carton-jaune); box-shadow: 0 0 0 3px var(--carton-jaune); }
.suivi-questions li.juste { background: var(--succes-fond); border-color: var(--succes); }
.suivi-questions li.aide { background: var(--indice-fond); border-color: var(--carton-jaune-fonce); }
.suivi-questions li.rate { background: var(--erreur-fond); border-color: var(--erreur); }

.question {
  display: grid;
  gap: 16px;
  padding: 22px;
  border-radius: var(--rayon);
  background: var(--surface);
  box-shadow: var(--ombre);
}
.question-defi { border: 3px solid var(--carton-jaune); }
.intro { color: var(--encre-douce); }
.question-texte { font-size: 1.4rem; font-weight: 600; line-height: 1.35; }
.choix { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.btn-choix {
  min-height: 64px;
  padding: 10px 16px;
  border-radius: 14px;
  border: 2px solid var(--trait);
  background: var(--surface-2);
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-choix:hover:not([disabled]) { border-color: var(--pelouse-claire); }
.btn-choix[disabled] { cursor: default; }
.btn-choix.bonne { background: var(--succes-fond); border-color: var(--succes); color: var(--succes); }
.btn-choix.fausse { background: var(--erreur-fond); border-color: var(--erreur); color: var(--erreur); text-decoration: line-through; }
.retour { display: grid; gap: 8px; padding: 16px; border-radius: 12px; }
.retour button { justify-self: start; }
.retour-titre { font-weight: 600; font-size: 1.1rem; }
.retour-petit { font-size: 0.95rem; color: var(--encre-douce); }
.retour-ok { background: var(--succes-fond); }
.retour-indice { background: var(--indice-fond); }
.retour-rate { background: var(--erreur-fond); }

/* ---------- Résultat ---------- */
.score {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 18px;
  border-radius: var(--rayon);
  color: var(--craie);
  background-color: var(--pelouse);
  background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0 48px, transparent 48px 96px);
}
.score-etiquette { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.85rem; font-weight: 600; }
.score-chiffres { font-family: var(--f-titre); font-weight: 800; font-size: 4.5rem; line-height: 1; font-variant-numeric: tabular-nums; }
.score-detail { font-size: 0.95rem; }
.score-record { box-shadow: 0 0 0 4px var(--carton-jaune); }
.bilan, .points, .progression-globale, .bonus-etat, .confirmation, .explication-echange, .jauge-defis, .reinitialiser, .atelier, .defi {
  display: grid;
  gap: 12px;
  padding: 18px 20px;
  border-radius: var(--rayon);
  background: var(--surface);
  box-shadow: var(--ombre);
}
.bilan h2, .points h2, .explication-echange h2, .reinitialiser h2 { font-family: var(--f-titre); font-weight: 800; font-size: 1.6rem; }
.bilan-liste, .points-liste { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.bilan-ligne { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; }
.bilan-icone { font-size: 1.3rem; line-height: 1.4; }
.bilan-etat { color: var(--encre-douce); font-size: 0.9rem; }
.bilan-explication { color: var(--encre-douce); font-size: 0.95rem; }
.points-liste li, .points-total { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.points-total { border-top: 2px solid var(--trait); padding-top: 10px; font-size: 1.15rem; }
.points-total b { font-family: var(--f-titre); font-weight: 800; font-size: 1.6rem; }
.bonus-gagne {
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--indice-fond);
  border: 2px solid var(--carton-jaune);
  font-weight: 600;
}

/* ---------- Cartes de collection (charte validée le 3 octobre 2026) ----------
   Chaque carte montre « la zone » du joueur tracée à la craie sur le terrain,
   et sa matière dit sa catégorie : craie, cuivre, or, pierre, argent, prisme, cosmos. */
@property --angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.carte {
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 30%;
  position: relative;
  width: 250px;
  max-width: 100%;
  aspect-ratio: 5 / 7;
  container-type: inline-size;
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 250ms ease;
  border-radius: 6.5cqw;
  -webkit-tap-highlight-color: transparent;
}
.carte[role="button"] { cursor: pointer; }
.carte-inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 750ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.carte.retournee .carte-inner { transform: rotateY(180deg); }
.face {
  position: absolute;
  inset: 0;
  border-radius: 6.5cqw;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border: 2.6cqw solid transparent;
  background: var(--fond-carte) padding-box, var(--cadre) border-box;
  color: var(--texte);
  box-shadow: 0 3cqw 8cqw rgba(0, 0, 0, 0.35);
  text-align: left;
  line-height: 1.3;
}
.verso { transform: rotateY(180deg); background: var(--fond-verso) padding-box, var(--cadre) border-box; }
.matiere, .reflet, .zone { position: absolute; inset: 0; pointer-events: none; }
.zone { width: 100%; height: 100%; fill: none; stroke: var(--lignes); stroke-width: 0.7; }
.maillot {
  position: absolute; top: 9%; right: -3%;
  font-family: var(--f-titre); font-weight: 900; font-size: 64cqw; line-height: 0.8;
  color: transparent; -webkit-text-stroke: 0.7cqw var(--chiffre);
  letter-spacing: -0.02em; pointer-events: none;
}
.silhouette { position: absolute; left: 50%; bottom: 25%; width: 66%; translate: -50% 0; fill: var(--silhouette); }
.c-haut { position: absolute; top: 4%; left: 5%; right: 5%; display: flex; justify-content: space-between; align-items: center; gap: 2cqw; }
.c-badge { display: inline-flex; align-items: center; gap: 1.6cqw; padding: 1cqw 2.8cqw 1cqw 1.4cqw; border-radius: 99px; background: var(--badge-fond); color: var(--badge-texte); font-size: 4cqw; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; }
.c-badge b { font-weight: 600; }
.c-badge svg { width: 6.5cqw; height: 6.5cqw; fill: currentColor; }
.c-num { font-family: var(--f-titre); font-weight: 800; font-size: 6.5cqw; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.c-num small { font-size: 4.2cqw; opacity: 0.75; }
.c-plaque { position: absolute; left: 5%; right: 5%; bottom: 14.5%; display: grid; padding: 2cqw 3.5cqw; border-radius: 3cqw; background: var(--plaque); }
.c-prenom { font-size: 4.6cqw; font-weight: 500; opacity: 0.9; line-height: 1.1; }
.c-nom { font-family: var(--f-titre); font-weight: 900; font-size: 13cqw; line-height: 0.95; text-transform: uppercase; letter-spacing: 0.01em; overflow-wrap: anywhere; }
.c-infos { position: absolute; left: 5%; right: 5%; bottom: 7.2%; display: flex; gap: 1.6cqw; }
.c-infos span { padding: 0.8cqw 2.4cqw; border-radius: 99px; background: var(--puce); font-size: 3.8cqw; font-weight: 500; white-space: nowrap; }
.c-pied { position: absolute; left: 5%; right: 5%; bottom: 2.2%; display: flex; justify-content: space-between; font-size: 3cqw; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.75; }
.reflet { background: radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, 0.5), transparent 42%); mix-blend-mode: soft-light; opacity: 0; transition: opacity 300ms; }
.carte:hover .reflet, .carte:focus-visible .reflet { opacity: 1; }

/* Verso commun */
.v-motif { position: absolute; inset: 0; pointer-events: none; background:
  radial-gradient(circle at 50% 46%, transparent 18cqw, var(--lignes) 18.3cqw, transparent 18.8cqw),
  linear-gradient(var(--lignes), var(--lignes)) 50% 46% / 100% 0.5cqw no-repeat; opacity: 0.6; }
.v-mfc { position: absolute; left: 50%; top: 46%; translate: -50% -50%; font-family: var(--f-titre); font-weight: 900; font-size: 22cqw; color: transparent; -webkit-text-stroke: 0.5cqw var(--lignes); opacity: 0.35; }
.v-contenu { position: absolute; inset: 4.5% 6%; display: grid; align-content: space-between; gap: 2cqw; }
.v-tete { display: flex; justify-content: space-between; align-items: center; font-size: 4cqw; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.v-fiche { margin: 0; display: grid; gap: 0.5cqw; padding: 3cqw; border-radius: 3cqw; background: var(--plaque); font-size: 3.6cqw; line-height: 1.25; }
.v-fiche div { display: flex; justify-content: space-between; gap: 2cqw; }
.v-fiche dt { opacity: 0.75; }
.v-fiche dd { margin: 0; font-weight: 600; text-align: right; }
.v-note { padding: 2.4cqw 3cqw; border-radius: 3cqw; background: var(--plaque); font-size: 3.5cqw; line-height: 1.35; }
.v-note b { display: block; font-size: 3.2cqw; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.v-credit { font-size: 2.8cqw; opacity: 0.7; text-align: center; }

/* Matières par catégorie */
.carte[data-cat="classique"] {
  --fond-carte: linear-gradient(172deg, #208049 0%, #17643a 55%, #0f4a2a 100%);
  --fond-verso: linear-gradient(172deg, #17643a, #0f4a2a);
  --cadre: linear-gradient(160deg, #ffffff, #dfe7e1 60%, #ffffff);
  --texte: #ffffff; --lignes: rgba(255, 255, 255, 0.55); --chiffre: rgba(255, 255, 255, 0.3);
  --silhouette: rgba(255, 255, 255, 0.16); --plaque: rgba(6, 34, 18, 0.55); --puce: rgba(255, 255, 255, 0.16);
  --badge-fond: #ffffff; --badge-texte: #145a33; --accent: #bff0cf;
}
.carte[data-cat="classique"] .matiere { background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0 9cqw, transparent 9cqw 18cqw); }

.carte[data-cat="brassard"] {
  --fond-carte: linear-gradient(165deg, #2d1a12 0%, #5e301c 50%, #23130c 100%);
  --fond-verso: linear-gradient(165deg, #3a2115, #1f110a);
  --cadre: linear-gradient(135deg, #f8cba8, #b8663b 28%, #ffe3cc 50%, #9a4f2a 74%, #eaa97e);
  --texte: #fff4ec; --lignes: rgba(243, 179, 138, 0.5); --chiffre: rgba(243, 179, 138, 0.38);
  --silhouette: rgba(243, 179, 138, 0.18); --plaque: rgba(26, 12, 6, 0.6); --puce: rgba(243, 179, 138, 0.2);
  --badge-fond: linear-gradient(135deg, #f8cba8, #c0744a); --badge-texte: #3a1a0b; --accent: #f3b38a;
}
.carte[data-cat="brassard"] .matiere { background: linear-gradient(118deg, transparent 40%, rgba(243, 179, 138, 0.2) 40% 47%, rgba(243, 179, 138, 0.32) 47% 53%, rgba(243, 179, 138, 0.2) 53% 60%, transparent 60%); }

.carte[data-cat="crack"] {
  --fond-carte: radial-gradient(ellipse 80% 55% at 50% -12%, rgba(255, 222, 140, 0.55), transparent 70%), linear-gradient(180deg, #0c1834, #070d1f);
  --fond-verso: linear-gradient(180deg, #0c1834, #070d1f);
  --cadre: linear-gradient(135deg, #fff2bd, #d4a02b 24%, #fff7d6 44%, #b37f19 68%, #f8db7d);
  --texte: #fff8e6; --lignes: rgba(247, 211, 107, 0.45); --chiffre: rgba(247, 211, 107, 0.45);
  --silhouette: rgba(255, 228, 160, 0.17); --plaque: rgba(3, 7, 20, 0.6); --puce: rgba(247, 211, 107, 0.2);
  --badge-fond: linear-gradient(135deg, #fff2bd, #d4a02b); --badge-texte: #2b1d00; --accent: #f7d36b;
}
.carte[data-cat="crack"] .matiere {
  background: repeating-conic-gradient(from 150deg at 50% -18%, rgba(255, 214, 120, 0.13) 0deg 3deg, transparent 3deg 10deg);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 75%); mask-image: linear-gradient(180deg, #000 0%, transparent 75%);
}

.carte[data-cat="totem"] {
  --fond-carte: linear-gradient(180deg, #27372f, #18231e);
  --fond-verso: linear-gradient(180deg, #27372f, #18231e);
  --cadre: linear-gradient(135deg, #d3bf86, #7c6b3f 32%, #ebdcae 52%, #6a5a32 76%, #c7b277);
  --texte: #f3ecd6; --lignes: rgba(216, 198, 144, 0.42); --chiffre: rgba(216, 198, 144, 0.4);
  --silhouette: rgba(216, 198, 144, 0.16); --plaque: rgba(10, 16, 12, 0.6); --puce: rgba(216, 198, 144, 0.18);
  --badge-fond: linear-gradient(135deg, #ebdcae, #a8945a); --badge-texte: #262010; --accent: #d8c690;
}
.carte[data-cat="totem"] .matiere {
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0 1.2cqw, transparent 1.2cqw 7cqw),
    repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.22) 0 1.2cqw, transparent 1.2cqw 7cqw);
  -webkit-mask-image: linear-gradient(90deg, transparent 4%, #000 22%, #000 78%, transparent 96%); mask-image: linear-gradient(90deg, transparent 4%, #000 22%, #000 78%, transparent 96%);
}

.carte[data-cat="limitee"] {
  --serie: #4aa7e0;
  --fond-carte: linear-gradient(160deg, #e7ecf0 0%, #b3bcc4 42%, #f2f5f7 58%, #95a0aa 100%);
  --fond-verso: linear-gradient(160deg, #dfe5ea, #a3adb6);
  --cadre: linear-gradient(135deg, #ffffff, #9aa5af 34%, #f6f8f9 54%, #7f8a95 78%, #e3e8ec);
  --texte: #14212f; --lignes: rgba(20, 33, 47, 0.25); --chiffre: rgba(20, 33, 47, 0.18);
  --silhouette: rgba(20, 33, 47, 0.13); --plaque: rgba(255, 255, 255, 0.62); --puce: rgba(20, 33, 47, 0.1);
  --badge-fond: var(--serie); --badge-texte: #ffffff; --accent: #1f6fa3;
}
.carte[data-cat="limitee"] .matiere {
  background:
    linear-gradient(180deg, var(--serie) 0 0) 0 26% / 100% 2.2cqw no-repeat,
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.3) 0 0.4cqw, rgba(0, 0, 0, 0.03) 0.4cqw 1.2cqw);
}

.carte[data-cat="diamant"] {
  --fond-carte: linear-gradient(160deg, #0c2b3b, #1a1140);
  --fond-verso: linear-gradient(160deg, #0c2b3b, #1a1140);
  --cadre: conic-gradient(from var(--angle), #8ff3ff, #b38bff, #ff9de1, #ffe48a, #8ff3ff);
  --texte: #f1fbff; --lignes: rgba(170, 236, 255, 0.45); --chiffre: rgba(170, 236, 255, 0.42);
  --silhouette: rgba(200, 240, 255, 0.16); --plaque: rgba(6, 10, 30, 0.58); --puce: rgba(170, 236, 255, 0.16);
  --badge-fond: linear-gradient(135deg, #8ff3ff, #b38bff, #ff9de1); --badge-texte: #10142e; --accent: #9ff0ff;
  animation: tourne 6s linear infinite;
}
.carte[data-cat="diamant"] .matiere {
  background:
    linear-gradient(115deg, transparent 18%, rgba(143, 243, 255, 0.28) 34%, rgba(179, 139, 255, 0.3) 46%, rgba(255, 157, 225, 0.28) 58%, rgba(255, 228, 138, 0.22) 70%, transparent 84%) calc(var(--mx) * 1) 0 / 220% 100%,
    conic-gradient(from 45deg at 30% 28%, rgba(255, 255, 255, 0.07) 0 25%, transparent 25% 50%, rgba(255, 255, 255, 0.05) 50% 75%, transparent 75%);
  mix-blend-mode: screen;
}

.carte[data-cat="supernova"] {
  --fond-carte:
    radial-gradient(circle at 50% 36%, rgba(255, 214, 250, 0.6), rgba(150, 80, 255, 0.28) 24%, transparent 52%),
    radial-gradient(circle at 82% 88%, rgba(80, 200, 255, 0.3), transparent 38%),
    radial-gradient(circle at 12% 70%, rgba(255, 120, 180, 0.22), transparent 34%),
    linear-gradient(180deg, #08041a, #140a2b);
  --fond-verso: linear-gradient(180deg, #120830, #07031a);
  --cadre: conic-gradient(from var(--angle), #ff9de1, #8ff3ff, #ffe48a, #c49bff, #ff9de1);
  --texte: #fff4fd; --lignes: rgba(255, 214, 246, 0.42); --chiffre: rgba(255, 214, 246, 0.45);
  --silhouette: rgba(255, 230, 250, 0.18); --plaque: rgba(10, 4, 26, 0.55); --puce: rgba(255, 214, 246, 0.17);
  --badge-fond: linear-gradient(135deg, #ff9de1, #c49bff, #8ff3ff); --badge-texte: #1a0a2e; --accent: #ffc6f1;
  animation: tourne 4s linear infinite;
}
.carte[data-cat="supernova"] .face { box-shadow: 0 0 6cqw rgba(214, 140, 255, 0.55), 0 3cqw 8cqw rgba(0, 0, 0, 0.4); }
.carte[data-cat="supernova"] .matiere {
  background:
    radial-gradient(0.7cqw 0.7cqw at 18% 22%, #fff, transparent),
    radial-gradient(0.5cqw 0.5cqw at 72% 14%, #fff, transparent),
    radial-gradient(0.6cqw 0.6cqw at 86% 42%, #fff, transparent),
    radial-gradient(0.5cqw 0.5cqw at 30% 58%, #fff, transparent),
    radial-gradient(0.8cqw 0.8cqw at 64% 66%, #fff, transparent),
    radial-gradient(0.5cqw 0.5cqw at 10% 88%, #fff, transparent),
    radial-gradient(0.6cqw 0.6cqw at 48% 8%, #fff, transparent);
  animation: scintille 2.6s ease-in-out infinite;
}
@keyframes tourne { to { --angle: 360deg; } }
@keyframes scintille { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

/* Petites cartes collées dans l'album */
.carte.mini { width: 100%; }
.carte.mini .face { box-shadow: 0 1.5cqw 4cqw rgba(0, 0, 0, 0.35); }
.carte.mini.cliquable:hover { transform: translateY(-4%); }
.carte.mini.nouvelle { animation: halo-carte 1.6s ease-in-out infinite, tourne 6s linear infinite; }
@keyframes halo-carte { 0%, 100% { filter: drop-shadow(0 0 0 rgba(255, 207, 46, 0)); } 50% { filter: drop-shadow(0 0 7px rgba(255, 207, 46, 0.95)); } }

/* Pastilles de catégorie (légendes de l'album) */
.pastille-cat { display: block; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15); }
.pastille-cat[data-cat="classique"] { background: linear-gradient(170deg, #208049, #0f4a2a); }
.pastille-cat[data-cat="brassard"] { background: linear-gradient(135deg, #f8cba8, #b8663b, #ffe3cc); }
.pastille-cat[data-cat="crack"] { background: linear-gradient(135deg, #fff2bd, #d4a02b, #fff7d6); }
.pastille-cat[data-cat="totem"] { background: linear-gradient(135deg, #ebdcae, #7c6b3f, #d3bf86); }
.pastille-cat[data-cat="limitee"] { background: linear-gradient(135deg, #ffffff, #9aa5af, #4aa7e0); }
.pastille-cat[data-cat="diamant"] { background: linear-gradient(135deg, #8ff3ff, #b38bff, #ff9de1, #ffe48a); }
.pastille-cat[data-cat="supernova"] { background: linear-gradient(180deg, #140a2b, #c49bff, #ff9de1); }

/* ---------- Album ---------- */
.pages-clubs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.page-club {
  display: grid;
  gap: 6px;
  text-align: left;
  padding: 16px 18px;
  border-radius: var(--rayon);
  border: 2px solid var(--trait);
  background: var(--surface);
  cursor: pointer;
}
.page-club:hover { border-color: var(--pelouse-claire); }
.page-club-nom { font-family: var(--f-titre); font-weight: 800; font-size: 1.5rem; line-height: 1.05; }
.page-club-ville { color: var(--encre-douce); font-size: 0.9rem; }
.page-club-compte { font-weight: 600; font-variant-numeric: tabular-nums; }
.barre { height: 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--trait); overflow: hidden; }
.barre-remplie { display: block; height: 100%; background: var(--pelouse-claire); border-radius: 999px; transition: width 500ms ease; }
.progression-club { display: grid; gap: 8px; }
.compteur-club {
  justify-self: start;
  padding: 10px 18px;
  border-radius: 12px;
  background: var(--indice-fond);
  border: 2px solid var(--carton-jaune);
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
}
.compteur-avant { color: var(--encre-douce); text-decoration: line-through; }
.compteur-apres { font-family: var(--f-titre); font-size: 1.6rem; font-weight: 800; animation: pop 600ms ease-out 300ms both; display: inline-block; }
/* Page de club : les 6 cases posées sur un terrain (attaque en haut, défense en bas) */
.terrain-cadre { container-type: inline-size; width: 100%; max-width: 560px; margin-inline: auto; }
.terrain {
  position: absolute; inset: 6% 6% 8%;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: 1fr 1fr;
  gap: 4cqw 3.4cqw; padding: 5cqw 4cqw; border-radius: 3cqw;
  background:
    linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.5)) 50% 50% / 100% 0.4cqw no-repeat,
    radial-gradient(circle at 50% 50%, transparent 11cqw, rgba(255, 255, 255, 0.5) 11.2cqw, transparent 11.6cqw),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0 8cqw, transparent 8cqw 16cqw),
    linear-gradient(180deg, #1f7a46, #155a34);
  box-shadow: inset 0 0 0 0.5cqw rgba(255, 255, 255, 0.55);
}
.terrain.terrain-ecran { position: relative; inset: auto; grid-template-rows: auto auto; }
.case { container-type: inline-size; align-self: center; display: grid; gap: 1.2cqw; justify-items: center; min-width: 0; }
.case-legende { font-size: 9cqw; font-weight: 600; line-height: 1.2; color: #ffffff; letter-spacing: 0.06em; text-transform: uppercase; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }
.case-vide {
  --cat: rgba(255, 255, 255, 0.7);
  width: 100%; aspect-ratio: 5 / 7; border-radius: 6.5cqw;
  display: grid; place-content: center; justify-items: center; gap: 2cqw;
  border: 1.6cqw dashed var(--cat);
  background: rgba(255, 255, 255, 0.07); color: #ffffff; text-align: center; line-height: 1.1;
}
.case-vide[data-cat="brassard"] { --cat: #f3b38a; }
.case-vide[data-cat="crack"] { --cat: #f7d36b; }
.case-vide .q { font-family: var(--f-titre); font-weight: 900; font-size: 30cqw; line-height: 0.8; opacity: 0.85; }
.case-vide .n { font-family: var(--f-titre); font-weight: 800; font-size: 13cqw; font-variant-numeric: tabular-nums; }
.case-vide .c { font-size: 8.5cqw; letter-spacing: 0.08em; text-transform: uppercase; }
.page-complete { font-family: var(--f-titre); font-weight: 800; font-size: 1.8rem; text-align: center; }

/* ---------- 📖 L'album à feuilleter ---------- */
.livre { display: grid; gap: 12px; }
.livre-barre { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.titre-livre { font-size: clamp(1.7rem, 4vw, 2.3rem); }
.livre-compte { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--encre-douce); }
.livre-nav { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px 16px; }
.livre-position { min-width: 16ch; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--encre-douce); }
.livre-aide { text-align: center; }
.btn[disabled] { opacity: 0.4; cursor: default; transform: none; }
.livre-scene { perspective: 2400px; }
.livre-pages {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(100%, max(640px, calc((100vh - 290px) / 1.38 * 2 + 24px)));
  width: min(100%, max(640px, calc((100svh - 290px) / 1.38 * 2 + 24px)));
  margin-inline: auto;
  padding: 12px;
  border-radius: 14px;
  background: linear-gradient(90deg, #0f2a1b, #164029 49.5%, #0a1f13 50%, #164029 50.5%, #0f2a1b);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
  touch-action: pan-y;
}
.livre-pages:focus-visible { outline-offset: 6px; }
.page, .f {
  position: relative;
  aspect-ratio: 1 / 1.38;
  container-type: inline-size;
  overflow: hidden;
  color: #1b2a3d;
  line-height: 1.35;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.6), transparent 60%),
    linear-gradient(180deg, #fbfcf8, #f2f5ee);
}
.page.gauche { border-radius: 8px 0 0 8px; box-shadow: inset -26px 0 30px -26px rgba(0, 0, 0, 0.45); }
.page.droite { border-radius: 0 8px 8px 0; box-shadow: inset 26px 0 30px -26px rgba(0, 0, 0, 0.45); }
.page-contenu { position: absolute; inset: 0; }
.feuille {
  position: absolute; top: 12px; bottom: 12px; left: 50%; width: calc(50% - 12px);
  transform-origin: left center; transform-style: preserve-3d;
  transition: transform 950ms cubic-bezier(0.32, 0.7, 0.2, 1);
  z-index: 5; display: none;
}
.feuille .f { position: absolute; inset: 0; aspect-ratio: auto; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.feuille .f-recto { border-radius: 0 8px 8px 0; }
.feuille .f-verso { transform: rotateY(180deg); border-radius: 8px 0 0 8px; }

/* Contenu des pages (tailles relatives à la largeur de la page) */
.p { position: absolute; inset: 7% 8%; display: grid; align-content: start; gap: 2.6cqw; }
.p-sur { font-size: 2.8cqw; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: #17683c; }
.p-titre { font-family: var(--f-titre); font-weight: 900; font-size: 9cqw; line-height: 0.95; text-transform: uppercase; }
.p-texte { font-size: 3.3cqw; line-height: 1.45; color: #3c4b5e; }
.p-numero { position: absolute; bottom: 3%; font-size: 2.6cqw; color: #7d8a99; font-variant-numeric: tabular-nums; }
.gauche .p-numero, .f-verso .p-numero { left: 8%; }
.droite .p-numero, .f-recto .p-numero { right: 8%; }
.garde { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 3cqw; padding: 8cqw; text-align: center; color: #ffffff;
  background: radial-gradient(ellipse at 50% -10%, rgba(255, 255, 255, 0.22), transparent 60%), linear-gradient(180deg, #0b2416, #17683c); }
.garde .embleme { width: 34cqw; }
.garde .p-titre { font-size: 11cqw; color: #ffffff; }
.garde .p-texte { color: #cfe0d5; }
.garde .garde-sur { color: #ffcf2e; }
.garde .proprio { font-size: 3.6cqw; padding: 1.6cqw 4cqw; border: 0.4cqw solid rgba(255, 255, 255, 0.5); border-radius: 99px; }
.legende { display: grid; gap: 1.6cqw; }
.legende div { display: grid; grid-template-columns: 7cqw 1fr auto; align-items: center; gap: 2.4cqw; font-size: 3.2cqw; }
.legende i { width: 7cqw; height: 7cqw; border-radius: 1.6cqw; }
.legende span:last-child { color: #4f5d6e; font-variant-numeric: tabular-nums; }
/* Sommaire interactif : les pages spéciales (Totem, Série limitée, Diamant, Supernova) sont des liens cliquables. */
.legende-speciale { gap: 0.6cqw; }
.legende-lien {
  display: grid; grid-template-columns: 7cqw 1fr auto; align-items: center; gap: 2.4cqw;
  width: 100%; padding: 1.4cqw 1.2cqw; border: 0; border-radius: 1.6cqw;
  background: none; color: inherit; font: inherit; font-size: 3.2cqw; text-align: left; cursor: pointer;
}
.legende-lien:hover { background: rgba(23, 104, 60, 0.07); }
.legende-lien:hover span:nth-child(2) { text-decoration: underline; text-underline-offset: 0.6cqw; }
.liste-clubs { display: grid; gap: 0.6cqw; }
.ligne-club {
  display: grid; grid-template-columns: 5cqw 1fr auto; gap: 2cqw; align-items: center;
  padding: 1.6cqw 0; border: 0; border-bottom: 0.25cqw solid #e1e7e2; border-radius: 0;
  background: none; color: inherit; font-size: 3.6cqw; text-align: left; cursor: pointer;
}
.ligne-club:hover span:nth-child(2) { text-decoration: underline; text-underline-offset: 0.6cqw; }
.ligne-club b { color: #17683c; font-variant-numeric: tabular-nums; }
.ligne-club span:last-child { font-variant-numeric: tabular-nums; color: #3c4b5e; }
.club-tete { display: grid; gap: 2cqw; }
.club-progres { display: flex; align-items: center; gap: 3cqw; font-size: 3.4cqw; }
.club-progres b { font-family: var(--f-titre); font-weight: 900; font-size: 7cqw; font-variant-numeric: tabular-nums; }
.jauge-club { flex: 1; height: 2.4cqw; border-radius: 99px; background: #dfe7e1; overflow: hidden; }
.jauge-club i { display: block; height: 100%; background: #17683c; }
.tampon { justify-self: start; padding: 1.4cqw 3.6cqw; border-radius: 2cqw; border: 0.6cqw dashed #b9c6bd; color: #5d6b7c; font-size: 3cqw; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; rotate: -4deg; }
.tampon.tampon-ok { border-style: solid; border-color: #17683c; color: #17683c; }

/* Pages spéciales : cases sur papier clair */
.p .case-legende { color: #1b2a3d; text-shadow: none; }
.mur { display: grid; grid-template-columns: repeat(2, minmax(0, 27cqw)); justify-content: center; gap: 3cqw 6cqw; }
.pochette-doublons .case-legende { font-size: 11cqw; }
.liste-cartes { display: grid; gap: 0.4cqw; margin-top: 1cqw; }
.ligne-carte { display: grid; grid-template-columns: 4.6cqw 13cqw 1fr auto; align-items: center; gap: 2cqw; padding-block: 1.1cqw; border-bottom: 0.25cqw solid #e1e7e2; font-size: 3.2cqw; color: #6a7889; }
.ligne-carte .pastille-cat { width: 4.6cqw; height: 4.6cqw; border-radius: 1.2cqw; }
.ligne-carte span:nth-child(2) { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ligne-carte.ok { color: #1b2a3d; font-weight: 500; }
.ligne-carte .coche { font-weight: 700; }
.ligne-carte.ok .coche { color: #17683c; }
.mur .case-vide, .vitrine .case-vide { --cat: #bda86c; color: #6a5a32; background: rgba(189, 168, 108, 0.08); }
.vitrine { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3cqw; }
.vitrine .case-vide[data-cat="limitee"] { --cat: #4aa7e0; color: #1f6fa3; background: rgba(74, 167, 224, 0.08); }
.vitrine-une { grid-template-columns: minmax(0, 0.56fr); justify-content: center; }
.verrou {
  container-type: inline-size; aspect-ratio: 5 / 7; border-radius: 6.5cqw; display: grid; place-content: center; justify-items: center; gap: 4cqw; text-align: center;
  color: #ffffff; padding: 6cqw;
  background: linear-gradient(160deg, rgba(143, 243, 255, 0.35), rgba(179, 139, 255, 0.35), rgba(255, 157, 225, 0.3)), #22264a;
  box-shadow: inset 0 0 0 1.2cqw rgba(255, 255, 255, 0.3);
}
.verrou svg { width: 34cqw; fill: rgba(255, 255, 255, 0.85); }
.verrou span { font-size: 9cqw; line-height: 1.25; }
.nuit { position: absolute; inset: 0; background: radial-gradient(circle at 50% 30%, rgba(196, 155, 255, 0.4), transparent 50%), linear-gradient(180deg, #0a0520, #160b33); color: #ffffff; }
.nuit .p-titre { color: #ffffff; }
.nuit .p-sur { color: #ffc6f1; }
.nuit .p-texte { color: #d9cdf2; }
.nuit .verrou { background: linear-gradient(160deg, rgba(255, 157, 225, 0.4), rgba(143, 243, 255, 0.3)), #1c1040; }
.pochette-doublons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3cqw; padding: 4cqw; border-radius: 3cqw; background: #e8ede6; box-shadow: inset 0 1.2cqw 2cqw rgba(0, 0, 0, 0.12); }
.bonus-ligne { display: flex; gap: 2cqw; align-items: center; font-size: 3.2cqw; font-weight: 600; padding: 2cqw 3cqw; border-radius: 2cqw; background: #fff3c4; color: #2a2000; }

/* ---------- Doublons et Bonus Échange ---------- */
.bonus-etat { grid-template-columns: auto 1fr; align-items: center; column-gap: 18px; }
.bonus-nombre { font-family: var(--f-titre); font-weight: 800; font-size: 2.6rem; line-height: 1; }
.grille-doublons { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.doublon {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: var(--rayon);
  border: 3px solid transparent;
  background: none;
  cursor: pointer;
}
.doublon.choisi { border-color: var(--carton-jaune); background: var(--indice-fond); }
.doublon-nb { font-weight: 600; }
.confirmation { border: 3px solid var(--carton-jaune); }
.explication-echange ol { margin: 0; padding-left: 1.4em; display: grid; gap: 4px; }
.vide { color: var(--encre-douce); }

/* ---------- Défis libres ---------- */
.matieres { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-matiere {
  min-height: 52px;
  padding: 8px 20px;
  border-radius: 999px;
  border: 2px solid var(--trait);
  background: var(--surface);
  font-weight: 600;
  cursor: pointer;
}
.btn-matiere.choisie { background: var(--pelouse); border-color: var(--pelouse); color: var(--craie); }
.liste-defis { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.defi { align-content: start; }
.defi-theme { font-family: var(--f-titre); font-weight: 800; font-size: 1.7rem; line-height: 1.05; }
.defi-niveau { color: var(--encre-douce); font-weight: 600; }
.defi-infos { display: grid; gap: 6px; margin: 0; }
.defi-infos div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--trait); padding-bottom: 6px; }
.defi-infos dt { color: var(--encre-douce); }
.defi-infos dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.defi .btn { justify-self: start; }

/* ---------- Atelier ---------- */
.atelier h3 { font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--encre-douce); }
.atelier ul, .atelier ol { margin: 0; padding-left: 1.4em; display: grid; gap: 4px; }
.atelier-theme { color: var(--encre-douce); font-weight: 600; }
.atelier-titre { font-family: var(--f-titre); font-weight: 800; font-size: 2.1rem; line-height: 1.05; }
.atelier-enigme { padding: 12px 16px; border-radius: 12px; background: var(--indice-fond); font-weight: 600; }
.atelier-explication summary { cursor: pointer; font-weight: 600; }
.atelier-explication p { margin-top: 8px; }

/* ---------- Espace parents ---------- */
.outils { display: grid; gap: 12px; }
.outil {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--rayon);
  background: var(--surface);
  border: 1px solid var(--trait);
}
.outil-titre { font-weight: 600; }
.outil-detail { color: var(--encre-douce); font-size: 0.92rem; max-width: 60ch; }
.pied {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 20px;
  padding-top: 16px;
  border-top: 1px solid var(--trait);
  color: var(--encre-douce);
  font-size: 0.9rem;
}
/* Version réellement servie, discrète, sous la page de connexion (PC / téléphone / iPad). */
.pied-connexion { justify-content: center; margin-top: 6px; }
.version-app { color: var(--texte-doux, #7a8a82); font-size: 0.82rem; opacity: 0.85; }

/* ---------- Pochette, révélation, loterie ---------- */
.voile {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 18px;
  padding: calc(24px + env(safe-area-inset-top, 0px)) 16px calc(24px + env(safe-area-inset-bottom, 0px));
  background: var(--voile);
  color: #ffffff;
  text-align: center;
  overflow-y: auto;
}
.revelation-titre { font-family: var(--f-titre); font-weight: 800; font-size: clamp(2.2rem, 7vw, 3.4rem); line-height: 1.05; }
/* Célébration « nouvelle carte » : lueur dorée + carte mise en avant. */
.voile.celebration { background: radial-gradient(circle at 50% 38%, rgba(228,192,75,0.28), var(--voile) 62%); }
.voile.celebration .revelation-scene { width: min(300px, 80vw); animation: carte-trophee 0.9s ease-out; }
@keyframes carte-trophee { 0% { transform: scale(0.4) rotate(-12deg); opacity: 0; } 60% { transform: scale(1.12) rotate(4deg); } 100% { transform: scale(1) rotate(0); opacity: 1; } }
.confettis { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; }
.confettis i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; opacity: 0.9; animation: confetti-chute 2.4s linear forwards; }
@keyframes confetti-chute { to { transform: translateY(102vh) rotate(540deg); opacity: 0; } }
/* Zoom + déplacement (carte et album) : fonctionne souris + tactile. */
.voile-zoom { gap: 12px; }
.zoom-cadre { position: relative; width: min(92vw, 520px); height: min(70vh, 640px); overflow: hidden; border-radius: 14px; background: rgba(0,0,0,0.25); touch-action: none; cursor: grab; }
.zoom-cadre.zoome { cursor: grab; }
.zoom-surface { width: 100%; height: 100%; display: grid; place-items: center; transform-origin: center center; will-change: transform; }
.zoom-surface .carte { width: min(80%, 320px); }
/* Une face seule de carte, à plat (recto ou verso) pour un zoom net sans rotation 3D. */
.carte-face { position: relative; width: min(80%, 320px); aspect-ratio: 5 / 7; }
.carte-face .face { position: absolute; inset: 0; transform: none; backface-visibility: visible; -webkit-backface-visibility: visible; }
.zoom-hote { display: contents; }
.zoom-barre-hote { display: inline-flex; }
.zoom-surface .spread-zoom { display: flex; gap: 6px; transform: scale(0.98); }
.zoom-surface .spread-zoom .page-contenu { width: 240px; }
.zoom-barre { display: inline-flex; gap: 8px; }
@media (prefers-reduced-motion: reduce) { .voile.celebration .revelation-scene { animation: none; } .confettis { display: none; } }
.revelation-scene { width: min(250px, 70vw); display: grid; justify-items: center; perspective: 900px; }
.revelation-scene .carte { width: 100%; }
.revelation-scene.scene-fiche { width: min(300px, 76vw); }
.revelation-statut { display: grid; gap: 4px; font-size: 1.1rem; min-height: 2.4em; }
.revelation-detail { font-size: 0.95rem; color: #d5e6db; }
.revelation-remise { color: #d5e6db; }
.revelation-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; min-height: 64px; }
.etiquette-nouvelle, .etiquette-doublon {
  font-family: var(--f-titre);
  font-weight: 800;
  font-size: 1.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.etiquette-nouvelle { color: #ffcf2e; }
.etiquette-doublon { color: #9fd7b4; }

.pochette {
  width: min(220px, 62vw);
  aspect-ratio: 5 / 7;
  border-radius: 18px;
  border: 0;
  cursor: pointer;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  color: #17351f;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.65) 0%, rgba(255, 255, 255, 0) 35%, rgba(255, 255, 255, 0.45) 55%, rgba(255, 255, 255, 0) 75%),
    linear-gradient(160deg, #ffe27a, #ffcf2e 45%, #e6a800);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45), inset 0 0 0 4px rgba(255, 255, 255, 0.5);
  animation: secousse 1.1s ease-in-out infinite;
}
.pochette-statique { animation: none; justify-self: center; cursor: default; }
.pochette-objectif {
  color: #10142e;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0) 35%, rgba(255, 255, 255, 0.45) 55%, rgba(255, 255, 255, 0) 75%),
    linear-gradient(160deg, #8ff3ff, #b38bff 50%, #ff9de1);
}
.pochette-marque { font-family: var(--f-titre); font-weight: 800; font-size: 1.7rem; text-transform: uppercase; letter-spacing: 0.06em; }
.pochette-ballon { font-size: 3.4rem; }
.pochette-mot { font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; font-size: 0.85rem; }
.pochette.ouverte { animation: dechirer 1s ease-in forwards; }
@keyframes secousse {
  0%, 60%, 100% { transform: rotate(0); }
  70% { transform: rotate(-4deg) scale(1.03); }
  80% { transform: rotate(4deg) scale(1.03); }
  90% { transform: rotate(-2deg); }
}
@keyframes dechirer {
  0% { transform: scale(1); filter: brightness(1); }
  40% { transform: scale(1.08) rotate(-3deg); filter: brightness(1.4); }
  100% { transform: scale(0.2) rotate(12deg) translateY(-60px); opacity: 0; filter: brightness(2); }
}
.carte.a-reveler { transform: rotateY(90deg) scale(0.8); transition: transform 700ms cubic-bezier(0.2, 0.9, 0.3, 1.2); }
.carte.a-reveler.revelee { transform: rotateY(0) scale(1); }
.loterie-defile {
  width: 100%;
  min-height: 120px;
  display: grid;
  place-items: center;
  padding: 16px;
  border-radius: 16px;
  border: 3px dashed #ffcf2e;
  font-family: var(--f-titre);
  font-weight: 800;
  font-size: 1.6rem;
  line-height: 1.1;
}

/* ---------- Mode démonstration (bulle du guide) ---------- */
.bulle-guide {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 40;
  width: min(720px, calc(100% - 32px));
  display: grid;
  gap: 12px;
  padding: 18px 20px;
  border-radius: 20px;
  color: #ffffff;
  background: #10301d;
  border: 3px solid #ffcf2e;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}
.bulle-points { display: flex; gap: 6px; }
.bulle-points span { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.25); }
.bulle-points span.fait { background: #9fd7b4; }
.bulle-points span.actif { background: #ffcf2e; }
.bulle-texte { font-size: 1.12rem; font-weight: 500; }
.bulle-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.lien-clair { color: #d5e6db; }
.gagne, .fin-guide { display: grid; justify-items: center; gap: 24px; padding-block: 24px; text-align: center; }

/* ---------- Message temporaire ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 60;
  max-width: calc(100% - 32px);
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--encre);
  color: var(--fond);
  font-weight: 600;
  box-shadow: var(--ombre);
}

/* ---------- Petits écrans ---------- */
@media (max-width: 640px) {
  body { font-size: 17px; }
  .tuiles, .pages-clubs { grid-template-columns: 1fr; }
  .tuile { min-height: 96px; }
  .tuile-emoji { width: 54px; height: 54px; font-size: 1.7rem; }
  .tuile-titre { font-size: 1.45rem; }
  .cahier, .consigne-ecole { padding-left: 52px; background-image:
    linear-gradient(90deg, transparent 38px, var(--marge) 38px, var(--marge) 40px, transparent 40px),
    repeating-linear-gradient(180deg, transparent 0 31px, var(--seyes) 31px 32px),
    repeating-linear-gradient(180deg, transparent 0 7px, var(--seyes-fin) 7px 8px); }
  .score-chiffres { font-size: 3.6rem; }
  .bonus-etat { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .livre-pages { grid-template-columns: 1fr; gap: 10px; width: 100%; background: #0f2a1b; }
  .page.gauche, .page.droite { border-radius: 8px; box-shadow: none; }
  .feuille { display: none !important; }
  .livre-compte { margin-left: 0; }
}
@media (max-width: 480px) {
  .nav-texte { display: none; }
  .livre-nav .btn { min-width: 56px; font-size: 1.2rem; }
  .livre-position { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .ballon.nouveau { animation: none; }
}

/* =====================================================================
   Application finale : connexion, espace parents, entraînements, challenges
   ===================================================================== */
.chargement { color: var(--encre-douce); font-weight: 500; }
.message-erreur { color: var(--erreur); font-weight: 600; min-height: 1.4em; }
.btn-clair { background: rgba(255, 255, 255, 0.16); color: var(--craie); border-color: rgba(255, 255, 255, 0.35); }
.btn-clair:hover { background: rgba(255, 255, 255, 0.26); }
.btn[disabled] { opacity: 0.45; cursor: default; transform: none; }
a.btn { text-decoration: none; }
.tableau-parents { background-color: #22324a; }
.pastille-ecole { background: var(--succes-fond); color: var(--succes); border-color: transparent; justify-self: start; }
.titre-section { font-family: var(--f-titre); font-weight: 800; font-size: 1.6rem; }

/* Connexion */
.cadre-connexion { max-width: 720px; }
.choix-personne { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; width: 100%; justify-self: stretch; }
.personne {
  display: grid; justify-items: center; gap: 8px; padding: 22px 14px; border-radius: var(--rayon);
  border: 2px solid var(--trait); background: var(--surface); box-shadow: var(--ombre); cursor: pointer;
  font-family: var(--f-titre); font-weight: 800; font-size: 1.6rem;
}
.personne:hover { border-color: var(--pelouse-claire); }
.personne-enfant { border-color: var(--carton-jaune); }
.personne-emoji { font-size: 2.6rem; }
.zone-connexion { display: grid; gap: 16px; justify-items: start; }
.code-points { font-family: var(--f-titre); font-size: 2.4rem; letter-spacing: 0.2em; }
.clavier { display: grid; grid-template-columns: repeat(3, 76px); gap: 10px; }
.touche {
  height: 64px; border-radius: 14px; border: 2px solid var(--trait); background: var(--surface);
  font-family: var(--f-titre); font-weight: 800; font-size: 1.7rem; cursor: pointer;
}
.touche:active { transform: translateY(2px); }
.formulaire { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; justify-items: start; width: 100%; }
.formulaire > * { max-width: 100%; }
.formulaire-large { max-width: 520px; }
.formulaire label { font-weight: 600; }
.champ {
  width: 100%; max-width: 420px; min-height: 48px; padding: 8px 12px; border-radius: 12px;
  border: 2px solid var(--trait); background: var(--surface); color: var(--encre); font: inherit;
}
.champ:focus { border-color: var(--pelouse-claire); outline: none; box-shadow: 0 0 0 3px var(--succes-fond); }
.champ-court { max-width: 160px; }
.champ-large { max-width: 100%; }
textarea.champ { min-height: 110px; }
select { min-height: 44px; padding: 6px 10px; border-radius: 10px; border: 2px solid var(--trait); background: var(--surface); color: var(--encre); font: inherit; max-width: 100%; }
.case-a-cocher { display: flex; gap: 10px; align-items: center; font-weight: 500; min-width: 0; }
.case-a-cocher input { flex: none; }
.case-a-cocher input { width: 22px; height: 22px; }

/* Accueil de Mathéo : 5 boutons */
.tuiles-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tuiles-5 .tuile:last-child { grid-column: 1 / -1; }
.rangee-objectifs { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.vedette-accueil { display: grid; grid-template-columns: 96px 1fr; gap: 16px; align-items: center; padding: 14px 16px; border-radius: var(--rayon);
  background: var(--surface); box-shadow: var(--ombre); border: 2px solid var(--carton-jaune); }
.vedette-carte { width: 96px; }
.vedette-titre { font-family: var(--f-titre); font-weight: 800; font-size: 1.35rem; }

/* Devoirs */
.cahier-consigne { font-family: var(--f-cahier); font-size: 1.15rem; line-height: 32px; }
.documents { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; line-height: 1.4; }
.documents a { color: var(--pelouse-claire); font-weight: 600; }
.doc-absent { color: var(--encre-douce); }
.devoirs-passes summary { cursor: pointer; font-weight: 600; padding-block: 8px; }

/* Entraînement : types de questions */
.reponse-trous { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.associations { display: grid; gap: 10px; }
.ligne-association { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: center; }
.ordre ol { display: grid; gap: 8px; padding-left: 1.4em; margin: 0; }
.ordre li span:first-child { font-weight: 600; }
.ordre li { padding: 6px 0; }
.ordre-boutons { display: inline-flex; gap: 6px; margin-left: 10px; vertical-align: middle; }

/* Challenges */
.challenge { display: grid; gap: 10px; padding: 16px 18px; border-radius: var(--rayon); background: var(--surface); box-shadow: var(--ombre); border: 2px solid var(--trait); }
.challenge-reussi { border-color: var(--carton-jaune); }
.challenge-a-venir { border-style: dashed; }
.challenge-titre { font-family: var(--f-titre); font-weight: 800; font-size: 1.4rem; line-height: 1.1; }
.challenge-periode, .challenge-annonce { color: var(--encre-douce); font-weight: 600; }
.challenge-annonce-detail { display: grid; gap: 6px; margin: 0; }
.challenge-annonce-detail div { display: grid; grid-template-columns: 150px 1fr; gap: 10px; }
.challenge-annonce-detail dt { color: var(--encre-douce); }
.challenge-annonce-detail dd { margin: 0; font-weight: 500; }
.criteres { display: grid; gap: 8px; }
.critere { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(80px, 1fr) auto; gap: 10px; align-items: center; }
.critere b { font-variant-numeric: tabular-nums; }
.message-reussite { padding: 12px 16px; border-radius: 12px; background: var(--indice-fond); border: 2px solid var(--carton-jaune); display: grid; gap: 4px; }
.message-reussite p:first-child { font-family: var(--f-titre); font-weight: 800; font-size: 1.4rem; }
.challenge-valide { font-weight: 600; color: var(--succes); }

/* Espace parents */
.statut-one { display: grid; gap: 10px; padding: 18px 20px; border-radius: var(--rayon); background: var(--surface); box-shadow: var(--ombre); border: 3px solid var(--trait); }
.statut-ok { border-color: var(--succes); }
.statut-alerte { border-color: var(--carton-jaune); }
.statut-titre { font-family: var(--f-titre); font-weight: 800; font-size: 1.8rem; }
.tuiles-parents { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.tuile-parent { min-height: 100px; }
.tuile-parent .tuile-emoji { background: #22324a; }
.tuile-alerte { border-color: var(--carton-jaune); box-shadow: 0 0 0 3px var(--carton-jaune), var(--ombre); }
.bloc-parent { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 18px 20px; border-radius: var(--rayon); background: var(--surface); box-shadow: var(--ombre); }
.bloc-parent > * { min-width: 0; }
.bloc-parent h2 { font-family: var(--f-titre); font-weight: 800; font-size: 1.5rem; }
.bloc-parent h3 { font-size: 1.05rem; }
.bloc-parent .formulaire { padding: 12px 0; border-top: 1px solid var(--trait); }
.liste-simple { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.table-defile { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--trait); vertical-align: top; }
th { font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--encre-douce); }
.ligne-devoir { display: grid; gap: 6px; padding: 12px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--trait); }
.ligne-devoir-tete { color: var(--encre-douce); }
.resume-one { display: grid; gap: 10px; padding: 18px 20px; border-radius: var(--rayon); background: var(--succes-fond); border: 2px solid var(--succes); }
.resume-titre { font-family: var(--f-titre); font-weight: 800; font-size: 2rem; color: var(--succes); }
.resume-one dl { margin: 0; display: grid; gap: 6px; }
.resume-one dl div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid rgba(0, 0, 0, 0.08); padding-bottom: 4px; }
.resume-one dt { font-weight: 500; }
.resume-one dd { margin: 0; font-family: var(--f-titre); font-weight: 800; font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.resume-date { font-weight: 600; }
.zone-synchro { display: grid; gap: 14px; }

/* Boîte de dialogue intégrée */
.voile-clair { background: rgba(10, 20, 14, 0.55); color: var(--encre); }
.boite { width: min(520px, 100%); display: grid; gap: 14px; padding: 22px; border-radius: var(--rayon); background: var(--surface); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35); text-align: left; }
.boite-titre { font-family: var(--f-titre); font-weight: 800; font-size: 1.6rem; }

/* Album de production */
.case-vedette { position: relative; }
.ruban-vedette {
  position: absolute; top: -4%; left: 50%; translate: -50% 0; z-index: 2; white-space: nowrap;
  padding: 0.3em 0.7em; border-radius: 99px; background: #ffcf2e; color: #2a2000; font-weight: 700;
  font-size: clamp(0.5rem, 9cqw, 0.75rem); letter-spacing: 0.06em; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.case-a-venir { border-style: dotted; opacity: 0.75; }
.photo-joueur { position: absolute; left: 50%; bottom: 25%; width: 70%; translate: -50% 0; aspect-ratio: 1; object-fit: cover; border-radius: 6cqw; }
.mur { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1.6cqw; }
.vitrine-serie { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.liste-clubs { gap: 0.2cqw; }
.ligne-club { font-size: 3.1cqw; padding: 1cqw 0; }
.etiquette-vedette { color: #ffcf2e; font-weight: 700; }
.defi-attente { opacity: 0.75; }
.atelier-securite { padding: 10px 14px; border-radius: 12px; background: var(--erreur-fond); }
.toast-erreur { background: var(--erreur); color: #ffffff; }
.toast-succes { background: var(--succes); color: #ffffff; }
/* Retour visuel : zone qui vient d'être modifiée (après enregistrement). */
.vient-de-changer { animation: surligne-modif 2.2s ease-out; }
@keyframes surligne-modif {
  0% { background: var(--succes-fond, #e7f7ec); box-shadow: 0 0 0 3px var(--succes, #2e9e5b); }
  70% { background: var(--succes-fond, #e7f7ec); box-shadow: 0 0 0 3px var(--succes, #2e9e5b); }
  100% { background: transparent; box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) { .vient-de-changer { animation: none; outline: 2px solid var(--succes, #2e9e5b); } }
/* Indicateur discret de la dernière modification LOCALE (≠ synchro ONE). */
.indicateur-modif { margin: 4px 0 8px; font-size: 0.9em; color: var(--succes, #2e9e5b); }

@media (max-width: 640px) {
  .tuiles-5 .tuile:last-child { grid-column: auto; }
  .challenge-annonce-detail div { grid-template-columns: 1fr; }
  .critere { grid-template-columns: 1fr auto; }
  .critere .barre { grid-column: 1 / -1; }
  .ligne-association { grid-template-columns: 1fr; }
  .clavier { grid-template-columns: repeat(3, 68px); }
}

/* Fiche du club (données réelles vérifiées) */
.fiche-club { display: grid; gap: 6px; padding: 14px 16px; border-radius: var(--rayon); background: var(--surface); border: 1px solid var(--trait); max-width: 62ch; }
.fiche-club p { margin: 0; line-height: 1.5; }
.photo-joueur { object-position: 50% 18%; }

/* ===================== Version 1.1 : leçons, contrôle ONE, guide, présentation, installation ===================== */
.ecran-lancement { min-height: 70vh; display: grid; place-content: center; justify-items: center; gap: 12px; font-family: var(--f-titre); font-weight: 800; font-size: 1.6rem; color: var(--pelouse); }

/* Voyant ONE permanent (en-tête parents) et bouton d'aide */
.voyant-one { min-height: 36px; padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.4); background: rgba(255, 255, 255, 0.14); color: var(--craie); font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer; }
.voyant-one[data-niveau="vert"] { background: rgba(28, 138, 75, 0.85); }
.voyant-one[data-niveau="orange"] { background: #b86a00; }
.voyant-one[data-niveau="rouge"] { background: #b3262f; }
.voyant-one:focus-visible, .btn-aide:focus-visible { outline: 3px solid var(--carton-jaune); outline-offset: 2px; }
.btn-aide { min-width: 36px; font-weight: 800; }

/* Contrôle ONE au démarrage (parents) */
.zone-controle-one { display: grid; gap: 8px; }
.controle-one { display: grid; gap: 10px; padding: 16px 18px; border-radius: var(--rayon); border: 2px solid var(--trait); background: var(--surface); }
.controle-one p { margin: 0; }
.controle-titre { font-family: var(--f-titre); font-weight: 800; font-size: 1.45rem; }
.controle-vert { border-color: var(--succes); background: var(--succes-fond); }
.controle-orange { border-color: #d08a1e; background: var(--indice-fond); }
.controle-rouge { border-color: var(--erreur); background: var(--erreur-fond); }
.statut-compact { margin: 0; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); font-weight: 600; }
.statut-compact[data-niveau="orange"] { background: var(--indice-fond); }
.statut-compact[data-niveau="rouge"] { background: var(--erreur-fond); }
.actions-parents .rangee-actions { margin: 0; }

/* Parcours « Étape 1/2 — Consulte la leçon » → « Étape 2/2 — Lance l'entraînement » */
.parcours { margin: 0; justify-self: start; padding: 6px 12px; border-radius: 999px; background: var(--carton-jaune); color: var(--carton-jaune-texte); font-weight: 700; font-size: 0.95rem; }
.parcours[data-etape="2"] { background: var(--succes-fond); color: var(--succes); }
.parcours-carte { font-size: 0.85rem; }

/* Visionneuse de leçon et barre d'actions toujours visible (téléphone, tablette) */
.visionneuse { display: grid; gap: 8px; }
.visionneuse-cadre { width: 100%; height: min(72vh, 900px); min-height: 360px; border: 1px solid var(--trait); border-radius: 12px; background: #fff; }
.visionneuse-image img { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--trait); background: #fff; }
.barre-parcours { position: sticky; bottom: 0; z-index: 6; display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin: 8px 0 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); border-radius: 14px 14px 0 0;
  background: var(--surface); border-top: 1px solid var(--trait); box-shadow: 0 -8px 24px rgba(18, 48, 32, 0.14); }
.barre-parcours .btn { min-height: 46px; }
.barre-parcours .btn-principal { margin-left: auto; }
@media (max-width: 480px) { .barre-parcours .btn-principal { margin-left: 0; flex: 1 1 100%; } .barre-parcours .btn-secondaire { flex: 1 1 0; } }
.lien-document { background: none; border: 0; padding: 4px 0; color: var(--pelouse); font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; text-align: left; }
.lien-document:focus-visible { outline: 3px solid var(--carton-jaune); outline-offset: 2px; border-radius: 4px; }

/* Décision d'un parent sur un élément « à vérifier » */
.ligne-decision { margin: 0; font-size: 0.92rem; font-weight: 600; }
.decision-ok { color: var(--succes); }
.decision-exclu { color: var(--erreur); }

/* Entraînement : étapes et mains (technique de la table de 9) */
.etape-entrainement { margin: 0; font-size: 0.9rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--pelouse); }
.mains-figure { margin: 0; display: grid; gap: 4px; justify-items: center; }
.mains-figure svg { width: min(100%, 420px); height: auto; }
.mains-figure .paume { fill: #f2c9a5; stroke: #b98563; stroke-width: 2; }
.mains-figure .doigt { fill: #f6d4b5; stroke: #b98563; stroke-width: 2; }
.mains-figure .doigt-baisse { fill: #d9a77f; stroke: #8d5d3c; stroke-dasharray: 3 2; }
.mains-figure .doigt-num { font: 700 11px/1 var(--f-texte); fill: #5b3a22; }
.mains-figure .main-nom { font: 600 11px/1 var(--f-texte); fill: var(--encre-douce); }

/* ❓ Guide parents */
.guide-sommaire { display: flex; flex-wrap: wrap; gap: 8px; }
.guide-partie { display: grid; gap: 10px; padding: 16px 18px; border-radius: var(--rayon); background: var(--surface); border: 1px solid var(--trait); }
.guide-partie h2 { margin: 0; font-family: var(--f-titre); font-weight: 800; font-size: 1.5rem; }
.guide-etapes { margin: 0; padding-left: 1.4rem; display: grid; gap: 6px; max-width: 65ch; }
.guide-cle { margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--succes-fond); font-weight: 600; }
.guide-lexique { margin: 0; display: grid; gap: 10px; }
.guide-lexique div { display: grid; gap: 2px; padding-bottom: 8px; border-bottom: 1px solid var(--trait); }
.guide-lexique dt { font-weight: 700; }
.guide-lexique dd { margin: 0; color: var(--encre-douce); max-width: 65ch; }
.guide-cas { display: grid; gap: 8px; }
.guide-cas summary { cursor: pointer; font-weight: 600; min-height: 32px; }
.guide-cas p { margin: 6px 0 0; max-width: 65ch; }
.guide-regles { margin: 0; padding-left: 1.2rem; display: grid; gap: 6px; }
.lien-guide { justify-content: center; }

/* Présentation de première connexion */
.presentation { z-index: 60; }
.presentation-boite { text-align: center; justify-items: center; width: min(460px, 100%); }
.presentation-etape { margin: 0; font-size: 0.85rem; color: var(--encre-douce); font-weight: 600; }
.presentation-emoji { margin: 0; font-size: 3.4rem; line-height: 1.1; }
.presentation-titre { margin: 0; font-family: var(--f-titre); font-weight: 800; font-size: 1.9rem; text-wrap: balance; }
.presentation-texte { margin: 0; font-size: 1.1rem; max-width: 34ch; }
.presentation-points { display: flex; gap: 6px; }
.presentation-points span { width: 9px; height: 9px; border-radius: 50%; background: var(--trait); }
.presentation-points span.actif { background: var(--pelouse); }
.presentation-actions { width: 100%; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.presentation-actions .btn { min-height: 46px; }
[data-profil="enfant"] .presentation-titre { color: var(--pelouse); }

/* 📲 Installation */
.bloc-courant { border: 2px solid var(--pelouse); }
.bloc-installation summary { cursor: pointer; font-weight: 600; }

/* ===================== Version 1.2 : échéances, statuts, reprise, indices ===================== */
/* Accueil de Mathéo : 8 tuiles, pictogramme au-dessus du titre pour laisser toute la largeur au texte */
.tuiles-8 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tuiles-8 .tuile { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; row-gap: 8px; align-items: start; align-content: start; min-height: 0; padding: 16px; }
.tuiles-8 .tuile-emoji { grid-row: auto; width: 52px; height: 52px; font-size: 1.6rem; }
.tuiles-8 .tuile-titre { font-size: 1.4rem; text-wrap: balance; }
.tuiles-8 .tuile-sous { font-size: 0.9rem; }
@media (max-width: 860px) { .tuiles-8 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Compteurs ✅ faits · ▶️ en cours · 📚 à faire */
.compteurs-devoirs { display: flex; flex-wrap: wrap; gap: 10px; }
.compteur { display: inline-flex; align-items: baseline; gap: 6px; padding: 8px 14px; border-radius: 999px; font-weight: 600; background: var(--surface); border: 2px solid var(--trait); }
.compteur b { font-family: var(--f-titre); font-size: 1.5rem; line-height: 1; }
.compteur-fait { border-color: var(--succes); color: var(--succes); }
.compteur-en-cours { border-color: #d08a1e; color: #8a5600; }
.compteur-a-faire { border-color: var(--pelouse); color: var(--encre); }

/* Carte de devoir : la date « POUR » est l'information la plus visible */
.carte-devoir { display: grid; gap: 10px; padding: 16px 18px; border-radius: var(--rayon); background: var(--surface); border: 2px solid var(--trait); box-shadow: var(--ombre); }
.carte-devoir[data-statut="EN_COURS"] { border-color: #d08a1e; }
.carte-devoir[data-statut="FAIT"] { border-color: var(--succes); background: var(--succes-fond); }
.carte-devoir-tete { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; }
.carte-devoir-matiere { font-weight: 700; }
.carte-devoir-titre { margin: 0; font-family: var(--f-titre); font-weight: 800; font-size: 1.45rem; line-height: 1.15; text-wrap: balance; }
.statut-devoir { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 0.85rem; font-weight: 700; letter-spacing: 0.02em; }
.statut-a-faire { background: var(--surface-2); color: var(--encre); border: 1px solid var(--trait); }
.statut-en-cours { background: var(--indice-fond); color: #7a4c00; border: 1px solid #e0b25a; }
.statut-fait { background: var(--succes-fond); color: var(--succes); border: 1px solid var(--succes); }
.echeance { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.echeance-date { font-family: var(--f-titre); font-weight: 800; font-size: 1.3rem; color: var(--encre); }
.echeance-etiquette { display: inline-block; padding: 3px 10px; border-radius: 6px; font-size: 0.85rem; font-weight: 800; letter-spacing: 0.06em; background: var(--surface-2); color: var(--encre); }
.echeance-etiquette[data-etiquette="EN RETARD"] { background: var(--erreur); color: #fff; }
.echeance-etiquette[data-etiquette="AUJOURD'HUI"] { background: #d0631e; color: #fff; }
.echeance-etiquette[data-etiquette="DEMAIN"] { background: var(--carton-jaune); color: var(--carton-jaune-texte); }
.echeance-etiquette[data-etiquette="PENDANT LES VACANCES"] { background: #cfe6f7; color: #134a73; }
.ajoute-le { margin: 0; font-size: 0.8rem; color: var(--encre-douce); }
.carte-devoir .cahier { margin: 0; }

/* ▶️ Continuer où j'en étais */
.grille-reprises { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.carte-reprise { display: grid; gap: 6px; padding: 14px 16px; border-radius: var(--rayon); background: var(--indice-fond); border: 2px solid #e0b25a; }
.carte-reprise p { margin: 0; }
.carte-reprise-titre { font-weight: 800; font-size: 1.05rem; }
.carte-reprise .btn { justify-self: start; }

/* 🏖️ Devoirs des vacances */
.section-vacances { display: grid; gap: 8px; padding: 14px 16px; border-radius: var(--rayon); background: #eaf4fb; border: 2px solid #9cc9ea; }
.section-vacances p { margin: 0; }
.liste-vacances { margin: 0; padding-left: 1.1rem; display: grid; gap: 4px; }

/* Barre de l'activité : progression, pause, recommencer */
.barre-activite { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); }
.progression-activite { margin: 0; font-weight: 600; }
.indice-2 { display: grid; gap: 8px; margin-top: 8px; padding-top: 10px; border-top: 1px dashed #e0b25a; }
.indice-2 .btn { justify-self: start; }

/* ===================== Version 1.2 : acquis, missions, bureau ===================== */
.grille-missions { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.carte-mission { display: grid; gap: 8px; align-content: start; padding: 16px 18px; border-radius: var(--rayon); background: var(--surface); border: 2px solid var(--trait); box-shadow: var(--ombre); }
.carte-mission p, .carte-mission h3 { margin: 0; }
.carte-mission-jour { border-color: var(--pelouse); background: var(--succes-fond); }
.mission-du-jour { font-family: var(--f-titre); font-weight: 800; font-size: 1.1rem; color: var(--pelouse); }
.carte-mission-matiere { font-weight: 600; color: var(--encre-douce); }
.carte-mission-titre { font-family: var(--f-titre); font-weight: 800; font-size: 1.35rem; line-height: 1.15; text-wrap: balance; }
.carte-mission .btn { justify-self: start; }
.pastille-niveau { justify-self: start; }
.pastille-niveau[data-niveau="maitrise"] { background: var(--succes-fond); color: var(--succes); }
.pastille-niveau[data-niveau="en_progression"] { background: var(--indice-fond); color: #7a4c00; }
.pastille-niveau[data-niveau="a_renforcer"] { background: #e7f0fb; color: #1d4f8a; }
.bloc-profil { display: grid; gap: 10px; }
.profil-matiere { display: grid; gap: 4px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--trait); }
.profil-matiere h3, .profil-matiere p { margin: 0; }
.groupe-niveau h3 { margin: 6px 0 4px; font-size: 1.05rem; }
.evolution { color: var(--encre-douce); }
.bloc-progres { background: var(--succes-fond); border: 1px solid var(--succes); }
.bloc-progres p { margin: 0; font-weight: 600; }

/* 🗂️ Bureau : un classeur avec intercalaires */
.classeur { display: grid; gap: 12px; }
.intercalaire { padding: 12px 16px 14px; border-radius: 4px 16px 16px 16px; background: var(--surface); border: 1px solid var(--trait); border-left: 8px solid var(--pelouse); box-shadow: var(--ombre); }
.intercalaire[data-categorie="evaluations"] { border-left-color: #1d4f8a; }
.intercalaire[data-categorie="lecons"] { border-left-color: var(--pelouse); }
.intercalaire[data-categorie="exercices"] { border-left-color: #d0631e; }
.intercalaire[data-categorie="fiches"] { border-left-color: #8a5aa8; }
.intercalaire[data-categorie="controles"] { border-left-color: var(--succes); }
.intercalaire[data-categorie="autres"] { border-left-color: var(--encre-douce); }
.intercalaire-titre { margin: 0 0 6px; font-family: var(--f-titre); font-weight: 800; font-size: 1.3rem; }
.intercalaire-nombre { font-family: var(--f-texte); font-size: 0.9rem; font-weight: 500; color: var(--encre-douce); }
.liste-classeur { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.liste-classeur li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }

/* Dépôt et vérification d'un document */
.fichier-cache { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.apercu-document { max-width: 100%; max-height: 70vh; border-radius: 10px; border: 1px solid var(--trait); background: #fff; }
.fiche-comprise { margin: 0; display: grid; gap: 6px; }
.fiche-comprise div { display: grid; grid-template-columns: minmax(120px, 30%) 1fr; gap: 8px; }
.fiche-comprise dt { font-weight: 700; }
.fiche-comprise dd { margin: 0; }
.champ-formulaire { display: grid; gap: 4px; }
.tableau-competences { width: 100%; border-collapse: collapse; }
.tableau-competences th, .tableau-competences td { padding: 6px 8px; border-bottom: 1px solid var(--trait); text-align: left; vertical-align: middle; }

/* ===================== Version 1.3 : 📥 documents à traiter, « Voici ce que j'ai compris » ===================== */
.bloc-depot { border: 2px solid var(--pelouse); }
.resume-depot { font-size: 1.05rem; }
.carte-depot { display: grid; gap: 6px; padding: 14px 16px; border-radius: var(--rayon); border: 2px solid var(--trait); background: var(--surface); }
.carte-depot[data-etat="a_confirmer"] { border-color: var(--carton-jaune); }
.carte-depot[data-etat="erreur_lecture"], .carte-depot[data-etat="a_traiter_manuellement"] { border-color: #d08a1e; }
.carte-depot-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; }
.carte-depot-titre { margin: 0; font-size: 1.15rem; }
.etat-depot { display: inline-block; padding: 2px 10px; border-radius: 999px; font-weight: 600; font-size: 0.9rem; background: var(--fond); border: 1px solid var(--trait); }
.etat-a-confirmer { background: #fff3c4; border-color: #e6b800; color: #6b5200; }
.etat-en-analyse { background: #e7f0ff; border-color: #8fb3ef; color: #1f4e8c; }
.etat-erreur, .etat-manuel { background: #ffeedd; border-color: #e4a35b; color: #7a4100; }
.etat-integre, .etat-confirme { background: var(--succes-fond); border-color: var(--succes); color: var(--succes); }
.depot-anterieurs, .depot-ignores, .historique-document { margin-top: 10px; }
.depot-anterieurs summary, .depot-ignores summary, .historique-document summary { cursor: pointer; font-weight: 600; }
.source-depot { overflow-wrap: anywhere; }
.validation-deux-colonnes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; align-items: start; }
.validation-deux-colonnes > * { min-width: 0; }
@media (max-width: 900px) { .validation-deux-colonnes { grid-template-columns: minmax(0, 1fr); } }
.apercu-annote { position: relative; display: block; line-height: 0; }
.apercu-annote img { width: 100%; height: auto; border-radius: 8px; }
.marque-point { position: absolute; transform: translate(-50%, -50%); min-width: 22px; height: 22px; padding: 0 4px; border-radius: 999px;
  background: #d62828; color: #fff; font: 700 12px/22px var(--f-texte, sans-serif); text-align: center; box-shadow: 0 0 0 2px #fff; pointer-events: none; }
.marque-limite { background: #e6a700; color: #1d1d1d; }
.tableau-competences tr[data-limite="oui"] td:first-child { box-shadow: inset 4px 0 0 #e6a700; }
.tableau-competences tr[data-modifie="oui"] td { background: #fff7d6; }
.pastille-limite { margin-left: 6px; background: #fff3c4; border: 1px solid #e6b800; color: #6b5200; font-size: 0.8rem; }
.barre-validation { position: sticky; bottom: env(safe-area-inset-bottom, 0px); background: var(--surface); padding-block: 8px; z-index: 2; }
.chargement-doux { font-style: italic; color: var(--encre-douce); }
/* Statuts : terminé par Mathéo ≠ validé par un parent ; planning des vacances ; archives */
.compteur-valide { border-color: #5b4bb3; color: #3e2f8f; }
.statut-valide { background: #ece8ff; border: 1px solid #8f80e0; color: #3e2f8f; }
.carte-devoir[data-etat="VALIDE"] { border-color: #8f80e0; }
.planning-vacances { margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: var(--fond); border: 1px dashed var(--trait); }
.archives-mois h3 { margin: 12px 0 6px; font-size: 1.05rem; }
.position-lue { white-space: nowrap; }

/* ===================== « Voici ce que j'ai compris » : photo annotée + compétences une par une ===================== */
.panneau-photo { display: grid; gap: 8px; align-content: start; }
@media (min-width: 901px) { .panneau-photo { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 8px); } }
.barre-photo { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.zone-photo { overflow: auto; max-height: 76vh; border: 1px solid var(--trait); border-radius: 10px; background: #fff; overscroll-behavior: contain; }
.toile-photo { position: relative; width: 100%; line-height: 0; }
.toile-photo img { display: block; width: 100%; height: auto; }
.marque-point { pointer-events: auto; cursor: pointer; border: 0; transition: transform 120ms ease; }
.marque-point:focus-visible { outline: 3px solid #1f6feb; outline-offset: 2px; }
.marque-active { background: #1f6feb; color: #fff; transform: translate(-50%, -50%) scale(1.35); box-shadow: 0 0 0 3px #fff, 0 0 0 7px rgba(31, 111, 235, 0.45); z-index: 3; }
.marque-limite.marque-active { background: #1f6feb; color: #fff; }
.panneau-photo.plein-ecran { position: fixed; inset: 0; z-index: 60; margin: 0; border-radius: 0; max-height: none;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 12px calc(env(safe-area-inset-bottom, 0px) + 10px); background: var(--surface); grid-template-rows: auto 1fr auto; }
.panneau-photo.plein-ecran .zone-photo { max-height: none; height: 100%; }
.colonne-liste { display: grid; gap: 12px; min-width: 0; }
.liste-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.point-competence { display: grid; gap: 6px; padding: 12px 14px; border: 2px solid var(--trait); border-radius: 12px; background: var(--surface); cursor: pointer; }
.point-competence[data-confiance="verifier"] { border-left: 6px solid #e6a700; }
.point-competence[data-confiance="sur"] { border-left: 6px solid var(--succes); }
.point-competence.point-actif { border-color: #1f6feb; box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.25); }
.point-competence[data-modifie="oui"] { background: #fff7d6; }
.point-competence:focus-visible { outline: 3px solid #1f6feb; outline-offset: 2px; }
.point-tete { display: flex; align-items: center; gap: 10px; }
.point-numero { flex: none; display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 999px; background: #d62828; color: #fff; font-weight: 700; }
.point-competence[data-confiance="verifier"] .point-numero { background: #e6a700; color: #1d1d1d; }
.point-nom { font-weight: 700; font-size: 1.05rem; }
.point-details { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px 12px; margin: 0; }
.point-details > div { display: contents; }
.point-details dt { color: var(--encre-douce); }
.point-details dd { margin: 0; }
.point-choix { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.point-choix .choix-niveau { max-width: 260px; }
.point-modifie { font-size: 0.9rem; color: #7a5a00; }
.suivi-lecture { margin: 0; font-weight: 600; }
.barre-validation button[disabled] { opacity: 0.55; cursor: not-allowed; }
/* Barre de confirmation compacte (toujours visible en bas de la liste) */
.colonne-liste > .barre-validation { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px;
  border: 2px solid var(--trait); box-shadow: var(--ombre); }
.colonne-liste > .barre-validation .suivi-lecture { flex: 1 1 180px; font-size: 0.92rem; }
.colonne-liste > .barre-validation .btn { min-height: 42px; padding-block: 6px; }
.estimation-interne { margin: 0; font-size: 0.85rem; color: var(--encre-douce); }

/* ===================== 🎯 Je m'entraîne pour progresser : missions recommandées ===================== */
.mission-principale .carte-mission { border-width: 3px; }
.carte-mission-recommandee { border-color: var(--carton-jaune); box-shadow: 0 0 0 3px rgba(230, 184, 0, 0.25), var(--ombre); }
.mission-recommandee { margin: 0; display: inline-block; justify-self: start; padding: 4px 12px; border-radius: 999px; background: #fff3c4; color: #6b5200; font-weight: 800; }
.mission-revision { margin: 0; display: inline-block; justify-self: start; padding: 2px 10px; border-radius: 999px; background: var(--fond); border: 1px solid var(--trait); font-weight: 700; }
.carte-mission-revision { border-style: dashed; }
.carte-mission-infos { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 12px; margin: 4px 0; }
.carte-mission-infos > div { display: contents; }
.carte-mission-infos dt { color: var(--encre-douce); font-weight: 600; }
.carte-mission-infos dd { margin: 0; }
@media (max-width: 520px) { .carte-mission-infos { grid-template-columns: minmax(0, 1fr); } .carte-mission-infos dt { margin-top: 4px; } }
.bloc-revision { display: grid; gap: 8px; }
.liste-priorites { display: grid; gap: 6px; padding-left: 1.4em; }
.liste-priorites li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.points-essai { border: 2px dashed var(--trait); }

/* ===================== Leçon du devoir : trouvée · manquante · en préparation ===================== */
.bloc-preparation { display: grid; gap: 6px; padding: 10px 12px; border-radius: 12px; border: 2px dashed var(--trait); background: var(--fond); }
.bloc-preparation[data-etat="lecon_manquante"] { border-color: #e4a35b; background: #fff6ec; }
.bloc-preparation[data-etat="lecon_trouvee"] { border-color: var(--succes); border-style: solid; }
.bloc-preparation[data-etat="en_preparation"] { border-color: #8fb3ef; background: #eef4ff; }
.bloc-preparation p { margin: 0; }
/* Déroulé d'un devoir : 5 étapes claires (attribution · support · préparation · travail de Mathéo · contrôle parent). */
.parcours-devoir { list-style: none; margin: 10px 0 0; padding: 8px 10px; display: grid; gap: 4px; border-radius: 12px; border: 1px solid var(--trait); background: var(--fond); counter-reset: etape; }
.etape-devoir { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 3px 0; border-left: 4px solid var(--trait); padding-left: 8px; }
.etape-devoir[data-etat="ok"] { border-left-color: var(--succes); }
.etape-devoir[data-etat="a-verifier"] { border-left-color: #d08a1e; }
.etape-devoir[data-etat="attente"] { border-left-color: #8fb3ef; }
.etape-devoir[data-etat="exclu"] { border-left-color: #c05a5a; }
.etape-titre { font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.etape-valeur { text-align: right; }
.etape-devoir[data-etat="a-verifier"] .etape-valeur { color: #a7670f; }
/* État DIRECTEMENT actionnable : un bouton qui mène à l'action exacte (une action = une destination). */
.etape-action { text-align: right; font: inherit; font-weight: 600; cursor: pointer; border: 1px solid var(--trait); background: var(--fond); border-radius: 999px; padding: 2px 10px; color: inherit; }
.etape-action:hover, .etape-action:focus-visible { border-color: var(--accent, #3b6fd6); color: var(--accent, #3b6fd6); outline: none; }
.etape-devoir[data-etat="a-verifier"] .etape-action { color: #a7670f; border-color: #d08a1e; }
.etape-devoir[data-etat="ok"] .etape-action { color: var(--succes); border-color: var(--succes); }
.supports-uniques { margin: 10px 0 0; padding: 6px 10px; border: 1px solid var(--trait); border-radius: 12px; background: var(--fond); }
.supports-uniques .supports-titre { font-weight: 600; margin: 0 0 4px; }
.supports-uniques .liste-supports { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.supports-uniques .liste-supports > li { padding: 2px 0; border-top: 1px solid var(--trait); display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.supports-uniques .alias-copies { margin-top: 4px; }
.supports-uniques .alias-copies > summary { cursor: pointer; color: var(--texte-doux, inherit); font-size: 0.92em; }
.aide-info { border: 1px solid var(--trait); background: var(--fond); color: var(--texte-doux, inherit); border-radius: 50%; width: 1.25em; height: 1.25em; line-height: 1; padding: 0; font-size: 0.85em; cursor: pointer; }
.pastille-lecon { background: var(--succes-fond); border: 1px solid var(--succes); color: var(--succes); }
.pastille-lecon-manquante { background: #fff6ec; border: 1px solid #e4a35b; color: #7a4100; }

/* ===================== ⚠️ Supports de leçon manquants (accueil parents) et pages d'un document ===================== */
.alertes-supports { display: grid; gap: 10px; }
.alerte-support { display: grid; gap: 4px; padding: 12px 16px; border-radius: var(--rayon); border: 3px solid #e4a35b; background: #fff6ec; box-shadow: var(--ombre); }
.alerte-support p { margin: 0; }
.alerte-support-titre { font-weight: 800; color: #7a4100; font-size: 1.05rem; }
.alerte-support-sujet { font-size: 1.1rem; }
.btn-lien { background: none; border: 0; text-decoration: underline; color: var(--encre-douce); cursor: pointer; }
.pastille-lecon-attente { background: #eef4ff; border: 1px solid #8fb3ef; color: #1f4e8c; }
.onglets-pages { display: flex; flex-wrap: wrap; gap: 6px; }
.onglet-actif { border-color: var(--pelouse); background: var(--succes-fond); font-weight: 700; }
.pages-choisies { display: grid; gap: 8px; padding-left: 0; list-style: none; }
.page-choisie { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 6px; border: 1px solid var(--trait); border-radius: 10px; background: var(--surface); }
.vignette-page { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; }
.vignette-pdf { display: inline-grid; place-items: center; width: 64px; height: 64px; font-size: 1.8rem; background: var(--fond); border-radius: 6px; }
.page-choisie-nom { flex: 1 1 160px; overflow-wrap: anywhere; }
.pages-document { display: grid; gap: 14px; }
.passage-lecon { border-left: 6px solid var(--pelouse); }
.texte-lecon { width: 100%; max-width: 100%; font: inherit; }
.choix-regroupement { font-size: 0.85rem; margin-right: 6px; }

/* ===================== 🔎 Proposition de rattachement d'un support à un devoir · 🎮 informations de la leçon ===================== */
.proposition-rattachement { display: grid; gap: 4px; margin-block: 8px; padding: 10px 14px; border-radius: var(--rayon); border: 2px dashed #8fb3ef; background: #f3f7ff; }
.proposition-rattachement p { margin: 0; }
.proposition-titre { font-weight: 600; }
.liste-informations { display: grid; gap: 8px; padding-left: 0; list-style: none; }
.ligne-information { display: grid; gap: 6px; padding: 8px; border: 1px solid var(--trait); border-radius: 10px; background: var(--surface); }
.ligne-information-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.ligne-information.a-verifier { border-color: #e4a35b; background: #fff6ec; }
.pastille-information { font-size: 0.8rem; white-space: nowrap; }
.champ-information { width: 100%; min-width: 0; resize: vertical; font: inherit; }

.ligne-version { text-align: center; margin-top: 18px; opacity: 0.85; }

/* ===================== 📖 Consulter la leçon : pages scannées, zoom, plein écran ===================== */
.cadre-lecon { display: grid; gap: 10px; }
.outils-lecon { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--fond); padding: 6px 0; }
.pages-zoomables { overflow-x: auto; }
.pages-zoomables .visionneuse-image img { width: calc(100% * var(--zoom, 1)); max-width: none; height: auto; }
.cadre-lecon.plein-ecran { position: fixed; inset: 0; z-index: 1000; background: var(--fond); overflow: auto;
  padding: max(10px, env(safe-area-inset-top, 0px)) 12px max(10px, env(safe-area-inset-bottom, 0px)); }
.cadre-lecon.plein-ecran .outils-lecon { top: 0; }
/* 📄 Leçon ONE en images (1.14.2) : même lecteur, pages sur toute la largeur (téléphone) ; secours si le PDF ne s'affiche pas */
.visionneuse-pdf figure { margin: 0; }
.visionneuse-secours { display: grid; gap: 10px; justify-items: start; padding: 16px; border: 2px dashed var(--trait);
  border-radius: 12px; background: var(--surface); }
.visionneuse-secours p { margin: 0; }

/* Environnement de test (1.6.0) : bandeau permanent, jamais en production. */
.bandeau-environnement {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 1000;
  padding: 0.4rem 1rem;
  background: #b3261e;
  color: #fff;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.03em;
}

/* 👁 Afficher / 🙈 Masquer le mot de passe (1.6.2) : bouton collé au champ, grande zone tactile. */
.champ-secret { display: flex; align-items: stretch; gap: 6px; width: 100%; }
.champ-secret .champ { flex: 1 1 auto; min-width: 0; }
.btn-oeil { flex: 0 0 auto; min-height: 44px; min-width: 44px; padding: 0 12px; border: 2px solid var(--pelouse-claire, #2e7d4f);
  border-radius: 10px; background: transparent; color: inherit; font: inherit; font-size: 0.95rem; cursor: pointer; white-space: nowrap; }
.btn-oeil:focus-visible { outline: 3px solid var(--pelouse-claire, #2e7d4f); outline-offset: 2px; }
.btn-oeil[aria-pressed="true"] { background: var(--succes-fond, #e6f4ea); }
/* 🔎 Recherche rapide des cours et documents · ➕ boutons d'ajout du Bureau (1.5.3) */
.barre-recherche { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0 12px; }
.barre-recherche .champ-recherche { flex: 1 1 240px; max-width: 640px; font-size: 1.05rem; }
.resultats-recherche { display: grid; gap: 10px; }
.carte-resultat { display: grid; gap: 4px; padding: 12px 16px; border-radius: var(--rayon); background: var(--surface); box-shadow: var(--ombre); }
.carte-resultat > * { min-width: 0; overflow-wrap: anywhere; }
.carte-resultat-titre { font-size: 1.05rem; }
.carte-resultat .rangee-actions { margin-top: 4px; }
.boutons-ajout .btn { flex: 1 1 200px; justify-content: center; text-align: center; }

/* 📑 Pages utiles, codes de leçon, blocs de devoirs (1.5.4) */
.figure-page-utile, .page-utile { outline: 3px solid var(--pelouse-claire); outline-offset: 2px; border-radius: 8px; }
.page-secondaire { opacity: 0.85; }
.pages-utiles { font-weight: 600; }
.lecon-a-revoir { margin: 4px 0; }
.proposition-pages { display: grid; gap: 6px; padding: 10px 12px; border-radius: 12px; border: 2px dashed var(--trait); background: var(--surface); }
.proposition-pages[data-confiance="forte"] { border-color: var(--pelouse-claire); }
.lecon-pages { display: grid; gap: 6px; margin-top: 8px; }
.liste-pages { list-style: none; padding: 0; display: grid; gap: 6px; }
.case-page { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 8px; border-radius: 10px; background: var(--surface); }
.case-page.page-proposee { box-shadow: inset 4px 0 0 var(--pelouse-claire); }
.bloc-pedagogique { display: grid; gap: 10px; padding: 10px; border-radius: var(--rayon); border: 2px solid var(--trait); }
.bloc-pedagogique-titre { font-size: 1.1rem; }
.aide-action { font-style: italic; }
.pages-trouvees li { margin: 4px 0; }
.proposition-regroupement { display: grid; gap: 4px; padding: 10px 12px; border-radius: 12px; border: 2px dashed var(--trait); }

/* ⚠️ À vérifier / 🎮 Diagnostic des entraînements : lignes d'action avec repère de catégorie (🟢🟡🔵🔴) */
.analyse-entrainements, .debrief-version { display: grid; gap: 12px; text-align: left; }
.cat-analyse { display: grid; gap: 8px; }
.ligne-analyse { display: grid; gap: 4px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--trait);
  border-left: 5px solid var(--encre-douce); background: var(--surface); }
.ligne-analyse[data-cat="disponible"], .ligne-analyse[data-type="controle"] { border-left-color: var(--succes); }
.ligne-analyse[data-cat="action_parent"], .ligne-analyse[data-type="lecon"], .ligne-analyse[data-type="document"] { border-left-color: var(--carton-jaune-fonce); }
.ligne-analyse[data-cat="non_necessaire"] { border-left-color: var(--seyes); }
.ligne-analyse[data-cat="probleme"], .ligne-analyse[data-type="ambigu"] { border-left-color: var(--erreur); }
.ligne-analyse p { margin: 0; }
.debrief-version h3 { margin: 10px 0 2px; font-size: 1rem; }
.debrief-version ul { margin: 2px 0; }

/* 🆕 Bannière discrète « application mise à jour » (une fois par appareil/version) — jamais bloquante */
.banniere-nouveautes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px;
  background: var(--indice-fond); border: 1px solid var(--carton-jaune-fonce); }
.banniere-nouveautes span { flex: 1 1 auto; }

/* 💡 Bon à savoir — grille de thèmes responsive : 4 → 3 → 2 → 1 colonne selon la largeur, jamais de débordement
   horizontal. Les tuiles empilent icône / nom / compteur (comme .tuiles-8) pour que les noms d'un seul mot
   (« Communication », « Technologie »…) puissent revenir à la ligne au lieu de dépasser la carte. */
.tuiles-themes { grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 12px; }
.tuiles-themes .tuile {
  grid-template-columns: 1fr; grid-template-rows: auto auto auto; row-gap: 6px;
  justify-items: start; align-content: start; min-height: 0; min-width: 0; padding: 14px 16px;
}
.tuiles-themes .tuile-emoji { grid-row: auto; width: 48px; height: 48px; font-size: 1.5rem; }
.tuiles-themes .tuile-titre { font-size: 1.2rem; overflow-wrap: anywhere; }
.tuiles-themes .tuile-sous { font-size: 0.85rem; overflow-wrap: anywhere; }
.bas-jour { margin: 8px 0 4px; }
.bas-fiche { text-align: left; }
.bas-fiche-detail { display: grid; gap: 8px; background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 14px 16px; }
.bas-ligne { margin: 0; }
.bas-savais { background: var(--seyes-fin); border-radius: 12px; padding: 8px 10px; }
.bas-nuance { background: var(--indice-fond); border-radius: 12px; padding: 8px 10px; }
.bas-question { margin-top: 6px; border-top: 1px dashed var(--trait); padding-top: 10px; display: grid; gap: 8px; }
.bas-choix { flex-wrap: wrap; }
.bas-choix .btn.bon { background: var(--succes-fond); border-color: var(--succes); color: var(--encre); }
.bas-choix .btn.rate { background: var(--erreur-fond); border-color: var(--erreur); color: var(--encre); }
.bas-feedback { margin: 0; font-weight: 600; }

/* 🧠 Retour d'expérience & adaptation (questionnaires Mathéo/parents, profil) */
.ton-avis, .avis-parent { display: grid; gap: 10px; text-align: left; }
.ton-avis { margin-top: 16px; padding: 12px 14px; border-radius: var(--rayon); border: 2px dashed var(--trait); background: var(--surface); }
.avis-groupe { display: grid; gap: 6px; }
.avis-groupe p { margin: 0; font-weight: 600; }
.avis-choix { display: flex; flex-wrap: wrap; gap: 6px; }
.avis-choix .btn.choisi { background: var(--pelouse); color: var(--craie); border-color: var(--pelouse); }
.profil-matiere-adapt { margin: 8px 0; }
.profil-matiere-adapt h3 { margin: 6px 0 2px; font-size: 1rem; }

.confiance-avant { display: grid; gap: 6px; padding: 10px 12px; margin-bottom: 10px; border-radius: 12px; background: var(--seyes-fin); border: 1px solid var(--seyes); }
.confiance-avant p { margin: 0; font-weight: 600; }

/* 🧠 Voici ce que j'ai compris — édition des informations de la leçon */
.infos-lecon { display: grid; gap: 8px; margin: 8px 0; }
.rubrique-comprehension { margin: 14px 0 2px; font-size: 1rem; }
.info-lecon-ligne { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; }
.info-lecon-ligne .source-info { grid-column: 2 / -1; font-size: 0.82rem; }

/* 🔎 Diagnostic qualité document → entraînement */
.diagnostic-lecon { display: grid; gap: 2px; padding: 8px 10px; border-radius: 10px; background: var(--seyes-fin); border: 1px solid var(--trait); }
.diagnostic-lecon[data-cause="ocr"], .diagnostic-lecon[data-cause="document"] { background: var(--indice-fond); border-color: var(--carton-jaune-fonce); }

/* 🧪 Simulation parent — bannière permanente non confondable avec une vraie séance */
.banniere-simulation { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; margin-bottom: 10px;
  border-radius: 12px; background: var(--carton-jaune); color: var(--carton-jaune-texte); border: 2px solid var(--carton-jaune-fonce); }
.banniere-simulation span { flex: 1 1 auto; }
/* Devoir correctement diagnostiqué comme impossible automatiquement (🔴) : pas un formulaire obligatoire. */
.bloc-impossible { border: 1px solid #c05a5a; border-radius: 12px; padding: 8px 10px; background: var(--fond); }
.bloc-impossible > p:first-child { color: #a33; font-weight: 600; margin: 0 0 4px; }

/* 📅 Filtre des devoirs par date (affichage seulement : aucune donnée n'est modifiée). Responsive : les puces reviennent
   à la ligne sur téléphone, tablette et au zoom 200 % (flex-wrap), jamais de débordement horizontal. */
.devoirs-filtrables { margin-top: .25rem; }
.filtre-dates { display: flex; flex-wrap: wrap; gap: .5rem; margin: .1rem 0 1rem; padding: .15rem 0; }
.chip-date { font: inherit; font-size: .95rem; line-height: 1.2; min-height: 2.5em; padding: .45em .9em; border: 1.5px solid var(--trait);
  background: var(--surface); color: var(--encre); border-radius: 999px; cursor: pointer; }
.chip-date:hover { border-color: var(--pelouse-claire); }
.chip-date:focus-visible { outline: 3px solid var(--seyes); outline-offset: 2px; }
.chip-date.actif { background: var(--pelouse); border-color: var(--pelouse); color: var(--craie); font-weight: 600; }
@media (max-width: 480px) { .chip-date { font-size: .9rem; padding: .45em .75em; } }

/* Pied de page commun (identité EDS 22) — discret, responsive, ne gêne pas l'utilisation. */
.pied-eds { text-align: center; color: var(--encre-douce); font-size: .82rem; line-height: 1.45; }
.pied-eds p { margin: .15rem 0; overflow-wrap: anywhere; }
.pied-eds .pied-equipe { font-size: .78rem; }
.pied-eds .pied-prive { color: var(--encre-douce); }
.lien-mentions { background: none; border: 0; padding: 0; color: var(--pelouse-claire); font: inherit; text-decoration: underline; cursor: pointer; }
.lien-mentions:hover { color: var(--pelouse); }
.lien-mentions:focus-visible { outline: 3px solid var(--seyes); outline-offset: 2px; border-radius: 4px; }
/* Page Mentions légales / À propos */
.mentions-bloc h2 { margin-top: 0; }
.mentions-bloc p { line-height: 1.5; overflow-wrap: anywhere; }
.liste-credits { margin: .3rem 0 0; padding-left: 1.1rem; font-size: .9rem; }
.liste-credits li { margin: .25rem 0; overflow-wrap: anywhere; }
@media (max-width: 480px) { .pied-eds { font-size: .78rem; } .pied-eds .pied-equipe { font-size: .74rem; } }

/* Sélecteur d'élève (en-tête parent, multi-élèves ; visible seulement si ≥2 élèves autorisés) */
.selecteur-eleve-bloc { display: inline-flex; align-items: center; gap: .35rem; margin-right: .4rem; max-width: 100%; }
.selecteur-eleve-libelle { font-size: .8rem; color: #fff; opacity: .9; white-space: nowrap; }
.selecteur-eleve {
  font: inherit; font-size: .9rem; padding: .35rem 1.8rem .35rem .6rem; min-height: 40px; border-radius: 999px;
  border: 2px solid rgba(255,255,255,.55); background: rgba(255,255,255,.14); color: #fff; cursor: pointer;
  max-width: 11rem; text-overflow: ellipsis;
}
.selecteur-eleve option { color: #16351f; background: #fff; }
.selecteur-eleve:focus-visible { outline: 3px solid #ffd54a; outline-offset: 2px; }
@media (max-width: 520px) {
  .selecteur-eleve-libelle { display: none; }
  .selecteur-eleve { max-width: 8.5rem; }
}

/* ====================== 👨‍👧 Élèves (gestion multi-élèves, étape 7) ====================== */
.cartes-eleves { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 14px; margin-top: 14px; }
.carte-eleve { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.carte-eleve-archive { opacity: 0.72; background: var(--surface-2); }
.carte-eleve-tete { display: flex; gap: 12px; align-items: flex-start; }
.eleve-avatar { font-size: 2em; line-height: 1; flex: 0 0 auto; }
.carte-eleve-id { min-width: 0; }
.eleve-nom { font-size: 1.15em; margin: 0 0 2px; overflow-wrap: anywhere; }
.eleve-niveau { margin: 0; color: var(--encre-douce); font-size: 0.95em; overflow-wrap: anywhere; }
.eleve-alerte { color: var(--carton-jaune-fonce); font-weight: 600; }
.eleve-archive-tag { color: var(--encre-douce); font-weight: 600; font-size: 0.85em; }
.carte-eleve-etats { display: flex; flex-wrap: wrap; gap: 8px; }
.eleve-etat { font-size: 0.85em; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--trait); }
.eleve-etat[data-ok="oui"] { background: var(--succes-fond); border-color: transparent; color: var(--succes); }
.carte-eleve-actions { flex-wrap: wrap; gap: 8px; }
.carte-eleve-actions .btn { min-height: 40px; }
.choix-avatar { border: 1px solid var(--trait); border-radius: 12px; padding: 8px 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.choix-avatar legend { padding: 0 6px; color: var(--encre-douce); }
.avatar-option { display: inline-flex; align-items: center; justify-content: center; font-size: 1.4em; padding: 4px; border-radius: 10px; cursor: pointer; }
.avatar-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.avatar-option:focus-within, .avatar-option:has(input:checked) { outline: 2px solid var(--pelouse); background: var(--surface-2); }
.ligne-acces { display: flex; align-items: center; gap: 10px; padding: 8px 4px; min-height: 40px; }
.ligne-acces input { width: 20px; height: 20px; }
.message-info { background: var(--surface-2); border: 1px solid var(--trait); border-radius: 12px; padding: 12px 14px; color: var(--encre-douce); }
.aide-eleves { border-left: 4px solid var(--pelouse); }

/* ====================== 📅 Agenda + ⏰ horloge d'en-tête (v1.14.0) ====================== */
.tableau-horloge { display: inline-flex; align-items: center; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.02em;
  opacity: 0.9; padding: 0 8px; white-space: nowrap; color: inherit; align-self: center; }
.btn-agenda { white-space: nowrap; }
.agenda-badge { font-weight: 700; }
/* Écran Agenda */
.agenda-section { margin-top: 18px; }
.agenda-jour { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 12px 14px; margin-top: 12px; }
.agenda-aujourdhui { border-color: var(--pelouse); box-shadow: inset 0 0 0 1px var(--pelouse); background: var(--surface-2); }
.agenda-retard-bloc { border-color: var(--erreur); background: var(--erreur-fond); }
.agenda-jour-titre { margin: 0 0 8px; font-size: 1.02rem; overflow-wrap: anywhere; }
.agenda-liste { display: flex; flex-direction: column; gap: 8px; }
.agenda-item { display: grid; grid-template-columns: 56px 1fr; gap: 10px; align-items: start; padding: 8px 10px; border: 1px solid var(--trait); border-radius: 12px; background: var(--surface); }
.agenda-item-heure { font-weight: 700; color: var(--encre-douce); font-variant-numeric: tabular-nums; }
.agenda-heure-journee { opacity: 0.5; }
.agenda-item-corps { min-width: 0; }
.agenda-item-titre { margin: 0 0 2px; font-weight: 600; overflow-wrap: anywhere; }
.agenda-item-meta { margin: 0; font-size: 0.88rem; color: var(--encre-douce); overflow-wrap: anywhere; }
.agenda-item-desc { margin: 4px 0 0; font-size: 0.9rem; overflow-wrap: anywhere; }
.agenda-item-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.agenda-item-actions .btn { min-height: 40px; }
.agenda-retard { color: var(--erreur); font-weight: 700; }
/* Devoir mis en évidence à l'ouverture depuis l'Agenda */
.devoir-focus { outline: 3px solid var(--pelouse); outline-offset: 2px; border-radius: 12px; animation: devoir-focus-pulse 2.4s ease-out 1; }
@keyframes devoir-focus-pulse { 0% { background: var(--succes-fond); } 100% { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .devoir-focus { animation: none; } }
@media (max-width: 420px) { .agenda-item { grid-template-columns: 44px 1fr; } }

/* ---------- 🎲 Jeux en famille (1.15.0) : salon, partie, énoncés des énigmes, résultats ---------- */
.jeux-zone { display: grid; gap: 18px; }
.jeux-section { display: grid; gap: 12px; }
.jeux-regles summary { cursor: pointer; font-weight: 600; }
.jeux-regles ul { margin: 8px 0 0; padding-left: 22px; display: grid; gap: 4px; }
.jeux-joueur {
  display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-radius: 12px; border: 2px solid var(--trait); background: var(--surface);
}
.jeux-joueur-nom { font-weight: 700; font-size: 1.15rem; margin: 0; overflow-wrap: anywhere; }
.jeux-niveau { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.jeux-ajout { display: grid; gap: 8px; }
.jeux-reglages { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); align-items: end; }
.jeux-reglages .champ { width: 100%; }
.jeux-section > .btn, .jeux-age > .btn, .jeux-age > select { justify-self: start; }
.jeux-reglages > h2, .jeux-reglages > p { grid-column: 1 / -1; }
.jeux-scores { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.jeux-score {
  display: inline-flex; gap: 8px; align-items: baseline; padding: 6px 12px; border-radius: 999px;
  border: 2px solid var(--trait); background: var(--surface); overflow-wrap: anywhere;
}
.jeux-score-actif { border-color: var(--carton-jaune-fonce); background: var(--indice-fond); }
.jeux-score-equipe[data-equipe="A"] { border-color: #2f6fd6; }
.jeux-score-equipe[data-equipe="B"] { border-color: #d9822b; }
.jeux-passage { justify-items: center; text-align: center; }
.jeux-passage-titre { font-family: var(--f-titre); font-weight: 800; font-size: clamp(1.8rem, 6vw, 2.6rem); margin: 0; }
.jeux-question-entete { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.jeux-chrono { font-weight: 700; font-variant-numeric: tabular-nums; padding: 4px 12px; border-radius: 999px; background: var(--succes-fond); }
.jeux-chrono-fin { background: var(--erreur-fond); color: var(--erreur); }
.jeux-signaler { justify-self: start; }
.jeux-enonce, .jeux-calcul { font-size: 1.3rem; font-weight: 600; overflow-wrap: anywhere; }
.jeux-calcul { font-size: clamp(1.5rem, 6vw, 2.2rem); text-align: center; letter-spacing: 0.04em; }
.jeux-rangee { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.jeux-case {
  display: grid; place-items: center; min-width: clamp(42px, 11vw, 60px); height: clamp(42px, 11vw, 60px); padding: 0 6px;
  border-radius: 10px; border: 2px solid var(--trait); background: var(--surface); font-size: clamp(1.15rem, 4.5vw, 1.6rem); font-weight: 700;
}
.jeux-case-cherchee { border: 3px dashed var(--carton-jaune-fonce); background: var(--indice-fond); }
.jeux-case-vide { background: transparent; border-style: dotted; }
.jeux-mots { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.jeux-mots li { padding: 8px 14px; border-radius: 12px; border: 2px solid var(--trait); background: var(--surface); font-size: 1.15rem; font-weight: 600; }
.jeux-equations { display: grid; gap: 6px; justify-items: center; }
.jeux-equation { margin: 0; font-size: clamp(1.3rem, 5vw, 1.8rem); font-weight: 700; }
.jeux-pyramide { display: grid; gap: 6px; justify-items: center; }
.jeux-pyramide-ligne { display: flex; gap: 6px; }
.jeux-brique {
  display: grid; place-items: center; min-width: clamp(44px, 13vw, 70px); height: 44px; border-radius: 6px;
  border: 2px solid var(--carton-jaune-fonce); background: var(--surface); font-weight: 700; font-size: 1.2rem;
}
.jeux-grille { display: grid; grid-template-columns: repeat(var(--n), auto); gap: 6px; justify-content: center; }
.jeux-indices { margin: 0; padding-left: 22px; display: grid; gap: 6px; font-size: 1.1rem; }
.jeux-bilan { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.jeux-bilan li { padding: 12px 16px; border-radius: 12px; display: grid; gap: 6px; overflow-wrap: anywhere; }
.jeux-bilan p { margin: 0; }
.jeux-bilan-ok { background: var(--succes-fond); }
.jeux-bilan-rate { background: var(--erreur-fond); }
.jeux-motif { display: flex; gap: 8px; align-items: center; font-weight: 400 !important; }
.jeux-classement { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.jeux-classement li { padding: 12px 16px; border-radius: 12px; background: var(--surface); box-shadow: var(--ombre); display: grid; gap: 6px; }
.jeux-classement-ligne { margin: 0; font-size: 1.2rem; overflow-wrap: anywhere; }
.jeux-nouveau-badge { margin: 0; font-weight: 600; color: var(--succes); }
.jeux-badges { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.jeux-badges li { padding: 6px 12px; border-radius: 999px; background: var(--indice-fond); border: 1px solid var(--carton-jaune-fonce); }
.jeux-historique, .jeux-signalements { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.jeux-historique li, .jeux-signalements li {
  padding: 10px 14px; border-radius: 12px; border: 1px solid var(--trait); background: var(--surface); overflow-wrap: anywhere;
}
.jeux-historique p, .jeux-signalements p { margin: 2px 0; }
.jeux-signalements li[data-statut="en_attente"] { border: 2px solid var(--carton-jaune-fonce); }
.jeux-commandes { justify-content: flex-end; }
/* 🎲 Jeux en famille — plusieurs appareils (1.16.0) : rejoindre, invitation (code + QR), demandes des invités */
.jeux-rejoindre { display: grid; gap: 8px; padding: 14px 16px; border-radius: 12px; border: 2px dashed var(--trait); background: var(--surface); }
.jeux-champ-code { text-transform: uppercase; letter-spacing: 0.25em; font-weight: 700; font-family: ui-monospace, Consolas, monospace; }
.jeux-invitation { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; }
.jeux-code {
  margin: 4px 0; font-family: ui-monospace, Consolas, monospace; font-weight: 800; font-size: clamp(2rem, 9vw, 3rem);
  letter-spacing: 0.2em; overflow-wrap: anywhere;
}
.jeux-qr { width: min(220px, 70vw); height: auto; border-radius: 8px; box-shadow: var(--ombre); }
.jeux-demande { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-radius: 12px; background: var(--indice-fond); border: 2px solid var(--carton-jaune-fonce); }
.jeux-demande p { margin: 0; overflow-wrap: anywhere; }
/* 🎤🔊 Jeux en famille — interaction multimodale (1.17.0) : écouter, répondre à la voix, réglages du joueur */
.jeux-ecouter { justify-self: start; }
.jeux-voix { display: grid; gap: 8px; padding: 10px 14px; border-radius: 12px; border: 2px dashed var(--trait); }
.jeux-micro { justify-self: start; min-height: 56px; }
.jeux-voix-ecoute { margin: 0; font-weight: 700; color: var(--erreur); }
.jeux-voix-compris { margin: 0; font-size: 1.15rem; overflow-wrap: anywhere; }
.jeux-choix-groupe { border: 1px solid var(--trait); border-radius: 12px; padding: 8px 12px; display: grid; gap: 6px; margin: 0; }
.jeux-choix-groupe legend { font-weight: 700; padding: 0 4px; }
.jeux-choix-option { display: flex; gap: 8px; align-items: center; font-weight: 400 !important; }
.jeux-option-cases { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 4px 12px; }
.jeux-option-multiple .rangee-actions { margin: 0; }
.jeux-libre { display: grid; gap: 8px; }
.jeux-libre .champ { font-size: 1.2rem; }
.jeux-deviner { justify-items: center; text-align: center; }
.jeux-deviner .rangee-actions { justify-content: center; }
.jeux-carte { display: grid; gap: 8px; justify-items: center; width: min(100%, 420px); padding: 18px 16px; border-radius: var(--rayon);
  border: 3px solid var(--carton-jaune-fonce); background: var(--indice-fond); color: var(--encre); box-shadow: var(--ombre); }
.jeux-carte-surveillance { border-color: var(--erreur); }
.jeux-carte-cachee { border-style: dashed; background: var(--surface-2); }
.jeux-carte p { margin: 0; }
.jeux-carte-emoji { font-size: clamp(3rem, 14vw, 4.5rem); line-height: 1.1; }
.jeux-carte-mot { font-family: var(--f-titre); font-weight: 800; font-size: clamp(1.8rem, 8vw, 2.6rem); overflow-wrap: anywhere; }
.jeux-interdits { width: 100%; border-top: 2px dashed var(--erreur); padding-top: 8px; }
.jeux-interdits-titre { font-weight: 700; color: var(--erreur); }
.jeux-interdits ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; font-size: 1.2rem; font-weight: 600; }
.jeux-chrono-grand { font-size: clamp(1.6rem, 8vw, 2.4rem); padding: 6px 20px; margin: 0; }
.jeux-devineurs { width: min(100%, 520px); }
.jeux-devineurs legend { margin: 0 auto; }
.jeux-btn-faute { border-color: var(--erreur); }
.jeux-cartes-tour { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; text-align: start; width: min(100%, 520px); }
.jeux-carte-resultat { padding: 8px 12px; border-radius: 10px; background: var(--surface-2); overflow-wrap: anywhere; }
.jeux-carte-resultat[data-resultat="trouve"] { background: var(--succes-fond); }
.jeux-carte-resultat[data-resultat="faute"] { background: var(--erreur-fond); }
.jeux-dessin { display: grid; gap: 8px; justify-items: center; width: min(100%, 520px); }
.jeux-toile { width: min(100%, 520px); aspect-ratio: 1; height: auto; background: #ffffff; border: 3px solid var(--trait);
  border-radius: 12px; touch-action: none; cursor: crosshair; box-shadow: var(--ombre); }
.jeux-toile-lecture { touch-action: auto; cursor: default; }
.jeux-palette { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.jeux-couleur { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--trait); background: var(--couleur); cursor: pointer;
  font-size: 1.1rem; padding: 0; }
.jeux-gomme { background: #ffffff; }
.jeux-epaisseur { width: 56px; height: 40px; border-radius: 10px; border: 2px solid var(--trait); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; padding: 0 8px; }
.jeux-epaisseur-trait { display: block; width: 100%; border-radius: 99px; background: var(--encre); }
.jeux-couleur[aria-pressed="true"], .jeux-epaisseur[aria-pressed="true"] { outline: 3px solid var(--encre); outline-offset: 2px; }
.jeux-propositions { width: min(100%, 520px); text-align: start; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); }
.jeux-propositions p, .jeux-propositions ul { margin: 0; }
.jeux-propositions ul { list-style: none; padding: 0; display: grid; gap: 2px; overflow-wrap: anywhere; }
.jeux-propositions-titre { font-weight: 700; }
.jeux-vignette { width: 120px; height: 120px; float: inline-start; margin: 0 10px 4px 0; background: #ffffff; border: 2px solid var(--trait);
  border-radius: 8px; }
.jeux-carte-resultat::after { content: ""; display: block; clear: both; }
.tuile-soiree { border: 3px solid var(--carton-jaune-fonce); background: var(--indice-fond); }
.jeux-programme { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; counter-reset: programme; }
.jeux-programme-jeu { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; padding: 8px 12px; border-radius: 12px;
  background: var(--surface-2); counter-increment: programme; }
.jeux-programme-jeu::before { content: counter(programme) "."; font-weight: 800; }
.jeux-programme-nom { font-weight: 700; flex: 1 1 150px; overflow-wrap: anywhere; }
.jeux-programme-ajout { display: grid; gap: 6px; }
.jeux-soiree-classement { display: grid; gap: 8px; }
.jeux-ecouter-sons { justify-self: center; min-height: 56px; font-size: 1.15rem; }
.jeux-demandes { gap: 8px; }
.jeux-demandes .jeux-demande { border: 3px solid var(--carton-jaune-fonce); background: var(--indice-fond); padding: 10px 14px; border-radius: 12px; }
.jeux-liste-invitations { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.jeux-invitation-ligne { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: space-between;
  padding: 8px 12px; border-radius: 12px; background: var(--surface-2); }
.jeux-invitation-ligne p { margin: 0; overflow-wrap: anywhere; }
.jeux-invite-form { display: grid; gap: 6px; }
.jeux-partage { gap: 10px; }
.jeux-partage .rangee-actions a { text-decoration: none; }
.jeux-lien-invitation { margin: 0; font-family: ui-monospace, Consolas, monospace; font-size: 0.85rem; overflow-wrap: anywhere;
  padding: 8px; border-radius: 8px; background: var(--surface-2); }
.jeux-accueil-invite { display: grid; gap: 10px; }
.jeux-bienvenue { border: 3px solid var(--carton-jaune); }
.jeux-ma-facon { justify-content: space-between; }
.jeux-ma-facon p { margin: 0; }

/* ---------- Jeux en famille — EDS 22 : cadre commun du socle (identité, état de la connexion, pied de page) ---------- */
.jeux-identite { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px;
  margin: 0 0 12px; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--trait); }
.jeux-identite-nom { font-family: var(--f-titre); font-weight: 800; font-size: 1.15rem; letter-spacing: 0.04em; color: var(--encre); }
.jeux-tableau .tableau-nom { font-size: clamp(1.25rem, 5vw, 2rem); overflow-wrap: anywhere; }
.jeux-tableau { background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0 48px, transparent 48px 96px); }  /* sans la ligne médiane : le titre reste lisible */
.jeux-connexion { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 0.85rem;
  font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.jeux-connexion-protegee { background: var(--succes-fond); color: var(--encre); border-color: var(--succes); }  /* contraste AA : texte foncé */
.jeux-connexion-reconnexion { background: var(--indice-fond); color: var(--encre); border-color: var(--carton-jaune-fonce); }
.jeux-connexion-locale { background: var(--surface); color: var(--encre-douce); border-color: var(--trait); }
.tableau .jeux-connexion-protegee { background: var(--craie); color: #145a34; border-color: var(--craie); }
.jeux-protection { margin: 4px 0 14px; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--trait); background: var(--surface); }
.jeux-protection p { margin: 4px 0; }
.jeux-protection-titre { font-weight: 800; font-size: 1.05rem; }
.jeux-protection-protegee { border-color: var(--succes); background: var(--succes-fond); }
.jeux-protection-reconnexion { border-color: var(--carton-jaune-fonce); background: var(--indice-fond); }
.jeux-pourquoi { margin: 14px 0; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--trait); }
.jeux-pourquoi summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.jeux-pourquoi ul { margin: 4px 0 8px 1.2em; padding: 0; }
.jeux-apropos { display: grid; gap: 10px; max-height: 60vh; overflow-y: auto; text-align: left; }
.jeux-apropos-section h3 { margin: 4px 0; font-size: 1rem; }
.jeux-apropos-section p { margin: 4px 0; }
.pied-jeux .pied-liens .lien { min-height: 44px; }
.jeux-attente-lancement { font-weight: 700; }
