/* Polices : Marelle (cursive, capitales bâton, lignage Seyès) — OFL, Ministère de l'Éducation nationale ;
   Andika (script, lettres d'apprentissage) — OFL, SIL International. */
@font-face { font-family: "Marelle"; src: url(/fonts/Marelle-Regular.woff2) format("woff2"); font-display: block; }
@font-face { font-family: "Marelle Baton"; src: url(/fonts/MarelleBaton-Regular.woff2) format("woff2"); font-display: block; }
@font-face { font-family: "Marelle Lignes"; src: url(/fonts/MarelleLIGNES-Regular.woff2) format("woff2"); font-display: block; }
@font-face { font-family: "Marelle Lignes Baton"; src: url(/fonts/MarelleLIGNESBaton-Regular.woff2) format("woff2"); font-display: block; }
@font-face { font-family: "Marelle Lignes Noir"; src: url(/fonts/MarelleLIGNESN-Regular.woff2) format("woff2"); font-display: block; }
@font-face { font-family: "Andika"; src: url(/fonts/Andika-Regular.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Andika"; src: url(/fonts/Andika-Bold.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --fond: #fbf8f1;
  --carte: #ffffff;
  --texte: #1d2330;
  --doux: #5a6272;
  --bord: #d9d3c4;
  --accent: #2a6fb0;
  --ok: #1f8a4c;
  --ok-fond: #e3f5e9;
  --non: #b4441f;
  --non-fond: #fbe9e2;
  --cible: #d6455d;
  --rayon: 18px;
  --ombre: 0 2px 0 rgba(0,0,0,.08), 0 6px 18px rgba(0,0,0,.06);
  --taille: clamp(17px, 1.1vw + 12px, 24px);
}
.contraste {
  --fond: #ffffff; --carte: #ffffff; --texte: #000000; --doux: #1d1d1d; --bord: #000000;
  --accent: #0040a0; --ok: #005a20; --non: #8a1c00;
}
.contraste .carte, .contraste .choix, .contraste .tuile { border-width: 3px; }
.grand-texte { --taille: clamp(20px, 1.4vw + 14px, 30px); }

* { box-sizing: border-box; }
html { font-size: var(--taille); }
body {
  margin: 0; background: var(--fond); color: var(--texte);
  font-family: "Andika", "Verdana", sans-serif; line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: .4em 0 .5em; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.3rem; }
p { max-width: 60ch; }
.visuellement-cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.evitement { position: absolute; left: -999px; }
.evitement:focus { left: 8px; top: 8px; background: #fff; padding: 8px; z-index: 10; }
:focus-visible { outline: 4px solid #f5b400; outline-offset: 3px; }

/* Écritures */
.f-capitale { font-family: "Marelle Baton", "Andika", sans-serif; text-transform: uppercase; font-variant-ligatures: none; }
.f-script { font-family: "Andika", sans-serif; }
.f-cursive { font-family: "Marelle", cursive; }
.f-cursive-baton { font-family: "Marelle Baton", cursive; }
.f-lignes { font-family: "Marelle Lignes", cursive; }

/* Entête */
.entete {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem;
  padding: .5rem 1rem; background: var(--carte); border-bottom: 2px solid var(--bord);
}
.logo { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: 1.1rem; text-decoration: none; color: var(--texte); }
.logo-lettres { display: inline-flex; gap: .15em; align-items: baseline; color: var(--cible); font-size: 1.4em; line-height: 1; }
.entete nav { display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; }
.entete nav a { padding: .35rem .7rem; border-radius: 999px; text-decoration: none; color: var(--texte); }
.entete nav a[aria-current="page"] { background: var(--texte); color: var(--fond); }
.btn-reglages { font-size: 1.3rem; background: none; border: 0; cursor: pointer; padding: .2rem .5rem; border-radius: 999px; }
.integre .entete { display: none; }

main { padding: 1rem clamp(.75rem, 3vw, 2.5rem) 3rem; max-width: 1400px; margin: 0 auto; outline: none; }
.integre main { padding: .5rem; }
.barre-integre { display: none; }
.integre .barre-integre { display: flex; justify-content: flex-end; gap: .5rem; font-size: .8rem; }

/* Boutons */
button, .bouton {
  font: inherit; color: inherit; cursor: pointer; touch-action: manipulation;
}
.bouton, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  min-height: 3rem; padding: .4em 1em; border-radius: 999px;
  background: var(--carte); color: var(--texte); border: 2px solid var(--bord);
  text-decoration: none; font-weight: 700; box-shadow: var(--ombre);
}
.bouton.principal, .btn.principal { background: var(--accent); border-color: var(--accent); color: #fff; }
.bouton:hover, .btn:hover { filter: brightness(.97); }
.btn-son { background: #fff6d6; border-color: #e9c96a; }
.btn-son::before { content: "🔊"; }
.sans-voix .btn-son { display: none; }
.rangee { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.rangee.centre { justify-content: center; }
.petit { font-size: .85rem; }
.doux { color: var(--doux); }

/* Cartes */
.carte { background: var(--carte); border: 2px solid var(--bord); border-radius: var(--rayon); padding: 1rem 1.2rem; box-shadow: var(--ombre); }
.grille { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }

/* Accueil */
.accueil { text-align: center; padding-top: 1rem; }
.accueil h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
.accueil .grandes-lettres { font-size: clamp(4rem, 14vw, 10rem); line-height: 1.1; color: var(--cible); display: flex; justify-content: center; gap: .3em; }
.accueil .choix-entree { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); max-width: 1000px; margin: 1.5rem auto; }
.entree { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: 1.2rem; border-radius: var(--rayon); background: var(--carte); border: 2px solid var(--bord); text-decoration: none; color: var(--texte); box-shadow: var(--ombre); font-weight: 700; font-size: 1.15rem; }
.entree .ico { font-size: 2.6rem; }
.entree small { font-weight: 400; color: var(--doux); font-size: .85rem; }

/* Parcours */
.etape { border-top: 10px solid var(--c, var(--accent)); }
.etape-titre { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.etape-num { background: var(--c); color: #fff; border-radius: 999px; padding: .05em .7em; font-weight: 700; }
.tuiles { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fill, minmax(clamp(90px, 13vw, 150px), 1fr)); margin: .8rem 0; }
.tuile {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  aspect-ratio: 1; border-radius: var(--rayon); background: var(--carte); border: 3px solid var(--c, var(--bord));
  text-decoration: none; color: var(--texte); box-shadow: var(--ombre); padding: .3rem;
}
.tuile .g { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1; }
.tuile .p { display: flex; gap: .5em; font-size: clamp(1.4rem, 2.8vw, 2rem); color: var(--doux); line-height: 1.5; margin-bottom: .5rem; }
.tuile .etoiles { position: absolute; bottom: .25rem; font-size: .7rem; letter-spacing: 1px; }
.points { display: flex; gap: 3px; position: absolute; bottom: 6px; }
.points i { width: 9px; height: 9px; border-radius: 50%; background: var(--bord); }
.points i.fait { background: var(--ok); }

/* Page lettre */
.fil { font-size: .9rem; margin-bottom: .3rem; }
.lettre-tete { display: grid; gap: 1rem; grid-template-columns: 1fr auto; align-items: center; }
@media (max-width: 700px) { .lettre-tete { grid-template-columns: 1fr; } }
.trois { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.ecriture-carte { text-align: center; background: var(--carte); border: 2px solid var(--bord); border-radius: var(--rayon); padding: .4rem .3rem .6rem; box-shadow: var(--ombre); }
.ecriture-carte .g { font-size: clamp(4rem, 14vw, 11rem); line-height: 1.15; color: var(--texte); display: block; }
.ecriture-carte .f-cursive.g { font-size: clamp(2.8rem, 9.5vw, 7.4rem); line-height: 1.75; }
.ecriture-carte .nom { font-size: .9rem; color: var(--doux); }
.mot-repere { display: flex; flex-direction: column; align-items: center; gap: .2rem; text-align: center; }
.mot-repere img { width: clamp(90px, 16vw, 180px); height: auto; }
.mot-repere .mot { font-size: 2rem; }
.mot .cible, .cible { color: var(--cible); font-weight: 700; }
.f-cursive .cible { font-weight: 400; }
.activites { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); margin: 1.2rem 0; }
.activite-btn { display: flex; align-items: center; gap: .7rem; padding: .8rem 1rem; border-radius: var(--rayon); background: var(--carte); border: 3px solid var(--c, var(--bord)); text-decoration: none; color: var(--texte); font-weight: 700; font-size: 1.15rem; box-shadow: var(--ombre); min-height: 4.2rem; }
.activite-btn .ico { font-size: 2rem; }
.activite-btn.fait::after { content: "✔"; margin-left: auto; color: var(--ok); font-size: 1.4rem; }
.note { background: #fff6d6; border-left: 6px solid #e9c96a; padding: .5rem .8rem; border-radius: 8px; max-width: 60ch; }

/* Activités */
.jeu { display: flex; flex-direction: column; align-items: center; gap: 1rem; text-align: center; min-height: 70vh; }
.integre .jeu { min-height: 0; }
.jeu-tete { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.consigne { font-size: 1.35rem; font-weight: 700; display: flex; align-items: center; gap: .6rem; justify-content: center; flex-wrap: wrap; margin: 0; }
.progression { display: flex; gap: 6px; }
.progression i { width: 16px; height: 16px; border-radius: 50%; background: var(--bord); }
.progression i.fait { background: var(--ok); }
.progression i.encours { background: var(--accent); }
.modele { font-size: clamp(3.5rem, 11vw, 8rem); line-height: 1.2; padding: 0 .6em; border: 3px dashed var(--bord); border-radius: var(--rayon); background: var(--carte); min-width: 1.6em; }
.choix-zone { display: flex; flex-wrap: wrap; gap: clamp(.6rem, 2vw, 1.5rem); justify-content: center; }
.choix {
  min-width: clamp(110px, 18vw, 200px); min-height: clamp(110px, 18vw, 200px);
  font-size: clamp(3.5rem, 10vw, 7rem); line-height: 1; padding: .1em .2em;
  background: var(--carte); border: 3px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre);
  display: flex; align-items: center; justify-content: center; transition: transform .1s;
}
.choix.f-cursive { font-size: clamp(2.6rem, 7.5vw, 5.2rem); line-height: 1.8; padding-bottom: .15em; }
.modele.f-cursive { font-size: clamp(2.6rem, 8vw, 6rem); line-height: 1.8; }
.kim-carte.f-cursive { font-size: clamp(2.2rem, 6vw, 4.4rem); line-height: 1.8; }
.choix:active { transform: scale(.97); }
.choix.bon { background: var(--ok-fond); border-color: var(--ok); }
.choix.faux { background: var(--non-fond); border-color: var(--non); opacity: .45; }
.choix.indice { animation: pulse 1s infinite; border-color: var(--ok); }
.choix:disabled { cursor: default; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(31,138,76,.25); } }
@keyframes secoue { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.secoue { animation: secoue .3s; }
.retour { min-height: 2.4rem; font-size: 1.3rem; font-weight: 700; }
.retour.bon { color: var(--ok); }
.retour.faux { color: var(--non); }
.oui-non { display: flex; gap: 1.5rem; justify-content: center; }
.oui-non .choix { font-size: clamp(2rem, 5vw, 3rem); flex-direction: column; gap: .2rem; }
.oui-non .choix small { font-size: 1.2rem; font-weight: 700; }
.image-mot img { width: clamp(140px, 26vw, 260px); height: auto; }
.image-mot .mot { font-size: 2.2rem; min-height: 1.5em; }
.fin { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.fin .bravo { font-size: clamp(4rem, 12vw, 8rem); line-height: 1; }

/* Kim */
.kim-zone { display: flex; gap: clamp(.5rem, 2vw, 1.2rem); justify-content: center; flex-wrap: wrap; min-height: 160px; }
.kim-carte { width: clamp(90px, 15vw, 170px); aspect-ratio: 3/4; display: flex; align-items: center; justify-content: center; font-size: clamp(3rem, 8vw, 6rem); background: var(--carte); border: 3px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre); }
.kim-carte.cachee { background: repeating-linear-gradient(45deg, #e8e2d3, #e8e2d3 10px, #f3eee2 10px, #f3eee2 20px); color: transparent; }
.kim-carte.vide { background: transparent; border-style: dashed; box-shadow: none; color: transparent; }

/* Tracer */
.tracer-zone { position: relative; width: min(100%, 900px); aspect-ratio: 16/10; background: var(--carte); border: 3px solid var(--bord); border-radius: var(--rayon); overflow: hidden; touch-action: none; }
.tracer-zone .fond-lettre { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #c9cfd8; pointer-events: none; user-select: none; line-height: 1; white-space: pre; }
.tracer-zone canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; }
.onglets { display: inline-flex; border: 2px solid var(--bord); border-radius: 999px; overflow: hidden; background: var(--carte); }
.onglets button { border: 0; background: transparent; padding: .4em 1em; min-height: 2.8rem; font-weight: 700; }
.onglets button[aria-pressed="true"] { background: var(--texte); color: var(--fond); }
.couleurs { display: inline-flex; gap: .4rem; }
.couleurs button { width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--bord); }
.couleurs button[aria-pressed="true"] { box-shadow: 0 0 0 4px var(--texte); }

/* Alphabet */
.alphabet { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(clamp(80px, 11vw, 140px), 1fr)); }
.alphabet .tuile.joue { background: #fff6d6; transform: scale(1.06); }
.alphabet .tuile img { width: 34%; height: auto; }

/* Prénom */
.prenom-saisie { font: inherit; font-size: 1.6rem; padding: .3em .6em; border-radius: 12px; border: 2px solid var(--bord); width: min(100%, 420px); }
.prenom-grand { font-size: clamp(2.6rem, 9vw, 6rem); line-height: 1.3; word-break: break-all; }
.prenom-lettres { display: flex; flex-wrap: wrap; gap: .4rem; }
.prenom-lettres button { font-size: 2.4rem; min-width: 3.4rem; min-height: 3.4rem; border-radius: 14px; border: 2px solid var(--bord); background: var(--carte); }

/* Enseignant */
.ens table { border-collapse: collapse; width: 100%; background: var(--carte); }
.ens th, .ens td { border: 1px solid var(--bord); padding: .4rem .5rem; vertical-align: top; text-align: left; }
.ens th { background: #f1ece0; }
.ens .lettre-cell { font-size: 1.6rem; white-space: nowrap; }
.ens .act { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; margin: .15rem 0; }
.ens .act > span:first-child { min-width: 7.5em; }
.mini { font: inherit; font-size: .78rem; padding: .15rem .55rem; border-radius: 999px; border: 1.5px solid var(--bord); background: #fff; cursor: pointer; text-decoration: none; color: var(--texte); white-space: nowrap; }
.mini:hover { background: #f1ece0; }
.ens details { margin: .5rem 0; }
.ens summary { cursor: pointer; font-weight: 700; font-size: 1.1rem; }
.ens pre, .ens code { background: #f1ece0; padding: .1em .35em; border-radius: 6px; font-size: .8rem; white-space: pre-wrap; word-break: break-all; }
.reglages-liens { display: flex; flex-wrap: wrap; gap: .8rem 1.4rem; align-items: center; }
label.champ { display: inline-flex; gap: .4rem; align-items: center; }
select { font: inherit; padding: .2rem .4rem; border-radius: 8px; border: 2px solid var(--bord); background: #fff; }

/* Dialogues */
.dialogue { border: 0; border-radius: var(--rayon); padding: 1.2rem 1.4rem; max-width: min(96vw, 640px); box-shadow: 0 20px 60px rgba(0,0,0,.3); color: var(--texte); background: var(--carte); }
.dialogue::backdrop { background: rgba(20,24,32,.45); }
.dialogue fieldset { border: 0; padding: 0; margin: 0 0 .8rem; }
.dialogue legend { font-weight: 700; margin-bottom: .2rem; }
.dialogue .options { display: flex; flex-wrap: wrap; gap: .3rem .8rem; }
.dialogue label { display: inline-flex; gap: .3rem; align-items: center; min-height: 2.2rem; }
.qr-img { width: min(70vw, 320px); height: auto; display: block; margin: .5rem auto; image-rendering: pixelated; }

.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); background: var(--texte); color: var(--fond); padding: .6rem 1.2rem; border-radius: 999px; z-index: 20; font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ===== Fiches A5 ===== */
.impression-barre { position: sticky; top: 0; z-index: 5; background: var(--carte); border-bottom: 2px solid var(--bord); padding: .5rem 1rem; display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; margin: -1rem -2.5rem 1rem; }
.feuilles { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.feuille-a4 { display: flex; background: #fff; box-shadow: var(--ombre); }
.page-a5 {
  width: 148mm; height: 210mm; padding: 9mm 10mm; background: #fff; color: #000; overflow: hidden;
  box-shadow: var(--ombre); position: relative; display: flex; flex-direction: column; gap: 3mm;
  font-size: 12pt; line-height: 1.3;
}
.feuille-a4 .page-a5 { box-shadow: none; border-right: 1px dashed #bbb; }
.feuille-a4 .page-a5:last-child { border-right: 0; }
.page-a5 h2 { font-size: 17pt; margin: 0; display: flex; align-items: center; gap: 3mm; }
.page-a5 h3 { font-size: 12.5pt; margin: 1.5mm 0 0; }
.page-a5 .bandeau { height: 3mm; background: var(--c); border-radius: 2mm; }
.page-a5 .pied { margin-top: auto; font-size: 7.5pt; color: #666; display: flex; justify-content: space-between; }
.page-a5 .p-trois { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3mm; text-align: center; }
.page-a5 .p-trois > div { border: .5mm solid #333; border-radius: 3mm; padding: 1mm 0 2mm; }
.page-a5 .p-trois .g { font-size: 60pt; line-height: 1.15; display: block; }
.page-a5 .p-trois .f-cursive.g { font-size: 42pt; line-height: 1.64; }
.page-a5 .p-trois small { font-size: 8pt; color: #555; }
.page-a5 .p-mot { display: flex; align-items: center; gap: 5mm; }
.page-a5 .p-mot img { width: 22mm; height: 22mm; }
.page-a5 .p-mot .mots { font-size: 22pt; line-height: 1.5; }
.page-a5 .p-mot .mots .f-cursive { font-size: 26pt; }
.page-a5 .lignes { font-family: "Marelle Lignes", cursive; white-space: pre; overflow: hidden; color: #000; }
.page-a5 .lignes .gris { color: #b8b8b8; }
.page-a5 .modele-capitale { font-size: 26pt; letter-spacing: 6mm; line-height: 1.6; white-space: nowrap; overflow: hidden; }
.page-a5 .modele-capitale .gris { color: #c4c4c4; }
.page-a5 .entoure { display: grid; grid-template-columns: repeat(8, 1fr); gap: 1mm 0; text-align: center; font-size: 22pt; line-height: 1.45; }
.page-a5 .entoure .f-cursive { font-size: 24pt; }
.page-a5 .relie { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 14mm; text-align: center; font-size: 22pt; line-height: 1.55; }
.page-a5 .relie span { display: flex; align-items: center; justify-content: center; gap: 2mm; }
.page-a5 .relie span::after, .page-a5 .relie span::before { content: "•"; font-family: Andika, sans-serif; font-size: 16pt; color: #333; }
.page-a5 .relie .c1 span::before, .page-a5 .relie .c3 span::after { content: ""; }
.page-a5 .ecoute { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2mm; }
.page-a5 .ecoute div { border: .4mm solid #444; border-radius: 3mm; display: flex; flex-direction: column; align-items: center; padding: 1.5mm; font-size: 10pt; }
.page-a5 .ecoute img { width: 15mm; height: 15mm; }
.page-a5 .ecoute .cases { font-size: 11pt; letter-spacing: 1mm; }
.page-a5 .abc { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.6mm; }
.page-a5 .abc div { border: .4mm solid #444; border-radius: 2.5mm; text-align: center; padding: .6mm 0 .8mm; display: flex; flex-direction: column; align-items: center; }
.page-a5 .abc .l { font-size: 15pt; display: flex; gap: 2.2mm; align-items: baseline; line-height: 1.25; }
.page-a5 .abc img { width: 9mm; height: 9mm; }
.page-a5 .abc small { font-size: 7.5pt; line-height: 1.1; }
.page-a5 .consigne-p { font-weight: 700; font-size: 11.5pt; display: flex; gap: 2mm; align-items: center; }
.page-a5 .consigne-p .ico { font-size: 13pt; }

@page { size: A5 portrait; margin: 0; }
@media print {
  body { background: #fff; }
  .entete, .impression-barre, .barre-integre, .evitement { display: none !important; }
  main { padding: 0; max-width: none; }
  .feuilles { display: block; }
  .page-a5, .feuille-a4 { box-shadow: none; break-after: page; page-break-after: always; margin: 0; }
  .feuille-a4 .page-a5 { break-after: auto; page-break-after: auto; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
body.mode-a4 { }

/* Ajustements : place pour les hampes et jambages de la cursive. */
[hidden] { display: none !important; }
.tuile { aspect-ratio: auto; min-height: clamp(100px, 14vw, 160px); padding: .5rem .3rem 1.1rem; }
.tuile .p { line-height: 1.85; margin-bottom: 0; }
.alphabet .tuile { gap: .15rem; }
.alphabet .tuile img { width: 30%; margin-top: .2rem; }
.ecriture-carte { padding-top: .8rem; }
.page-a5 .p-trois .f-cursive.g { font-size: 38pt; line-height: 1.82; }
.page-a5 .entoure .f-cursive { font-size: 22pt; line-height: 2.2; }
.page-a5 .case { display: inline-block; width: 3.4mm; height: 3.4mm; border: .35mm solid #222; border-radius: .6mm; vertical-align: -.4mm; margin: 0 .8mm 0 1.6mm; }
.page-a5 .ecoute .cases { letter-spacing: 0; }
/* La cursive Marelle a de longs jambages (f, g, j, p, q, y, z) : on leur réserve de la place. */
.tuile .p .f-cursive, .p-mot .mots .f-cursive, .mot-repere .mot.f-cursive { display: inline-block; padding-bottom: .55em; }
.tuile .p { line-height: 1.5; }
.ecriture-carte .f-cursive.g, .page-a5 .p-trois .f-cursive.g { padding-bottom: .3em; line-height: 1.5; }
.page-a5 .entoure { line-height: 1.2; align-items: start; }
.page-a5 .entoure .f-cursive { line-height: 1.3; padding-bottom: .7em; }
.page-a5 .relie { font-size: 19pt; line-height: 1; }
.page-a5 .relie span { height: 10.5mm; align-items: flex-start; }
.page-a5 .ecoute img { width: 12mm; height: 12mm; }
.page-a5 .p-trois .g { font-size: 52pt; }
.page-a5 .p-mot img { width: 18mm; height: 18mm; }
.ecriture-carte .f-cursive.g, .page-a5 .p-trois .f-cursive.g { padding-bottom: .62em; line-height: 1.3; }
.page-a5 .consigne-p .f-cursive { display: inline-block; padding-bottom: .6em; vertical-align: top; line-height: 1; }
.ecriture-carte { display: flex; flex-direction: column; align-items: center; }
.ecriture-carte .nom { order: -1; }
.ecriture-carte .f-script.g { padding-bottom: .22em; }
.prenom-cartes { display: grid; gap: .8rem; margin: 1rem 0; }
.prenom-cartes small { display: block; }
.prenom-grand { font-size: clamp(2.2rem, 7vw, 4.6rem); word-break: normal; overflow-wrap: anywhere; line-height: 1.4; }
.prenom-grand.f-cursive, .prenom-grand.f-cursive-baton { line-height: 1.7; padding-bottom: .3em; }
.page-a5 .abc { grid-template-columns: repeat(3, 1fr); gap: 2.5mm; flex: 1; grid-auto-rows: 1fr; max-height: 172mm; }
.page-a5 .abc div { justify-content: space-between; padding: 1.5mm 0 1.5mm; }
.page-a5 .abc .l { font-size: 24pt; gap: 3.5mm; line-height: 1.1; }
.page-a5 .abc .l .f-cursive { display: inline-block; padding-bottom: .45em; font-size: 26pt; }
.page-a5 .abc img { width: 13mm; height: 13mm; margin-top: -3mm; }
.page-a5 .abc small { font-size: 10pt; }
.page-a5 .abc div { padding-top: 4.5mm; }
.page-a5 .abc .l .f-cursive { font-size: 22pt; padding-bottom: .2em; }
.page-a5 .abc img { margin-top: 0; width: 12mm; height: 12mm; }
.page-a5 > * { flex-shrink: 0; }
.page-a5 > .bloc-lignes, .page-a5 > .abc { flex-shrink: 1; }
.page-a5 .abc { max-height: 164mm; }

/* Cursive sur lignage Seyès (variante Marelle LIGNES : les lignes font partie de la police). */
.seyes { font-family: "Marelle Lignes", cursive !important; }
.seyes.f-cursive-baton { font-family: "Marelle Lignes Baton", cursive !important; }
.seyes .cible { font-weight: 400; }
/* Le lignage Marelle tient exactement dans une hauteur de 1,92 em : on cale chaque bloc dessus. */
.seyes { line-height: 1.92 !important; padding-top: 0 !important; padding-bottom: 0 !important; display: inline-block; white-space: pre; }
.ecriture-carte .seyes.g { font-size: clamp(2.2rem, 5.4vw, 4.4rem); display: block; }
.mot-repere .mot.seyes { font-size: 1.45rem; }
.choix.seyes { font-size: clamp(2rem, 5.2vw, 3.8rem); display: flex; }
.modele.seyes { font-size: clamp(2rem, 5.6vw, 4rem); display: block; }
.kim-carte.seyes { font-size: clamp(1.6rem, 4.2vw, 3rem); display: flex; }
.tuile .p .seyes { font-size: .8em; }
.alphabet .tuile .g.seyes { font-size: clamp(1.4rem, 3.2vw, 2.4rem); }
.prenom-grand.seyes { font-size: clamp(1.6rem, 5vw, 3.2rem); }
.page-a5 .p-trois .seyes.g { font-size: 28pt; display: block; }
.page-a5 .p-mot .mots .seyes { font-size: 19pt; }
.page-a5 .entoure .seyes { font-size: 15pt; justify-self: center; }
.page-a5 .relie .seyes { font-size: 13pt; height: 10.5mm; }
.page-a5 .abc .l .seyes { font-size: 14pt; }
/* Les jambages de f, g, j, p, q, y, z descendent sous la dernière ligne. */
.seyes { padding-bottom: .5em !important; }
.choix.seyes { padding-bottom: .25em !important; }
.ecriture-carte .seyes.g { font-size: clamp(2.6rem, 6.4vw, 5.2rem); }
.page-a5 .p-trois > div { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; }
.page-a5 .p-trois small { order: -1; }
.page-a5 .p-trois .seyes.g { font-size: 30pt; padding-bottom: .35em !important; }
/* Abécédaire : grille en millimètres (3 colonnes × 5 rangées), pour que rien ne déborde à l'impression. */
.page-a5 .abc { flex: none; max-height: none; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(5, 30.5mm); grid-auto-rows: 30.5mm; gap: 2.2mm; }
.page-a5 .abc div { height: 30.5mm; overflow: hidden; padding: 1.2mm 0 1mm; justify-content: flex-start; gap: 0; }
.page-a5 .abc .l { font-size: 21pt; gap: 2.5mm; align-items: center; line-height: 1; height: 14mm; }
.page-a5 .abc .l .seyes { font-size: 17pt; padding-bottom: 0 !important; }
.page-a5 .abc img { width: 10mm; height: 10mm; margin: .3mm 0 0; }
.page-a5 .abc small { font-size: 9.5pt; line-height: 1.2; margin-top: .3mm; }
/* Une page A5 imprimée mesure 209,9 mm chez certains navigateurs : on reste en dessous pour éviter une page blanche. */
@media print {
  .page-a5 { height: 208.5mm; }
  .feuille-a4 { height: 208.5mm !important; }
  .feuille-a4 .page-a5 { height: 208.5mm; }
  .page-a5:last-child, .feuille-a4:last-child { break-after: auto; page-break-after: auto; }
}

/* Logo */
.logo-img { height: 2.6rem; width: auto; }
.logo-accueil { width: min(70vw, 320px); height: auto; display: block; margin: 0 auto; }
.accueil .grandes-lettres { font-size: clamp(2.6rem, 8vw, 5rem); }
.page-a5 .pied { align-items: flex-end; }
.page-a5 .pied-logo { display: inline-flex; align-items: flex-end; gap: 1.5mm; }
.page-a5 .pied-logo img { height: 7mm; width: auto; }

/* ===== Cahiers multimédias ===== */
body.dans-cahier .fil, body.dans-cahier .lettre-suite, body.dans-cahier .barre-integre { display: none !important; }
.tourne { width: 100%; text-align: center; font-weight: 700; font-size: 1.2rem; color: var(--doux); margin: .5rem 0 0; }
.bouton-cahier { display: flex; align-items: center; gap: .9rem; margin: 1.2rem 0 .2rem; padding: .8rem 1.2rem; border-radius: var(--rayon);
  background: var(--c); color: #fff; text-decoration: none; box-shadow: var(--ombre); max-width: 560px; }
.bouton-cahier .ico { font-size: 2.2rem; }
.bouton-cahier strong { display: block; font-size: 1.2rem; }
.bouton-cahier small { display: block; opacity: .9; }

/* La carte d'une lettre (couverture et vignettes) */
.carte-lettre { container-type: inline-size; width: 100%; aspect-ratio: 1; display: grid; grid-template: 1fr 1fr / 1fr 1fr; gap: 3cqw; padding: 4cqw;
  background: #fff; border: 2.4cqw solid var(--c); border-radius: 8cqw; box-sizing: border-box; color: #1d2330; }
.carte-lettre > div { background: #faf7ef; border-radius: 5cqw; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; min-height: 0; }
.carte-lettre .f-capitale { font-size: 24cqw; line-height: 1; }
.carte-lettre .f-script { font-size: 24cqw; line-height: 1; margin-top: -4cqw; }
.carte-lettre .seyes { font-size: 10cqw !important; padding-bottom: 3cqw !important; }
.carte-lettre img { width: 20cqw; height: auto; }
.carte-lettre .mot.f-script { font-size: 7.5cqw; margin: 1cqw 0 0; line-height: 1.1; }

/* Le cahier ouvert : une page à la fois */
body.page-cahier { background: #e5f1f1; }
body.page-cahier .entete, body.page-cahier .barre-integre { display: none; }
body.page-cahier main { padding: 0; max-width: none; }
.cahier { position: relative; height: 100vh; height: 100dvh; padding: 18px 70px 18px 44px; box-sizing: border-box; }
.c-spirale { position: absolute; left: 22px; top: 44px; bottom: 44px; display: flex; flex-direction: column; justify-content: space-between; z-index: 2; }
.c-spirale span { display: block; width: 32px; height: 7px; border-radius: 4px; background: #4a4f58; box-shadow: 0 2px 0 rgba(0,0,0,.15); }
.c-feuille { position: relative; height: 100%; background: #fff; border-radius: 24px; box-shadow: 0 3px 0 rgba(0,0,0,.08), 0 10px 30px rgba(0,0,0,.08);
  display: flex; flex-direction: column; overflow: hidden; padding: 16px 20px 18px 34px; box-sizing: border-box; }
.cahier[data-type="couverture"] .c-feuille { background: var(--c); box-shadow: 0 10px 0 color-mix(in srgb, var(--c) 70%, #000), 0 14px 30px rgba(0,0,0,.12); padding: 28px 60px; }
.cahier[data-type="mission"] .c-feuille, .cahier[data-type="bravo"] .c-feuille {
  background: #fff repeating-linear-gradient(#fff 0 31px, #dde3e8 31px 32px); }
.cahier button { font: inherit; cursor: pointer; }

.c-couverture { flex: 1; display: flex; flex-direction: column; gap: 18px; min-height: 0; }
.c-titre { background: #fff; border: 3px solid #1d2330; border-radius: 18px; padding: 10px 22px 12px; display: flex; flex-direction: column; }
.c-titre .c-niveau { font-weight: 700; color: var(--doux); font-size: .85rem; border-bottom: 2px solid #ddd; padding-bottom: 4px; }
.c-titre h1 { margin: 4px 0; font-size: clamp(1.6rem, 4vw, 2.4rem); }
.c-titre .c-sous { font-size: .95rem; color: var(--doux); border-top: 2px solid #ddd; padding-top: 4px; }
.c-image { flex: 1; min-height: 0; background: #fff; border-radius: 22px; display: flex; align-items: center; justify-content: center; padding: 14px; }
.c-image .carte-lettre { width: auto; height: 100%; max-width: 100%; }
.c-bas { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.c-logo { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; color: #fff; font-size: .9rem; }
.c-logo img { height: 40px; width: auto; background: #fff; border-radius: 10px; padding: 2px 4px; }
.c-ouvrir, .c-parti { background: #1d2330; color: #fff; border: 0; border-radius: 999px; padding: .65em 1.6em; font-weight: 700; font-size: 1.2rem; text-decoration: none; display: inline-flex; align-items: center; }

.c-tete { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: 10px; }
.c-etiquette { background: var(--c); color: #fff; font-weight: 700; padding: .25em .9em; border-radius: 999px; }
.c-phrase { flex: 1; min-width: 12em; font-weight: 600; }
.c-nav { display: inline-flex; align-items: center; gap: .8rem; }
.c-avant { background: #fff; border: 2px solid var(--c); color: #1d2330; border-radius: 999px; padding: .35em 1em; font-weight: 700; }
.c-num { font-size: .85rem; color: var(--doux); font-weight: 700; white-space: nowrap; }
.c-cadre { flex: 1; width: 100%; min-height: 0; border: 0; border-radius: 14px; background: var(--fond); margin-bottom: 44px; }
.c-coin { position: absolute; right: 0; bottom: 0; width: 96px; height: 96px; border: 0; background: transparent; padding: 0; }
.c-coin::after { content: ""; position: absolute; right: 0; bottom: 0; width: 76px; height: 76px; background: var(--c); clip-path: polygon(100% 0, 100% 100%, 0 100%); border-bottom-right-radius: 24px; }
.c-coin span { position: absolute; right: 6px; top: -34px; width: 80px; font-size: .72rem; font-weight: 700; line-height: 1.1; text-align: center; color: #1d2330; }
.c-coin:hover::after { filter: brightness(1.1); }

.c-outils { flex: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.2rem; align-content: center; padding: 0 3rem 60px; }
.c-outil { display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: 2rem 1rem; background: #faf8f2; border: 2px solid #e4e0d4; border-radius: 22px; color: #1d2330; text-align: center; }
.c-outil-ico { font-size: 4rem; }
.c-outil strong { font-size: 1.5rem; }

.c-mission { flex: 1; display: flex; flex-direction: column; gap: 1.6rem; padding: 2rem clamp(1rem, 8vw, 8rem) 0; }
.c-tampon { align-self: flex-start; background: var(--c); color: #1d2330; font-family: Andika, sans-serif; font-weight: 700; font-size: clamp(2rem, 5vw, 3.4rem);
  padding: .1em .6em; border-radius: 12px; transform: rotate(-2deg); color: #fff; }
.c-boite { background: #fff; border: 3px solid #1d2330; border-radius: 18px; padding: 1rem 1.6rem 1.2rem; }
.c-boite span { color: color-mix(in srgb, var(--c) 70%, #000); font-weight: 700; }
.c-boite p { margin: .3rem 0 0; font-size: clamp(1.3rem, 2.6vw, 1.9rem); font-weight: 700; max-width: none; line-height: 1.35; }
.c-ecouter { align-self: flex-start; background: #fff; border: 3px solid #1d2330; border-radius: 999px; padding: .45em 1.2em; font-weight: 700; font-size: 1.15rem; }
.sans-voix .c-ecouter { display: none; }
.c-mission-bas { margin-top: auto; display: flex; align-items: center; gap: 1rem; padding-bottom: .5rem; }
.c-mission-bas .c-parti { margin-left: auto; font-size: 1.4rem; }

.c-bravo { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .8rem; text-align: center; }
.c-etoile { font-size: 5rem; }
.c-bravo h1 { font-size: 3rem; margin: 0; }
.c-fait { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; max-width: 760px; }
.c-fait button { border: 2px solid var(--bord); background: #fff; border-radius: 999px; padding: .3em .9em; }
.c-fait button.vu { border-color: var(--ok); color: var(--ok); font-weight: 700; }

.c-marge { position: absolute; right: 8px; top: 18px; bottom: 18px; width: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.c-grand { position: absolute; top: 0; width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--c); background: #fff; font-size: 1.4rem; line-height: 1; }
.c-onglet { writing-mode: vertical-rl; background: color-mix(in srgb, var(--c) 80%, #000); color: #fff; border: 0; border-radius: 0 14px 14px 0; padding: 1.6rem .55rem; font-weight: 700; margin-left: -8px; }
.c-etapes { position: absolute; right: 70px; top: 50%; transform: translateY(-50%); z-index: 5; display: flex; flex-direction: column; gap: 6px; max-height: 80vh; overflow: auto; padding: 4px; }
.c-etapes[hidden] { display: none; }
.c-etapes button { background: var(--c); color: #fff; border: 2px solid #fff; border-radius: 12px; padding: .45em 1em; font-weight: 700; text-align: left; box-shadow: var(--ombre); min-width: 11rem; }
.c-etapes button small { display: block; font-weight: 400; opacity: .95; }
.c-etapes button.ici { background: #1d2330; }
.c-etapes button.vu::after { content: " ✔"; }

@media (max-width: 700px) {
  .cahier { padding: 8px 8px 8px 8px; }
  .c-spirale { display: none; }
  .c-feuille { padding: 12px; }
  .cahier[data-type="couverture"] .c-feuille { padding: 16px; }
  .c-marge { right: 12px; top: 12px; bottom: auto; width: auto; flex-direction: row; gap: 6px; z-index: 6; }
  .c-grand { position: static; }
  .c-onglet { writing-mode: horizontal-tb; border-radius: 12px; padding: .5rem .9rem; margin: 0; }
  .c-etapes { right: 12px; top: 64px; transform: none; }
  .c-tete { padding-right: 9rem; }
  .c-mission { padding: 1rem .5rem 0; }
}

/* La rubrique Cahiers */
.cahiers-tete h1 { color: #c26a12; text-transform: uppercase; letter-spacing: .02em; }
.cahiers-outils { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; margin: 1rem 0 1.4rem; }
.cahiers-outils input[type=search] { flex: 1; min-width: 14rem; font: inherit; padding: .45em .8em; border: 2px solid var(--bord); border-radius: 12px; }
.cahiers-cartes { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.cahier-carte { background: var(--carte); border: 2px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre); overflow: hidden; display: flex; flex-direction: column; }
.cahier-vignette { display: flex; justify-content: center; padding: 1rem; background: color-mix(in srgb, var(--c) 18%, #fff); }
.cahier-vignette .carte-lettre { width: 62%; }
.cahier-infos { padding: .8rem 1rem 0; flex: 1; }
.cahier-infos h2 { font-size: 1.15rem; margin: 0 0 .4rem; }
.cahier-infos h2 .doux { font-weight: 400; font-size: .9rem; }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; padding: .15em .6em; border-radius: 6px; background: color-mix(in srgb, var(--c) 16%, #fff); color: color-mix(in srgb, var(--c) 75%, #000); }
.cahier-actions { display: flex; gap: .5rem; padding: .8rem 1rem 1rem; flex-wrap: wrap; }
.cahier-actions .bouton { min-height: 2.6rem; font-size: .9rem; }
.cahiers-lignes { display: flex; flex-direction: column; gap: .6rem; }
.cahiers-lignes .cahier-carte { flex-direction: row; align-items: center; }
.cahiers-lignes .cahier-vignette { padding: .5rem; width: 110px; flex: none; }
.cahiers-lignes .cahier-vignette .carte-lettre { width: 100%; }
.cahiers-lignes .cahier-infos { padding: .4rem 1rem; }
.cahiers-lignes .cahier-actions { padding: .5rem 1rem; }
/* La carte : le cadre extérieur sert de mesure (cqw) à la grille intérieure. */
.carte-lettre { display: block; padding: 0; border: 0; background: none; gap: 0; border-radius: 0; }
.carte-lettre .cl { width: 100%; height: 100%; box-sizing: border-box; display: grid; grid-template: 1fr 1fr / 1fr 1fr; gap: 3cqw; padding: 4cqw;
  background: #fff; border: 2.4cqw solid var(--c); border-radius: 8cqw; }
.carte-lettre .cl > div { background: #faf7ef; border-radius: 5cqw; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; min-height: 0; }
.c-grand { display: flex; align-items: center; justify-content: center; color: #1d2330; }
.c-image .carte-lettre { aspect-ratio: 1; }
.carte-lettre .cl { aspect-ratio: 1; height: auto; grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.carte-lettre .cl > div { align-self: stretch; justify-self: stretch; }
.cahier-vignette, .cahier-vignette:hover { text-decoration: none; color: inherit; }

/* ===== Thème « La Ruche » (inspiré de fluence.notre-sac-a-dos.net) ===== */
@font-face { font-family: "Nunito Sans"; src: url(/fonts/NunitoSans-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Nunito Sans"; src: url(/fonts/NunitoSans-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Nunito Sans"; src: url(/fonts/NunitoSans-800.woff2) format("woff2"); font-weight: 800; font-display: swap; }
:root {
  --fond: #FFFBEA; --carte: #FFFFFF; --texte: #2B241D; --doux: #7A6E4E; --bord: #EFE3B8;
  --accent: #F5C21B; --accent-texte: #2B241D; --accent-doux: #FFF3C2; --ambre: #9A6400; --bleu: #1F5C8B;
  --ok: #2E7D4F; --ok-fond: #DDF0E4; --non: #A33A2A; --non-fond: #F8E0DB; --cible: #C2342B;
  --rayon: 16px; --ombre: none;
  --ui: "Nunito Sans", "Segoe UI", Roboto, system-ui, sans-serif;
}
body { font-family: var(--ui); }
h1, h2, h3, .consigne, .retour { font-family: var(--ui); font-weight: 800; }
a { color: var(--bleu); }
:focus-visible { outline-color: var(--ambre); }
.contraste { --fond: #fff; --bord: #2B241D; --doux: #2B241D; --accent: #F5C21B; }

/* Entête : blanche, liseré miel */
.entete { background: #fff; border-bottom: 1px solid var(--bord); }
.logo { font-family: var(--ui); font-weight: 800; }
.entete nav a { font-weight: 800; color: var(--texte); border-radius: 10px; }
.entete nav a[aria-current="page"] { background: var(--accent); color: var(--accent-texte); }

/* Boutons : coins de 12 px, gras, jaune miel pour l'action principale */
.bouton, .btn { border-radius: 12px; border: 1px solid var(--bord); box-shadow: none; font-family: var(--ui); font-weight: 800; background: #fff; color: var(--texte); }
.bouton.principal, .btn.principal { background: var(--accent); border-color: var(--accent); color: var(--accent-texte); }
.btn-son { background: var(--accent-doux); border-color: var(--accent); }
.onglets { border: 1px solid var(--bord); border-radius: 12px; }
.onglets button { font-family: var(--ui); font-weight: 800; }
.onglets button[aria-pressed="true"] { background: var(--accent); color: var(--accent-texte); }
.mini { border-radius: 10px; border-color: var(--bord); font-family: var(--ui); font-weight: 700; }
select, input[type=search], .prenom-saisie { border: 1px solid var(--bord) !important; border-radius: 12px !important; }

/* Cartes et tuiles : blanches, fin liseré, sans ombre */
.carte, .entree, .ecriture-carte, .mot-repere.carte, .choix, .tuile, .activite-btn, .kim-carte, .tracer-zone, .cahier-carte, .c-outil, .prenom-lettres button {
  box-shadow: none; }
.carte, .entree, .ecriture-carte, .choix, .kim-carte, .tracer-zone, .cahier-carte { border: 1px solid var(--bord); }
.tuile, .activite-btn { border-width: 2px; }
.entree { font-family: var(--ui); font-weight: 800; }
.etape { border-top-width: 6px; }
.etape-num { font-weight: 800; }
.choix.bon { background: var(--ok-fond); border: 2px solid var(--ok); }
.choix.faux { background: var(--non-fond); border: 2px solid var(--non); }
.progression i.encours { background: var(--accent); }
.progression i.fait, .points i.fait { background: var(--ok); }
.modele { border: 2px dashed var(--bord); }
.note { background: var(--accent-doux); border-left-color: var(--accent); }
.bouton-cahier { background: var(--accent); color: var(--accent-texte); box-shadow: none; }
.alphabet .tuile.joue { background: var(--accent-doux); }
.toast { background: var(--texte); }
.dialogue { border-radius: 16px; }
.ens th { background: var(--accent-doux); }
.ens pre, .ens code { background: var(--accent-doux); }
.cahiers-tete h1 { color: var(--texte); text-transform: none; letter-spacing: 0; }
.tag { border-radius: 6px; }
.cahier-vignette { background: var(--accent-doux); }
.impression-barre { border-bottom: 1px solid var(--bord); }

/* Cahiers : couverture jaune miel, texte foncé (comme les boutons de La Ruche) */
body.page-cahier { background: #FFF6D6; }
.c-feuille { border: 1px solid var(--bord); box-shadow: none; }
.cahier[data-type="couverture"] .c-feuille { border: 0; box-shadow: 0 8px 0 #D9A400; }
.c-titre { border: 2px solid var(--texte); }
.c-titre .c-niveau { color: var(--etape); }
.c-etiquette, .c-tampon, .c-etapes button { color: var(--c-texte); }
.c-tampon { font-family: var(--ui); font-weight: 800; }
.c-boite span { color: var(--c-fort); }
.c-avant { border-color: var(--bord); border-width: 1px; font-family: var(--ui); font-weight: 800; border-radius: 12px; }
.c-ouvrir, .c-parti { background: var(--texte); border-radius: 12px; font-family: var(--ui); font-weight: 800; }
.c-ecouter { border-width: 2px; border-radius: 12px; font-family: var(--ui); font-weight: 800; background: var(--accent-doux); border-color: var(--accent); }
.c-onglet { background: var(--accent); color: var(--c-texte); font-family: var(--ui); font-weight: 800; }
.c-grand { border-color: var(--bord); }
.c-etapes button { border-color: #fff; font-family: var(--ui); }
.c-etapes button.ici { background: var(--texte); color: #fff; }
.c-logo { color: var(--c-texte); }
.c-coin span { font-family: var(--ui); font-weight: 800; }
.c-outil { border: 1px solid var(--bord); }
.c-num { font-family: var(--ui); }
.carte.etape { border-top: 6px solid var(--c); }

/* Page Mission : le bouton pour commencer est juste sous la mission, toujours visible. */
.c-mission { overflow-y: auto; min-height: 0; }
.c-mission-boutons { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }
.c-mission-boutons .c-ecouter { align-self: auto; }
.c-commencer { background: var(--texte); color: #fff; border: 0; border-radius: 12px; padding: .6em 1.5em; font-family: var(--ui); font-weight: 800; font-size: 1.35rem; cursor: pointer; }
.c-commencer:hover { filter: brightness(1.2); }
@media (max-height: 640px) {
  .c-mission { gap: .7rem; padding-top: .8rem; }
  .c-tampon { font-size: 1.6rem; }
  .c-boite { padding: .6rem 1rem .8rem; }
  .c-boite p { font-size: 1.2rem; }
}
