@font-face{font-family:'Dancing Script';font-weight:500;font-display:swap;src:url(fonts/dancing-script-latin-500-normal.woff2) format('woff2')}
@font-face{font-family:'Dancing Script';font-weight:600;font-display:swap;src:url(fonts/dancing-script-latin-600-normal.woff2) format('woff2')}
@font-face{font-family:Nunito;font-weight:400;font-display:swap;src:url(fonts/nunito-latin-400-normal.woff2) format('woff2')}
@font-face{font-family:Nunito;font-weight:600;font-display:swap;src:url(fonts/nunito-latin-600-normal.woff2) format('woff2')}
@font-face{font-family:Nunito;font-weight:700;font-display:swap;src:url(fonts/nunito-latin-700-normal.woff2) format('woff2')}
@font-face{font-family:Nunito;font-weight:800;font-display:swap;src:url(fonts/nunito-latin-800-normal.woff2) format('woff2')}
:root{
  --nuit:#0a1230; --papier:#F7F0E2; --panneau:#FFFDF8; --filet:#E6D9C1; --filet-fort:#E0D2B8;
  --texte:#3B322A; --texte-2:#6E6152; --texte-3:#9A8B75;
  --cobalt:#1F56C4; --cobalt-fonce:#1a4aab; --cobalt-clair:#EAF0FD; --cobalt-bord:#BFD0F2;
  --maitrise:#8E5A00; --or:#C9992A; --or-fonce:#A87A16; --or-vif:#F2C55C; --brique:#A8553A;
  --cursive:'Dancing Script','Segoe Script','Snell Roundhand',Nunito,sans-serif;
  --police:Nunito,'Segoe UI',system-ui,sans-serif;
  --ease:cubic-bezier(.2,.8,.2,1);
}
*{box-sizing:border-box}
[hidden]{display:none!important}
html,body{height:100%;margin:0}
body{background:var(--nuit);color:var(--texte);font-family:var(--police);font-size:16px;line-height:1.4;overflow:hidden;-webkit-font-smoothing:antialiased;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
button{font:inherit;color:inherit;cursor:pointer}
:focus-visible{outline:3px solid var(--or-vif);outline-offset:2px}
#app{position:relative;height:100%;height:100dvh;display:grid;grid-template-rows:minmax(0,1fr) auto;overflow:clip}
#scene{position:relative;min-height:0;overflow:hidden}
#gl{position:absolute;inset:0;width:100%;height:100%;display:block}
#sans-3d{position:absolute;inset:0;display:grid;place-content:center;padding:24px;text-align:center;color:#d9cbb0;font-size:15px}

/* ---------- tête haute ---------- */
#hud{position:absolute;z-index:5;left:0;right:0;top:0;display:flex;align-items:center;gap:10px;padding:max(10px,env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) 0 max(14px,env(safe-area-inset-left));pointer-events:none}
#hud>*{pointer-events:auto}
.puce{display:inline-flex;align-items:center;gap:7px;height:38px;padding:0 13px;border-radius:999px;background:rgba(10,16,44,.62);border:1px solid rgba(242,197,92,.28);color:#f1e6cf;font-weight:800;font-size:14px;backdrop-filter:blur(6px);font-variant-numeric:tabular-nums}
.puce small{font-size:10.5px;letter-spacing:.1em;text-transform:uppercase;color:#b7a88c;font-weight:800}
.pages{display:inline-flex;gap:4px}
.pages i{width:13px;height:17px;border-radius:2px 4px 4px 2px;background:#f3e6c6;box-shadow:inset 2px 0 0 #c9a45a;transition:transform .4s var(--ease),opacity .4s}
.pages i.mangee{opacity:.18;transform:rotate(18deg) scale(.8)}
#serie.chaud{border-color:var(--or-vif);color:var(--or-vif);box-shadow:0 0 18px rgba(242,197,92,.35)}
#hud .vide{flex:1}
/* le repère des points d'or de la nuit : absent tant qu'aucun n'est gagné ; la goutte d'or qui le rejoint (goutteOr dans jeu.js) */
#or-n:empty{display:none} #or{gap:6px;padding:0 11px;border-color:rgba(242,197,92,.5);color:var(--or-vif)}
#or i{width:11px;height:11px;border-radius:50%;background:radial-gradient(circle at 35% 30%,#fff3c4,var(--or-vif) 50%,var(--or));box-shadow:0 0 7px rgba(242,197,92,.55)}
#or.plus{animation:or-plus .45s var(--ease)}
@keyframes or-plus{35%{transform:scale(1.2);box-shadow:0 0 16px rgba(242,197,92,.5)}}
.goutte-or{position:fixed;z-index:30;left:-7px;top:-7px;width:14px;height:14px;border-radius:50%;background:radial-gradient(circle at 35% 30%,#fff3c4,var(--or-vif) 48%,var(--or-fonce));box-shadow:0 0 12px rgba(242,197,92,.85);pointer-events:none;will-change:transform,opacity}
#hud button.puce{padding:0;width:38px;justify-content:center}
#hud svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}

/* ---------- étiquettes posées sur la scène ---------- */
.etiquette{position:absolute;z-index:3;left:0;top:0;transform:translate(-50%,-100%);white-space:nowrap;pointer-events:none;font:800 15px/1 var(--police);color:#f6ead2;background:rgba(10,16,44,.74);border:1px solid rgba(255,255,255,.14);border-radius:10px;padding:7px 10px;transition:opacity .25s;will-change:transform}
.etiquette.cible{border-color:var(--or-vif);box-shadow:0 0 0 3px rgba(242,197,92,.18)}
.etiquette.boss{font-size:17px;border-color:#d0704f;color:#ffd9c9}
.etiquette .pv{display:inline-flex;gap:3px;margin-left:8px;vertical-align:1px}
.etiquette .pv i{width:8px;height:8px;border-radius:50%;background:#d0704f} .etiquette .pv i.x{background:rgba(255,255,255,.18)}
#bulle{position:absolute;z-index:4;left:0;top:0;max-width:min(300px,62vw);transform:translate(-12%,-100%);background:var(--panneau);border-radius:18px 18px 18px 4px;padding:11px 15px;font-family:var(--cursive);font-size:22px;line-height:1.18;color:var(--texte);box-shadow:0 10px 30px rgba(0,0,0,.5);opacity:0;transition:opacity .25s;pointer-events:none;text-wrap:balance}
#bulle.vue{opacity:1}
/* une bulle de bande dessinée : contour à l'encre, coins bien ronds, et une queue qui part vers Cobalt (vers le bas, ou vers la gauche quand la bulle est à côté de sa tête) */
#bulle{border:2.5px solid #2a2340;border-radius:24px;padding:11px 17px 12px}
#bulle::before,#bulle::after{content:'';position:absolute;top:100%;left:18px;width:40px;height:30px;background:#2a2340;clip-path:polygon(35% 0,100% 0,0 100%)}
#bulle::after{left:24px;top:calc(100% - 3.5px);width:30px;height:24px;background:var(--panneau)}
#bulle.cote::before{top:auto;bottom:16px;left:auto;right:100%;width:30px;height:30px;clip-path:polygon(100% 0,100% 100%,0 96%)}
#bulle.cote::after{top:auto;bottom:20px;left:auto;right:calc(100% - 3.5px);width:25px;height:22px;clip-path:polygon(100% 0,100% 100%,0 96%)}
#bulle.au-livre::before,#bulle.au-livre::after{display:none}
#bandeau{position:absolute;z-index:4;left:50%;top:22%;transform:translate(-50%,-50%);font-family:var(--cursive);font-weight:600;font-size:clamp(40px,8vw,84px);color:#fbe8b6;text-shadow:0 4px 30px rgba(0,0,0,.8),0 0 40px rgba(242,197,92,.35);opacity:0;pointer-events:none;white-space:nowrap}
#bandeau.vue{animation:bandeau 1.9s var(--ease) both}
@keyframes bandeau{0%{opacity:0;transform:translate(-50%,-30%) scale(.9)}18%,70%{opacity:1;transform:translate(-50%,-50%) scale(1)}100%{opacity:0;transform:translate(-50%,-70%) scale(1.04)}}
#piege{position:absolute;z-index:4;left:50%;bottom:12px;transform:translateX(-50%);max-width:min(560px,calc(100% - 24px));background:rgba(10,16,44,.8);border:1px solid rgba(242,197,92,.3);color:#f1e6cf;border-radius:14px;padding:9px 14px;font-size:14.5px;opacity:0;transition:opacity .3s;pointer-events:none;backdrop-filter:blur(6px);text-align:center}
#piege.vue{opacity:1}
#piege{display:flex;align-items:center;justify-content:center;width:max-content} #piege>span{min-width:0}
#piege b{font-family:var(--cursive);font-weight:600;font-size:24px;color:var(--or-vif);margin-right:8px;vertical-align:-2px}
#piege.revoir b{color:#f0a487}
.vol{position:absolute;z-index:6;left:0;top:0;font-family:var(--cursive);font-weight:600;font-size:40px;color:var(--or-vif);text-shadow:0 0 18px rgba(255,200,90,.9);pointer-events:none;white-space:nowrap;will-change:transform,opacity}
.lettre{position:absolute;z-index:6;left:0;top:0;font:800 20px var(--police);color:#cfc3ff;pointer-events:none;will-change:transform,opacity}

/* ---------- panneau d'épreuve ---------- */
#panneau{position:relative;z-index:7;background:var(--papier);border-radius:22px 22px 0 0;box-shadow:0 -14px 40px rgba(0,0,0,.5);padding:14px max(16px,env(safe-area-inset-right)) max(14px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));display:grid;gap:10px;justify-items:center}
#panneau>*{width:min(100%,720px)}
.genre{display:flex;align-items:center;gap:8px;font-size:11px;font-weight:800;letter-spacing:.12em;text-transform:uppercase;color:var(--texte-3)}
.genre b{color:var(--cobalt);background:var(--cobalt-clair);border:1px solid var(--cobalt-bord);border-radius:999px;padding:3px 10px}
.genre .nature{margin-left:auto}
#phrase{margin:0;font-size:clamp(17px,2.3vw,21px);color:var(--texte)}
#phrase .trou{display:inline-block;min-width:4.6em;border-bottom:3px solid var(--cobalt);margin:0 .25em;transform:translateY(-3px)}
#phrase strong{color:var(--or-fonce)}
#zone{display:grid;gap:10px;min-height:128px;align-content:center}
.ligne{display:flex;gap:10px;flex-wrap:wrap}
#mot{flex:1 1 200px;min-width:0;font:700 clamp(22px,3vw,28px)/1.2 var(--police);color:var(--texte);background:var(--panneau);border:2px solid var(--cobalt-bord);border-radius:14px;padding:13px 16px;outline:none}
#mot:focus{border-color:var(--cobalt);box-shadow:0 0 0 5px rgba(31,86,196,.12)}
.secoue{animation:secoue .4s}
@keyframes secoue{25%{transform:translateX(-6px)}60%{transform:translateX(5px)}}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:54px;padding:0 20px;border-radius:14px;border:1px solid var(--filet);background:var(--panneau);font-weight:800;font-size:16px;color:var(--texte-2);box-shadow:0 3px 0 var(--filet-fort);transition:transform .1s,box-shadow .1s,opacity .2s}
.btn:active{transform:translateY(2px);box-shadow:0 1px 0 var(--filet-fort)}
.btn.primaire{background:var(--cobalt);border-color:var(--cobalt-fonce);color:#fff;box-shadow:0 3px 0 #153c8d}
.btn:disabled{opacity:.4;cursor:default}
.btn small{font-weight:700;font-size:12px;color:var(--texte-3)}
.choix{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:10px}
.choix .btn{min-height:68px;font:700 clamp(22px,3.2vw,30px)/1.1 var(--police);color:var(--texte);letter-spacing:.01em}
.choix .btn.non{opacity:.3;text-decoration:line-through;pointer-events:none}
.dechire{font:800 clamp(28px,4.4vw,40px)/1.1 var(--police);color:var(--texte);text-align:center;letter-spacing:.02em}
.dechire i{display:inline-block;min-width:1.5em;height:1.05em;margin:0 .08em;border-radius:6px;vertical-align:-.12em;background:repeating-linear-gradient(135deg,var(--cobalt-clair) 0 6px,#fff 6px 12px);border:2px dashed var(--cobalt-bord)}
.aides{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.aides .btn{min-height:42px;font-size:14px;padding:0 14px}
#indice-txt{font-family:var(--cursive);font-size:21px;color:var(--cobalt);flex:1 1 200px}

/* ---------- écrans titre et fin ---------- */
.voile{position:absolute;z-index:9;inset:0;display:grid;place-items:center;padding:20px;background:linear-gradient(90deg,rgba(8,14,40,0),rgba(8,14,40,.55) 60%);overflow:auto}
.carte{width:min(100%,460px);justify-self:end;margin-right:clamp(0px,5vw,70px);background:var(--papier);border-radius:24px;padding:26px 26px 22px;box-shadow:0 30px 80px rgba(0,0,0,.6);display:grid;gap:14px}
.carte h1{font-family:var(--cursive);font-weight:600;font-size:clamp(38px,6vw,54px);line-height:.95;margin:0;color:var(--cobalt)}
.carte h1 small{display:block;font:800 11px var(--police);letter-spacing:.16em;text-transform:uppercase;color:var(--texte-3);margin-bottom:10px}
.carte p{margin:0;color:var(--texte-2)}
.regles{display:grid;gap:8px;margin:0;padding:0;list-style:none}
.regles li{display:grid;grid-template-columns:34px 1fr;gap:10px;align-items:center;font-size:14.5px;color:var(--texte-2)}
.regles b{display:grid;place-items:center;width:34px;height:34px;border-radius:10px;background:var(--cobalt-clair);border:1px solid var(--cobalt-bord);color:var(--cobalt);font-size:16px}
.reglage{display:flex;align-items:center;gap:10px;font-size:14px;color:var(--texte-2)}
.reglage input{width:20px;height:20px;accent-color:var(--cobalt)}
.trio{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.trio div{background:var(--panneau);border:1px solid var(--filet);border-radius:14px;padding:10px 12px;font-size:10.5px;font-weight:800;letter-spacing:.1em;text-transform:uppercase;color:var(--texte-3)}
.trio b{display:block;font-size:30px;letter-spacing:0;line-height:1.1;color:var(--or-fonce);font-variant-numeric:tabular-nums}
.liste{display:flex;flex-wrap:wrap;gap:4px 14px;font-family:var(--cursive);font-size:25px;line-height:1.15}
.liste .r{color:var(--brique)}
.liste-titre{font-size:11px;font-weight:800;letter-spacing:.12em;text-transform:uppercase;color:var(--texte-3);margin-bottom:-8px}

@media (max-width:700px){
  .voile{background:linear-gradient(180deg,rgba(8,14,40,0) 20%,rgba(8,14,40,.7) 60%);place-items:end center}
  .carte{justify-self:center;margin:0;padding:20px 18px 16px;gap:11px}
  .puce small{display:none} .puce{height:34px;padding:0 10px;font-size:13px}
  #consigne{display:none}
  #bulle{font-size:19px}
  .etiquette{font-size:13px;padding:5px 8px}
}
@media (max-height:520px){
  #panneau{padding-top:8px;gap:6px;border-radius:14px 14px 0 0} .genre,.aides #indice,#piege{display:none} #zone{min-height:0}
  .btn{min-height:44px} #mot{padding:8px 12px} .choix .btn{min-height:48px}
}
@media (prefers-reduced-motion:reduce){ #bandeau.vue{animation-duration:1.2s} .secoue{animation:none} }
/* ---------- ajouts de la version 2 ---------- */
.etiquette{font-family:var(--police);background:var(--papier);color:var(--texte);border:1px solid var(--filet-fort);box-shadow:0 4px 14px rgba(4,8,30,.45);border-radius:9px 9px 9px 2px;transform-origin:50% 100%}
.etiquette s{text-decoration:underline wavy var(--brique);text-decoration-thickness:1.5px;text-underline-offset:3px}
.etiquette.cible{font-size:18px;padding:8px 12px 10px}
.etiquette.cible{border-color:var(--cobalt);box-shadow:0 0 0 3px rgba(31,86,196,.25),0 4px 14px rgba(4,8,30,.45)}
.etiquette.boss{color:var(--texte);border-color:var(--brique)}
.etiquette .pv i{background:var(--brique)} .etiquette .pv i.x{background:var(--filet-fort)}
.etiquette:not(.cible){opacity:.72;font-size:12px}
#piege{background:var(--papier);color:var(--texte-2);border:1px solid var(--filet-fort);backdrop-filter:none;box-shadow:0 8px 24px rgba(4,8,30,.4)}
#piege b{color:var(--or-fonce)} #piege.revoir b{color:var(--brique)}
#zone{min-height:96px}
.voile{transition:opacity .5s} .voile.part{opacity:0;pointer-events:none}
#fin .carte{box-shadow:none}
@media (max-height:520px){ #hud .puce small{display:none} #hud{gap:6px} .puce{height:30px;font-size:12px;padding:0 9px} #panneau{gap:5px} #phrase{font-size:15px} .aides{display:none} #bulle{display:none} .etiquette{font-size:12px;padding:4px 7px} }

.petit{font-size:13px;color:var(--texte-3)!important}.voix{font-family:var(--cursive);font-size:23px;color:var(--texte)!important}
#fin.jour{background:none}
.dechire.repare{font-family:var(--cursive);font-weight:600;color:var(--or-fonce);letter-spacing:0}
@media (max-width:700px){ #bulle{max-width:62vw;font-size:17px;padding:8px 12px;border-radius:18px} #piege{font-size:12.5px;padding:6px 10px;bottom:6px} #piege b{font-size:19px}
  /* téléphone : trois lignes au plus (deux sur un écran bas), le reste se lit en touchant l'encart (la loupe). La coupe est sur le texte seul :
     posée sur l'encart, elle laissait voir le haut de la ligne suivante dans sa marge et cachait la loupe. */
  #piege>span{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden} }
@media (max-width:700px) and (max-height:620px){ #piege>span{-webkit-line-clamp:2} }
/* ---------- passe « jeu, pas exercice » ---------- */
#nature{display:none}
.gribouillis{display:inline-block;width:86px;height:22px;vertical-align:middle;background:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 96 24'><g fill='none' stroke='%233B322A' stroke-linecap='round' stroke-linejoin='round'><path stroke-width='2.4' d='M4 14c4-9 7-9 8 0s5 8 7-1 5-9 7 1 4 9 7 0 5-10 8 0 5 9 8-1 4-8 7 1 5 8 8-1 5-8 8 1 4 6 7 2 6-6 9-2'/><path stroke-width='1.6' opacity='.75' d='M6 9c8 6 14-6 22 2s14-7 22 1 14-6 22 2 10-3 16-1'/><path stroke-width='3' opacity='.55' d='M10 17c10-3 18 3 28-1s20 3 30-1 12 1 18-1'/></g><g fill='%233B322A'><circle cx='30' cy='6' r='1.6'/><circle cx='71' cy='20' r='2.1'/><circle cx='88' cy='7' r='1.2'/></g></svg>") center/contain no-repeat}
.etiquette:not(.cible) .gribouillis{width:60px;height:15px}
.etiquette .pv{vertical-align:middle}
/* ---------- clavier virtuel ouvert (classe posée d'après la zone réellement visible) ---------- */
html,body{overscroll-behavior:none}
body{position:fixed;inset:0;width:100%}
#app.clavier #panneau{padding-top:8px;gap:5px;border-radius:14px 14px 0 0}
#app.clavier .genre,#app.clavier .aides,#app.clavier #piege,#app.clavier #bulle{display:none}
#app.clavier #zone{min-height:0}
#app.clavier .btn{min-height:44px} #app.clavier #mot{padding:8px 12px} #app.clavier .choix .btn{min-height:48px}
#app.clavier #phrase{font-size:15px}
#app.clavier #hud{gap:6px} #app.clavier .puce{height:30px;font-size:12px;padding:0 9px} #app.clavier .puce small{display:none}
#app.clavier .etiquette{padding:4px 7px}
#panneau{transition:opacity .3s}

/* ---------- cibles d'un doigt, pause, attente ---------- */
#hud button.puce{width:44px;height:44px}
.aides .btn{min-height:46px}
#panneau[inert]>*,#panneau.attente>*{visibility:hidden}                    /* en pause, l'épreuve est cachée ; avant la première épreuve, le panneau est vide */
.carte .btn{width:100%}
#pause{place-items:center;background:rgba(8,14,40,.74)} #pause .carte{justify-self:center;margin:0;width:min(100%,360px);text-align:center}
.btn svg{width:20px;height:20px;flex:none;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
@keyframes fondu{from{opacity:0}to{opacity:1}}

/* ---------- accueil : un parchemin déroulé ; un seul bouton cobalt, le grimoire, la révision, les réglages ---------- */
.ecran{position:absolute;z-index:9;inset:0;display:grid;overflow:auto;padding:max(20px,env(safe-area-inset-top)) max(20px,env(safe-area-inset-right)) max(20px,env(safe-area-inset-bottom)) max(20px,env(safe-area-inset-left));transition:opacity .5s,visibility 0s}
.ecran.part{opacity:0;visibility:hidden;pointer-events:none;transition:opacity .35s,visibility 0s .35s}
#accueil{place-items:center start;background:linear-gradient(90deg,rgba(8,14,40,.5),rgba(8,14,40,0) 52%)}
.menu{position:relative;width:min(100%,372px);margin-left:clamp(0px,3.5vw,48px);display:grid;gap:12px;border-radius:3px;padding:34px 24px 30px;transform:rotate(-.8deg);
  background:radial-gradient(120% 90% at 50% 45%,rgba(247,240,226,0) 55%,rgba(168,122,22,.16)),linear-gradient(180deg,rgba(168,122,22,.14),rgba(168,122,22,0) 9%,rgba(168,122,22,0) 91%,rgba(168,122,22,.16)),var(--papier);
  box-shadow:0 26px 60px rgba(2,5,22,.6)}
.menu::before,.menu::after{content:"";position:absolute;left:-13px;right:-13px;height:24px;border-radius:12px;            /* les deux rouleaux */
  background:linear-gradient(180deg,#fffaf0,#efe3c8 38%,#c9b78f 82%,#a8946a);box-shadow:0 5px 10px rgba(2,5,22,.45),inset 0 0 0 1px rgba(110,97,82,.25)}
.menu::before{top:-11px} .menu::after{bottom:-11px}
.menu h1{font-family:var(--cursive);font-weight:600;font-size:clamp(50px,6.4vw,66px);line-height:.9;margin:0;color:var(--cobalt);text-align:center}
.menu h1 span{display:block;font-weight:500;font-size:.5em;line-height:1.1;color:var(--texte);margin-top:6px}
.menu p{margin:0;color:var(--texte-2);font-size:15px}
.menu .petit{color:var(--texte-2)!important;font-size:14px}
.menu #accueil-intro{text-align:center}
.menu .btn{width:100%}
.menu .btn.primaire{min-height:62px;font-size:19px;flex-direction:column;gap:0}
.menu .btn.primaire small{font-size:12.5px;font-weight:700;color:rgba(255,255,255,.86)}
.menu .btn:not(.primaire){background:rgba(255,253,248,.72)}
/* chaque bouton dit en petit, à droite, sur quels mots il porte (« Réglages » : la classe, posée par la tâche du petit texte) */
#ouvrir-grimoire,#reviser,#ma-liste,#ouvrir-reglages{justify-content:flex-start;color:var(--texte)}
#ouvrir-grimoire>span,#reviser>span,#ma-liste>span,#ouvrir-reglages>span{white-space:nowrap}
#ouvrir-grimoire small,#reviser small,#ma-liste small,#ouvrir-reglages small{margin-left:auto;min-width:0;font-size:13px;line-height:1.25;text-align:right;color:var(--texte-2)}
#ma-liste small span{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#reviser small{color:var(--brique)}
@media (max-aspect-ratio:1/1){
  #accueil{place-items:end center;background:linear-gradient(180deg,rgba(8,14,40,0) 40%,rgba(8,14,40,.6) 75%)}
  .menu{margin:0;width:min(100%,460px)}
}
@media (max-width:700px){
  .ecran{padding:12px}
  .menu{gap:9px;padding:26px 16px 24px;transform:rotate(-.5deg);margin:0 10px 12px;width:calc(100% - 20px)} .menu::before,.menu::after{left:-9px;right:-9px;height:20px}
  .menu h1{font-size:46px} .menu p{font-size:14px} .menu .btn.primaire{min-height:56px}
}
@media (max-height:520px){
  .menu{gap:7px;padding:18px 16px 16px} .menu h1{font-size:34px} .menu h1 span{display:inline;font-size:.6em} #accueil-intro{display:none} .menu .btn.primaire{min-height:46px;font-size:16px}
}

/* ---------- la classe (premier lancement, src/classe.js) : le parchemin de l'accueil, posé de l'autre côté de Cobalt ;
   six livres sur une planche, un par année, de plus en plus hauts (maquette docs/maquettes/classe.html).
   Sous la bulle (z-index 3 contre 4) : la réplique de Cobalt reste lisible même si elle mord sur le rouleau. ---------- */
#classe{z-index:3;place-items:center start;background:linear-gradient(90deg,rgba(8,14,40,.5),rgba(8,14,40,0) 52%)}            /* à gauche, à la place du menu de l'accueil : le cadrage de l'accueil y laisse Cobalt et son pupitre dégagés */
#classe .rouleau{position:relative;width:min(100%,410px);margin-left:clamp(0px,3.5vw,48px);display:grid;gap:14px;border-radius:3px;padding:34px 22px 30px;transform:rotate(.6deg);
  background:radial-gradient(120% 90% at 50% 45%,rgba(247,240,226,0) 55%,rgba(168,122,22,.16)),linear-gradient(180deg,rgba(168,122,22,.14),rgba(168,122,22,0) 9%,rgba(168,122,22,0) 91%,rgba(168,122,22,.16)),var(--papier);
  box-shadow:0 26px 60px rgba(2,5,22,.6)}
#classe .rouleau::before,#classe .rouleau::after{content:"";position:absolute;left:-13px;right:-13px;height:24px;border-radius:12px;            /* les deux rouleaux, comme à l'accueil */
  background:linear-gradient(180deg,#fffaf0,#efe3c8 38%,#c9b78f 82%,#a8946a);box-shadow:0 5px 10px rgba(2,5,22,.45),inset 0 0 0 1px rgba(110,97,82,.25)}
#classe .rouleau::before{top:-11px} #classe .rouleau::after{bottom:-11px}
#classe h1{font-family:var(--cursive);font-weight:600;font-size:42px;line-height:1;margin:0;color:var(--cobalt);text-align:center}
#classe .aide{margin:0;text-align:center;font-size:16px;font-weight:600;color:var(--texte-2)}
/* l'étagère : les livres se tiennent sur une planche de bois, comme dans la bibliothèque derrière Cobalt */
.etagere{position:relative;display:flex;align-items:flex-end;justify-content:center;gap:6px;height:206px;padding:0 6px;margin-top:2px}
.etagere::after{content:"";position:absolute;left:0;right:0;bottom:-14px;height:14px;border-radius:3px;background:linear-gradient(180deg,#8a5a2e,#5e3a1b);box-shadow:0 6px 10px rgba(2,5,22,.35)}
.tome{position:relative;flex:0 1 60px;min-width:48px;border:0;padding:0;border-radius:5px 5px 2px 2px;color:#fff6de;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font-family:var(--police);cursor:pointer;
  box-shadow:inset 6px 0 0 rgba(255,255,255,.12),inset -6px 0 0 rgba(0,0,0,.18),0 0 0 1px rgba(2,5,22,.25);transition:opacity .3s,transform .3s var(--ease),box-shadow .3s}
.tome::before,.tome::after{content:"";position:absolute;left:8px;right:8px;height:3px;border-radius:2px;background:rgba(242,197,92,.85)}
.tome::before{top:12px} .tome::after{bottom:12px}
.tome b{font-family:var(--cursive);font-weight:600;font-size:38px;line-height:.9}
.tome b sup{font-size:.5em;margin-left:1px}
.tome span{font-weight:800;font-size:12.5px;letter-spacing:.01em;opacity:.92}
.t1{height:120px;background:#3a67b5} .t2{height:134px;background:#2f5a3f} .t3{height:148px;background:#8c3f2c}
.t4{height:162px;background:#1f56c4} .t5{height:176px;background:#6b3f7a} .t6{height:190px;background:#a87a16}
#classe .btn.plus-grand{width:100%;min-height:56px;font-size:17px;margin-top:24px;color:var(--texte);background:rgba(255,253,248,.72)}
/* après le toucher : le livre choisi sort du rang et s'éclaire, les autres s'effacent ; Cobalt confirme (bulle). Les boutons sont
   désactivés (un seul toucher compte) : ils gardent leur aspect, seul l'effacement dit qu'ils ne servent plus. */
#classe [data-classe]:disabled{cursor:default}
#classe.choisi .tome,#classe.choisi .plus-grand{opacity:.38}
#classe.choisi .ici{opacity:1}
#classe.choisi .tome.ici{transform:translateY(-18px);box-shadow:inset 6px 0 0 rgba(255,255,255,.12),inset -6px 0 0 rgba(0,0,0,.18),0 0 0 3px var(--or-vif),0 14px 22px rgba(2,5,22,.4)}
#classe.choisi .plus-grand.ici{border-color:var(--or-vif);box-shadow:0 0 0 3px var(--or-vif)}
#classe.choisi .aide{visibility:hidden}
/* moins de mouvement : le livre choisi ne bouge pas, seul son état change */
#classe.reduit .tome,#classe.reduit .plus-grand{transition:none} #classe.reduit.choisi .tome.ici{transform:none}
@media (max-aspect-ratio:1/1){
  #classe{place-items:end center;background:linear-gradient(180deg,rgba(8,14,40,0) 35%,rgba(8,14,40,.6) 72%)}
  #classe .rouleau{margin:0 0 12px;width:min(100%,460px)}
}
@media (max-width:700px){
  #classe .rouleau{gap:10px;padding:24px 12px 22px;transform:rotate(-.4deg);margin:0 10px 12px;width:calc(100% - 20px)} #classe .rouleau::before,#classe .rouleau::after{left:-9px;right:-9px;height:20px}
  #classe h1{font-size:36px} #classe .aide{font-size:14.5px}
  .etagere{gap:4px;height:172px;padding:0 2px}
  .tome{flex-basis:50px} .tome b{font-size:30px} .tome span{font-size:11px}
  .t1{height:104px} .t2{height:114px} .t3{height:124px} .t4{height:134px} .t5{height:144px} .t6{height:154px}
  #classe .btn.plus-grand{min-height:52px;font-size:16px;margin-top:20px}
}
/* clavier ouvert, téléphone couché : un rouleau plus serré, des livres plus courts (toujours au moins 48 px), sans la ligne d'aide */
@media (max-height:520px){
  #classe .rouleau{gap:6px;padding:18px 12px 16px} #classe h1{font-size:28px} #classe .aide{display:none}
  .etagere{height:120px} .tome::before{top:7px} .tome::after{bottom:7px} .tome b{font-size:24px} .tome span{font-size:10px}
  .t1{height:66px} .t2{height:76px} .t3{height:86px} .t4{height:96px} .t5{height:106px} .t6{height:116px}
  #classe .btn.plus-grand{min-height:48px;margin-top:18px}
  #classe.choisi .tome.ici{transform:translateY(-8px)}
}

/* ---------- bandeau de jeu sur petit écran (téléphone debout ou couché, clavier ouvert) : l'essentiel seulement ----------
   Ce qui compte pendant le jeu : les pages qui restent, puis la vague. La série n'apparaît
   qu'à partir de trois, quand elle devient une récompense. Ce qui reste garde son libellé : un « 0 » seul ne dit rien. */
@media (max-width:700px),(max-height:520px){
  #hud{gap:6px}
  #hud #serie.puce:not(.chaud){display:none}
  #hud .puce.p-vague small,#hud #serie.puce small{display:inline}
}
#app.clavier #hud #serie.puce:not(.chaud){display:none}
#app.clavier #hud .puce.p-vague small,#app.clavier #hud #serie.puce small{display:inline}
#app.clavier #hud button.puce{width:44px;height:44px;padding:0}            /* son et pause restent des cibles d'un doigt, même en mode compact */

/* ---------- le grimoire : le texte est écrit sur les pages du livre 3D du pupitre ----------
   La caméra plonge sur le livre (CAM.grimoire dans main.js) ; le bloc .livre est calé sur le rectangle des pages à l'écran
   (caler dans grimoire.js) et fondu en « multiplier » : le grain et la lumière du papier 3D passent à travers l'encre.
   Aucun fond ici : le papier, la reliure et le bois sont ceux de la scène. */
#grimoire{position:absolute;z-index:20;inset:0;overflow:hidden;padding-bottom:env(safe-area-inset-bottom)}            /* le retrait du bas se lit dans grimoire.js (placerBarre) */
.livre{position:absolute;left:0;top:0;width:100%;height:100%;display:grid;grid-template-rows:minmax(0,1fr) auto;mix-blend-mode:multiply}
#grimoire.ouvre .livre{animation:fondu .55s ease-out both} #grimoire.ferme .livre{animation:fondu .25s ease-in reverse both}
#fermer-grimoire{position:absolute;z-index:2;left:max(12px,env(safe-area-inset-left));top:max(12px,env(safe-area-inset-top));height:46px;padding:0 16px 0 10px;gap:4px;cursor:pointer}
#fermer-grimoire svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
#grimoire.ouvre #fermer-grimoire{animation:fondu .5s both}

/* les pages : seule la double page ouverte est construite (grimoire.js règle largeur, écart, marges et hauteur de ligne).
   Une page : un en-tête (.t) sur la première page d'une partie, des lignes de hauteur fixe (--h) rangées en sous-colonnes, un pied (.p). */
.feuillets{position:relative;min-height:0;overflow:hidden;padding-top:2.5%;touch-action:pan-y}
.planches{height:100%;display:grid}
.page{position:relative;min-width:0;height:100%;display:flex;flex-direction:column;overflow:hidden;color:var(--texte)}
.page.sonde{position:absolute;left:0;top:0;height:auto;visibility:hidden;pointer-events:none}
.page .t,.page .p{display:flow-root;flex:none} .page .p{margin-top:auto}
.lignes{display:grid;grid-auto-flow:column;column-gap:var(--pas,18px);flex:none}
.page button{color:inherit;-webkit-tap-highlight-color:transparent}

/* le sommaire : la page des chapitres, la page du carnet de l'école */
.page h1{font-family:var(--cursive);font-weight:600;font-size:clamp(34px,4.6vw,48px);line-height:1;margin:0;color:var(--cobalt)}
.page .bilan{margin:4px 0 9px;font-size:14.5px}
.entree{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:12px;width:100%;height:var(--h);min-width:0;padding:0 4px;border:0;border-top:1px solid rgba(59,50,42,.2);border-radius:0;background:none;text-align:left}
.entree:active,.mot:active{background:rgba(59,50,42,.08)}
.entree img,.tete img{width:46px;height:46px;object-fit:contain;flex:none}
.entree b{display:block;font-family:var(--cursive);font-weight:600;font-size:25px;line-height:1.08;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.entree small{display:block;font-size:13.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lettrine{flex:none;width:54px;text-align:center;font-family:var(--cursive);font-style:normal;font-weight:600;font-size:60px;line-height:.85;color:var(--cobalt)}
.jauge{display:block;position:relative;height:6px;margin:5px 0 3px;border-radius:3px;background:rgba(59,50,42,.2);overflow:hidden}
.jauge i{position:absolute;left:0;top:0;bottom:0;border-radius:3px;background:rgba(168,122,22,.55)} .jauge i.m{background:#8a6510}
/* la page du carnet : une case par lettre, cinq par rang (grimoire.js : section « carnet », rang). Lettre arrivée : un bouton, son nombre de mots,
   la jauge (écrits, maîtrisés) et le signet si ma liste y est. Lettre pas encore arrivée : pointillés, le nombre de mots qui l'attendent. */
.page.carnet .lignes{grid-auto-flow:row;column-gap:7px} .page.carnet .bilan{font-size:13.5px;line-height:1.3}
.case{position:relative;display:grid;grid-template-rows:minmax(0,1fr) auto 6px;justify-items:center;align-items:center;gap:2px;min-width:0;height:calc(var(--h) - 7px);margin-top:3px;padding:4px 5px 6px;border-radius:11px;border:1px solid rgba(59,50,42,.3);background:rgba(255,253,248,.35);color:var(--texte);text-align:center}
.case b{font-family:var(--cursive);font-weight:600;font-size:clamp(22px,calc(var(--h) * .42),36px);line-height:.95;color:var(--cobalt)}
.case small{font-weight:700;font-size:11.5px;line-height:1.1;color:var(--texte-2);white-space:nowrap}
.case .jauge{width:100%;height:6px;margin:0}
.case .plus-or{position:absolute;left:4px;top:2px;margin:0;padding:0 3px;border-radius:6px;background:rgba(255,253,248,.85);font-size:10.5px;line-height:1.35}
button.case:active{background:rgba(59,50,42,.1)}
.case.ici{border-color:var(--cobalt);box-shadow:0 0 0 1.5px var(--cobalt);background:rgba(31,86,196,.1)}
.case.ici::after{content:"";position:absolute;right:7px;top:-2px;width:11px;height:17px;background:var(--cobalt);clip-path:polygon(0 0,100% 0,100% 100%,50% 72%,0 100%)}
.case.avenir{border-style:dashed;background:none} .case.avenir b{color:rgba(59,50,42,.42)} .case.avenir small{color:rgba(59,50,42,.55)}
/* la légende de la grille, juste sous les cases (le pied du carnet ne descend pas au bas de la page) */
.page.carnet .p{margin-top:0}
.cles{display:flex;flex-wrap:wrap;gap:2px 14px;margin:5px 0 6px;font-size:12.5px;line-height:1.3;font-weight:700;color:var(--texte-2)}
.cles span{display:inline-flex;align-items:center;gap:5px;white-space:nowrap}
.cles i{flex:none;width:18px;height:7px;border-radius:4px;background:rgba(168,122,22,.55)} .cles i.m{background:#8a6510} .cles i.avenir{width:16px;height:11px;border:1px dashed rgba(59,50,42,.5);border-radius:3px;background:none}
.regle{margin:0;padding:8px 0 2px;border-top:1px solid rgba(59,50,42,.2);font-size:14.5px;line-height:1.42}
.regle .pts{margin:0 2px 0 0;vertical-align:0}

/* l'en-tête d'un chapitre ou d'une lettre, et l'encadré de la liste */
.tete{display:flex;align-items:center;gap:10px;margin:0 0 8px}
.tete>span:nth-of-type(1){min-width:0}
.tete h2{margin:0;font-family:var(--cursive);font-weight:600;font-size:clamp(24px,3vw,30px);line-height:1.05;color:var(--cobalt);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tete small{display:block;font-size:13.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tete .lettrine{width:auto;font-size:62px}
/* la tête d'une lettre : la lettre arrivée d'avant, celle d'après, et « Les lettres » qui revient aux cases du carnet */
.nav{margin-left:auto;display:flex;gap:6px;flex:none}
.nav button{display:inline-flex;align-items:center;justify-content:center;gap:2px;height:44px;min-width:44px;padding:0 9px;border-radius:999px;border:1px solid rgba(59,50,42,.4);background:none;font-weight:800;font-size:15px}
.nav button.toutes{padding:0 12px;font-size:13.5px;background:rgba(255,253,248,.5)}
.tete:has(.nav) h2{font-size:26px;overflow:visible} .tete:has(.nav)>span:nth-of-type(1){flex:none}            /* le titre tient à côté des trois boutons, sans être coupé */
.nav svg{flex:none;width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
.cadre{display:grid;gap:7px;margin-bottom:8px;padding:9px 12px 11px;border:1.5px solid rgba(31,86,196,.6);border-radius:14px}
.cadre p{margin:0;font-size:13.5px;line-height:1.3} .cadre p b{font-size:15.5px;color:var(--cobalt)}
.cadre .rang{display:flex;flex-wrap:wrap;gap:8px}
.cadre .btn{min-height:50px;padding:0 13px;font-size:14.5px;white-space:nowrap;color:var(--texte);background:rgba(255,253,248,.5);border-color:rgba(59,50,42,.45);box-shadow:none}
.cadre .btn.primaire{flex:1 1 100%;font-size:16.5px;color:#fff;background:var(--cobalt);border-color:var(--cobalt-fonce);box-shadow:0 3px 0 #153c8d}
.cadre.pose{border-style:dashed}

.cadre .btn small{margin-left:5px;font-size:.86em;font-weight:700;opacity:.75}
/* la légende des marques d'une ligne, juste au-dessus des lignes : chaque marque est montrée par un exemple */
.legende{display:flex;flex-wrap:wrap;align-items:center;gap:1px 18px;margin:0 0 5px;font-size:13.5px;line-height:1.3;font-weight:700}
.legende span{display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
.legende .trait{flex:none;width:4px;height:17px;background:var(--cobalt)}
.ex{font-family:var(--cursive);font-weight:600;font-size:1.75em;line-height:.8;color:var(--brique)}
.regle .ex{font-family:inherit;font-size:inherit;font-weight:800}
.nb{white-space:nowrap}

/* une ligne par mot : le mot en cursive, ses trois points d'or. Gris : pas encore rencontré. Brique : à revoir. Liseré cobalt : ma liste. */
.mot{position:relative;display:flex;align-items:center;gap:6px;height:var(--h);min-width:0;padding:0 4px 0 11px;border:0;border-bottom:1px solid rgba(59,50,42,.18);border-radius:0;background:none;text-align:left}
.mot .m{flex:1 1 auto;min-width:0;font-family:var(--cursive);font-weight:500;font-size:var(--f,25px);line-height:1.15;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mot.cache .m{color:rgba(59,50,42,.68)} .mot.revoir .m{color:var(--brique)} .mot.maitrise .m{color:var(--maitrise);font-weight:600}
.mot em{flex:0 1000 auto;min-width:0;overflow:hidden;white-space:nowrap;font-style:normal;font-weight:800;font-size:10.5px;letter-spacing:.06em;text-transform:uppercase;color:var(--brique)}
.pts{display:inline-flex;gap:4px;margin-left:10px;vertical-align:4px}
.pts i{width:9px;height:9px;border-radius:50%;border:1.5px solid #8a6510} .pts i.x{background:#a87a16}
.mot .pts{flex:none;margin:0}
/* un point d'or gagné pendant la dernière nuit : vide jusqu'à ce qu'on ouvre sa page, puis il s'encre (encrer dans grimoire.js) */
.mot .pts i.frais{background:none}
.mot .pts i.frais.encre{animation:encre .62s var(--ease) var(--d,0ms) both}
@keyframes encre{0%{background:rgba(168,122,22,0);transform:scale(.4);box-shadow:0 0 0 0 rgba(201,153,42,0)}45%{background:#c9992a;transform:scale(1.9);box-shadow:0 0 0 5px rgba(201,153,42,.32)}100%{background:#a87a16;transform:scale(1);box-shadow:0 0 0 0 rgba(201,153,42,0)}}
.plus-or{display:inline-block;margin-left:8px;font-style:normal;font-weight:800;color:var(--or-fonce)} .plus-or::after{content:"";display:inline-block;width:8px;height:8px;margin-left:3px;border-radius:50%;background:#a87a16}
.mot.marque::before,.mot.premier::before{content:"";position:absolute;left:0;top:-1px;bottom:-1px;width:4px;background:var(--cobalt);transform-origin:50% 0}
.mot.trace::before{animation:trace var(--t,60ms) linear var(--d,0ms) both}
@keyframes trace{from{transform:scaleY(0)}to{transform:scaleY(1)}}
.mot.premier,.mot.ouvert{background:rgba(31,86,196,.13)}

/* pages étroites (téléphone) : tout se resserre, la mention « à revoir » laisse la couleur parler */
.livre.etroit .page h1{font-size:32px} .livre.etroit .page .bilan{font-size:13.5px;margin-bottom:6px}
.livre.etroit .entree{gap:9px} .livre.etroit .entree b{font-size:21px} .livre.etroit .entree small{font-size:12.5px}
.livre.etroit .entree img,.livre.etroit .tete img{width:36px;height:36px} .livre.etroit .lettrine{width:38px;font-size:46px} .livre.etroit .jauge{margin:3px 0 2px;height:5px}
.livre.etroit .regle{font-size:12.5px;line-height:1.35;padding-top:6px}
.livre.etroit .tete{gap:7px;margin-bottom:6px} .livre.etroit .tete h2{font-size:21px} .livre.etroit .tete small{font-size:12.5px} .livre.etroit .tete .lettrine{font-size:44px}
.livre.etroit .nav{gap:4px;margin-right:6px} .livre.etroit .nav button{height:44px;min-width:44px;padding:0 6px;font-size:14px} .livre.etroit .nav button.toutes{padding:0 9px;font-size:12.5px}
.livre.etroit .tete:has(.nav) .lettrine{display:none}            /* la grande lettrine laisse sa place au titre et au compteur ; les boutons s'écartent du bord de la feuille */
.livre.etroit .page.carnet .lignes{column-gap:5px} .livre.etroit .case{height:calc(var(--h) - 5px);margin-top:2px;padding:3px 3px 5px;border-radius:9px} .livre.etroit .case small{font-size:10px} .livre.etroit .case .jauge{height:5px}
.livre.etroit .case.ici::after{right:5px;width:9px;height:14px} .livre.etroit .cles{font-size:11px;gap:1px 10px;margin:4px 0 5px} .livre.etroit .cles i{width:14px;height:6px}
.livre.mince .page.carnet h1{font-size:25px} .livre.mince .page.carnet .bilan{font-size:12px} .livre.mince .page.carnet .lignes{column-gap:4px} .livre.mince .case small span{display:none}            /* « 342 mots » ne tient pas dans une case de 37 px : la case mince ne garde que le nombre */
.livre.etroit .legende{font-size:12.5px;gap:0 12px;margin-bottom:3px} .livre.etroit .legende .trait{width:3px;height:15px}
.livre.etroit .cadre{gap:5px;margin-bottom:5px;padding:7px 9px 9px} .livre.etroit .cadre p{font-size:12.5px} .livre.etroit .cadre p b{font-size:14px}
.livre.etroit .cadre .btn{min-height:44px;padding:0 9px;font-size:13px} .livre.etroit .cadre .btn.primaire{font-size:15px}
.livre.etroit .cadre .rang{flex-wrap:wrap;gap:6px} .livre.etroit .cadre .rang .btn{flex:1 1 auto}
.livre.etroit .mot{gap:4px;padding:0 2px 0 8px} .livre.etroit .mot .m{font-size:var(--f,22px)}
.livre.etroit .mot em{display:none} .livre.etroit .mot .pts{gap:3px} .livre.etroit .mot .pts i{width:7.5px;height:7.5px}
.livre.etroit .mot.marque::before,.livre.etroit .mot.premier::before{width:3px}
.livre.mince .tete:has(.nav)>span:nth-of-type(1){display:none} .livre.mince .tete:has(.nav) .lettrine{display:block} .livre.mince .tete:has(.nav){gap:5px;margin-bottom:3px} .livre.mince .tete:has(.nav) .lettrine{width:auto;font-size:40px} .livre.mince .nav{gap:3px;margin-right:2px} .livre.mince .nav button{height:40px;min-width:40px;padding:0 4px;font-size:13.5px} .livre.mince .nav button.toutes{padding:0 6px;font-size:11.5px} .livre.mince .cadre .rang{flex-wrap:wrap} .livre.mince .cadre .btn{flex:1}

/* ============ le grimoire : « l'encre sur le papier, les commandes sur le pupitre » (docs/maquettes/grimoire-design.html, 18 novembre 2026) ============
   Sur le papier, seulement ce qu'un livre porte : du texte, des filets, une lettrine, un folio, un ruban. Toutes les commandes sont dans
   une barre sous le livre (#g-barre), de la famille de « Refermer » ; le seul bouton bleu est « Jouer ». */
/* La cursive : la boucle du L (et du J, du G…) sort à gauche et en bas de la boîte du texte. Les titres rognés par « overflow:hidden » la
   coupaient (« Le carnet de l'école », « Les mots qui doublent ») : leur boîte s'agrandit de ce côté, le texte ne bouge pas. Même chose pour la
   page entière, dont le bord gauche rognait le titre et la lettrine. */
.entree b,.tete h2,.mot .m,#g-etui .t em,#g-fiche-liste .suite{padding:0 0 .14em .26em;margin:0 0 -.14em -.26em}
.page{padding-left:12px;margin-left:-12px} .page.sonde{padding-left:0;margin-left:0}
/* le pied de page : le folio, écrit à l'encre */
.pied{display:flex;align-items:center;justify-content:center;height:44px;padding:0 3% 1%}
#g-num{display:inline-flex;align-items:center;gap:8px;font-weight:700;font-size:14px;color:var(--texte-2);font-variant-numeric:tabular-nums;white-space:nowrap}
#g-num img{width:26px;height:26px;object-fit:contain} #g-num b{font-family:var(--cursive);font-weight:600;font-size:24px;line-height:1;color:var(--cobalt)}
.livre.double .pied{justify-content:flex-end;padding-right:calc(3% + 21%)}            /* en double page, le folio est au pied de la page de droite */
.livre.etroit .pied{height:38px} .livre.etroit #g-num{font-size:13.5px} .livre.etroit #g-num b{font-size:22px} .livre.mince .pied{height:34px}

/* ma liste : un ruban cobalt cousu le long des mots. Il naît sous une épingle d'or au premier mot, finit en queue d'aronde au dernier ;
   coupé net en bas d'une colonne, il reprend en haut de la suivante. */
#g-liste .mot{padding-left:15px} .livre.etroit #g-liste .mot{padding-left:12px}
#g-liste .mot.marque::before{content:"";position:absolute;left:0;top:-1px;bottom:0;width:9px;background:var(--cobalt);transform-origin:50% 0}
#g-liste .mot.marque::after{content:"";position:absolute;left:3.5px;top:1px;bottom:1px;border-left:1.5px dashed rgba(255,253,248,.8)}
#g-liste .mot.marque.debut::before{top:9px;border-radius:3px 3px 0 0} #g-liste .mot.marque.debut::after{top:15px}
#g-liste .mot.marque.fin::before{bottom:7px;clip-path:polygon(0 0,100% 0,100% 100%,50% calc(100% - 6px),0 100%)} #g-liste .mot.marque.fin::after{bottom:15px}
.epingle{position:absolute;left:-1.5px;top:3px;width:12px;height:12px;border-radius:50%;background:#c9992a;border:2px solid #6f520c;z-index:1}
.livre.etroit #g-liste .mot.marque::before{width:8px} .livre.etroit #g-liste .mot.marque::after{left:3px} .livre.etroit .epingle{left:-2px}
/* le choix en cours : le premier mot est épinglé et passe au cobalt, le fil du ruban court en pointillé sur tous les mots qui suivent */
#g-liste .mot.premier{background:none} #g-liste .mot.premier .m{color:var(--cobalt);font-weight:600}
#g-liste .mot.fil::before{content:"";position:absolute;left:2.5px;top:0;bottom:0;width:0;background:none;border-left:4px dotted rgba(31,86,196,.75)}
#g-liste .mot.premier.fil::before{top:16px}
.sig{display:inline-block;width:9px;height:15px;margin-right:5px;vertical-align:-2px;background:var(--cobalt);clip-path:polygon(0 0,100% 0,100% 100%,50% 70%,0 100%)}

/* le sommaire, en portrait : le carnet de l'école est sa première ligne, dans la même écriture que les chapitres */
.entree .az{justify-self:center;width:46px;text-align:center;font-style:normal;font-family:var(--cursive);font-weight:600;font-size:28px;line-height:1;color:var(--cobalt);white-space:nowrap}
.entree.carnet b{color:var(--cobalt)} .livre.etroit .page.sommaire:not(.carnet) .bilan{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.page.signale h1{animation:signale .55s var(--ease)} @keyframes signale{35%{transform:scale(1.07)}}
.page h1{transform-origin:0 60%} .livre.etroit .entree .az{width:36px;font-size:22px}

/* la page d'ouverture d'une lettre : la lettrine, le compte, et l'index des débuts de mots, écrit comme une table des matières */
.page.ouverture .t{flex:1;display:flex;flex-direction:column;min-height:0}
.ouv-tete{display:flex;align-items:flex-end;gap:16px;padding-bottom:10px;border-bottom:1px solid rgba(59,50,42,.28)}
.ouv-tete .lettrine{width:auto;font-size:104px;line-height:.78}
.ouv-tete p{margin:0 0 2px;font-size:14.5px;line-height:1.3} .ouv-tete p b{display:block;font-size:17px;font-weight:800}
.ouv-tete.petite{margin-bottom:2px;padding-bottom:7px} .ouv-tete.petite .lettrine{font-size:64px}
.consigne{margin:9px 0 1px;font-size:14px;font-weight:700;color:var(--texte-2)}
.index{display:grid;grid-auto-flow:column;grid-template-columns:1fr 1fr;column-gap:var(--pas,18px)}
.index .e{display:flex;align-items:baseline;gap:7px;height:48px;min-width:0;padding:9px 4px 0 2px;border:0;border-bottom:1px solid rgba(59,50,42,.18);border-radius:0;background:none;text-align:left;color:var(--texte)}
.index .e:active,.voisines button:active,.toute:active{background:rgba(59,50,42,.08)}
.index.dense{column-gap:10px} .index.dense .e>i,.index.dense .e span u{display:none} .index.dense .e{justify-content:space-between}            /* page basse : l'index passe sur trois ou quatre colonnes, sans pointillés ni numéros */
.index .e b{font-family:var(--cursive);font-weight:600;font-size:29px;line-height:1;color:var(--cobalt)}
.index .e>i{flex:1;border-bottom:2px dotted rgba(59,50,42,.42);transform:translateY(-4px)}
.index .e span{font-weight:800;font-size:14.5px;font-variant-numeric:tabular-nums;white-space:nowrap} .index .e u{text-decoration:none} .index .e em{font-style:normal;font-family:var(--cursive);font-weight:500;font-size:21px;color:var(--texte-2)}
.page.ouverture .regle{margin:10px 0 0;padding:0;border:0;font-size:13.5px;line-height:1.5}
.voisines{display:flex;justify-content:space-between;margin-top:auto;border-top:1px solid rgba(59,50,42,.28)}
.page:not(.ouverture) .voisines{margin:0 0 4px;border-top:0;border-bottom:1px solid rgba(59,50,42,.28)}
.voisines button{display:inline-flex;align-items:center;gap:5px;height:46px;min-width:96px;padding:0;border:0;border-radius:0;background:none;font-weight:800;font-size:15px;color:var(--texte)} .voisines button:last-child{justify-content:flex-end}
.voisines b{font-family:var(--cursive);font-weight:600;font-size:28px;line-height:1;color:var(--cobalt)} .voisines svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
/* le chemin vers les mots, dit en premier : une ligne pleine largeur, à l'encre cobalt, avec sa flèche */
.lire{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;height:50px;margin-top:4px;padding:0 4px 0 2px;border:0;border-bottom:1px solid rgba(59,50,42,.28);border-radius:0;background:none;font-weight:800;font-size:16.5px;color:var(--cobalt);text-align:left}
.lire svg{flex:none;width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round} .lire:active{background:rgba(59,50,42,.08)}
.voisines small{font-weight:700;font-size:13px;color:var(--texte-2)}
.livre.etroit .lire{height:48px;font-size:15.5px} .livre.mince .lire{height:44px;font-size:14.5px}
/* pendant le choix : « Prendre toute la lettre », écrit à l'encre cobalt sous l'en-tête */
.toute{display:flex;align-items:center;gap:6px;width:100%;min-height:46px;margin-top:4px;padding:0 2px;border:0;border-bottom:1.5px dashed rgba(31,86,196,.6);border-radius:0;background:none;font-weight:800;font-size:15px;color:var(--cobalt);text-align:left} .toute small{font-weight:700;font-size:.9em;color:var(--texte-2)}
.livre.etroit .ouv-tete{gap:12px;padding-bottom:8px} .livre.etroit .ouv-tete .lettrine{font-size:80px} .livre.etroit .ouv-tete.petite .lettrine{font-size:54px} .livre.etroit .ouv-tete p{font-size:13.5px} .livre.etroit .ouv-tete p b{font-size:16px}
.livre.etroit .index .e{height:46px} .livre.etroit .index .e b{font-size:27px} .livre.etroit .consigne{font-size:13px;margin-top:7px} .livre.etroit .page.ouverture .regle{font-size:12.5px;line-height:1.45;margin-top:8px} .livre.etroit .toute{font-size:14px}
.livre.mince .ouv-tete .lettrine{font-size:60px} .livre.mince .ouv-tete{padding-bottom:5px} .livre.mince .ouv-tete p{font-size:12.5px} .livre.mince .ouv-tete p b{font-size:15px}
.livre.mince .index .e{height:44px;padding-top:8px} .livre.mince .index .e b{font-size:25px} .livre.mince .consigne,.livre.mince .page.ouverture .regle,.livre.mince .page.ouverture .voisines{display:none}

/* ---------- le pupitre : toutes les commandes, hors du papier (verre de nuit, liseré d'or). Portrait : deux rangées dans la bande vide sous le
   livre ; paysage (.large) : une rangée ; téléphone très étroit (.serre) : une rangée serrée. Placée par grimoire.js (placerBarre). ---------- */
#g-barre{position:absolute;z-index:3;display:grid;grid-template-columns:auto minmax(0,1fr) auto;grid-template-areas:"prec haut suiv" "liste liste liste";align-items:center;gap:8px;--bh:52px;animation:fondu .5s .15s both}
#g-barre.large{grid-template-columns:auto auto minmax(0,1fr) auto auto;grid-template-areas:"prec haut . liste suiv";gap:10px;--bh:54px}
#grimoire.ferme #g-barre{animation:fondu .2s reverse both}
#g-barre .b{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:var(--bh);min-width:var(--bh);padding:0 18px;border-radius:999px;background:rgba(10,16,44,.82);border:1px solid rgba(242,197,92,.36);color:#f1e6cf;font-weight:800;font-size:15px;white-space:nowrap}
#g-barre .b:active{transform:translateY(1px)} #g-barre .b:disabled{opacity:.3} #g-barre [hidden]{display:none}
#g-barre .b svg{width:22px;height:22px;flex:none;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
#g-barre .rond{padding:0;width:var(--bh)} #g-barre .eteint{visibility:hidden}
#g-prec{grid-area:prec} #g-suiv{grid-area:suiv} #g-haut{grid-area:haut;justify-self:stretch;min-width:0;overflow:hidden} #g-barre.large #g-haut{justify-self:start}
#g-barre .zl{grid-area:liste;display:flex;align-items:center;gap:8px;min-width:0} #g-barre.large .zl{justify-content:flex-end}
#g-haut i{font-style:normal;font-family:var(--cursive);font-weight:600;font-size:31px;line-height:1;color:var(--or-vif)} #g-haut em{font-style:normal;font-family:var(--cursive);font-weight:600;font-size:22px;line-height:1} #g-haut small{font-weight:800;font-size:13.5px;color:#c9bda3}
#g-barre #g-jouer{flex:none;background:var(--cobalt);border-color:#6f9bf0;color:#fff;box-shadow:0 3px 0 #123377;font-size:16px} #g-barre #g-jouer svg{width:17px;height:17px;fill:currentColor;stroke-width:1.6}
#g-barre #g-jouer.neuf{box-shadow:0 3px 0 #123377,0 0 0 3px rgba(242,197,92,.9)}
#g-barre #g-etui{flex:1 1 0;justify-content:flex-start;gap:11px;padding:0 16px 0 14px;min-width:0;text-align:left} #g-barre.large #g-etui{flex:0 1 auto} #g-barre #g-etui:disabled{opacity:1}
#g-etui .rb{flex:none;width:13px;height:26px;background:#4d82ee;clip-path:polygon(0 0,100% 0,100% 100%,50% 74%,0 100%)}
#g-etui .rb.creux{background:none;clip-path:none;height:24px;border:2px dashed #8fb0f5;border-bottom:0}
#g-etui .t{display:grid;min-width:0;line-height:1.1} #g-etui .t b{font-size:12.5px;font-weight:800;color:#c9bda3} #g-etui .t em{font-style:normal;font-family:var(--cursive);font-weight:600;font-size:20px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#g-etui .n{flex:none;display:inline-flex;align-items:center;gap:5px;margin-left:auto;padding-left:6px;font-size:13.5px;color:var(--or-vif);font-variant-numeric:tabular-nums} #g-etui .n::before{content:"";width:9px;height:9px;border-radius:50%;background:#c9992a}
#g-etui.choisir{font-size:16px} #g-etui.choisir small{min-width:0;font-weight:700;font-size:13px;color:#c9bda3;overflow:hidden;text-overflow:ellipsis}
#g-pose{display:flex;align-items:center;gap:8px;min-width:0;flex:1}
#g-barre .dit{flex:1;min-width:0;padding-left:4px;color:#f1e6cf;font-weight:800;font-size:15.5px;line-height:1.25;white-space:normal;text-wrap:balance} #g-barre .dit em{font-style:normal;font-family:var(--cursive);font-weight:600;font-size:22px;line-height:.9;color:var(--or-vif)}
#g-barre.large .dit{text-align:right;white-space:nowrap}
#g-barre .leger{flex:none;background:rgba(10,16,44,.55);font-size:14.5px;padding:0 15px} #g-barre .leger small{font-weight:700;color:#c9bda3}
#g-barre:not(.large) #g-toute,#g-barre:not(.large) .long{display:none}
#g-barre.serre{grid-template-columns:auto auto minmax(0,1fr) auto;grid-template-areas:"prec haut liste suiv";gap:6px;--bh:46px}
#g-barre.serre .b{padding:0 12px;font-size:14px} #g-barre.serre .rond{padding:0} #g-barre.serre #g-haut{padding:0 9px;justify-self:start} #g-barre.serre #g-haut em,#g-barre.serre #g-haut small{display:none} #g-barre.serre #g-haut i{font-size:27px}
#g-barre.serre .zl{gap:6px;justify-content:flex-end} #g-barre.serre #g-etui{flex:0 0 auto;padding:0;width:var(--bh);justify-content:center} #g-barre.serre #g-etui .t,#g-barre.serre #g-etui .n{display:none}
#g-barre.serre #g-etui.choisir{width:auto;flex:1 1 auto;padding:0 6px;font-size:13.5px} #g-barre.serre #g-etui.choisir small,#g-barre.serre #g-etui.choisir .rb{display:none}
#g-barre.serre #g-jouer{padding:0 12px;font-size:15px;gap:6px} #g-barre.serre.notee #g-etui{display:none} #g-barre.serre .dit{font-size:13px} #g-barre.serre .dit em{font-size:18px} #g-barre.serre .moyen{display:none}

/* barre serrée faute de hauteur sur une tablette en portrait : la place ne manque pas en largeur, le bouton qui remonte reste (pendant la pose, il mène à « Prendre toute la lettre ») */
@media (max-width:520px){#g-barre.serre.pose #g-haut,#g-barre.serre.notee #g-haut{display:none}}

/* la fiche de ma liste : la même feuille que la fiche d'un mot, ouverte par l'étui ; c'est aussi ce qu'un parent regarde */
#g-fiche-liste{position:absolute;z-index:5;width:min(500px,calc(100% - 16px));padding:16px 18px;background:var(--papier);border:1px solid var(--filet-fort);border-radius:14px 14px 4px 14px;box-shadow:0 14px 34px rgba(30,14,4,.55);color:var(--texte);animation:fiche .2s var(--ease) both}
#g-fiche-liste[hidden]{display:none}
#g-fiche-liste h3{margin:0;font-size:13.5px;font-weight:800;color:var(--texte-2)}
#g-fiche-liste .suite{margin:1px 0 6px;font-family:var(--cursive);font-weight:600;font-size:31px;line-height:1.05;color:var(--cobalt)}
#g-fiche-liste .compte{margin:0 0 9px;font-size:15px;line-height:1.35}
.bande{display:grid;grid-template-columns:repeat(auto-fill,minmax(11px,1fr));gap:3px;margin:0 0 6px} .bande i{height:18px;border-radius:3px;background:rgba(59,50,42,.16)} .bande i.e,#g-fiche-liste .cle i.e{background:#dcb65a} .bande i.m,#g-fiche-liste .cle i.m{background:#8a6510} .bande i.x,#g-fiche-liste .cle i.x{background:var(--brique)}
#g-fiche-liste .jauge{height:12px;margin:0 0 7px}
#g-fiche-liste .cle{display:flex;flex-wrap:wrap;gap:3px 14px;margin:0 0 13px;font-size:12.5px;font-weight:700;color:var(--texte-2)} #g-fiche-liste .cle i{display:inline-block;width:12px;height:12px;border-radius:3px;margin-right:5px;vertical-align:-1px;background:rgba(59,50,42,.16)} #g-fiche-liste .cle i.e{background:#dcb65a} #g-fiche-liste .cle i.m{background:#8a6510} #g-fiche-liste .cle i.x{background:var(--brique)}
#g-fiche-liste .rang{display:flex;gap:8px} #g-fiche-liste .btn{flex:1;justify-content:center;min-height:50px;padding:0 8px;font-size:15px;white-space:nowrap;background:var(--panneau);color:var(--texte)}
#g-fiche-liste .retirer{display:flex;align-items:center;justify-content:center;gap:6px;width:100%;height:46px;margin:6px 0 -8px;border:0;background:none;font-weight:800;font-size:14.5px;color:var(--brique)} #g-fiche-liste .retirer small{font-weight:700;font-size:13px;color:var(--texte-2)}

/* maquette (?page=longue) : en portrait, une feuille de papier dessinée prolonge la page du livre 3D jusqu'au bas de l'écran */
.livre.longue{background:linear-gradient(180deg,rgba(244,196,112,0) 0,#f2bd66 9%,#f5c676 55%,#eeb25a 100%);border-radius:0 0 10px 10px;box-shadow:0 18px 30px rgba(20,8,2,.55)}
/* les deux signets : la zone tactile est posée sur le ruban 3D (monde.rubans.rect) ; le nom est brodé sur le tissu 3D (src/decor.js) */
.ruban{position:absolute;z-index:3;padding:0;border:0;background:none;-webkit-tap-highlight-color:transparent;animation:fondu .5s .15s both}
#grimoire.ferme .ruban{animation:fondu .2s reverse both}

/* la fiche d'un mot : une étiquette de papier posée près de la ligne touchée (hors du fondu : elle se lit comme un objet posé sur le livre) */
#g-fiche{position:absolute;z-index:4;display:grid;grid-template-columns:auto minmax(0,1fr);gap:12px;align-items:start;padding:12px 14px 13px;background:var(--papier);border:1px solid var(--filet-fort);border-radius:4px 14px 14px 14px;box-shadow:0 14px 34px rgba(30,14,4,.55);animation:fiche .2s var(--ease) both}
#g-fiche.dessus{border-radius:14px 14px 14px 4px}
#g-fiche h3{display:inline;font-family:var(--cursive);font-weight:600;font-size:31px;line-height:1.05;margin:0;color:var(--texte)}
#g-fiche em{font-style:normal;font-weight:800;font-size:11px;letter-spacing:.08em;text-transform:uppercase;margin-left:9px;vertical-align:4px;color:#6f520c} #g-fiche em.revoir{color:var(--brique)}
#g-fiche p{margin:4px 0 0;font-size:14.5px;line-height:1.38;color:var(--texte)}
#g-fiche p.niveau{margin-top:5px;font-size:12.5px;font-weight:700;color:var(--texte-2)} #g-fiche sup{font-size:.68em;line-height:0}            /* l'année d'école du mot */
@keyframes fiche{from{opacity:0;transform:translateY(-5px) scale(.97)}}
.ecoute{display:grid;place-items:center;width:48px;height:48px;padding:0;border-radius:50%;border:1px solid rgba(31,86,196,.4);background:rgba(31,86,196,.13);color:var(--cobalt);transition:transform .1s,background .2s}
.ecoute:active{transform:scale(.94)} .ecoute.joue{background:var(--cobalt);color:#fff}
.ecoute svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
/* dans le livre, Cobalt est hors champ : sa bulle se pose sous le livre, au milieu */
#bulle.au-livre{z-index:21;left:50%;top:auto;bottom:var(--bas-bulle,max(10px,env(safe-area-inset-bottom)));transform:translateX(-50%);width:max-content;max-width:min(460px,calc(100% - 24px));border-radius:22px;text-align:center}
@media (prefers-reduced-motion:reduce){ .mot.trace::before,#g-fiche,.ruban,#or.plus{animation:none} .mot .pts i.frais{background:#a87a16;animation:none!important} }

/* ---------- la feuille qui se tourne (construite par tourner() dans jeu.js, retirée à la fin du tour) ----------
   Un élément en 3D n'est pas fondu dans le livre par le navigateur comme l'est le texte à plat :
   la feuille porte donc elle-même la couleur du papier éclairé par la bougie, plus sombre du côté de la reliure. */
.tourneur{position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;perspective-origin:50% 40%}
.tourneur .calque{position:absolute;top:0;height:100%}
.demi{position:absolute;top:0;height:100%;width:50%;overflow:hidden} .demi.g{left:0} .demi.d{left:50%} .demi.tout{left:0;width:100%}
.feuille{position:absolute;top:0;height:100%;width:50%;transform-style:preserve-3d;will-change:transform}
.feuille.d{left:50%;transform-origin:0 50%} .feuille.g{left:0;transform-origin:100% 50%} .feuille.seule{left:0;width:100%;transform-origin:0 50%}
.face{position:absolute;inset:0;overflow:hidden;backface-visibility:hidden;-webkit-backface-visibility:hidden;border-radius:2px;box-shadow:0 0 30px rgba(60,30,10,.5);
  background:linear-gradient(90deg,#c98f43,#eeb057 12%,#f7c070 48%,#f9c97f)}
.feuille.g .face,.feuille.d .face.dos{background:linear-gradient(270deg,#c98f43,#eeb057 12%,#f7c070 48%,#f4b962)}
.feuille.g .face.dos{background:linear-gradient(90deg,#c98f43,#eeb057 12%,#f7c070 48%,#f9c97f)}
.face.dos{transform:rotateY(180deg)}
/* ---------- carte de fin : l'avancement de la liste de l'école, et l'annonce d'une ligne d'arrivée (en or : c'est une récompense) ---------- */
#f-annonce{padding:9px 13px 10px;border:1.5px solid var(--or);border-radius:14px;background:rgba(242,197,92,.17);font-family:var(--cursive);font-size:22px;line-height:1.2;color:var(--texte)}
#f-annonce b{display:block;margin-bottom:4px;font:800 11px var(--police);letter-spacing:.14em;text-transform:uppercase;color:var(--or-fonce)}
#f-liste{display:grid;gap:5px;font-size:13.5px;font-weight:700;color:var(--texte-2)}
#f-liste b{font-size:11px;font-weight:800;letter-spacing:.12em;text-transform:uppercase;color:var(--texte-3)}
#f-liste-jauge{display:block;position:relative;height:8px;border-radius:4px;background:var(--filet);overflow:hidden}
#f-liste-jauge i{position:absolute;left:0;top:0;bottom:0;border-radius:4px;background:var(--or-vif)} #f-liste-jauge i.m{background:var(--or-fonce)}
/* ---------- carte de fin sur un écran en hauteur : en bas, pour laisser le haut à Cobalt et au grimoire ---------- */
@media (max-aspect-ratio:1/1){ #fin{place-items:end center} #fin .carte{justify-self:center;margin:0} }
/* le menu ne s'élargit jamais au-delà du parchemin, quel que soit le texte des boutons ; le bouton de la liste range ses détails
   sous son titre, sur une ligne (« de baguette à baigner · 0 mot écrit sur 2 »), coupée par des points de suspension s'il le faut */
.menu{grid-template-columns:minmax(0,1fr)} .menu .btn{min-width:0}
#ma-liste{flex-wrap:wrap;row-gap:1px;padding-top:8px;padding-bottom:8px}
#ma-liste small{flex:0 0 100%;margin-left:0;padding-left:28px;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#ma-liste small span{display:inline;overflow:visible}
#ma-liste small span:not(:empty)+span:not(:empty)::before{content:" · "}
/* le conseil de Cobalt : une fiche qui arrête la nuit, après un mot qui a résisté ou un premier point d'or (réglage « Conseils de Cobalt ») */
#conseil{position:absolute;z-index:8;inset:0;display:grid;place-items:center;padding:16px;background:rgba(8,12,36,.4);animation:fondu .3s both}
.fiche-conseil{width:min(100%,440px);max-height:100%;overflow:auto;background:var(--papier);border:2.5px solid #2a2340;border-radius:24px;padding:18px 22px 18px;display:grid;gap:8px;justify-items:center;text-align:center;box-shadow:0 24px 70px rgba(0,0,0,.6)}
.fiche-conseil small{font:800 11px var(--police);letter-spacing:.16em;text-transform:uppercase;color:var(--texte-3)}
.fiche-conseil b{font-family:var(--cursive);font-weight:600;font-size:clamp(40px,9vw,58px);line-height:1.05;color:var(--cobalt);overflow-wrap:anywhere}
.fiche-conseil p{margin:0;font-size:18px;line-height:1.4;color:var(--texte);text-wrap:pretty}
.fiche-conseil em{font-style:normal;font-weight:700;font-size:13px;color:var(--or-fonce)} .fiche-conseil em.revoir{color:var(--brique)}
.fiche-conseil .btn{width:100%;margin-top:6px}
#app.clavier .fiche-conseil{padding:10px 16px 12px;gap:4px} #app.clavier .fiche-conseil b{font-size:32px} #app.clavier .fiche-conseil p{font-size:15px} #app.clavier .fiche-conseil .btn{min-height:44px}
@media (max-height:520px){ .fiche-conseil{padding:10px 16px 12px;gap:4px} .fiche-conseil b{font-size:32px} .fiche-conseil p{font-size:15px} .fiche-conseil .btn{min-height:44px} }
@media (prefers-reduced-motion:reduce){ #conseil{animation:none} }
/* le panneau sans épreuve (une vague arrive, la nuit est en pause, la fiche de conseil est ouverte) : il reste en papier, à sa taille,
   et dit en une ligne ce qu'on attend (data-info, posé par le jeu) au lieu de devenir une bande grise et vide */
#panneau.attente::after,#panneau[inert]::after{content:attr(data-info);position:absolute;inset:0;display:grid;place-items:center;padding:10px 20px;text-align:center;font-family:var(--cursive);font-weight:500;font-size:clamp(21px,3.2vw,28px);line-height:1.15;color:var(--texte-2);text-wrap:balance}
#panneau.attente::after{animation:attendre 1.6s ease-in-out infinite alternate}
@keyframes attendre{from{opacity:.55}to{opacity:1}}
@media (prefers-reduced-motion:reduce){ #panneau.attente::after{animation:none} }
/* le panneau garde la même hauteur du début à la fin de la nuit, qu'il attende une vague ou qu'il montre une épreuve (la plus haute,
   Réparer, fixe la mesure) : l'image du dessus ne change donc plus de taille. Sans effet quand le clavier virtuel est ouvert ou l'écran très bas. */
@media (min-width:701px) and (min-height:521px){ #app:not(.clavier) #panneau{min-height:282px;align-content:center} }
@media (max-width:700px) and (min-height:521px){ #app:not(.clavier) #panneau{min-height:280px;align-content:center} }

/* ---------- le clavier du jeu (écrans qu'on touche : #app.tactile ; épreuve « Écrire » en cours : #app.ecrit) ----------
   Quatre rangées de dix touches : les accents, puis l'AZERTY. Aucun flou ni filtre : une touche enfoncée change de couleur et descend de 2 px. */
.touches{display:grid;gap:var(--e);--e:6px;--h:44px;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.touches div{display:grid;grid-template-columns:repeat(10,minmax(0,1fr));gap:var(--e)}
.touches button{height:var(--h);padding:0;display:grid;place-items:center;border-radius:10px;border:1px solid var(--filet);background:var(--panneau);box-shadow:0 2px 0 var(--filet-fort);font:800 22px/1 var(--police);color:var(--texte);touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.touches .accent{background:var(--cobalt-clair);border-color:var(--cobalt-bord);color:var(--cobalt)}
.touches .outil{background:#EFE6D3;color:var(--texte-2)} .touches svg{width:26px;height:26px}
.touches button.enfonce{transform:translateY(2px);box-shadow:none;background:var(--cobalt);border-color:var(--cobalt-fonce);color:#fff}
.touches button:disabled{opacity:.4}
.touches button:focus-visible{outline:3px solid var(--cobalt);outline-offset:1px}
#app.tactile #panneau{grid-template-columns:minmax(0,1fr)}
#app.ecrit #panneau{padding-top:8px;gap:6px}
#app.ecrit #zone{min-height:0;gap:6px;align-content:start;order:2;grid-template-columns:minmax(0,1fr)}
#app.ecrit .ligne{flex-wrap:nowrap;gap:8px}
#app.ecrit .ligne .btn{min-height:48px;padding:0 14px;font-size:15px;white-space:nowrap;flex:none}
#app.ecrit #mot{flex:1 1 0;padding:8px 14px}
#app.ecrit .aides{display:block;order:1} #app.ecrit .aides:has(#indice-txt:empty){display:none}
#app.ecrit #indice-txt{display:block;font-size:19px;line-height:1.1}
@media (max-height:700px){ #app.ecrit .genre{display:none} }
@media (min-width:560px) and (min-height:800px){ .touches{--h:52px;--e:7px} }
@media (max-width:559px){
  .touches{--e:4px;--h:46px} .touches button{font-size:19px;border-radius:8px}
  #app.ecrit .ligne{gap:5px} #app.ecrit .ligne .btn{padding:0 12px} #app.ecrit .ligne .long{display:none} #app.ecrit #mot{font-size:20px;padding:8px 10px}
  /* « Écouter » et « Indice » n'ont plus que leur dessin (leur nom reste lu par les lecteurs d'écran) */
  #app.ecrit #ecouter,#app.ecrit #indice{font-size:0;gap:3px;width:44px;padding:0} #app.ecrit #ecouter::before{content:'🔊';font-size:19px} #app.ecrit #indice::before{content:'💡';font-size:18px} #app.ecrit #indice small{font-size:12px}
}
#app.clavier .touches{--h:36px;--e:4px} #app.clavier.ecrit .ligne .btn{min-height:40px} #app.clavier.ecrit #mot{padding:5px 12px}

/* ---------- première installation (src/installation.js) : un parchemin sur fond de nuit, devant tout le jeu, le temps de régler l'affichage.
   L'écran est opaque (le jeu tourne derrière, on le mesure) et léger à dessiner : ni flou ni ombre animée, seulement des opacités et des
   déplacements. Tout l'avancement tient dans --inst-p (de 0 à 1, posé sur <html>) : le trait d'encre, la plume et les huit emblèmes en
   découlent, ce qui permet de reprendre au même point après le rechargement vers le mode allégé. ---------- */
#installation{display:none}
html[data-installation] #installation{position:fixed;z-index:60;inset:0;display:grid;place-items:center;overflow:auto;padding:max(20px,env(safe-area-inset-top)) max(20px,env(safe-area-inset-right)) max(20px,env(safe-area-inset-bottom)) max(20px,env(safe-area-inset-left));background:radial-gradient(90% 70% at 50% 42%,#18275c,var(--nuit) 70%)}
#installation.fini{opacity:0;transition:opacity .6s}
.inst{position:relative;width:min(100%,520px);display:grid;gap:14px;justify-items:center;border-radius:3px;padding:30px 28px 26px;text-align:center;
  background:radial-gradient(120% 90% at 50% 45%,rgba(247,240,226,0) 55%,rgba(168,122,22,.16)),linear-gradient(180deg,rgba(168,122,22,.14),rgba(168,122,22,0) 9%,rgba(168,122,22,0) 91%,rgba(168,122,22,.16)),var(--papier);
  box-shadow:0 26px 60px rgba(2,5,22,.6)}
.inst::before,.inst::after{content:"";position:absolute;left:-13px;right:-13px;height:24px;border-radius:12px;background:linear-gradient(180deg,#fffaf0,#efe3c8 38%,#c9b78f 82%,#a8946a);box-shadow:0 5px 10px rgba(2,5,22,.45),inset 0 0 0 1px rgba(110,97,82,.25)}
.inst::before{top:-11px} .inst::after{bottom:-11px}
.inst .portrait{width:92px;height:92px;border-radius:50%;border:3px solid var(--or);box-shadow:0 4px 0 var(--or-fonce);object-fit:cover}
.inst h1{font-family:var(--cursive);font-weight:600;font-size:44px;line-height:1;margin:0;color:var(--cobalt)}
.inst .quoi{margin:0;font-size:15.5px;color:var(--texte-2);max-width:34ch}
/* les huit emblèmes des chapitres : l'emblème i se pose quand l'avancement atteint (i+1)/8 ; --la vaut 0 avant, 1 après */
.inst .emblemes{display:grid;grid-template-columns:repeat(8,1fr);gap:6px;width:100%;margin-top:2px}
.inst .emblemes img{--la:clamp(0,calc((var(--inst-p,0)*8 - var(--i))*200 - 199),1);width:100%;height:auto;aspect-ratio:1;opacity:calc(.13 + .87*var(--la));filter:grayscale(calc(1 - var(--la)));transform:translateY(calc(6px - 6px*var(--la))) scale(calc(.86 + .14*var(--la)));transition:opacity .5s,transform .5s var(--ease),filter .5s}
/* le trait d'encre et la plume qui le suit */
.inst .trait{position:relative;width:100%;height:10px;border-radius:999px;background:rgba(59,50,42,.13);margin:14px 0 2px}
.inst .trait i{position:absolute;inset:0;border-radius:999px;background:var(--cobalt);transform-origin:0 50%;transform:scaleX(var(--inst-p,0));transition:transform .6s var(--ease)}
.inst .course{position:absolute;top:0;bottom:0;width:0;left:calc(var(--inst-p,0)*100%);transition:left .6s var(--ease);pointer-events:none}            /* sans largeur : à droite, elle ne doit pas élargir l'écran */
.inst .course img{position:absolute;left:-8px;bottom:2px;width:46px;height:46px;transform-origin:20% 90%;animation:inst-ecrit 1.1s ease-in-out infinite alternate}
@keyframes inst-ecrit{from{transform:rotate(-5deg)}to{transform:rotate(7deg) translateY(-2px)}}
.inst .etapes{list-style:none;margin:0;padding:0;width:100%;display:grid;gap:6px;text-align:left}
.inst .etapes li{display:grid;grid-template-columns:22px 1fr;gap:10px;align-items:center;min-height:44px;padding:5px 12px;border-radius:12px;border:1px solid var(--filet);background:rgba(255,253,248,.6);color:var(--texte-3)}
.inst .etapes b{display:block;font-weight:800;font-size:15.5px;line-height:1.2}
.inst .etapes small{display:block;font-size:13px;font-weight:600;line-height:1.25;font-variant-numeric:tabular-nums}
.inst .etapes li::before{content:"";width:18px;height:18px;border-radius:50%;border:2px solid currentColor;opacity:.5}
.inst .etapes li.encours{color:var(--texte);border-color:var(--cobalt-fonce);background:#fff}
.inst .etapes li.encours::before{border-color:var(--cobalt);border-right-color:transparent;opacity:1;animation:inst-tourne 1s linear infinite}
.inst .etapes li.fait{color:var(--texte-2)}
.inst .etapes li.fait::before{opacity:1;border-color:var(--or-fonce);background:var(--or) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center/14px no-repeat}
@keyframes inst-tourne{to{transform:rotate(1turn)}}
@media (max-width:700px){ .inst{padding:24px 16px 20px;gap:11px} .inst h1{font-size:34px} .inst .portrait{width:72px;height:72px} .inst .emblemes{gap:3px} .inst .quoi{font-size:14.5px} }
@media (max-height:520px){ .inst{width:min(100%,760px);grid-template-columns:auto 1fr;column-gap:18px;padding:22px 24px 18px;gap:8px} .inst .portrait{grid-row:1/3;width:72px;height:72px} .inst h1{font-size:32px;text-align:left;justify-self:start} .inst .quoi{justify-self:start;text-align:left;max-width:none} .inst .emblemes,.inst .trait,.inst .etapes{grid-column:1/-1} .inst .etapes{grid-template-columns:1fr 1fr} .inst .emblemes img{max-height:64px;object-fit:contain} }
@media (prefers-reduced-motion:reduce){ .inst .course img,.inst .etapes li.encours::before{animation:none} .inst .emblemes img,.inst .trait i,.inst .course{transition:none} #installation.fini{transition:none} }
.ligne .btn.primaire{gap:.28em}
/* le panneau garde aussi sa hauteur sur les écrans qu'on touche : là, c'est l'épreuve « Écrire » et son clavier qui fixent la mesure */
@media (min-width:701px) and (min-height:521px) and (max-height:799px){ #app.tactile:not(.clavier) #panneau{min-height:311px} }
@media (min-width:701px) and (min-height:800px){ #app.tactile:not(.clavier) #panneau{min-height:372px} }
@media (min-width:560px) and (max-width:700px) and (min-height:800px){ #app.tactile:not(.clavier) #panneau{min-height:364px} }
@media (max-width:559px) and (min-height:521px){ #app.tactile:not(.clavier) #panneau{min-height:355px} }
/* écran bas (tablette en paysage, téléphone couché) : la scène seule est trop petite pour la fiche de conseil, qui s'y trouvait écrasée
   tout en haut. Elle se pose alors au milieu de tout l'écran, par-dessus le panneau (vide à ce moment-là). */
@media (max-height:700px){ #conseil{position:fixed;background:rgba(8,12,36,.55)} #app:has(#conseil:not([hidden])) #panneau::after{content:none} }
/* la petite carte du mot se touche pour s'ouvrir en grand (fiche de conseil, nuit arrêtée) : une loupe le signale */
#piege.vue.ouvrable{pointer-events:auto;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
#piege.ouvrable::after{content:'';flex:none;width:15px;height:15px;margin-left:8px;background:currentColor;opacity:.7;-webkit-mask:var(--loupe) center/contain no-repeat;mask:var(--loupe) center/contain no-repeat;
  --loupe:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5L21 21'/%3E%3C/svg%3E")}
/* même raison pour le menu de pause : sur un écran bas il tenait dans la scène seule et il fallait le faire défiler */
@media (max-height:700px){ #pause{position:fixed} #app:has(#pause:not([hidden])) #panneau::after{content:none} }

/* ---------- le menu « Réglages » (src/reglages.js, maquette docs/maquettes/reglages.html) : le papier et les deux rouleaux du parchemin
   de l'accueil et de la classe, une ligne par réglage, et pour chacun deux gros boutons Oui / Non dont l'un est allumé (aria-pressed).
   Sur tout l'écran (position fixe) : pendant la nuit, la scène n'en est que le haut. L'écran d'où l'on vient s'efface derrière.
   Les lignes défilent dans la carte (.defile) si elle dépasse l'écran ; le titre et le bouton du bas restent en place.
   Le papier est recopié et non partagé avec #classe .rouleau, dont le bloc appartient à l'écran de la classe. ---------- */
#reglages{position:fixed;z-index:12;inset:0;display:flex;align-items:center;justify-content:center;padding:max(26px,env(safe-area-inset-top)) max(20px,env(safe-area-inset-right)) max(26px,env(safe-area-inset-bottom)) max(20px,env(safe-area-inset-left));background:rgba(8,14,40,.62);animation:fondu .3s both}
#accueil.sous-reglages .menu,#pause.sous-reglages .carte{visibility:hidden}
#pause.sous-reglages{background:none}
#reglages .rouleau{position:relative;width:min(100%,640px);max-height:100%;display:grid;grid-template-rows:auto minmax(0,1fr) auto;border-radius:3px;padding:24px 28px 22px;transform:rotate(-.4deg);
  background:radial-gradient(120% 90% at 50% 45%,rgba(247,240,226,0) 55%,rgba(168,122,22,.16)),linear-gradient(180deg,rgba(168,122,22,.14),rgba(168,122,22,0) 9%,rgba(168,122,22,0) 91%,rgba(168,122,22,.16)),var(--papier);
  box-shadow:0 26px 60px rgba(2,5,22,.6)}
#reglages .rouleau:focus{outline:none}            /* le focus posé à l'ouverture : la carte entière, sans cadre */
#reglages .rouleau::before,#reglages .rouleau::after{content:"";position:absolute;left:-13px;right:-13px;height:24px;border-radius:12px;
  background:linear-gradient(180deg,#fffaf0,#efe3c8 38%,#c9b78f 82%,#a8946a);box-shadow:0 5px 10px rgba(2,5,22,.45),inset 0 0 0 1px rgba(110,97,82,.25)}
#reglages .rouleau::before{top:-11px} #reglages .rouleau::after{bottom:-11px}
#reglages h1{font-family:var(--cursive);font-weight:600;font-size:44px;line-height:1;margin:0 0 8px;color:var(--cobalt)}
#reglages .defile{min-height:0;overflow:auto;overscroll-behavior:contain;margin:0 -8px;padding:0 8px 4px}            /* la marge rend la place du cadre de focus des boutons */
#reglages .option{display:grid;grid-template-columns:48px minmax(0,1fr) auto;align-items:center;gap:4px 14px;padding:9px 0;border-top:1px solid rgba(59,50,42,.16)}
#reglages .picto{display:grid;place-items:center;width:48px;height:48px;border-radius:50%;background:var(--cobalt-clair);color:var(--cobalt)}
#reglages .picto svg{width:28px;height:28px;fill:none;stroke:currentColor;stroke-width:2.1;stroke-linecap:round;stroke-linejoin:round}
#reglages .option b{display:block;font-weight:800;font-size:18px;line-height:1.15;color:var(--texte)}
#reglages .option p{margin:1px 0 0;font-size:14.5px;line-height:1.25;color:var(--texte-2)}
/* le choix : un creux de papier où le bouton allumé est le bleu de Cobalt ; la classe : sept pastilles sur une ligne à elle */
#reglages .oui-non,#reglages .annees{display:flex;gap:6px;padding:5px;border-radius:18px;background:rgba(59,50,42,.09)}
#reglages .oui-non button,#reglages .annees button{display:flex;align-items:center;justify-content:center;height:48px;padding:0 14px;border:0;border-radius:13px;background:none;font-weight:800;font-size:16.5px;color:var(--texte-2);transition:background .15s,color .15s}
#reglages .oui-non button{min-width:76px}
#reglages .oui-non [aria-pressed="true"],#reglages .annees [aria-pressed="true"]{background:var(--cobalt);color:#fff;box-shadow:0 3px 0 #153c8d}
#reglages .option.classe{grid-template-columns:48px minmax(0,1fr)}
#reglages .annees{grid-column:1/-1;margin-top:6px}
#reglages .annees button{flex:1;min-width:0;padding:0 4px;font-size:17px}
#reglages .annees sup{font-size:.62em;margin:-8px 0 0 1px}
#reglages .annees .grand{flex:1.9;font-size:15px;white-space:nowrap}
#reglages .option > .btn{min-height:50px;padding:0 18px;font-size:15.5px;white-space:nowrap;color:var(--texte);background:rgba(255,253,248,.72)}
#reglages-retour{width:100%;min-height:54px;margin-top:6px;font-size:18px}
/* la version d'essai du site : une étiquette sous le titre de l'accueil (src/reglages.js) */
#accueil-essai{position:relative;justify-self:center;margin:-4px 0 0;padding:4px 12px;font-family:inherit;cursor:pointer;border-radius:999px;border:1.5px dashed rgba(31,78,200,.55);background:rgba(31,78,200,.08);color:var(--cobalt);font-weight:800;font-size:14px;line-height:1.2}
#accueil-essai[hidden]{display:none} #accueil-essai::after{content:"";position:absolute;inset:-10px -8px}            /* une cible de 44 px autour de l'étiquette, qui mène à « Pour les parents » */
#reglages .option[hidden]{display:none}            /* « Les vibrations » : seulement là où le clavier du jeu peut vibrer (jeu.js) */
#reglages.en-pause .pas-en-pause{display:none}            /* depuis la pause : ni la classe ni l'image */
/* passer le mode tranquille à Oui fait parler Cobalt : sa bulle passe devant le voile et la carte (elle ne prend pas le doigt) */
body:has(#reglages:not([hidden])) #bulle{z-index:13}
/* carte ouverte : la bulle se pose hors de la carte (jeu.js, horsCarte), sans queue ; sans place pour elle, elle ne se montre pas */
#bulle.hors-carte::before,#bulle.hors-carte::after{display:none} #bulle.sans-place{visibility:hidden}
@media (max-width:700px){
  #reglages{padding:max(24px,env(safe-area-inset-top)) 12px max(24px,env(safe-area-inset-bottom))}
  #reglages .rouleau{padding:20px 14px 16px;transform:rotate(-.3deg)} #reglages .rouleau::before,#reglages .rouleau::after{left:-9px;right:-9px;height:20px}
  #reglages h1{font-size:38px;margin-bottom:6px}
  #reglages .option{grid-template-columns:40px minmax(0,1fr) auto;gap:2px 10px;padding:8px 0}
  #reglages .picto{width:40px;height:40px} #reglages .picto svg{width:22px;height:22px}
  #reglages .option b{font-size:16px} #reglages .option p{font-size:12.5px;line-height:1.2}
  #reglages .oui-non{gap:4px;padding:4px;border-radius:15px} #reglages .oui-non button{min-width:50px;height:46px;padding:0 9px;font-size:15px;border-radius:11px}
  #reglages .option.classe{grid-template-columns:40px minmax(0,1fr)}
  #reglages .annees{flex-wrap:wrap;gap:3px;padding:4px;margin-top:4px} #reglages .annees button{flex:1 0 14%;height:46px;font-size:15.5px;border-radius:11px} #reglages .annees .grand{flex:1 0 100%;font-size:15px}
  #reglages .option > .btn{min-height:46px;padding:0 12px;font-size:14px}
  #reglages-retour{min-height:52px;font-size:17px}
}
/* écran bas (téléphone couché, clavier ouvert) : un titre plus petit, des rouleaux plus près du bord ; les lignes défilent */
@media (max-height:520px){
  #reglages{padding-top:max(16px,env(safe-area-inset-top));padding-bottom:max(16px,env(safe-area-inset-bottom))}
  #reglages .rouleau{padding-top:14px;padding-bottom:12px} #reglages h1{font-size:30px;margin-bottom:4px} #reglages-retour{min-height:46px}
  #reglages .annees{flex-wrap:nowrap} #reglages .annees button{flex:1 1 0;padding:0 2px;font-size:15px} #reglages .annees .grand{flex:2.2 1 0;font-size:13.5px}            /* les sept pastilles sur une ligne : une rangée de moins à faire défiler */
}
@media (prefers-reduced-motion:reduce){ #reglages{animation:none} #reglages .oui-non button,#reglages .annees button{transition:none} }

/* ---------- la première partie guidée (docs/premiere-partie.md, expliquer dans src/jeu.js) ----------
   .montre : l'élément dont Cobalt parle, entouré le temps de sa bulle. Or sur la scène sombre (bandeau, étiquettes), cobalt sur le papier. */
.montre:not(#etiquettes),#etiquettes.montre .etiquette{--m:31,86,196;outline:3px solid rgb(var(--m));outline-offset:3px;animation:montre .85s ease-in-out infinite alternate}
#hud .montre,#etiquettes.montre .etiquette,#etiquettes .montre{--m:242,197,92}
#hud .pages.montre,#hud .montre{border-radius:999px} #zone .dechire.montre,#zone .choix.montre,#f-revoir.montre{border-radius:12px}
@keyframes montre{from{outline-color:rgba(var(--m),.4);box-shadow:0 0 0 0 rgba(var(--m),0)}to{outline-color:rgb(var(--m));box-shadow:0 0 0 7px rgba(var(--m),.3)}}
/* une explication se lit même là où la bulle ordinaire est retirée (écran bas, clavier du système ouvert) : elle est obligatoire */
@media (max-height:520px){ #bulle.tenue{display:block;font-size:15px;padding:6px 10px;max-width:72vw} }
#app.clavier #bulle.tenue{display:block;font-size:15px;padding:6px 10px;max-width:72vw}
/* l'étiquette du gribouille quand la réponse est juste : le barbouillage s'efface, le mot apparaît bien écrit, puis l'étiquette s'en va */
.etiquette .juste{display:inline-block;font-family:var(--cursive);font-weight:600;font-size:1.3em;line-height:.9;color:var(--cobalt);animation:juste .32s var(--ease) both}
.etiquette.part{opacity:0;font-size:18px;padding:8px 12px 10px;transition:opacity .35s .6s}
@keyframes juste{from{opacity:0;filter:blur(5px);transform:scale(.85)}to{opacity:1;filter:none;transform:none}}
/* la carte de fin : les points d'or de la nuit à la place de l'encre, et ce que Cobalt dit des mots à revoir (la première fois) */
.trio .or b::before{content:'';display:inline-block;width:.42em;height:.42em;margin-right:.2em;border-radius:50%;vertical-align:.14em;background:radial-gradient(circle at 35% 30%,#fff3c4,var(--or-vif) 50%,var(--or))}
#f-revoir-mot{margin:-4px 0 0;font-size:20px;line-height:1.2}
/* « Comment jouer » : la seconde page de la carte des réglages (src/reglages.js). Une ligne par explication : le dessin, la phrase, l'écoute. */
#aide h2,#confidentialite h2{margin:14px 0 4px;font:800 12px var(--police);letter-spacing:.14em;text-transform:uppercase;color:var(--texte-3)}
#aide h2:first-child{margin-top:2px}
/* « Confidentialité » : un texte pour les parents ; au bas, le portail parental devant le lien de la politique en ligne */
#confidentialite,#parents{font-size:15px;line-height:1.5;color:var(--texte);overflow-wrap:anywhere}
#confidentialite p,#confidentialite ul,#parents p{margin:6px 0} #confidentialite ul{padding-left:20px}
.portail{margin:8px 0 4px;display:grid;gap:8px;justify-items:start} .portail [hidden]{display:none}
.portail .btn{min-height:46px;font-size:15px;text-decoration:none} .portail form{display:grid;gap:6px} .portail form p{margin:0}
.portail .reponse{display:flex;gap:8px;align-items:stretch} .portail input{width:6.5em;min-height:46px;padding:0 12px;border-radius:12px;border:2px solid var(--filet-fort);background:#fff;font:800 20px var(--police);color:var(--texte);text-align:center}
.portail .non{margin:0;color:var(--texte-2,var(--texte));font-weight:700}
#confidentialite .cle{margin:2px 0 4px;padding:10px 12px;border-radius:12px;border:1px solid var(--filet);background:var(--panneau);font-weight:800}
#aide .explication{display:grid;grid-template-columns:124px minmax(0,1fr) auto;align-items:center;gap:6px 14px;padding:9px 0;border-top:1px solid rgba(59,50,42,.16)}
#aide .explication p{margin:0;font-family:var(--cursive);font-size:22px;line-height:1.18;color:var(--texte);text-wrap:pretty}
#aide .dessin{display:flex;flex-wrap:wrap;gap:5px;align-items:center;justify-content:center;min-height:48px}
#aide .dessin .etiquette{position:static;transform:none;opacity:1;font-size:13px;padding:5px 8px 6px;animation:none}
#aide .dessin .gribouillis{width:60px;height:15px}
#aide .dessin .puce{height:32px;padding:0 10px;font-size:13px;background:#141c44;backdrop-filter:none}
#aide .dessin .puce.ronde{width:36px;padding:0;justify-content:center}
#aide .dessin .puce svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round}
#aide .dessin .puce.chaud{border-color:var(--or-vif);color:var(--or-vif)}
#aide .bouton{display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:32px;padding:3px 10px;border-radius:10px;border:1px solid var(--filet);background:var(--panneau);font-weight:800;font-size:12.5px;line-height:1.1;color:var(--texte-2);box-shadow:0 2px 0 var(--filet-fort);text-align:center}
#aide .bouton.plein{background:var(--cobalt);border-color:var(--cobalt);color:#fff;box-shadow:0 2px 0 #153c8d}
#aide .bouton small{font-size:11px;opacity:.8}
#aide .a-revoir{font-family:var(--cursive);font-size:22px;color:var(--brique)}
#aide .morceau{font:800 22px/1 var(--police);color:var(--texte)}
#aide .morceau i{display:inline-block;width:1.3em;height:.95em;margin:0 .08em;border-radius:5px;vertical-align:-.1em;background:repeating-linear-gradient(135deg,var(--cobalt-clair) 0 5px,#fff 5px 10px);border:2px dashed var(--cobalt-bord)}
#aide .carte-mot{display:inline-flex;flex-direction:column;align-items:center;max-width:100%;background:var(--papier);border:1px solid var(--filet-fort);border-radius:10px;padding:4px 9px 5px;font-size:11.5px;line-height:1.15;color:var(--texte-2);text-align:center}
#aide .carte-mot b{font-family:var(--cursive);font-weight:600;font-size:19px;color:var(--cobalt)}
#aide .carte-mot svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:2.6;stroke-linecap:round;opacity:.7}
#aide .pts{margin:0;gap:5px} #aide .pts i{width:13px;height:13px}
#aide .lettres b{display:inline-grid;place-items:center;width:27px;height:32px;margin:0 2px;border:1px solid var(--filet-fort);border-radius:6px;background:var(--panneau);font-size:16px;color:var(--cobalt)}
#aide .ligne-mot{display:inline-flex;align-items:center;gap:8px;padding:2px 0 2px 9px;font-family:var(--cursive);font-size:22px;color:var(--texte)}
#aide .ligne-mot.marque{border-left:4px solid var(--cobalt)}
@media (max-width:700px){ #aide .explication{grid-template-columns:86px minmax(0,1fr) auto;gap:4px 10px;padding:8px 0} #aide .explication p{font-size:18px} #aide .ecoute{width:44px;height:44px} }
@media (prefers-reduced-motion:reduce){ .montre:not(#etiquettes),#etiquettes.montre .etiquette{animation:none} .etiquette .juste{animation:none} }

/* la bulle de Cobalt croise l'étiquette du gribouille visé et ne peut pas monter : elle passe devant (src/jeu.js, la boucle) */
#bulle.devant{z-index:6}
