/* Déclic : feuille commune (page joueur, page parent). Jetons et références : docs/DESIGN.md */

@font-face {
  font-family: "Big Shoulders Display";
  src: url("../polices/big-shoulders-600.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Big Shoulders Display";
  src: url("../polices/big-shoulders-800.woff2") format("woff2");
  font-weight: 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Literata";
  src: url("../polices/literata-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Literata";
  src: url("../polices/literata-400-italique.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Literata";
  src: url("../polices/literata-700.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  --tapis: #14463C;
  --tapis-clair: #1A5447;
  --tapis-ombre: #0E352D;
  --carte: #FBFAF6;
  --encre: #1C2440;
  --craie: #E3EDE7;
  --elle: #F2BE22;
  --baron: #D3263E;
  --juste: #1F7A4D;
  --trait: #C9CDD6;
  --choisi: #FFF4CF;
  --figure-fond: #FFFFFF;
  --figure-encre: #000000;

  --affiche: "Big Shoulders Display", "Literata", serif;
  --texte: "Literata", serif;

  --e1: 0.25rem; --e2: 0.5rem; --e3: 1rem; --e4: 1.5rem; --e5: 2.5rem; --e6: 4rem;
  --colonne: 60rem;
  --rayon-carte: 6px;
  --rayon-bouton: 4px;
  --pose: 0 3px 0 var(--tapis-ombre);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { font-size: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--texte);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--craie);
  background-color: var(--tapis);
  /* la lampe au-dessus de la table */
  background-image: radial-gradient(ellipse 80% 60% at 50% 0%, var(--tapis-clair), var(--tapis) 70%);
  background-attachment: fixed;
}

h1, h2, h3, p { margin: 0; }
button, input { font: inherit; color: inherit; }
code { font-family: var(--texte); font-weight: 700; }

:focus-visible { outline: 3px solid var(--elle); outline-offset: 3px; }
.carte :focus-visible { outline-color: var(--encre); }

/* ---------- cadre ---------- */

.bandeau {
  background: var(--baron);
  color: var(--carte);
  text-align: center;
  padding: var(--e2) var(--e3);
  font-weight: 700;
}

.entete, .table, .pied {
  width: 100%;
  max-width: calc(var(--colonne) + 2 * var(--e5));
  margin: 0 auto;
  padding-left: var(--e5);
  padding-right: var(--e5);
}

.entete {
  display: flex;
  align-items: baseline;
  gap: var(--e4);
  padding-top: var(--e4);
  padding-bottom: var(--e3);
}
.marque {
  font-family: var(--affiche);
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: 0.02em;
  color: var(--elle);
  margin-right: auto;
}
.entete-duel {
  font-family: var(--affiche);
  font-weight: 600;
  font-size: 1.3rem;
  display: flex;
  align-items: baseline;
  gap: var(--e2);
}
.entete-duel strong { font-weight: 800; font-size: 1.6rem; }
.mini-elle { color: var(--elle); }
.mini-contre { font-family: var(--texte); font-style: italic; font-size: 1rem; color: var(--craie); }
.mini-baron strong {
  background: var(--baron);
  color: var(--carte);
  padding: 0 var(--e2);
  border-radius: 2px;
}

.table { flex: 1; padding-bottom: var(--e6); }

.pied {
  display: flex;
  justify-content: flex-end;
  padding-top: var(--e3);
  padding-bottom: var(--e4);
  border-top: 1px solid var(--tapis-clair);
}
.lien-parents { color: var(--craie); font-size: 0.875rem; opacity: 0.8; }
.lien-parents:hover { opacity: 1; }

/* ---------- éléments communs ---------- */

.carte {
  background: var(--carte);
  color: var(--encre);
  border-radius: var(--rayon-carte);
  box-shadow: var(--pose);
  padding: var(--e5) var(--e6) var(--e5) var(--e5);
}

.titre-ecran {
  font-family: var(--affiche);
  font-weight: 800;
  font-size: 2.2rem;
  line-height: 1.1;
  margin-bottom: var(--e3);
}
.titre-bloc {
  font-family: var(--affiche);
  font-weight: 600;
  font-size: 1.6rem;
  line-height: 1.15;
  margin-bottom: var(--e2);
}
.titre-geant {
  font-family: var(--affiche);
  font-weight: 800;
  font-size: 8rem;
  line-height: 0.9;
  color: var(--elle);
  letter-spacing: -0.01em;
}
.sous-titre { font-size: 1.3rem; max-width: 34ch; margin-top: var(--e3); }
.note { font-size: 0.875rem; opacity: 0.85; }
.etiquette {
  display: block;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: var(--e2);
  padding: 0;
}
.erreur { color: var(--baron); font-size: 0.95rem; min-height: 1.5em; margin: var(--e1) 0 var(--e2); }

.actions { display: flex; gap: var(--e3); flex-wrap: wrap; margin-top: var(--e4); }
.actions-droite { justify-content: flex-end; }

.bouton {
  font-family: var(--affiche);
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: 0.03em;
  line-height: 1;
  padding: 0.8rem 1.8rem;
  border: 0;
  border-radius: var(--rayon-bouton);
  background: var(--encre);
  color: var(--carte);
  box-shadow: 0 3px 0 #0A1022;
  cursor: pointer;
}
.bouton:hover:not(:disabled) { background: #2A3560; }
.bouton:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #0A1022; }
.bouton:disabled { opacity: 0.35; cursor: not-allowed; box-shadow: none; }
.bouton-second { background: transparent; color: var(--encre); box-shadow: inset 0 0 0 2px var(--encre); }
.bouton-second:hover:not(:disabled) { background: var(--choisi); }

.table > .ecran > .bouton,
.accueil-jour .bouton {
  background: var(--elle);
  color: var(--encre);
  box-shadow: 0 3px 0 #9C7A10;
}
.accueil-jour .bouton:hover:not(:disabled) { background: #FFD24A; }
.bouton-grand { font-size: 1.9rem; padding: 1rem 2.2rem; }

.bouton-petit {
  font-family: var(--affiche);
  font-weight: 600;
  font-size: 1.1rem;
  padding: 0.35rem 0.9rem;
  border-radius: var(--rayon-bouton);
  background: transparent;
  color: var(--craie);
  border: 2px solid var(--craie);
  cursor: pointer;
}
.bouton-petit:hover:not(:disabled) { background: var(--craie); color: var(--tapis); }
.bouton-petit:disabled { opacity: 0.4; cursor: not-allowed; }

.lien {
  background: none;
  border: 0;
  padding: 0;
  color: var(--craie);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  font-size: 0.95rem;
}

.champ {
  display: block;
  width: 100%;
  max-width: 22rem;
  font-size: 1.3rem;
  padding: 0.6rem 0.8rem;
  background: #FFFFFF;
  color: var(--encre);
  border: 2px solid var(--trait);
  border-radius: var(--rayon-bouton);
}
.champ:focus { border-color: var(--encre); outline: none; box-shadow: 0 0 0 3px var(--elle); }

/* La réplique du Baron : son filet rouge, son italique. */
.replique {
  margin: var(--e4) 0 0;
  padding: var(--e2) 0 var(--e2) var(--e3);
  border-left: 4px solid var(--baron);
}
.replique-texte { font-style: italic; font-size: 1.125rem; line-height: 1.5; }
.replique-signe {
  font-family: var(--affiche);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.03em;
  color: var(--baron);
  margin-top: var(--e1);
}

/* ---------- l'affiche du duel ---------- */

.affiche {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  margin: var(--e3) 0 var(--e5);
}
.affiche-camp {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--e2);
  padding: var(--e4) var(--e5);
  min-height: 11rem;
}
.affiche-elle {
  background: var(--elle);
  color: var(--encre);
  clip-path: polygon(0 0, 100% 0, calc(100% - 2.5rem) 100%, 0 100%);
  padding-right: var(--e6);
}
.affiche-baron {
  background: var(--baron);
  color: var(--carte);
  text-align: right;
  clip-path: polygon(2.5rem 0, 100% 0, 100% 100%, 0 100%);
  padding-left: var(--e6);
}
.affiche-nom {
  font-family: var(--affiche);
  font-weight: 800;
  font-size: 2.2rem;
  line-height: 1;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere; /* le pseudo s'affiche tel que tapé, sans capitales forcées */
}
.affiche-score {
  font-family: var(--affiche);
  font-weight: 800;
  font-size: 5rem;
  line-height: 0.85;
  font-variant-numeric: tabular-nums;
}
.affiche-contre {
  align-self: center;
  font-style: italic;
  font-size: 1.3rem;
  padding: 0 var(--e1);
  margin: 0 -1.25rem;
  position: relative;
  z-index: 1;
  line-height: 1;
}
.affiche-petite .affiche-camp { min-height: 8rem; padding-top: var(--e3); padding-bottom: var(--e3); }
.affiche-petite .affiche-score { font-size: 4rem; }
.affiche-petite .affiche-nom { font-size: 1.6rem; }

/* ---------- profils ---------- */

.affiche-titre { padding: var(--e5) 0 var(--e5); }
.profils-grille {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: var(--e5);
  align-items: start;
}
.liste-profils { list-style: none; margin: var(--e3) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--e3); }
.profil {
  font-family: var(--affiche);
  font-weight: 800;
  font-size: 1.9rem;
  line-height: 1.1;
  padding: var(--e3) var(--e4);
  min-width: 9rem;
  text-align: left;
  background: var(--carte);
  color: var(--encre);
  border: 0;
  border-radius: var(--rayon-carte);
  box-shadow: var(--pose);
  cursor: pointer;
  overflow-wrap: anywhere;
}
.profil:hover { background: var(--elle); }
.carte-profil { padding: var(--e4) var(--e5) var(--e5); max-width: 28rem; }
body[data-ecran="profils"] .marque { visibility: hidden; }
.carte-profil .bouton { margin-top: var(--e2); }

/* ---------- accueil ---------- */

.accueil-corps {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: var(--e6);
  align-items: start;
}
.numero-seance {
  font-family: var(--affiche);
  font-weight: 800;
  font-size: 3.2rem;
  line-height: 1;
  margin-bottom: var(--e4);
}
.message-jour { font-size: 1.3rem; max-width: 30ch; }
.accueil-jour .replique {
  background: var(--carte);
  color: var(--encre);
  border-radius: 0 var(--rayon-carte) var(--rayon-carte) 0;
  padding: var(--e3) var(--e4);
  max-width: 30rem;
  box-shadow: var(--pose);
  margin-top: var(--e5);
}
.accueil-faites .titre-bloc { margin-bottom: 0; }
.liste-faites {
  list-style: none;
  margin: var(--e3) 0 0;
  padding: 0 var(--e2) 0 0;
  max-height: 26rem;
  overflow-y: auto;
  scrollbar-color: var(--craie) var(--tapis-ombre);
}
.faite {
  display: grid;
  grid-template-columns: 2.6rem 1fr auto auto;
  align-items: center;
  gap: var(--e3);
  padding: var(--e2) 0;
  border-top: 1px solid var(--tapis-clair);
}
.faite:last-child { border-bottom: 1px solid var(--tapis-clair); }
.faite-numero { font-family: var(--affiche); font-weight: 800; font-size: 1.9rem; line-height: 1; color: var(--elle); }
.faite-info { display: flex; flex-direction: column; line-height: 1.2; }
.faite-date { font-size: 0.875rem; opacity: 0.8; }
.faite-score { font-family: var(--affiche); font-weight: 600; font-size: 1.1rem; white-space: nowrap; }
.faite-score strong { font-weight: 800; font-size: 1.3rem; }
.faite-elle { color: var(--elle); }
.faite-baron { background: var(--baron); color: var(--carte); padding: 0 0.35rem; border-radius: 2px; }

/* ---------- défi ---------- */
.defi-famille {
  font-family: var(--affiche);
  font-weight: 800;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--tapis);
  display: inline-block;
  padding-bottom: var(--e2);
  border-bottom: 3px solid var(--tapis);
  margin-bottom: var(--e4);
}
.defi-figure {
  margin: var(--e4) 0 0;
  display: block;
  max-width: 36rem;
  padding: var(--e3);
  background: var(--figure-fond);
  color: var(--figure-encre);
  border: 1px solid var(--trait);
  border-radius: var(--rayon-bouton);
}
.defi-figure img { display: block; width: 100%; height: auto; }

.zone-saisie { margin-bottom: var(--e4); }
.saisie-ligne { display: flex; align-items: center; gap: var(--e3); }
.champ-reponse { max-width: 16rem; }
.unite { font-size: 1.125rem; }

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.choix-cases { display: flex; flex-wrap: wrap; gap: var(--e2) var(--e3); }
.choix {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  padding: var(--e2) var(--e4);
  font-size: 1.125rem;
  background: #FFFFFF;
  border: 2px solid var(--trait);
  border-radius: var(--rayon-bouton);
  cursor: pointer;
}
.choix input, .jeton input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.choix:hover { border-color: var(--encre); }
.choix:has(input:checked) { border-color: var(--encre); background: var(--choisi); box-shadow: inset 0 0 0 1px var(--encre); }
/* focus en jaune : il ne se confond pas avec la case choisie (bord bleu nuit) */
.choix:has(input:focus-visible), .jeton:has(input:focus-visible) { outline: 3px solid var(--elle); outline-offset: 3px; }

/* Les jetons de mise */
.jetons { display: flex; gap: var(--e5); flex-wrap: wrap; }
.jeton {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--e2);
  cursor: pointer;
  min-width: 5.5rem;
}
.jeton-num {
  display: grid;
  place-items: center;
  width: 4.25rem;
  height: 4.25rem;
  border-radius: 50%;
  font-family: var(--affiche);
  font-weight: 800;
  font-size: 2rem;
  background: #FFFFFF;
  color: var(--encre);
  border: 3px solid var(--encre);
  /* la tranche striée d'un jeton */
  box-shadow: inset 0 0 0 4px #FFFFFF, inset 0 0 0 7px var(--trait), 0 3px 0 var(--trait);
}
.jeton-sep {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.jeton-mot { font-size: 0.95rem; }
.jeton:hover .jeton-num { box-shadow: inset 0 0 0 4px #FFFFFF, inset 0 0 0 7px var(--elle), 0 3px 0 var(--trait); }
.jeton:has(input:checked) .jeton-num {
  background: var(--elle);
  box-shadow: inset 0 0 0 4px var(--elle), inset 0 0 0 7px var(--encre), 0 3px 0 #9C7A10;
  transform: translateY(-3px);
}
.jeton:has(input:checked) .jeton-mot { font-weight: 700; }

/* Pourquoi ? */

/* Correction : la carte se retourne */
.correction {
  margin-top: var(--e5);
  padding-top: var(--e4);
  border-top: 2px dashed var(--trait);
  animation: retourne 0.35s ease-out;
  transform-origin: top center;
}
@keyframes retourne {
  from { opacity: 0; transform: perspective(60rem) rotateX(-12deg); }
  to { opacity: 1; transform: none; }
}
.correction-verdict {
  font-family: var(--affiche);
  font-weight: 800;
  font-size: 2.2rem;
  line-height: 1;
  margin-bottom: var(--e3);
}
.correction-verdict.est-juste { color: var(--juste); }
.correction-verdict.est-faux { color: var(--baron); }
.correction-reponse { font-size: 1.125rem; margin-bottom: var(--e2); }
.correction-explication { font-size: 1.125rem; line-height: 1.6; max-width: 62ch; white-space: pre-line; }

/* ---------- fin et final ---------- */

.carte-fin { max-width: 44rem; }
.fin-phrase { font-size: 1.3rem; line-height: 1.5; margin-bottom: var(--e2); }
.titre-final { font-size: 6rem; margin: var(--e4) 0 var(--e4); }
.carte-message { max-width: 40rem; margin-top: var(--e5); }
.carte-message p + .actions { margin-top: var(--e4); }

/* ---------- page parent ---------- */

.invisible { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.carte-code { max-width: 28rem; margin-top: var(--e5); }
.carte-code .titre-ecran { font-size: 1.9rem; }
.champ-code { max-width: 9rem; letter-spacing: 0.4em; text-align: center; margin-bottom: var(--e3); }
.aide { font-size: 0.95rem; line-height: 1.5; max-width: 62ch; margin-bottom: var(--e3); }

.parent-tete { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--e4); margin: var(--e3) 0 var(--e4); }
.parent-tete .titre-ecran { margin-bottom: 0; color: var(--craie); }
.parent-tete #parent-pseudo { color: var(--elle); overflow-wrap: anywhere; }
.parent-choix { display: flex; flex-direction: column; gap: var(--e1); }
.champ-select { font-size: 1.05rem; padding: 0.4rem 0.6rem; }

.carte-parent { padding: var(--e4); margin-bottom: var(--e4); }
.carte-parent .note { margin-bottom: var(--e3); max-width: 62ch; }
.carte-parent .aide { margin-bottom: var(--e2); }

.defile { overflow-x: auto; }
.tableau { width: 100%; border-collapse: collapse; font-size: 1rem; font-variant-numeric: tabular-nums; }
.tableau th, .tableau td { padding: var(--e2) var(--e3) var(--e2) 0; border-bottom: 1px solid var(--trait); text-align: left; vertical-align: bottom; }
.tableau thead th { font-size: 0.875rem; font-weight: 700; border-bottom: 2px solid var(--encre); line-height: 1.3; }
.tableau tbody th { font-weight: 400; }
.tableau-bilans tbody th { white-space: nowrap; }
.tableau tbody tr:last-child th, .tableau tbody tr:last-child td { border-bottom: 0; }
.tableau .num { text-align: right; padding-right: var(--e3); white-space: nowrap; }
.tableau thead .num { white-space: normal; }
.tableau .vide::before { content: ""; display: inline-block; width: 1rem; height: 2px; vertical-align: middle; background: var(--trait); }
.sous-entete { display: block; font-weight: 400; font-size: 0.8rem; opacity: 0.8; }
.tableau-bilans td.num { font-family: var(--affiche); font-weight: 600; font-size: 1.3rem; }
.avertissement { margin-top: var(--e3); padding-left: var(--e3); border-left: 4px solid var(--elle); font-style: italic; }

.reglage { padding: var(--e3) 0; border-top: 1px solid var(--trait); }
.reglage:first-of-type { border-top: 0; padding-top: 0; }
.sous-bloc { font-family: var(--affiche); font-weight: 600; font-size: 1.3rem; margin-bottom: var(--e1); }
.reglage .actions { margin-top: var(--e2); }
.reglage .bouton { font-size: 1.1rem; padding: 0.65rem 1.3rem; }
.reglage .bouton-second:disabled { box-shadow: inset 0 0 0 2px var(--encre); }
.bouton-fichier { display: inline-block; cursor: pointer; }
.actions:has(#fichier-import:focus-visible) .bouton-fichier { outline: 3px solid var(--encre); outline-offset: 3px; }
.ligne-champ { display: flex; align-items: flex-start; gap: var(--e3); flex-wrap: wrap; }
.ligne-champ .champ-code { margin-bottom: 0; }
.confirmation { margin-top: var(--e3); padding: var(--e3) var(--e4); border-left: 4px solid var(--elle); }
.confirmation p { margin-bottom: var(--e1); }
.confirmation-phrase { font-weight: 700; margin-bottom: var(--e2); }
.confirmation .actions { margin-top: var(--e3); }
.retour { min-height: 1.5em; margin-top: var(--e2); font-size: 0.95rem; font-weight: 700; }

/* ---------- tablette ---------- */

@media (max-width: 1000px) {
  .entete, .table, .pied { padding-left: var(--e4); padding-right: var(--e4); }
  .accueil-corps { grid-template-columns: 1fr; gap: var(--e5); }
  .carte { padding: var(--e4); }
  .titre-geant { font-size: 6rem; }
  .affiche-score { font-size: 4rem; }
  .affiche-nom { font-size: 1.8rem; }
  .affiche-camp { padding: var(--e3) var(--e4); min-height: 9rem; }
  .affiche-elle { padding-right: var(--e5); }
  .affiche-baron { padding-left: var(--e5); }
  .parent-tete { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .correction { animation: none; }
  .jeton:has(input:checked) .jeton-num { transform: none; }
}

/* ---------- séance v2 : la lecture (docs/DESIGN.md, section « Lecture ») ---------- */

.seance-tete {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--e2) var(--e4);
  margin-bottom: var(--e3);
}
.seance-repere { font-size: 1rem; opacity: 0.9; }
.replique-seance { margin: 0 0 var(--e4); max-width: 48rem; }

.seance-corps { display: grid; grid-template-columns: minmax(0, 48rem); gap: var(--e4); align-items: start; }
.seance-corps.deux-colonnes { grid-template-columns: minmax(0, 34rem) minmax(0, 1fr); gap: var(--e5); }
.seance-corps.deux-colonnes .carte-question { position: sticky; top: var(--e3); }
.seance-corps:not(.deux-colonnes) .feuille[data-mode="texte"] { max-width: 34rem; }

/* La feuille du texte */
.feuille {
  background: var(--carte);
  color: var(--encre);
  border-radius: var(--rayon-carte);
  box-shadow: var(--pose);
  padding: var(--e5) var(--e5) var(--e5) var(--e6);
}
.feuille-titre {
  font-family: var(--affiche);
  font-weight: 800;
  font-size: 1.9rem;
  line-height: 1.05;
  margin-bottom: var(--e4);
}
.texte { font-size: 1.2rem; line-height: 1.7; }
.phrase { position: relative; margin: 0 0 0.35em; max-width: 58ch; }
.phrase::before {
  content: attr(data-phrase);
  position: absolute;
  left: -2.4rem;
  top: 0.2em;
  width: 1.6rem;
  height: 1.6rem;
  display: grid;
  place-items: center;
  font-family: var(--affiche);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  color: var(--tapis);
  border-radius: 50%;
}
.phrase-visee::before { background: var(--elle); color: var(--encre); font-weight: 800; }

/* Le mot à cliquer : un bouton qui garde l'allure du texte */
.mot, .phrase-bouton {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  text-decoration: underline dotted var(--encre) 1px;
  text-underline-offset: 0.22em;
  border-radius: 2px;
}
.phrase-bouton { text-align: left; display: block; width: 100%; }
.mot:hover:not(:disabled), .mot:focus-visible,
.phrase-bouton:hover:not(:disabled), .phrase-bouton:focus-visible {
  background: var(--choisi);
  text-decoration-style: solid;
}
.mot:disabled, .phrase-bouton:disabled { cursor: default; color: inherit; }

/* La preuve, au surligneur */
mark.preuve {
  color: inherit;
  background: linear-gradient(transparent 55%, rgba(242, 190, 34, 0.6) 55%);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  padding: 0 0.05em;
}

/* Le rappel : une étiquette sur le tapis, pas de feuille */
.feuille[data-mode="rappel"] { background: none; box-shadow: none; color: var(--craie); padding: 0; }
.feuille[data-mode="rappel"] .feuille-titre { font-size: 1.6rem; margin-bottom: 0; color: var(--elle); }
.rappel-etiquette { font-style: italic; margin-bottom: var(--e1); }

/* Le texte caché : le dos de la carte */
.feuille[data-mode="dos"] { padding: 0; overflow: hidden; max-width: 48rem; }
.feuille[data-mode="dos"] .feuille-titre {
  font-size: 1.6rem;
  margin: 0;
  padding: var(--e3) var(--e4);
  border-bottom: 1px solid var(--trait);
}
.feuille-dos {
  height: 9rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--e3);
  padding: var(--e3) var(--e4);
  color: var(--craie);
  background-color: var(--encre);
  background-image:
    repeating-linear-gradient(45deg, transparent 0 9px, var(--tapis-clair) 9px 10px),
    repeating-linear-gradient(-45deg, transparent 0 9px, var(--tapis-clair) 9px 10px);
}
.dos-phrase, .dos-mise {
  background: var(--encre);
  padding: var(--e1) var(--e2);
  border-radius: var(--rayon-bouton);
}
.dos-phrase { font-style: italic; }
.dos-mise { display: flex; align-items: center; gap: var(--e2); }
.dos-jeton {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: var(--elle);
  color: var(--encre);
  font-family: var(--affiche);
  font-weight: 800;
  font-size: 1.3rem;
  box-shadow: inset 0 0 0 3px var(--elle), inset 0 0 0 5px var(--encre);
}

/* Cacher le texte : trois jetons-boutons */
.zone-cacher { margin-top: var(--e5); padding-top: var(--e4); border-top: 2px dashed var(--trait); }
.cacher-consigne { font-size: 1.05rem; margin-bottom: var(--e3); max-width: 58ch; }
.cacher-jetons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--e3); }
.bouton-cacher {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--e1);
  text-align: center;
  padding: var(--e3) var(--e2);
  background: #FFFFFF;
  color: var(--encre);
  border: 2px solid var(--trait);
  border-radius: var(--rayon-bouton);
  cursor: pointer;
}
.cacher-num {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  font-family: var(--affiche);
  font-weight: 800;
  font-size: 1.6rem;
  border: 3px solid var(--encre);
  box-shadow: inset 0 0 0 3px #FFFFFF, inset 0 0 0 5px var(--trait);
}
.cacher-num { margin-bottom: var(--e1); }
.cacher-mise { font-weight: 700; }
.cacher-geste { font-size: 0.9rem; }
.bouton-cacher:hover:not(:disabled) { border-color: var(--encre); background: var(--choisi); }
.bouton-cacher:hover:not(:disabled) .cacher-num { background: var(--elle); }
.bouton-cacher:disabled { cursor: default; }

