/* Shootout Arena — écran des résultats de la soirée (ecran-soiree.html).
 * Pensé pour un écran de salle : grandes polices (elles suivent la largeur de l'écran), aucun menu, contraste fort.
 * Sur un grand écran la page tient dans la fenêtre (les listes défilent d'elles-mêmes) ; sur téléphone, c'est une page normale. */

html { font-size: clamp(15px, 0.9vw + 4px, 34px); scroll-behavior: auto; }
.scr-body {
  --a: #5b9bff; --b: #ff5b5b; --gold: #f2c94c; --silver: #cbd5e1; --bronze: #d28b52;
  min-height: 100vh; display: flex; flex-direction: column;
  background: radial-gradient(1200px 500px at 85% -10%, rgba(255, 90, 31, 0.12), transparent 60%), var(--bg);
}
.scr-body.is-idle { cursor: none; }

/* ---------- en-tête ---------- */
.scr-head { display: flex; align-items: center; gap: 1.2rem; padding: 0.7rem 2rem; flex: none; }
.scr-logo { height: 3rem; width: auto; display: block; }
.scr-title { flex: 1; min-width: 0; }
.scr-kicker { font-family: "Oxanium", sans-serif; font-weight: 700; font-size: 0.8rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-2); }
.scr-title h1 { font-size: 1.9rem; line-height: 1.15; overflow-wrap: anywhere; }
.scr-status { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; justify-content: flex-end; text-align: right; }
.scr-live { font-size: 0.8rem; }
.scr-updated { font-size: 0.8rem; color: var(--muted); }
.scr-updated.is-stale { color: var(--bad); font-weight: 600; }
.scr-full {
  font: inherit; font-size: 0.8rem; color: var(--muted); background: transparent; cursor: pointer;
  border: 1px solid var(--border); border-radius: 0.6rem; padding: 0.35rem 0.7rem;
  transition: opacity 0.4s ease, color 0.15s ease, border-color 0.15s ease;
}
.scr-full:hover { color: var(--text); border-color: var(--muted); }
.scr-body.is-idle .scr-full { opacity: 0; pointer-events: none; }

/* ---------- grille principale ---------- */
.scr-main {
  flex: 1; min-height: 0; display: grid; gap: 1.1rem; padding: 0 2rem 0.9rem;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
}
.scr-rounds { grid-column: 1; grid-row: 1; }
.scr-board { grid-column: 2; grid-row: 1; }
.scr-teams { grid-column: 1 / -1; grid-row: 2; }
.scr-panel {
  display: flex; flex-direction: column; min-height: 0; min-width: 0;
  background: var(--bg-alt); border: 1px solid var(--border); border-radius: 1.1rem; padding: 1.1rem 1.4rem;
}
.scr-panel h2 { font-size: 0.85rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.8rem; flex: none; }
.scr-sub { font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 1.2rem 0 0.6rem; }
.scr-scroll { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: none; -ms-overflow-style: none; }
.scr-scroll::-webkit-scrollbar { display: none; }
.scr-note { flex: none; margin-top: 0.7rem; font-size: 0.72rem; color: var(--muted); }
.scr-empty { color: var(--muted); font-size: 1rem; padding: 1.2rem 0.2rem; line-height: 1.5; }

