/* Jeu : le mot caché */

/* Repli pour les navigateurs sans color-mix() (Safari avant 16.2, vieux iPad) : sous chaque règle qui mélange
   des couleurs, un petit bloc @supports not redonne une couleur simple de base.css (la plus présente du mélange).
   Une ligne de repli écrite juste avant ne suffirait pas : une valeur qui contient var() est jugée trop tard,
   elle devient « unset » (le noir d'un SVG, un fond transparent). */

.mot-cache__choix {
  justify-content: center;
}

/* Les sortes de pièges ont chacune leur couleur et leur trait (les mêmes dans le détective) */
.mot-cache__q--muette { --q: var(--violet); --q-trait: dotted; }
.mot-cache__q--son { --q: var(--rouge); --q-trait: wavy; }
.mot-cache__q--double { --q: var(--vert); --q-trait: double; }
.mot-cache__q--accent { --q: var(--bleu); --q-trait: solid; }

/* ---------- La séance : de petits jalons, sans chiffres ---------- */

.mot-cache__seance {
  display: flex;
  justify-content: center;
  gap: var(--espace-2);
  min-height: 0.6rem;
}

.mot-cache__jalon {
  width: 1.6rem;
  height: 0.55rem;
  border-radius: 99px;
  background: var(--trait);
  transition: background var(--duree), transform var(--duree);
}

.mot-cache__jalon--juste {
  /* le code des couleurs (22/10/2026) : juste = vert pâle, bordé de vert foncé (trop petit pour une coche) */
  background: var(--fn-juste);
  box-shadow: inset 0 0 0 2px var(--fn-juste-texte);
}

.mot-cache__jalon--passe {
  background: color-mix(in srgb, var(--trait) 55%, transparent);
}
@supports not (color: color-mix(in srgb, red 50%, blue)) { .mot-cache__jalon--passe { background: var(--trait); } }

.mot-cache__jalon.est-actuel {
  transform: scaleY(1.5);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--encre-2);
}

/* ---------- La carte ---------- */

.mot-cache__carte {
  --mot-cache-taille: 2.6rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: var(--espace-4);
  width: 100%;
  max-width: 44rem;
  padding: var(--espace-5) var(--espace-3);
  border-radius: var(--rayon-grand);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 2px var(--trait);
}

.mot-cache__tete {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--espace-4);
  width: 100%;
  max-width: 34rem;
}

.mot-cache__image {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 50%;
  background: var(--bois);
  box-shadow: inset 0 -4px 0 var(--bois-flanc);
  font-size: 1.8rem;
}

.mot-cache__image > .icone {
  width: 2.2rem;
  height: 2.2rem;
}

.mot-cache__illustration {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin: 0 auto;
  padding: 12px 14px;
  border-radius: 18px;
  background: #f5ebd8;
  color: #1e293b;
  border: 2px solid #d8cbb3;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  max-width: 25rem;
  width: 100%;
}

.mot-cache__illustration .bouton-voix {
  background: #ebe0c9;
  color: #1e293b;
  box-shadow: inset 0 0 0 2px #cbbba0;
}

.mot-cache__illustration-img {
  display: block;
  width: 100%;
  max-width: 22rem;
  height: auto;
  border-radius: 12px;
}

.mot-cache__illustration-legende {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.4;
  font-weight: 700;
  color: #1e293b;
  text-align: center;
}

.mot-cache__dire {
  display: flex;
  align-items: center;
  gap: var(--espace-3);
  min-width: 0;
}

.mot-cache__phrase {
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.4;
}

/* Rien dans la carte ne doit l'élargir (un long mot, le clavier) */
.mot-cache__carte > *,
.mot-cache__fin > *,
.mot-cache__mes > * {
  min-width: 0;
  max-width: 100%;
}

/* ---------- La vitre et son rideau ---------- */

.mot-cache__vitre {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: calc(var(--mot-cache-taille) * 1.12 + 3.6rem);
  padding: 1.9rem var(--espace-3) var(--espace-4);
  border-radius: var(--rayon-grand);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 30%, var(--trait));
  overflow: hidden;
  scroll-margin-top: 5.5rem;
}
@supports not (color: color-mix(in srgb, red 50%, blue)) { .mot-cache__vitre { background: var(--surface); } }

.mot-cache__tuiles,
.mot-cache__essai {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 5px;
  max-width: 100%;
}

.mot-cache__lettre {
  --taille: var(--mot-cache-taille);
  min-width: calc(var(--taille) * 0.86);
  padding: 0 0.06em;
  border: 0;
  text-decoration-thickness: 0.09em;
  text-underline-offset: 0.16em;
}

button.mot-cache__lettre {
  cursor: pointer;
}

/* Le code des couleurs (22/10/2026) : le piège est surligné en jaune ; sa sorte se lit au trait souligné
   (pointillés, vague, double, plein), dans la couleur de la sorte ; ce qu'on vient de marquer porte le contour bleu */
.mot-cache__lettre.est-piege {
  background: var(--fn-piege);
  color: var(--fn-piege-texte);
  text-decoration-line: underline;
  text-decoration-style: var(--q-trait);
  text-decoration-color: var(--q);
  box-shadow: inset 0 -6px 0 var(--bois-flanc), 0 0 0 4px var(--fn-piege), 0 0 0 6px var(--fn-piege-texte);
}

.mot-cache__lettre.est-marquee {
  position: relative;
  background: var(--fn-piege);
  color: var(--fn-piege-texte);
  text-decoration-line: underline;
  text-decoration-style: wavy;
  text-decoration-color: var(--fn-piege-texte);
  box-shadow: inset 0 -6px 0 var(--bois-flanc), 0 0 0 4px var(--fn-piege), 0 0 0 6px var(--fn-piege-texte);
}

