/* Cartons de loto / bingo et boulier */
.o-loto-bingo-formats { border-top: 0; padding-top: 0; }
.atelier .o-loto-bingo-formats .btn[aria-pressed="true"] { background: var(--marque); border-color: var(--marque); color: var(--sur-marque); }
.o-loto-bingo-bloc { padding-top: 18px; margin-top: 18px; border-top: 1px solid var(--bord); }
.o-loto-bingo-formats + .o-loto-bingo-bloc { margin-top: 0; }
.o-loto-bingo-bloc h2 { margin: 0 0 12px; font-size: 1.25rem; }
.o-loto-bingo-sous-titre { margin: 18px 0 8px; font-size: 1rem; color: var(--texte-2); }
.o-loto-bingo-aide { margin: 0 0 10px; color: var(--texte-2); font-size: .92rem; }
.o-loto-bingo-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 10px; }
.o-loto-bingo-resume { display: block; margin-bottom: 6px; font-weight: 600; }
.o-loto-bingo .tirage-message { margin-bottom: 6px; }

/* Aperçu des cartons */
.o-loto-bingo-apercu { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; max-height: 640px; overflow: auto; margin-top: 12px; padding: 4px; }
.o-loto-bingo-apercu.f75, .o-loto-bingo-apercu.f30 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }
.o-loto-bingo-apercu:focus-visible { outline: 2px solid var(--marque); outline-offset: 2px; }
.o-loto-bingo-carton { margin: 0; }
.o-loto-bingo-carton figcaption { margin-bottom: 4px; font-size: .85rem; font-weight: 600; color: var(--texte-2); }
.o-loto-bingo-grille { width: 100%; border-collapse: collapse; table-layout: fixed; font-variant-numeric: tabular-nums; }
.o-loto-bingo-grille td, .o-loto-bingo-grille th { border: 1px solid var(--bord); text-align: center; padding: 0; height: 2.1em; font-weight: 700; background: var(--surface); color: var(--texte); }
.o-loto-bingo-grille th { background: var(--marque); color: var(--sur-marque); }
.o-loto-bingo-grille td.vide { background: var(--surface-2); }
.o-loto-bingo-grille td.libre { font-size: .62rem; letter-spacing: .02em; background: var(--surface-2); }
.o-loto-bingo-grille.g75 td, .o-loto-bingo-grille.g30 td { height: 2.4em; }
.o-loto-bingo-grille td.sorti { background: var(--ok-fond); color: var(--ok-texte); }
.o-loto-bingo-grille td.gagne { background: var(--marque); color: var(--sur-marque); }