/* ---------- dernière manche ---------- */
.scr-last {
  --c: var(--a); position: relative; border: 1px solid var(--c); border-radius: 1rem; padding: 1.1rem 1.3rem;
  background: linear-gradient(135deg, color-mix(in srgb, var(--c) 17%, transparent), transparent 70%), var(--surface);
}
.scr-last--A { --c: var(--a); }
.scr-last--B { --c: var(--b); }
.scr-last--D { --c: var(--silver); } /* égalité : ni bleu ni rouge */
.scr-last-top { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: 0.85rem; }
.scr-last-top strong { color: var(--text); font-family: "Oxanium", sans-serif; font-size: 1rem; letter-spacing: 0.04em; }
.scr-win { font-family: "Oxanium", sans-serif; font-weight: 800; font-size: 2.1rem; line-height: 1.15; color: var(--c); margin: 0.35rem 0 0.2rem; }
.scr-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.8rem; }
.scr-flag, .scr-mode { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 0.15rem 0.6rem; border-radius: 999px; }
.scr-mode { color: var(--muted); background: rgba(154, 160, 176, 0.14); }
.scr-mode--capture { color: var(--accent-2); background: rgba(34, 211, 238, 0.14); }
.scr-mode--carabiner { color: var(--gold); background: rgba(242, 201, 76, 0.14); }
.scr-mode--flags { color: var(--ok); background: rgba(52, 211, 153, 0.14); }
.scr-flag--ok { color: var(--ok); background: rgba(52, 211, 153, 0.12); }
.scr-flag--off { color: #f2c94c; background: rgba(242, 201, 76, 0.13); }
.scr-last-teams { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 0.4rem; }
.scr-team h3 { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.95rem; margin-bottom: 0.45rem; }
.scr-team--A h3 { color: var(--a); }
.scr-team--B h3 { color: var(--b); }
.scr-team h3 span { font-size: 0.78rem; color: var(--muted); font-family: "Inter", sans-serif; font-weight: 500; }
.scr-team ul { list-style: none; display: grid; gap: 0.3rem; }
.scr-pl { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.3rem 0.65rem; border-radius: 0.55rem; background: rgba(255, 255, 255, 0.04); font-size: 0.95rem; }
.scr-pl.is-won { background: color-mix(in srgb, var(--c) 14%, transparent); }
.scr-pl-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.scr-caps { flex: none; font-size: 0.85rem; font-weight: 700; color: var(--accent-2); white-space: nowrap; }
.scr-delta { flex: none; font-family: "Oxanium", sans-serif; font-weight: 800; font-size: 0.9rem; color: var(--muted); }

/* Capture du point : temps de tenue de chaque équipe, en barre proportionnelle à la durée de la manche. */
.scr-hold { margin: 0.2rem 0 0.9rem; }
.scr-hold-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.8rem; margin-bottom: 0.35rem; font-size: 0.78rem; color: var(--muted); }
.scr-hold-head b { font-family: "Oxanium", sans-serif; font-size: 1.15rem; }
.scr-hold-a { color: var(--a); }
.scr-hold-b { color: var(--b); }
.scr-hold-bar { display: flex; height: 0.75rem; border-radius: 999px; overflow: hidden; background: rgba(255, 255, 255, 0.07); }
.scr-hold-bar-a { background: var(--a); }
.scr-hold-bar-b { background: var(--b); }
.scr-hold-none { color: var(--muted); font-size: 0.8rem; margin: 0 0 0.8rem; }