.mot-cache__lettre.est-marquee::after {
  content: "✓";
  position: absolute;
  top: -0.55em;
  right: -0.35em;
  display: grid;
  place-items: center;
  width: 1.35em;
  height: 1.35em;
  border-radius: 50%;
  background: var(--fn-juste);
  color: var(--fn-juste-texte);
  box-shadow: 0 0 0 1.5px var(--fn-juste-texte);
  font-size: max(0.75rem, calc(var(--taille) * 0.26));
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.mot-cache__lettre.est-verifiee {
  box-shadow: inset 0 -6px 0 var(--bois-flanc), 0 0 0 3px var(--trait);
}

/* Les lettres de l'essai qui sont justes restent, en vert pâle (les autres s'en vont, ou laissent un « ? ») */
.mot-cache__lettre.tuile--allumee {
  background: var(--fn-juste);
  color: var(--fn-juste-texte);
  box-shadow: inset 0 -6px 0 var(--bois-flanc), 0 0 0 2px var(--fn-juste-texte);
}

/* la coche, posée sur le coin : la lettre ne s'élargit pas */
.mot-cache__essai .mot-cache__lettre.tuile--allumee {
  position: relative;
}

.mot-cache__essai .mot-cache__lettre.tuile--allumee::after {
  content: '\2713';
  position: absolute;
  top: -0.55em;
  right: -0.35em;
  display: grid;
  place-items: center;
  width: 1.35em;
  height: 1.35em;
  border-radius: 50%;
  background: var(--fn-juste);
  color: var(--fn-juste-texte);
  box-shadow: 0 0 0 1.5px var(--fn-juste-texte);
  font-size: max(0.75rem, calc(var(--taille) * 0.26));
  font-weight: 700;
  line-height: 1;
}

.mot-cache__rebond {
  animation: mot-cache-rebond 300ms ease;
}

@keyframes mot-cache-rebond {
  40% { transform: translateY(-6px); }
}

/* Le rideau : replié en haut (on voit sa frange et sa tirette), il descend sur le mot */
.mot-cache__rideau {
  position: absolute;
  inset: 0 0 auto 0;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0 0 16px 16px;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.18), transparent 30%),
    repeating-linear-gradient(90deg, var(--accent) 0 16px, color-mix(in srgb, var(--accent) 72%, #000) 16px 26px);
  box-shadow: 0 6px 12px var(--ombre);
  transform: translateY(calc(-100% + 1.9rem));
  transition: transform 460ms cubic-bezier(0.3, 0.9, 0.3, 1.05);
  cursor: grab;
  touch-action: none;
}
@supports not (color: color-mix(in srgb, red 50%, blue)) { .mot-cache__rideau { background: linear-gradient(180deg, rgba(0, 0, 0, 0.18), transparent 30%), repeating-linear-gradient(90deg, var(--accent) 0 16px, var(--accent) 16px 26px); } }

.mot-cache__rideau.sans-animation,
.mot-cache__rideau.est-tire {
  transition: none;
}

.mot-cache__rideau.est-tire {
  cursor: grabbing;
}

.mot-cache__vitre.est-cache .mot-cache__rideau {
  transform: translateY(0);
  cursor: default;
}

.mot-cache__rideau[disabled] {
  cursor: default;
}

.mot-cache__vitre:not(.est-cache) .mot-cache__rideau[disabled] {
  filter: saturate(0.5);
  opacity: 0.7;
}

.mot-cache__tissu {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(ellipse 60% 40% at 50% 45%, rgba(255, 255, 255, 0.12), transparent 70%);
}

.mot-cache__frange {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0.7rem;
  background: radial-gradient(circle at 8px 0, color-mix(in srgb, var(--accent) 72%, #000) 6px, transparent 6.5px) 0 0 / 16px 100% repeat-x;
  transform: translateY(55%);
}
@supports not (color: color-mix(in srgb, red 50%, blue)) { .mot-cache__frange { background: radial-gradient(circle at 8px 0, var(--accent) 6px, transparent 6.5px) 0 0 / 16px 100% repeat-x; } }

.mot-cache__tirette {
  position: absolute;
  left: 50%;
  bottom: 0.32rem;
  width: 2.8rem;
  height: 1.05rem;
  margin-left: -1.4rem;
  border-radius: 99px;
  background: var(--jaune);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.22);
}

.mot-cache__rideau.est-invitant .mot-cache__tirette {
  animation: mot-cache-tirette 1.5s ease-in-out infinite;
}

@keyframes mot-cache-tirette {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

/* ---------- Les pièges trouvés ---------- */

.mot-cache__compteur {
  font-weight: 700;
  text-align: center;
}

.mot-cache__pieges {
  display: grid;
  gap: var(--espace-2);
  width: 100%;
  max-width: 34rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mot-cache__pieges:empty {
  display: none;
}

.mot-cache__piege {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--espace-3);
  align-items: center;
  padding: var(--espace-2) var(--espace-3);
  border-radius: var(--rayon);
  background: var(--surface);
  box-shadow: inset 4px 0 0 var(--q);
}

.mot-cache__piege.est-neuf {
  animation: entrer 420ms cubic-bezier(0.2, 0.9, 0.3, 1.3);
}

.mot-cache__piege-lettres {
  min-width: 2.4rem;
  padding: 0.1rem 0.45rem;
  border-radius: 8px;
  background: var(--bois);
  color: var(--bois-encre);
  font-weight: 700;
  font-size: 1.4rem;
  text-align: center;
  text-decoration: underline var(--q-trait) var(--q);
  text-decoration-thickness: 3px;
  text-underline-offset: 0.18em;
}

.mot-cache__piege-texte {
  font-size: 1.02rem;
  line-height: 1.4;
}

.mot-cache__message {
  max-width: 32rem;
  min-height: 1.5em;
  font-size: 1.12rem;
  text-align: center;
}

.mot-cache__message:empty {
  min-height: 0;
}

/* ---------- Écrire ---------- */

.mot-cache__essai {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  min-width: min(100%, 16rem);
  min-height: calc(var(--mot-cache-taille) * 1.12 + 8px);
  padding: 4px;
  border-bottom: 3px solid var(--trait);
}

.mot-cache__essai-trace {
  width: 100%;
  margin-bottom: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--rouge) 12%, var(--surface));
  color: var(--encre);
  font-size: 0.92rem;
  font-weight: 700;
  text-align: center;
}
@supports not (color: color-mix(in srgb, red 50%, blue)) { .mot-cache__essai-trace { background: var(--surface); } }

.mot-cache__ecrite {
  animation: mot-cache-tape 160ms ease-out;
}

@keyframes mot-cache-tape {
  from { transform: translateY(-30%); opacity: 0.2; }
}

.mot-cache__curseur {
  min-width: calc(var(--mot-cache-taille) * 0.5);
  background: transparent;
  box-shadow: inset 0 -4px 0 var(--accent);
  animation: mot-cache-curseur 1.1s steps(2) infinite;
}

@keyframes mot-cache-curseur {
  50% { box-shadow: inset 0 -4px 0 transparent; }
}

.mot-cache__part {
  animation: mot-cache-part 360ms ease-in forwards;
}

@keyframes mot-cache-part {
  to { transform: scale(0.4); opacity: 0; }
}

.mot-cache__trou {
  /* le code des couleurs : le « ? » cache ce qu'on cherche, surligné en jaune */
  background: var(--fn-piege);
  color: var(--fn-piege-texte);
  box-shadow: inset 0 0 0 2px var(--fn-piege-texte);
  border-style: dashed;
}

.mot-cache__trou.est-montre {
  background: var(--bois);
  color: var(--bois-encre);
  box-shadow: inset 0 -6px 0 var(--bois-flanc), 0 0 0 3px var(--fn-change);
  animation: entrer 360ms cubic-bezier(0.2, 0.9, 0.3, 1.3);
}

.mot-cache__clavier {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(3rem, 1fr));
  gap: 6px;
  width: 100%;
  max-width: 40rem;
}

