/* Mathautomatix — composants partagés (piste A « Formes vives »). Mobile d'abord.
   Dépend de base.css. Aucun défilement horizontal à 320 px, cibles ≥ 44 px. */

/* Icônes partagées (masques : la couleur vient de background) */
:root {
  --icone-coche: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 12.5 5 5L20 6.5'/%3E%3C/svg%3E");
  --icone-loupe: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m15.5 15.5 5 5'/%3E%3C/svg%3E");
  --icone-coche-violet: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233A1C9A' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}

/* ───────────── Page ───────────── */

/* Fond violet semé de formes en filigrane (accueil, jouer/, programmes/, a-propos/). */
.page {
  --couleur-focus: var(--soleil);
  display: flex;
  flex-direction: column;
  color: var(--blanc);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='50' fill='%235CC8FF' fill-opacity='.35'/%3E%3C/svg%3E") left -1.5rem top 7rem / 6rem no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Crect x='15' y='15' width='70' height='70' rx='14' fill='%232FD4A3' fill-opacity='.3' transform='rotate(18 50 50)'/%3E%3C/svg%3E") right 5% top 5rem / 5.5rem no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M44 18a7 7 0 0 1 12 0l38 66a7 7 0 0 1-6 10H12a7 7 0 0 1-6-10z' fill='%23FF6B5A' fill-opacity='.35'/%3E%3C/svg%3E") left 3% bottom 10rem / 6.5rem no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='50' fill='%23FFD23F' fill-opacity='.18'/%3E%3C/svg%3E") right 10% bottom 3rem / 9rem no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='40' fill='none' stroke='%23FFFFFF' stroke-opacity='.2' stroke-width='10'/%3E%3C/svg%3E") left 62% bottom 14rem / 4rem no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M20 50h60M50 20v60' stroke='%23FFFFFF' stroke-opacity='.2' stroke-width='12' stroke-linecap='round'/%3E%3C/svg%3E") left 36% bottom 1.5rem / 4rem no-repeat,
    var(--violet);
}
.page > main { flex: 1 0 auto; }

/* Variante claire (eleve/, classe/) : lavande, texte encre. */
.page--clair {
  --couleur-focus: var(--violet-vif);
  color: var(--encre);
  background: var(--lavande);
}

.conteneur {
  width: 100%;
  max-width: var(--largeur-max);
  margin-inline: auto;
  padding-inline: var(--gouttiere);
}

/* Lien d'évitement (inséré par page.js) */
.evitement {
  position: absolute;
  top: 0.5rem; left: 0.5rem;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  font-weight: 700;
  color: var(--encre);
  background: var(--soleil);
  border-radius: 999px;
  transform: translateY(-200%);
}
.evitement:focus, .evitement:focus-visible { transform: none; outline-color: var(--blanc); }

.titre-page { margin-block: 1.5rem 0.75rem; font-size: clamp(2rem, 6vw, 3.25rem); }
.accent { color: var(--soleil); }
.page--clair .accent { color: var(--violet); }
.chapeau { color: var(--lilas); }
.page--clair .chapeau { color: var(--encre-douce); }

/* ───────────── En-tête ───────────── */

.entete { position: relative; z-index: 10; }
.entete__interieur {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding-block: 1rem 0.5rem;
}
.entete__logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: var(--cible);
  margin-inline-end: auto;
  font-family: var(--police-titre);
  font-weight: 800;
  font-size: clamp(1.25rem, 5.5vw, 2rem);
  letter-spacing: -0.01em;
  line-height: 1;
  text-decoration: none;
  color: inherit;
}
.entete__marque { width: 2.25rem; height: auto; }
@media (max-width: 23.75rem) { .entete__marque { display: none; } }