/* La carte de question */
.carte-question { padding: var(--e4) var(--e5) var(--e5); }
.question-enonce { font-size: 1.2rem; line-height: 1.6; max-width: 62ch; white-space: pre-line; margin-bottom: var(--e4); }
.carte-question[data-bloc="calcul"] .question-enonce {
  font-family: var(--affiche);
  font-weight: 800;
  font-size: 3.2rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.carte-question .defi-figure { max-width: 24rem; margin: 0 0 var(--e4); }
.question-support { margin-bottom: var(--e4); }
.support-consigne { margin-bottom: var(--e3); }
.support-lignes {
  list-style: none;
  margin: 0;
  padding: var(--e3) var(--e4);
  background: var(--figure-fond);
  border: 1px solid var(--trait);
  border-radius: var(--rayon-bouton);
  font-size: 1.3rem;
  line-height: 1.7;
  columns: 2;
}
.consigne-clic { font-style: italic; }
.choix-boutons { display: flex; flex-direction: column; align-items: stretch; gap: var(--e2); }
.choix-bouton {
  text-align: left;
  font-size: 1.1rem;
  line-height: 1.4;
  padding: var(--e2) var(--e3);
  min-height: 3rem;
  background: #FFFFFF;
  color: var(--encre);
  border: 2px solid var(--trait);
  border-radius: var(--rayon-bouton);
  cursor: pointer;
}
.choix-bouton:hover:not(:disabled) { border-color: var(--encre); background: var(--choisi); }
.choix-bouton:disabled { cursor: default; }
.zone-mise { margin-top: var(--e4); }
.carte-question .actions { margin-top: var(--e3); }
.carte-question .zone-saisie { margin-bottom: 0; }

/* Les maillons : des bandelettes de papier */
.maillons-cote { display: flex; flex-direction: column; gap: var(--e2); margin-bottom: var(--e4); }
.maillons-places {
  list-style: none;
  counter-reset: rang;
  margin: 0;
  padding: 0 0 0 var(--e3);
  display: flex;
  flex-direction: column;
  gap: var(--e2);
  min-height: 3rem;
  border-left: 3px solid var(--trait);
}
.maillons-places li { counter-increment: rang; display: flex; align-items: center; gap: var(--e2); }
.maillons-places li::before {
  content: counter(rang);
  flex: none;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--elle);
  font-family: var(--affiche);
  font-weight: 800;
  font-size: 1.1rem;
}
.maillon, .maillon-vide { min-height: 2.8rem; }
.maillon {
  flex: 1;
  text-align: left;
  font-size: 1.05rem;
  line-height: 1.4;
  padding: var(--e2) var(--e3);
  background: #FFFFFF;
  color: var(--encre);
  border: 1px solid var(--trait);
  border-left: 4px solid var(--trait);
  border-radius: 2px;
  box-shadow: 0 2px 0 var(--trait);
  cursor: pointer;
}
.maillon:hover:not(:disabled) { border-left-color: var(--elle); background: var(--choisi); }
.maillon:disabled { cursor: default; }
.maillon-vide { display: block; border: 1px dashed var(--trait); border-radius: 2px; }