.mot-cache__touche {
  --taille: 3rem;
  min-width: 0;
  width: 100%;
  height: 3.1rem;
  padding: 0;
  border: 0;
  font-size: 1.45rem;
}

.mot-cache__touche--large {
  grid-column: span 2;
  font-size: 1.1rem;
}

.mot-cache__touche--accents {
  background: var(--surface);
  color: var(--encre);
  box-shadow: inset 0 0 0 2px var(--trait), inset 0 -5px 0 var(--trait);
}

.mot-cache__touche--accents[aria-pressed="true"] {
  background: var(--accent);
  color: var(--sur-accent);
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.25);
}

.mot-cache__effacer,
.mot-cache__effacer svg {
  display: block;
  width: 2.1rem;
  height: 1.6rem;
}

.mot-cache__actions {
  min-height: 3rem;
}

/* ---------- Le chemin des trois jours ---------- */

.mot-cache__chemin {
  display: grid;
  justify-items: center;
  gap: var(--espace-2);
  padding-top: var(--espace-3);
  border-top: 2px dashed var(--trait);
  width: 100%;
  max-width: 30rem;
  text-align: center;
}

.mot-cache__chemin-legende {
  font-size: 0.95rem;
}

.mot-cache__cases {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.mot-cache__case {
  position: relative;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 6px;
  background: var(--surface);
  box-shadow: inset 0 0 0 2.5px var(--encre-2);
}

.mot-cache__case.est-cochee {
  background: var(--fn-juste);
  box-shadow: inset 0 0 0 2.5px var(--fn-juste-texte);
}

.mot-cache__case.est-cochee::after {
  content: "";
  position: absolute;
  left: 0.55rem;
  top: 0.2rem;
  width: 0.5rem;
  height: 0.95rem;
  border-right: 4px solid var(--fn-juste-texte);
  border-bottom: 4px solid var(--fn-juste-texte);
  transform: rotate(40deg);
}

.mot-cache__case.est-neuve::after {
  animation: mot-cache-coche 500ms cubic-bezier(0.2, 0.9, 0.3, 1.4);
}

@keyframes mot-cache-coche {
  from { transform: rotate(40deg) scale(0); }
  to { transform: rotate(40deg) scale(1); }
}

.mot-cache__etoile {
  display: inline-flex;
  width: 2rem;
  height: 2rem;
  margin-left: 0.2rem;
}

.mot-cache__etoile-dessin,
.mot-cache__etoile-dessin svg {
  display: block;
  width: 100%;
  height: 100%;
}

.mot-cache__etoile svg path {
  fill: transparent;
  stroke: var(--encre-2);
  stroke-width: 1.6;
  stroke-linejoin: round;
  stroke-dasharray: 3 2.5;
}

.mot-cache__etoile.est-gagnee svg path {
  fill: var(--jaune);
  stroke: var(--encre);
  stroke-dasharray: none;
}

.mot-cache__etoile.est-revue svg path {
  stroke: var(--fn-juste-texte);
  stroke-width: 2;
}

.mot-cache__etoile.est-neuve {
  animation: mot-cache-etoile 800ms cubic-bezier(0.2, 0.9, 0.3, 1.4);
}

@keyframes mot-cache-etoile {
  0% { transform: scale(0.2) rotate(-90deg); }
  100% { transform: none; }
}

/* ---------- Mes mots de la semaine ---------- */

.mot-cache__mes {
  display: grid;
  gap: var(--espace-3);
  width: 100%;
  max-width: 40rem;
  padding: var(--espace-4) var(--espace-5);
  border-radius: var(--rayon-grand);
  background: var(--surface-2);
}

.mot-cache__mes-ferme {
  justify-content: space-between;
}

.mot-cache__mes-titre {
  font-family: var(--police-titre);
  font-weight: 400;
  font-size: 1.15rem;
}

.mot-cache__ajout {
  display: flex;
  flex-wrap: wrap;
  gap: var(--espace-2);
}

.mot-cache__champ {
  flex: 1 1 12rem;
  min-width: 0;
  min-height: 3rem;
  padding: 0.5rem 0.9rem;
  border: 0;
  border-radius: var(--rayon);
  background: var(--surface);
  box-shadow: inset 0 0 0 2px var(--trait);
  font-size: 1.25rem;
  font-weight: 700;
}

.mot-cache__champ:focus-visible {
  box-shadow: inset 0 0 0 3px var(--accent);
  outline: none;
}

.mot-cache__aide {
  min-height: 1.2em;
  font-size: 0.95rem;
  color: var(--encre-2);
}

.mot-cache__aide:empty {
  min-height: 0;
}

.mot-cache__mes-liste {
  display: flex;
  flex-wrap: wrap;
  gap: var(--espace-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.mot-cache__mes-mot {
  gap: 0.2rem;
  padding: 0.15rem 0.2rem 0.15rem 0.7rem;
  font-size: 1.1rem;
  background: var(--surface);
}

.mot-cache__retirer {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--encre-2);
}

.mot-cache__retirer:hover {
  background: var(--surface-2);
  color: var(--encre);
}

/* ---------- La fin de la séance, le carnet ---------- */

.mot-cache__fin {
  display: grid;
  justify-items: center;
  gap: var(--espace-4);
  width: 100%;
  max-width: 34rem;
  padding: var(--espace-5);
  border-radius: var(--rayon-grand);
  background: var(--surface-2);
  text-align: center;
}

.mot-cache__fin-titre {
  font-size: var(--t-titre-3);
  font-weight: 700;
}

.mot-cache__fin-liste {
  display: grid;
  gap: var(--espace-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.mot-cache__fin-mot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--espace-3);
}

.mot-cache__fin-ecrit {
  min-width: 7rem;
  font-size: 1.4rem;
  font-weight: 700;
}

.mot-cache__truc {
  display: grid;
  justify-items: center;
  width: 100%;
}

.mot-cache__carnet {
  display: grid;
  gap: var(--espace-2);
  width: 100%;
  max-width: 40rem;
}

.mot-cache__carnet-mots {
  display: flex;
  flex-wrap: wrap;
  gap: var(--espace-2);
}

.mot-cache__carnet-mot {
  gap: 0.35rem;
  font-size: 1rem;
}

.mot-cache__carnet-mot .mot-cache__etoile-dessin {
  width: 1.1rem;
  height: 1.1rem;
}

.mot-cache__carnet-mot svg path {
  fill: var(--jaune);
  stroke: var(--encre);
  stroke-width: 1.6;
}

/* L'affiche de l'accueil : la dernière lettre derrière un bout de rideau */
.mot-cache__glyphe-cache {
  color: transparent;
  background: repeating-linear-gradient(90deg, var(--surface) 0 6px, var(--trait) 6px 10px);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.2);
}

@media (max-width: 520px) {
  .mot-cache__tete {
    flex-direction: column;
    gap: var(--espace-3);
    text-align: center;
  }

  .mot-cache__image {
    width: 2.6rem;
    height: 2.6rem;
    font-size: 1.65rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mot-cache__rideau.est-invitant .mot-cache__tirette,
  .mot-cache__curseur {
    animation: none;
  }
}

/* ---------- Ajouts du 21/10/2026 (remarques de l’autrice) ---------- */

/* Le mot et son bouton « Écouter le mot », côte à côte : la voix seulement à la demande */
.mot-cache__mot-rangee {
  display: flex;
  align-items: center;
  gap: var(--espace-2);
  width: 100%;
}

.mot-cache__mot-rangee .mot-cache__vitre {
  flex: 1 1 auto;
  min-width: 0;
}

.mot-cache__voix-mot {
  flex: none;
}

/* Un piège touché : on voit tout de suite que c'est juste (le mot du compteur, la petite coche) */
.mot-cache__compteur.est-bien-vu {
  color: var(--fn-juste-texte);
  animation: entrer 320ms cubic-bezier(0.2, 0.9, 0.3, 1.3);
}

.mot-cache__lettre.est-piege {
  position: relative;
}

.mot-cache__lettre.est-piege::after {
  content: "✓";
  position: absolute;
  top: -0.55em;
  right: -0.35em;
  display: grid;
  place-items: center;
  width: 1.35em;
  height: 1.35em;
  border-radius: 50%;
  background: var(--fn-juste);
  color: var(--fn-juste-texte);
  box-shadow: 0 0 0 1.5px var(--fn-juste-texte);
  font-size: max(0.75rem, calc(var(--taille) * 0.26));
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.mot-cache__lettre.est-neuve {
  animation: mot-cache-bien-vu 380ms cubic-bezier(0.2, 0.9, 0.3, 1.4);
}

@keyframes mot-cache-bien-vu {
  0% { transform: scale(1); }
  45% { transform: scale(1.14) translateY(-4px); }
  100% { transform: scale(1); }
}

.mot-cache__piege {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

/* Le message et son bouton d'écoute ; pas de bouton quand il n'y a rien à lire */
.mot-cache__message-rangee {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--espace-2);
  max-width: 34rem;
}

.mot-cache__message:empty + .mot-cache__voix-message {
  display: none;
}

/* « Je vérifie » toujours sous la ligne d'écriture, au milieu : sa place ne change pas d'une lettre à l'autre,
   et le clavier dessous ne bouge pas (audit tablette du 22/10/2026 : à côté de la ligne, le bouton glissait
   de 30 px à chaque lettre et passait d'une ligne à l'autre, ce qui faisait remonter le clavier de 60 px) */
.mot-cache__ecriture {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--espace-2);
  max-width: 100%;
}

.mot-cache__ecriture .mot-cache__essai {
  min-width: min(100%, 9rem);
}

.mot-cache__ecriture[hidden] {
  display: none;
}

.mot-cache__place-verifier:empty {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .mot-cache__compteur.est-bien-vu,
  .mot-cache__lettre.est-neuve {
    animation: none;
  }
}

/* Sous la consigne de l'en-tête, à part et en plus petit : ce qu'est un piège (l’autrice, 22/10/2026) */
.mot-cache__precision {
  max-width: 36rem;
  margin: 0;
  padding-top: var(--espace-1);
  font-size: var(--t-petit);
  font-weight: 400;
  line-height: 1.35;
}

@media (max-width: 600px) {
  .mot-cache__precision { font-size: 0.85rem; padding-top: 0; }
}

/* Un piège que l'enfant n'avait pas montré, allumé à la vérification : sans la petite coche
   (ce n'est pas lui qui l'a trouvé), avec un contour en pointillés */
.mot-cache__lettre.est-piege.est-revele::after {
  content: none;
}

.mot-cache__lettre.est-piege.est-revele {
  outline: 3px dashed var(--encre-2);
  outline-offset: 3px;
}

.mot-cache__piege.est-revele {
  box-shadow: inset 4px 0 0 var(--q), 0 0 0 2px var(--q);
}

/* ---------- Hiérarchie claire : Espace Parent vs Exercice Enfant (13/11/2026) ---------- */

.mot-cache__choix {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--espace-3);
  width: 100%;
  max-width: 44rem;
  padding: var(--espace-2) var(--espace-3);
  border-radius: var(--rayon);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 2px var(--trait);
}

.mot-cache__choix-groupe {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--espace-2);
}

