/* Sur téléphone, 100vh compte la hauteur sans la barre d'adresse : la page dépassait l'écran de 71 points et défilait.
   Partout où une hauteur d'écran sert, 100dvh (hauteur réellement visible) passe après 100vh, qui ne sert que de repli. */
/* Cytoduel — apparence. Suit le guide de style de l'équipe de design (docs/prototypes/02-guide-de-style.html) :
   ambiance « microscope à fluorescence », fond bleu nuit, formes rondes, couleurs qui luisent. */
@import url(polices/polices.css);

:root{
  --bg:#0b1420; --panel:#132132; --panel2:#1b2d42; --well:#0f1c2b; --line:#24384f;
  --txt:#e6eef7; --mut:#8ea3b8;
  --me:#2dd4bf; --me-d:#0f766e; --foe:#f472b6; --foe-d:#9d2463;
  --me-l:#5eead4; --me-rgb:45,212,191; --me-on:#14403f; --foe-rgb:244,114,182; --foe-raye:#b8437f; --foe-ink:#3b0a25;
  --warn:#fbbf24; --poison:#a3e635; --acid:#d9f99d; --bio:#86efac; --ink:#04201d;
  --fh:'Fredoka','Arial Rounded MT Bold','Trebuchet MS',system-ui,sans-serif;
  --fb:'Nunito','Segoe UI Variable','Segoe UI',system-ui,-apple-system,sans-serif;
}
/* Couleurs des camps « bleu et orange » (réglage de la page d'infos, pour qui confond le turquoise et le rose) */
.camps-bo{--me:#60a5fa; --me-d:#1d4ed8; --me-l:#93c5fd; --me-rgb:96,165,250; --me-on:#16325a; --ink:#0b1a33;
  --foe:#fb923c; --foe-d:#9a3412; --foe-rgb:251,146,60; --foe-raye:#c2410c; --foe-ink:#3b1405}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html{-webkit-text-size-adjust:100%;touch-action:manipulation}   /* le zoom à deux doigts reste permis (accessibilité) ; seul le zoom au double toucher est retiré */
body{margin:0;color:var(--txt);font-family:var(--fb);font-weight:600;font-size:15px;line-height:1.4;min-height:100vh;min-height:100dvh;
  background:radial-gradient(900px 520px at 12% -8%,rgba(var(--me-rgb),.11),transparent 62%),radial-gradient(820px 520px at 100% 8%,rgba(var(--foe-rgb),.07),transparent 62%),var(--bg);background-attachment:fixed}
h1,h2,h3{font-family:var(--fh);font-weight:600;letter-spacing:.2px;line-height:1.15;margin:0}
/* Badge de l'hébergeur : l'offre gratuite de Netlify pose en bas à droite un badge fixe de 64 points de haut (cadre #nl-badge-frame),
   qui recouvrait le bouton « Combattre » sur téléphone. On ne le masque pas (il fait partie de l'offre) : la page lui laisse sa place.
   Sur écran large il tombe à côté de la colonne du jeu et ne gêne pas. --bas vaut 0 partout ailleurs (en local, autre hébergeur). */
body{--bas:0px;   /* encoches et barres du système (viewport-fit=cover) : marges de sécurité du navigateur */
  --sh:env(safe-area-inset-top,0px); --sb:env(safe-area-inset-bottom,0px); --sg:env(safe-area-inset-left,0px); --sd:env(safe-area-inset-right,0px)}
@media (max-width:899px){body:has(#nl-badge-frame){--bas:64px}}
.app{max-width:480px;margin:0 auto;padding:calc(8px + var(--sh)) calc(12px + var(--sd)) calc(8px + var(--bas) + var(--sb)) calc(12px + var(--sg))}
.hide{display:none!important}
/* lu par le lecteur d'écran, invisible à l'œil (la grille en liste, les annonces) */
.lu{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.lu button{width:1px;height:1px}
.grow{flex:1;min-width:0}
canvas{display:block;margin:0 auto;touch-action:none}
svg{display:block}
:focus-visible{outline:2px solid var(--warn);outline-offset:2px}

/* ---------- composants ---------- */
button{font:inherit;color:var(--txt);background:var(--panel2);border:1px solid var(--line);border-radius:12px;padding:8px 6px;cursor:pointer}
button.on{border-color:var(--me);background:var(--me-on);box-shadow:0 0 0 1.5px var(--me)}
button:disabled{opacity:.4;cursor:default}
button small{display:block;color:var(--mut);font-size:12px}
/* bouton principal : relief sous le bouton, il s'enfonce quand on appuie */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;font-family:var(--fh);font-weight:600;font-size:17px;line-height:1.15;color:var(--ink);
  background:linear-gradient(var(--me-l),var(--me));border:0;border-radius:16px;padding:13px 18px;text-align:center;box-shadow:0 4px 0 var(--me-d),0 0 26px rgba(var(--me-rgb),.28)}
.btn:active{transform:translateY(3px);box-shadow:0 1px 0 var(--me-d)}
.btn.sec{color:var(--txt);background:var(--panel2);border:1px solid #2f4a68;box-shadow:0 4px 0 #0a1522}
.btn.sec:active{box-shadow:0 1px 0 #0a1522}
.btn.sm{font-size:14px;padding:7px 11px;border-radius:12px;box-shadow:0 3px 0 #0a1522}
.btn.sm:active{transform:translateY(2px);box-shadow:0 1px 0 #0a1522}
.btn:disabled{opacity:.42;box-shadow:none}
.iconbtn{width:44px;height:44px;border-radius:12px;display:grid;place-items:center;background:var(--well);border:1px solid var(--line);font-size:20px;padding:0;flex:none}
.chip{display:inline-flex;align-items:center;gap:4px;font-size:12px;font-weight:800;line-height:1.5;padding:1px 8px;border-radius:999px;border:1px solid var(--line);background:var(--well);color:var(--mut);white-space:nowrap}
.chip svg{width:12px;height:12px}
.chip.warn{color:var(--warn);border-color:rgba(251,191,36,.45)}
.lab{font-size:12px;font-weight:800;color:var(--mut);text-transform:uppercase;letter-spacing:.08em}
.panel{background:var(--panel);border:1px solid var(--line);border-radius:18px;padding:12px 14px;margin-top:10px}
/* comparaison de deux cellules (UX 5.6) : côte à côte, à la même échelle, les cases différentes entourées d'ambre */
.cmp2{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:6px 0 0}
.cmp2 figure{margin:0;text-align:center}
.cmp2 canvas{display:block;margin:0 auto}
.cmp2 figcaption{font-family:var(--fh);font-weight:600;font-size:14px;margin-top:2px}
.cmp2 figcaption small{display:block;font-family:var(--fb);font-weight:700;font-size:12px;color:var(--mut)}
.cmpLeg{font-size:12px;color:var(--mut);margin:6px 0 4px}
.cmpLeg:empty{display:none}
.cmpTab{width:100%;border-collapse:collapse;font-size:13px;margin:4px 0 8px}
.cmpTab th{text-align:left;font-weight:700;color:var(--mut);padding:5px 0;font-size:12.5px}
.cmpTab td{text-align:center;font-weight:800;width:26%;padding:5px 0}
.cmpTab tr+tr th,.cmpTab tr+tr td{border-top:1px solid var(--line)}
.cmpTab td.diff{color:var(--warn)}
.card{background:var(--panel);border:1px solid var(--line);border-radius:18px;padding:8px 12px}
.bar{height:8px;background:#0a111b;border-radius:4px;overflow:hidden}
.bar>i{display:block;height:100%;background:var(--me);transition:width .15s}
.row{display:flex;gap:8px;align-items:center}
.row>*{flex:1}

/* ---------- atelier : tout tient sur un écran de téléphone ---------- */
/* Toutes les cibles font au moins 44 points (UX §5.1, WCAG 2.5.5), même avec la bande laissée au badge de l'hébergeur (22 novembre) :
   le son descend à côté de « Combattre », tourner et retirer passent dans la grille (colonne de droite, sous annuler et rétablir),
   la fiche, la palette et les comportements se resserrent. La grille y gagne environ 80 points de haut. */
#atelier{position:relative;display:flex;flex-direction:column;gap:4px;height:calc(100vh - 16px - var(--bas) - var(--sh) - var(--sb));height:calc(100dvh - 16px - var(--bas) - var(--sh) - var(--sb));min-height:520px}
.head{display:flex;align-items:center;gap:8px;flex:none}
.ttl{font-family:var(--fh);font-weight:600;font-size:22px;line-height:1.1}
.ttl small{display:block;white-space:nowrap;font-family:var(--fb);font-size:12px;font-weight:700;color:var(--mut)}
/* l'adversaire à battre, avec ses deux flèches */
.foe-row{display:flex;gap:5px;align-items:center;flex:1;min-width:0}
.head .ttl{flex:none}
.sonbtn{color:var(--txt)}
.sonbtn.off{color:var(--mut)}
#foeLab{min-width:0;flex:1;text-align:center;font-family:var(--fh);font-weight:600;font-size:15px;line-height:1.15;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#foeLab small{display:block;font-family:var(--fb);font-size:12px;font-weight:700;color:var(--mut)}
/* la grille : un puits éclairé par le centre, comme une lame sous l'objectif */
#edwrap{position:relative;flex:1;min-height:140px;border-radius:20px;background:radial-gradient(circle at 50% 46%,#14293d,#0f1c2b 70%);border:1px solid var(--line);overflow:hidden}
#edwrap canvas{position:absolute;left:0;top:0}
#edwrap .front{position:absolute;top:8px;left:10px;pointer-events:none}
/* à droite, en colonne : annuler, rétablir, tourner et retirer l'organite choisi (ils agissent sur la grille, ils sont à côté d'elle) */
#edwrap .undo{position:absolute;top:8px;right:8px;display:flex;flex-direction:column;gap:4px}
/* trois emplacements de cellule, en colonne sous « Avant » ; un emplacement vide est en pointillés */
#edwrap .slots{position:absolute;top:34px;left:8px;display:flex;flex-direction:column;gap:3px}
#edwrap .slots button{width:44px;height:44px;min-height:0;padding:0;border-radius:10px;border:1px solid var(--line);background:rgba(11,20,32,.7);color:var(--mut);font-family:var(--fh);font-weight:600;font-size:15px;cursor:pointer}
#edwrap .slots button.on{color:var(--txt);border-color:var(--me);box-shadow:inset 0 0 0 1px var(--me)}
#edwrap .slots button.vide{border-style:dashed}
#edwrap #passer{position:absolute;top:8px;right:8px;min-height:44px;padding:1px 12px;font-family:var(--fb);color:var(--txt);cursor:pointer}
/* organite ou comportement pas encore gagné : visible, mais éteint */
.pal button.verrou,.beh button.verrou{opacity:.42;border-style:dashed}
/* le bouton que le guide désigne */
.appel{animation:appel 1.3s ease-in-out infinite}
@keyframes appel{50%{box-shadow:0 0 0 7px rgba(var(--me-rgb),.32)}}
@media (prefers-reduced-motion:reduce){.appel{animation:none;box-shadow:0 0 0 4px rgba(var(--me-rgb),.4)}}
#edwrap .undo .iconbtn{background:rgba(11,20,32,.7)}
/* tourner et retirer agissent sur l'organite choisi (entouré d'ambre) : séparés d'annuler et rétablir, et de la même couleur */
#edwrap .undo #redo{margin-bottom:8px}
#edwrap.court .undo #redo{margin-bottom:0}
#edwrap .undo #turnG,#edwrap .undo #oter{color:var(--warn);border-color:rgba(251,191,36,.4)}
#edwrap .undo svg{width:17px;height:17px}
/* énergie : vingt segments, on compte d'un coup d'œil */
.nrj{display:flex;align-items:center;gap:10px;flex:none;line-height:1.1}
.nrj .lab{display:flex;align-items:center;gap:4px}
.nrj .lab svg{width:14px;height:14px;color:var(--warn)}
.nrj b{font-family:var(--fh);font-weight:600;font-size:16px;white-space:nowrap}
.segs{flex:1;display:grid;grid-template-columns:repeat(20,1fr);gap:2px;height:12px}
.segs i{border-radius:3px;background:#0a111b;box-shadow:inset 0 0 0 1px var(--line)}
.segs i.o{background:var(--warn);box-shadow:0 0 6px rgba(251,191,36,.35)}
/* fiche d'un organite (23 novembre) : plus de bandeau fixe sous la grille ; elle s'ouvre à la demande, posée en bas de la grille */
.fiche{position:absolute;left:8px;right:8px;bottom:8px;z-index:3;display:grid;grid-template-columns:50px 1fr;column-gap:10px;align-items:center;padding:10px 12px;border-color:rgba(251,191,36,.5);box-shadow:0 8px 24px rgba(0,0,0,.45);animation:ficheMonte .16s ease-out}
.fiche.hide{display:none}
.fiche .pic{width:50px;height:50px;border-radius:14px;background:var(--well);display:grid;place-items:center;overflow:hidden}
#edwrap .fiche .pic canvas{position:static;margin:0;width:42px!important;height:42px!important}   /* static : #edwrap canvas la plaquait en haut à gauche */
@keyframes ficheMonte{from{opacity:0;transform:translateY(8px)}}
@media (prefers-reduced-motion:reduce){.fiche{animation:none}}
#selHead{display:flex;align-items:center;gap:6px;flex-wrap:wrap;min-width:0}
#selHead b{font-family:var(--fh);font-weight:600;font-size:16px}
.fiche .desc{margin:3px 0 0;font-size:12.5px;line-height:1.3;font-weight:600;color:var(--mut)}
/* message de l'atelier : une bulle en bas de la grille, qui ne prend pas les touchers */
.bulleAt{position:absolute;left:50%;bottom:10px;transform:translateX(-50%);z-index:2;width:max-content;max-width:calc(100% - 24px);margin:0;padding:8px 12px;border-radius:14px;background:rgba(11,20,32,.92);border:1px solid rgba(251,191,36,.45);color:var(--warn);font-size:12.5px;line-height:1.3;font-weight:700;text-align:center;pointer-events:none}
.bulleAt.hide{display:none}
.bulleAt svg{display:inline-block;vertical-align:-.15em}
/* l'organite en main porte un « i » : le toucher encore ouvre sa fiche */
.pal button{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}
.pal button.on::before{content:'i';position:absolute;top:3px;left:4px;width:14px;height:14px;border-radius:7px;background:rgba(255,255,255,.14);color:var(--txt);font:700 10px/14px var(--fh);text-align:center}
/* tourner et retirer l'organite choisi : dans la colonne de droite de la grille */
#turnG svg{transform:scaleX(-1)}
#selHead{flex-wrap:nowrap}
#selHead b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* organite qui ne peut pas être posé (énergie manquante, ou déjà au plafond) : éteint, mais on peut toujours lire sa fiche */
.pal button.cher{opacity:.5}
.pal button.cher small{color:var(--mut)}
/* la jauge d'énergie se secoue quand elle refuse une pose */
.secoue{animation:secoue .35s}
/* le guide montre un élément du doigt : un halo qui pulse trois fois (une lueur fixe si le téléphone réduit les animations) */
.montre{animation:montre 1s ease-in-out 3;border-radius:14px}
@keyframes montre{50%{box-shadow:0 0 0 4px rgba(251,191,36,.75),0 0 18px rgba(251,191,36,.45)}}
@media (prefers-reduced-motion:reduce){.montre{animation:none;box-shadow:0 0 0 3px rgba(251,191,36,.75)}}
@keyframes secoue{20%{transform:translateX(-5px)}40%{transform:translateX(5px)}60%{transform:translateX(-3px)}80%{transform:translateX(3px)}}
@media (prefers-reduced-motion:reduce){.secoue{animation:none}}
/* palette : trois rangées de cinq */
.pal{display:grid;grid-template-columns:repeat(5,1fr);gap:3px 4px;flex:none}
.pal button{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;padding:1px 0 2px;border-radius:13px;background:var(--panel);font-size:12px;font-weight:800;line-height:1.15;height:44px}
.pal button canvas{width:24px!important;height:20px!important}   /* dessinée en 34 × 28 : réduite pour que la tuile tienne en 44 points */
.pal button small{display:flex;align-items:center;gap:1px;font-size:12px;color:var(--warn);font-weight:800;position:absolute;top:2px;right:5px}
.pal button small svg{width:9px;height:9px}
.pal canvas{margin:0;pointer-events:none}
/* comportement : trois choix, une icône et une phrase chacun */
.beh{display:grid;grid-template-columns:repeat(3,1fr);gap:5px;flex:none}
.beh button{display:flex;align-items:center;gap:6px;padding:4px 7px;border-radius:13px;background:var(--panel);text-align:left;min-height:44px}
/* le sous-titre (« droit sur l'ennemi »…) n'est plus affiché, faute de place : il reste lu par le lecteur d'écran */
.beh button small{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.beh button svg{width:20px;height:20px;color:var(--mut);flex:none}
.beh button b{display:block;font-family:var(--fh);font-weight:600;font-size:13.5px;line-height:1.1}
.beh button small{font-size:12px;font-weight:700;line-height:1.15}
.beh button.on svg{color:var(--me)}
.cta{display:flex;gap:8px;flex:none}   /* le relief des boutons (4 points) déborde dans la marge du bas de la page */
.cta #duelBtn{flex:none}
.cta .btn{padding-top:12px;padding-bottom:12px}
.cta .sonbtn{height:auto;align-self:stretch}

/* ---------- défi ---------- */
#duel,#cmp,#empl{position:absolute;left:0;right:0;bottom:0;margin:0;z-index:5;background:#111d2d;box-shadow:0 -8px 24px rgba(0,0,0,.45)}
#duel h2,#cmp h2,#empl h2{margin:0 0 4px;font-size:20px}
#duel p{margin:6px 0 3px;font-size:13px;color:var(--mut)}
#empl p{margin:4px 0 8px;font-size:13px;color:var(--mut)}
#empl{max-height:100%;overflow-y:auto;overscroll-behavior:contain}
.empl{border:1px solid var(--line);border-radius:12px;padding:8px;margin-top:6px;background:rgba(11,20,32,.5)}
.empl.on{border-color:var(--me)}
.emplH{display:grid;grid-template-columns:24px 1fr;gap:2px 8px;align-items:center}
.emplH b{font-family:var(--fh);font-size:17px;color:var(--mut);text-align:center}
.empl.on .emplH b{color:var(--me)}
.emplH input{min-width:0;font:inherit;font-size:16px;color:var(--txt);background:#0a111b;border:1px solid var(--line);border-radius:10px;padding:8px 10px;min-height:44px}
.emplH small{grid-column:2;font-size:12px;color:var(--mut)}
.emplB{display:flex;flex-wrap:wrap;gap:5px;margin-top:6px}
.emplB button{flex:1 1 auto;min-height:44px;font-size:13px;padding:6px 10px}
.emplB button.warn{border-color:var(--warn);color:var(--warn)}
/* grille trop basse pour deux colonnes de quatre boutons (écran court) : deux blocs de 2 × 2 dans les coins du haut,
   et la grille se rétrécit pour ne pas passer dessous (layout() dans client.js) */
#edwrap.court .slots,#edwrap.court .undo{flex-direction:row;flex-wrap:wrap;width:92px}
#edwrap.court .undo{justify-content:flex-end}
#edwrap .slots #gerer{font-size:18px;line-height:1;color:var(--mut)}
#edwrap .slots #gerer svg,#desc svg{display:inline-block;vertical-align:-.15em}   /* icône « autres » (⋯ dessiné, pas le caractère) */
#duel .line,#cmp .line,#empl .line{display:flex;gap:5px;margin-top:5px}
#cmp{max-height:100%;overflow-y:auto;overscroll-behavior:contain}
#duel input{flex:1;min-width:0;font:600 14px ui-monospace,Consolas,monospace;letter-spacing:.3px;color:var(--txt);background:#0a111b;border:1px solid var(--line);border-radius:12px;padding:10px 8px}
#duel .line button,#cmp .line button,#empl .line button{min-width:92px;min-height:44px}
#duelMsg{min-height:18px;color:var(--warn)!important}

/* ---------- combat ---------- */
#combat{display:flex;flex-direction:column;gap:8px}
/* toi à gauche, l'adversaire à droite, le chrono entre les deux */
.duel{display:grid;grid-template-columns:1fr 62px 1fr;gap:8px;align-items:center;flex:none}
.side{min-width:0}
.side>b{display:block;font-family:var(--fh);font-weight:600;font-size:15px;line-height:1.15;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:4px}
.tagrow{display:flex;align-items:baseline;justify-content:space-between;gap:6px}
.tag{display:inline-flex;align-items:center;gap:5px;font-size:12px;font-weight:800;letter-spacing:.02em;white-space:nowrap;text-transform:uppercase}
.side.me .tag{color:var(--me)}
.side.foe{text-align:right}
.side.foe .tag{color:var(--foe)}
.pc{font-family:var(--fh);font-weight:600;font-size:13px;font-variant-numeric:tabular-nums}
/* jamais la couleur seule : pastille ronde pour toi, losange pour l'adversaire, et sa barre est hachurée */
.idm,.idf{display:inline-block;flex:none;width:10px;height:10px;background:var(--me);border-radius:50%}
.idf{background:var(--foe);border-radius:2px;transform:rotate(45deg) scale(.9)}
.side .bar{height:12px;border-radius:6px;box-shadow:inset 0 0 0 1px var(--line)}
.side .bar>i{border-radius:6px}
.side.foe .bar>i{margin-left:auto;background:repeating-linear-gradient(135deg,var(--foe) 0 5px,var(--foe-raye) 5px 8px)}
.core{height:4px!important;box-shadow:none!important}
.core>i{background:#e6eef7!important}
.corerow{display:flex;align-items:center;gap:5px;font-size:12px;font-weight:700;color:var(--mut);margin-top:3px}
.corerow .bar{flex:1;margin:0}
.foe .corerow{flex-direction:row-reverse}
.timer{position:relative;width:62px;height:62px;display:grid;place-items:center}
.timer svg{position:absolute;inset:0}
.timer b{font-family:var(--fh);font-weight:600;font-size:24px;line-height:1;position:relative;margin-top:-8px;font-variant-numeric:tabular-nums}
.timer small{display:none}   /* « sec. » en 8,5 points : illisible, et le cercle se comprend sans lui */
.timer.late b{color:var(--warn)}
#arwrap{position:relative;margin:0 auto;flex:none}
#ar{border-radius:20px}
.alert{position:absolute;left:8px;right:8px;top:8px;display:flex;align-items:center;gap:8px;padding:7px 12px;border-radius:12px;background:rgba(40,30,8,.86);border:1px solid rgba(251,191,36,.45);color:var(--warn);font-size:13px;font-weight:800;pointer-events:none}
.alert svg{width:18px;height:18px;flex:none}
/* pause : toucher la boîte, ou la croix (qui demande alors confirmation avant de quitter) */
.pausebox{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:min(260px,86%);display:flex;flex-direction:column;gap:10px;padding:16px;border-radius:18px;background:rgba(15,28,43,.94);border:1px solid var(--line);text-align:center;box-shadow:0 12px 40px rgba(0,0,0,.5)}
.pausebox h2{font-size:22px}
/* fil d'événements : les trois derniers, le plus récent en haut */
.feed{margin:0;padding:7px 12px;flex:none;height:76px;overflow:hidden}
.feed li{display:flex;gap:8px;align-items:center;font-size:12.5px;font-weight:700;line-height:1.2;padding:2.5px 0;list-style:none;white-space:nowrap}
.feed li span{overflow:hidden;text-overflow:ellipsis}
.feed li time{font-family:var(--fh);font-weight:500;color:var(--mut);width:30px;flex:none}
.feed li:nth-child(n+2){opacity:.72}
.feed li:nth-child(n+3){opacity:.5}
.feed .vide{color:var(--mut);font-weight:600;white-space:normal}
.idn{display:inline-block;flex:none;width:10px;height:10px;border-radius:2px;background:var(--warn)}
.ctl{display:flex;gap:8px;align-items:center;flex:none}
.ctl .iconbtn{width:44px;height:44px}
.ctl .iconbtn svg{width:20px;height:20px}
.spd{display:flex;gap:4px;padding:4px;background:var(--well);border:1px solid var(--line);border-radius:14px}
.spd button{width:42px;height:36px;min-height:0!important;padding:0;border-radius:10px;border:0;background:none;box-shadow:none;font-family:var(--fh);font-weight:600;font-size:15px;color:var(--mut)}
.spd button.on{background:var(--panel2);color:var(--txt);box-shadow:inset 0 0 0 1.5px var(--me)}
#spd{flex:1}#spd button{flex:1;width:auto;height:40px}   /* sans le bouton « Résumé », les vitesses prennent toute la place */

/* ---------- résultat : ai-je gagné, pourquoi, et que changer ? ---------- */
/* L'écran tient dans la hauteur visible, badge de l'hébergeur déduit (22 novembre) : le verdict en haut et les boutons en bas
   restent toujours à l'écran ; entre les deux, le résumé défile seul s'il ne tient pas (petit écran, détail ouvert). */
#resultat{display:flex;flex-direction:column;gap:8px;overflow:hidden;height:calc(100vh - 16px - var(--bas) - var(--sh) - var(--sb));height:calc(100dvh - 16px - var(--bas) - var(--sh) - var(--sb))}
/* Page de fin de chapitre (docs/10 §3.3 à 3.6) : une page du carnet posée sur le résultat, au centre, loin du badge en bas */
.chapitre-fin{position:fixed;inset:0;z-index:20;display:flex;align-items:center;justify-content:center;padding:16px 16px calc(80px + var(--bas,0px));background:rgba(6,12,20,.86)}
.chapitre-fin-page{width:100%;max-width:360px;background:var(--panel);border:1px solid var(--line);border-radius:18px;padding:20px 18px;display:flex;flex-direction:column;gap:10px;text-align:center}
.chapitre-fin-page h2{margin:0;font-family:var(--fh);font-weight:600;font-size:22px;color:var(--me,#2dd4bf)}
.chapitre-fin-page p{margin:0;font-size:16px;line-height:1.4}
.chapitre-fin-page p+p{font-style:italic;color:var(--mut)}
.chapitre-fin-page button{margin-top:6px;min-height:48px}
#resultat .defile{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;display:flex;flex-direction:column;gap:8px;margin:0 -4px;padding:0 4px 2px}
.win{text-align:center;flex:none;padding-top:2px}
.win h2{font-size:34px;color:var(--me);text-shadow:0 0 28px rgba(var(--me-rgb),.5);display:inline-flex;align-items:center;gap:10px}
.win h2 b{font-weight:600}
.win h2 span{width:34px;height:34px;border-radius:50%;background:var(--me);color:var(--ink);display:grid;place-items:center;text-shadow:none}
.win h2 span svg{width:21px;height:21px;stroke-width:2.6}
.win p{margin:2px 0 0;font-size:13.5px;font-weight:700;color:var(--mut)}
/* la défaite : une croix et le rose ; l'égalité : un signe égal en gris */
.win.perdu h2{color:var(--foe);text-shadow:0 0 28px rgba(var(--foe-rgb),.45)}
.win.perdu h2 span{background:var(--foe);color:var(--foe-ink)}
.win.nul h2{color:var(--mut);text-shadow:none}
.win.nul h2 span{background:var(--mut);color:var(--bg)}
.vs{display:grid;grid-template-columns:1fr 46px 1fr;align-items:center;flex:none}
.vs .c{display:flex;flex-direction:column;align-items:center;text-align:center;padding:6px 6px 9px;min-width:0}
.vs .c canvas{margin:2px 0}
.vs .c.gagnant{border-color:rgba(var(--me-rgb),.55);box-shadow:0 0 24px rgba(var(--me-rgb),.14)}
.vs .c.foe.gagnant{border-color:rgba(var(--foe-rgb),.55);box-shadow:0 0 24px rgba(var(--foe-rgb),.14)}
.vs .c b{font-family:var(--fh);font-weight:600;font-size:15px;line-height:1.1;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.vs .c small{font-size:12px;font-weight:700;color:var(--mut)}
.vs .c.me .tag{color:var(--me)}
.vs .c.foe .tag{color:var(--foe)}
.vs .mid{text-align:center;font-family:var(--fh);font-weight:600;font-size:16px;color:var(--mut)}
.vs .mid small{display:block;font-family:var(--fb);font-size:12px;font-weight:800;white-space:nowrap}
.sum{display:grid;grid-template-columns:1fr 1fr;gap:9px;flex:none}
.sum .card{padding:9px 12px;min-width:0}
.sum h3{font-size:13.5px;font-weight:600;margin-bottom:4px;display:flex;align-items:center;gap:6px}
.dm{margin-top:5px}
.dm div:first-child{display:flex;justify-content:space-between;gap:6px;font-size:12px;font-weight:800;margin-bottom:2px;white-space:nowrap}
.dm .bar{height:8px}
.dm .bar.foe>i{background:repeating-linear-gradient(135deg,var(--foe) 0 5px,var(--foe-raye) 5px 8px)}
.dm .bar.warn>i{background:var(--warn)}
.sum .rien{font-size:12px;font-weight:700;color:var(--mut);margin-top:5px;line-height:1.3}
.tip{display:flex;gap:10px;align-items:flex-start;padding:9px 12px;flex:none;border-color:rgba(251,191,36,.4);background:linear-gradient(90deg,rgba(251,191,36,.10),rgba(251,191,36,.02))}
.tip svg{width:20px;height:20px;color:var(--warn);margin-top:1px;flex:none}
.tip p{margin:0;font-size:12.5px;font-weight:700;line-height:1.35}
.prog{display:flex;align-items:center;gap:10px;padding:8px 12px;flex:none}
.prog b{font-family:var(--fh);font-weight:600;font-size:15px;white-space:nowrap}
.prog .pas{flex:1;display:grid;grid-auto-flow:column;grid-auto-columns:1fr;gap:3px;height:10px}
.prog .pas i{border-radius:3px;background:#0a111b;box-shadow:inset 0 0 0 1px var(--line)}
.prog .pas i.o{background:var(--me);box-shadow:0 0 6px rgba(var(--me-rgb),.35)}
.prog .pas i.neuf{background:var(--bio)}
.prog .tot{font-size:12px;font-weight:700;color:var(--mut);white-space:nowrap}
/* étoiles : icône SVG (le caractère ★ change de dessin d'un téléphone à l'autre) ; grises tant qu'elles ne sont pas gagnées,
   couleur Lait ensuite (pas d'ambre, qui veut dire danger : direction artistique §2.4), vertes et qui battent au moment où on les gagne */
i.et{font-style:normal;color:#2a3a4d;display:inline-block;line-height:1}
i.et svg{display:block;width:1.05em;height:1.05em;stroke:#0b1420;stroke-width:.6}
i.et.o{color:var(--txt);filter:drop-shadow(0 0 4px rgba(230,238,247,.35))}
i.et.neuf{color:var(--bio);animation:etoile .6s ease-out 2}
@keyframes etoile{50%{transform:scale(1.35)}}
@media (prefers-reduced-motion:reduce){i.et.neuf{animation:none}}
#foeLab{cursor:pointer}#foeLab .ets{letter-spacing:1px}
.etoiles{padding:8px 12px;flex:none}
/* la note du carnet : une annotation à la main, en marge du verdict */
.win p.carnet{margin-top:6px;font-style:italic;font-weight:600;color:var(--txt);opacity:.85;font-size:13.5px}
.win p.carnet:empty{display:none}
/* le détail du combat, replié par défaut */
.detail{padding:0 12px;flex:none}
.detail summary{cursor:pointer;min-height:44px;display:flex;align-items:center;font-family:var(--fh);font-weight:600;font-size:14px;list-style:none}
.detail summary::-webkit-details-marker{display:none}
.detail summary::after{content:'';margin-left:auto;width:8px;height:8px;border-right:2px solid var(--mut);border-bottom:2px solid var(--mut);transform:rotate(45deg);transition:transform .2s}
.detail[open] summary::after{transform:rotate(-135deg)}
.detail canvas{display:block;margin:2px auto 0}
.detail .leg{margin:4px 0 0;font-size:12px;color:var(--mut);line-height:1.35}
.detail .leg i{vertical-align:-1px;margin-right:3px}
.detail .vide{margin:8px 0 0;font-size:12.5px;font-weight:700;line-height:1.35}
.detail .vide:empty{display:none}
.armes2{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:8px 0 12px}
.armes2 h3{font-size:13px;font-weight:600;margin:0 0 4px}
.armes{list-style:none;margin:0;padding:0;display:grid;gap:3px}
.armes li{font-size:12px;line-height:1.3;display:flex;flex-direction:column}
.armes li b{font-weight:800}
.armes li span{color:var(--mut)}
.armes li.vide{opacity:.6}
.armes2 .rien{font-size:12px;color:var(--mut);margin:0}
.etoiles h3{margin:0 0 4px;font-family:var(--fh);font-weight:600;font-size:14px;display:flex;justify-content:space-between;gap:8px;align-items:baseline}
.etoiles h3 small{font-family:var(--fb);font-size:12px;font-weight:700;color:var(--mut);white-space:nowrap}
.etoiles ul{list-style:none;margin:0;padding:0;display:grid;gap:2px}
.etoiles li{display:flex;gap:8px;align-items:baseline;font-size:13px;color:var(--mut)}
.etoiles li.o{color:var(--txt)}
.etoiles li i.et{width:14px;align-self:center}
.etoiles h3 small i.et{vertical-align:-.15em;margin:0 1px}
.etoiles em{font-style:normal;font-weight:800;color:var(--bio);font-size:12px}
/* une seule rangée : « Revoir » et « Ajuster » en petits boutons (icône sur le mot), le bouton principal prend le reste */
.acts{display:flex;gap:8px;flex:none;padding-bottom:4px}
.acts .btn.sec{flex:none;flex-direction:column;gap:1px;min-width:66px;padding:5px 8px;font-size:13px}
.acts .btn.go{flex:1;min-width:0;min-height:50px}
.acts .btn svg{width:18px;height:18px}

#rot{display:none}
@media (orientation:landscape) and (max-height:480px){.app{display:none}#rot{display:flex;height:100vh;align-items:center;justify-content:center;padding:24px;text-align:center;font-size:17px}}
@media (prefers-reduced-motion:reduce){.btn:active{transform:none}.bar>i{transition:none}}
/* Écran court (360×640) : avec les textes à 12 points l'atelier dépassait de 10 points. On y retire le sous-titre des comportements. */
@media (max-height:680px){.beh button small{display:none}#atelier{gap:4px}}
.tagrow .pc{white-space:nowrap}
/* liens discrets vers la page d'informations */
.ttl small a,.pied a{color:var(--mut);text-decoration:underline;text-underline-offset:2px}
.pied{margin:0;text-align:center;font-size:12.5px;padding-bottom:4px}
/* ---------- Page d'informations (infos.html) ---------- */
.page{max-width:560px;margin:0 auto;padding:calc(16px + var(--sh)) calc(16px + var(--sd)) calc(96px + var(--sb)) calc(16px + var(--sg))}
.page h1{font-size:30px;margin:14px 0 8px}
.page h2{font-size:20px;margin:26px 0 8px}
.page p,.page li{font-size:15px;line-height:1.5;font-weight:600;color:var(--txt)}
.page ul{padding-left:20px;margin:8px 0}
.page li{margin-bottom:8px}
.page a{color:var(--me)}
.page a.btn{color:var(--txt);text-decoration:none;display:inline-flex}
.page form{display:flex;flex-direction:column;gap:8px}
.page label{font-size:14px;font-weight:800;color:var(--mut)}
.page textarea,.page input,.page select{font:inherit;font-size:16px;color:var(--txt);background:var(--well);border:1px solid var(--line);border-radius:12px;padding:10px 12px;width:100%}
.page input[type=checkbox]{width:22px;height:22px;padding:0;margin:0 8px 0 0;vertical-align:middle;accent-color:var(--me)}   /* pas en pleine largeur : la case reste contre son libellé */
.page textarea:focus,.page input:focus,.page select:focus{outline:2px solid var(--me);outline-offset:1px}
.page #avisEtat,.page #effacerEtat{min-height:22px;margin:0;color:var(--warn)}
.page select{min-height:44px;margin-top:4px}

/* ---------- Écrans de l'application : accueil, collection, ligue et boutique (maquette 03-accueil ; 22 novembre) ----------
   Chaque écran prend la hauteur visible moins la barre du bas (58 points et 6 d'écart). La barre se pose sous l'écran,
   donc au-dessus de la bande laissée au badge de l'hébergeur (--bas) : elle ne le recouvre jamais et n'est jamais recouverte. */
.ecran{position:relative;display:flex;flex-direction:column;gap:8px;height:calc(100vh - 16px - var(--bas) - var(--sh) - var(--sb) - 64px);height:calc(100dvh - 16px - var(--bas) - var(--sh) - var(--sb) - 64px);min-height:420px}
.ehead{display:flex;align-items:center;gap:8px;flex:none;min-height:44px}
.ttl.grow{flex:1;min-width:0}
/* ce qui n'existe pas encore : bord en tirets, texte pâli, un cadenas ; jamais de faux chiffre */
.card.ferme{border-style:dashed;background:rgba(19,33,50,.55)}
.card.ferme b{color:var(--mut)}
.saison,#collection .card.ferme{display:flex;align-items:center;gap:10px;padding:7px 12px;flex:none}
.saison .g,#collection .card.ferme .g{width:32px;height:32px;border-radius:50%;display:grid;place-items:center;background:var(--well);color:var(--mut);font-size:17px;flex:none}
.saison b,#collection .card.ferme b{font-family:var(--fh);font-weight:600;font-size:15px;display:block;line-height:1.2}
.saison small,#collection .card.ferme small{display:block;font-size:12px;color:var(--mut);font-weight:700;line-height:1.3}
/* ta cellule dans sa boîte, avec la plaque de son nom */
.hero{position:relative;flex:1;min-height:150px;border-radius:24px;overflow:hidden;border:1px solid var(--line);
  background:radial-gradient(circle at 50% 40%,#16324a 0%,#12283a 55%,#0f2032 100%);box-shadow:inset 0 0 50px rgba(45,212,191,.12)}
.hero canvas{position:absolute;left:0;top:4px;margin:0}
.plate{position:absolute;left:10px;right:10px;bottom:10px;display:flex;align-items:center;gap:10px;background:rgba(11,20,32,.92);border:1px solid var(--line);border-radius:14px;padding:5px 6px 5px 14px}
.plate .grow{min-width:0}
.plate b{font-family:var(--fh);font-weight:600;font-size:17px;line-height:1.15;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.plate small{font-size:12px;color:var(--mut);font-weight:700;display:flex;align-items:center;gap:4px;white-space:nowrap}
.plate small svg{width:14px;height:14px;flex:none}
.plate small svg:last-of-type{color:var(--warn)}
.plate .btn{flex:none;min-height:44px}
.plate .btn svg{width:16px;height:16px}
.btn.big{flex:none;flex-direction:column;gap:2px;font-size:22px;padding:9px 18px;border-radius:18px;min-height:60px}
.btn.big small{display:block;font-family:var(--fb);font-size:12.5px;font-weight:700;color:var(--ink);opacity:.8}
.two{display:grid;grid-template-columns:1fr 1fr;gap:8px;flex:none}
.tile{display:flex;flex-direction:column;align-items:stretch;gap:3px;padding:9px 12px;text-align:left;color:var(--txt);min-height:44px;font:inherit}
button.card.tile{background:var(--panel);border-radius:18px;cursor:pointer}
.tile .lab{display:flex;align-items:center;gap:5px}
.tile .lab svg{width:14px;height:14px}
.tile b{font-family:var(--fh);font-weight:600;font-size:15px;line-height:1.2}
.tile .bar{display:block;height:6px}
.tile small{display:flex;align-items:center;gap:4px;font-size:12px;color:var(--mut);font-weight:700;line-height:1.3}
.tile small svg{width:13px;height:13px;color:var(--txt)}   /* étoile blanche, comme les étoiles gagnées partout ailleurs */
/* barre du bas : l'onglet actif en couleur et par une languette, jamais par la couleur seule ; un cadenas sur la ligue et la boutique */
#nav{display:flex;gap:2px;height:58px;margin-top:6px;padding:3px;background:#0d1826;border:1px solid var(--line);border-radius:18px}
#nav button{position:relative;flex:1;min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;padding:2px 0;border:0;background:none;border-radius:13px;box-shadow:none;font-size:12px;font-weight:800;color:var(--mut);letter-spacing:-.1px;white-space:nowrap;overflow:hidden}
#nav .ni{position:relative;font-size:22px;line-height:1;display:block}
#nav .ni svg{display:block}
#nav .cad{position:absolute;right:-8px;bottom:-4px;font-size:12px;line-height:1;color:var(--warn);background:#0d1826;border-radius:50%;padding:1px}
#nav button.on{color:var(--me);background:rgba(var(--me-rgb),.08)}
#nav button.on::before{content:"";position:absolute;top:0;left:50%;margin-left:-15px;width:30px;height:4px;border-radius:0 0 4px 4px;background:var(--me);box-shadow:0 0 10px var(--me)}
/* collection : quatre chapitres de dix spécimens ; ceux qui ne sont pas encore rencontrés en silhouette */
#collection .defile{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;margin:0 -4px;padding:0 4px 4px}
#collTot{white-space:normal}
.chap h2{display:flex;justify-content:space-between;align-items:baseline;gap:8px;font-size:17px;margin:6px 0 6px}
.chap h2 small{font-family:var(--fb);font-size:12px;font-weight:700;color:var(--mut)}
.specs{display:grid;grid-template-columns:repeat(4,1fr);gap:5px}   /* quatre de front : à cinq, « Canonnière » se coupait en deux */
.spec{display:flex;flex-direction:column;align-items:center;gap:1px;padding:4px 2px 5px;min-width:0;min-height:44px;border-radius:12px;background:var(--panel)}
.spec canvas{margin:0}
.spec b{font-family:var(--fb);font-weight:800;font-size:12px;line-height:1.15;text-align:center;min-height:2.3em;max-width:100%;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.spec .ets{display:flex;gap:1px;font-size:11px;color:var(--mut)}
.spec .ets svg{width:11px;height:11px}
.spec.ombre{border-style:dashed;background:transparent}
.spec.ombre b{color:var(--mut)}
.spec.neuf:not(.ombre){border-color:rgba(251,191,36,.55)}
#collDet{position:absolute;left:0;right:0;bottom:0;margin:0;z-index:5;background:#111d2d;box-shadow:0 -8px 24px rgba(0,0,0,.45);max-height:100%;overflow-y:auto}
#collDet h2{margin:0;font-size:20px}
#collDet .chapo{margin:2px 0 6px;font-size:12.5px;font-weight:700;color:var(--mut)}
#collDet p{margin:0 0 8px;font-size:14px;line-height:1.4}
.etl{list-style:none;margin:0 0 8px;padding:0;display:grid;gap:3px}
.etl li{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--mut)}
.etl li.o{color:var(--txt)}
.etl li svg{width:14px;height:14px}
#collDet .line{display:flex;gap:5px;margin-top:5px}
#collDet .line button{min-height:44px}
/* conteneurs de la ligue et de la boutique (contenu : équipe Art, src/ecrans.js) : ils défilent seuls, la barre reste en place */
#ligue,#boutique{overflow-y:auto;overscroll-behavior:contain;   /* même hauteur que les autres écrans : la règle .ecran-ligue (height:100%) ne doit pas la défaire */
  height:calc(100vh - 16px - var(--bas) - var(--sh) - var(--sb) - 64px);height:calc(100dvh - 16px - var(--bas) - var(--sh) - var(--sb) - 64px)}
#ligue.hide,#boutique.hide{display:none}
/* ligue et boutique sans src/ecrans.js : ce que ce sera, ce qui manque */
.vcorps{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;text-align:center;padding:0 4px}
.vico{position:relative;font-size:54px;line-height:1;color:var(--mut)}
.vico svg{display:block}
.vico i{position:absolute;right:-12px;bottom:-6px;font-size:26px;color:var(--warn);background:var(--bg);border-radius:50%;padding:2px}
.vmsg{margin:4px 0 0;font-family:var(--fh);font-weight:600;font-size:20px;line-height:1.25}
.vliste{list-style:none;margin:0;padding:0;display:grid;gap:7px;max-width:400px;text-align:left}
.vliste li{padding:9px 12px;border:1px dashed var(--line);border-radius:12px;font-size:14px;line-height:1.4;color:var(--mut)}
@media (max-height:680px){.ecran{gap:6px}.saison small{display:none}.btn.big{min-height:54px;padding:7px 16px;font-size:20px}}

/* ---------- Vague 4 (22 novembre) : chaque écran au plus près de sa maquette (docs/prototypes/03 à 09) ---------- */
/* en-tête commun de l'accueil et de la collection : ta cellule, son nom, le carnet ; monnaies grisées, cadenas, sans chiffre */
.entete{display:flex;align-items:center;gap:7px;height:52px;margin-bottom:6px}
.entete.hide{display:none}
.entete .ava{width:44px;height:44px;flex:none;border-radius:50%;background:var(--well);border:2px solid var(--me);display:grid;place-items:center;overflow:hidden}
.entete .ava canvas{margin:0}
.entete .who{flex:1;min-width:0}
.entete .who b{display:block;font-family:var(--fh);font-weight:600;font-size:16px;line-height:1.15;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.entete .who small{display:block;font-size:12px;font-weight:700;color:var(--mut);white-space:nowrap}
.pill{display:inline-flex;align-items:center;gap:3px;height:44px;padding:0 9px;border-radius:22px;background:var(--well);border:1px solid var(--line);color:var(--mut);flex:none;font-size:18px}
.pill.ferme{border-style:dashed;opacity:.75}
.pill .pk{font-size:12px;color:var(--mut)}
.pill .pi svg,.pill .pk svg{display:block}
#accueil,#collection{height:calc(100vh - 16px - var(--bas) - var(--sh) - var(--sb) - 122px);height:calc(100dvh - 16px - var(--bas) - var(--sh) - var(--sb) - 122px)}
.toast{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(var(--bas) + var(--sb) + 76px);z-index:20;max-width:min(92vw,420px);margin:0;padding:10px 14px;border-radius:14px;
  background:#1b2d42;border:1px solid rgba(251,191,36,.5);color:var(--txt);font-size:14px;font-weight:700;text-align:center;box-shadow:0 8px 24px rgba(0,0,0,.5)}
.toast.hide{display:none}
#nav button[aria-disabled="true"]{opacity:.7}
/* accueil : la boîte de Petri ronde, la plaque du nom à cheval sur son bas, la carte des défenses verrouillée */
.hero{border:0;background:none;box-shadow:none;overflow:visible}
.hero .dish{position:absolute;top:0;border-radius:50%;background:radial-gradient(circle at 50% 45%,#16324a 0%,#12283a 58%,#0f2032 100%);
  box-shadow:0 0 0 4px #3b5878,0 0 0 5px rgba(230,238,247,.12),inset 0 0 50px rgba(45,212,191,.16),0 14px 34px rgba(0,0,0,.45)}
.hero .dish::before{content:"";position:absolute;inset:10px;border-radius:50%;border:1px dashed rgba(142,163,184,.22)}
.hero .plate{left:50%;right:auto;transform:translateX(-50%);bottom:0;width:max-content;max-width:calc(100% - 20px)}
.defs{display:flex;align-items:center;gap:10px;padding:7px 12px;flex:none}
.defs .g{width:32px;height:32px;border-radius:50%;display:grid;place-items:center;background:var(--well);color:var(--mut);font-size:17px;flex:none}
.defs b{font-family:var(--fh);font-weight:600;font-size:15px;display:block;line-height:1.2}
.defs small{display:block;font-size:12px;color:var(--mut);font-weight:700}
#accueil .pied{flex:none;margin:0}
@media (max-height:680px){.defs small,#accueil .pied{display:none}.defs{padding:4px 12px}}
/* atelier : « ‹ Atelier » et la cellule ouverte ; Tourner dans la fiche ; palette en cartes sur deux rangées qui défilent ;
   « COMPORTEMENT » ; « Défi » et « Lâcher dans la boîte » en bas */
.head .ttl.atl{flex:1;min-width:0;font-size:20px}
.head .ttl.atl small{overflow:hidden;text-overflow:ellipsis}
.cta .iconbtn{align-self:stretch;height:auto;width:44px}
#atelier{gap:3px}
.behlab{margin-bottom:-1px}
.cta #fight{padding-left:6px;padding-right:6px;font-size:15px;min-width:0}
/* le texte du bouton tient en entier (vague 7 : il était coupé aux deux bouts en anglais) : sur deux lignes au besoin, jamais coupé */
.cta #fight span{display:flex;flex-direction:column;align-items:center;width:100%;white-space:normal;line-height:1.1;text-align:center}
.cta #fight small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.cta #duelBtn{padding-left:12px;padding-right:12px}
#turnG svg{width:16px;height:16px}
.pal{grid-template-columns:none;grid-template-rows:repeat(2,52px);grid-auto-flow:column;grid-auto-columns:calc((100% - 16px)/5.3);overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x proximity;scrollbar-width:none;position:relative}
.pal::-webkit-scrollbar{display:none}
.pal button{height:52px;scroll-snap-align:start;justify-content:flex-start;padding-top:3px}
.pal button small{position:static;justify-content:center;margin-top:1px}
.behlab{margin:0;flex:none;line-height:1.1}
.cta #fight{flex-direction:column}
.cta #fight small{display:block;font-family:var(--fb);font-size:12px;font-weight:700;color:var(--ink);opacity:.75}
.cta #fight span{display:flex;flex-direction:column;align-items:center}
/* combat : « Passer au résumé » à côté des vitesses, la légende des états sous la boîte */
#spd{flex:1 1 auto;min-width:0}
#passerRes{flex:none;min-height:44px;padding:6px 10px;font-size:13px;white-space:normal;line-height:1.1;max-width:112px}
.legende{display:flex;justify-content:space-around;margin:0;flex:none;font-size:12px;font-weight:700;color:var(--mut)}
.legende span{display:flex;align-items:center;gap:5px}
.legende canvas{margin:0}
@media (max-height:680px){.legende{display:none}}
/* résultat : « Revoir » et « Ajuster » côte à côte, puis le bouton principal sur toute la largeur (maquette 06) */
.acts{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.acts .btn.sec{flex-direction:row;gap:6px;font-size:15px;padding:8px 10px;min-height:44px}
.acts .btn.go{grid-column:1/3;min-height:48px}
.acts:has(#edit.hide) #again{grid-column:1/3}

/* ---------- Vague 4, au pixel : les valeurs de docs/prototypes/03-accueil.html, recopiées (écran de 390 × 844) ----------
   Le jeu a 16 points de marge sur les côtés comme la maquette (12 de la page + 4 ici). Seule la hauteur de la boîte varie :
   292 points comme la maquette quand l'écran le permet, moins sur un écran plus court ou avec le badge de l'hébergeur. */
#ent,#accueil,#collection{margin-left:4px;margin-right:4px}
.entete{height:60px;margin:0;padding:6px 0 10px;gap:8px}
.entete .ava{width:44px;height:44px}
.entete .who small{font-size:12px}
.pill{height:32px;padding:0 9px 0 6px;border-radius:16px;font-size:20px;gap:4px}
.entete .iconbtn{width:32px;height:32px;border-radius:16px;font-size:16px;position:relative}
.entete .iconbtn::after{content:'';position:absolute;inset:-6px}   /* dessin de 32 comme la maquette, zone de toucher de 44 (essai du 22 nov.) */
.entete .iconbtn svg{width:17px;height:17px}
#accueil,#collection{height:calc(100vh - 16px - var(--bas) - var(--sh) - var(--sb) - 136px);height:calc(100dvh - 16px - var(--bas) - var(--sh) - var(--sb) - 136px)}
#accueil{gap:11px}
/* le Milieu de la saison (ici verrouillé) : bandeau de 60 points, rond de 34 */
.saison{min-height:60px;padding:9px 12px;border-radius:16px;gap:10px}
.saison .g{width:34px;height:34px;font-size:19px}
.saison b{font-size:15px;line-height:1.2}
/* la boîte : 292 de haut, disque de 282, plaque à cheval sur le bas */
.hero{flex:0 1 292px;min-height:150px}
.hero .plate{bottom:-4px;gap:10px;border-radius:14px;padding:6px 8px 6px 14px;background:rgba(11,20,32,.9)}
.hero .plate b{font-size:18px;line-height:1.1}
.hero .plate .btn{min-height:0}
.hero .dish::after{content:"";position:absolute;left:12%;top:9%;width:33%;height:16%;border-radius:50%;border-top:3px solid rgba(255,255,255,.2);transform:rotate(-32deg)}
/* défenses (verrouillées) : carte de 65, pastille carrée arrondie de 36 */
.defs{min-height:65px;padding:12px 14px;gap:10px;border-radius:18px}
.defs .g{width:36px;height:36px;border-radius:12px;font-size:20px}
.defs b{font-family:var(--fb);font-weight:800;font-size:14px;line-height:1.25}
/* Combattre : 69 de haut, texte de 23, rayon 20 */
#accueil .btn.big{min-height:69px;font-size:23px;padding:14px 20px;border-radius:20px}
#accueil .btn.big small{font-size:12px;margin-top:1px;opacity:.82}
/* carnet et pass : tuiles de 78, écart de 10 */
#accueil .two{gap:10px}
#accueil .two.un{grid-template-columns:1fr}   /* 23 novembre : seul le Pass verrouillé reste, sur toute la largeur */
#accueil .tile{min-height:78px;padding:10px 12px;gap:0}
#accueil .tile .lab{font-size:12px}
#accueil .tile b{margin:2px 0 6px;font-size:15px}
#accueil .tile .bar{height:10px;border-radius:6px}
/* la barre du bas : 76 de haut, collée en bas, trait du haut, languette sous le bord (maquette) */
#nav{height:76px;margin:0 -12px;padding:6px 8px 16px;border:0;border-top:1px solid var(--line);border-radius:0;background:#0d1826}
#nav button{border-radius:0;background:none!important;gap:1px;overflow:visible}
.toast{bottom:calc(var(--bas) + var(--sb) + 92px)}
#nav .ni{font-size:24px}
#nav button.on::before{top:-7px}
#atlBio{flex:none}
/* vague 5 : les monnaies dessinées comme dans la maquette, grisées tant qu'elles n'existent pas */
.pill.ferme .pi{filter:grayscale(.65);opacity:.7}
/* menu : un panneau qui glisse depuis la droite, sur un voile ; lignes de 48 points */
.menufond{position:fixed;inset:0;z-index:30;background:rgba(4,10,18,.6)}
.menu{position:fixed;top:0;right:0;bottom:0;z-index:31;width:min(320px,88vw);overflow-y:auto;overscroll-behavior:contain;
  padding:calc(10px + var(--sh)) 16px calc(16px + var(--sb) + var(--bas));background:#111d2d;border-left:1px solid var(--line);box-shadow:-12px 0 32px rgba(0,0,0,.5)}
.menufond.hide,.menu.hide{display:none}
.mhead{display:flex;align-items:center;justify-content:space-between;margin-bottom:6px}
.mhead h2{font-size:22px}
.mgr{margin-top:10px}
.mgr h3{margin:0 0 4px;font-family:var(--fb);font-size:12px;font-weight:800;color:var(--mut);text-transform:uppercase;letter-spacing:.08em}
.mrow{display:flex;align-items:center;gap:12px;width:100%;min-height:48px;padding:0 4px;border:0;border-bottom:1px solid var(--line);border-radius:0;background:none;
  color:var(--txt);font:inherit;font-size:15px;font-weight:700;text-align:left;text-decoration:none;cursor:pointer}
.mrow input[type=checkbox]{width:22px;height:22px;margin:0;accent-color:var(--me);flex:none}
.msel{justify-content:space-between}
.msel select{font:inherit;font-size:14px;color:var(--txt);background:var(--well);border:1px solid var(--line);border-radius:10px;padding:7px 8px;max-width:58%}
.mlien::after{content:'›';margin-left:auto;color:var(--mut);font-size:20px}
/* Vague 7 : dans l'application Android, Chrome dessine d'un bord à l'autre, et 100dvh y vaut toute la hauteur (885), barre de
   gestes comprise, alors que la partie visible (innerHeight) fait 829. La page dépassait de 56 points et la barre du bas passait
   sous la barre de gestes. --hv est la hauteur visible, posée par client.js (innerHeight, mise à jour au redimensionnement) ;
   100dvh ne sert plus que de repli. */
body{min-height:var(--hv,100dvh)}
/* écran de titre (vague 8) : fond Nuit et icône de la cellule, comme l'écran de départ de l'application Android */
.titre{position:fixed;inset:0;z-index:60;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;padding:24px;
  background:radial-gradient(520px 420px at 50% 42%,rgba(45,212,191,.14),transparent 70%),var(--bg);cursor:default}
.titre.pret{opacity:0;transition:opacity .45s;pointer-events:none}   /* prêt (1,8 s au moins) : fondu vers le jeu, sans toucher */
@media (prefers-reduced-motion:reduce){.titre.pret{transition:none}}
.titre.hide{display:none}
.tlogo{width:min(52vw,40vh,240px);height:auto;filter:drop-shadow(0 0 30px rgba(45,212,191,.45))}
.titre h1{font-family:var(--fh);font-weight:600;font-size:46px;margin:0;color:var(--txt);text-shadow:0 0 26px rgba(45,212,191,.45)}
.tbarre{width:min(60vw,240px);height:6px;border-radius:3px;background:#0a111b;overflow:hidden;box-shadow:inset 0 0 0 1px var(--line);transition:opacity .4s}
.tbarre i{display:block;height:100%;width:0;background:var(--me);transition:width .12s linear}   /* avancée continue (client.js) */
.tgo{margin:0;min-height:48px;padding:10px 26px;font-family:var(--fh);font-weight:600;font-size:20px;color:var(--mut)}
@media (prefers-reduced-motion:reduce){.titre.pret{transition:none}.tbarre i{transition:none}}
/* tutoriel (vague 9) : la mécanique du moteur src/tutoriel.js. Le dessin (voile, trou, bulle, main) est dans la section .tuto-*
   de l'équipe Art, plus bas. Ici : le calque qui porte le tout, les caches qui bloquent les touchers hors de la zone, « Passer ». */
.tuto-racine{position:fixed;inset:0;z-index:55;pointer-events:none}
.tuto-cache{position:absolute;pointer-events:auto;background:transparent;-webkit-tap-highlight-color:transparent}
.tuto-cache.tuto-plein{inset:0;cursor:pointer}
.tuto-racine .tuto-voile{z-index:0}   /* dans le calque du tutoriel, le voile reste sous Pip, la bulle et la main */
.tuto-racine .tuto-guide{pointer-events:none;top:calc(60px + var(--sh,0px));z-index:2}
.tuto-racine .tuto-guide.bas{top:auto}
.tuto-mainbox{position:absolute;pointer-events:none;z-index:3}
.tuto-mainbox .tuto-main{position:static}
.tuto-passer{position:absolute;top:calc(10px + var(--sh,0px));left:12px;   /* à gauche : à droite, il couvrait le bouton Menu que le tutoriel fait toucher */z-index:4;pointer-events:auto;min-height:44px;padding:8px 16px;border-radius:22px;
  background:rgba(11,20,32,.85);border:1px solid var(--line);color:var(--txt);font-family:var(--fh);font-weight:600;font-size:15px}
.tuto-passer.tuto-propose{border-color:var(--warn);box-shadow:0 0 0 3px rgba(251,191,36,.45)}
/* guide : la ligne sous la palette réduite à un organite */
.palnote{margin:0;flex:none;font-size:13px;font-weight:700;color:var(--mut);text-align:center}
#atelier{height:calc(var(--hv,100dvh) - 16px - var(--bas) - var(--sh) - var(--sb) - 76px);min-height:420px}   /* 23 novembre : la barre d'onglets (76) reste sous l'atelier */
/* le menu : le bouton qui le ferme a la forme et la taille du bouton rond qui l'ouvre (en-tête commun, 32 points) */
#menuFerme{width:32px;height:32px;border-radius:16px;font-size:16px}
/* résultat (23 novembre) : il ne reste que le haut et les deux cellules ; elles se centrent, et « Rejouer » et « Accueil »
   se partagent la rangée du bas */
#resultat{justify-content:center;gap:18px}   /* le titre, les cellules, le résumé et les boutons forment un bloc centré dans la hauteur (porteur, 23 nov.) */
/* 23 novembre (porteur) : ni phrase sous le titre, ni note du carnet, ni carte de conseil ; restent le titre, les deux cellules et les dégâts.
   Le texte est toujours calculé (lecteur d'écran via resT, journal local), il n'est plus montré. */
#resSub,#resNote,#resultat .tip{display:none}
/* les trois étoiles du spécimen, sous le titre ; chacune est un bouton de 44 points qui dit sa condition */
.resEts{display:flex;justify-content:center;gap:6px;margin-top:6px}
.resEts.hide{display:none}
.resEts button{width:48px;height:44px;padding:0;border:0;background:none;display:grid;place-items:center;cursor:pointer;font-size:34px}
#resultat .defile{flex:0 1 auto;gap:12px}
#resultat .acts .btn.sec{min-height:48px}
#resultat .acts .btn.go{grid-column:1/3}   /* Rejouer et Modifier sur une rangée, Accueil en dessous, pleine largeur */
#menuFerme svg{width:17px;height:17px}
#resultat{height:calc(var(--hv,100dvh) - 16px - var(--bas) - var(--sh) - var(--sb))}
.ecran{height:calc(var(--hv,100dvh) - 16px - var(--bas) - var(--sh) - var(--sb) - 64px)}
#ligue,#boutique{height:calc(var(--hv,100dvh) - 16px - var(--bas) - var(--sh) - var(--sb) - 64px)}
#accueil,#collection{height:calc(var(--hv,100dvh) - 16px - var(--bas) - var(--sh) - var(--sb) - 136px)}
/* l'atelier aux valeurs de docs/prototypes/04-atelier.html, dès que l'écran a la hauteur de la maquette (800 points et plus).
   En dessous (téléphone de 727 avec le badge, 640), la version resserrée plus haut garde des cases d'au moins 44 points. */
@media (min-height:800px){
  #atelier{gap:8px;margin:0 4px}
  #atelier .head{height:50px;padding:4px 0 8px;gap:10px}
  .head .ttl.atl{font-size:22px}
  #edwrap{flex:1 1 286px;border-radius:20px;margin-top:-8px}   /* la grille suit l'en-tête sans écart, comme dans la maquette */
  .nrj{height:23px}
  .pal{grid-template-rows:repeat(2,76px);gap:6px;grid-auto-columns:calc((100% - 24px)/5)}
  .pal button{height:76px;padding:3px 0 5px;justify-content:flex-start;border-radius:13px}
  .pal button canvas{width:44px!important;height:36px!important}
  .behlab{margin:1px 0 -3px;font-size:12px}
  .beh{gap:6px}
  .beh button{min-height:55px;padding:7px 8px;gap:7px}
  .beh button small{position:static;width:auto;height:auto;overflow:visible;clip:auto;white-space:normal;display:block;font-size:12px}
  .cta{margin:2px -16px 0;padding:10px 16px 12px;gap:10px;background:#0d1826;border-top:1px solid var(--line)}
  .cta .btn{min-height:48px}
}
/* combat aux valeurs de docs/prototypes/05-combat.html (800 points et plus) : croix et titre en haut, barre de commandes pleine largeur */
.chead{display:none}
@media (min-height:800px){
  #combat{margin:0 4px}
  .chead{display:flex;align-items:center;gap:10px;height:50px;padding:4px 0 8px;flex:none}
  .chead .ttl{font-size:18px}
  .chead .chip{font-size:12px}
  .legende{justify-content:space-between;padding:0 6px;font-weight:800}
  .feed{padding:9px 12px;height:89px}
  .ctl{margin:0 -16px;padding:10px 16px 12px;gap:10px;background:#0d1826;border-top:1px solid var(--line)}
  #spd{flex:none;width:138px}
  #passerRes{flex:1;min-width:0;max-width:none;font-size:14px;padding:8px 10px;gap:6px;white-space:normal;line-height:1.15}   /* ne déborde plus à 390 points (22 nov.) */
  #passerRes svg{width:17px;height:17px}
}
/* résultat aux valeurs de docs/prototypes/06-resultat.html (800 points et plus) : verdict de 40, cartes des cellules de 221,
   barre de boutons pleine largeur en bas (deux boutons de 48 côte à côte, le principal de 46 dessous) */
@media (min-height:800px){
  #resultat{margin:0 4px;gap:10px}
  .win h2{font-size:40px}
  .vs .c{min-height:221px;justify-content:center}
  .acts{margin:0 -16px;padding:10px 16px 12px;background:#0d1826;border-top:1px solid var(--line);gap:10px}
  .acts .btn.sec{min-height:48px;font-size:17px}
  .acts .btn.go{min-height:46px}
}

/* ==== Écrans Ligue et Boutique (direction artistique, src/ecrans.js) ====
   Des aperçus : bandeau clair en haut, voile léger sur le reste, « Exemple » partout, aucun bouton actif.
   La liste défile dans l'écran quand le conteneur a une hauteur, sinon la page défile. */
.ecran-ligue,.ecran-boutique{position:relative;display:flex;flex-direction:column;gap:8px;min-height:0;height:100%}
.ec-apercu::after{content:'';position:absolute;inset:0;border-radius:18px;pointer-events:none;background:rgba(11,20,32,.2)}   /* le voile */
.ec-apercu .ec-corps{filter:saturate(.72)}
.ec-bandeau{position:relative;z-index:2;flex:none;display:flex;align-items:center;gap:8px;margin:0;padding:9px 12px;border-radius:14px;
  background:#16304a;border:1px solid #6b86a3;color:var(--txt);font-size:14px;font-weight:800;line-height:1.3}
.ec-bandeau .ec-ic{flex:none;width:18px;height:18px;color:var(--me-l)}
.ecran-ligue>.ec-corps:not(.ec-pied),.ecran-boutique>.ec-corps{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;gap:10px;padding-bottom:4px}
.ec-ex{display:inline-block;margin-left:6px;padding:0 7px;border-radius:999px;border:1px dashed #6b86a3;color:var(--mut);font-family:var(--fb);font-size:12px;font-weight:800;line-height:1.5;vertical-align:2px;letter-spacing:0}
.ec-carte{background:var(--panel);border:1px solid var(--line);border-radius:16px;padding:10px 12px}
.ec-carte h3{display:flex;align-items:center;gap:6px;font-size:16px;margin:0 0 6px}
.ec-carte h3 .ec-ex{margin-left:auto}
.ec-carte h3 .ec-ic{width:18px;height:18px;color:var(--mut)}
.ec-note{margin:8px 0 0;font-size:12px;font-weight:700;color:var(--mut);line-height:1.35}
.ec-ic{flex:none}
/* Ligue : en-tête, échelle des cinq ligues, récompenses, classement, pied */
.ec-tete{display:flex;align-items:center;gap:10px}
.ec-tete h2{font-size:22px;display:flex;flex-direction:column;gap:2px}
.ec-tete h2 small{font-family:var(--fb);font-size:12px;font-weight:700;color:var(--mut)}
.ec-tete h2 small .ec-ex{margin-left:0}
.ec-embleme{flex:none;width:44px;height:48px;display:grid;place-items:center;clip-path:polygon(50% 0,100% 25%,100% 75%,50% 100%,0 75%,0 25%);
  background:linear-gradient(160deg,#a78bfa,#5b3fa8);color:#f5f3ff;font-family:var(--fh);font-size:17px}
.ec-echelle{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:4px;align-items:center}
.ec-echelle li{font-size:12px;font-weight:800;color:var(--mut);padding:2px 8px;border-radius:999px;border:1px solid var(--line)}
.ec-echelle li.on{color:var(--txt);border-color:var(--me);background:var(--me-on)}
.ec-recomp{list-style:none;margin:0;padding:0;display:grid;gap:6px}
.ec-recomp li{display:flex;gap:8px;align-items:flex-start;font-size:13px;color:var(--mut);line-height:1.3}
.ec-recomp li b{display:block;color:var(--txt);font-size:13px}
.ec-recomp .ec-ic{width:18px;height:18px;margin-top:1px}
.ec-recomp li.m .ec-ic{color:var(--bio)}.ec-recomp li.d .ec-ic{color:var(--mut)}
.ec-class ol{list-style:none;margin:0;padding:0;display:grid;gap:2px}
.ec-ligne{display:flex;align-items:center;gap:8px;min-height:40px;padding:2px 8px;border-radius:10px;font-size:14px}
.ec-ligne .r{width:22px;text-align:right;font-family:var(--fh);color:var(--mut)}
.ec-ligne .v{flex:none;width:34px;height:34px}
.ec-ligne .n{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ec-ligne .p{font-size:12px;font-weight:800;color:var(--mut);white-space:nowrap}
.ec-ligne.toi{background:var(--me-on);box-shadow:inset 0 0 0 1.5px var(--me)}
.ec-ligne.toi .n{color:var(--txt);font-weight:800}
.ec-zone{display:flex;align-items:center;gap:6px;margin:4px 0;padding-top:4px;border-top:1.5px dashed #6b86a3;font-size:12px;font-weight:800;color:var(--mut)}
.ec-zone .ec-ic{width:14px;height:14px}
.ec-zone.m{color:var(--bio)}
.ec-pied{flex:none;display:flex;align-items:center;gap:10px;padding:8px 12px;border-radius:16px;background:var(--panel2);border:1px solid var(--line)}
.ec-pied p{flex:1;margin:0;font-size:12px;font-weight:700;color:var(--mut);line-height:1.3}
.ec-pied p b{display:block;color:var(--txt);font-size:14px}
.ec-pied .btn{flex:none;min-height:44px}
.ec-pied .btn .ec-ic{width:16px;height:16px}
/* Boutique : promesse, pass, apparences, offres, garde-fous */
.ec-titre{font-size:22px}
.ec-promesse{display:flex;gap:8px;align-items:flex-start;margin:0;padding:9px 12px;border-radius:14px;background:var(--well);border:1px solid var(--line);font-size:13px;line-height:1.35}
.ec-promesse .ec-ic{width:20px;height:20px;color:var(--me-l)}
.ec-sous{margin:-2px 0 8px;font-size:12px;font-weight:700;color:var(--mut)}
.ec-paliers,.ec-items{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(4,1fr);gap:6px}
.ec-items{grid-template-columns:repeat(2,1fr)}
.ec-paliers li,.ec-items li{display:flex;flex-direction:column;align-items:center;text-align:center;gap:1px;padding:6px 4px;border-radius:12px;background:var(--well);border:1px solid var(--line)}
.ec-items li{flex-direction:row;text-align:left;gap:8px;padding:6px 8px}
.ec-items li svg{flex:none;width:48px;height:48px}
.ec-t{display:flex;flex-direction:column;align-items:flex-start;gap:1px;min-width:0}
.ec-paliers b,.ec-items b{font-size:12px;line-height:1.2}
.ec-paliers small,.ec-items small{font-size:12px;font-weight:700;color:var(--mut);line-height:1.2}
.ec-rare{display:inline-flex;gap:3px;margin-top:3px}
.ec-rare i{width:6px;height:6px;border-radius:50%;background:currentColor}
.ec-prog{display:flex;align-items:center;gap:8px;margin-top:10px;font-size:12px;font-weight:800;color:var(--mut)}
.ec-prog>i{flex:1;height:8px;border-radius:99px;background:#0a111b;box-shadow:inset 0 0 0 1px var(--line)}
.ec-prog b{color:var(--txt)}
.ec-offres,.ec-garde ul{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.ec-offres li,.ec-garde li{display:flex;gap:8px;align-items:flex-start;font-size:13px;color:var(--mut);line-height:1.3}
.ec-offres li b{display:block;color:var(--txt)}
.ec-offres .ec-ic,.ec-garde li .ec-ic{width:18px;height:18px;margin-top:1px;color:var(--me-l)}
.ec-garde li{color:var(--txt)}
@media (max-width:370px){.ec-paliers{grid-template-columns:repeat(2,1fr)}}

/* ==== Écran Collection (direction artistique, src/ecrans.js ; maquette prototypes/08-collection.html) ==== */
/* Valeurs reprises telles quelles de la maquette (titre, onglets, barre, sections, cartes, fiche, lignes du carnet) ;
   seules les tailles de 11 et 11,5 passent à 12 points, plancher du jeu. */
.ecran-collection{position:relative;display:flex;flex-direction:column;min-height:0;height:100%}
.ec-ttl{flex:none;font-family:var(--fh);font-weight:600;font-size:22px;line-height:1.1;margin:0 0 9px}
.ec-tabs{flex:none;display:flex;gap:4px;padding:4px;background:var(--well);border:1px solid var(--line);border-radius:14px;margin-bottom:10px}
.ec-tabs button{flex:1;font-family:var(--fh);font-weight:500;font-size:14px;color:var(--mut);background:none;border:0;border-radius:10px;padding:7px 4px;cursor:pointer;white-space:nowrap}
.ec-tabs button.on{background:var(--panel2);color:var(--txt);box-shadow:inset 0 0 0 1.5px var(--me)}
.ec-scroll{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:none}
.ec-scroll::-webkit-scrollbar{display:none}
.ec-scroll[hidden],.ec-sheet[hidden]{display:none}
.ec-prog{display:flex;align-items:center;gap:10px;margin:2px 0 10px}
.ec-prog b{font-family:var(--fh);font-weight:600;font-size:14px;white-space:nowrap}
.ec-bar{flex:1;height:10px;border-radius:6px;background:#0a111b;overflow:hidden;box-shadow:inset 0 0 0 1px var(--line)}
.ec-bar>i{display:block;height:100%;border-radius:6px;background:var(--me)}
.ec-sect{display:flex;align-items:center;gap:8px;margin:12px 0 8px}
.ec-intro+.ec-sect{margin-top:0}
.ec-lab{font-size:12px;font-weight:800;color:var(--mut);text-transform:uppercase;letter-spacing:.08em}
.ecran-collection .chip{font-size:12px}
.ecran-collection .chip.me{color:var(--me);border-color:rgba(var(--me-rgb),.45)}
.ec-og{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.ec-og button{position:relative;display:flex;flex-direction:column;align-items:center;padding:4px 4px 8px;border-radius:16px;background:var(--panel);border:1px solid var(--line);cursor:pointer;text-align:center;color:var(--txt);font:inherit}
.ec-og .pt{width:76px;height:76px}
.ec-og button b{font-family:var(--fh);font-weight:600;font-size:13.5px;line-height:1.15}
.ec-og button small{display:flex;align-items:center;justify-content:center;gap:2px;font-size:12px;font-weight:800;color:var(--warn);margin-top:1px;line-height:1.4}
.ec-og button small svg{width:11px;height:11px;flex:none}
.ec-og button.lock b{color:var(--mut)}
.ec-og button.lock small{color:var(--bio)}
.ec-og button.lock .lk{position:absolute;top:30px;left:50%;margin-left:-12px;width:24px;height:24px;color:var(--txt)}
.ec-og button.lock .lk svg{width:24px;height:24px}
.ec-og button.on{border-color:var(--warn);box-shadow:0 0 0 1.5px var(--warn)}
.ec-mut{font-size:12px;font-weight:700;color:var(--mut);margin:10px 2px 14px}
.ec-sheet{flex:none;margin:0 -6px 0;padding:10px 12px;display:flex;gap:10px;align-items:center;border-color:rgba(251,191,36,.5);box-shadow:0 -10px 30px rgba(0,0,0,.35)}
.ec-sheet .pic{width:54px;height:54px;border-radius:14px;background:var(--well);display:grid;place-items:center;flex:none}
.ec-sheet .pic canvas{width:52px;height:52px}
.ec-sheet b{font-family:var(--fh);font-weight:600;font-size:15px}
.ec-sheet p{font-size:12px;font-weight:700;color:var(--mut);line-height:1.3;margin:2px 0 0}
.ec-sheet .chip svg{width:13px;height:13px}
.ec-act{flex:none;max-width:96px;display:flex;flex-direction:column;align-items:center;gap:2px;padding:6px 8px;border-radius:12px;border:1.5px solid var(--bio);background:#12301f;color:var(--bio);font-size:12px;font-weight:800;line-height:1.2;text-align:center}
.ec-act svg{width:16px;height:16px}
.ec-intro{font-size:12.5px;font-weight:700;color:var(--mut);margin:0 2px 10px}
.ec-sp{display:flex;align-items:center;gap:10px;padding:6px 12px 6px 6px;margin-bottom:8px}
.ec-sp .av{width:66px;height:66px;border-radius:16px;background:var(--well);display:grid;place-items:center;flex:none;overflow:hidden}
.ec-sp .av canvas{width:66px;height:66px}
.ec-sp .n{font-family:var(--fh);font-weight:600;font-size:15px;line-height:1.15;display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.ec-sp .n .chip svg{width:12px;height:12px}
.ec-sp .ets{display:inline-flex;gap:1px}
.ec-sp .ets svg{width:12px;height:12px}
.ec-sp p{font-size:12px;font-weight:700;color:var(--mut);line-height:1.3;margin:2px 0 0}
.ec-sp.lock{opacity:.55}
.ec-sp.lock .av canvas{filter:grayscale(1) brightness(.6)}
.ec-sp.next{border-color:var(--me);box-shadow:0 0 0 1px var(--me)}
.ec-sp .btn.sm{flex:none;font-size:14px;padding:8px 12px;border-radius:12px;box-shadow:0 3px 0 var(--me-d)}
.ec-ferme{display:flex;flex-direction:column;align-items:center;gap:6px;text-align:center;padding:28px 16px;border-radius:16px;border:1px dashed #6b86a3;background:var(--panel)}
.ec-ferme .g{width:48px;height:48px;border-radius:50%;display:grid;place-items:center;background:var(--well);color:var(--mut)}
.ec-ferme .g svg{width:22px;height:22px}
.ec-ferme b{font-family:var(--fh);font-weight:600;font-size:17px}
.ec-ferme small{font-size:13px;color:var(--mut);font-weight:700}

/* ==== Tutoriel : guide, bulle, main fantôme, voile et zone éclairée (direction artistique, src/guide-perso.js) ====
   Usage proposé (équipe UX) :
   - .tuto-voile : le calque du tutoriel, plein écran, au-dessus du jeu. Il ne bloque pas les touchers (pointer-events:none) ;
     c'est le jeu qui ignore les touchers hors de la zone, pour que le geste dans la zone atteigne vraiment le bouton.
   - .tuto-trou : posé sur la zone à toucher (left, top, width, height en pixels, --tuto-r pour l'arrondi). Son ombre immense
     assombrit tout le reste ; un anneau turquoise respire autour.
   - .tuto-guide : le personnage (guidePerso) et sa bulle (.tuto-bulle) côte à côte ; .bas pour le mettre en bas de l'écran.
   - .tuto-main : la main (guideMain), posée en position absolue, la pointe du doigt (20, 12 dans son repère) sur la cible. */
.tuto-voile{position:fixed;inset:0;z-index:50;pointer-events:none}
.tuto-voile.plein{background:rgba(5,10,18,.72)}   /* sans zone à toucher : un voile uniforme */
.tuto-trou{position:absolute;border-radius:var(--tuto-r,16px);box-shadow:0 0 0 200vmax rgba(5,10,18,.72);pointer-events:none;transition:all .3s ease}
.tuto-trou::after{content:'';position:absolute;inset:-5px;border-radius:calc(var(--tuto-r,16px) + 5px);border:2.5px solid var(--me);
  box-shadow:0 0 18px rgba(var(--me-rgb),.55),inset 0 0 12px rgba(var(--me-rgb),.25);animation:tuto-anneau 1.6s ease-in-out infinite}
@keyframes tuto-anneau{50%{transform:scale(1.04);opacity:.65}}
.tuto-guide{position:absolute;left:12px;right:12px;top:calc(12px + var(--sh,0px));display:flex;align-items:flex-end;gap:6px;pointer-events:auto}
.tuto-guide.bas{top:auto;bottom:calc(16px + var(--bas,0px) + var(--sb,0px))}
.tuto-guide .tuto-perso{flex:none;width:88px;height:88px}
.tuto-perso{display:block;overflow:visible}
.tuto-souffle{transform-origin:60px 108px;animation:tuto-souffle 3s ease-in-out infinite}
@keyframes tuto-souffle{50%{transform:scale(1.035,.97)}}
.tuto-oeil{transform-box:fill-box;transform-origin:center;animation:tuto-cligne 4.5s infinite}   /* clignement des yeux seuls */
@keyframes tuto-cligne{0%,95%,100%{transform:none}97%{transform:scaleY(.12)}}
.tuto-eclat{transform-origin:95px 30px;animation:tuto-eclat 1.4s ease-in-out infinite}
@keyframes tuto-eclat{50%{transform:scale(.6) rotate(45deg);opacity:.5}}
/* la bulle : fond Lait, encre Nuit, Nunito, pointe vers le personnage (à gauche par défaut, .pointe-bas pour une pointe en bas) */
.tuto-bulle{position:relative;flex:1;min-width:0;margin-bottom:18px;padding:11px 14px 9px;border-radius:18px;background:#e6eef7;color:#0b1420;
  font-family:var(--fb);font-weight:700;font-size:16px;line-height:1.35;box-shadow:0 6px 20px rgba(0,0,0,.45);animation:tuto-pop .28s cubic-bezier(.3,1.5,.6,1)}
.tuto-bulle::before{content:'';position:absolute;left:-9px;bottom:18px;border:10px solid transparent;border-right-color:#e6eef7;border-left:0}
.tuto-bulle.pointe-bas::before{left:28px;bottom:-9px;border:10px solid transparent;border-top-color:#e6eef7;border-bottom:0}
.tuto-bulle b{color:#0f766e;font-weight:800}
.tuto-bulle .tuto-nom{display:block;font-family:var(--fh);font-weight:600;font-size:13px;color:#0f766e;margin-bottom:1px}
.tuto-suite{display:block;margin-top:4px;text-align:right;font-size:12px;font-weight:800;color:#4b6178;animation:tuto-suite 1.8s ease-in-out infinite}
@keyframes tuto-suite{50%{opacity:.45}}
@keyframes tuto-pop{from{transform:scale(.85);opacity:0}}
/* la main fantôme : elle tape (enfoncement et ondes) ou glisse de --tuto-dx, --tuto-dy */
.tuto-main{position:absolute;width:64px;height:72px;pointer-events:none;filter:drop-shadow(0 4px 6px rgba(0,0,0,.5));z-index:51}
.tuto-main.tape .tuto-doigt{transform-origin:20px 40px;animation:tuto-tape 1.2s ease-in-out infinite}
.tuto-main.tape .tuto-ondes{transform-origin:20px 12px;animation:tuto-ondes 1.2s ease-out infinite}
@keyframes tuto-tape{0%,100%{transform:translate(4px,8px)}40%,55%{transform:none}}
@keyframes tuto-ondes{0%,40%{transform:scale(.3);opacity:0}55%{opacity:1}100%{transform:scale(1.3);opacity:0}}
.tuto-main.glisse{animation:tuto-glisse 1.8s ease-in-out infinite}
.tuto-main.glisse .tuto-ondes{display:none}
@keyframes tuto-glisse{0%,15%{transform:translate(0,0);opacity:0}25%{opacity:1}75%{transform:translate(var(--tuto-dx,80px),var(--tuto-dy,0px));opacity:1}100%{transform:translate(var(--tuto-dx,80px),var(--tuto-dy,0px));opacity:0}}
/* moins d'animations : tout s'arrête, la main reste posée sur la cible, l'anneau reste fixe */
@media (prefers-reduced-motion:reduce){
  .tuto-souffle,.tuto-oeil,.tuto-eclat,.tuto-bulle,.tuto-suite,.tuto-trou::after,.tuto-main.tape .tuto-doigt,.tuto-main.tape .tuto-ondes,.tuto-main.glisse{animation:none}
  .tuto-trou{transition:none}
}
