/* Tableau de jetons LeoBelo, version 1.0.0. Classes préfixées tj-. Couleurs : jetons du socle (palette fluo). */
.tj-ecran[hidden] { display: none !important; }
.tj-marque { font-weight: 700; }

/* Teinte choisie : posée sur html[data-couleur] */
html { --tj-fonce: var(--lb-bleu-fonce); --tj-vif: var(--lb-bleu-vif); --tj-moyen: var(--lb-bleu-moyen); --tj-clair: var(--lb-bleu-clair); --tj-dessus: #66DDF5; --tj-pastel: #A6EAF8; }
html[data-couleur="orange"] { --tj-fonce: var(--lb-orange-fonce); --tj-vif: var(--lb-orange-vif); --tj-moyen: var(--lb-orange-moyen); --tj-clair: var(--lb-orange-clair); --tj-dessus: #FFAE66; --tj-pastel: #FFCB99; }
html[data-couleur="vert"] { --tj-fonce: var(--lb-vert-fonce); --tj-vif: var(--lb-vert-vif); --tj-moyen: var(--lb-vert-moyen); --tj-clair: var(--lb-vert-clair); --tj-dessus: #B0F05A; --tj-pastel: #CBF28F; }

/* Jetons : vif toujours cerné de foncé (document 05, section 1.2) */
.tj-jeton { display: block; width: 100%; height: 100%; }
.tj-j-trait { stroke: var(--tj-fonce); stroke-width: 5; stroke-linejoin: round; }
.tj-j-face { fill: var(--tj-vif); }
.tj-j-dessus { fill: var(--tj-dessus); }
.tj-j-cote { fill: var(--tj-moyen); }

/* Écran de réglage */
.tj-reprendre { width: 100%; margin: var(--lb-pas) 0; }
.tj-nombres { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--lb-pas); }
@media (min-width: 30em) { .tj-nombres { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.tj-choix { padding: 0.5rem; }
.tj-nombres .tj-choix { font-size: 1.25rem; }
.tj-choix[aria-pressed="true"] { color: var(--lb-encre); background: var(--tj-vif); border-color: var(--tj-fonce); box-shadow: inset 0 0 0 0.125rem var(--tj-fonce); }
.tj-bloc { border: 0; padding: 0; margin: calc(var(--lb-pas) * 3) 0 0; min-width: 0; }
.tj-bloc > legend { padding: 0; }
.tj-bloc > legend h2 { margin-top: 0; }
.tj-formes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--lb-pas); }
.tj-vignette { flex-direction: column; gap: 0.25rem; padding: 0.5rem 0.25rem; }
.tj-vignette .tj-jeton { width: 2.75rem; height: 2.75rem; }
.tj-couleurs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--lb-pas); margin-top: var(--lb-pas); }
.tj-couleur { gap: 0.5rem; padding: 0.5rem 0.25rem; }
.tj-pastille { width: 1.25rem; height: 1.25rem; border-radius: 0.3rem; flex: none; }
.tj-p-bleu { background: var(--lb-bleu-vif); border: 0.125rem solid var(--lb-bleu-fonce); }
.tj-p-orange { background: var(--lb-orange-vif); border: 0.125rem solid var(--lb-orange-fonce); }
.tj-p-vert { background: var(--lb-vert-vif); border: 0.125rem solid var(--lb-vert-fonce); }
.tj-couleur[aria-pressed="true"] .tj-pastille { box-shadow: 0 0 0 0.1875rem #FFFFFF; } /* pastille détachée du fond vif du bouton choisi */
.tj-commencer-ligne { margin: calc(var(--lb-pas) * 3) 0 0; }
.tj-commencer { width: 100%; min-height: 3.5rem; font-size: 1.2rem; background: var(--tj-vif); border-color: var(--tj-fonce); }
.tj-imprimer { margin-top: calc(var(--lb-pas) * 3); }
.tj-aide ol { padding-left: 1.25rem; }
.tj-aide li { margin-bottom: var(--lb-pas); }
.tj-aide a { color: var(--lb-bleu-fonce); font-weight: 700; }

/* Écran du tableau : une seule zone, rien de décoratif autour des cases */
.tj-tableau { max-width: 44rem; margin: 0 auto; padding: calc(var(--lb-pas) * 2) calc(var(--lb-pas) * 2) calc(var(--lb-pas) * 4); }
.tj-haut { min-height: 2.5rem; margin-bottom: calc(var(--lb-pas) * 2); }
.tj-recompense, .tj-tache, .tj-fin-texte { overflow-wrap: anywhere; word-break: break-word; }
.tj-recompense { font-size: 1.375rem; line-height: 1.3; font-weight: 700; margin: 0 0 0.25rem; }
.tj-tache { font-size: 1.125rem; margin: 0; color: var(--lb-gris-texte); }
.tj-grille { list-style: none; margin: 0 auto; padding: 0; display: grid; gap: 0.625rem; width: 100%; max-width: 40rem; }
.tj-grille[data-colonnes="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 20rem; }
.tj-grille[data-colonnes="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 28rem; }
.tj-grille[data-colonnes="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 34rem; }
.tj-grille[data-colonnes="5"] { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.tj-case { position: relative; padding-bottom: 100%; border: 0.1875rem solid var(--lb-gris-trait); border-radius: var(--lb-rayon); background: var(--lb-fond); }
.tj-case .tj-jeton { position: absolute; top: 12%; left: 12%; width: 76%; height: 76%; }
.tj-numero { position: absolute; top: 0.25rem; left: 0.45rem; font-size: 1.125rem; font-weight: 700; line-height: 1; color: var(--lb-gris-texte); }
.tj-case.tj-pleine { border-color: var(--tj-fonce); }
.tj-case.tj-pleine .tj-numero { display: none; }
.tj-reste { text-align: center; font-size: 1.125rem; font-weight: 700; margin: calc(var(--lb-pas) * 1.5) 0 0; min-height: 1.6em; }

/* Pose d'un jeton : un seul petit mouvement, joué une fois, jamais en mode calme ni en animations réduites */
@keyframes tj-poser { from { transform: scale(0.6); opacity: 0.4; } to { transform: scale(1); opacity: 1; } }
html[data-animations="normales"] .tj-pose .tj-jeton { animation: tj-poser 0.3s ease-out 1; }

/* Fin : changement visuel bref et calme, sans son par défaut, sans confettis */
.tj-fin { display: none; align-items: center; gap: calc(var(--lb-pas) * 2); margin: calc(var(--lb-pas) * 2) 0 0; padding: calc(var(--lb-pas) * 1.5) calc(var(--lb-pas) * 2);
  border: 0.1875rem solid var(--tj-fonce); border-radius: var(--lb-rayon); background: var(--tj-clair); }
.tj-tableau[data-etat="fin"] .tj-fin { display: flex; }
.tj-tableau[data-etat="fin"] .tj-reste, .tj-tableau[data-etat="fin"] .tj-phrase { display: none; }
.tj-tableau[data-etat="fin"] .tj-grille { background: var(--tj-clair); border-radius: var(--lb-rayon); box-shadow: 0 0 0 0.5rem var(--tj-clair); }
.tj-coche { width: 3rem; height: 3rem; flex: none; color: var(--tj-fonce); }
.tj-fin { flex-wrap: wrap; }
.tj-fin > div { flex: 1 1 12rem; }
.tj-fin p { margin: 0 0 0.25rem; }
.tj-fin-titre { font-size: 1.375rem; font-weight: 700; }
.tj-fin-texte { font-size: 1.125rem; font-weight: 700; }

.tj-action { display: flex; justify-content: center; margin: calc(var(--lb-pas) * 2) 0 0; }
.tj-fin:focus { outline: none; }
.tj-fin:focus-visible { outline: 0.1875rem solid var(--lb-encre); outline-offset: 0.1875rem; }
.tj-donner { min-width: 16rem; background: var(--tj-vif); border-color: var(--tj-fonce); }
.tj-phrase { text-align: center; margin-top: var(--lb-pas); }
.tj-adulte { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--lb-pas); margin-top: calc(var(--lb-pas) * 2); }
.tj-adulte .lb-info { flex-basis: 100%; text-align: center; margin: 0; }

/* Habillage 1.0.0 (26/11/2026, demande de Bruno : plus vif, plus fini, sans dénaturer).
   Aucune animation ajoutée : seules des couleurs, des ombres fixes et des bords changent. */
.tj-j-trait { stroke-width: 4; }
.tj-jeton { filter: drop-shadow(0 0.1875rem 0 rgba(26, 26, 26, 0.18)); }
.tj-vignette .tj-jeton { filter: none; }
/* Les cases posées sur un plateau pastel ; case vide en pointillés de la teinte, numéro en teinte foncée */
.tj-grille { background: var(--tj-clair); border-radius: calc(var(--lb-rayon) * 1.5); padding: 0.75rem; box-sizing: border-box; box-shadow: inset 0 0 0 0.125rem var(--tj-pastel); }
.tj-case { border: 0.1875rem dashed var(--tj-moyen); background: #FFFFFF; }
.tj-numero { color: var(--tj-fonce); }
.tj-case.tj-pleine { border-style: solid; border-color: var(--tj-fonce); background: #FFFFFF; box-shadow: 0 0.1875rem 0 var(--tj-pastel); }
/* Gros boutons : couleur vive, bord foncé et une lèvre fixe en dessous, comme un bouton qu'on presse */
.tj-donner, .tj-commencer { box-shadow: 0 0.3125rem 0 var(--tj-fonce); margin-bottom: 0.3125rem; }
.tj-donner:active, .tj-commencer:active { box-shadow: 0 0.3125rem 0 var(--tj-fonce), inset 0 0 0 0.1875rem var(--tj-fonce); }
.tj-choix[aria-pressed="true"] { box-shadow: inset 0 0 0 0.125rem var(--tj-fonce), 0 0.1875rem 0 var(--tj-fonce); }
/* Fin : le plateau passe au pastel soutenu, la coche pleine en couleur vive */
.tj-tableau[data-etat="fin"] .tj-grille { background: var(--tj-pastel); box-shadow: 0 0 0 0.1875rem var(--tj-fonce); }
.tj-fin { background: #FFFFFF; border-color: var(--tj-fonce); box-shadow: 0 0.3125rem 0 var(--tj-pastel); }
.tj-coche { color: var(--lb-encre); }
.tj-coche circle { fill: var(--tj-vif); stroke: var(--tj-fonce); }
/* Contraste renforcé : pas d'ombre décorative, traits pleins */
html[data-contraste="fort"] .tj-jeton, html[data-contraste="fort"] .tj-case, html[data-contraste="fort"] .tj-fin { filter: none; box-shadow: none; }
html[data-contraste="fort"] .tj-case { border-style: solid; }

/* Impression : le tableau, noir sur blanc */
.tj-impression h1 { font-size: 22pt; margin: 0 0 6mm; }
.tj-i-ligne { font-size: 14pt; margin: 0 0 6mm; border-bottom: 0.3mm solid #808080; padding-bottom: 2mm; min-height: 9mm; }
.tj-i-grille { display: grid; gap: 4mm; margin-top: 8mm; }
.tj-i-grille[data-colonnes="2"] { grid-template-columns: repeat(2, 45mm); }
.tj-i-grille[data-colonnes="3"] { grid-template-columns: repeat(3, 45mm); }
.tj-i-grille[data-colonnes="4"] { grid-template-columns: repeat(4, 40mm); }
.tj-i-grille[data-colonnes="5"] { grid-template-columns: repeat(5, 34mm); }
.tj-i-case { border: 0.6mm solid #808080; border-radius: 3mm; height: 34mm; position: relative; }
.tj-i-grille[data-colonnes="2"] .tj-i-case, .tj-i-grille[data-colonnes="3"] .tj-i-case { height: 45mm; }
.tj-i-grille[data-colonnes="4"] .tj-i-case { height: 40mm; }
.tj-i-case span { position: absolute; top: 1mm; left: 2mm; font-size: 14pt; font-weight: 700; color: #5F5B54; }
.tj-i-pied { margin-top: 10mm; font-size: 9pt; color: #5F5B54; }
@media print {
  .tj-ecran { display: none !important; }
  .tj-impression { display: block !important; }
}

/* Téléphone en paysage : les cases à gauche, le bouton et la fin à droite, tout visible sans défiler */
@media (orientation: landscape) and (max-height: 32em) {
  .tj-tableau { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); column-gap: 1.5rem; align-items: start; max-width: 60rem; padding-top: var(--lb-pas); }
  .tj-haut { grid-column: 1 / -1; margin-bottom: var(--lb-pas); }
  .tj-recompense { font-size: 1.2rem; }
  .tj-grille { grid-column: 1; grid-row: 2 / span 5; width: 100%; }
  .tj-reste, .tj-fin, .tj-action, .tj-phrase, .tj-adulte { grid-column: 2; }
  .tj-reste { margin-top: 0; }
  .tj-action { margin-top: var(--lb-pas); }
  .tj-donner { min-width: 0; width: 100%; }
  .tj-tableau { padding-bottom: calc(var(--lb-pas) * 4); }
  .tj-adulte .lb-bouton { min-height: var(--lb-cible); padding: 0.4rem 0.75rem; }
}
