/* Feuille de score : compteur de points pour jeux (général, Yams, équipes) */
.o-feuille-score { background: var(--surface); color: var(--texte); }
.o-feuille-score [hidden] { display: none !important; }
.o-feuille-score-titre { margin: 0 0 10px; font-size: 1.25rem; }
.o-feuille-score-sous-titre { margin: 22px 0 8px; font-size: 1.05rem; }
.o-feuille-score-modes { display: flex; flex-wrap: wrap; gap: 8px; }
.o-feuille-score-modes .btn { min-height: 44px; border-radius: 999px; }
.atelier .o-feuille-score-modes .btn[aria-pressed="true"] { background: var(--marque); border-color: var(--marque); color: var(--sur-marque); }
.o-feuille-score-modes + .tirage-astuce { margin: 8px 0 14px; }

.o-feuille-score-joueurs-tete { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 8px; }
.o-feuille-score-joueurs-tete label { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--texte-2); }
.o-feuille-score-joueurs-tete input { width: 5em; }
.o-feuille-score-joueurs { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin: 0 0 10px; padding: 0; list-style: none; }
.o-feuille-score-joueur { display: flex; align-items: center; gap: 8px; padding: 6px; border: 1px solid var(--bord); border-radius: var(--rayon-petit); background: var(--surface-2); }
.o-feuille-score-joueur input { flex: 1; min-width: 0; min-height: 38px; }
.o-feuille-score-pastille { flex: none; width: 30px; height: 30px; border: 2px solid var(--surface); border-radius: 50%; box-shadow: 0 0 0 1px var(--bord); cursor: pointer; }
.o-feuille-score-oter { flex: none; width: 34px; height: 34px; border: 0; border-radius: 50%; background: none; color: var(--texte-2); font-size: 1.3rem; cursor: pointer; }
.o-feuille-score-oter:hover:not(:disabled) { background: var(--erreur-fond); color: var(--erreur-texte); }
.o-feuille-score-oter:disabled { opacity: .3; cursor: default; }
.o-feuille-score-config .reglages { margin-top: 16px; }
.o-feuille-score-config .tirage-scene { padding: 18px 0 6px; }

.o-feuille-score-tete { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.o-feuille-score-objectif { color: var(--texte-2); font-size: .92rem; }
.o-feuille-score-etat { display: block; margin: 6px 0 14px; padding: 8px 12px; border-radius: var(--rayon-petit); background: var(--surface-2); font-weight: 600; }
.o-feuille-score.fini .o-feuille-score-etat { background: var(--ok-fond); color: var(--ok-texte); }
.o-feuille-score-message { display: block; margin: 10px 0 0; }
.o-feuille-score-message.erreur { color: var(--erreur-texte); font-weight: 600; }

.o-feuille-score-champs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.o-feuille-score-champ label { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font-size: .9rem; font-weight: 600; overflow-wrap: anywhere; }
.o-feuille-score-ligne { display: flex; gap: 4px; }
.o-feuille-score-ligne input { flex: 1; min-width: 0; min-height: 46px; font: 600 1.25rem var(--police); font-variant-numeric: tabular-nums; text-align: right; border-left: 4px solid var(--c); }
.o-feuille-score-ligne input[aria-invalid="true"] { outline: 2px solid var(--erreur-texte); }
.o-feuille-score-signe { min-width: 44px; font-size: 1.2rem; }
.o-feuille-score-point { flex: none; display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--c, var(--marque)); }
.o-feuille-score-commandes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 6px; }
.o-feuille-score-commandes .btn { min-height: 44px; }