/* Restitution */
.restitution-consigne { font-size: 1.2rem; line-height: 1.6; margin-bottom: var(--e4); max-width: 62ch; }
.champ-long { max-width: none; font-family: var(--texte); font-size: 1.1rem; line-height: 1.6; resize: vertical; }
.restitution-comparaison { display: grid; grid-template-columns: 1fr 1fr; gap: var(--e4); }
.restitution-sien, .restitution-modele { font-size: 1.05rem; line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.restitution-modele { padding-left: var(--e3); border-left: 4px solid var(--juste); }
.restitution-points { grid-column: 1 / -1; margin-top: var(--e3); }
.point { margin-bottom: var(--e3); display: flex; flex-wrap: wrap; gap: var(--e2) var(--e3); align-items: center; }
.point-texte { float: left; width: 100%; font-weight: 700; margin-bottom: var(--e1); }
.choix-petit { min-height: 2.4rem; font-size: 1rem; padding: var(--e1) var(--e3); }

/* Correction v2 */
.carte-question .correction { margin-top: var(--e3); padding-top: var(--e3); }
.correction-phrase {
  margin: var(--e2) 0 var(--e3);
  padding-left: var(--e3);
  border-left: 4px solid var(--elle);
  font-size: 1.1rem;
  line-height: 1.6;
}
.correction-ordre { margin: var(--e2) 0; padding-left: var(--e4); font-size: 1.05rem; line-height: 1.5; }
.correction-intrus { margin-bottom: var(--e3); }
.correction-defauts { list-style: none; margin: var(--e3) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--e3); }
.correction-defauts li { padding-left: var(--e3); border-left: 4px solid var(--baron); }
.defaut-choix { display: block; font-weight: 700; }
.defaut-texte { display: block; font-size: 1rem; line-height: 1.5; }

