/* ==========================================================================
   « Avant de tirer » (lot 5) — écran de marquage (mode « téléphone » de /tente, fond clair).
   Une liste à cocher FACULTATIVE (4 grosses cases) et la ligne « Canon prêt ».
   Règles : le bloc a une hauteur FIXE (cocher une case, « Canon prêt — Robin, 14:33 », le rappel de la
   charge : seules les couleurs et les textes changent, rien ne bouge) ; il n'est jamais dans le bloc des
   deux gros boutons ; animations sur transform / opacity seulement, coupées si « réduire les animations ».
   ========================================================================== */
.t-avant { display: flex; flex-direction: column; gap: 8px; flex: none; }
.t-avant-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.t-avant-titre {
  margin: 0; font-family: var(--police-titre); font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  font-size: 1rem; color: var(--texte-doux);
}
.t-avant-titre small { font-family: var(--police); font-weight: 400; text-transform: none; letter-spacing: 0; font-size: .9em; }
.t-avant-compte { font-family: var(--police-titre); font-weight: 800; font-size: 1.15rem; font-variant-numeric: tabular-nums; color: var(--texte-doux); }
.t-avant.est-pret .t-avant-compte { color: #2F7A1F; }

/* Les 4 cases : toute la ligne se touche (64 px de haut), la coche est un gros carré. */
.t-avant-liste { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.t-avant-case {
  min-height: 64px; padding: 6px 14px 6px 10px; display: flex; align-items: center; gap: 12px; text-align: left;
  border: 2px solid #c9c5b6; border-radius: 14px; background: var(--blanc); color: var(--noir);
  font-family: var(--police); font-size: 1.15rem; cursor: pointer;
  transition: transform 120ms var(--sortie), opacity 120ms var(--sortie);
}
.t-avant-case:active { transform: scale(.98); }
.t-avant-case:focus-visible { outline: 3px solid var(--focus, var(--noir)); outline-offset: 3px; }
.t-avant-coche {
  flex: none; width: 40px; height: 40px; border-radius: 10px; border: 3px solid var(--noir); background: var(--blanc);
  display: grid; place-items: center;
}
.t-avant-coche svg {
  width: 30px; height: 30px; fill: none; stroke: #ffffff; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round;
  opacity: 0; transform: scale(.5); transition: transform 160ms var(--sortie), opacity 120ms var(--sortie);
}
.t-avant-texte { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.t-avant-texte strong { font-weight: 700; }
.t-avant-texte small { font-size: .88rem; color: var(--texte-doux); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-avant-case .verre { flex: none; color: var(--noir); --poudre: #b9b29a; --fond-verre: var(--blanc); }
.t-avant-case[aria-checked="true"] { border-color: #2F7A1F; background: #eef6ea; }
.t-avant-case[aria-checked="true"] .t-avant-coche { background: #2F7A1F; border-color: #2F7A1F; }
.t-avant-case[aria-checked="true"] .t-avant-coche svg { opacity: 1; transform: none; }
.t-avant-case[aria-checked="true"] .verre { --fond-verre: #eef6ea; }

/* Rappel de la préparation de la charge, pendant les 10 minutes avant le tir (tant que « Charge prête » n'est pas cochée). */
.t-avant.a-preparer .t-avant-case[data-point="0"] { border-color: #b89600; background: #fff6c2; }
.t-avant.a-preparer .t-avant-case[data-point="0"] small { color: #5c4500; font-weight: 700; }
.t-avant.a-preparer .t-avant-case[data-point="0"] .verre { --fond-verre: #fff6c2; }
.mode-telephone .t-carte-depart .t-charge.a-preparer { background: #fff6c2; box-shadow: inset 0 0 0 2px #b89600; }
.mode-telephone .t-carte-depart .t-charge.a-preparer .verre { --fond-verre: #fff6c2; }

/* La ligne « Canon prêt » : TOUJOURS 56 px, que le canon soit prêt ou non (2 lignes de texte au plus). */
.t-avant-etat { display: flex; align-items: stretch; gap: 8px; height: 56px; }
.t-avant-message {
  flex: 1 1 auto; min-width: 0; margin: 0; padding: 0 14px; border-radius: 12px; display: flex; align-items: center; overflow: hidden;
  background: var(--surface-2); color: var(--texte-doux); font-weight: 600; font-size: 1.05rem; line-height: 1.15;
}
.t-avant-message span { min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.t-avant.est-pret .t-avant-message { background: #2F7A1F; color: #ffffff; font-weight: 700; font-size: 1.15rem; }
.t-avant.est-pret .t-avant-message::before { content: '✔'; margin-right: 8px; flex: none; }
.mode-telephone .t-avant .t-avant-bouton { flex: none; min-height: 56px; height: 56px; padding: 0 16px; white-space: nowrap; }
.t-avant-lecture .t-avant-message { justify-content: center; }

/* Vue des causes (coup pas parti) : accès à la fiche du tir — note, « On a finalement retiré ». */
.t-causes-suite { display: flex; justify-content: center; }
.mode-telephone .t-causes-suite .t-btn { width: 100%; white-space: normal; line-height: 1.1; padding: 6px 12px; }

/* Grand écran (la « vraie page d'ordinateur » de l'écran de marquage) : les 4 cases sur 2 colonnes. */
@media (min-width: 900px) and (min-height: 620px) {
  .t-avant-liste { grid-template-columns: 1fr 1fr; }
  .t-avant-titre { font-size: 1.1rem; }
  .mode-telephone .t-causes-suite .t-btn { width: auto; }
}
/* Téléphone couché : 2 colonnes aussi (la hauteur est rare). */
@media (orientation: landscape) and (max-height: 500px) {
  .t-avant-liste { grid-template-columns: 1fr 1fr; }
}
@media (forced-colors: active) {
  .t-avant-case, .t-avant-coche, .t-avant-message { border: 2px solid ButtonText; }
  .t-avant-case[aria-checked="true"] .t-avant-coche svg { stroke: ButtonText; }
}
@media (prefers-reduced-motion: reduce) {
  .t-avant-case, .t-avant-coche svg { transition: none; }
}