.o-feuille-score-defile { overflow-x: auto; margin-top: 12px; border: 1px solid var(--bord); border-radius: var(--rayon-petit); }
.o-feuille-score-defile:focus-visible { outline: 3px solid var(--marque); outline-offset: 2px; }
.o-feuille-score-tableau { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.o-feuille-score-tableau th, .o-feuille-score-tableau td { padding: 6px 10px; border-bottom: 1px solid var(--bord); text-align: right; white-space: nowrap; }
.o-feuille-score-tableau thead th { position: sticky; top: 0; background: var(--surface-2); border-bottom: 3px solid var(--c, var(--bord)); text-align: right; max-width: 9em; overflow: hidden; text-overflow: ellipsis; }
.o-feuille-score-tableau .o-feuille-score-num { width: 4.5em; text-align: left; color: var(--texte-2); font-weight: 500; }
.o-feuille-score-tableau tr.derniere td { background: var(--surface-2); }
.o-feuille-score-tableau td.negatif { color: var(--erreur-texte); }
.o-feuille-score-tableau tr.vide td { text-align: center; color: var(--texte-2); }
.o-feuille-score-tableau tfoot td, .o-feuille-score-tableau tfoot th { border-bottom: 0; border-top: 2px solid var(--texte-2); font-weight: 800; font-size: 1.1rem; color: var(--texte); }
.o-feuille-score-tableau td.meneur { color: var(--ok-texte); }
.o-feuille-score-tableau th.gagnant { background: var(--ok-fond); color: var(--ok-texte); }

.o-feuille-score-grille .o-feuille-score-cat { text-align: left; white-space: normal; min-width: 9.5em; }
.o-feuille-score-grille .o-feuille-score-cat small { display: block; color: var(--texte-2); font-weight: 400; font-size: .78rem; }
.o-feuille-score-grille td { padding: 4px 6px; }
.o-feuille-score-grille select { min-width: 4.6em; min-height: 38px; font: 600 1rem var(--police); font-variant-numeric: tabular-nums; text-align: right; }
.o-feuille-score-grille .o-feuille-score-sous th, .o-feuille-score-grille .o-feuille-score-sous td { background: var(--surface-2); font-weight: 700; }
.o-feuille-score-grille .o-feuille-score-sous.total th, .o-feuille-score-grille .o-feuille-score-sous.total td { font-size: 1.1rem; font-weight: 800; border-top: 2px solid var(--texte-2); }
.o-feuille-score-grille td.actif { background: color-mix(in srgb, var(--marque) 9%, transparent); }
.o-feuille-score-grille thead th.actif { color: var(--marque-fort); box-shadow: inset 0 -3px 0 var(--marque); }

.o-feuille-score-des-zone { padding: 10px 0; }
.o-feuille-score-des-case { display: flex; align-items: center; gap: 8px; }
.o-feuille-score-des-case input { width: 20px; height: 20px; accent-color: var(--marque); }
.o-feuille-score-des-panneau { margin-top: 10px; padding: 12px; border: 1px solid var(--bord); border-radius: var(--rayon); background: var(--surface-2); }
.o-feuille-score-des-tete { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.o-feuille-score-des-tete label { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--texte-2); }
.o-feuille-score-des { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 12px 0 4px; }
.o-feuille-score-de { width: 62px; height: 62px; padding: 0; border: 0; border-radius: 14px; background: none; cursor: pointer; position: relative; }
.o-feuille-score-de svg { display: block; width: 100%; height: 100%; }
.o-feuille-score-de .face { fill: #fffdf7; stroke: #3a3f4d; stroke-width: 3; }
.o-feuille-score-de .pip { fill: #1b1e27; }
.o-feuille-score-de .vide { fill: #8a91a3; font: 700 40px var(--police); }
.o-feuille-score-de[aria-pressed="true"] { transform: translateY(-4px); }
.o-feuille-score-de[aria-pressed="true"] .face { fill: #ffe9a8; stroke: var(--marque); stroke-width: 7; }
.o-feuille-score-de[aria-pressed="true"]::after { content: ""; position: absolute; left: 25%; right: 25%; bottom: -8px; height: 4px; border-radius: 2px; background: var(--marque); }
.o-feuille-score-de:disabled { cursor: default; }
.o-feuille-score-de:focus-visible { outline: 3px solid var(--marque); outline-offset: 3px; }
.o-feuille-score-de.roule svg { animation: o-feuille-score-roule .35s ease-out 1; }
@keyframes o-feuille-score-roule { from { transform: rotate(-80deg) scale(.8); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .o-feuille-score-de.roule svg { animation: none; } .o-feuille-score-de[aria-pressed="true"] { transform: none; } }
.o-feuille-score-lancers { font-variant-numeric: tabular-nums; color: var(--texte-2); }
.o-feuille-score-prop-titre { margin: 10px 0 6px; }
.o-feuille-score-propositions { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.o-feuille-score-propositions .btn { border-radius: 999px; }
.atelier .o-feuille-score-propositions .btn.zero { color: var(--texte-2); }

.o-feuille-score-classement { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.o-feuille-score-classement li { display: grid; grid-template-columns: 2em 12px minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; padding: 8px 12px; border: 1px solid var(--bord); border-left: 5px solid var(--c); border-radius: var(--rayon-petit); }
.o-feuille-score-classement li.gagnant { background: var(--ok-fond); color: var(--ok-texte); }
.o-feuille-score-rang { font-weight: 800; font-size: 1.1rem; }
.o-feuille-score-nom { overflow-wrap: anywhere; font-weight: 600; }
.o-feuille-score-total { font-size: 1.15rem; font-variant-numeric: tabular-nums; text-align: right; }
.o-feuille-score-ecart { grid-column: 3 / -1; color: var(--texte-2); font-size: .85rem; font-variant-numeric: tabular-nums; }
.o-feuille-score-ecart:empty { display: none; }
.o-feuille-score-classement li.gagnant .o-feuille-score-ecart { color: inherit; font-weight: 700; }

.o-feuille-score-graphique { margin: 22px 0 0; }
.o-feuille-score-graphique figcaption { margin-bottom: 6px; font-weight: 700; font-size: 1.05rem; }
.o-feuille-score-graphique svg { display: block; width: 100%; height: auto; border: 1px solid var(--bord); border-radius: var(--rayon-petit); background: var(--surface); }
.o-feuille-score-graphique .grille { stroke: var(--bord); stroke-width: 1; }
.o-feuille-score-graphique .axe { stroke: var(--texte-2); stroke-width: 1.5; }
.o-feuille-score-graphique .etiquette { fill: var(--texte-2); font: 12px var(--police); }
.o-feuille-score-legende { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0 0; padding: 0; list-style: none; font-size: .9rem; }
.o-feuille-score-legende li { display: flex; align-items: center; gap: 6px; }

.o-feuille-score-fin { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--bord); }
.atelier .o-feuille-score [data-confirmer] { background: var(--erreur-fond); border-color: var(--erreur-texte); color: var(--erreur-texte); }
.o-feuille-score-partage { width: 100%; margin-top: 8px; font: .95rem var(--mono); }
.o-feuille-score .prereglages { margin-top: 18px; }
.o-feuille-score-historique { padding-top: 4px; }
.o-feuille-score-h-liste { display: grid; gap: 8px; margin: 0 0 10px; padding: 0; list-style: none; }
.o-feuille-score-h-liste li { padding: 8px 12px; border: 1px solid var(--bord); border-radius: var(--rayon-petit); }
.o-feuille-score-h-liste p { margin: 0; overflow-wrap: anywhere; }
.o-feuille-score-h-tete { color: var(--texte-2); font-size: .85rem; }
.o-feuille-score-note { margin-top: 14px; }

.o-feuille-score:fullscreen { overflow: auto; padding: 20px; background: var(--surface); }
.o-feuille-score:fullscreen .o-feuille-score-tableau { font-size: 1.25rem; }
.o-feuille-score:fullscreen .o-feuille-score-classement li { font-size: 1.2rem; }

@media (max-width: 480px) {
  .o-feuille-score-champs { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .o-feuille-score-de { width: 52px; height: 52px; }
  .o-feuille-score-tableau th, .o-feuille-score-tableau td { padding: 5px 7px; }
}

/* Feuille vierge à imprimer */
.o-feuille-score-impression { display: none; }
@media print {
  @page { size: A4 portrait; margin: 12mm; }
  body:has(.o-feuille-score-impression) *:not(:has(.o-feuille-score-impression)):not(.o-feuille-score-impression):not(.o-feuille-score-impression *) { display: none !important; }
  html:has(.o-feuille-score-impression), body:has(.o-feuille-score-impression), body:has(.o-feuille-score-impression) *:has(.o-feuille-score-impression) {
    display: block !important; margin: 0 !important; padding: 0 !important; border: 0 !important; background: #fff !important;
    box-shadow: none !important; width: auto !important; max-width: none !important; min-height: 0 !important; height: auto !important;
    position: static !important; overflow: visible !important; color: #000 !important;
  }
  .o-feuille-score .o-feuille-score-impression { display: block !important; color: #000; font-family: var(--police); }
  .o-feuille-score-impression h2 { margin: 0 0 3mm; font-size: 18pt; color: #000; }
  .o-feuille-score-impr-ligne { margin: 0 0 4mm; font-size: 11pt; }
  .o-feuille-score-impression table { width: 100%; border-collapse: collapse; table-layout: fixed; }
  .o-feuille-score-impression th, .o-feuille-score-impression td { border: .3mm solid #000; padding: 0 2mm; text-align: left; font-size: 10pt; color: #000; }
  .o-feuille-score-impression th.premiere { width: 22mm; font-weight: 600; }
  .o-feuille-score-impression .yams th.premiere { width: 42mm; }
  .o-feuille-score-impression th small { display: block; font-weight: 400; font-size: 7.5pt; color: #333; }
  .o-feuille-score-impression thead th { height: 12mm; }
  .o-feuille-score-impression .general tbody tr { height: 10.4mm; }
  .o-feuille-score-impression .yams tbody tr { height: 11.5mm; }
  .o-feuille-score-impression tr.sous th, .o-feuille-score-impression tr.sous td { background: #eee; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .o-feuille-score-impression tr.total th, .o-feuille-score-impression tr.total td { border-top: .8mm solid #000; font-weight: 800; }
}