/* Drapeaux cachés : chaque drapeau avec ses points et la base où il se trouve (rien par joueur). */
.scr-flag-free { margin: 0.4rem 0 0; font-size: 0.78rem; color: var(--muted); }
.scr-flags { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 0.5rem; margin: 0 0 0.9rem; }
.scr-flag-it {
  --c: var(--muted); display: grid; gap: 0.1rem; padding: 0.5rem 0.75rem; border-radius: 0.7rem;
  background: rgba(255, 255, 255, 0.04); border-left: 4px solid var(--c);
}
.scr-flag-it--A { --c: var(--a); background: color-mix(in srgb, var(--a) 13%, transparent); }
.scr-flag-it--B { --c: var(--b); background: color-mix(in srgb, var(--b) 13%, transparent); }
.scr-flag-n { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.scr-flag-pts { font-family: "Oxanium", sans-serif; font-weight: 800; font-size: 1.2rem; }
.scr-flag-where { font-size: 0.8rem; font-weight: 700; color: var(--c); }

/* Mousqueton : tableau de tous les joueurs, du plus au moins de mousquetons, avec la couleur de l'équipe. */
.scr-car-title { margin: 0.2rem 0 0.5rem; font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.scr-car-rank { list-style: none; display: grid; gap: 0.3rem; }
.scr-car {
  --c: var(--a); display: grid; grid-template-columns: 1.8rem minmax(0, 1fr) auto auto auto; gap: 0.6rem; align-items: center;
  padding: 0.35rem 0.7rem; border-radius: 0.55rem; background: rgba(255, 255, 255, 0.04); border-left: 4px solid var(--c); font-size: 0.95rem;
}
.scr-car--A { --c: var(--a); }
.scr-car--B { --c: var(--b); }
.scr-car.is-won { background: color-mix(in srgb, var(--c) 13%, transparent); }
.scr-car-pos { font-family: "Oxanium", sans-serif; font-weight: 800; color: var(--muted); text-align: center; }
.scr-car:nth-child(1) .scr-car-pos { color: var(--gold); }
.scr-car-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.scr-car-team { color: var(--c); font-size: 0.75rem; font-weight: 700; }
.scr-car-n { font-family: "Oxanium", sans-serif; font-weight: 800; font-size: 1.05rem; color: var(--gold); white-space: nowrap; }
.scr-delta--up { color: var(--ok); }
.scr-delta--down { color: var(--bad); }

/* La manche qui vient d'être enregistrée : le cadre pulse un moment pour attirer l'œil. */
.scr-last.is-new { animation: scr-flash 1.6s ease-out 5; }
.scr-new-tag { position: absolute; top: -0.7rem; right: 1rem; padding: 0.15rem 0.7rem; border-radius: 999px; background: var(--c); color: #0a0b0f; font-family: "Oxanium", sans-serif; font-weight: 800; font-size: 0.72rem; letter-spacing: 0.1em; }
@keyframes scr-flash {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 70%, transparent); }
  100% { box-shadow: 0 0 0 1.1rem transparent; }
}

/* ---------- manches précédentes ---------- */
.scr-history { list-style: none; display: grid; gap: 0.55rem; }
.scr-round {
  --c: var(--a); display: grid; grid-template-columns: auto 1fr auto; gap: 0.15rem 0.9rem; align-items: baseline;
  padding: 0.65rem 0.9rem; border-radius: 0.8rem; background: var(--surface); border-left: 4px solid var(--c);
}
.scr-round--A { --c: var(--a); }
.scr-round--B { --c: var(--b); }
.scr-round--D { --c: var(--silver); }
.scr-rn { font-family: "Oxanium", sans-serif; font-weight: 700; font-size: 0.95rem; }
.scr-rw { color: var(--c); font-weight: 700; font-size: 0.95rem; }
.scr-rmeta { color: var(--muted); font-size: 0.78rem; text-align: right; }
.scr-rnames { grid-column: 1 / -1; color: var(--muted); font-size: 0.8rem; line-height: 1.45; overflow-wrap: anywhere; }
.scr-rnames b { color: var(--text); font-weight: 600; }

/* ---------- classement de la soirée ---------- */
.scr-scores { list-style: none; display: grid; gap: 0.4rem; }
.scr-score {
  display: grid; grid-template-columns: 2.1rem minmax(0, 1fr) auto auto; gap: 0.7rem; align-items: center;
  padding: 0.5rem 0.85rem; border-radius: 0.75rem; background: var(--surface);
}
.scr-rank { font-family: "Oxanium", sans-serif; font-weight: 800; font-size: 1rem; color: var(--muted); text-align: center; }
.scr-score:nth-child(1) { box-shadow: inset 0 0 0 1px var(--gold); }
.scr-score:nth-child(1) .scr-rank { color: var(--gold); }
.scr-score:nth-child(2) .scr-rank { color: var(--silver); }
.scr-score:nth-child(3) .scr-rank { color: var(--bronze); }
.scr-sname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 1rem; }
.scr-scores--x1 .scr-score { grid-template-columns: 2.1rem minmax(0, 1fr) auto auto auto; }       /* + une colonne (prises du point OU mousquetons) */
.scr-scores--x2 .scr-score { grid-template-columns: 2.1rem minmax(0, 1fr) auto auto auto auto; }  /* + les deux colonnes */
.scr-scaps { color: var(--accent-2); font-size: 0.85rem; font-weight: 700; white-space: nowrap; }
.scr-sbilan { color: var(--muted); font-size: 0.8rem; white-space: nowrap; }
.scr-spts { font-family: "Oxanium", sans-serif; font-weight: 800; font-size: 1.15rem; color: var(--accent-2); text-align: right; min-width: 3.5rem; white-space: nowrap; }