.mot-cache__choix-etiquette {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--encre-2);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.mot-cache__choix-groupe--ecole {
  padding-left: var(--espace-3);
  border-left: 2px dashed var(--trait);
}

@media (max-width: 680px) {
  .mot-cache__choix-groupe--ecole {
    padding-left: 0;
    border-left: 0;
    width: 100%;
    padding-top: var(--espace-2);
    border-top: 1px dashed var(--trait);
  }
}

.mot-cache__parent-entete {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--espace-3);
  text-align: left;
  padding-bottom: var(--espace-3);
  border-bottom: 2px solid var(--trait);
  width: 100%;
}

.mot-cache__parent-entete-textes {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
  flex: 1 1 20rem;
}

.mot-cache__rep-lancer-barre {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--espace-3);
  padding: 0.75rem 1rem;
  border-radius: var(--rayon);
  background: var(--fn-juste);
  color: var(--fn-juste-texte);
  box-shadow: inset 0 0 0 2px var(--fn-juste-texte);
}

.mot-cache__rep-lancer-compte {
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.35;
}

.mot-cache__methode-sommaire {
  cursor: pointer;
  list-style: none;
}

.mot-cache__methode-sommaire::-webkit-details-marker {
  display: none;
}

.mot-cache__parent-bloc--methode[open] .mot-cache__methode-grille {
  margin-top: var(--espace-3);
}