/* Fin v2 */
.fin-justes { font-family: var(--affiche); font-weight: 800; font-size: 2.2rem; color: var(--elle); margin: var(--e3) 0 var(--e4); }
.fin-annonce { font-size: 1.1rem; font-style: italic; margin-top: var(--e3); padding-left: var(--e3); border-left: 3px solid var(--elle); }

@media (max-width: 1000px) {
  .seance-corps.deux-colonnes { grid-template-columns: minmax(0, 1fr); }
  .seance-corps.deux-colonnes .carte-question { position: static; }
  .feuille { padding: var(--e4) var(--e4) var(--e4) var(--e6); }
  .restitution-comparaison { grid-template-columns: 1fr; }
}


/* L'énoncé reçoit le focus quand la réponse est un choix : aucun choix ne paraît suggéré. Il n'est pas dans
   l'ordre de tabulation et ne porte pas d'anneau : ce n'est pas une commande. */
.question-enonce:focus, .question-enonce:focus-visible { outline: none; }
.correction-ordre-titre { margin-top: var(--e2); }

/* ---------- page parent v2 : tableaux larges, restitutions ---------- */

/* Les séances se lisent sur douze colonnes : la page parent prend plus de largeur que la table de jeu. */
.page-parent .entete, .page-parent .table { max-width: 84rem; }