/* ---------- équipes en place ---------- */
/* Titre et mode de la prochaine manche sur la même ligne : le bandeau reste bas, pour laisser la place aux manches. */
.scr-teams { display: grid; grid-template-columns: auto 1fr; column-gap: 1.4rem; align-items: baseline; padding-top: 0.9rem; padding-bottom: 0.9rem; }
.scr-teams > h2 { margin-bottom: 0.6rem; }
.scr-teams > .scr-teams-grid { grid-column: 1 / -1; }
.scr-next { margin: 0 0 0.6rem; font-size: 0.9rem; color: var(--muted); }
.scr-next b { color: var(--accent-2); font-weight: 700; }
.scr-teams-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.scr-tm { min-width: 0; }
.scr-tm h3 { font-size: 0.9rem; margin-bottom: 0.4rem; }
.scr-tm--A h3 { color: var(--a); }
.scr-tm--B h3 { color: var(--b); }
.scr-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.scr-chips li { padding: 0.2rem 0.65rem; border-radius: 999px; background: rgba(255, 255, 255, 0.05); font-size: 0.85rem; font-weight: 500; }
.scr-chips .scr-none { background: transparent; padding-left: 0; color: var(--muted); }
.scr-aside { grid-column: 1 / -1; color: var(--muted); font-size: 0.8rem; }

/* ---------- pied de page minimal (le règlement et les mentions légales restent accessibles de toute page) ---------- */
.scr-foot { flex: none; padding: 0 2rem 0.9rem; text-align: center; font-size: 0.72rem; color: var(--muted); }
.scr-foot a:hover { color: var(--text); text-decoration: underline; }

/* ---------- petits écrans : une page normale qui défile ---------- */
@media (max-width: 1000px) {
  html { font-size: 16px; }
  .scr-main { display: block; padding: 0 1rem 0.6rem; }
  .scr-foot { padding: 0 1rem 1.2rem; }
  .scr-panel { margin-bottom: 1rem; padding: 1rem; }
  .scr-scroll { overflow: visible; }
  .scr-head { flex-wrap: wrap; padding: 0.9rem 1rem; gap: 0.8rem; }
  .scr-logo { height: 2.6rem; }
  .scr-title h1 { font-size: 1.4rem; }
  .scr-status { justify-content: flex-start; text-align: left; width: 100%; }
  .scr-win { font-size: 1.6rem; }
  .scr-round { grid-template-columns: auto 1fr; }
  .scr-rmeta { grid-column: 1 / -1; text-align: left; }
  .scr-last-teams, .scr-teams-grid { grid-template-columns: 1fr; }
  .scr-full { display: none; }
}