.mot-cache__parent-badge {
  display: inline-block;
  width: fit-content;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: var(--bleu);
  color: var(--sur-bleu);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mot-cache__parent-intro {
  margin: 0;
  font-size: 1.02rem;
  color: var(--encre-2);
}

.mot-cache__parent-bloc {
  display: grid;
  gap: var(--espace-3);
  width: 100%;
  padding: var(--espace-4);
  border-radius: var(--rayon);
  background: var(--surface);
  box-shadow: inset 0 0 0 2px var(--trait);
  text-align: left;
}

.mot-cache__parent-etape-titre {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  font-size: 1.12rem;
  font-weight: 800;
}

.mot-cache__parent-num {
  display: inline-grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  background: var(--bleu);
  color: var(--sur-bleu);
  font-size: 0.95rem;
  font-weight: 800;
  flex: none;
}

.mot-cache__mes-rang {
  font-weight: 700;
  color: var(--encre-2);
  margin-right: 0.25rem;
}

.mot-cache__mes-texte {
  font-size: 1.15rem;
  margin-right: 0.4rem;
}

.mot-cache__methode-grille {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--espace-3);
}

@media (max-width: 640px) {
  .mot-cache__methode-grille {
    grid-template-columns: minmax(0, 1fr);
  }
}

.mot-cache__methode-carte {
  display: grid;
  gap: 0.3rem;
  padding: var(--espace-3);
  border-radius: var(--rayon);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1.5px var(--trait);
  font-size: 0.95rem;
  line-height: 1.38;
}

.mot-cache__methode-carte p {
  margin: 0;
  color: var(--encre-2);
}

.mot-cache__parent-lancer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--espace-3);
  width: 100%;
  padding-top: var(--espace-2);
}

.mot-cache__mes-badge-actif {
  font-weight: 800;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: inset 0 0 0 2px var(--bleu);
}

/* Bandeau des 3 étapes en haut de la carte de l'enfant */
.mot-cache__etapes-enfant {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--espace-2);
  width: 100%;
  margin: 0;
  padding: 0 0 var(--espace-2);
  border-bottom: 1px dashed var(--trait);
  list-style: none;
}

.mot-cache__etape-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--surface);
  color: var(--encre-2);
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: inset 0 0 0 1.5px var(--trait);
}

.mot-cache__etape-num {
  display: inline-grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: var(--surface-2);
  font-size: 0.8rem;
  font-weight: 800;
}

.mot-cache__etape-pill.est-active {
  background: var(--fn-piege);
  color: var(--fn-piege-texte);
  box-shadow: inset 0 0 0 2px var(--fn-piege-texte);
}

.mot-cache__etape-pill.est-active .mot-cache__etape-num {
  background: var(--fn-piege-texte);
  color: var(--fn-piege);
}

.mot-cache__etape-pill.est-faite {
  background: var(--fn-juste);
  color: var(--fn-juste-texte);
  box-shadow: inset 0 0 0 1.5px var(--fn-juste-texte);
}

/* Choix Tuiles du mot vs Cahier / ardoise + explication parent sur le geste graphique (13/11/2026) */
.mot-cache__modes-ecriture {
  display: grid;
  justify-items: center;
  gap: 0.45rem;
  width: 100%;
  max-width: 36rem;
  margin-bottom: var(--espace-2);
}