.entete__nav { order: 3; flex-basis: 100%; }
.entete__nav ul { display: flex; flex-wrap: wrap; gap: 0 0.25rem; margin: 0 -0.625rem; padding: 0; list-style: none; }
.entete__nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--cible);
  padding-inline: 0.625rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 999px;
}
/* Petit écran : 2 × 2 liens alignés (jamais un lien seul sur sa ligne), cibles de 48 px. */
@media (max-width: 29.99rem) {
  .entete__nav ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 0.5rem; }
  .entete__nav a { display: flex; }
}
.entete__nav a:hover { color: var(--soleil); }
.entete__nav a[aria-current="page"] {
  color: var(--soleil);
  text-decoration: underline;
  text-decoration-thickness: 4px;
  text-underline-offset: 0.35em;
}
@media (min-width: 60rem) {
  .entete__interieur { flex-wrap: nowrap; gap: 2rem; padding-block: 2rem 1rem; }
  .entete__logo { margin-inline-end: 0; }
  .entete__nav { order: 0; flex: 1 1 auto; flex-basis: auto; }
  .entete__nav ul { gap: 0.5rem 1rem; margin-inline: 0; }
}

.entete__actions { display: flex; align-items: center; gap: 0.5rem; }
.entete__bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-width: var(--cible);
  min-height: var(--cible);
  padding: 0 0.875rem;
  font-weight: 700;
  color: var(--violet);
  background: var(--blanc);
  border: 0;
  border-radius: 999px;
  transition: transform var(--duree) ease;
}
.entete__bouton:hover { transform: translateY(-2px); }
.entete__bouton svg { width: 1.25rem; height: 1.25rem; }
@media (max-width: 37.5rem) {
  .entete__bouton--icone { padding: 0; width: var(--cible); }
  .entete__bouton--icone .entete__libelle {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
  }
}
.page--clair .entete__bouton { color: var(--blanc); background: var(--violet); }
.page--clair .entete__nav a:hover,
.page--clair .entete__nav a[aria-current="page"] { color: var(--violet); }

/* Menu des langues (motif « révélation », pas un menu ARIA) */
.choix-langue { position: relative; }
.choix-langue__liste {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 20;
  min-width: 12rem;
  padding: 0.5rem;
  color: var(--encre);
  background: var(--blanc);
  border-radius: var(--rayon);
  box-shadow: var(--ombre-carte);
  --couleur-focus: var(--violet-vif);
}
.choix-langue__liste button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  min-height: var(--cible);
  padding: 0 0.875rem;
  font-weight: 700;
  text-align: start;
  background: none;
  border: 0;
  border-radius: 12px;
}
.choix-langue__liste button:hover { background: var(--lavande); }
.choix-langue__liste button[aria-current="true"]::after {
  content: "";
  width: 1.25rem; height: 1.25rem;
  background: var(--violet);
  -webkit-mask: var(--icone-coche) center / contain no-repeat;
  mask: var(--icone-coche) center / contain no-repeat;
}

/* ───────────── Pied de page ───────────── */

.pied { margin-top: 3rem; font-size: 0.875rem; color: var(--lilas); }
.pied .conteneur { max-width: 100rem; }
.pied__liste {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 1rem;
  padding-block: 1rem 1.25rem;
  border-top: 2px solid rgb(255 255 255 / 0.15);
}
.pied__element { display: inline-flex; align-items: center; gap: 0.3125rem; min-height: 44px; }
.pied__element svg { width: 1.125rem; height: 1.125rem; opacity: 0.9; }
.pied a { color: var(--blanc); }
.pied a:hover { color: var(--soleil); }
.pied__nom { font-family: var(--police-titre); font-weight: 800; color: var(--blanc); }
.page--clair .pied { color: var(--encre-douce); }
.page--clair .pied__liste { border-top-color: var(--lavande-trait); }
.page--clair .pied a, .page--clair .pied__nom { color: var(--violet); }

/* ───────────── Carte ───────────── */

.carte {
  --couleur-focus: var(--violet-vif);
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  padding: 1.5rem;
  color: var(--encre);
  background: var(--blanc);
  border-radius: var(--rayon-carte);
  box-shadow: var(--ombre-carte);
}
.page--clair .carte { box-shadow: 0 8px 0 var(--lavande-trait); }
.carte a:not([class]) { color: var(--violet); }
.carte__titre { font-family: var(--police-titre); font-weight: 800; font-size: clamp(1.75rem, 5vw, 2.125rem); line-height: 1; }
.carte__texte { color: var(--encre-douce); }
.carte__icone {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4rem; height: 4rem;
  background: var(--lavande);
  border-radius: 20px;
}
.carte__icone svg { width: 2.125rem; height: 2.125rem; }
.carte__icone--soleil { background: var(--soleil); }
.carte__icone--ciel { background: var(--ciel); }
.carte__icone--corail { background: var(--corail); }
.carte__icone--menthe { background: var(--menthe); }
.carte__icone--rose { background: var(--rose); }

