/* Fiche du jeu (étape 6, page de référencement) et page de décompte. Tokens dans tokens.css. */

html { scroll-behavior: smooth; }
.front { --surface-2: oklch(0.25 0.022 285); --filet: oklch(0.30 0.02 285); }

/* ---------- Face de dé : le barème d'une règle ---------- */
/* Pleine = barème fixe ; détourée = ça dépend de la carte ou de la partie. La forme porte l'info, pas la teinte. */
.valeur { flex: none; width: 64px; height: 56px; border-radius: var(--radius-de); display: flex; flex-direction: column; align-items: center; justify-content: center; font: 800 17px/1 var(--font-chiffres); letter-spacing: -0.5px; text-align: center; }
.valeur small { display: block; font: 600 10px/12px var(--font-texte); letter-spacing: 0; margin-top: 2px; }
.valeur.fixe { background: var(--ambre); color: var(--nuit); }
.valeur.variable { color: var(--score); border: 2px solid var(--score); }
.valeur-egalite { background: var(--vert); color: var(--nuit); font-size: 24px; }

.exemple { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 12px; padding: 10px 12px; border-radius: 12px; background: var(--fond); font-size: 14px; line-height: 20px; }
.exemple b { font: 700 14px/20px var(--font-chiffres); color: var(--score); white-space: nowrap; }

/* ---------- Fiche du jeu (étape 6) ---------- */
/* Mobile : une colonne ; .fj-gauche et .fj-cote s'effacent, l'ordre vient des « order ». Bureau : deux colonnes, plus bas. */
.fj { display: flex; flex-direction: column; gap: 20px; }
.fj-gauche, .fj-cote { display: contents; }
.fj-tete { order: 1; } .fj-bref { order: 2; } .fj-feuilles { order: 3; } .fj-infos { order: 4; } .fj-score { order: 5; }
.fj-parties { order: 6; } .fj-autres { order: 7; }
.surtitre { display: inline-flex; align-items: center; gap: 8px; font: 700 13px/18px var(--font-texte); text-transform: uppercase; letter-spacing: 1.2px; color: var(--rose); }
.surtitre svg { width: 18px; height: 18px; flex: none; }
.fj-tete { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: start; }
.fj-tete-texte { display: flex; flex-direction: column; gap: 6px; container-type: inline-size; }
/* --mot = lettres du mot le plus long (show.html.twig) ; ~0,6 em par lettre : le mot tient sur une ligne (pas de hyphens : balance couperait des mots qui tiennent) */
.fj-titre { --taille-max: 44px; margin: 0; font: 800 clamp(26px, calc(100cqi / (var(--mot, 8) * 0.6)), var(--taille-max))/1 var(--font-display); letter-spacing: -1.4px; text-wrap: balance; overflow-wrap: break-word; }
.fj-titre span { display: block; margin-top: 6px; font-size: 21px; line-height: 26px; letter-spacing: -0.3px; color: var(--encre-douce); }
.fj-jaquette { width: 96px; border-radius: 16px; background: var(--surface); overflow: hidden; }
.fj-jaquette img { display: block; width: 100%; height: auto; }
.fj-bref { margin: 0; font-size: 17px; line-height: 26px; max-width: 60ch; }
.fj-infos { display: flex; flex-direction: column; gap: 16px; }
.bouton-feuille { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 22px; border-radius: var(--radius-pill); background: var(--rose); color: var(--nuit) !important; font-weight: 700; font-size: 17px; text-decoration: none; }
.bouton-feuille svg { width: 20px; height: 20px; flex: none; }
.fj-rassure { margin: 0; font-size: 13px; line-height: 18px; color: var(--encre-douce); }
.fj-feuilles { scroll-margin-top: 16px; }

/* Comment se compte le score : une ligne par source de points */
.fj-score { display: flex; flex-direction: column; gap: 16px; }
.fj-score p { margin: 0; max-width: 60ch; }
.fj-lignes { display: flex; flex-direction: column; padding: 4px 0; border-radius: 18px; background: var(--surface); }
.fj-ligne { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; align-items: center; padding: 8px 14px 8px 10px; }
.fj-ligne + .fj-ligne, .fj-egalite { border-top: 1px solid var(--filet); }
.fj-ligne strong { display: block; font-weight: 600; line-height: 20px; }
.fj-ligne span, .fj-egalite span { display: block; font-size: 13px; line-height: 18px; color: var(--encre-douce); }
.fj-egalite { padding: 10px 14px 8px; }
.fj-egalite strong { display: block; font-weight: 600; color: var(--vert); }

/* La règle qu'on oublie */
.oubli { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 20px; background: linear-gradient(160deg, oklch(0.32 0.08 8 / .55), var(--surface) 60%); box-shadow: inset 0 0 0 2px oklch(0.67 0.21 8 / .55); }
.oubli h3 { margin: 0; font: 800 20px/25px var(--font-display); }
.oubli p { font-size: 15px; line-height: 22px; }
.oubli .exemple { background: oklch(0 0 0 / .25); }
.oubli .exemple b { color: var(--rose); }
.vers-decompte { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 10px 14px; border-radius: 16px; box-shadow: inset 0 0 0 2px var(--filet); color: var(--encre) !important; text-decoration: none; font-weight: 600; line-height: 20px; }
.vers-decompte span { display: block; font-weight: 400; font-size: 13px; line-height: 18px; color: var(--encre-douce); }
.vers-decompte svg { width: 20px; height: 20px; flex: none; }