.mot-cache__modes-boutons {
  justify-content: center;
}

.mot-cache__modes-note {
  margin: 0;
  padding: 0.35rem 0.75rem;
  border-radius: var(--rayon);
  background: var(--surface);
  font-size: 0.86rem;
  text-align: center;
  line-height: 1.35;
}

.mot-cache__touche--plateau {
  width: 3.5rem;
  height: 3.7rem;
  font-size: 1.55rem;
}

.mot-cache__touche--plateau.est-prise {
  opacity: 0.28;
  transform: translateY(2px) scale(0.95);
  box-shadow: none;
  cursor: default;
}

.mot-cache__zone-cahier {
  width: 100%;
  max-width: 34rem;
}

.mot-cache__cahier-encadre {
  display: grid;
  justify-items: center;
  gap: var(--espace-3);
  padding: var(--espace-4);
  border-radius: var(--rayon);
  background: var(--surface);
  box-shadow: inset 0 0 0 2px var(--bleu);
  text-align: center;
}

.mot-cache__cahier-consigne {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.45;
}

.mot-cache__parent-astuce-geste {
  margin: var(--espace-2) 0 0;
  padding: var(--espace-3);
  border-radius: var(--rayon);
  background: color-mix(in srgb, var(--jaune) 18%, var(--surface));
  box-shadow: inset 0 0 0 1.5px var(--jaune);
  font-size: 0.95rem;
  line-height: 1.4;
}

/* Bandeau d'invitation au-dessus du mot : « 👇 Où est le piège ? Touche les lettres difficiles pour les marquer. » + bouton d'écoute (l’autrice, 13/11/2026) */
.mot-cache__compteur-rangee {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--espace-3);
  width: 100%;
  max-width: 36rem;
  padding: 0.55rem 1rem;
  border-radius: var(--rayon);
  background: var(--fn-piege);
  color: var(--fn-piege-texte);
  box-shadow: inset 0 0 0 2px var(--fn-piege-texte);
}

.mot-cache__compteur-rangee[hidden] {
  display: none !important;
}

.mot-cache__compteur-rangee .mot-cache__compteur {
  margin: 0;
  font-size: 1.06rem;
  font-weight: 800;
  color: inherit;
}

.mot-cache__compteur-rangee.est-bien-vu {
  background: var(--fn-juste);
  color: var(--fn-juste-texte);
  box-shadow: inset 0 0 0 2px var(--fn-juste-texte);
}

.mot-cache__voix-compteur {
  flex: none;
}

/* ---------- Répertoire illustré Dubois-Buyse & Éduscol (13/11/2026) ---------- */

.mot-cache__rep-barre {
  display: grid;
  gap: var(--espace-2);
  width: 100%;
}

.mot-cache__rep-onglets {
  justify-content: flex-start;
}

.mot-cache__rep-recherche {
  width: 100%;
  min-height: 2.8rem;
  padding: 0.45rem 0.85rem;
  border: 0;
  border-radius: var(--rayon);
  background: var(--surface-2);
  color: var(--encre);
  box-shadow: inset 0 0 0 2px var(--trait);
  font-size: 1rem;
  font-family: inherit;
}

.mot-cache__rep-recherche:focus-visible {
  box-shadow: inset 0 0 0 3px var(--accent);
  outline: none;
}

.mot-cache__rep-soustitre {
  margin: 0;
  font-weight: 700;
}

.mot-cache__rep-grille {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr));
  gap: var(--espace-2);
  max-height: 23rem;
  overflow-y: auto;
  padding: 2px;
}

.mot-cache__rep-carte {
  display: grid;
  align-content: start;
  gap: 0.45rem;
  padding: var(--espace-3);
  border: 0;
  border-radius: var(--rayon);
  background: var(--surface-2);
  color: var(--encre);
  box-shadow: inset 0 0 0 2px var(--trait);
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.mot-cache__rep-carte:hover {
  box-shadow: inset 0 0 0 2px var(--bleu);
}

.mot-cache__rep-carte.est-choisi {
  background: var(--fn-juste);
  color: var(--fn-juste-texte);
  box-shadow: inset 0 0 0 2.5px var(--fn-juste-texte);
}

.mot-cache__rep-tete {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
}

.mot-cache__rep-icone {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: var(--bois);
  box-shadow: inset 0 -3px 0 var(--bois-flanc);
  font-size: 1.4rem;
  flex: none;
}

.mot-cache__rep-icone > .icone {
  width: 1.9rem;
  height: 1.9rem;
}

.mot-cache__rep-titres {
  display: grid;
  min-width: 0;
  flex: 1 1 auto;
}

.mot-cache__rep-mot {
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.2;
}

.mot-cache__rep-piege {
  display: inline-block;
  padding: 0 0.16em;
  margin: 0 0.02em;
  border-radius: 4px;
  background: var(--fn-piege);
  color: var(--fn-piege-texte);
  border-bottom: 2.5px solid var(--fn-piege-texte);
  line-height: 1.15;
}

.mot-cache__rep-echelon {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--encre-2);
}

.mot-cache__rep-action {
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--trait);
  font-size: 0.8rem;
  font-weight: 800;
  flex: none;
}

.mot-cache__rep-carte.est-choisi .mot-cache__rep-action {
  background: var(--fn-juste-texte);
  color: var(--fn-juste);
  box-shadow: none;
}

.mot-cache__rep-phrase {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.35;
  color: var(--encre-2);
}

.mot-cache__rep-carte.est-choisi .mot-cache__rep-phrase,
.mot-cache__rep-carte.est-choisi .mot-cache__rep-echelon {
  color: inherit;
}

/* ---------- Filtres par famille de piège, Dictées progressives & Atelier « Ma dictée sur mesure » (14/11/2026) ---------- */

.mot-cache__parent-actions-haut,
.mot-cache__rep-lancer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.mot-cache__dictee-active-banniere {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
  background: var(--fn-juste);
  color: var(--fn-juste-texte);
  font-size: 0.92rem;
}