/* Boulier */
.o-loto-bingo-boule { display: grid; place-items: center; align-content: center; width: 160px; height: 160px; border-radius: 50%; background: var(--marque); color: var(--sur-marque); font: 800 4rem/1 var(--police); font-variant-numeric: tabular-nums; box-shadow: inset -10px -12px 0 rgba(0, 0, 0, .12); }
.o-loto-bingo-boule.vide { background: var(--surface-2); color: var(--texte-2); }
.o-loto-bingo-boule [data-boule-lettre] { font-size: 1.4rem; line-height: 1; }
.o-loto-bingo-boule [data-boule-lettre]:empty { display: none; }
.o-loto-bingo-boule.anime { animation: o-loto-bingo-sortie .35s ease-out; }
@keyframes o-loto-bingo-sortie { from { transform: scale(.6) rotate(-20deg); opacity: .3; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .o-loto-bingo-boule.anime { animation: none; } }
.o-loto-bingo-compte { margin: 0; color: var(--texte-2); font-weight: 600; }
.o-loto-bingo-commandes { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; }

/* Tableau des numéros sortis */
.o-loto-bingo-tableau { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; font-variant-numeric: tabular-nums; }
.o-loto-bingo-tableau span, .o-loto-bingo-tableau b { display: grid; place-items: center; min-height: 30px; border-radius: 6px; background: var(--surface-2); color: var(--texte-2); font-size: .9rem; font-weight: 600; }
.o-loto-bingo-tableau span.sorti { background: var(--marque); color: var(--sur-marque); }
.o-loto-bingo-tableau.t75 { grid-template-columns: 1fr; }
.o-loto-bingo-tableau.t75 .ligne { display: grid; grid-template-columns: repeat(16, 1fr); gap: 3px; }
.o-loto-bingo-tableau.t75 b.lettre { background: none; color: var(--texte); font-size: 1rem; }
.o-loto-bingo-tableau.ttombola { grid-template-columns: repeat(2, 1fr); gap: 10px; }
.o-loto-bingo-tableau .bloc { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; padding: 5px; border: 2px solid var(--bord); border-radius: var(--rayon-petit); }
.o-loto-bingo-historique { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.o-loto-bingo-historique li { display: grid; place-items: center; min-width: 34px; height: 30px; padding: 0 6px; border-radius: 8px; background: var(--surface-2); font: 600 .95rem var(--mono); }
.o-loto-bingo-historique li:last-child { background: var(--marque); color: var(--sur-marque); }
@media (max-width: 520px) {
  .o-loto-bingo-tableau span, .o-loto-bingo-tableau b { min-height: 26px; font-size: .78rem; border-radius: 4px; }
  .o-loto-bingo-tableau.t75 .ligne { grid-template-columns: 1.2em repeat(15, 1fr); gap: 1px; }
  .o-loto-bingo-tableau.t75 span { min-height: 24px; font-size: .62rem; letter-spacing: -.03em; border-radius: 3px; }
  .o-loto-bingo-apercu { max-height: 460px; }
  .o-loto-bingo-tableau.ttombola { gap: 6px; }
  .o-loto-bingo-tableau .bloc { padding: 3px; gap: 2px; }
  .o-loto-bingo-boule { width: 130px; height: 130px; font-size: 3.2rem; }
}

/* Plein écran */
.o-loto-bingo-boulier:fullscreen { overflow: auto; padding: 24px 4vw; margin: 0; border: 0; background: var(--fond); color: var(--texte); }
.o-loto-bingo-boulier:fullscreen .o-loto-bingo-boule { width: min(38vh, 380px); height: min(38vh, 380px); font-size: min(17vh, 170px); }
.o-loto-bingo-boulier:fullscreen .o-loto-bingo-boule [data-boule-lettre] { font-size: min(6vh, 60px); }
.o-loto-bingo-boulier:fullscreen .o-loto-bingo-tableau span { min-height: 4.2vh; font-size: 2.2vh; }

/* Vérification */
.o-loto-bingo-verif { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.o-loto-bingo-verif input { width: 7em; }
.o-loto-bingo-verdict { display: block; margin: 12px 0; }
.o-loto-bingo-verdict:empty { display: none; }
.o-loto-bingo-verdict strong { display: block; font-size: 1.15rem; margin-bottom: 2px; }
.o-loto-bingo-carte-verif { max-width: 480px; }

/* Impression */
.o-loto-bingo .o-loto-bingo-impression { display: none; }
@media print {
  body:has(.o-loto-bingo-impression) *:not(:has(.o-loto-bingo-impression)):not(.o-loto-bingo-impression):not(.o-loto-bingo-impression *) { display: none !important; }
  html:has(.o-loto-bingo-impression), body:has(.o-loto-bingo-impression), body:has(.o-loto-bingo-impression) *:has(.o-loto-bingo-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-loto-bingo .o-loto-bingo-impression { display: block !important; color: #000; font-family: var(--police); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .o-loto-bingo-impression .o-loto-bingo-feuille { display: grid; align-content: start; justify-content: center; overflow: hidden; break-after: page; page-break-after: always; }
  .o-loto-bingo-impression .o-loto-bingo-feuille:last-child { break-after: auto; page-break-after: auto; }
  .o-loto-bingo-impression .o-loto-bingo-carte-impr { justify-self: center; align-self: center; }
  .o-loto-bingo-impression .o-loto-bingo-tete, .o-loto-bingo-impression .o-loto-bingo-pied { box-sizing: border-box; line-height: 1.1; }
  .o-loto-bingo-impression td, .o-loto-bingo-impression th { box-sizing: border-box; overflow: hidden; }
  .o-loto-bingo-impression .o-loto-bingo-tete { display: flex; justify-content: space-between; align-items: flex-end; gap: 4mm; padding-bottom: 1mm; font-size: 10pt; color: #000; overflow: hidden; white-space: nowrap; }
  .o-loto-bingo-impression .o-loto-bingo-tete strong { font-size: 12pt; overflow: hidden; text-overflow: ellipsis; }
  .o-loto-bingo-impression .o-loto-bingo-pied { padding-top: .8mm; font-size: 7pt; color: #555; white-space: nowrap; overflow: hidden; }
  .o-loto-bingo-impression .o-loto-bingo-carte-impr { display: flex; flex-direction: column; }
  .o-loto-bingo-impression table { margin: 0 !important; border-collapse: collapse; table-layout: fixed; font-variant-numeric: tabular-nums; }
  .o-loto-bingo-impression td, .o-loto-bingo-impression th { border: .4mm solid #000; padding: 0; text-align: center; vertical-align: middle; font-weight: 700; color: #000; background: #fff; line-height: 1; }
  .o-loto-bingo-impression th { background: #000; color: #fff; }
  .o-loto-bingo-impression td.vide { background: #d9d9d9; }
  .o-loto-bingo-impression td.libre { background: #eee; font-weight: 600; }
  .o-loto-bingo-impression .tabellone h2 { margin: 0 0 6mm; font-size: 20pt; text-align: center; color: #000; }
  .o-loto-bingo-impression .tabellone .blocs { display: grid; grid-template-columns: repeat(2, auto); justify-content: center; gap: 6mm 8mm; }
  .o-loto-bingo-impression .tabellone .nom { margin: 0 0 1mm; font-size: 10pt; font-weight: 700; }
}