/* Mobile : le bouton reste à portée une fois le choix des feuilles dépassé (front.js) */
.fj-colle { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; padding: 12px var(--site-gouttiere, 16px) calc(16px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--fond) 70%, transparent); }
.fj-colle[hidden] { display: none; }

/* ---------- Page de décompte ---------- */
.tete-decompte { display: flex; flex-direction: column; gap: 24px; }
.tete-texte { display: flex; flex-direction: column; gap: 14px; }
.grand-titre { margin: 0; font: 800 38px/1 var(--font-display); letter-spacing: -1.4px; text-wrap: balance; }
.reponse { margin: 0; font-size: 18px; line-height: 27px; max-width: 46ch; }
.bouton-compter { align-self: flex-start; display: inline-flex; align-items: center; min-height: 48px; padding: 0 20px; border-radius: 12px; background: var(--accent); color: var(--nuit) !important; font-weight: 700; text-decoration: none; }

/* Le bloc de score, signature de la page : chaque ligne mène à sa règle */
.bloc { background: var(--creme); color: var(--nuit); border-radius: 20px; padding: 8px 8px 14px; }
.bloc table { width: 100%; border-collapse: collapse; }
.bloc caption { text-align: left; padding: 10px 10px 8px; font-size: 13px; line-height: 18px; }
.bloc th, .bloc td { padding: 0 10px; height: 42px; text-align: left; font-weight: 500; font-size: 15px; line-height: 18px; border-top: 1.5px solid color-mix(in oklab, var(--nuit) 18%, transparent); }
.bloc thead th { border-top: 0; height: 30px; font: 800 15px var(--font-display); }
.bloc .pts { width: 62px; text-align: right; font: 700 16px var(--font-chiffres); }
.bloc thead .pts { font: 800 15px var(--font-display); }
.bloc tbody a { color: var(--nuit) !important; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.bloc tfoot th, .bloc tfoot td { height: 56px; border-top: 3px solid var(--nuit); font: 800 18px var(--font-display); }
.bloc tfoot .pts { font: 800 26px var(--font-chiffres); letter-spacing: -1px; }
.bloc-issue { margin: 8px 10px 0; padding: 10px 12px; border-radius: 12px; background: var(--vert); font-size: 14px; line-height: 20px; font-weight: 600; }

.corps-decompte { display: flex; flex-direction: column; gap: 32px; margin-top: 12px; }
.sommaire { display: none; }
.article { display: flex; flex-direction: column; gap: 40px; min-width: 0; }
.point { display: flex; flex-direction: column; gap: 12px; scroll-margin-top: 16px; }
.point-tete { display: flex; align-items: center; gap: 14px; }
.point p { margin: 0; max-width: 62ch; }
.point .exemple { max-width: 62ch; background: var(--surface); }
.tableau { width: 100%; max-width: 62ch; border-collapse: collapse; background: var(--surface); border-radius: 16px; overflow: hidden; }
.tableau th, .tableau td { padding: 10px 12px; text-align: left; font-size: 14px; line-height: 20px; font-weight: 500; border-top: 1px solid var(--filet); }
.tableau thead th { border-top: 0; font-weight: 600; color: var(--encre-douce); font-size: 13px; }
.tableau .pts { text-align: right; font: 700 15px var(--font-chiffres); color: var(--score); }
.tableau thead .pts { font: 600 13px var(--font-texte); color: var(--encre-douce); }
.tableau .bareme { color: var(--score); font-weight: 600; }
.calcul { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 16px; background: var(--surface); max-width: 62ch; font-size: 15px; line-height: 22px; }
.calcul strong { font-weight: 600; }
.faq { display: flex; flex-direction: column; gap: 18px; }
.faq h3 { margin: 0 0 2px; font: 600 16px/22px var(--font-texte); }
.autres { display: flex; flex-wrap: wrap; gap: 8px; }
.autres a { padding: 8px 14px; border-radius: var(--radius-pill); background: var(--surface); color: var(--encre) !important; text-decoration: none; font-size: 14px; }

/* ---------- Bureau ---------- */
@media (min-width: 760px) {
    .corps-decompte { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 20px 48px; align-items: start; }
    .sommaire { position: sticky; top: 24px; }
    .sommaire { display: flex; flex-direction: column; }
    .sommaire a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; padding: 0 12px; border-radius: 10px; color: var(--encre-douce) !important; text-decoration: none; font-size: 14px; }
    .sommaire a:hover { background: var(--surface); color: var(--encre) !important; }
    .sommaire b { font: 700 13px var(--font-chiffres); color: var(--score); }
}
@media (min-width: 960px) {
    .fj { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 48px; align-items: start; }
    .fj-gauche { display: flex; flex-direction: column; gap: 28px; min-width: 0; }
    .fj-cote { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 18px; padding: 18px; border-radius: 22px; background: oklch(0.2 0.015 285); }
    .fj-cote > * { order: 0; }
    .fj-colle { display: none !important; }
    .fj-titre { --taille-max: 64px; letter-spacing: -2px; }
    .fj-titre span { font-size: 26px; line-height: 34px; }
    .fj-jaquette { width: 160px; }
    .fj-bref { font-size: 19px; line-height: 30px; }
    .fj-score { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
    .fj-score-cote { padding-top: 36px; }
    .tete-decompte { display: grid; grid-template-columns: minmax(0, 1fr) 500px; gap: 56px; align-items: center; }
    .grand-titre { font-size: 60px; letter-spacing: -2.4px; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}