.mot-cache__dictee-active-retirer {
  margin-left: auto;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1.5px solid currentColor;
  background: transparent;
  color: inherit;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
}

.mot-cache__mes-piege-info {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--encre-2);
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
  background: var(--surface-2);
}

.mot-cache__editer-phrase {
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--trait);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--encre);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.mot-cache__editeur-phrase-box {
  display: grid;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: var(--surface-2);
  border: 2px solid var(--bleu);
}

.mot-cache__editeur-phrase-label {
  font-size: 0.9rem;
  font-weight: 700;
}

.mot-cache__editeur-phrase-rangee {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.mot-cache__familles-pieges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.mot-cache__famille-pill {
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1.5px solid var(--trait);
  background: var(--surface-2);
  color: var(--encre);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}

.mot-cache__famille-pill.est-active {
  background: var(--bleu);
  color: var(--sur-bleu);
  border-color: var(--bleu);
}

.mot-cache__famille-piege-explication {
  margin: 0;
  padding: 0.55rem 0.85rem;
  border-radius: 10px;
  background: var(--surface-2);
  border-left: 4px solid var(--bleu);
  font-size: 0.9rem;
  line-height: 1.4;
}

.mot-cache__rep-regle {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.3;
  color: var(--encre);
  font-weight: 600;
}

/* Grille des 15 dictées progressives Éduscol / Dubois-Buyse */
.mot-cache__prog-grille {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 0.85rem;
}

.mot-cache__prog-carte {
  display: grid;
  align-content: start;
  gap: 0.55rem;
  padding: 1rem;
  border-radius: var(--rayon);
  background: var(--surface-2);
  border: 2px solid var(--trait);
}

.mot-cache__prog-carte.est-choisie {
  border-color: var(--fn-juste-texte);
  background: var(--fn-juste);
  color: var(--fn-juste-texte);
}

.mot-cache__prog-carte.est-choisie .mot-cache__prog-mots-label {
  color: var(--fn-juste-texte);
}

.mot-cache__prog-tete {
  display: grid;
  gap: 0.2rem;
}

.mot-cache__prog-badge {
  justify-self: start;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--encre-2);
}

.mot-cache__prog-titre {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.25;
}

.mot-cache__prog-point {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.35;
}

.mot-cache__prog-mots {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.mot-cache__prog-mots-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--encre-2);
}

.mot-cache__prog-mot-pill,
.mot-cache__dictee-mot-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 8px;
  background: var(--surface);
  border: 1.5px solid var(--trait);
  font-weight: 800;
  font-size: 0.95rem;
}

.mot-cache__prog-texte {
  margin: 0;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  background: var(--surface);
  font-size: 0.9rem;
  line-height: 1.4;
  font-style: italic;
}

.mot-cache__prog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.2rem;
}

/* Panneau de l'Atelier « Ma dictée sur mesure » */
.mot-cache__dictee {
  display: grid;
  gap: var(--espace-3);
  width: 100%;
  max-width: 44rem;
}

.mot-cache__dictee[hidden] {
  display: none;
}

.mot-cache__dictee-entete {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--espace-3);
  padding: var(--espace-3) var(--espace-4);
  border-radius: var(--rayon-grand);
  background: var(--surface);
  box-shadow: var(--ombre);
}

.mot-cache__dictee-entete-textes {
  display: grid;
  gap: 0.25rem;
  flex: 1 1 20rem;
}

.mot-cache__dictee-entete-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.mot-cache__dictee-mots-bandeau {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--rayon);
  background: var(--surface);
  box-shadow: inset 0 0 0 2px var(--trait);
}

.mot-cache__dictee-mots-label {
  font-weight: 800;
  font-size: 0.92rem;
}

.mot-cache__dictee-mots-liste {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.mot-cache__dictee-modes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.65rem;
}

.mot-cache__dictee-mode-btn {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-radius: var(--rayon);
  border: 2px solid var(--trait);
  background: var(--surface);
  color: var(--encre);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}

.mot-cache__dictee-mode-btn.est-actif {
  border-color: var(--bleu);
  background: var(--fn-juste);
  color: var(--fn-juste-texte);
}

.mot-cache__dictee-mode-icone {
  font-size: 1.5rem;
  line-height: 1;
}

.mot-cache__dictee-mode-textes {
  display: grid;
  gap: 0.2rem;
}

.mot-cache__dictee-mode-textes strong {
  font-size: 0.96rem;
}

.mot-cache__dictee-mode-textes span {
  font-size: 0.8rem;
  line-height: 1.3;
  opacity: 0.9;
}

.mot-cache__dictee-corps {
  display: grid;
  gap: var(--espace-3);
  padding: var(--espace-4);
  border-radius: var(--rayon-grand);
  background: var(--surface);
  box-shadow: var(--ombre);
}