/* Grand écran : la page tient exactement dans la fenêtre, rien ne déborde. */
@media (min-width: 1001px) {
  .scr-body { height: 100vh; overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  .scr-last.is-new { animation: none; }
}

/* ---------- annonce sur le panneau « Manches » : manche enregistrée, modifiée, nouveau mode ---------- */
.scr-rounds { position: relative; }
.scr-pop {
  position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; padding: 1rem; border-radius: inherit; cursor: pointer;
  background: rgba(6, 8, 13, 0.86); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  animation: scr-pop-fade 0.3s ease both;
}
.scr-pop[hidden] { display: none; }
.scr-pop-card {
  --c: var(--a); position: relative; width: min(100%, 44rem); overflow: hidden; text-align: center;
  padding: 1.6rem 2rem 1.9rem; border: 2px solid var(--c); border-radius: 1.2rem;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 22%, transparent), transparent 75%), var(--surface);
  box-shadow: 0 0 0 0.35rem color-mix(in srgb, var(--c) 18%, transparent), 0 1.6rem 4rem rgba(0, 0, 0, 0.6);
  animation: scr-pop-in 0.5s cubic-bezier(0.2, 1.25, 0.3, 1) both;
}
.scr-pop--A { --c: var(--a); }
.scr-pop--B { --c: var(--b); }
.scr-pop--D { --c: var(--silver); } /* égalité */
.scr-pop--ok { --c: var(--ok); }    /* manche désormais comptée */
.scr-pop--off { --c: var(--gold); } /* manche retirée du classement */
.scr-pop--next { --c: var(--accent-2); }
.scr-pop-kicker { margin: 0 0 0.5rem; font-family: "Oxanium", sans-serif; font-weight: 700; font-size: 0.95rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--c); }
.scr-pop-title { margin: 0; font-family: "Oxanium", sans-serif; font-weight: 800; font-size: 2.4rem; line-height: 1.15; overflow-wrap: anywhere; }
.scr-pop-detail { margin: 0.8rem 0 0; font-size: 1.05rem; line-height: 1.45; color: var(--muted); }
.scr-pop-tag { margin: 0.9rem 0 0; }
.scr-pop-tag .scr-flag { font-size: 0.9rem; padding: 0.25rem 0.9rem; }
.scr-pop-extra { margin: 0.8rem 0 0; font-weight: 600; color: var(--text); }
.scr-pop-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 0.28rem; background: color-mix(in srgb, var(--c) 20%, transparent); }
.scr-pop-bar span { display: block; height: 100%; background: var(--c); transform-origin: left; animation: scr-pop-bar linear forwards; }
@keyframes scr-pop-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes scr-pop-in { from { opacity: 0; transform: translateY(1.2rem) scale(0.92); } to { opacity: 1; transform: none; } }
@keyframes scr-pop-bar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
/* Petit écran (page normale, le panneau n'est pas forcément à l'écran) : l'annonce couvre toute la fenêtre. */
@media (max-width: 1000px) {
  .scr-pop { position: fixed; border-radius: 0; }
  .scr-pop-card { padding: 1.3rem 1.2rem 1.6rem; }
  .scr-pop-title { font-size: 1.7rem; }
}
@media (prefers-reduced-motion: reduce) {
  .scr-pop, .scr-pop-card, .scr-pop-bar span { animation: none; }
}

/* ---------- chronomètre de la manche (au-dessus des manches) ---------- */
.scr-run {
  --c: var(--ok); flex: none; margin: 0 0 0.9rem; padding: 0.8rem 1.3rem 1rem; border: 1px solid var(--c); border-radius: 1rem; text-align: center;
  background: linear-gradient(135deg, color-mix(in srgb, var(--c) 16%, transparent), transparent 70%), var(--surface);
}
.scr-run.is-over { --c: var(--accent); }
.scr-run-top { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; font-size: 0.85rem; color: var(--muted); }
.scr-run-state { font-family: "Oxanium", sans-serif; font-weight: 800; letter-spacing: 0.12em; color: var(--c); }
.scr-run.is-live .scr-run-state { animation: scr-blink 1.4s ease-in-out infinite; }
.scr-run-clock {
  margin: 0.2rem 0 0.4rem; font-family: "Oxanium", sans-serif; font-weight: 800; font-size: 4.2rem; line-height: 1.05; letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
.scr-run-bar { height: 0.5rem; border-radius: 999px; overflow: hidden; background: color-mix(in srgb, var(--c) 18%, transparent); }
.scr-run-bar span { display: block; height: 100%; width: 0; background: var(--c); transition: width 0.25s linear; }
.scr-run-sub { margin: 0.45rem 0 0; font-size: 0.8rem; color: var(--muted); }
.scr-pop--start { --c: var(--ok); }     /* début de partie */
.scr-pop--end { --c: var(--accent); }   /* fin de partie */
@keyframes scr-blink { 50% { opacity: 0.45; } }
@media (max-width: 1000px) { .scr-run-clock { font-size: 3rem; } }
@media (prefers-reduced-motion: reduce) {
  .scr-run.is-live .scr-run-state { animation: none; }
  .scr-run-bar span { transition: none; }
}