/* Carte entièrement cliquable : <a class="carte carte--lien"> */
.carte--lien {
  text-decoration: none;
  transition: transform var(--duree) ease, box-shadow var(--duree) ease;
}
.carte--lien:hover { transform: translateY(-4px); box-shadow: 0 14px 0 var(--violet-fonce); }
.carte--lien:active { transform: translateY(6px); box-shadow: 0 4px 0 var(--violet-fonce); }
.carte--lien:focus-visible { outline-color: var(--soleil); }
.page--clair .carte--lien:focus-visible { outline-color: var(--violet-vif); }
.carte--lien .carte__icone { transition: transform var(--duree) ease; }
.carte--lien:hover .carte__icone { transform: rotate(-6deg) scale(1.06); }

.grille-cartes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 1.25rem;
}
@media (min-width: 52rem) { .grille-cartes--trois { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ───────────── Touche (bouton en relief) ───────────── */

.touche {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: var(--cible);
  padding: 0.5rem 1.25rem;
  font-family: var(--police-titre);
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  color: var(--encre);
  background: var(--blanc);
  border: 3px solid var(--lavande-trait);
  border-radius: 22px;
  box-shadow: var(--ombre-touche);
  transition: transform var(--duree) ease, box-shadow var(--duree) ease;
  -webkit-tap-highlight-color: transparent;
}
.touche:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--lavande-trait); }
.touche:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--lavande-trait); }
.touche:disabled, .touche[aria-disabled="true"] { cursor: not-allowed; transform: none; opacity: 0.6; }
.touche:disabled:is(:hover, :active), .touche[aria-disabled="true"]:is(:hover, :active) { transform: none; }
.touche svg { width: 1.25em; height: 1.25em; }

.touche--principal { color: var(--blanc); background: var(--violet); border-color: var(--violet); box-shadow: 0 5px 0 var(--violet-fonce); }
.touche--principal:hover { box-shadow: 0 7px 0 var(--violet-fonce); }
.touche--principal:active { box-shadow: 0 1px 0 var(--violet-fonce); }

.touche--soleil { color: var(--encre); background: var(--soleil); border-color: var(--soleil); box-shadow: 0 5px 0 var(--soleil-ombre); }
.touche--soleil:hover { box-shadow: 0 7px 0 var(--soleil-ombre); }
.touche--soleil:active { box-shadow: 0 1px 0 var(--soleil-ombre); }

/* Sur fond violet */
.touche--clair { color: var(--violet); background: var(--blanc); border-color: var(--blanc); box-shadow: 0 5px 0 var(--violet-fonce); }
.touche--clair:hover { box-shadow: 0 7px 0 var(--violet-fonce); }
.touche--clair:active { box-shadow: 0 1px 0 var(--violet-fonce); }

/* États d'une réponse choisie (le texte porte aussi l'information) */
.touche--juste { color: var(--juste-encre); background: var(--juste); border-color: var(--juste-trait); box-shadow: 0 5px 0 var(--juste-ombre); }
.touche--revoir { color: var(--revoir-encre); background: var(--revoir); border-color: var(--revoir-trait); box-shadow: 0 5px 0 var(--revoir-ombre); }

.touche--large { width: 100%; }
.touche--grande { min-height: 4.5rem; font-size: 1.75rem; }

/* ───────────── Pastille (pilules de cycle, de niveau, onglets) ───────────── */

.groupe-pastilles { display: flex; flex-wrap: wrap; gap: 0.625rem; }
.pastille {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-height: var(--cible);
  padding: 0 1.25rem;
  font-family: var(--police-titre);
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.1;
  color: var(--lilas);
  background: transparent;
  border: 2px solid var(--violet-trait);
  border-radius: 999px;
  transition: transform var(--duree) ease, background-color var(--duree) ease;
}
.pastille:hover { color: var(--blanc); border-color: var(--lilas); }
.pastille[aria-pressed="true"], .pastille[aria-selected="true"] {
  color: var(--violet);
  background: var(--soleil);
  border-color: var(--soleil);
}
.pastille[aria-pressed="true"]:hover, .pastille[aria-selected="true"]:hover { color: var(--violet); }
.pastille:disabled, .pastille[aria-disabled="true"] {
  cursor: not-allowed;
  border-style: dashed;
}
.pastille:disabled:hover, .pastille[aria-disabled="true"]:hover { color: var(--lilas); border-color: var(--violet-trait); }
/* Raison visible d'un choix indisponible (« bientôt ») */
.pastille__note { font-family: var(--police-texte); font-size: 0.8125rem; font-weight: 700; }