/* Mode 1 : Dictée à trous */
.mot-cache__trous-progression {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.mot-cache__trous-etape {
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1.5px solid var(--trait);
  background: var(--surface-2);
  color: var(--encre);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.mot-cache__trous-etape.est-actuel {
  background: var(--bleu);
  color: var(--sur-bleu);
  border-color: var(--bleu);
}

.mot-cache__trous-phrase-box {
  display: grid;
  gap: 0.75rem;
  padding: 1.1rem 1.25rem;
  border-radius: var(--rayon);
  background: var(--surface-2);
  border: 2px solid var(--trait);
}

.mot-cache__trous-voix-rangee {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.mot-cache__trous-phrase {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.55;
  font-weight: 700;
}

.mot-cache__trou-boite {
  display: inline-block;
  min-width: 5.5rem;
  padding: 0.1rem 0.55rem;
  margin: 0 0.2rem;
  border-radius: 8px;
  background: var(--surface);
  border: 2.5px dashed var(--bleu);
  color: var(--bleu);
  text-align: center;
  font-weight: 800;
}

.mot-cache__trou-boite.est-bravo {
  border-style: solid;
  border-color: var(--fn-juste-texte);
  background: var(--fn-juste);
  color: var(--fn-juste-texte);
}

.mot-cache__trous-indice {
  margin: 0;
  font-size: 0.92rem;
  color: var(--encre-2);
}

.mot-cache__trous-message {
  margin: 0;
  text-align: center;
  font-weight: 700;
  font-size: 1.05rem;
}

/* Mode 2 : Dictée guidée au cahier */
.mot-cache__cahier-etape {
  display: grid;
  gap: 0.65rem;
  padding: 1rem 1.15rem;
  border-radius: var(--rayon);
  background: var(--surface-2);
  border: 1.5px solid var(--trait);
}

.mot-cache__cahier-titre {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  font-size: 1.08rem;
}

.mot-cache__cahier-guide {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.45;
}

.mot-cache__cahier-mots-prep {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mot-cache__cahier-mot-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  background: var(--surface);
}

.mot-cache__cahier-mot-ecrit {
  font-size: 1.15rem;
}

.mot-cache__cahier-mot-regle {
  font-size: 0.88rem;
  color: var(--encre-2);
}

.mot-cache__cahier-groupes {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mot-cache__cahier-groupe {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.55rem 0.85rem;
  border-radius: 10px;
  background: var(--surface);
  border: 1.5px solid var(--trait);
}

.mot-cache__cahier-groupe-num {
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 0.78rem;
  font-weight: 800;
}

.mot-cache__cahier-groupe-texte {
  flex: 1 1 12rem;
  font-size: 1.08rem;
}

.mot-cache__dictee-perso-details {
  padding-top: 0.4rem;
  font-size: 0.9rem;
}

.mot-cache__dictee-perso-details summary {
  cursor: pointer;
  font-weight: 700;
}

.mot-cache__dictee-perso-corps {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.mot-cache__dictee-textarea {
  width: 100%;
  padding: 0.65rem;
  border-radius: 8px;
  border: 2px solid var(--trait);
  font-family: inherit;
  font-size: 0.95rem;
}

.mot-cache__cahier-modele-box {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: var(--surface);
  border: 2px solid var(--fn-juste-texte);
}

.mot-cache__cahier-modele-label {
  margin: 0 0 0.25rem;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--encre-2);
}

.mot-cache__cahier-modele-texte {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 700;
  line-height: 1.5;
}

.mot-cache__cahier-compteur-positif {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: var(--fn-juste);
  color: var(--fn-juste-texte);
}

.mot-cache__cahier-compteur-label {
  font-weight: 800;
}

.mot-cache__cahier-compteur-boutons {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.mot-cache__cahier-score {
  font-size: 1.1rem;
}

/* Mode 3 : Aperçu & Impression A4 du Chemin des 3 jours + Dictée */
.mot-cache__imprimer-presentation {
  display: grid;
  gap: 0.65rem;
}

.mot-cache__apercu-feuille {
  overflow-x: auto;
}

.mot-cache__apercu-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.mot-cache__apercu-table th,
.mot-cache__apercu-table td {
  padding: 0.6rem 0.75rem;
  border: 1.5px solid var(--trait);
  text-align: left;
  vertical-align: top;
}

.mot-cache__apercu-table th {
  background: var(--surface-2);
  font-weight: 800;
}

.mot-cache__apercu-col-jour {
  border-left: 2px dashed var(--bleu) !important;
  color: var(--encre-2);
  font-style: italic;
}

.print-3j {
  display: none;
}

@media print {
  body.impression-3j-active > *:not(#zone-impression-dictee-3jours) {
    display: none !important;
  }

  body.impression-3j-active #zone-impression-dictee-3jours {
    display: block !important;
    padding: 0;
    color: #111;
    background: #fff;
    font-size: 10.5pt;
    line-height: 1.35;
  }

  .print-3j__entete {
    border-bottom: 2px solid #222;
    padding-bottom: 6pt;
    margin-bottom: 10pt;
  }

  .print-3j__surtitre {
    margin: 0;
    font-size: 8.5pt;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #444;
  }

  .print-3j__titre {
    margin: 2pt 0;
    font-size: 15pt;
  }

  .print-3j__point {
    margin: 2pt 0 0;
    font-size: 10pt;
    font-weight: 700;
  }

  .print-3j__section {
    margin-bottom: 12pt;
  }

  .print-3j__h2 {
    margin: 0 0 6pt;
    font-size: 11pt;
  }

  .print-3j__table {
    width: 100%;
    border-collapse: collapse;
  }

  .print-3j__table th,
  .print-3j__table td {
    border: 1pt solid #333;
    padding: 5pt 6pt;
    vertical-align: middle;
    text-align: left;
  }

  .print-3j__col-jour {
    border-left: 1.5pt dashed #111 !important;
    width: 21%;
    text-align: center !important;
    color: #666;
  }

  .print-3j__modele-haut {
    display: flex;
    align-items: baseline;
    gap: 4pt;
    font-size: 12pt;
    font-weight: 800;
  }

  .print-3j__piege-texte {
    margin: 2pt 0 0;
    font-size: 8.5pt;
    color: #333;
  }

  .print-3j__trous-liste {
    margin: 0;
    padding-left: 16pt;
  }

  .print-3j__trou-item {
    margin-bottom: 6pt;
    font-size: 11pt;
  }

  .print-3j__trou-ligne {
    font-weight: 700;
    letter-spacing: 0.05em;
  }

  .print-3j__encart-parent {
    border: 1pt solid #444;
    border-radius: 6pt;
    padding: 8pt 10pt;
    background: #fafafa;
  }

  .print-3j__h3 {
    margin: 0 0 4pt;
    font-size: 10.5pt;
  }

  .print-3j__texte-parent {
    margin: 0 0 6pt;
    font-size: 10.5pt;
    font-style: italic;
  }

  .print-3j__bilan-positif {
    margin: 0;
    font-weight: 700;
    font-size: 10pt;
  }
}