.tableau-seances { font-size: 0.95rem; }
.tableau-seances th, .tableau-seances td { padding-right: var(--e2); }
.tableau-seances .num { padding-right: var(--e2); }
.tableau-seances thead th { vertical-align: bottom; }
.tableau-seances tbody th { font-weight: 700; white-space: nowrap; }
.tableau-seances td:last-child { min-width: 9rem; padding-right: 0; }
.tableau-seances tbody tr:hover { background: var(--choisi); }

.tableau-finesses tbody th { font-weight: 700; white-space: nowrap; }
.tableau-finesses td:nth-child(2) { width: 100%; }
.tableau-finesses td.num { font-family: var(--affiche); font-weight: 600; font-size: 1.3rem; white-space: nowrap; }

.restitution { padding: var(--e3) 0; border-top: 1px solid var(--trait); }
.restitution:first-child { border-top: 0; padding-top: 0; }
.restitution-tete { display: flex; align-items: baseline; gap: var(--e3); margin-bottom: var(--e2); }
.restitution-titre { font-family: var(--affiche); font-weight: 600; font-size: 1.3rem; }
.restitution-date { font-size: 0.875rem; opacity: 0.8; }
.restitution-colonnes { display: grid; grid-template-columns: 1fr 1fr; gap: var(--e4); }
.restitution-colonne { min-width: 0; }
.restitution-etiquette { font-size: 0.875rem; font-weight: 700; margin-bottom: var(--e1); }
.restitution-texte, .restitution-modele { max-width: 62ch; overflow-wrap: anywhere; white-space: pre-wrap; }
.restitution-modele { padding-left: var(--e3); border-left: 4px solid var(--trait); }
.restitution-points { list-style: none; margin: var(--e3) 0 0; padding: 0; display: grid; gap: var(--e1); }
.verdict { display: inline-block; min-width: 4.2rem; margin-right: var(--e2); padding: 0 var(--e2); border-radius: 2px; text-align: center; font-size: 0.875rem; font-weight: 700; }
.verdict.dit { background: var(--juste); color: var(--carte); }
.verdict.pas-dit { box-shadow: inset 0 0 0 2px var(--baron); color: var(--baron); }

@media (max-width: 1000px) {
  .restitution-colonnes { grid-template-columns: 1fr; gap: var(--e3); }
}
.tableau-finesses thead .num { white-space: nowrap; }

/* À 768 px les douze colonnes tiennent : la valeur chiffrée ne se coupe pas, son préfixe et son suffixe passent dessous. */
@media (max-width: 1000px) {
  .page-parent .carte-parent { padding: var(--e3); }
  .page-parent .entete, .page-parent .table { padding-left: var(--e3); padding-right: var(--e3); }
  .tableau-seances { font-size: 0.8rem; }
  .tableau-seances th, .tableau-seances td, .tableau-seances .num { padding-right: 0.35rem; }
  .tableau-seances tbody th { white-space: normal; }
  .tableau-seances td:last-child { min-width: 0; }
  .tableau-seances .avant, .tableau-seances .apres, .tableau-seances .valeur { display: block; }
  .tableau-seances .avant, .tableau-seances .apres { font-size: 0.8rem; opacity: 1; }
}