/* Sur fond clair */
.pastille--claire { color: var(--violet); border-color: var(--lavande-trait); background: var(--blanc); }
.pastille--claire:hover { color: var(--violet); border-color: var(--violet-vif); }
.pastille--claire[aria-pressed="true"], .pastille--claire[aria-selected="true"] { color: var(--blanc); background: var(--violet); border-color: var(--violet); }
.pastille--claire[aria-pressed="true"]:hover, .pastille--claire[aria-selected="true"]:hover { color: var(--blanc); }
.pastille--claire:disabled, .pastille--claire[aria-disabled="true"] { color: var(--encre-douce); }

/* Petit badge (« recomposé », « bientôt ») */
.badge {
  display: inline-block;
  padding: 0.0625rem 0.625rem;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--violet);
  background: var(--lavande);
  border: 2px solid var(--lavande-trait);
  border-radius: 999px;
  vertical-align: 0.1em;
  white-space: nowrap;
}
.badge--soleil { color: var(--encre); background: var(--soleil); border-color: var(--soleil); }

/* ───────────── Domaine : couleur + icône + libellé ───────────── */

.domaine {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3125rem 0.875rem 0.3125rem 0.5rem;
  font-family: var(--police-titre);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  color: var(--encre);
  background: var(--lavande);
  border-radius: 999px;
}
.domaine::before {
  content: "";
  flex: none;
  width: 1.25rem; height: 1.25rem;
  margin-inline-start: 0.25rem;
  background: currentColor;
  -webkit-mask: var(--icone-domaine, none) center / contain no-repeat;
  mask: var(--icone-domaine, none) center / contain no-repeat;
}
.domaine--nombres { background: var(--dom-nombres); --icone-domaine: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M4 9h16M4 15h16M10 3 8 21M16 3l-2 18'/%3E%3C/svg%3E"); }
.domaine--grandeurs { background: var(--dom-grandeurs); --icone-domaine: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 15 15 3l6 6L9 21z'/%3E%3Cpath d='m7 11 2 2m1-5 2 2m1-5 2 2'/%3E%3C/svg%3E"); }
.domaine--geometrie { background: var(--dom-geometrie); --icone-domaine: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linejoin='round'%3E%3Cpath d='M3 21 10 7l7 14z'/%3E%3Ccircle cx='17' cy='7' r='4'/%3E%3C/svg%3E"); }
.domaine--donnees { background: var(--dom-donnees); --icone-domaine: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.8' stroke-linecap='round'%3E%3Cpath d='M5 20v-8M12 20V5M19 20v-5'/%3E%3C/svg%3E"); }
.domaine--proportionnalite { background: var(--dom-proportionnalite); --icone-domaine: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M19 5 5 19'/%3E%3Ccircle cx='7' cy='7' r='2.5'/%3E%3Ccircle cx='17' cy='17' r='2.5'/%3E%3C/svg%3E"); }
.domaine--informatique { background: var(--dom-informatique); --icone-domaine: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m8 7-5 5 5 5m8-10 5 5-5 5'/%3E%3C/svg%3E"); }

/* ───────────── Barre de progression ─────────────
   <div class="barre-progression" role="progressbar" aria-valuenow="4" aria-valuemax="10"
        style="--progression: .4"><span></span></div> */
.barre-progression {
  flex-grow: 1;
  height: 0.875rem;
  overflow: hidden;
  background: var(--piste);
  border-radius: 999px;
}
.barre-progression > span {
  display: block;
  width: calc(var(--progression, 0) * 100%);
  height: 100%;
  background: var(--violet-vif);
  border-radius: inherit;
  transition: width 400ms cubic-bezier(.3, 1.4, .5, 1);
}
.page:not(.page--clair) .barre-progression { background: rgb(255 255 255 / 0.2); }
.page:not(.page--clair) .barre-progression > span { background: var(--soleil); }
.carte .barre-progression, .dialogue .barre-progression { background: var(--piste); }
.carte .barre-progression > span, .dialogue .barre-progression > span { background: var(--violet-vif); }

/* ───────────── Retour (juste / à revoir) ───────────── */

.retour {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 1rem 1.25rem;
  font-weight: 700;
  border: 3px solid transparent;
  border-radius: var(--rayon);
}
.retour::before {
  content: "";
  flex: none;
  width: 1.75rem; height: 1.75rem;
  background: currentColor;
  -webkit-mask: var(--icone-retour) center / contain no-repeat;
  mask: var(--icone-retour) center / contain no-repeat;
}
.retour--sans-icone::before { display: none; }
.retour__titre { font-family: var(--police-titre); font-weight: 800; font-size: 1.625rem; line-height: 1.1; }
.retour__texte { flex: 1 1 12rem; font-weight: 400; }
.retour--juste {
  color: var(--juste-encre);
  background: var(--juste);
  border-color: var(--juste-trait);
  --icone-retour: var(--icone-coche);
}
.retour--revoir {
  color: var(--revoir-encre);
  background: var(--revoir);
  border-color: var(--revoir-trait);
  /* Loupe : « à retravailler » (on regarde de plus près), sans idée de recommencer. */
  --icone-retour: var(--icone-loupe);
}

/* ───────────── Dialogue (<dialog> natif) ───────────── */

.dialogue {
  --couleur-focus: var(--violet-vif);
  width: calc(100% - 2rem);
  max-width: 32rem;
  max-height: calc(100% - 2rem);
  padding: 0;
  color: var(--encre);
  background: var(--blanc);
  border: 0;
  border-radius: var(--rayon-carte);
  box-shadow: var(--ombre-carte);
  overflow: auto;
}
.dialogue[open] { animation: dialogue-ouvrir 220ms cubic-bezier(.3, 1.4, .5, 1); }
.dialogue::backdrop { background: rgb(27 19 64 / 0.72); }
.dialogue__corps { display: flex; flex-direction: column; gap: 1.25rem; padding: 1.5rem; }
.dialogue__entete { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.dialogue__titre { font-size: 1.75rem; }
.dialogue__fermer {
  display: inline-flex; align-items: center; justify-content: center;
  flex: none;
  width: var(--cible); height: var(--cible);
  margin: -0.375rem -0.375rem 0 0;
  color: var(--violet);
  background: var(--lavande);
  border: 0;
  border-radius: 50%;
}
.dialogue__fermer svg { width: 1.25rem; height: 1.25rem; }
.dialogue__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.dialogue__actions > * { flex: 1 1 12rem; }
@keyframes dialogue-ouvrir { from { opacity: 0; transform: translateY(12px) scale(.96); } }

/* Pause écran */
.dialogue--pause .dialogue__corps { align-items: center; text-align: center; }
.dialogue--pause .personnage { width: 8.5rem; height: auto; }
.dialogue--pause .dialogue__actions { flex-direction: column; width: 100%; }
.dialogue--pause .dialogue__actions > * { flex: none; width: 100%; }

/* Interrupteur (case à cocher, rôle switch) */
.interrupteurs { display: flex; flex-direction: column; gap: 0.25rem; }
.interrupteur {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--cible);
  padding: 0.375rem 0;
  font-weight: 700;
  cursor: pointer;
}
.interrupteur input {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: none;
  width: 3.5rem; height: 2rem;
  margin: 0;
  background: var(--lavande-trait);
  border-radius: 999px;
  box-shadow: inset 0 0 0 2px var(--violet-trait);
  cursor: pointer;
  transition: background-color var(--duree) ease;
}
.interrupteur input::after {
  content: "";
  position: absolute;
  top: 0.25rem; left: 0.25rem;
  width: 1.5rem; height: 1.5rem;
  background: var(--blanc);
  border-radius: 50%;
  box-shadow: 0 2px 0 rgb(27 19 64 / 0.25);
  transition: transform var(--duree) ease;
}
.interrupteur input:checked { background: var(--violet); box-shadow: none; }
.interrupteur input:checked::after {
  transform: translateX(1.5rem);
  background: var(--soleil) var(--icone-coche-violet) center / 1rem no-repeat;
}

/* ───────────── Accueil ───────────── */

.heros {
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-start;
  gap: 1.5rem;
  padding-block: 1rem 2.5rem;
}
.heros__texte { display: flex; flex-direction: column; gap: 1.5rem; min-width: 0; }
.heros__titre { display: flex; flex-direction: column; }
.heros__personnages {
  position: relative;
  align-self: center;
  width: min(100%, 21.25rem);
  aspect-ratio: 340 / 280;
}
.heros__personnages .personnage { position: absolute; height: auto; }
.heros__personnages .personnage--rond { left: 31%; top: 0; width: 38%; }
.heros__personnages .personnage--carre { left: 2%; top: 39%; width: 39%; rotate: -8deg; }
.heros__personnages .personnage--tri { left: 49%; top: 34%; width: 50%; rotate: 10deg; }
@media (min-width: 52rem) {
  .heros { flex-direction: row; align-items: center; justify-content: space-between; padding-block: 2rem 3rem; }
  .heros__personnages { flex: 0 0 21.25rem; }
}

.personnage--flotte { animation: flotter 4.5s ease-in-out infinite; }
.personnage--flotte:nth-child(2) { animation-delay: -1.5s; }
.personnage--flotte:nth-child(3) { animation-delay: -3s; }
@keyframes flotter { 50% { translate: 0 -8px; } }

.ligne-programme {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.75rem;
  margin-top: 2rem;
  color: var(--lilas);
}
.ligne-programme a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; color: var(--blanc); }
.ligne-programme a:hover { color: var(--soleil); }

/* ───────────── Pages de texte (programmes, à propos) ───────────── */

.pile { display: flex; flex-direction: column; gap: 1.5rem; }
.texte-court { display: flex; flex-direction: column; gap: 0.75rem; }
.texte-court ul { padding-inline-start: 1.25rem; }
.texte-court li + li { margin-top: 0.375rem; }
.liste-source { display: grid; gap: 0.375rem; font-size: 1rem; }
.liste-source dt { font-weight: 700; color: var(--encre-douce); }
.liste-source dd { margin: 0 0 0.5rem; }
.statut { min-height: 1.5em; font-weight: 700; color: var(--juste-encre); }

.onglets { display: flex; flex-wrap: wrap; gap: 0.625rem; margin-block: 0.5rem 1.25rem; }
.domaine-programme > h2 { margin-bottom: 0.25rem; }
.sous-domaine + .sous-domaine { margin-top: 0.75rem; padding-top: 1rem; border-top: 2px solid var(--lavande); }
.sous-domaine h3 { margin-bottom: 0.5rem; }
.sous-domaine h4 { margin-block: 0.75rem 0.25rem; color: var(--encre-douce); }
ol.automatismes { display: flex; flex-direction: column; gap: 0.5rem; padding-inline-start: 1.75rem; list-style: decimal; }
.automatismes li { padding-inline-start: 0.25rem; }
.automatismes li::marker { font-family: var(--police-titre); font-weight: 800; color: var(--violet); }
.automatismes .badge { margin-inline-start: 0.375rem; }
.pile--espacee { margin-top: 1.5rem; }
.domaine-programme > h2 .domaine { font-size: 1.25rem; }
.grille-cartes > li { display: flex; }
.grille-cartes > li > .carte { flex: 1; }
main:focus-visible { outline: none; }
.dialogue--pause .badge { font-size: 1rem; padding: 0.25rem 0.875rem; }
[role="tabpanel"] { display: flex; flex-direction: column; gap: 1rem; }
[role="tabpanel"][hidden] { display: none; }
@media (max-width: 37.5rem) { .entete__bouton { padding: 0 0.625rem; } }

/* Textes riches (rendreTexte) : nombres, unités, fractions empilées — partagés par tous les espaces */
.nombre { white-space: nowrap; font-variant-numeric: tabular-nums; }
.unite { font-weight: 700; }
.fraction {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  vertical-align: middle;
  margin-inline: 0.1em;
  font-size: 0.85em;
  line-height: 1.1;
}
.fraction .num { padding-inline: 0.15em; border-bottom: 0.08em solid currentColor; }
.fraction .den { padding-inline: 0.15em; }
