/* =========================================================================
   POTOS — Votes en partie et tirage au sort (js/votes.js, lot 14a). Charte « Soirée jeux » §5 : jetons seulement,
   Fredoka / Space Grotesk, cartes posées (surface, filet coloré à gauche, comme la carte « joueur absent »).
   Animations : transform / opacity uniquement (docs/fluidite.md) ; compte à rebours = scaleX d'une barre.
   Empilement : sous les fenêtres (z 96+), au-dessus des plateaux ; la carte du vote se place sous la carte
   « joueur absent » quand les deux sont là (body.has-attente).
   ========================================================================= */

/* ---------- Tirage au sort : « 🎲 Tirage au sort : Léa commence » ---------- */
.tirage {
  /* au-dessus des fenêtres de règles / tutoriel ouvertes d'office à la 1re partie (z 96) : simple annonce, sans clic */
  position: fixed; z-index: 99; left: 50%; top: 24%; translate: -50% 0;
  display: flex; align-items: center; gap: 12px; padding: 12px 18px 12px 14px;
  max-width: calc(100vw - 32px); width: max-content;
  color: var(--text); background: var(--surface); border: 1px solid var(--line-2); border-left: 5px solid var(--accent);
  border-radius: var(--r-lg); box-shadow: var(--ombre-3); pointer-events: none; contain: layout paint;
  font-family: var(--font-ui);
  animation: tirage-in .42s var(--spring, ease-out) both;
}
.tirage .tg-de { font-size: 2.1rem; line-height: 1; display: inline-block; animation: tirage-de .7s var(--ease-out, ease-out) both; }
.tirage .tg-txt { display: grid; gap: 1px; min-width: 0; }
.tirage small { font-size: .78rem; font-weight: 600; letter-spacing: .02em; color: var(--muted); }
.tirage b { font-family: var(--font-display); font-weight: 700; font-size: 1.22rem; line-height: 1.2; }
.tirage.is-out { animation: tirage-out .4s ease-in both; }
@keyframes tirage-in { from { opacity: 0; transform: translateY(-10px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes tirage-out { to { opacity: 0; transform: translateY(-8px) scale(.97); } }
@keyframes tirage-de { 0% { transform: rotate(-200deg) scale(.6); } 70% { transform: rotate(12deg) scale(1.08); } 100% { transform: none; } }

/* ---------- Carte du vote en cours ---------- */
.vote-carte {
  position: fixed; z-index: 87; left: 50%; top: calc(max(12px, env(safe-area-inset-top)) + 54px);
  width: min(calc(100vw - 24px), 460px); translate: -50% 0;
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px 10px; padding: 10px 10px 14px 12px;
  color: var(--text); background: var(--surface); border: 1px solid var(--line-2); border-left: 4px solid var(--accent-2);
  border-radius: var(--r-md); box-shadow: var(--ombre-3); font-family: var(--font-ui); contain: layout paint;
  animation: attente-in .32s var(--ease-out, ease-out) both;
}
.vote-carte[hidden] { display: none; }
.vote-carte.is-cible { border-left-color: var(--warn); }
body.has-attente .vote-carte { top: calc(max(12px, env(safe-area-inset-top)) + 140px); }
.vote-carte .vt-txt { margin: 0; display: grid; gap: 3px; min-width: 0; }
.vote-carte .vt-txt b { font-family: var(--font-display); font-weight: 600; font-size: 1rem; line-height: 1.2; padding-right: 34px; }
.vote-carte .vt-txt small { font-size: .78rem; line-height: 1.3; color: var(--muted); }
.vote-carte .vt-compte { font-size: .8rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.vote-carte .vt-actions { display: flex; gap: 6px; }
.vote-carte .vt-actions .btn { min-height: var(--tap, 44px); white-space: nowrap; }
.vote-carte .vt-oui[aria-pressed="true"] { background: rgb(var(--ok-rgb) / .16); border-color: var(--ok); color: var(--ok-text, var(--text)); }
.vote-carte .vt-non[aria-pressed="true"] { background: rgb(var(--danger-rgb) / .14); border-color: var(--danger); color: var(--danger-text, var(--text)); }
.vote-carte .vt-sec { position: absolute; right: 10px; top: 6px; font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.vote-carte .vt-temps { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; overflow: hidden; border-radius: 0 0 var(--r-md) var(--r-md); }
.vote-carte .vt-temps i { display: block; height: 100%; background: var(--accent-2); transform-origin: left center; animation: vote-temps linear both; }
.vote-carte.is-cible .vt-temps i { background: var(--warn); }
@keyframes vote-temps { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (max-width: 420px) {
  .vote-carte { grid-template-columns: 1fr; }
  .vote-carte .vt-actions .btn { flex: 1 1 0; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .vote-carte { top: calc(max(8px, env(safe-area-inset-top)) + 50px); left: auto; right: max(8px, env(safe-area-inset-right)); translate: none; width: min(48vw, 400px); }
  body.has-attente .vote-carte { top: calc(max(8px, env(safe-area-inset-top)) + 130px); }
}

/* ---------- (lot 15) le bouton 🗳️ a quitté l’en-tête : « Proposer un vote » est dans le menu ⋯ (css/menu-jeu.css) ---------- */

/* ---------- Feuille « Proposer d'exclure un joueur » (glisse du bas au téléphone, centrée sur ordinateur) ---------- */
.vote-feuille { position: fixed; inset: 0; z-index: 97; display: flex; align-items: flex-end; justify-content: center; }
.vote-feuille .vf-fond { position: absolute; inset: 0; background: rgb(var(--bg-rgb) / .62); opacity: 0; transition: opacity .25s ease; }
.vote-feuille .vf-carte {
  position: relative; width: min(100vw, 520px); max-height: min(86vh, 640px); overflow: auto; overscroll-behavior: contain;
  padding: 10px 16px calc(16px + env(safe-area-inset-bottom)); display: grid; gap: 12px;
  color: var(--text); background: var(--surface); border-radius: var(--r-xl) var(--r-xl) 0 0; box-shadow: var(--ombre-3);
  font-family: var(--font-ui); transform: translateY(100%); transition: transform .26s var(--ease-out, ease-out);
}
.vote-feuille.is-open .vf-fond { opacity: 1; }
.vote-feuille.is-open .vf-carte { transform: none; }
.vote-feuille .vf-poignee { justify-self: center; width: 44px; height: 5px; border-radius: 99px; background: var(--line-2); }
.vote-feuille h2 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; }
.vote-feuille .vf-regle { margin: 0; font-size: .86rem; line-height: 1.4; color: var(--muted); }
.vote-feuille .vf-liste { display: grid; gap: 10px; }
.vote-feuille .vf-joueur { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.vote-feuille .vf-joueur > b { font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; }
.vote-feuille .vf-motifs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px; align-items: start; }
.vote-feuille .vf-motif { min-height: var(--tap, 44px); justify-content: center; }
.vote-feuille .vf-motif[aria-disabled="true"] { opacity: .55; }
.vote-feuille .vf-motif.is-arme { border-color: var(--danger); color: var(--danger-text, var(--text)); }
.vote-feuille .vf-m { display: grid; gap: 4px; align-content: start; }
.vote-feuille .vf-pourquoi { font-size: .74rem; line-height: 1.3; color: var(--muted); }
.vote-feuille .vf-non, .vote-feuille .vf-attente { margin: 0; font-size: .9rem; color: var(--muted); }
@media (min-width: 700px) {
  .vote-feuille { align-items: center; }
  .vote-feuille .vf-carte { border-radius: var(--r-xl); transform: translateY(16px); opacity: 0; transition: transform .22s var(--ease-out, ease-out), opacity .22s ease; }
  .vote-feuille.is-open .vf-carte { opacity: 1; }
  .vote-feuille .vf-poignee { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .tirage, .tirage .tg-de, .tirage.is-out, .vote-carte { animation: none; }
  .vote-feuille .vf-carte, .vote-feuille .vf-fond { transition: none; }
}
html.perf-lite .tirage, html.perf-lite .vote-carte { box-shadow: var(--ombre-2); }
html.perf-lite .tirage .tg-de { animation: none; }
