/* Commun aux quatre propositions : le boulier libre (ajouts à boulier.css et tama.css de la v3),
   le logo Sorotama, le soulignement (jamais de surlignage), la fiche A4.
   Couleurs : seulement les variables de tama.css (greffe v3, bulle corrigée de tarifs-v2). */

/* ---------- mise en valeur : un trait sous les jambages, jamais derrière les lettres ---------- */
.bulle b, .souligne, h1 em, h2 em {
  font-style: normal; background: none; padding: 0;
  text-decoration-line: underline; text-decoration-color: var(--tomate); text-decoration-thickness: .13em;
  text-underline-position: under; text-underline-offset: .08em; text-decoration-skip-ink: none;
}
.bulle b { text-decoration-color: var(--soleil-fonce); white-space: nowrap; }

/* ---------- logo ---------- */
.logo .mot { letter-spacing: -.02em; }
.logo .mot i { font-style: normal; color: var(--tomate-fonce); }
.nuit .logo .mot i { color: var(--soleil); }

/* ---------- boulier libre : tige = curseur au clavier, toute la tige se touche ---------- */
.bl { --g: var(--b); }
.bl .sb-rod { cursor: pointer; touch-action: manipulation; outline: none; }
.bl .sb-rod:focus-visible::after { content: ""; position: absolute; inset: -2px 1px; border: 3px solid var(--focus); border-radius: 12px; pointer-events: none; z-index: 3; }
.bl .sb-bead { pointer-events: none; }
.bl.bl-fin { --bar: 10px; --sb-tige-l: 3px; }
.bl.bl-fin .sb-bead { width: calc(var(--w) * .98); margin-left: calc(var(--w) * -.49); }
.bl.bl-fin .sb-bead .bd-trait { stroke-width: 2.5; }
.bl.bl-fin .sb-bead .bd-reflet { stroke-width: 2.5; }
.bl.bl-fin .sb-dot { width: 6px; height: 6px; }
.bl.bl-fin .sb-frame { padding: 8px; border-radius: 18px; }
.bl.bl-fin .sb-rods { padding: 4px 2px; border-radius: 12px; }
.bl-etiq .sb-rods, .bl-etiq.bl-fin .sb-rods { padding-bottom: 30px; }
.bl-place { position: absolute; left: 50%; bottom: -27px; transform: translateX(-50%); font: 800 15px/1 var(--body); color: var(--doux); white-space: nowrap; }
/* Tiges fines : seulement u, d, c et le début de chaque groupe de trois (m, M, G, T) */
.bl-fin .bl-place.sec { display: none; }
h1 em, h2 em { white-space: nowrap; }

/* Le halo d'une boule qui va bouger (geste montré), et l'invitation de l'arrivée */
.sb-bead.halo::after, .sb-bead.invite-halo::after {
  content: ""; position: absolute; inset: -6px -4px; border-radius: 50%; border: 3px solid var(--soleil-fonce);
  box-shadow: 0 0 0 4px var(--soleil-clair); animation: halo 1.1s ease-in-out infinite; }
