/* Le coloriage mystère en ligne (prototype). Chargée par la seule page mystere-en-ligne.html, APRÈS maquette.css, dont
   elle ne prend que les couleurs et les polices. Tout ce qui est propre à la page porte le préfixe my.
   Téléphone d'abord, tenu en portrait : la grille prend l'écran, la légende est en bas, sur une rangée qui défile. */
html:has(.my-page) { overflow: hidden; overscroll-behavior: none; touch-action: manipulation; }
.my-page { margin: 0; overflow: hidden; }
.my, .my *, .my-feuillet, .my-feuillet * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
.my [hidden], .my-feuillet [hidden] { display: none !important; }
.my button, .my-feuillet button { font: inherit; color: inherit; cursor: pointer; }

.my { position: fixed; inset: 0; display: grid; grid-template: 'barre' auto 'scene' minmax(0, 1fr) 'palette' auto / minmax(0, 1fr); height: 100dvh; background: var(--kraft); color: var(--encre); font-family: var(--texte, system-ui, sans-serif); font-size: 16px; line-height: 1.4; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }

/* ---------- La barre ---------- */
.my__barre { grid-area: barre; display: flex; align-items: center; gap: 4px; padding: 6px 8px; background: var(--papier); border-bottom: 1.5px solid var(--trait); }
.my-bouton { flex: none; display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1.5px solid transparent; border-radius: 12px; background: none; color: var(--encre); text-decoration: none; transition: background 0.12s ease, opacity 0.12s ease; }
.my-bouton svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.my-bouton:hover { background: var(--kraft); }
.my-bouton:disabled { opacity: 0.3; cursor: default; background: none; }
.my__nom { flex: 0 1 auto; min-width: 0; display: inline-flex; align-items: center; gap: 4px; height: 44px; padding: 0 8px; border: 0; border-radius: 12px; background: none; font-family: var(--titre, Georgia, serif); font-weight: 620; font-size: 18px; letter-spacing: -0.01em; }
.my__nom span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.my__nom svg { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.my__nom:hover { background: var(--kraft); }
.my__reste { flex: none; display: flex; flex-direction: column; align-items: stretch; gap: 3px; margin: 0 4px 0 auto; font-size: 13.5px; font-weight: 600; color: var(--encre-douce); white-space: nowrap; }
.my__sur, .my__reste-avant { display: none; }
@media (max-width: 899px) { .my__barre .my-bouton { width: 40px; } .my__nom { padding: 0 4px; font-size: 17px; } }
.my__jauge { display: block; min-width: 70px; height: 6px; border-radius: 3px; background: var(--trait); overflow: hidden; }
.my__jauge i { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--c-sapin-vif, #4fae78); transition: width 0.25s ease; }

/* ---------- La scène : la feuille, qu'on zoome et qu'on déplace ---------- */
.my__scene { grid-area: scene; position: relative; overflow: hidden; touch-action: none; cursor: grab; }
.my__scene--tire { cursor: grabbing; }
.my__scene--attente::after { content: ''; position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px; border: 3px solid var(--trait-fort); border-top-color: var(--encre); border-radius: 50%; animation: my-tourne 0.8s linear infinite; }
@keyframes my-tourne { to { transform: rotate(360deg); } }
/* Le SVG déborde de 240 px autour de la scène (DEBORD dans le script) et se déplace par transformation pendant un geste. */
.my__dessin { position: absolute; left: -240px; top: -240px; width: calc(100% + 480px); height: calc(100% + 480px); display: block; transform-origin: 0 0; will-change: transform; }
.my__feuille { fill: #fff; }
/* Une case vide : blanche, un filet gris. Une case remplie : sa couleur, bordée de sa couleur, pour que la grille
   disparaisse entre deux cases faites. Les cases remplies sont rangées en tête : les filets des cases vides restent
   ainsi par-dessus. */
.my__cases path { fill: #fff; stroke: #b7b0a4; stroke-width: 1px; vector-effect: non-scaling-stroke; stroke-linejoin: round; cursor: pointer; }
/* Les cases de la couleur tenue : hachurées (le motif est posé par le script, qui écrit aussi la règle `fill`), un
   contour sombre. Le gris-bleu uni d'avant se confondait avec les couleurs pâles déjà posées. */
.my__cases path.vise { fill: #dfe4ee; stroke: #34405c; stroke-width: 1.6px; cursor: cell; }
.my__cases path.faite { fill: var(--c); stroke: none; cursor: inherit; }
/* Le joint d'une case remplie : son contour, SOUS les cases, pour fermer le jour entre deux voisines sans mordre sur elles. */
.my__joints { pointer-events: none; }
.my__joints path { fill: none; stroke: var(--c); stroke-width: 1.5px; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.my__cases path.refus { animation: my-refus 0.45s ease; }
@keyframes my-refus { 0%, 100% { fill: #fff; } 30%, 70% { fill: #f6c9bd; } }
.my__cases path.pose { animation: my-pose 0.3s ease-out; }
@keyframes my-pose { from { fill-opacity: 0.25; } to { fill-opacity: 1; } }
.my__signes { pointer-events: none; }
.my__signes text { font-family: Arial, Helvetica, sans-serif; font-weight: 700; fill: #7a7266; text-anchor: middle; dominant-baseline: central; }
.my__signes text.vise { fill: #1d1a16; paint-order: stroke; stroke: #fff; stroke-width: 0.24em; stroke-linejoin: round; } /* un liseré blanc : le signe reste lisible sur la hachure */
/* De loin, les signes des petites cases ne sont que du bruit : le script les cache sous une taille lisible. */
.my__dessin[data-loin='2'] .my__signes text.petit, .my__dessin[data-loin='2'] .my__signes text.moyen, .my__dessin[data-loin='1'] .my__signes text.petit { display: none; }
.my__dessin--fini .my__cases path { cursor: inherit; }

.my__zoom { position: absolute; right: 8px; top: 8px; display: grid; gap: 4px; padding: 3px; border-radius: 14px; background: rgba(250, 246, 238, 0.92); box-shadow: 0 1px 0 rgba(29, 26, 22, 0.05), 0 8px 18px -10px rgba(29, 26, 22, 0.4); }
.my__zoom .my-bouton { width: 40px; height: 40px; }
.my__mot { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); max-width: calc(100% - 24px); margin: 0; padding: 7px 14px; border-radius: 999px; background: var(--encre); color: var(--papier); font-size: 14.5px; font-weight: 600; text-align: center; pointer-events: none; animation: my-mot 0.18s ease-out; }
.my__mot i { display: inline-block; width: 13px; height: 13px; margin: 0 5px -1px 2px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.75); }
@keyframes my-mot { from { opacity: 0; transform: translate(-50%, 6px); } }
.my__panne { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 24px; text-align: center; font-weight: 600; }

/* L'écran de fin : un bandeau au bas de la scène, l'image finie reste visible au-dessus. */
.my__fin { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); width: min(calc(100% - 20px), 540px); padding: 14px 16px 14px; border-radius: 16px; background: var(--papier); box-shadow: 0 2px 0 rgba(29, 26, 22, 0.05), 0 22px 30px -14px rgba(29, 26, 22, 0.45); text-align: center; animation: my-fin 0.45s ease-out 0.25s backwards; }
@keyframes my-fin { from { opacity: 0; transform: translate(-50%, 14px); } }
.my__fin-titre { margin: 0; font-family: var(--titre, Georgia, serif); font-weight: 620; font-size: 21px; letter-spacing: -0.012em; }
.my__fin-nom { margin: 2px 0 12px; color: var(--encre-douce); font-size: 15px; }
.my__fin-gestes { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0; }
.my__geste svg { flex: none; width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.my__fin-suite { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin: 10px 0 0; font-size: 14.5px; }
.my__fin-suite a, .my__fin-suite button { padding: 4px 2px; border: 0; background: none; color: var(--encre-douce) !important; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.my__fin-suite a:hover, .my__fin-suite button:hover { color: var(--encre) !important; }
.my__geste { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 16px; border: 1.5px solid var(--encre); border-radius: 999px; background: none; font-weight: 700; font-size: 15.5px; }
.my__geste:hover { background: var(--kraft); }
.my__geste--plein { background: var(--encre); color: var(--papier) !important; }
.my__geste--plein:hover { background: #3a342c; }

/* ---------- La légende : une couleur, son signe, ce qui reste ---------- */
.my__palette { grid-area: palette; display: flex; gap: 8px; padding: 9px 10px calc(9px + env(safe-area-inset-bottom, 0px)); background: var(--papier); border-top: 1.5px solid var(--trait); overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
.my__palette::-webkit-scrollbar { display: none; }
.my-couleur { flex: none; position: relative; display: grid; justify-items: center; gap: 7px; width: 54px; padding: 6px 0 2px; border: 0; background: none; }
.my-couleur b { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--c); color: var(--sur); font: 700 19px/1 Arial, Helvetica, sans-serif; box-shadow: inset 0 0 0 1.5px rgba(29, 26, 22, 0.22); transition: transform 0.12s ease, box-shadow 0.12s ease; }
.my-couleur small { font-size: 12px; font-weight: 600; color: var(--encre-douce); line-height: 1.1; }
.my-couleur[aria-pressed='true'] b { transform: scale(1.06); box-shadow: inset 0 0 0 1.5px rgba(29, 26, 22, 0.22), 0 0 0 2.5px var(--papier), 0 0 0 5px var(--encre); }
.my-couleur[aria-pressed='true'] small { color: var(--encre); }
.my-couleur--finie b { opacity: 0.45; font-size: 0; }
.my-couleur--finie b::after { content: ''; width: 18px; height: 10px; border: solid var(--sur); border-width: 0 0 3px 3px; transform: translateY(-3px) rotate(-45deg); }
.my-couleur--finie small { visibility: hidden; }

/* ---------- Les feuillets : le choix du dessin, la confirmation ---------- */
.my-feuillet { width: min(100vw - 20px, 620px); max-height: min(100dvh - 20px, 760px); padding: 16px 18px 18px; border: 0; border-radius: 18px; background: var(--papier); color: var(--encre); font-family: var(--texte, system-ui, sans-serif); box-shadow: 0 30px 60px -20px rgba(29, 26, 22, 0.6); }
.my-feuillet::backdrop { background: rgba(29, 26, 22, 0.45); }
.my-feuillet--petit { width: min(100vw - 20px, 400px); text-align: center; }
.my-feuillet h2 { margin: 0; font-family: var(--titre, Georgia, serif); font-weight: 620; font-size: 23px; letter-spacing: -0.014em; line-height: 1.2; }
.my-feuillet__tete { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.my-feuillet__mot { margin: 6px 0 14px; color: var(--encre-douce); font-size: 14.5px; }

/* ---------- Les aides ---------- */
/* « Où ? » : en bas à droite de la scène, sous le pouce. */
.my__montrer { position: absolute; right: 8px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 14px 0 11px; border: 1.5px solid var(--encre); border-radius: 999px; background: var(--papier); font-weight: 700; font-size: 15px; box-shadow: 0 8px 18px -10px rgba(29, 26, 22, 0.5); }
.my__montrer svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.my__montrer:hover { background: var(--kraft); }
/* Les anneaux : autour de la case montrée (fort) et des dernières cases d'une couleur. */
.my__reperes { pointer-events: none; }
.my__reperes circle { fill: none; stroke: #e0532f; stroke-width: 2.5px; vector-effect: non-scaling-stroke; animation: my-anneau 1.5s ease-in-out infinite; }
.my__reperes circle.fort { stroke: #1d1a16; stroke-width: 3.5px; animation-duration: 0.75s; }
@keyframes my-anneau { 0%, 100% { stroke-opacity: 1; } 50% { stroke-opacity: 0.25; } }
/* Au doigt, la pince zoome : les boutons + et − ne feraient que couvrir la feuille. */
@media (pointer: coarse) { .my__zoom-pas { display: none; } }
/* Pour les lecteurs d'écran seulement. */
.my__annonce { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.my :focus-visible, .my-feuillet :focus-visible { outline: 3px solid var(--c-ciel-fort, #2167a1); outline-offset: 2px; }

/* ---------- La galerie : les dessins en images, par section ---------- */
.my-galerie { width: min(100vw - 16px, 1040px); height: min(100dvh - 16px, 900px); max-height: none; padding: 0; overflow: hidden; }
.my-galerie[open] { display: grid; grid-template: auto minmax(0, 1fr) auto / minmax(0, 1fr); }
.my-galerie__pied { margin: 0; padding: 10px 16px; border-top: 1.5px solid var(--trait); text-align: center; font-size: 14.5px; }
.my-galerie__pied a { color: var(--encre) !important; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.my-galerie__tete { padding: 14px 16px 10px; border-bottom: 1.5px solid var(--trait); }
.my-galerie__sauts { display: flex; gap: 6px; margin: 10px -16px 0; padding: 0 16px 2px; overflow-x: auto; scrollbar-width: none; }
.my-galerie__sauts::-webkit-scrollbar { display: none; }
.my-galerie__sauts button { flex: none; height: 36px; padding: 0 14px; border: 1.5px solid var(--trait-fort); border-radius: 999px; background: #fff; font-weight: 600; font-size: 14.5px; }
.my-galerie__sauts button:hover { border-color: var(--encre); }
.my-galerie__corps { overflow-y: auto; overscroll-behavior: contain; padding: 4px 16px 20px; }
.my-galerie__corps h3 { margin: 18px 0 10px; font-family: var(--titre, Georgia, serif); font-weight: 620; font-size: 20px; letter-spacing: -0.012em; }
.my-galerie__liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 16px 12px; margin: 0; padding: 0; list-style: none; }
.my-carte { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; }
.my-carte__image { position: relative; display: block; aspect-ratio: 260 / 368; border-radius: 4px; background: #fff; overflow: hidden; box-shadow: 0 0 0 1px rgba(29, 26, 22, 0.12), 0 10px 18px -12px rgba(29, 26, 22, 0.4); transition: transform 0.15s ease, box-shadow 0.15s ease; }
.my-carte__image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.my-carte:hover .my-carte__image { transform: translateY(-3px); box-shadow: 0 0 0 1px rgba(29, 26, 22, 0.2), 0 18px 24px -14px rgba(29, 26, 22, 0.5); }
.my-carte[aria-current='true'] .my-carte__image { box-shadow: 0 0 0 3px var(--encre); }
.my-carte__image i { position: absolute; left: 0; bottom: 0; height: 6px; background: var(--c-sapin-vif, #4fae78); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.8); }
.my-carte__image em { position: absolute; left: 6px; top: 6px; padding: 2px 9px; border-radius: 999px; background: var(--encre); color: var(--papier); font-style: normal; font-weight: 700; font-size: 12.5px; }
.my-carte__image em.fini { background: var(--c-sapin-fort, #167645); }
.my-carte strong { display: block; margin-top: 8px; font-weight: 700; font-size: 15px; line-height: 1.25; }
.my-carte small { display: block; color: var(--encre-douce); font-size: 12.5px; }

/* ---------- L'impression de l'image finie : elle seule, sur la page ---------- */
.my-impression { display: none; }
@media print {
  @page { size: A4 portrait; margin: 10mm; }
  html:has(.my-page), .my-page { overflow: visible !important; background: #fff !important; }
  .my, .my-feuillet, .my__annonce { display: none !important; }
  .my-impression { display: block; width: 100%; height: auto; max-height: 277mm; object-fit: contain; }
}

/* ---------- Grand écran : la légende passe à droite, en colonnes ---------- */
@media (min-width: 900px) {
  .my { grid-template: 'barre barre' auto 'scene palette' minmax(0, 1fr) / minmax(0, 1fr) auto; }
  .my__barre { padding: 8px 14px; gap: 8px; }
  .my__nom { font-size: 20px; }
  .my__reste { flex-direction: row-reverse; align-items: center; gap: 12px; font-size: 15px; }
  .my__jauge { width: 150px; }
  .my__sur, .my__reste-avant { display: inline; }
  .my__palette { display: grid; grid-template-columns: repeat(3, 60px); align-content: start; gap: 14px 8px; padding: 18px 16px; border-top: 0; border-left: 1.5px solid var(--trait); overflow: hidden auto; }
  .my-couleur { width: 60px; }
  .my-couleur b { width: 50px; height: 50px; }
  .my__zoom { right: 12px; top: 12px; }
  .my__montrer { right: 12px; bottom: 14px; }
  .my-galerie__liste { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px 16px; }
  .my-galerie__tete, .my-galerie__corps { padding-left: 24px; padding-right: 24px; }
  .my-galerie__sauts { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { .my *, .my-feuillet * { animation: none !important; transition: none !important; } }

/* ---------- Le mode jeu (prototype, plans/mystere-jeu.md) : la jauge, les pouvoirs, le film ---------- */
.my__pouvoirs { position: absolute; left: 8px; bottom: 10px; display: flex; align-items: center; gap: 6px; padding: 4px; border-radius: 999px; background: rgba(250, 246, 238, 0.94); box-shadow: 0 8px 18px -10px rgba(29, 26, 22, 0.5); }
/* La jauge : un anneau qui se remplit, le nombre de pouvoirs prêts au milieu. */
.my-charge { --part: 0; flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: radial-gradient(closest-side, var(--papier) 76%, transparent 78%), conic-gradient(var(--c-mandarine-vif, #dd8a46) calc(var(--part) * 360deg), var(--trait) 0); }
.my-charge b { font: 700 17px/1 var(--texte, system-ui, sans-serif); color: var(--encre-douce); }
.my-charge--prete b { color: var(--encre); }
.my-charge--prete { background: radial-gradient(closest-side, #ffe7b8 76%, transparent 78%), conic-gradient(var(--c-mandarine-vif, #dd8a46) calc(var(--part) * 360deg), var(--c-miel-clair, #ecd6a4) 0); }
.my-charge.gagne { animation: my-gagne 0.6s ease-out; }
@keyframes my-gagne { 0% { transform: scale(1); } 35% { transform: scale(1.35); } 100% { transform: scale(1); } }
.my-pouvoir { position: relative; flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1.5px solid var(--encre); border-radius: 50%; background: var(--papier); transition: transform 0.12s ease, opacity 0.12s ease, background 0.12s ease; }
.my-pouvoir svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.my-pouvoir:hover:not(:disabled) { background: #ffe7b8; transform: translateY(-2px); }
.my-pouvoir:disabled { opacity: 0.32; border-color: var(--trait-fort); cursor: default; }
.my-pouvoir[aria-pressed='true'] { background: var(--encre); color: var(--papier); }
.my-pouvoir em { position: absolute; right: -3px; top: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--encre); color: var(--papier); font: 700 11.5px/18px var(--texte, system-ui, sans-serif); font-style: normal; text-align: center; }
.my__scene--vise, .my__scene--vise .my__cases path { cursor: crosshair; }
/* La couleur d'un pouvoir arrive en onde : chaque case attend son tour (retard posé par le script), puis s'allume. */
.my__cases path.onde { animation: my-onde 0.34s ease-out backwards; }
@keyframes my-onde { 0% { fill-opacity: 0; } 55% { fill-opacity: 1; filter: brightness(1.25); } 100% { fill-opacity: 1; filter: none; } }
.my__ondes { pointer-events: none; }
.my__ondes circle { fill: none; stroke: var(--encre); stroke-width: 3px; vector-effect: non-scaling-stroke; transform-box: fill-box; transform-origin: center; animation: my-anneau-onde 0.75s ease-out forwards; }
@keyframes my-anneau-onde { from { transform: scale(0.08); stroke-opacity: 0.9; } to { transform: scale(1); stroke-opacity: 0; } }
/* Le film : les joints de couleur se cachent, la grille revient, puis les cases se recolorient. */
.my__dessin--film .my__joints, .my__dessin--film .my__signes, .my__dessin--film .my__reperes, .my__dessin--apercu .my__signes, .my__dessin--apercu .my__reperes { display: none; }
.my__dessin--film .my__cases path[data-i] { fill: #fff; stroke: #b7b0a4; stroke-width: 1px; cursor: inherit; transition: fill 0.25s ease; }
.my__dessin--film .my__cases path[data-i].vu { fill: var(--c); stroke: var(--c); }
/* L'aperçu de l'image finie : chaque case montre sa couleur, sans être remplie. */
.my__dessin--apercu .my__cases path[data-i] { fill: var(--c) !important; stroke: var(--c) !important; stroke-width: 1px; cursor: inherit; }
@media (min-width: 900px) { .my__pouvoirs { left: 12px; bottom: 14px; gap: 8px; } }
.my-bouton[aria-pressed='true'] { background: var(--encre); color: var(--papier); }

/* ---------- L'INTERFACE DU JEU (21 novembre 2026) : tout ce qui suit ne vaut que sous .my-jeu ---------- */
/* La palette : une couleur finie disparaît, un anneau dit l'avancement de chacune. */
.my-jeu .my-couleur--finie { display: none; }
.my-jeu .my-couleur b { box-shadow: inset 0 0 0 1.5px rgba(29, 26, 22, 0.22), 0 0 0 2px var(--papier); outline: 0; position: relative; }
.my-jeu .my-couleur b::before { content: ''; position: absolute; inset: -5px; border-radius: 50%; background: conic-gradient(var(--c-sapin-vif, #4fae78) calc(var(--part, 0) * 1turn), rgba(29, 26, 22, 0.1) 0); z-index: -1; }
.my-jeu .my-couleur { isolation: isolate; }
.my-jeu .my-couleur[aria-pressed='true'] b { box-shadow: inset 0 0 0 1.5px rgba(29, 26, 22, 0.22), 0 0 0 2px var(--papier), 0 0 0 4.5px var(--encre); }
.my-jeu .my-couleur[aria-pressed='true'] b::before { display: none; }
@media (max-width: 899px) {
  /* sur téléphone : deux rangées, des pastilles un peu plus petites, pour voir douze couleurs d'un coup */
  .my-jeu .my__palette { display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, auto); grid-auto-columns: 52px; gap: 6px 6px; padding-top: 10px; }
  .my-jeu .my-couleur { width: 52px; gap: 5px; padding: 4px 0 0; }
  .my-jeu .my-couleur b { width: 40px; height: 40px; font-size: 17px; }
  .my-jeu .my-couleur small { font-size: 11px; }
}
/* L'accueil : la galerie en pleine page. */
.my-galerie--jeu { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; border-radius: 0; }
.my-galerie--jeu .my-galerie__tete h2 { font-size: 26px; }
.my-galerie--jeu .my-galerie__liste { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.my-galerie--jeu .my-carte__image { border-radius: 10px; aspect-ratio: 3 / 4; background: #e9e2d4; }
.my-galerie--jeu .my-carte__image img.flou { filter: blur(11px) saturate(1.2); transform: scale(1.3); }

@media (min-width: 900px) { .my-galerie--jeu .my-galerie__liste { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); } .my-galerie--jeu .my-galerie__corps, .my-galerie--jeu .my-galerie__tete { padding-left: max(24px, calc(50vw - 620px)); padding-right: max(24px, calc(50vw - 620px)); } }
.my-jeu [data-retour] { cursor: pointer; }
/* La fin, dans le jeu : le dessin suivant d'abord ; pas de feuille à imprimer (c'est une idée du site). */
.my-jeu .my__fin-feuille, .my-jeu [data-imprimer] { display: none; }
.my-jeu .my__geste--plein:not(.my__geste--suivant) { background: #fff !important; color: var(--encre) !important; box-shadow: inset 0 0 0 1.5px var(--trait-fort); }
/* L'effet aquarelle (jeu) : deux images par-dessus les cases, mêlées à leurs couleurs. */
.my__aquarelle { display: none; pointer-events: none; }
.my__dessin--aquarelle .my__aquarelle { display: inline; }
.my__dessin { isolation: isolate; }
.my__lavis { mix-blend-mode: soft-light; }
.my__grain { mix-blend-mode: multiply; }
/* Les contours gardés (vitrail, estampe). */
.my__cases path.trait { pointer-events: none; }
.my__traits { display: none; pointer-events: none; }
.my__traits path { fill: var(--c); fill-rule: evenodd; }
.my__cases path.trait { fill-rule: evenodd; }
.my__dessin--fini .my__traits, .my__dessin--apercu .my__traits, .my__dessin--film .my__traits { display: inline; }
/* dans le film, un détail ne se montre qu'avec sa case ; la copie rangée parmi les cases est cachée */
.my__dessin--film .my__traits path:not(.vu), .my__dessin--film .my__cases path.trait { display: none; }

/* L'habillage du jeu autonome. Chargée APRÈS mystere-en-ligne.css (copiée telle quelle de maquette/), qu'elle complète.
   1. Le thème : sombre, façon galerie. La feuille d'origine ne connaît que des variables (--papier, --encre…) : on leur
      donne des valeurs de nuit, et l'écran de coloriage suit. La feuille à colorier, elle, reste blanche.
   2. Ce que le cadre d'un portail demande : paysage 16:9 dès 800 × 450, rien qui se sélectionne, rien qui défile.
   3. La bibliothèque (préfixe gc) : les livres, un livre, les favoris, les terminés. */
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('polices/figtree.woff2') format('woff2'); }
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 500 700; font-display: swap; src: url('polices/fraunces.woff2') format('woff2'); }
:root {
  --fond: #111018;          /* le mur de la galerie */
  --papier: #1b1a24;        /* les panneaux : barre, palette, bandeaux */
  --kraft: #111018;         /* autour de la feuille */
  --trait: #2b2a37; --trait-fort: #45435a;
  --encre: #f5f1e8; --encre-douce: #a8a5b8;
  --accent: #ffc35a;        /* l'avancement */
  --coeur: #ff5d7a;
  --c-sapin-vif: #ffc35a; --c-sapin-fort: #2f9d68; --c-ciel-fort: #8cc0ff; --c-mandarine-vif: #ff9a4d; --c-miel-clair: #5a4a2a;
  --titre: 'Fraunces', Georgia, 'Times New Roman', serif;
  --texte: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}
html, body { height: 100%; margin: 0; background: var(--fond); color: var(--encre); font-family: var(--texte); -webkit-font-smoothing: antialiased; }
html, body, .my-feuillet, .my-feuillet *, .gc, .gc * { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
img { -webkit-user-drag: none; pointer-events: none; }
body { overflow: hidden; overscroll-behavior: none; }
.my-bouton { appearance: none; -webkit-appearance: none; }

/* ---------- 1. L'écran de coloriage, de nuit ---------- */
.my { background: radial-gradient(900px 500px at 50% 0, #1d1b2b 0, transparent 70%), var(--fond); }
.my__barre { border-bottom-color: var(--trait); }
.my__feuille { filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.6)); }
.my__zoom { background: rgba(27, 26, 36, 0.92); box-shadow: 0 0 0 1px var(--trait), 0 10px 22px -10px rgba(0, 0, 0, 0.8); }
.my-bouton:hover, .my__nom:hover, .my__geste:hover, .my__montrer:hover { background: var(--trait); }
.my-bouton[aria-pressed='true'] { background: var(--encre); color: var(--fond); }
.my__montrer { border-color: var(--trait-fort); box-shadow: 0 10px 22px -10px rgba(0, 0, 0, 0.8); }
.my__mot { box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.7); }
.my__fin { box-shadow: 0 0 0 1px var(--trait), 0 24px 40px -14px rgba(0, 0, 0, 0.85); }
.my__geste { border-color: var(--trait-fort); }
.my__geste--plein { background: var(--accent); border-color: var(--accent); color: #1b1408 !important; }
.my__geste--plein:hover { background: #ffd382; }
html.my-jeu .my__geste--plein:not(.my__geste--suivant) { background: none !important; color: var(--encre) !important; box-shadow: none; border-color: var(--trait-fort); }
.my-couleur b { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.16); }
.my-jeu .my-couleur b { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.16), 0 0 0 2px var(--papier); }
.my-jeu .my-couleur b::before { background: conic-gradient(var(--accent) calc(var(--part, 0) * 1turn), rgba(255, 255, 255, 0.12) 0); }
.my-jeu .my-couleur[aria-pressed='true'] b { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.16), 0 0 0 2px var(--papier), 0 0 0 4.5px var(--encre); }
.my-feuillet::backdrop { background: rgba(5, 5, 10, 0.7); }
/* La galerie du moteur ne se montre jamais : la bibliothèque la remplace (jeu/src/enveloppe.js). */
.my-galerie, .my-galerie::backdrop { display: none !important; }
/* Le cœur : dans la barre, sur le bandeau de fin, sur les cartes. */
.gc-coeur svg { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linejoin: round; }
.gc-coeur[aria-pressed='true'] { background: none; color: var(--coeur); }
.gc-coeur[aria-pressed='true'] svg { fill: currentColor; }
.my__geste.gc-coeur svg { width: 19px; height: 19px; }

/* ---------- Une seule barre d'outils ----------
   Les boutons de zoom sont entrés dans la barre (jeu/src/enveloppe.js) : plus rien ne flotte sur la feuille, sauf
   « Where? ». L'œil (voir l'image finie) et le film à tout moment sont retirés : ils éventent le mystère. Le film
   reste à la fin. L'avancement est un anneau. */
.my__zoom { display: contents; }
.my__zoom [data-apercu], .my__zoom [data-voir-film], .my__zoom [data-effet] { display: none !important; }
.my__barre .my__zoom .my-bouton { width: 44px; height: 44px; }
.my__reste { display: none; }
.gc-espace { flex: 1 1 0; min-width: 0; min-height: 0; }
.gc-anneau { --p: 0; flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: radial-gradient(closest-side, var(--papier) 78%, transparent 80%), conic-gradient(var(--accent) calc(var(--p) * 1turn), var(--trait-fort) 0); }
.gc-anneau b { font: 700 13.5px/1 var(--texte); font-variant-numeric: tabular-nums; }
.gc-anneau b::after { content: '%'; font-size: 9.5px; font-weight: 600; color: var(--encre-douce); margin-left: 1px; }
.gc-son svg .gc-son__croix { display: none; }
.gc-son[aria-pressed='true'] { background: none; color: var(--encre-douce); }
.gc-son[aria-pressed='true'] svg .gc-son__ondes { display: none; }
.gc-son[aria-pressed='true'] svg .gc-son__croix { display: inline; }
/* Téléphone debout : la barre garde l'essentiel. « Recommencer » reste sur l'écran de fin. */
@media (max-width: 480px) and (orientation: portrait) {
  .my__barre { gap: 0; padding: 4px 4px; }
  .my__barre [data-zero], .my__barre .gc-coeur, .my__nom svg { display: none; } /* le cœur reste sur l'écran de fin et dans le livre */
  .my__nom { flex: 1 1 0; }
  .gc-espace { flex: 0 0 0; }
  .my__nom { font-size: 16px; }
}

/* ---------- 2. Paysage : la barre se couche à gauche, l'image prend toute la hauteur ----------
   Un cadre de portail est en 16:9 et nos images en 3:4 : chaque point de hauteur compte. La barre du haut devient
   une colonne d'outils à gauche, la palette reste à droite, le nom du dessin flotte en haut de la scène. */
@media (orientation: landscape) {
  .my { grid-template: 'barre scene palette' minmax(0, 1fr) / auto minmax(0, 1fr) auto; }
  .my__barre { flex-direction: column; gap: 2px; width: 60px; padding: 8px 0; border-bottom: 0; border-right: 1.5px solid var(--trait); }
  .my__barre .my-bouton, .my__barre .my__zoom .my-bouton { width: 44px; height: 42px; }
  .my__barre [data-retour] { order: 0; }
  .gc-anneau { order: 1; margin-top: 6px; }
  .gc-espace { order: 2; }
  .my__barre .my__zoom .my-bouton, .gc-son, .my__barre .gc-coeur, .my__barre [data-annuler], .my__barre [data-zero] { order: 3; }
  .my__nom { position: fixed; left: 72px; top: 10px; z-index: 3; height: 34px; padding: 0 14px; border-radius: 999px; background: rgba(27, 26, 36, 0.82); box-shadow: 0 0 0 1px var(--trait); font-size: 15px; max-width: 40vw; }
  .my__nom svg { display: none; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .my__barre { width: 52px; padding: 4px 0; gap: 0; }
  .my__barre .my-bouton, .my__barre .my__zoom .my-bouton { width: 42px; height: 38px; }
  .gc-anneau { width: 38px; height: 38px; margin-top: 2px; }
  .my__nom { left: 62px; top: 8px; height: 30px; font-size: 14px; }
}
@media (orientation: landscape) and (max-width: 899px) {
  .my-jeu .my__palette { display: grid; grid-auto-flow: row; grid-template-rows: none; grid-template-columns: repeat(4, 44px); grid-auto-columns: auto; align-content: start; gap: 8px 6px; padding: 10px 10px 10px 12px; border-top: 0; border-left: 1.5px solid var(--trait); overflow: hidden auto; overscroll-behavior: contain; }
  .my-jeu .my-couleur { width: 44px; gap: 4px; padding: 4px 0 0; }
  .my-jeu .my-couleur b { width: 36px; height: 36px; font-size: 15.5px; }
  .my__fin { padding: 10px 14px; }
  .my__fin-nom { margin-bottom: 8px; }
  .my__geste { min-height: 40px; }
}

/* ---------- Le retour d'une case posée ----------
   Calme (son retour du 22 novembre 2026) : la couleur se dépose comme une peinture qui prend, d'abord diluée puis
   pleine. Pas d'éclat, pas d'anneau, pas de confettis. */
.my__cases path.pose { animation: gc-pose 0.6s ease-out; }
@keyframes gc-pose { 0% { fill-opacity: 0; } 35% { fill-opacity: 0.55; } 100% { fill-opacity: 1; } }
/* Une couleur de la palette : elle répond au doigt. */
.my-couleur:active b { transform: scale(0.92); }
.my-jeu .my-couleur[aria-pressed='true'] b { transform: scale(1.1); }

/* La fin en paysage : le bandeau se range à droite de l'image, qui garde toute la hauteur. Le moteur réserve la
   largeur du bandeau et pose cette classe sur la scène (window.MYSTERE.finACote). */
.my__scene--fin-a-cote .my__fin { left: auto; right: 14px; bottom: 50%; transform: translateY(50%); width: min(300px, 42%); padding: 18px 16px; animation-name: gc-fin; }
@keyframes gc-fin { from { opacity: 0; transform: translate(14px, 50%); } }
.my__scene--fin-a-cote .my__fin-gestes { flex-direction: column; align-items: stretch; }
.my__scene--fin-a-cote .my__montrer { display: none; }
/* Dessin fini : la palette est vide, elle rend sa place à l'image. */
.my:has(.my__dessin--fini) .my__palette { display: none; }

/* Le curseur : une goutte de la couleur tenue (posée par l'enveloppe dans --curseur). La main ne vient que pour déplacer. */
.my__scene { cursor: var(--curseur, default); }
.my__cases path, .my__cases path.vise, .my__cases path.faite { cursor: inherit; }
.my__scene--main, .my__scene--main .my__cases path { cursor: grab; }
.my__scene--tire, .my__scene--tire .my__cases path { cursor: grabbing; }
.my__dessin--fini, .my__dessin--fini .my__cases path { cursor: default; }
/* Le nom du livre devant le nom du dessin. */
.my__nom span b { margin-right: 7px; padding-right: 8px; border-right: 1.5px solid var(--trait-fort); font-weight: 600; color: var(--encre-douce); }
/* Téléphone debout : le livre au-dessus du nom, sur deux lignes. */
@media (max-width: 480px) and (orientation: portrait) { .my__nom span b { display: block; margin: 0 0 1px; padding: 0; border: 0; font-size: 11.5px; line-height: 1.1; letter-spacing: 0.02em; } .my__nom span { line-height: 1.15; text-align: left; } }
/* L'aide : une carte sur la scène, qui ne bloque pas le coloriage. */
.gc-aide { position: absolute; z-index: 3; left: 50%; top: 14px; transform: translateX(-50%); width: min(360px, calc(100% - 24px)); padding: 14px 16px 14px; border-radius: 16px; background: rgba(27, 26, 36, 0.96); box-shadow: 0 0 0 1px var(--trait-fort), 0 20px 34px -14px rgba(0, 0, 0, 0.85); pointer-events: none; cursor: default; animation: gc-aide 0.3s ease-out; }
.gc-aide[hidden] { display: none; }
@keyframes gc-aide { from { transform: translate(-50%, -10px); } }
.gc-aide strong { display: block; font-family: var(--titre); font-weight: 620; font-size: 18px; }
.gc-aide ol { margin: 8px 0 12px; padding: 0 0 0 20px; color: var(--encre); font-size: 14.5px; line-height: 1.4; }
.gc-aide li { margin: 3px 0; }
.gc-aide li::marker { color: var(--accent); font-weight: 700; }
.gc-aide__ok { pointer-events: auto; min-height: 38px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--accent); color: #1b1408; font: 700 15px/1 var(--texte); cursor: pointer; }
.gc-aide__ok:hover { background: #ffd382; }
.gc-aide-bouton[aria-pressed='true'] { background: var(--encre); color: var(--fond); }
@media (orientation: landscape) { .gc-aide { top: 52px; } .gc-aide-bouton { order: 3; } }
@media (orientation: landscape) and (max-height: 520px) { .gc-aide { top: 44px; padding: 10px 14px; } .gc-aide ol { margin: 4px 0 8px; font-size: 13.5px; } }

/* ---------- 3. La bibliothèque ---------- */
.gc { position: fixed; inset: 0; z-index: 30; display: grid; grid-template-rows: auto minmax(0, 1fr); background: radial-gradient(1100px 520px at 12% -12%, #2b2346 0, transparent 62%), radial-gradient(900px 500px at 100% 0, #1d2a3d 0, transparent 60%), var(--fond); color: var(--encre); font-size: 16px; line-height: 1.35; }
.gc[hidden] { display: none; }
.gc *, .gc *::before { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
.gc button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; text-align: left; }
.gc :focus-visible { outline: 3px solid var(--c-ciel-fort); outline-offset: 3px; }
.gc ul { margin: 0; padding: 0; list-style: none; }
.gc__tete { display: flex; align-items: center; gap: 16px; padding: 14px clamp(14px, 3.2vw, 40px) 10px; }
.gc__marque { display: flex; align-items: center; gap: 10px; margin: 0; font-family: var(--titre); font-weight: 700; font-size: 25px; letter-spacing: -0.02em; white-space: nowrap; }
.gc__marque i { width: 26px; height: 26px; border-radius: 9px 9px 9px 2px; background: conic-gradient(from 210deg, #ff5d7a, #ffc35a, #5ad1a0, #5aa9ff, #a06bff, #ff5d7a); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.25); }
.gc__onglets { display: flex; gap: 4px; margin-left: auto; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); }
.gc__onglet { height: 38px; padding: 0 16px !important; border-radius: 999px; color: var(--encre-douce) !important; font-weight: 700 !important; font-size: 15px; white-space: nowrap; }
.gc__onglet:hover { color: var(--encre) !important; }
.gc__onglet[aria-current] { background: var(--encre) !important; color: var(--fond) !important; }
.gc__corps { overflow: hidden auto; overscroll-behavior: contain; padding: 4px clamp(14px, 3.2vw, 40px) 36px; scrollbar-width: thin; scrollbar-color: var(--trait-fort) transparent; outline: 0; }
.gc h2 { margin: 18px 0 12px; font-family: var(--titre); font-weight: 620; font-size: 21px; letter-spacing: -0.014em; }
.gc__mention { margin: 34px auto 0; max-width: 60ch; text-align: center; color: var(--encre-douce); font-size: 12.5px; opacity: 0.8; }
.gc__vide { margin: 40px auto; max-width: 30ch; text-align: center; color: var(--encre-douce); font-size: 17px; }

/* Un livre : sa couverture (trois images finies en éventail), son nom, son avancement. */
.gc-livres { display: grid; grid-template-columns: repeat(auto-fill, minmax(max(232px, 22%), 1fr)); gap: 18px; } /* quatre livres par rangée au plus */
.gc-livre { position: relative; display: block; width: 100%; padding: 16px 16px 14px !important; border-radius: 20px; background: linear-gradient(165deg, color-mix(in srgb, var(--t) 46%, #1b1a24) 0, #1b1a24 62%) !important; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07); transition: transform 0.16s ease, box-shadow 0.16s ease; }
.gc-livre:hover { transform: translateY(-4px); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--t) 70%, transparent), 0 22px 30px -18px color-mix(in srgb, var(--t) 60%, #000); }
.gc-livre__images { position: relative; display: block; aspect-ratio: 4 / 3; margin-bottom: 12px; }
.gc-livre__images img { position: absolute; top: 6%; left: 50%; width: 44%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 9px; background: #2b2a37; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9), 0 14px 22px -10px rgba(0, 0, 0, 0.8); }
.gc-livre__images img:nth-child(1) { z-index: 2; transform: translateX(-50%); top: 2%; width: 47%; }
.gc-livre__images img:nth-child(2) { transform: translateX(-118%) rotate(-9deg); }
.gc-livre__images img:nth-child(3) { transform: translateX(18%) rotate(9deg); }
.gc-livre__images--2 img:nth-child(1) { transform: translateX(-88%) rotate(-5deg); }
.gc-livre__images--2 img:nth-child(2) { transform: translateX(-12%) rotate(6deg); }
.gc-livre strong { display: block; font-family: var(--titre); font-weight: 620; font-size: 21px; letter-spacing: -0.014em; }
.gc-livre small { display: block; min-height: 2.6em; margin-top: 2px; color: var(--encre-douce); font-size: 14px; }
.gc-livre__avance { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.gc-livre__avance > span { flex: 1; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.gc-livre__avance i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.gc-livre__avance b { flex: none; font-size: 13.5px; font-weight: 700; color: var(--encre-douce); font-variant-numeric: tabular-nums; }

/* L'en-tête d'un livre ouvert. */
.gc-entete { display: flex; align-items: center; gap: 14px; margin: 8px 0 16px; padding: 14px 18px 14px 12px; border-radius: 20px; background: linear-gradient(100deg, color-mix(in srgb, var(--t) 40%, #1b1a24) 0, #1b1a24 75%); }
.gc-entete > div { flex: 1; min-width: 0; }
.gc-entete h2 { margin: 0; font-size: 26px; }
.gc-entete p { margin: 2px 0 0; color: var(--encre-douce); font-size: 14.5px; }
.gc-entete .gc-livre__avance { flex: none; width: min(34%, 220px); margin: 0; }
.gc-rond { flex: none; display: grid !important; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, 0.1) !important; }
.gc-rond:hover { background: rgba(255, 255, 255, 0.2) !important; }
.gc-rond svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }

/* Un dessin : sa grille, son cliché en cours ou l'image finie ; son nom, sa difficulté, son cœur. */
/* Cinq dessins par rangée au plus : sur un grand écran, des cartes qu'on lit, pas dix timbres sur une ligne. */
.gc-dessins { display: grid; grid-template-columns: repeat(auto-fill, minmax(max(150px, 18%), 1fr)); gap: 24px 20px; }
.gc-dessins--rail { display: flex; gap: 14px; margin: 0 calc(-1 * clamp(14px, 3.2vw, 40px)); padding: 2px clamp(14px, 3.2vw, 40px) 6px; overflow: auto hidden; scrollbar-width: none; }
.gc-dessins--rail::-webkit-scrollbar { display: none; }
.gc-dessins--rail > li { flex: none; width: 132px; }
.gc-dessin { position: relative; }
.gc-dessin__ouvrir { display: block; width: 100%; }
.gc-dessin__image { position: relative; display: block; aspect-ratio: 3 / 4; border-radius: 12px; background: #fff; overflow: hidden; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 14px 22px -14px rgba(0, 0, 0, 0.9); transition: transform 0.16s ease; }
.gc-dessin__ouvrir:hover .gc-dessin__image { transform: translateY(-3px); }
.gc-dessin__image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gc-dessin__image em { position: absolute; left: 7px; top: 7px; display: inline-flex; align-items: center; gap: 3px; height: 24px; padding: 0 9px; border-radius: 999px; background: rgba(17, 16, 24, 0.86); color: var(--encre); font-style: normal; font-weight: 700; font-size: 12.5px; }
.gc-dessin--fini .gc-dessin__image em { background: var(--c-sapin-fort); color: #fff; }
.gc-dessin__image em svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.gc-dessin__image > i { position: absolute; left: 0; bottom: 0; height: 6px; background: var(--accent); box-shadow: 0 0 0 1px rgba(17, 16, 24, 0.6); }
.gc-dessin strong { display: block; margin-top: 9px; font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gc-niveau { display: flex; align-items: center; gap: 6px; margin-top: 1px; color: var(--encre-douce); font-size: 12.5px; white-space: nowrap; }
.gc-niveau b { flex: none; width: 18px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--n) 0 var(--p), rgba(255, 255, 255, 0.16) var(--p)); }
.gc-niveau--1 { --n: #5ad1a0; --p: 34%; } .gc-niveau--2 { --n: #ffc35a; --p: 67%; } .gc-niveau--3 { --n: #ff6f6f; --p: 100%; }
.gc-dessin__coeur { position: absolute; right: 6px; top: 6px; display: grid !important; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: rgba(17, 16, 24, 0.72) !important; color: #fff !important; }
.gc-dessin__coeur svg { width: 20px; height: 20px; }
.gc-dessin__coeur[aria-pressed='true'] { color: var(--coeur) !important; }
.gc-dessin__coeur:hover { background: rgba(17, 16, 24, 0.95) !important; }

/* Très grand écran : le contenu ne s'étale pas au-delà de 1 500 px (les vignettes font 280 px de large). */
@media (min-width: 1580px) { .gc__tete, .gc__corps { padding-left: calc((100% - 1500px) / 2); padding-right: calc((100% - 1500px) / 2); } .gc-dessins--rail { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; } }
/* Téléphone tenu debout : les onglets passent en bas, sous le pouce ; deux livres par rangée. */
@media (max-width: 640px) and (orientation: portrait) {
  .gc { grid-template-rows: auto minmax(0, 1fr) auto; }
  .gc__tete { display: contents; }
  .gc__marque { grid-row: 1; padding: 14px 16px 6px; font-size: 24px; }
  .gc__corps { grid-row: 2; padding: 0 16px 20px; }
  .gc__onglets { grid-row: 3; margin: 0; padding: 6px 10px calc(6px + env(safe-area-inset-bottom, 0px)); border-radius: 0; background: #1b1a24; border-top: 1px solid var(--trait); }
  .gc__onglet { flex: 1; height: 44px; text-align: center !important; }
  .gc-livres { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .gc-livre { padding: 12px 12px 12px !important; border-radius: 16px; }
  .gc-livre strong { font-size: 18px; }
  .gc-livre small { font-size: 12.5px; }
  .gc-dessins { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
  .gc-dessins--rail { margin: 0 -16px; padding: 2px 16px 6px; }
  .gc-entete { flex-wrap: wrap; padding: 12px; }
  .gc-entete .gc-livre__avance { width: 100%; }
  .gc-entete h2 { font-size: 23px; }
}
/* Un cadre bas (800 × 450) : la tête s'affine, les livres passent à quatre par rangée. */
@media (max-height: 560px) and (orientation: landscape) {
  .gc__tete { padding-top: 8px; padding-bottom: 4px; }
  .gc__marque { font-size: 21px; } .gc__marque i { width: 22px; height: 22px; }
  .gc__onglet { height: 34px; }
  .gc h2 { margin: 10px 0 8px; font-size: 19px; }
  .gc-livres { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
  .gc-livre { padding: 12px !important; }
  .gc-livre small { display: none; }
  .gc-dessins { grid-template-columns: repeat(auto-fill, minmax(max(118px, 15%), 1fr)); gap: 14px 12px; }
  .gc-dessins--rail > li { width: 104px; }
  .gc-entete { margin: 4px 0 10px; padding: 8px 14px 8px 8px; }
  .gc-entete h2 { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) { .gc * { transition: none !important; } }