@keyframes halo { 0%, 100% { transform: scale(.94); opacity: .55; } 50% { transform: scale(1.06); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sb-bead.halo::after, .sb-bead.invite-halo::after { animation: none; opacity: 1; } }

/* La pastille du doigt : « pouce ↑ », « index ↓ » */
.bl-geste { position: absolute; bottom: calc(100% + 10px); transform: translateX(-50%); z-index: 6; display: flex; gap: 6px; pointer-events: none;
  animation: pop-in .25s var(--pop); transition: opacity .35s ease; }
.bl-geste b { font: 800 15px/1 var(--body); padding: 6px 11px; border: 2.5px solid var(--encre); border-radius: 999px; background: var(--blanc); box-shadow: 0 3px 0 var(--encre); white-space: nowrap; }
.bl-geste b:first-child { background: var(--soleil); }
.bl-geste.part { opacity: 0; }

/* Bande de lecture : le chiffre de chaque tige, au-dessus d'elle (tableau de numération) */
.bl-bande { display: flex; justify-content: center; padding: 0 0 8px; }
.bl-bande b { width: var(--w); flex: none; text-align: center; font: 700 clamp(15px, calc(var(--w) * .46), 30px)/1.15 var(--display); font-variant-numeric: tabular-nums; color: var(--encre); }
.bl-bande b.zero { color: var(--doux); font-weight: 400; }
.bl-cache .bl-bande b { font-size: 0; }
.bl-cache .bl-bande b::before { content: "?"; font: 700 clamp(15px, calc(var(--w) * .46), 30px)/1.15 var(--display); color: var(--doux); }

/* Petit boulier d'ensemble */
.bl-mini { display: block; cursor: pointer; }
.bl-mini svg { width: 100%; height: auto; }
.bm-cadre { fill: var(--blanc); stroke: var(--encre); stroke-width: 2.5; }
.bm-loupe { fill: var(--soleil-doux); stroke: var(--tomate-fonce); stroke-width: 3; }
.bm-tige { stroke: var(--encre); stroke-width: 1.6; }
.bm-barre { fill: var(--encre); }
.bm-point { fill: var(--soleil); }
.bm-h, .bm-b { stroke: var(--encre); stroke-width: 1.4; }
.bm-h { fill: var(--prune); } .bm-b { fill: var(--tomate); }

/* Réglages : pilules à cocher, ronds d'outil */
.choix { display: inline-flex; padding: 4px; gap: 4px; border: var(--trait); border-radius: 18px; background: var(--blanc); box-shadow: 0 4px 0 var(--encre); }
.choix button { min-width: 44px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 13px; background: none; font: 700 1.1rem/1 var(--display); color: var(--encre); cursor: pointer; }
.choix button[aria-pressed="true"] { background: var(--encre); color: var(--papier); }
.outil { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; min-width: 48px; padding: 0 14px; border: var(--trait); border-radius: 16px;
  background: var(--blanc); box-shadow: 0 4px 0 var(--encre); font: 800 1rem/1.1 var(--body); color: var(--encre); cursor: pointer; text-decoration: none; }
.outil:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--encre); }
.outil[aria-pressed="true"] { background: var(--soleil); }
.outil svg { width: 22px; height: 22px; flex: none; }
[hidden] { display: none !important; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nombre { font-variant-numeric: tabular-nums; }
.saisie { min-height: 56px; width: 100%; border: var(--trait); border-radius: 16px; padding: 0 16px; font: 700 1.6rem/1 var(--display); color: var(--encre); background: var(--blanc); text-align: center; }

/* ---------- la fiche A4, noir et blanc ---------- */
.barre-fiche { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding-top: 20px; padding-bottom: 6px; }
.barre-fiche h1 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); flex: 1 1 200px; }
.barre-actions { display: flex; gap: 12px; }
.page-fiche .feuilles { background: var(--papier-2); border-top: var(--trait); margin-top: 14px; }
@page { size: A4 portrait; margin: 0; }
.a4 { --nb-encre: #111; --nb-gris: #6a6a6a; --nb-clair: #d6d6d6; --nb-trame: #ececec;
  width: 210mm; height: 297mm; overflow: hidden; position: relative; background: #fff; color: var(--nb-encre);
  font-family: var(--body); font-weight: 700; font-size: 12pt; line-height: 1.35;
  -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.a4 .tama-nb { --tomate: #fff; --tomate-clair: #fff; --tomate-fonce: #9a9a9a; --joue: #c8c8c8; --bouche: #111; --langue: #bbb; --tige: #fff; --feuille: #fff; --encre: #111; --blanc: #fff; }
.a4 svg .t-tige { stroke: #111; stroke-width: 2.2; }
.a4 svg .t-barre { fill: #111; }
.a4 svg .t-point { fill: #fff; stroke: #111; stroke-width: 1.4; }
.a4 svg .t-cadre { fill: none; stroke: #111; stroke-width: 2.2; }
.a4 svg .t-b { fill: var(--nb-clair); stroke: #111; stroke-width: 2; }
.a4 svg .t-b.vide { fill: #fff; }
.a4 svg .t-b.colorie { fill: #555; }
.a4 section, .a4 header, .a4 footer { padding: 0; }
.a4 h2 { font-size: inherit; }
.apercu { position: relative; overflow: hidden; aspect-ratio: 210 / 297; width: 100%; min-width: 0; background: #fff; border: var(--trait); border-radius: 10px; }
.apercu .a4 { zoom: var(--zp, .3); position: absolute; top: 0; left: 0; }
.feuilles { display: grid; justify-content: center; gap: 28px; padding: 24px 12px 60px; }
.feuilles .a4 { zoom: var(--z, 1); box-shadow: 0 0 0 1px #0002, 0 10px 30px #2B1E2F26; }
@media print {
  html, body { background: #fff !important; }
  body > :not(main), .pas-imprime { display: none !important; }
  main > :not(.feuilles) { display: none !important; }
  /* Rien autour des feuilles : la bande beige, son trait et ses marges de l'écran sortaient à l'impression
     et poussaient le pied de la page 1 sur une page de plus. */
  .feuilles, .page-fiche .feuilles { display: block; margin: 0; padding: 0; border: 0; background: none; }
  .feuilles .a4 { zoom: 1; box-shadow: none; }
  /* Saut avant la feuille suivante, jamais après la dernière (pas de page blanche). */
  .feuilles .a4 + .a4 { break-before: page; }
}
