/* ═══════════════════════════════════════════════════════════════
   La Mire — compteur de fléchettes
   Palette & typo reprises de la-mire.pro
   Mobile first : l'écran de jeu tient dans une hauteur d'écran.
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* ── Marque la-mire.pro — identique dans les deux thèmes ────── */
  --ink:        #15120D;
  --ink-soft:   #211C14;
  --cream:      #F3EAD6;
  --cream-fg:   #F6EFD9;
  --board:      #EFE4C6;
  --green:      #1C7A47;
  --red:        #C0272D;

  /* ── Thème clair (par défaut) ───────────────────────────────── */
  --bg:            #F4EBD7;
  --bg-glow:       #FCF8EC;
  --surface:       #FBF5E6;
  --surface-2:     #FFFCF2;
  --surface-3:     #F1E7D0;

  --fg:            var(--ink);
  --fg-muted:      rgba(21, 18, 13, 0.68);
  --fg-faint:      rgba(21, 18, 13, 0.52);

  --line:          rgba(21, 18, 13, 0.18);
  --line-strong:   rgba(21, 18, 13, 0.38);
  --line-soft:     rgba(21, 18, 13, 0.09);

  --sunken:        rgba(21, 18, 13, 0.04);   /* panneau en creux    */
  --sunken-2:      rgba(21, 18, 13, 0.07);   /* creux plus marqué   */
  --field:         #FFFDF7;                  /* fond de champ       */
  --field-focus:   #FFFFFF;
  --hover:         rgba(21, 18, 13, 0.06);

  --fill:          var(--ink);               /* aplat contrasté     */
  --fill-fg:       var(--cream-fg);          /* texte sur l'aplat   */
  --ring-fill:     rgba(21, 18, 13, 0.35);

  --chip:          rgba(21, 18, 13, 0.06);   /* fléchette saisie    */
  --chip-line:     rgba(21, 18, 13, 0.34);
  --chip-hover:    rgba(21, 18, 13, 0.12);

  --green-hud:     #15703F;                  /* vert lisible sur le fond */
  --red-bright:    #BC2027;
  --green-tint:    rgba(28, 122, 71, 0.12);
  --red-tint:      rgba(192, 39, 45, 0.10);
  --green-tint-2:  rgba(28, 122, 71, 0.17);
  --red-tint-2:    rgba(192, 39, 45, 0.14);
  --red-soft:      rgba(188, 32, 39, 0.45);
  --red-wash:      rgba(188, 32, 39, 0.10);
  --ring-red:      rgba(188, 32, 39, 0.40);

  --on-accent:     #FFF8E7;                  /* texte sur aplat rouge */
  --hud-fg:        var(--cream-fg);          /* texte sur aplat vert  */

  --locked-line:   rgba(166, 116, 12, 0.55);
  --locked-bg:     rgba(21, 18, 13, 0.05);
  --backdrop:      rgba(21, 18, 13, 0.42);
  --scroll-thumb:  rgba(21, 18, 13, 0.22);
  --op-off:        0.45;                     /* opacité des touches désactivées */

  --shadow-card:   0 14px 34px rgba(21, 18, 13, 0.10);
  --shadow-modal:  0 20px 46px rgba(21, 18, 13, 0.20);
  --shadow-banner: 0 10px 26px rgba(21, 18, 13, 0.24);

  /* ── Relief : lumière venant du haut ─────────────────────────── */
  --hi:            rgba(255, 255, 255, 0.85);   /* arête éclairée */
  --raise:                                      /* objet posé sur la table */
    inset 0 1px 0 var(--hi),
    0 1px 1px rgba(21, 18, 13, 0.06),
    0 3px 6px -2px rgba(21, 18, 13, 0.08),
    0 18px 36px -18px rgba(21, 18, 13, 0.28);
  --raise-sm:
    inset 0 1px 0 var(--hi),
    0 1px 1px rgba(21, 18, 13, 0.08),
    0 4px 10px -4px rgba(21, 18, 13, 0.18);
  --well:                                       /* creusé dans la surface */
    inset 0 2px 5px rgba(21, 18, 13, 0.09),
    inset 0 0 0 1px rgba(21, 18, 13, 0.03),
    0 1px 0 var(--hi);
  --edge:          #D6C8A6;                     /* tranche d'une touche */
  --edge-dark:     #B8A780;
  --key-top:       linear-gradient(180deg, #FFFEF9 0%, #F7EFDC 100%);
  --key:           inset 0 1px 0 #FFFFFF, 0 3px 0 var(--edge), 0 4px 0 var(--edge-dark), 0 7px 10px -4px rgba(21, 18, 13, 0.30);
  --key-press:     inset 0 1px 0 #FFFFFF, 0 1px 0 var(--edge), 0 1px 0 var(--edge-dark), 0 2px 3px -1px rgba(21, 18, 13, 0.25);
  --red-edge:      #861A1F;
  --ink-edge:      #000000;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .08 0 0 0 0 .07 0 0 0 0 .05 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");

  /* ── Tableau des scores : les chiffres qui comptent ─────────────────────── */
  --slate-hi:      #3A4245;
  --slate:         #2B3134;
  --slate-lo:      #1F2426;
  --chalk:         #F3EEDF;
  --chalk-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 -.35'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.13'/%3E%3C/svg%3E");

  --font-display: 'Clash Display', ui-sans-serif, system-ui, sans-serif;
  --font-text:    'General Sans', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono:    'Chakra Petch', ui-monospace, SFMono-Regular, Menlo, monospace;

  --gap: 10px;
  --r: 12px;
  --r-lg: 18px;
}

/* ── Thème sombre — ajouter data-theme="dark" sur <html> ─────── */
[data-theme="dark"] {
  --bg:            #15120D;
  --bg-glow:       #241E15;
  --surface:       #191510;
  --surface-2:     #221C15;
  --surface-3:     #2C241A;

  --fg:            var(--cream-fg);
  --fg-muted:      rgba(246, 239, 217, 0.62);
  --fg-faint:      rgba(246, 239, 217, 0.38);

  --line:          rgba(246, 239, 217, 0.14);
  --line-strong:   rgba(246, 239, 217, 0.30);
  --line-soft:     rgba(246, 239, 217, 0.07);

  --sunken:        rgba(0, 0, 0, 0.24);
  --sunken-2:      rgba(0, 0, 0, 0.30);
  --field:         rgba(0, 0, 0, 0.30);
  --field-focus:   rgba(0, 0, 0, 0.45);
  --hover:         rgba(246, 239, 217, 0.08);

  --fill:          var(--cream);
  --fill-fg:       var(--ink);
  --ring-fill:     rgba(243, 234, 214, 0.50);

  --chip:          rgba(246, 239, 217, 0.08);
  --chip-line:     rgba(246, 239, 217, 0.35);
  --chip-hover:    rgba(246, 239, 217, 0.16);

  --green-hud:     #3FB374;
  --red-bright:    #D8322F;
  --green-tint:    rgba(63, 179, 116, 0.10);
  --red-tint:      rgba(216, 50, 47, 0.10);
  --green-tint-2:  rgba(28, 122, 71, 0.22);
  --red-tint-2:    rgba(192, 39, 45, 0.22);
  --red-soft:      rgba(216, 50, 47, 0.50);
  --red-wash:      rgba(216, 50, 47, 0.14);
  --ring-red:      rgba(216, 50, 47, 0.55);

  --on-accent:     #FFFFFF;
  --hud-fg:        var(--ink);

  --locked-line:   rgba(244, 208, 111, 0.40);
  --locked-bg:     rgba(0, 0, 0, 0.34);
  --backdrop:      rgba(10, 8, 5, 0.78);
  --scroll-thumb:  rgba(246, 239, 217, 0.20);
  --op-off:        0.28;

  --shadow-card:   0 20px 50px rgba(0, 0, 0, 0.50);
  --shadow-modal:  0 24px 60px rgba(0, 0, 0, 0.60);
  --shadow-banner: 0 12px 30px rgba(0, 0, 0, 0.55);

  --hi:            rgba(246, 239, 217, 0.07);
  --raise:         inset 0 1px 0 var(--hi), 0 1px 2px rgba(0, 0, 0, 0.5), 0 18px 36px -16px rgba(0, 0, 0, 0.7);
  --raise-sm:      inset 0 1px 0 var(--hi), 0 4px 10px -4px rgba(0, 0, 0, 0.6);
  --well:          inset 0 2px 6px rgba(0, 0, 0, 0.45), 0 1px 0 var(--hi);
  --edge:          #0D0B08;
  --edge-dark:     #000000;
  --key-top:       linear-gradient(180deg, #2E271D 0%, #241E16 100%);
  --key:           inset 0 1px 0 rgba(246, 239, 217, 0.10), 0 3px 0 var(--edge), 0 7px 10px -4px rgba(0, 0, 0, 0.6);
  --key-press:     inset 0 1px 0 rgba(246, 239, 217, 0.10), 0 1px 0 var(--edge);
}

* { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  padding: var(--gap);
  padding-bottom: max(var(--gap), env(safe-area-inset-bottom));
  padding-top: max(var(--gap), env(safe-area-inset-top));
  background:
    var(--grain),
    /* Le halo n'est peint qu'une fois, en haut : répété à chaque hauteur d'écran, il tranchait les longues pages. */
    radial-gradient(120% 80% at 50% 0%, var(--bg-glow) 0%, var(--bg) 62%) no-repeat,
    var(--bg);
  color: var(--fg);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
}

#app { max-width: 1120px; margin: 0 auto; }

.hidden { display: none !important; }

button { font-family: inherit; touch-action: manipulation; user-select: none; }

::selection { background: var(--green-hud); color: var(--hud-fg); }

/* ─────────────────────────────────────────────────────────────
   Écran de configuration
   ───────────────────────────────────────────────────────────── */

.board {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line-soft);
  border-bottom-color: var(--line);
  border-radius: var(--r-lg);
  padding: clamp(16px, 4vw, 30px);
  box-shadow: var(--raise);
  position: relative;
  overflow: clip;   /* pas « hidden » : le bouton de lancement doit rester sticky */
}
.board::before {
  /* liseré cible : vert / rouge / crème */
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 4px;
  background: repeating-linear-gradient(90deg,
    var(--green) 0 22px, var(--cream) 22px 30px,
    var(--red) 30px 52px, var(--ink-soft) 52px 60px);
  opacity: .9;
}

.board-head { text-align: center; margin-bottom: clamp(18px, 4vw, 28px); }
/* logo : la cible de La Mire (partials/_logo.html.twig) */
.logo-mark { display: block; width: 28px; height: 28px; flex: none; }
.logo-mark-head { width: 46px; height: 46px; margin: 4px auto 12px; filter: drop-shadow(0 2px 2px rgba(21, 18, 13, 0.18)); }
.logo-mark-login { width: 64px; height: 64px; }
.board-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 9vw, 2.9rem);
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--fg);
}
.board-head .subtitle {
  margin: 8px 0 0;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: .7rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--green-hud);
}

#setup-form { display: grid; gap: 16px; }

fieldset {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px;
  margin: 0;
  background: var(--sunken);
  border-color: var(--line-soft);
  box-shadow: var(--well);
}
legend {
  padding: 0 8px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.hint { margin: 0 0 12px; color: var(--fg-faint); font-size: .82rem; line-height: 1.4; }

/* segmented */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg-btn {
  display: grid; gap: 1px;
  padding: 12px 8px;
  font-size: 1rem; font-weight: 600;
  color: var(--fg-muted);
  background: var(--key-top);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--key);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .06s, box-shadow .06s;
}
.seg-btn:active { transform: translateY(2px); box-shadow: var(--key-press); }
.seg-btn span {
  font-family: var(--font-mono); font-weight: 600;
  font-size: .68rem; letter-spacing: .14em; text-transform: uppercase;
  opacity: .7;
}
.seg-btn.is-active {
  color: var(--fill-fg);
  background: linear-gradient(180deg, #2B251B, var(--ink));
  border-color: var(--ink);
  /* enfoncé et verrouillé, comme un interrupteur */
  transform: translateY(2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 1px 0 var(--ink-edge), 0 2px 4px -1px rgba(21, 18, 13, 0.4);
}

/* équipes */
.teams-setup { display: grid; gap: 14px; }
.team-setup { display: grid; gap: 8px; align-content: start; }
.team-setup h3 {
  margin: 0;
  font-family: var(--font-mono); font-weight: 700;
  font-size: .72rem; letter-spacing: .18em; text-transform: uppercase;
  display: flex; align-items: center; gap: 8px;
}
.team-setup h3::before {
  content: ""; width: 10px; height: 10px; border-radius: 50%; flex: none;
}
.t-green h3::before, .bull-row.t-green .bull-name::before { background: var(--green-hud); }
.t-red h3::before,   .bull-row.t-red .bull-name::before   { background: var(--red-bright); }
.t-green h3 { color: var(--green-hud); }
.t-red h3   { color: var(--red-bright); }

input[type="text"], input[type="number"], input[type="email"], input[type="password"], input[type="tel"], input[type="date"], select, textarea {
  width: 100%;
  padding: 13px 12px;
  font-family: inherit; font-size: 1rem;
  color: var(--fg);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  box-shadow: inset 0 2px 3px rgba(21, 18, 13, 0.07), 0 1px 0 var(--hi);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
input::placeholder { color: var(--fg-faint); }
textarea { resize: vertical; line-height: 1.4; }
input:focus, select:focus, textarea:focus { border-color: var(--green-hud); background-color: var(--field-focus); box-shadow: inset 0 2px 3px rgba(21, 18, 13, 0.06), 0 0 0 3px var(--green-tint-2); }
select {
  appearance: none; cursor: pointer; padding-right: 34px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--fg-muted) 50%),
    linear-gradient(135deg, var(--fg-muted) 50%, transparent 50%);
  background-position: right 17px center, right 12px center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  background-color: var(--surface-2);
  box-shadow: var(--raise-sm);
}
select option { background: var(--surface-2); color: var(--fg); }

.grid-cfg { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.bot-row { margin-top: 14px; }
.grid-cfg label, .bot-row {
  display: grid; gap: 6px; align-content: start;
  font-family: var(--font-mono); font-weight: 600;
  font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--fg-muted);
}

/* bulle */
.bull-grid { display: grid; gap: 10px; }
.bull-row {
  display: grid;
  grid-template-columns: auto 1fr 96px;
  align-items: center; gap: 12px;
  padding: 10px 12px;
  background: var(--surface-2);
  box-shadow: var(--raise-sm);
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.bull-row input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.bull-check {
  width: 22px; height: 22px; flex: none;
  border: 2px solid var(--fg-faint);
  border-radius: 50%;
  display: grid; place-items: center;
  transition: border-color .15s;
}
.bull-check::after {
  content: ""; width: 10px; height: 10px; border-radius: 50%;
  background: currentColor; transform: scale(0); transition: transform .15s;
}
.bull-name { display: flex; align-items: center; gap: 8px; font-weight: 500; overflow-wrap: anywhere; }
.bull-name::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.bull-row.t-green:has(input:checked) { border-color: var(--green-hud); background: var(--green-tint); color: var(--green-hud); }
.bull-row.t-red:has(input:checked)   { border-color: var(--red-bright); background: var(--red-tint); color: var(--red-bright); }
.bull-row:has(input:checked) .bull-check { border-color: currentColor; }
.bull-row:has(input:checked) .bull-check::after { transform: scale(1); }
.bull-dist { text-align: center; font-family: var(--font-mono); font-weight: 600; color: var(--fg); }

/* ─────────────────────────────────────────────────────────────
   Boutons
   ───────────────────────────────────────────────────────────── */

.btn {
  font-size: 1rem; font-weight: 600;
  padding: 13px 18px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--key-top);
  color: var(--fg);
  box-shadow: var(--key);
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .06s, box-shadow .06s, opacity .15s;
}
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: var(--key-press); }
.btn:disabled { opacity: var(--op-off); cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(180deg, #D3353B 0%, var(--red) 55%, #B02228 100%);
  border-color: #A41F25;
  color: var(--on-accent);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 3px 0 var(--red-edge), 0 4px 0 #5E1215, 0 8px 14px -4px rgba(140, 20, 26, 0.45);
}
.btn-primary:active:not(:disabled) { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 0 var(--red-edge), 0 1px 0 #5E1215, 0 2px 4px -1px rgba(140, 20, 26, 0.4); }
.btn-primary:disabled { box-shadow: 0 3px 0 var(--red-edge); }
.btn-outline { border-color: var(--line); color: var(--fg-muted); }
.btn-danger  { border-color: var(--red-soft); color: var(--red-bright); }
.btn-block   { width: 100%; padding: 16px; font-size: 1.05rem; }

@media (hover: hover) {
  .btn:hover:not(:disabled) { border-color: var(--line-strong); }
  .btn-primary:hover:not(:disabled) { background: linear-gradient(180deg, #DC3A40 0%, var(--red-bright) 55%, #B52329 100%); border-color: #A41F25; }
  .btn-danger:hover:not(:disabled) { background: var(--red-wash); border-color: var(--red-bright); }
  .seg-btn:hover { color: var(--fg); }
  .seg-btn.is-active:hover { color: var(--fill-fg); }
}

.icon-btn {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  font-size: 1.25rem; line-height: 1;
  color: var(--fg-muted);
  background: var(--key-top);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--key);
  cursor: pointer;
  transition: background .15s, color .15s, opacity .15s, transform .06s, box-shadow .06s;
}
.icon-btn:active:not(:disabled) { transform: translateY(2px); box-shadow: var(--key-press); }
.icon-btn:disabled { opacity: var(--op-off); cursor: not-allowed; }
.icon-btn.is-danger { color: var(--red-bright); }
@media (hover: hover) { .icon-btn:hover:not(:disabled) { color: var(--fg); border-color: var(--line-strong); } }

/* ─────────────────────────────────────────────────────────────
   Écran de jeu — grille pleine hauteur
   ───────────────────────────────────────────────────────────── */

/* Hauteur fixe = l'écran. Les touches ont une taille bornée ; la place
   qui reste va aux panneaux de score (l'historique des volées s'allonge). */
#screen-game {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: var(--gap);
  height: calc(100dvh - max(var(--gap), env(safe-area-inset-top)) - max(var(--gap), env(safe-area-inset-bottom)));
}

.game-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.match-info {
  font-family: var(--font-mono); font-weight: 600;
  font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--fg-faint);
  line-height: 1.5;
  min-width: 0;
}
.match-info b { color: var(--green-hud); font-weight: 700; }
.match-info .bull-note { display: block; color: var(--fg-faint); text-transform: none; letter-spacing: .04em; opacity: .8; }
.head-actions { display: flex; gap: 8px; flex: none; }

/* tableau des scores */
.scoreboard {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 4px 4px 6px;   /* le cadre bois déborde du panneau */
  min-height: 0;
}
.scoreboard.has-legs { grid-template-rows: auto minmax(0, 1fr); }

/* onglets des legs : on revoit un leg déjà joué */
.leg-tabs {
  grid-column: 1 / -1;
  display: flex; gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.leg-tabs::-webkit-scrollbar { display: none; }
.leg-tab {
  flex: none;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  font-family: var(--font-mono); font-weight: 600;
  font-size: .64rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--fg-muted);
  background: var(--key-top);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.leg-tab::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--line-strong);
}
.leg-tab.t0::before { background: var(--green); }
.leg-tab.t1::before { background: var(--red); }
.leg-tab.is-active {
  color: var(--fill-fg);
  background: linear-gradient(180deg, #2B251B, var(--ink));
  border-color: var(--ink);
}
@media (hover: hover) { .leg-tab:hover:not(.is-active) { color: var(--fg); border-color: var(--line-strong); } }

.team-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 4px;
  padding: 10px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: var(--r);
}
.team-panel::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--line);
}
.team-panel.t0::before { background: var(--green-hud); }
.team-panel.t1::before { background: var(--red-bright); }

/* ─────────────────────────────────────────────────────────────
   Tableau des scores : panneaux de score, joueurs, chiffres clés.
   Les couleurs sont redéfinies dans le panneau : tout ce qu'il
   contient s'écrit « à la craie » sans règle supplémentaire.
   ───────────────────────────────────────────────────────────── */
.slate, .team-panel, .pcard, .headline {
  --fg:          var(--chalk);
  --fg-muted:    rgba(243, 238, 223, 0.70);
  --fg-faint:    rgba(243, 238, 223, 0.46);
  --line:        rgba(243, 238, 223, 0.18);
  --line-soft:   rgba(243, 238, 223, 0.10);
  --line-strong: rgba(243, 238, 223, 0.36);
  --green-hud:   #62D394;
  --red-bright:  #F47468;
  --green-tint:  rgba(98, 211, 148, 0.14);
  --green-tint-2: rgba(98, 211, 148, 0.26);
  --red-wash:    rgba(244, 116, 104, 0.15);
  --red-soft:    rgba(244, 116, 104, 0.55);
  --fill:        var(--chalk);
  --fill-fg:     var(--slate-lo);
  --hud-fg:      var(--slate-lo);
  --chip:        rgba(243, 238, 223, 0.08);
  --chip-line:   rgba(243, 238, 223, 0.32);
  --scroll-thumb: rgba(243, 238, 223, 0.22);
  --sunken-2:    rgba(0, 0, 0, 0.25);

  color: var(--fg);
  background:
    var(--chalk-grain),
    radial-gradient(130% 80% at 25% -10%, rgba(255, 255, 255, 0.07), transparent 55%),
    radial-gradient(90% 60% at 85% 110%, rgba(243, 238, 223, 0.05), transparent 60%),
    linear-gradient(180deg, var(--slate), var(--slate-lo));
  border: 1px solid #111517;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    inset 0 0 0 3px rgba(0, 0, 0, 0.12),
    0 0 0 3px #7A5A36,                       /* cadre bois */
    0 0 0 4px #4A3520,
    0 2px 0 4px #3A2A19,
    0 16px 26px -10px rgba(21, 18, 13, 0.55);
  transition: box-shadow .2s;
}
/* chiffres à la craie : un léger flou de poussière */
.team-score, .pcard-score, .headline-value, .pcard-number {
  text-shadow: 0 0 1px rgba(243, 238, 223, 0.45), 0 0 14px rgba(243, 238, 223, 0.10);
}
/* au tour de : un trait de craie de la couleur de l'équipe */
.team-panel.t0.is-active, .pcard.is-active {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    inset 0 0 0 2px var(--green-hud),
    inset 0 0 28px rgba(98, 211, 148, 0.16),
    0 0 0 3px #7A5A36, 0 0 0 4px #4A3520, 0 2px 0 4px #3A2A19,
    0 16px 26px -10px rgba(21, 18, 13, 0.55);
}
.team-panel.t1.is-active {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    inset 0 0 0 2px var(--red-bright),
    inset 0 0 28px rgba(244, 116, 104, 0.16),
    0 0 0 3px #7A5A36, 0 0 0 4px #4A3520, 0 2px 0 4px #3A2A19,
    0 16px 26px -10px rgba(21, 18, 13, 0.55);
}

.team-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; min-width: 0; }
.team-name {
  font-weight: 600; font-size: 1.1rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.team-crowns {
  font-family: var(--font-mono); font-weight: 600;
  font-size: .72rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--fg-faint); white-space: nowrap; flex: none;
}
.team-crowns b { color: var(--fg); font-weight: 700; font-size: 1rem; }

.team-score {
  font-family: var(--font-mono); font-weight: 700;
  font-size: clamp(3.6rem, 19vw, 5.4rem);
  line-height: 1;
  text-align: center;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
}
.team-panel.t0.is-active .team-score { color: var(--green-hud); }
.team-panel.t1.is-active .team-score { color: var(--red-bright); }
.team-score.is-finish { color: var(--green-hud) !important; }

.team-thrower {
  text-align: center;
  min-height: 1.2em;
  font-size: .92rem; font-weight: 500;
  color: var(--fg-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.team-panel.is-active .team-thrower { color: var(--fg); }
.team-thrower.is-swappable {
  display: block; width: 100%;
  font-family: inherit;
  background: none; border: 1px dashed var(--line); border-radius: 6px;
  cursor: pointer;
}
.team-thrower.is-swappable span { color: var(--fg-muted); }

.team-turns {
  list-style: none; margin: 6px 0 0; padding: 0;
  min-height: 0; overflow-y: auto;
  border-top: 1px solid var(--line-soft);
  scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent;
  -webkit-overflow-scrolling: touch;
}
.team-turns li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: baseline; gap: 8px;
  padding: 5px 2px;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--font-mono); font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.team-turns .t-darts {
  font-size: .8rem; letter-spacing: .04em;
  color: var(--fg-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.team-turns .t-scored { font-size: 1.25rem; color: var(--fg); }
.team-turns .t-rest   { font-size: .88rem; color: var(--fg-faint); min-width: 2.8em; text-align: right; }
.team-turns li.is-bust .t-scored { color: var(--red-bright); font-size: .85rem; }
.team-turns li.is-ton  .t-scored { color: var(--green-hud); }
.team-turns li.is-win  .t-scored { color: var(--green-hud); }

.team-stats {
  padding-top: 5px;
  font-family: var(--font-mono); font-weight: 600;
  font-size: .72rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--fg-muted);
  text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.team-stats span { display: block; overflow: hidden; text-overflow: ellipsis; }
.team-stats span + span { opacity: .75; }

/* suggestion de sortie (finish) */
.checkout {
  display: flex; flex-wrap: wrap;
  align-items: center; justify-content: center; gap: 6px;
}
.checkout:empty { display: none; }
.co-label {
  font-family: var(--font-mono); font-weight: 600;
  font-size: .6rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--fg-faint);
}
.co-dart {
  font-family: var(--font-mono); font-weight: 700;
  font-size: .92rem; letter-spacing: .02em;
  padding: 2px 9px;
  border-radius: 999px;
  color: var(--green-hud);
  background: var(--green-tint);
  border: 1px solid var(--green-tint-2);
}
/* la fléchette qui clôture le leg */
.co-dart.is-final {
  color: var(--hud-fg);
  background: var(--green-hud);
  border-color: var(--green-hud);
}
.co-none { font-size: .74rem; font-style: italic; color: var(--fg-faint); }

/* volée en cours */
.turn-area {
  display: grid; gap: 6px; justify-items: center;
  padding: 8px;
  background: var(--sunken-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  box-shadow: var(--well);
}
.turn-who { font-size: .98rem; color: var(--fg-muted); text-align: center; }
.turn-who b { color: var(--fg); font-weight: 600; }

.darts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; max-width: 340px; }
.dart-slot {
  height: 52px;
  display: grid; place-items: center;
  padding: 0;
  font-family: var(--font-mono); font-weight: 700; font-size: 1.45rem;
  background: transparent;
  border: 1.5px dashed var(--line);
  border-radius: 10px;
  color: var(--fg-faint);
  transition: border-color .12s, background .12s, color .12s, transform .06s;
}
.dart-slot.is-filled {
  border-style: solid;
  border-color: var(--chip-line);
  background: var(--field);
  box-shadow: var(--raise-sm);
  color: var(--fg);
  cursor: pointer;   /* cliquer une fléchette la corrige */
}
.dart-slot.is-filled:active { transform: scale(.95); }
@media (hover: hover) {
  /* :not(.is-editing) sinon le survol écrase le fond de la fléchette sélectionnée */
  .dart-slot.is-filled:not(.is-editing):hover {
    border-color: var(--fill);
    background: var(--chip-hover);
  }
}
/* fléchette en cours de correction */
.dart-slot.is-editing {
  border-style: solid;
  border-color: var(--fill);
  background: var(--fill);
  color: var(--fill-fg);
  animation: editing 1.5s ease-in-out infinite;
}
@keyframes editing {
  0%, 100% { box-shadow: 0 0 0 0 var(--ring-fill); }
  55%      { box-shadow: 0 0 0 7px transparent; }
}
@media (prefers-reduced-motion: reduce) { .dart-slot.is-editing { animation: none; } }
.turn-total {
  font-family: var(--font-mono); font-weight: 600;
  font-size: .82rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--fg-muted); min-height: 1.3em;
  --num: 1.25rem;
}
/* la place d'un chiffre en gras, même sans fléchette : le bloc ne grandit pas à la première */
.turn-total::before { content: "\200b"; font-size: var(--num); }
.turn-total b { font-size: var(--num); color: var(--fg); }
/* Bob's 27 : la hauteur du bouton Valider, qui vient avec la première fléchette */
[data-controller="bobs27"] .turn-total::after { content: "\200b"; display: inline-block; font-size: .88rem; padding-block: 9px; }
.turn-total.is-bust, .turn-total.is-bust b { color: var(--red-bright); }
.turn-total.is-win, .turn-total.is-win b { color: var(--green-hud); }

/* volée close : elle attend la validation */
.turn-area.is-locked { border-color: var(--locked-line); background: var(--locked-bg); }
.turn-area.is-locked .dart-slot.is-empty { opacity: .35; }
.turn-area:has(.dart-slot.is-editing) { border-color: var(--fill); }

/* clavier */
.keypad {
  display: grid;
  gap: 10px;
  padding-bottom: 4px;   /* la tranche de la dernière rangée */
}
.mods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mod {
  display: grid; justify-items: center; align-content: center; gap: 0;
  padding: 6px 4px;
  color: var(--fg-muted);
  background: var(--key-top);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--key);
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s, transform .06s, box-shadow .06s;
}
.mod:active { transform: translateY(2px); box-shadow: var(--key-press); }
.mod b { font-family: var(--font-mono); font-weight: 700; font-size: 1.25rem; line-height: 1.1; }
.mod span { font-family: var(--font-mono); font-weight: 600; font-size: .55rem; letter-spacing: .16em; text-transform: uppercase; opacity: .75; }
.mod:disabled { opacity: var(--op-off); cursor: not-allowed; }
.mod.is-active {
  color: var(--fill-fg); background: linear-gradient(180deg, #2B251B, var(--ink)); border-color: var(--ink);
  transform: translateY(2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 1px 0 var(--ink-edge);
}
.mod[data-mult="2"].is-active { background: linear-gradient(180deg, #23894F, var(--green-hud)); border-color: #0F5730; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 0 #0B4626; color: var(--hud-fg); }
.mod[data-mult="3"].is-active { background: linear-gradient(180deg, #D3353B, var(--red)); border-color: #A41F25; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 1px 0 var(--red-edge); color: var(--on-accent); }

.numbers {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-auto-rows: clamp(34px, 6.2dvh, 58px);
  gap: 6px;
}
.specials { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }

.key {
  display: grid; place-items: center;
  padding: 4px;
  font-family: var(--font-mono); font-weight: 700;
  font-size: clamp(1.05rem, 4.4vw, 1.35rem);
  font-variant-numeric: tabular-nums;
  color: var(--fg);
  background: var(--key-top);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--key);
  cursor: pointer;
  transition: background .1s, transform .06s, border-color .1s, box-shadow .06s;
}
.key:active:not(:disabled) { transform: translateY(2px); box-shadow: var(--key-press); background: var(--surface-3); }
.key:disabled { opacity: var(--op-off); cursor: not-allowed; }
@media (hover: hover) { .key:hover:not(:disabled) { border-color: var(--line-strong); } }

.key-special { grid-auto-flow: row; gap: 0; min-height: 50px; }
.key-special b { font-family: var(--font-text); font-weight: 600; font-size: .72rem; letter-spacing: .04em; }
.key-special span { font-family: var(--font-mono); font-weight: 700; font-size: 1.05rem; color: var(--fg-muted); }
.key-special.is-green span { color: var(--green-hud); }
.key-special.is-red span   { color: var(--red-bright); }

/* la volée est prête : le bouton de validation se signale */
.btn-primary.is-ready { animation: ready 1.6s ease-in-out infinite; }
@keyframes ready {
  0%, 100% { box-shadow: 0 0 0 0 var(--ring-red); }
  55%      { box-shadow: 0 0 0 9px transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .btn-primary.is-ready { animation: none; box-shadow: 0 0 0 3px var(--ring-red); }
}

.pad-actions { display: grid; grid-template-columns: 64px 1fr; gap: 8px; }
/* le bot lance : le clavier attend */
.keypad[inert] { opacity: .45; transition: opacity .2s; }

/* saisie du total de la volée */
.total-entry {
  display: none;
  min-width: 140px; height: 46px;
  place-items: center;
  padding: 0 18px;
  font-family: var(--font-mono); font-weight: 700; font-size: 1.9rem;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
  background: var(--field);
  border: 1.5px solid var(--chip-line);
  border-radius: 10px;
  box-shadow: var(--raise-sm);
}
.total-entry.is-empty {
  font-size: .8rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--fg-faint);
  background: transparent;
  border-style: dashed; border-color: var(--line);
}
.turn-area.is-total .darts { display: none; }
.turn-area.is-total .total-entry { display: grid; }

.total-pad {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: clamp(44px, 8.5dvh, 72px);
  gap: 6px;
}
.keypad.is-total .mods,
.keypad.is-total .numbers,
.keypad.is-total .specials { display: none; }
.keypad.is-total .total-pad { display: grid; }
.pad-actions .btn { padding: 14px 10px; font-size: 1rem; }

/* bannière leg / set */
.banner {
  position: fixed;
  left: 50%; bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 40;
  max-width: calc(100vw - 24px);
  padding: 12px 22px;
  text-align: center;
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.05rem;
  color: var(--hud-fg);
  background: var(--green-hud);
  border-radius: 999px;
  box-shadow: var(--shadow-banner);
  animation: pop .22s cubic-bezier(.2,.9,.3,1.4);
}
@keyframes pop { from { transform: translateX(-50%) scale(.85); opacity: 0; } }

/* Les règles d'un jeu : un « ? » à côté du titre des réglages, et dans l'en-tête de la partie. */
.rules-help { display: inline-flex; vertical-align: middle; }
.rules-btn { font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; }
.board-head h1 .rules-btn { margin-left: 6px; }

/* modale */
.modal-root { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 18px; }
.modal-backdrop { position: absolute; inset: 0; background: var(--backdrop); backdrop-filter: blur(4px); }
.modal {
  position: relative;
  width: min(440px, 100%);
  padding: 26px 22px 22px;
  text-align: center;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-modal);
  animation: pop-modal .2s ease-out;
}
@keyframes pop-modal { from { transform: scale(.92); opacity: 0; } }
.modal h2 {
  margin: 0 0 8px;
  font-family: var(--font-display); font-weight: 700; font-size: 1.6rem;
  color: var(--fg);
}
.modal p { margin: 0 0 20px; color: var(--fg-muted); font-size: .95rem; }
.modal p b { color: var(--green-hud); }
/* La fin de partie, en grand : le trophée, le vainqueur. */
.modal.is-end { width: min(620px, 100%); padding: 30px 24px 24px; }
.modal.is-end::before { content: '🏆'; display: block; margin-bottom: 8px; font-size: 3.6rem; line-height: 1; animation: fx-trophy .6s cubic-bezier(.2, 1.4, .4, 1); }
.modal.is-end h2 { margin-bottom: 12px; font-size: clamp(2rem, 8vw, 3.2rem); line-height: 1.08; }
.modal.is-end p { font-size: 1.1rem; line-height: 1.5; }
@keyframes fx-trophy { from { transform: scale(.2) rotate(-12deg); opacity: 0; } }
/* Un texte à lire (les règles d'un jeu) : plus large, aligné à gauche, il défile sous le titre. */
.modal.is-doc { width: min(640px, 100%); text-align: left; display: flex; flex-direction: column; max-height: calc(100dvh - 36px); }
.modal.is-doc h2 { text-align: center; }
.modal.is-doc #modal-text { overflow-y: auto; min-height: 0; margin: 0 -6px 16px; padding: 0 6px; }
.rules h3 { margin: 16px 0 6px; font-family: var(--font-display); font-size: 1.05rem; color: var(--fg); }
.rules h3:first-child, .rules .rules-game + h3 { margin-top: 4px; }
.modal .rules p { margin: 0 0 6px; }
.rules ul { margin: 0; padding-left: 1.15rem; display: grid; gap: 5px; }
.rules p, .rules li { font-size: .95rem; line-height: 1.45; color: var(--fg-muted); }
.modal .rules b { color: var(--fg); }
.modal .rules .rules-game { padding: 8px 12px; border-radius: 10px; background: var(--surface-3); }
.modal-actions { display: grid; gap: 10px; }
@media (min-width: 400px) { .modal-actions { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); } }
/* une action « large » (Revoir la partie, Grand écran) passe sous les autres, seule sur sa ligne */
@media (min-width: 400px) {
  .modal-actions.has-wide { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal-actions .is-wide { grid-column: 1 / -1; }
}
/* choix compacts (ex. nombre de fléchettes) : toujours côte à côte */
.modal-actions.is-choices { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.modal-actions.is-choices .btn { display: grid; gap: 2px; padding: 12px 6px; }
.modal-actions.is-choices .btn b { font-family: var(--font-mono); font-size: 1.8rem; line-height: 1; }
.modal-actions.is-choices .btn span { font-size: .72rem; font-weight: 500; opacity: .8; }
/* saisie dans une modale (code d'une télé) */
.modal .modal-code { display: block; width: 100%; margin-top: 14px; text-align: center; font-family: var(--font-mono); font-size: 1.4rem; text-transform: uppercase; letter-spacing: .2em; }
.modal .modal-code::placeholder { font-family: var(--font-text); font-size: 1rem; text-transform: none; letter-spacing: 0; }
.modal .modal-error { display: block; margin-top: 10px; color: var(--red-bright); font-weight: 600; }
.modal .modal-note { display: block; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--sunken); }
.modal .modal-email { display: grid; grid-template-columns: minmax(80px, auto) 1fr; gap: 10px; align-items: center; margin-top: 10px; text-align: left; }
.modal .modal-email span { font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.modal .modal-email input { width: 100%; }

/* ─────────────────────────────────────────────────────────────
   Tablette / desktop
   ───────────────────────────────────────────────────────────── */

@media (min-width: 560px) {
  :root { --gap: 14px; }
  .teams-setup { grid-template-columns: 1fr 1fr; gap: 18px; }
  .co-dart { font-size: 1rem; padding: 3px 11px; }
  .co-label { font-size: .64rem; }
  .team-turns .t-darts { font-size: .9rem; }
  .team-turns .t-scored { font-size: 1.45rem; }
  .team-turns .t-rest { font-size: .95rem; }
  .team-stats { font-size: .78rem; }
  .dart-slot { height: 62px; font-size: 1.75rem; }
  .match-info { font-size: .8rem; }
}

@media (min-width: 900px) {
  #screen-game {
    grid-template-columns: 1fr minmax(380px, 440px);
    grid-template-rows: auto auto minmax(0, 1fr);
    grid-template-areas:
      "head head"
      "score turn"
      "score pad";
    column-gap: 18px;
  }
  .game-head { grid-area: head; }
  .scoreboard { grid-area: score; }
  .turn-area { grid-area: turn; align-content: center; }
  /* Le clavier tient dans ce qui reste de la colonne : les rangées de chiffres
     cèdent de la hauteur (jusqu'à leur minimum) plutôt que de pousser
     « Valider la volée » sous l'écran (tablette à l'horizontale, clavier ouvert). */
  .keypad { grid-area: pad; display: flex; flex-direction: column; min-height: 0; }
  .keypad > * { flex: none; }
  /* les panneaux occupent toute la colonne : l'historique respire */
  .team-panel { padding: 16px; }
  .team-score { font-size: clamp(4rem, 7vw, 6rem); }
  .team-name { font-size: 1.35rem; }
  .team-crowns { font-size: .8rem; }
  .team-crowns b { font-size: 1.15rem; }
  .team-turns .t-darts { font-size: 1rem; }
  .team-turns .t-scored { font-size: 1.7rem; }
  .team-turns .t-rest { font-size: 1.05rem; }
  .team-turns li { padding: 8px 4px; }
  .team-stats { font-size: .86rem; }
  .turn-who { font-size: 1.1rem; }
  .eye-pad-hint { font-size: 1.1rem; }
  /* on borne la taille des touches pour ne pas avoir de pavé géant */
  .numbers { grid-auto-rows: minmax(36px, 76px); gap: 8px; }
  .key { font-size: 1.3rem; }
  .key-special { min-height: 58px; }
  .dart-slot { height: 72px; font-size: 2rem; }
  .total-entry { height: 60px; font-size: 2.2rem; }
  .total-pad { grid-auto-rows: minmax(40px, 76px); gap: 8px; }
  /* quatre rangées chacun : le plancher est celui de leurs rangées les plus basses */
  .keypad > .numbers { flex: 0 1 auto; min-height: calc(4 * 36px + 3 * 8px); }
  .keypad > .total-pad { flex: 0 1 auto; min-height: calc(4 * 40px + 3 * 8px); }
}

/* tablette à l'horizontale, écran peu haut (barres du navigateur) : la volée
   passe sous les scores, le clavier a la colonne de droite pour lui seul */
@media (min-width: 900px) and (max-height: 760px) {
  :root { --gap: 10px; }
  #screen-game {
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "head  head"
      "score pad"
      "turn  pad";
  }
  .turn-area { padding: 6px; gap: 4px; }
  .dart-slot { height: 54px; font-size: 1.6rem; }
  .total-entry { height: 46px; font-size: 1.8rem; }
  .keypad { gap: 8px; }
  .mod { padding: 3px; }
  .key-special { min-height: 44px; }
  .pad-actions .btn { padding: 11px 8px; }
  .eye-pad-hint { padding: 8px 12px; font-size: 1rem; }
}

/* écrans courts : on compacte pour rester sur une seule hauteur d'écran */
@media (max-height: 760px) and (max-width: 899px) {
  :root { --gap: 8px; }
  .match-info .bull-note { display: none; }
  .team-panel { padding: 8px; }
  .team-score { font-size: clamp(2.9rem, 16vw, 3.9rem); }
  .team-thrower { min-height: 0; font-size: .74rem; }
  .team-turns { margin-top: 4px; }
  .team-turns li { padding: 2px; }
  .team-stats { padding-top: 3px; font-size: .66rem; }
  .turn-area { padding: 6px; gap: 4px; }
  .turn-who { font-size: .9rem; }
  .checkout { gap: 5px; }
  .co-dart { font-size: .82rem; padding: 1px 7px; }
  .co-label { font-size: .55rem; }
  .dart-slot { height: 46px; font-size: 1.3rem; }
  .total-entry { height: 40px; font-size: 1.5rem; }
  .turn-total { font-size: .74rem; min-height: 1.1em; }
  .mods { gap: 6px; }
  .mod { padding: 3px; }
  .mod b { font-size: 1.05rem; }
  .mod span { font-size: .5rem; }
  .key-special { min-height: 40px; }
  .numbers { grid-auto-rows: clamp(32px, 5.4dvh, 44px); }
  .total-pad { grid-auto-rows: clamp(42px, 7.5dvh, 60px); }
  .key-special b { font-size: .66rem; }
  .key-special span { font-size: .92rem; }
  .pad-actions .btn { padding: 11px 8px; font-size: .95rem; }
  .icon-btn { width: 36px; height: 36px; font-size: 1.1rem; }
}

/* Tablette de la cible en portrait (Galaxy Tab Active 3 : 600 px de large, 790 à
   960 de haut selon les barres d'Android et du navigateur). Le clavier ouvert pour
   corriger une fléchette de l'Œil n'écrase plus le tableau : la consigne de la
   caméra s'efface (eye_watch.js), le clavier et la volée se font un peu moins hauts. */
@media (min-width: 560px) and (max-width: 899px) and (orientation: portrait) {
  #screen-game.eye-mode.pad-open, .screen-variant.eye-mode.pad-open { row-gap: 10px; }
  .eye-mode.pad-open .team-score { font-size: 4rem; }
  .eye-mode.pad-open .turn-area { padding: 6px; gap: 4px; }
  .eye-mode.pad-open .dart-slot { height: 52px; }
  .eye-mode.pad-open .numbers { grid-auto-rows: clamp(40px, 5.2dvh, 52px); }
  .eye-mode.pad-open .cricket-board td { height: clamp(24px, 3dvh, 34px); }
}

/* très petits écrans : la liste des volées passe en une ligne */
@media (max-height: 660px) and (max-width: 899px) {
  .team-score { font-size: clamp(2.5rem, 14vw, 3.2rem); }
  .turn-area { padding: 5px; gap: 3px; }
  .dart-slot { height: 42px; font-size: 1.2rem; }
  .numbers { gap: 5px; }
  .key-special { min-height: 34px; }
  .pad-actions .btn { padding: 9px 8px; }
}

/* téléphone à l'horizontale : scores à gauche, clavier à droite */
@media (orientation: landscape) and (max-height: 500px) and (max-width: 1100px) {
  #screen-game {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "head  pad"
      "score pad"
      "turn  pad";
    column-gap: 12px;
  }
  .game-head { grid-area: head; }
  .scoreboard { grid-area: score; }
  .turn-area { grid-area: turn; }
  .keypad { grid-area: pad; grid-template-rows: auto minmax(0, 1fr) auto auto; gap: 6px; }
  .keypad.is-total { grid-template-rows: minmax(0, 1fr) auto; }
  .numbers { grid-auto-rows: minmax(28px, 1fr); gap: 5px; }
  .total-pad { grid-auto-rows: minmax(36px, 1fr); }
  .team-score { font-size: clamp(2.2rem, 11dvh, 3.4rem); }
  .turn-who, .turn-total:empty { display: none; }
  .key-special { min-height: 34px; }
  .pad-actions .btn { padding: 8px; }
}

/* ═══════════════════════════════════════════════════════════════
   Application club : navigation, pages, listes, statistiques
   ═══════════════════════════════════════════════════════════════ */

a { color: inherit; }

.topbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin: 0 auto var(--gap);
  max-width: 1120px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
  font-family: var(--font-display); font-weight: 700; font-size: 1.55rem;
  letter-spacing: -.01em;
}
.brand .logo-mark { width: 40px; height: 40px; }
.nav {
  display: flex; flex-wrap: wrap; gap: 2px; margin-left: auto;
  padding: 4px;
  background: var(--sunken-2);
  border-radius: 14px;
  box-shadow: var(--well);
}
.nav a {
  padding: 8px 12px;
  border-radius: 10px;
  text-decoration: none;
  font-size: .9rem; font-weight: 500;
  color: var(--fg-muted);
}
.nav a.is-active {
  color: var(--fill-fg);
  background: linear-gradient(180deg, #2B251B, var(--ink));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 1px 0 var(--ink-edge), 0 3px 6px -2px rgba(21, 18, 13, 0.45);
}
@media (hover: hover) { .nav a:not(.is-active):hover { background: var(--hover); color: var(--fg); } }

/* Sur téléphone : la barre d'onglets en bas remplace le menu du haut. */
.tabbar { display: none; }
@media (max-width: 720px) {
  :root { --tabbar-h: 62px; }
  .topbar .nav { display: none; }
  .topbar { margin-bottom: 12px; }
  .page { padding-bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom)); }
  .tabbar {
    position: fixed; z-index: 45; left: 0; right: 0; bottom: 0;
    display: flex;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px -12px rgba(21, 18, 13, 0.25);
  }
  .tab {
    flex: 1 1 0; min-width: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    height: 50px; border-radius: 12px;
    color: var(--fg-muted); text-decoration: none;
    font-size: .7rem; font-weight: 600; letter-spacing: .01em;
    cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .tab-icon { width: 23px; height: 23px; }
  .tab.is-active { color: var(--fg); }
  .tab.is-active .tab-icon { color: var(--red); }
  .tab.is-active span { position: relative; }
  .tab.is-active span::after {
    content: ""; position: absolute; left: 50%; bottom: -5px; transform: translateX(-50%);
    width: 4px; height: 4px; border-radius: 50%; background: var(--red);
  }
  .tab:active { background: var(--hover); }
  .tabbar-more { flex: 1 1 0; min-width: 0; position: relative; display: flex; }
  .tabbar-more > summary { list-style: none; }
  .tabbar-more > summary::-webkit-details-marker { display: none; }
  .tabbar-more[open] > summary { background: var(--hover); color: var(--fg); }
  .tabbar-sheet {
    position: absolute; right: 0; bottom: calc(100% + 10px);
    width: min(260px, calc(100vw - 20px));
    display: grid; padding: 6px;
    background: var(--surface-2);
    border: 1px solid var(--line); border-radius: 14px;
    box-shadow: var(--shadow-modal);
  }
  .tabbar-who { margin: 0; padding: 8px 10px 10px; border-bottom: 1px solid var(--line-soft); font-weight: 700; overflow-wrap: anywhere; }
  .tabbar-who small { display: block; color: var(--fg-faint); font-weight: 500; font-size: .78rem; }
  .tabbar-sheet a { padding: 12px 10px; border-radius: 9px; text-decoration: none; font-weight: 600; }
  .tabbar-sheet a.is-active { background: var(--hover); }
  .tabbar-sheet a:active { background: var(--hover); }
  .tabbar-sheet a:last-child { color: var(--red-bright); }
}
@media print { .tabbar { display: none; } }

/* Installer l'application (encart de l'accueil, menu Compte) */
.install-card {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; align-items: center; gap: 12px;
  padding: 12px 12px 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--raise-sm);
}
.install-card[hidden] { display: none; }
.install-card img { border-radius: 10px; }
.install-card p { margin: 0; font-size: .9rem; line-height: 1.35; color: var(--fg-muted); }
.install-card p b { color: var(--fg); }
.install-close { width: 32px; height: 32px; font-size: 1rem; }
@media (max-width: 480px) {
  .install-card { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .install-card .btn { grid-column: 1 / -1; grid-row: 2; }
  .install-close { grid-column: 3; grid-row: 1; align-self: start; }
}
.tabbar-install {
  margin: 0; padding: 12px 10px; border: 0; border-radius: 9px; background: none;
  font: inherit; font-weight: 600; text-align: left; color: var(--green-hud); cursor: pointer;
}
.tabbar-install[hidden] { display: none; }
.tabbar-install:active { background: var(--hover); }
.install-steps { margin: 0; padding-left: 1.3em; display: grid; gap: 8px; text-align: left; }

.page { display: grid; gap: 18px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head h1, .page h1 {
  margin: 0;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.6rem, 6vw, 2.3rem); line-height: 1.05; letter-spacing: -.02em;
}
.page-head p { margin: 4px 0 0; color: var(--fg-muted); }
.section-title {
  margin: 0 0 10px;
  font-family: var(--font-mono); font-weight: 600;
  font-size: .72rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--fg-muted);
}

.card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line-soft);
  border-bottom-color: var(--line);
  border-radius: var(--r-lg);
  padding: clamp(14px, 3vw, 22px);
  box-shadow: var(--raise);
  min-width: 0;
}
.grid-2 { display: grid; gap: 18px; }
.grid-3 { display: grid; gap: 14px; }
@media (min-width: 760px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

.flash {
  padding: 12px 14px; border-radius: var(--r);
  border: 1px solid var(--line-strong); background: var(--sunken-2);
}
.flash-error { border-color: var(--red-soft); background: var(--red-wash); color: var(--red-bright); }

/* tuiles de variante (accueil) */
.game-tiles { display: grid; gap: 14px; padding-bottom: 4px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.game-tile {
  position: relative;
  display: grid; gap: 6px; align-content: start;
  padding: 18px;
  min-height: 130px;
  text-decoration: none;
  background: var(--key-top);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--key);
  transition: border-color .15s, transform .06s, box-shadow .06s;
}
.game-tile:active { transform: translateY(2px); box-shadow: var(--key-press); }
@media (hover: hover) { .game-tile:hover { border-color: var(--fill); } }
.game-tile b { font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; }
.game-tile span { color: var(--fg-muted); font-size: .88rem; }
.game-tile::after {
  content: "→"; position: absolute; right: 16px; top: 16px;
  font-family: var(--font-mono); color: var(--fg-faint);
}

/* listes */
.list { list-style: none; margin: 0; padding: 0; display: grid; }
.list li { border-bottom: 1px solid var(--line-soft); }
.list li:last-child { border-bottom: 0; }
.list a, .list .row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center;
  padding: 10px 2px;
  text-decoration: none;
}
.list .title { font-weight: 600; overflow-wrap: anywhere; }
.list .sub { grid-column: 1; color: var(--fg-faint); font-size: .82rem; }
.list .side { grid-row: 1 / span 2; grid-column: 2; text-align: right; font-family: var(--font-mono); font-weight: 600; font-size: .8rem; color: var(--fg-muted); }
.empty { color: var(--fg-faint); font-style: italic; margin: 0; }

.badge {
  display: inline-block;
  padding: 2px 8px; border-radius: 999px;
  font-family: var(--font-mono); font-weight: 600;
  font-size: .62rem; letter-spacing: .1em; text-transform: uppercase;
  border: 1px solid var(--line); color: var(--fg-muted);
  white-space: nowrap;
}
.badge.is-live { border-color: var(--green-hud); color: var(--green-hud); background: var(--green-tint); }
.badge.is-off  { border-color: var(--red-soft); color: var(--red-bright); }

/* tableaux */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th, table.data td { padding: 9px 8px; border-bottom: 1px solid var(--line-soft); text-align: right; white-space: nowrap; }
table.data th:first-child, table.data td:first-child { text-align: left; white-space: normal; }
table.data th {
  font-family: var(--font-mono); font-weight: 600;
  font-size: .62rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--fg-faint);
}
table.data td { font-variant-numeric: tabular-nums; }
table.data a { font-weight: 600; text-decoration: none; }

/* chiffres clés */
.kpis { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.kpi {
  padding: 12px 14px;
  background: var(--sunken);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  box-shadow: var(--well);
}
.kpi-label {
  font-family: var(--font-mono); font-weight: 600;
  font-size: .6rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--fg-faint);
}
.kpi-value {
  font-family: var(--font-mono); font-weight: 700;
  font-size: 1.7rem; line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.kpi-value small { font-size: .9rem; color: var(--fg-muted); }
.kpi-sub { font-size: .76rem; color: var(--fg-faint); }

/* barres horizontales (répartition des volées, tranches) */
.bars { display: grid; gap: 8px; }
.bar { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: .85rem; }
.bar-label { font-family: var(--font-mono); font-weight: 600; font-size: .75rem; color: var(--fg-muted); }
.bar-track { height: 12px; border-radius: 999px; background: var(--sunken-2); overflow: hidden; box-shadow: inset 0 1px 2px rgba(21, 18, 13, 0.18); }
.bar-fill { height: 100%; border-radius: 999px; background: var(--fill); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), inset 0 -1px 0 rgba(0, 0, 0, 0.15); }
.bar-fill.is-good { background: var(--green-hud); }
.bar-fill.is-bad  { background: var(--red-bright); }
.bar-value { text-align: right; font-family: var(--font-mono); font-weight: 600; font-variant-numeric: tabular-nums; }

/* constats : points forts / faibles */
.insights { display: grid; gap: 10px; }
.insight {
  display: grid; gap: 4px; align-content: start;
  padding: 12px 14px 12px 16px;
  border: 1px solid var(--line-soft);
  border-left-width: 4px;
  border-radius: var(--r);
  background: var(--surface-2);
  box-shadow: var(--raise-sm);
}
.insight.is-weakness { border-left-color: var(--red-bright); }
.insight.is-strength { border-left-color: var(--green-hud); }
.insight.is-info     { border-left-color: var(--fg-faint); }
.insight-kind {
  font-family: var(--font-mono); font-weight: 600;
  font-size: .6rem; letter-spacing: .16em; text-transform: uppercase;
}
.insight.is-weakness .insight-kind { color: var(--red-bright); }
.insight.is-strength .insight-kind { color: var(--green-hud); }
.insight.is-info .insight-kind { color: var(--fg-muted); }
.insight h3 { margin: 0; font-size: 1rem; font-weight: 600; }
.insight p { margin: 0; color: var(--fg-muted); font-size: .9rem; }
.insight .exercise { justify-self: start; margin-top: 4px; padding: 7px 12px; font-size: .85rem; text-decoration: none; }

/* carte des doubles (Bob's 27) */
.doubles-map { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
@media (min-width: 560px) { .doubles-map { grid-template-columns: repeat(11, 1fr); } }
.dbl {
  display: grid; place-items: center; gap: 0;
  aspect-ratio: 1;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--sunken);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -2px 3px rgba(21, 18, 13, 0.08);
  font-family: var(--font-mono);
}
.dbl b { font-size: .95rem; }
.dbl span { font-size: .62rem; color: var(--fg-muted); }
.dbl.is-empty { opacity: .45; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .76rem; color: var(--fg-faint); margin-top: 10px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: -2px; margin-right: 4px; }

.chart-box { position: relative; height: 240px; }

.filters {
  display: flex; gap: 2px; flex-wrap: wrap;
  padding: 3px;
  background: var(--sunken-2);
  border-radius: 999px;
  box-shadow: var(--well);
}
.filters a {
  padding: 6px 11px; border-radius: 999px;
  text-decoration: none;
  font-size: .8rem; color: var(--fg-muted);
}
.filters a.is-active {
  color: var(--fill-fg);
  background: linear-gradient(180deg, #2B251B, var(--ink));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 1px 0 var(--ink-edge), 0 3px 6px -2px rgba(21, 18, 13, 0.45);
}
@media (hover: hover) { .filters a:not(.is-active):hover { color: var(--fg); background: var(--hover); } }

/* vue « L'essentiel » / « Analyse détaillée » */
.view-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
.view-tabs {
  display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding: 4px; gap: 4px;
  background: var(--sunken-2);
  border-radius: 999px;
  box-shadow: var(--well);
}
.view-tabs a {
  padding: 9px 16px; border-radius: 999px;
  text-align: center; text-decoration: none;
  font-weight: 600; font-size: .9rem; color: var(--fg-muted);
  white-space: nowrap;
}
.view-tabs a.is-active {
  color: var(--fill-fg);
  background: linear-gradient(180deg, #2B251B, var(--ink));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 1px 0 var(--ink-edge), 0 3px 6px -2px rgba(21, 18, 13, 0.45);
}
@media (hover: hover) { .view-tabs a:not(.is-active):hover { color: var(--fg); background: var(--hover); } }
.view-hint { margin: 0; display: flex; align-items: center; gap: 8px; }
@media (max-width: 480px) { .view-tabs { display: grid; width: 100%; } }

.headlines { display: grid; gap: 18px; padding: 4px 4px 6px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.headline {
  display: grid; gap: 6px; align-content: start;
  padding: 16px 18px;
  border-radius: var(--r);
}
.headline-label {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-weight: 600;
  font-size: .66rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--fg-muted);
}
.headline-value {
  font-family: var(--font-mono); font-weight: 700;
  font-size: 2.8rem; line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.headline-value small { font-size: 1.1rem; color: var(--fg-muted); }
.headline p { margin: 0; color: var(--fg-muted); font-size: .88rem; line-height: 1.4; }
.headline .headline-note { color: var(--fg-faint); font-size: .78rem; }
.tone-badge {
  justify-self: start;
  padding: 3px 9px; border-radius: 999px;
  font-size: .76rem; font-weight: 600;
  border: 1px solid var(--line); color: var(--fg-muted);
}
.tone-badge.is-good { border-color: var(--green-hud); color: var(--green-hud); background: var(--green-tint); }
.tone-badge.is-bad  { border-color: var(--red-soft); color: var(--red-bright); background: var(--red-wash); }
.more-link { margin: 12px 0 0; font-size: .88rem; }
.more-link a { font-weight: 600; }

/* bouton « ? » et bulle d'explication */
.help-btn {
  position: relative;
  display: inline-grid; place-items: center;
  width: 20px; height: 20px; padding: 0;
  vertical-align: middle;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: transparent; color: var(--fg-muted);
  font: 700 .7rem/1 var(--font-mono); letter-spacing: 0;
  cursor: pointer;
  flex: none;
}
.help-btn::after { content: ""; position: absolute; inset: -10px; }  /* cible tactile élargie */
.kpi-label .help-btn, .section-title .help-btn, .hint .help-btn { margin-left: 4px; }
.help-btn:focus-visible { outline: 2px solid var(--fill); outline-offset: 2px; }
@media (hover: hover) { .help-btn:hover { background: var(--fill); color: var(--fill-fg); border-color: var(--fill); } }
.help-pop {
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface-2); color: var(--fg);
  box-shadow: var(--shadow-modal);
  font-size: .94rem; line-height: 1.5;
  text-transform: none; letter-spacing: normal;
}
.help-pop::backdrop { background: var(--backdrop); }
.help-pop h3 { margin: 0 0 10px; font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; }
.help-pop p, .help-pop ul { margin: 0 0 10px; color: var(--fg-muted); }
.help-pop ul { padding-left: 18px; }
.help-pop b { color: var(--fg); }
.help-pop .help-read { padding: 10px 12px; border-radius: var(--r); background: var(--sunken-2); }
.help-pop .btn { margin-top: 4px; }

/* connexion : alternative Google */
.login-alt { display: grid; gap: 12px; margin-top: 18px; }
.login-sep {
  display: flex; align-items: center; gap: 12px; margin: 0;
  color: var(--fg-faint); font-size: .82rem;
}
.login-sep::before, .login-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn-google { display: flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; }
.login-note { margin: 0; text-align: center; }
.login-signup { margin-top: 18px; font-size: .92rem; color: var(--fg-muted); }
.login-signup a { font-weight: 600; color: var(--fg); }

/* inscription : messages sous les champs (hors de la casse des libellés) */
.field-error, .field-hint, .field-optional {
  font-family: var(--font-text); font-weight: 500;
  font-size: .8rem; letter-spacing: normal; text-transform: none;
}
.field-error { display: block; color: var(--red-bright); }
.field-hint { display: block; color: var(--fg-faint); }
.field-optional { color: var(--fg-faint); font-size: .72rem; }
input:disabled { color: var(--fg-muted); background: var(--sunken-2); }

.inline-form { display: inline; }
.actions-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-small { padding: 8px 12px; font-size: .88rem; }
.btn-link { display: inline-block; text-decoration: none; }

/* ─────────────────────────────────────────────────────────────
   Configuration d'une partie
   ───────────────────────────────────────────────────────────── */

.setup-form { display: grid; gap: 16px; }
.slot { display: grid; gap: 6px; align-content: start; }
.slot-guest { display: none; }
.slot.is-guest .slot-guest { display: block; }

/* Choix d'un joueur en tapant son nom (player-picker) */
.slot.has-picker { position: relative; }
.slot.has-picker select { display: none; }
.slot.has-picker .slot-guest { display: block; }
.slot.has-picker:not(.is-guest) .slot-guest { font-weight: 600; border-color: var(--green-hud); }
.picker-list {
  position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; right: 0;
  max-height: 264px; overflow-y: auto;
  margin: 0; padding: 4px; list-style: none;
  background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 28px -8px rgba(21, 18, 13, 0.35);
}
.picker-list li { padding: 9px 10px; border-radius: 7px; cursor: pointer; overflow-wrap: anywhere; }
.picker-list li.is-active { background: var(--hover); }
.picker-list li[aria-selected="true"] { font-weight: 600; color: var(--green-hud); }
.picker-list li[aria-disabled="true"] { color: var(--fg-faint); cursor: default; }
.picker-list li small { font-size: .75rem; }
.picker-list .picker-guest { color: var(--fg-muted); font-style: italic; cursor: default; }
@media (hover: hover) { .picker-list li[data-id]:not([aria-disabled="true"]):hover { background: var(--hover); } }
.players-list { display: grid; gap: 10px; }
.player-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto auto; gap: 8px; align-items: start; }
.player-row:not(:has(.number)) { grid-template-columns: 26px minmax(0, 1fr) auto; }
.player-row .remove-row { margin-top: 3px; }
.player-row .remove-row:disabled { visibility: hidden; }
.player-row .order {
  padding-top: 13px; text-align: center;
  font-family: var(--font-mono); font-weight: 700; color: var(--fg-faint);
}
.player-row .number { width: 84px; }
.check-row { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; cursor: pointer; }
.check-row input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--green-hud); flex: none; }

/* ─────────────────────────────────────────────────────────────
   Écrans de jeu
   ───────────────────────────────────────────────────────────── */

.back-btn { text-decoration: none; }

/* questions après une volée (fléchettes au double, sortie en combien) */
.modal-actions.is-choices .btn.is-default { border-color: var(--fill); }

/* Random checkout : la cible et la série */
.rc-panel { display: grid; gap: 10px; align-content: start; justify-items: center; text-align: center; }
.rc-target { font-family: var(--font-mono); font-weight: 700; font-size: clamp(4rem, 22vw, 7rem); line-height: 1; color: var(--green-hud); }
.rc-meta { font-family: var(--font-mono); font-weight: 600; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-muted); }
.rc-series { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
.rc-dot {
  min-width: 34px; padding: 3px 6px; border-radius: 8px;
  font-family: var(--font-mono); font-weight: 700; font-size: .75rem;
  border: 1px solid var(--line); color: var(--fg-faint);
}
.rc-dot.is-ok   { border-color: var(--green-hud); color: var(--green-hud); background: var(--green-tint); }
.rc-dot.is-ko   { border-color: var(--red-soft); color: var(--red-bright); background: var(--red-wash); }
.rc-dot.is-now  { border-color: var(--fill); color: var(--fg); }

/* à plusieurs : le joueur au tour et le classement */
.rc-head { display: grid; gap: 4px; }
.rc-player { font-weight: 600; font-size: 1.1rem; }
.rc-standings {
  list-style: none; margin: 0; padding: 0;
  width: 100%; max-width: 640px; max-height: 40dvh; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent;
}
.rc-standings li {
  display: grid; grid-template-columns: minmax(5em, 9em) minmax(0, 1fr) auto;
  align-items: center; gap: 10px;
  padding: 5px 4px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
}
.rc-standings li:last-child { border-bottom: 0; }
.rc-standings li.is-now { color: var(--fg); background: var(--green-tint); border-radius: 6px; }
.rc-standings li:not(.is-now) { color: var(--fg-muted); }
.rc-standings li.is-winner .rc-name { color: var(--green-hud); }
.rc-name { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-score { font-family: var(--font-mono); font-weight: 600; font-size: .72rem; color: var(--fg-faint); white-space: nowrap; }
.rc-score b { color: var(--fg); font-size: .95rem; }
.rc-series.is-small { justify-content: flex-start; gap: 3px; }
.rc-series.is-small .rc-dot { min-width: 0; padding: 1px 4px; font-size: .6rem; border-radius: 5px; }

/* Bob's 27 / Killer : pavé de saisie à gros boutons */
.hits-pad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.hits-pad .key { min-height: clamp(64px, 13dvh, 110px); display: grid; gap: 2px; align-content: center; }
.hits-pad .key b { font-size: clamp(1.6rem, 7vw, 2.4rem); }
.hits-pad .key span { font-family: var(--font-text); font-weight: 500; font-size: .72rem; color: var(--fg-muted); }

.players-board { display: grid; gap: 14px; padding: 5px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-content: start; min-height: 0; overflow-y: auto; }
.pcard {
  position: relative;
  display: grid; gap: 2px;
  padding: 10px 12px;
  border-radius: var(--r);
}
.pcard.is-out { opacity: .5; }
.pcard-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard-score { font-family: var(--font-mono); font-weight: 700; font-size: 2.2rem; line-height: 1.05; font-variant-numeric: tabular-nums; }
.pcard-sub { font-family: var(--font-mono); font-weight: 600; font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-faint); }
.pcard.is-active .pcard-score { color: var(--green-hud); }
.pcard-number {
  position: absolute; top: 8px; right: 10px;
  font-family: var(--font-mono); font-weight: 700; font-size: 1.1rem;
  color: var(--fg-muted);
}
.pcard.is-killer .pcard-number { color: var(--red-bright); }
.lives { letter-spacing: .1em; color: var(--red-bright); }
.lives .lost { color: var(--line-strong); }

.bobs-track { display: flex; flex-wrap: wrap; gap: 4px; }
.bobs-track span {
  min-width: 28px; padding: 2px 4px; text-align: center; border-radius: 6px;
  font-family: var(--font-mono); font-weight: 700; font-size: .68rem;
  border: 1px solid var(--line-soft); color: var(--fg-faint);
}
.bobs-track span.h1 { background: var(--green-tint); color: var(--green-hud); border-color: var(--green-tint-2); }
.bobs-track span.h2, .bobs-track span.h3 { background: var(--green-hud); color: var(--hud-fg); border-color: var(--green-hud); }
.bobs-track span.h0 { background: var(--red-wash); color: var(--red-bright); border-color: var(--red-soft); }
.bobs-track span.now { border-color: var(--fill); color: var(--fg); }

.killer-hits {
  display: flex; gap: 6px; justify-content: center; min-height: 34px; flex-wrap: wrap;
  --chip-fs: 1em; --chip-py: 4px; --chip-bw: 1px;
}
.killer-hits .chip {
  padding: var(--chip-py) 10px; border-radius: 999px;
  font-family: var(--font-mono); font-weight: 700; font-size: var(--chip-fs);
  background: var(--chip); border: var(--chip-bw) solid var(--chip-line);
}
/* la hauteur d'une fléchette, même sans fléchette : le bloc ne grandit pas à la première */
.killer-hits::before {
  content: "\200b"; margin-right: -6px;
  padding: var(--chip-py) 0; border: var(--chip-bw) solid transparent;
  font-family: var(--font-mono); font-weight: 700; font-size: var(--chip-fs);
}
.killer-pad { display: grid; gap: 8px; }
.killer-keys { display: grid; gap: 6px; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); }
.killer-track { display: flex; gap: 4px; margin: 2px 0; }
.killer-track span { width: 14px; height: 6px; border-radius: 3px; background: var(--line); }
.killer-track span.on { background: var(--fg-muted); }
.pcard.is-killer .killer-track span.on { background: var(--red-bright); }
.killer-pad .key { min-height: 58px; display: grid; gap: 0; }
.killer-pad .key b { font-size: 1.3rem; }
.killer-pad .key span { font-family: var(--font-text); font-weight: 500; font-size: .7rem; color: var(--fg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* écran de jeu des variantes : panneau joueurs + saisie */
.screen-variant {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: var(--gap);
  height: calc(100dvh - max(var(--gap), env(safe-area-inset-top)) - max(var(--gap), env(safe-area-inset-bottom)));
}
@media (min-width: 900px) {
  .screen-variant {
    grid-template-columns: 1fr minmax(380px, 440px);
    grid-template-rows: auto auto minmax(0, 1fr);
    grid-template-areas: "head head" "main turn" "main pad";
    column-gap: 18px;
  }
  .screen-variant > .game-head { grid-area: head; }
  .screen-variant > .variant-main { grid-area: main; }
  .screen-variant > .turn-area { grid-area: turn; }
  .screen-variant > .keypad { grid-area: pad; align-content: start; }
}
/* écran peu haut : comme le X01, la volée sous le tableau */
@media (min-width: 900px) and (max-height: 760px) {
  .screen-variant {
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas: "head head" "main pad" "turn pad";
  }
}
.variant-main { min-height: 0; overflow-y: auto; display: grid; align-content: start; gap: 10px; }

@media print { .topbar, .nav, .btn { display: none; } }

/* ─────────────────────────────────────────────────────────────
   Groupes
   ───────────────────────────────────────────────────────────── */

.group-pick { margin: 0 0 16px; display: flex; gap: 8px; align-items: end; }
.group-pick label { flex: 1; display: grid; gap: 6px; font-size: .85rem; font-weight: 600; color: var(--fg-muted); }
.group-filter { margin: 0 0 14px; flex-wrap: wrap; }
.choice-list { display: grid; gap: 10px; }
.search-row { display: flex; gap: 8px; align-items: center; margin: 0 0 12px; }
.search-row input { flex: 1; min-width: 0; }
.member-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; }
.member-row small { color: var(--fg-faint); font-weight: 500; }
.member-actions { display: flex; gap: 6px; align-items: center; flex: none; }
.member-actions select { width: auto; padding: 6px 28px 6px 10px; font-size: .85rem; background-position: right 13px center, right 8px center; }
.member-actions .icon-btn { width: 34px; height: 34px; font-size: 1.05rem; }

/* ─────────────────────────────────────────────────────────────
   Page d'accueil publique : la présentation de La Mire.
   Une seule animation : le tableau des scores qui rejoue un leg en neuf
   fléchettes. Le reste est posé, sans effet.
   ───────────────────────────────────────────────────────────── */

.lp-top {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  max-width: 1120px; margin: 0 auto;
}
.lp-top-actions { display: flex; align-items: center; gap: 16px; }
.lp-top-actions > a:not(.btn) { color: var(--fg-muted); font-weight: 600; text-decoration: none; }
.lp-top-actions > a:not(.btn):hover { color: var(--fg); }

.lp { display: grid; gap: clamp(56px, 9vw, 112px); padding: clamp(28px, 6vw, 72px) 0 40px; }
.lp h1, .lp h2, .lp h3 { font-family: var(--font-display); color: var(--fg); margin: 0; word-spacing: .08em; }
.lp h1 {
  font-size: clamp(2.5rem, 6.4vw, 4.6rem); font-weight: 700;
  line-height: .98; letter-spacing: -.025em;
  max-width: 13ch;
  text-wrap: balance;
}
.lp h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 700; line-height: 1.05; letter-spacing: -.015em; text-wrap: balance; }
.lp h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.15; }
.lp p { margin: 0; line-height: 1.55; max-width: 62ch; color: var(--fg-muted); }
.lp-lead { font-size: clamp(1.05rem, 1.6vw, 1.2rem); margin-top: 22px !important; }
.lp-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.lp-cta .btn { text-align: center; }
/* Sous les boutons du héros : le compte ne demande pas de cible équipée. */
.lp .lp-note { margin-top: 18px; padding: 12px 16px; border-left: 3px solid var(--green-hud); border-radius: 0 10px 10px 0; background: var(--surface-2); font-size: .95rem; }
.lp .lp-note b { color: var(--fg); }

/* Héros : le texte à gauche, le tableau des scores à droite (dessous sur téléphone) */
.lp-hero { display: grid; gap: 40px; align-items: center; }
@media (min-width: 860px) {
  .lp-hero { grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr); gap: 56px; }
}

.lp-board {
  margin: 6px;
  padding: 22px 24px 18px;
  border-radius: var(--r);
  display: grid; gap: 6px;
  transform: rotate(-1.2deg);
  max-width: 460px; justify-self: center; width: calc(100% - 12px);
}
.lp-board-head { display: flex; justify-content: space-between; gap: 12px; color: var(--fg-muted); font-size: .95rem; }
.lp-board-head span:first-child { color: var(--fg); font-weight: 600; font-size: 1.1rem; }
.lp-board-score {
  font-family: var(--font-mono); font-weight: 700;
  font-size: clamp(5.5rem, 17vw, 8.5rem); line-height: .95;
  text-align: center; font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  text-shadow: 0 0 1px rgba(243, 238, 223, 0.45), 0 0 18px rgba(243, 238, 223, 0.12);
}
.lp-board-score.is-finish { color: var(--green-hud); }
.lp-board-turns { list-style: none; margin: 8px 0 0; padding: 0; border-top: 1px solid var(--line-soft); }
.lp-board-turns li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 3.2em; gap: 10px; align-items: baseline;
  padding: 7px 2px; border-bottom: 1px solid var(--line-soft);
  font-family: var(--font-mono); font-weight: 600; font-variant-numeric: tabular-nums;
}
.lp-board-turns .lp-darts { color: var(--fg-faint); font-size: .85rem; letter-spacing: .04em; }
.lp-board-turns b { font-size: 1.3rem; color: var(--green-hud); }
.lp-board-turns li > span:last-child { text-align: right; color: var(--fg-faint); }
.lp-board-turns li.is-hidden { visibility: hidden; }
.lp-board-turns li.is-open b, .lp-board-turns li.is-open > span:last-child { visibility: hidden; }
.lp-board-foot { margin-top: 10px; color: var(--fg-muted); font-size: .95rem; text-align: center; transition: opacity .4s; }
.lp-board.is-playing .lp-board-foot { opacity: 0; }
.lp-replay {
  justify-self: center; margin-top: 4px;
  font: inherit; font-size: .88rem; font-weight: 600;
  color: var(--fg-muted); background: none;
  border: 1px dashed var(--line); border-radius: 999px; padding: 5px 14px;
  cursor: pointer;
}
.lp-replay:hover { color: var(--fg); border-color: var(--line-strong); }

/* Sections */
.lp-section { display: grid; gap: 28px; }
.lp-pair { display: grid; gap: 18px; }
@media (min-width: 760px) { .lp-pair { grid-template-columns: 1fr 1fr; } }
.lp-way {
  display: grid; gap: 12px; align-content: start;
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  box-shadow: var(--raise);
}
.lp-way + .lp-way { background: var(--surface-2); }
.lp-way-icon { width: 46px; height: 46px; color: var(--fg); }
.lp-way-note { color: var(--fg) !important; font-weight: 600; }

.lp-groups { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 860px) {
  .lp-groups { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); column-gap: 56px; }
  .lp-groups .lp-aside { grid-column: 2; }
}
.lp-groups > div > p { margin-top: 16px; }
.lp-group-kinds { margin: 0; display: grid; gap: 0; border-top: 2px solid var(--fg); }
.lp-group-kinds > div {
  display: grid; grid-template-columns: 5.5em minmax(0, 1fr); gap: 16px; align-items: baseline;
  padding: 16px 0; border-bottom: 1px solid var(--line);
}
.lp-group-kinds dt { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; color: var(--fg); }
.lp-group-kinds dd { margin: 0; color: var(--fg-muted); line-height: 1.5; }
.lp-aside { font-size: .95rem; }

.lp-games { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
@media (min-width: 760px) { .lp-games { grid-template-columns: 1fr 1fr; } }
.lp-games li {
  display: grid; gap: 4px;
  padding: 18px 20px 18px 22px;
  border-left: 4px solid var(--green);
  background: var(--sunken);
  border-radius: 0 var(--r) var(--r) 0;
}
.lp-games li:nth-child(even) { border-left-color: var(--red); }
.lp-games b { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; }
.lp-games span { color: var(--fg-muted); line-height: 1.45; }
.lp-games .lp-game-where { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--fg); }

.lp-stats { align-items: center; }
@media (min-width: 860px) { .lp-stats { grid-template-columns: minmax(0, 1fr) minmax(300px, .8fr); gap: 56px; } }
.lp-stats > div > p { margin-top: 16px; }
.lp-insight {
  display: grid; gap: 10px;
  padding: 24px;
  border-radius: var(--r);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-top: 4px solid var(--red);
  box-shadow: var(--raise);
}
.lp-insight-kind { color: var(--red-bright); font-weight: 600; font-size: .92rem; }
.lp-insight p { color: var(--fg-muted); }
.lp-insight-exercise {
  justify-self: start; margin-top: 4px;
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-weight: 600; font-size: .92rem;
}

.lp-end { display: grid; justify-items: center; text-align: center; gap: 14px; padding: 8px 0; }
.lp-end p { text-align: center; }
.lp-end .lp-cta { justify-content: center; margin-top: 12px; }

.lp-foot { max-width: 1120px; margin: 0 auto; padding: 22px 0 6px; border-top: 1px solid var(--line); }
.lp-foot p { margin: 0; color: var(--fg-faint); font-size: .88rem; }

body.landing, body.public { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.public-main { padding: clamp(28px, 6vw, 56px) 0 24px; }
.lp-top-actions > a[aria-current]:not(.btn) { color: var(--fg); }
.lp-top .brand { white-space: nowrap; }
.lp-top-actions > a { white-space: nowrap; }
@media (max-width: 520px) {
  .lp-top .brand { font-size: 1.3rem; }
  .landing .lp-top-actions .btn { display: none; }   /* le bouton d'inscription est juste dessous, dans le héros */
  .lp-top-actions > a[aria-current] { display: none; }   /* la page où l'on est déjà : place au lien vers l'autre */
  .lp-cta .btn { flex: 1 1 100%; }
  .lp-board { transform: none; }
}
@media (prefers-reduced-motion: reduce) { .lp-board-foot { transition: none; } }

/* ─────────────────────────────────────────────────────────────
   Jeux de l'Œil : Cricket, Capital
   ───────────────────────────────────────────────────────────── */

.dart-pad { display: grid; gap: 10px; }
/* L'arcade à la main : la cible à toucher (lib/dartboard.js), ou le pavé au choix. */
.board-pad { display: grid; place-items: center; min-height: 0; }
.dartboard { width: min(100%, 34dvh, 440px); aspect-ratio: 1; touch-action: manipulation; cursor: crosshair; user-select: none; -webkit-tap-highlight-color: transparent; }
.dartboard.is-off { opacity: var(--op-off); cursor: not-allowed; }
.dartboard .db-frame { fill: #1D1A16; }
.dartboard .db-s.is-dark { fill: #2A2622; }
.dartboard .db-s.is-light { fill: #EFE3C8; }
.dartboard .db-r.is-red { fill: var(--red); }
.dartboard .db-r.is-green { fill: var(--green); }
.dartboard path, .dartboard circle:not(.db-frame) { stroke: #8C8273; stroke-width: .35; }
.dartboard .db-n { fill: #F4ECDC; font: 700 8px var(--font-mono); text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.dartboard .db-mark { pointer-events: none; }
.dartboard .db-mark circle { fill: #FFD84A; stroke: #1D1A16; stroke-width: 1; }
.dartboard .db-mark text { fill: #1D1A16; font: 800 5px var(--font-mono); text-anchor: middle; dominant-baseline: central; }
.specials.is-board { grid-template-columns: 1fr auto; }

/* Corriger une fléchette (lib/dart_vue.js) : les cases proposées, ou la cible à toucher sur la télécommande. */
.dart-vue { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 12px; background: rgba(20, 16, 10, .72); }
.dv-sheet { width: min(100%, 560px); max-height: 100%; display: grid; gap: 10px; padding: 14px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--raise); }
.dv-title { margin: 0; text-align: center; color: var(--fg-muted); }
.dv-title b { color: var(--fg); }
.dv-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; }
.dv-choice { position: relative; min-height: 72px; padding: 8px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); color: var(--fg); font: 800 1.6rem var(--font-mono); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.dv-choice:active { transform: scale(.97); }
.dv-choice small { position: absolute; top: 5px; right: 8px; font: 600 .7rem var(--font-body); color: var(--fg-muted); text-transform: uppercase; letter-spacing: .04em; }
.dv-choice.is-current { border-color: var(--fg); box-shadow: inset 0 0 0 1px var(--fg); }
.dv-image { width: min(100%, 68dvh); aspect-ratio: 1; justify-self: center; border-radius: 12px; touch-action: none; user-select: none; -webkit-user-select: none; cursor: crosshair; -webkit-tap-highlight-color: transparent; }
.dv-pick { pointer-events: none; }
.dv-pick circle { fill: none; stroke: #4BE08A; stroke-width: 2; }
.dv-pick circle + circle { fill: #4BE08A; }
/* La loupe : au-dessus du doigt, l'endroit visé de près, la croix au centre, la case en dessous. */
.dv-loupe { position: fixed; z-index: 61; width: 150px; height: 150px; transform: translate(-50%, -50%); border-radius: 50%; overflow: hidden; border: 3px solid #FFF8E4; background: #111; box-shadow: 0 .6rem 1.6rem rgba(0, 0, 0, .55); pointer-events: none; }
.dv-loupe svg { display: block; width: 100%; height: 100%; }
.dv-loupe::before, .dv-loupe::after { content: ''; position: absolute; left: 50%; top: 50%; background: #4BE08A; box-shadow: 0 0 0 1px rgba(0, 0, 0, .5); }
.dv-loupe::before { width: 26px; height: 2px; margin: -1px 0 0 -13px; }
.dv-loupe::after { width: 2px; height: 26px; margin: -13px 0 0 -1px; }
.dv-loupe-code { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); padding: 1px 8px; border-radius: 999px; background: rgba(0, 0, 0, .7); color: #FFF8E4; font: 800 13px var(--font-mono); }
.dv-actions { display: grid; grid-template-columns: auto 1fr; gap: 10px; }
.dart-vue .dv-image.dartboard { width: min(100%, 68dvh); }
.dv-note { margin: 0; text-align: center; color: var(--fg-muted); font-size: .92rem; }
/* La cible aux vraies dimensions (repère en mm, deux fois celui de la schématique) : traits et numéros à l'échelle. */
.dartboard.is-real path, .dartboard.is-real circle:not(.db-frame) { stroke-width: .6; }
.dartboard.is-real .db-n { font-size: 17px; }
@media (min-width: 900px) { .dartboard { width: min(100%, 44dvh, 440px); } }
.pad-switch {
  justify-self: end; align-self: center;
  padding: 8px 12px; border-radius: 10px;
  font: inherit; font-size: .85rem; font-weight: 700; color: var(--fg-muted);
  background: transparent; border: 1px solid var(--line); cursor: pointer;
}
.killer-hits .empty { font-size: .8rem; color: var(--fg-faint); align-self: center; }

.cricket-board { width: 100%; border-collapse: separate; border-spacing: 4px; table-layout: fixed; }
.cricket-board thead th { font-weight: 600; font-size: .85rem; padding: 6px 4px; border-radius: 10px; vertical-align: top; }
.cricket-board thead th:first-child { width: 64px; }
.cricket-board thead th span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cricket-board thead th b { display: block; font-family: var(--font-mono); font-size: 1.7rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cricket-board thead th small { display: block; font-family: var(--font-mono); font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-faint); }
.cricket-board thead th.is-active b { color: var(--green-hud); }
.cricket-board tbody th { font-family: var(--font-mono); font-weight: 700; font-size: 1.15rem; text-align: center; color: var(--fg); }
.cricket-board td {
  height: clamp(26px, 4.2dvh, 46px); text-align: center;
  font-family: var(--font-mono); font-weight: 700; font-size: 1.3rem;
  background: var(--sunken-2); border: 1px solid var(--line-soft); border-radius: 8px;
  color: var(--fg-muted);
}
.cricket-board td.is-active { border-color: var(--line-strong); }
.cricket-board td.m1, .cricket-board td.m2 { color: var(--fg); }
.cricket-board td.m3 { color: var(--green-hud); background: var(--green-tint); border-color: var(--green-tint-2); }
.cricket-mark { display: block; width: 1.3em; height: 1.3em; margin: auto; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.cricket-board tr.is-dead th, .cricket-board tr.is-dead td { opacity: .35; }

.capital-track { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 5px; }
.capital-track span {
  padding: 3px 8px; border-radius: 999px;
  font-size: .72rem; font-weight: 600;
  border: 1px solid var(--line-soft); color: var(--fg-faint);
}
.capital-track span.done { color: var(--fg-muted); background: var(--chip); }
.capital-track span.now { border-color: var(--fill); color: var(--fg); }
.capital-turn { align-self: center; font-family: var(--font-mono); font-weight: 600; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-faint); }
.capital-turn.is-ok { color: var(--green-hud); }

/* ─────────────────────────────────────────────────────────────
   Jeux d'arcade de l'Œil (Siège, Ballons, Invasion, Zombies)
   Repris de la borne ; les scènes sont sombres, les plaques aussi.
   ───────────────────────────────────────────────────────────── */

:root { --brass: #d6b15a; --la-red-bright: #d8322f; --la-green-bright: #239a56; --font-body: var(--font-text); }
.arcade .variant-main { gap: 10px; }
.arcade .arcade-head:has(.siege-team) { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Couleur d'équipe pour du texte : les teintes « bright », lisibles sur le sombre. */
.siege-team-0 { --team: var(--la-red-bright); --team-glow: rgba(216, 50, 47, .3); }
.siege-team-1 { --team: var(--la-green-bright); --team-glow: rgba(35, 154, 86, .3); }
span.siege-team-0, span.siege-team-1 { color: var(--team); font-weight: 700; }
.siege-team span.siege-team-0, .siege-team span.siege-team-1, .siege-stage span.siege-team-0, .siege-stage span.siege-team-1 { color: color-mix(in srgb, var(--team) 75%, #fff); }

.siege-players .player-row { position: relative; padding-left: .9rem; }
.siege-players .player-row::before {
    content: ""; position: absolute; left: 0; top: 15%; bottom: 15%; width: 5px; border-radius: 3px;
    background: var(--la-red-bright);
}
.siege-players .player-row:nth-child(even)::before { background: var(--la-green-bright); }

/* En-tête de partie : deux plaques d'équipe, la manche au milieu. */
.siege-team {
    position: relative; overflow: hidden; border-radius: 18px; padding: .9rem 1.1rem;
    background: linear-gradient(180deg, #282117, #1a150e); border: 1px solid var(--line-soft);
    box-shadow: inset 0 1px 0 rgba(255, 244, 214, .06), 0 10px 26px rgba(0, 0, 0, .35);
    transition: border-color .2s ease, box-shadow .2s ease, opacity .2s ease;
}
.siege-team::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: var(--team); opacity: .5; }
.arcade-head:has(.siege-team.current) .siege-team:not(.current) { opacity: .75; }
.siege-team.current { border-color: var(--team); box-shadow: 0 0 0 1px var(--team-glow), 0 14px 38px var(--team-glow); }
.siege-team.current::before { opacity: 1; }
.siege-team-name {
    font-family: var(--font-display); font-weight: 800; font-size: 1.9rem; line-height: 1; color: #fff8e4;
    display: flex; justify-content: space-between; align-items: center; gap: .5rem;
}
.siege-team .badge {
    font-family: var(--font-body); font-size: .8rem; font-weight: 700; color: #fff;
    background: var(--team); padding: .2rem .65rem; border-radius: 999px;
}
.siege-team-players { color: #c9bfa4; margin: .3rem 0 .55rem; font-size: .98rem; }
.siege-team-players .is-current { color: #fff8e4; font-weight: 700; text-decoration: underline; text-decoration-color: var(--team); text-underline-offset: .2em; }
.siege-bar { height: 14px; border-radius: 999px; background: var(--well); box-shadow: inset 0 2px 5px rgba(0, 0, 0, .6); overflow: hidden; }
.siege-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--team), color-mix(in srgb, var(--team) 60%, #fff)); transition: width .6s ease; }
.siege-team-hp { margin-top: .4rem; font-size: .92rem; color: #c9bfa4; font-variant-numeric: tabular-nums; }
.siege-team-hp b { font-family: var(--font-display); font-size: 1.35rem; color: #fff8e4; }
@media (max-width: 640px) {
    .siege-team { padding: .6rem .8rem; }
    .siege-team-name { font-size: 1.3rem; }
    .siege-team-players { display: none; }
}

/* La scène : le château attaqué, en grand — c'est elle qu'on regarde de loin. */
.siege-call {
    font-family: var(--font-display); font-weight: 800; font-size: clamp(1.05rem, 2.2vw, 1.5rem);
    line-height: 1.1; color: var(--fg); text-align: center; margin: .1rem 0 0; min-height: 1.1em;
}
.siege-call-darts { color: var(--fg-muted); font-weight: 600; font-size: .7em; }
.siege-stage {
    position: relative; overflow: hidden; border-radius: 14px; aspect-ratio: 1000 / 600;
    width: 100%; margin: 0 auto;
    box-shadow: inset 0 0 0 1px var(--line), 0 12px 30px rgba(0, 0, 0, .45);
}
.siege-svg { display: block; width: 100%; height: 100%; }
.siege-svg text { font-family: var(--font-display); font-weight: 800; }
.sg-hud-titre { font-size: 17px; fill: #c9bfa4; letter-spacing: .08em; text-transform: uppercase; }
.sg-plaque text { font-size: 21px; fill: #e8d9ae; }
.sg-plaque.is-breche text { fill: #ff6a5f; letter-spacing: .12em; }
.sg-tissu { transform-box: fill-box; transform-origin: left center; animation: sg-flotte 2.4s ease-in-out infinite; }
@keyframes sg-flotte { 0%, 100% { transform: skewY(0deg) scaleX(1); } 50% { transform: skewY(-6deg) scaleX(.9); } }
.sg-vaguelette { animation: sg-vague 6s linear infinite; }
@keyframes sg-vague { from { transform: translateX(0); } to { transform: translateX(-50px); } }

/* Annonces de tir : en gros, au-dessus du château, puis elles s'envolent. */
.siege-toasts {
    position: absolute; inset: 14% 0 auto; display: grid; justify-items: center; gap: .3rem;
    pointer-events: none;
}
.siege-toast {
    font-family: var(--font-display); font-weight: 800; font-size: clamp(1.6rem, 4.6vw, 3.4rem); line-height: 1;
    color: #fff8e4; text-shadow: 0 3px 0 rgba(0, 0, 0, .55), 0 0 30px rgba(0, 0, 0, .6);
    animation: sg-toast 1.9s ease-out forwards;
}
.siege-toast-feu { color: #ffc35a; text-shadow: 0 3px 0 rgba(0, 0, 0, .55), 0 0 26px rgba(255, 140, 40, .7); }
.siege-toast-fort { color: #ffe08a; font-size: clamp(2rem, 6vw, 4.4rem); }
.siege-toast-repare { color: #9fe0b8; }
.siege-toast-rate { color: #9cc7cf; font-size: clamp(1.3rem, 3.4vw, 2.4rem); }
.siege-toast-fin { color: #ff6a5f; font-size: clamp(2.6rem, 8vw, 6rem); animation-duration: 4s; }
@keyframes sg-toast {
    0% { transform: scale(.4); opacity: 0; }
    12% { transform: scale(1.12); opacity: 1; }
    22% { transform: scale(1); }
    75% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(-40px); opacity: 0; }
}

/* Changement de camp : un bandeau traverse la scène. */
.siege-annonce {
    position: absolute; inset: 38% 0 auto; padding: .9rem 1rem; text-align: center;
    background: linear-gradient(90deg, transparent, rgba(17, 14, 9, .88) 15%, rgba(17, 14, 9, .88) 85%, transparent);
    display: grid; gap: .2rem; pointer-events: none;
}
.siege-annonce[hidden] { display: none; }
.siege-annonce.is-on { animation: sg-annonce 1.8s ease-in-out forwards; }
.siege-annonce-equipe { font-family: var(--font-display); font-weight: 800; font-size: clamp(2rem, 6vw, 4rem); line-height: 1; }
.siege-annonce-joueur { color: #e8d9ae; font-size: clamp(1rem, 2.4vw, 1.5rem); font-weight: 600; }
@keyframes sg-annonce {
    0% { transform: translateX(-100%); opacity: 0; }
    18%, 80% { transform: translateX(0); opacity: 1; }
    100% { transform: translateX(100%); opacity: 0; }
}

/* Bilan par joueur, à côté des boutons. */
.siege-roster-wrap { margin-top: 1rem; border-top: 1px solid var(--line-soft); padding-top: .8rem; }
.siege-roster { display: grid; gap: .8rem; }
.siege-roster { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.siege-roster h3 { margin: 0 0 .3rem; font-family: var(--font-display); font-size: 1.2rem; color: var(--team); }
.siege-roster ul { list-style: none; margin: 0; padding: 0; }
.siege-roster li { display: flex; align-items: baseline; gap: .5rem; padding: .2rem 0; }
.siege-roster li span { flex: 1; }
.siege-roster li b { font-family: var(--font-display); font-size: 1.3rem; color: var(--fg); font-variant-numeric: tabular-nums; }
.siege-roster li em { font-style: normal; color: var(--green-hud); font-size: .9rem; }

/* Moins d'animation si on le demande ; pas sur le grand écran (cf. ArcadeScene.calme). */
@media (prefers-reduced-motion: reduce) {
    body:not(.is-spectator) :is(.sg-tissu, .sg-vaguelette, .siege-annonce.is-on) { animation: none; }
    body:not(.is-spectator) .siege-toast { animation-duration: .01s; animation-delay: 1.6s; }
}

/* ====================== Territoires ====================== */
/* Une couleur par joueur, dans l'ordre des sièges (cf. COULEURS dans territoires_scene.js). */
:root { --tr-0: var(--la-red-bright); --tr-1: var(--la-green-bright); --tr-2: #2f6fd8; --tr-3: #d6a21e; }
.tr-c0 { --team: var(--tr-0); --team-glow: rgba(216, 50, 47, .3); }
.tr-c1 { --team: var(--tr-1); --team-glow: rgba(35, 154, 86, .3); }
.tr-c2 { --team: var(--tr-2); --team-glow: rgba(47, 111, 216, .3); }
.tr-c3 { --team: var(--tr-3); --team-glow: rgba(214, 162, 30, .3); }
span:is(.tr-c0, .tr-c1, .tr-c2, .tr-c3) { color: var(--team); font-weight: 700; }
.siege-stage span:is(.tr-c0, .tr-c1, .tr-c2, .tr-c3), .siege-call span:is(.tr-c0, .tr-c1, .tr-c2, .tr-c3) { color: color-mix(in srgb, var(--team) 75%, #fff); }

.territoires-players .player-row { position: relative; padding-left: .9rem; }
.territoires-players .player-row::before {
    content: ""; position: absolute; left: 0; top: 15%; bottom: 15%; width: 5px; border-radius: 3px; background: var(--tr-0);
}
.territoires-players .player-row:nth-child(2)::before { background: var(--tr-1); }
.territoires-players .player-row:nth-child(3)::before { background: var(--tr-2); }
.territoires-players .player-row:nth-child(4)::before { background: var(--tr-3); }

/* Les plaques des joueurs : la chaîne la plus longue, en gros. */
.arcade-territoires .arcade-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.tr-plate .siege-team-name { font-size: 1.4rem; }
.tr-plate.is-out { opacity: .45; }
.tr-plate.is-out .siege-team-name { text-decoration: line-through; text-decoration-color: var(--team); }
.tr-chain { margin-top: .35rem; color: #c9bfa4; font-size: .92rem; }
.tr-chain b { font-family: var(--font-display); font-size: 2rem; line-height: 1; color: var(--team); }

/* La carte. */
.tr-numero { font-size: 26px; fill: #2b1d0e; }
.tr-garnison { font-size: 25px; fill: #fff8e4; paint-order: stroke; stroke: rgba(0, 0, 0, .3); stroke-width: 3px; }
.tr-nord { font-size: 20px; fill: #4a3520; }
.tr-cercle { stroke: #a3241c; stroke-width: 4; stroke-dasharray: 10 7; stroke-linejoin: round; animation: tr-cible 1.2s ease-in-out infinite; }
.tr-epees { animation: tr-cible 1.2s ease-in-out infinite; }
@keyframes tr-cible { 0%, 100% { stroke-opacity: .95; } 50% { stroke-opacity: .3; } }

/* Le bull : le renfort se place à l'écran, avant que le temps ne s'écoule. */
.tr-bull {
    font-family: var(--font-body); font-weight: 600; font-size: 1rem; display: grid; gap: .5rem; padding: .6rem .8rem; border-radius: 14px; text-align: left;
    background: var(--surface); border: 2px solid var(--team); box-shadow: 0 0 0 1px var(--team-glow), 0 10px 26px var(--team-glow);
}
.tr-bull-title { display: flex; justify-content: space-between; gap: .5rem; font-size: 1.05rem; }
.tr-bull-left { font-variant-numeric: tabular-nums; color: var(--fg-muted); }
.tr-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.tr-pick {
    display: grid; justify-items: center; min-width: 58px; padding: .35rem .6rem; border-radius: 10px; cursor: pointer;
    background: color-mix(in srgb, var(--team) 22%, transparent); border: 1px solid var(--team); color: var(--fg); font: inherit;
}
.tr-pick b { font-family: var(--font-display); font-size: 1.5rem; line-height: 1; }
.tr-pick span { font-size: .78rem; color: var(--fg-muted); }
.tr-pick.is-default { outline: 2px dashed var(--team); outline-offset: 2px; }
.tr-bull-bar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.tr-bull-bar span { display: block; height: 100%; background: var(--team); transition: width .2s linear; }

/* Le journal du tour. */
.tr-journal h3 { margin: 0 0 .3rem; font-family: var(--font-display); font-size: 1.1rem; color: var(--fg); }
.tr-journal ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .2rem; }
.tr-journal li { display: flex; gap: .6rem; align-items: baseline; font-size: .95rem; color: var(--fg-muted); }
.tr-journal li > b { min-width: 2.6rem; font-family: var(--font-display); color: var(--fg); }

.is-spectator .arcade-territoires .arcade-head { grid-template-columns: 1fr; }
.is-spectator .arcade-territoires .tr-chain { color: var(--tv-muted); }
.is-spectator .arcade .tr-journal li { font-size: 1.1rem; color: var(--tv-muted); }
.is-spectator .arcade .tr-journal h3 { color: var(--tv-fg); }

@media (prefers-reduced-motion: reduce) {
    body:not(.is-spectator) :is(.tr-cercle, .tr-epees, .cf-cran-halo) { animation: none; }
}

/* ====================== Le Coffre ====================== */
.arcade-coffre .arcade-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.cf-plate { --team: var(--brass); --team-glow: rgba(214, 177, 90, .3); }
.cf-plate .siege-team-name { font-size: 1.4rem; }
.cf-lights { display: flex; gap: 6px; margin: .45rem 0 .1rem; }
.cf-light {
    display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
    background: #0f1115; border: 2px solid #5b616b; font-family: var(--font-display); font-weight: 800; color: #fff8e4;
}
.cf-light.is-open { background: var(--la-green-bright); border-color: #9fe0b8; }
.cf-light.is-revealed { color: #ff9a8f; }

/* La scène : la porte, le cadran, le thermomètre ou la cible du mode assisté. */
.cf-plaque { font-size: 28px; fill: #2b1d0e; }
.cf-num { font-size: 16px; fill: #1f2328; }
.cf-cran-num { font-size: 24px; }
.cf-cran-halo { animation: tr-cible 1.4s ease-in-out infinite; }
.cf-porte.is-open { transform: scaleX(.14); }
.cf-jauge-label { font-size: 19px; fill: #3b2a12; opacity: .55; }
.cf-jauge-label.is-on { opacity: 1; font-size: 23px; }
.cf-jauge-titre { font-size: 20px; fill: #6b5530; }
.cf-indice { font-size: 26px; fill: #f3e6c4; }
.cf-cible-num { font-size: 19px; fill: #7d6f55; }
.cf-cible-num.is-possible { fill: #fff8e4; }
.siege-toast-cf-brulant { color: #ff6a4d; font-size: clamp(2rem, 6vw, 4.4rem); }
.siege-toast-cf-chaud { color: #ffae5c; }
.siege-toast-cf-tiede { color: #f0d36a; }
.siege-toast-cf-froid { color: #8fd0ec; }

/* Les indices du cran cherché, joueur par joueur. */
.cf-hints h3 { margin: 0 0 .3rem; font-family: var(--font-display); font-size: 1.05rem; color: var(--fg-muted); }
.cf-hints.is-current h3 { color: var(--fg); }
.cf-hints ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.cf-hint { padding: .15rem .55rem; border-radius: 999px; font-size: .88rem; background: var(--surface-3); color: var(--fg-muted); border-left: 4px solid transparent; }
.cf-hint b { color: var(--fg); margin-right: .2rem; }
.cf-hint.cf-brulant { border-left-color: #e0391c; }
.cf-hint.cf-chaud { border-left-color: #f08a22; }
.cf-hint.cf-tiede { border-left-color: #cfa92c; }
.cf-hint.cf-froid { border-left-color: #3d97c2; }
.cf-hint.cf-bull { border-left-color: var(--la-green-bright); }
.cf-hint.is-empty { font-style: italic; }

.is-spectator .arcade-coffre .arcade-head { grid-template-columns: 1fr; }
.is-spectator .arcade .cf-hints h3 { color: var(--tv-muted); }
.is-spectator .arcade .cf-hints.is-current h3 { color: var(--tv-fg); }
.is-spectator .arcade .cf-hint { background: rgba(255, 255, 255, .08); color: var(--tv-muted); font-size: 1rem; }
.is-spectator .arcade .cf-hint b { color: var(--tv-fg); }

/* ====================== Arcade : commun aux scènes ====================== */
/* Les entités qui bougent (envahisseurs, zombies, ballons) glissent d'une
   place à l'autre : cf. ArcadeScene.synchroniser. */
.sg-entite { transition: transform .75s cubic-bezier(.3,.7,.3,1); }
.sg-flottant { font-family: var(--font-display); font-weight: 800; paint-order: stroke; stroke: rgba(0, 0, 0, .55); stroke-width: 5px; }
.siege-roster li.is-current span { color: var(--fg); font-weight: 700; }

/* En-tête chiffré (Invasion, Zombies) et numéro de manche (Ballons). */
.arcade-stats { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.arcade-stat {
    border-radius: 16px; padding: .7rem 1rem; text-align: center;
    background: linear-gradient(180deg, #282117, #1a150e); border: 1px solid var(--line-soft);
}
.arcade-stat span { display: block; font-size: .9rem; color: #c9bfa4; }
.arcade-stat b { font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.5rem); line-height: 1.05; color: #fff8e4; }

/* Ballons */
.bl-cheville { font-size: 19px; fill: #d6b15a; opacity: .8; }
.bl-cible-txt { font-size: 18px; fill: #e8d9ae; opacity: .8; }
.bl-num { font-size: 30px; fill: #fff; paint-order: stroke; stroke: rgba(0, 0, 0, .45); stroke-width: 4px; }
.bl-num.is-or { fill: #3a2a08; stroke: rgba(255, 240, 190, .5); }
.bl-tete { font-size: 26px; fill: #e8e8e8; }
.bl-etoile { font-size: 20px; fill: #fff6c8; }
.bl-ampoule { animation: bl-clignote 1s steps(2) infinite; }
@keyframes bl-clignote { 50% { opacity: .35; } }

/* Invasion */
.inv-num { font-size: 22px; fill: #fff8e4; }
.inv-label { font-size: 16px; fill: #d9d4ec; letter-spacing: .08em; }
.inv-hud { fill: #7cc7ff; }
.inv-corps { animation: inv-pas 1.2s steps(2) infinite; }
@keyframes inv-pas { 50% { transform: translateY(3px); } }
.inv-feu { animation: bl-clignote .8s steps(2) infinite; }

/* Zombies */
.zb-num { font-size: 24px; fill: #2a1d1d; }
.zb-couloir { font-size: 22px; fill: #d6b15a; }
.zb-hud { fill: #c8e09a; }
.zb-corps { animation: zb-titube 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes zb-titube { 50% { transform: rotate(3deg); } }

@media (prefers-reduced-motion: reduce) {
    body:not(.is-spectator) .sg-entite { transition: none; }
    body:not(.is-spectator) :is(.bl-ampoule, .inv-corps, .inv-feu, .zb-corps) { animation: none; }
}


/* ── Œil de La Mire ─────────────────────────────────────────────
   Partie sur une borne : les fléchettes vues par la caméra, celles
   qu'on a corrigées, et le kiosque de la tablette (QR code du salon). */
.eye-badge {
  display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px;
  font-family: var(--font-mono); font-size: .8rem; font-weight: 600; letter-spacing: .04em;
  border: 1px solid var(--green-hud); color: var(--green-hud); background: var(--green-tint);
  vertical-align: middle;
}
.eye-badge.is-off { border-color: var(--red-soft); color: var(--red-bright); background: var(--red-wash); }

/* fléchette vue par la caméra : un liseré vert ; corrigée à la main : en pointillé rouge */
.dart-slot.is-cv:not(.is-editing) { border-color: var(--green-hud); }
.dart-slot.is-corrected:not(.is-editing) { border-color: var(--red-bright); border-style: dashed; }
.chip.is-pickable { cursor: pointer; font: inherit; font-family: var(--font-mono); font-weight: 700;
  padding: 4px 10px; border-radius: 999px; background: var(--chip); border: 1px solid var(--chip-line); color: var(--fg); }
.chip.is-cv { border-color: var(--green-hud); }
.chip.is-corrected { border-color: var(--red-bright); border-style: dashed; }
.chip.is-editing { background: var(--fill); color: var(--fill-fg); border-color: var(--fill); }

.eye-pick { display: grid; gap: 4px; margin: 0 0 16px; font-weight: 600; }

.kiosk-lobby { text-align: center; }
.kiosk-lobby .list { text-align: left; }
.kiosk-qr { display: inline-block; padding: 10px; background: #fff; border-radius: 12px; box-shadow: var(--raise-sm); line-height: 0; }
.kiosk-qr svg { width: 200px; height: 200px; }
.kiosk-lobby-inline { display: flex; gap: 16px; align-items: center; text-align: left; margin: 0 0 16px; }
.kiosk-lobby-inline .kiosk-qr svg { width: 120px; height: 120px; }
@media (max-width: 520px) { .kiosk-lobby-inline { flex-direction: column; text-align: center; } }
.kiosk-lobby-title { margin: 14px 0 4px; font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--fg-muted); text-align: left; }

/* Page du QR code, sur le téléphone */
.join-page { max-width: 520px; margin: 0 auto; }
.join-page .card { margin-bottom: 14px; }
.join-main { margin-bottom: 14px; text-align: center; }
.join-choices { display: grid; gap: 8px; }
.join-choices .btn-link, .join-main { text-align: center; }
.join-guest { display: flex; gap: 8px; margin-top: 10px; }
.join-guest input { flex: 1; min-width: 0; }
.join-done p { margin: 0 0 12px; }
.join-page .game-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.join-page .game-tile { min-height: 0; padding: 14px 16px; }

/* Tes cibles (accueil) */
.eye-cards { margin-bottom: 18px; }
.eye-cards-list { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.eye-card { display: grid; gap: 6px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); box-shadow: var(--raise-sm); color: var(--fg); text-decoration: none; }
.eye-card:hover { border-color: var(--line-strong); }
.eye-card-name { font-family: var(--font-display, inherit); font-weight: 800; font-size: 1.15rem; }
.eye-card-sub { color: var(--fg-muted); font-size: .9rem; }
.eye-card-go { justify-self: start; margin-top: 4px; }
.lp-steps { display: grid; gap: 12px; padding-left: 1.4em; margin: 0; font-size: 1.05rem; }
.eye-target { margin: 0 0 16px; padding: 10px 14px; border-radius: 12px; background: var(--green-tint); border: 1px solid var(--green-hud); text-align: center; }

/* Mon profil */
.profile-card { max-width: 760px; }

.slot-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.slot-bar .slot-guest { display: block; }
@media (max-width: 560px) { .slot-bar { grid-template-columns: 1fr; } }
.game-tiles-compact { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.game-tiles-compact .game-tile { min-height: 0; padding: 12px 14px; }
.eye-target.is-manual { background: var(--sunken); border-color: var(--line); }
.recap-game { margin-bottom: 14px; }
.recap-winner { font-weight: 800; font-size: 1.1rem; margin: 0 0 8px; }
.recap-photo { margin: 0 0 16px; padding: 0; overflow: hidden; }
.recap-photo img { display: block; width: 100%; height: auto; }
.recap-photo figcaption { padding: 8px 14px; }
.recap-clip { display: block; width: 100%; max-height: 60vh; margin: 0 0 10px; border-radius: 12px; background: #000; }
/* La télé fête les moments forts : 180, Big Fish, grosse sortie, trois bulls (cf. fx.js). */
.fx-burst { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; background: rgba(21, 18, 13, .55); animation: fx-fade 3.2s ease forwards; }
.fx-burst b { font-family: var(--font-display); font-size: 9rem; line-height: 1; color: #FFF8E4; text-shadow: 0 .4rem 0 var(--red), 0 1rem 2.5rem rgba(0, 0, 0, .5); animation: fx-pop 3.2s cubic-bezier(.2, 1.4, .4, 1) forwards; }
.fx-burst span { margin-top: 1.2rem; font-size: 2.6rem; font-weight: 800; color: #FFF8E4; }
.fx-bigfish b { text-shadow: 0 .4rem 0 #1C7A47, 0 1rem 2.5rem rgba(0, 0, 0, .5); }
/* Le bust, dès la fléchette : aussi sur la tablette et le téléphone, d'où la taille bornée. */
.fx-bust b { font-size: min(9rem, 30vw); letter-spacing: .04em; }
.fx-bust span { font-size: min(2.6rem, 7vw); }
/* Le leg (ou le set) gagné : qui l'a gagné, bien lisible. */
.fx-leg b { font-size: min(9rem, 30vw); letter-spacing: .04em; text-shadow: 0 .4rem 0 #1C7A47, 0 1rem 2.5rem rgba(0, 0, 0, .5); }
.fx-leg span { max-width: 92vw; font-size: min(3.4rem, 8vw); text-align: center; }
.fx-unlock { position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 70; padding: .8rem 1.4rem; border: 0; border-radius: 999px; background: var(--red); color: var(--on-accent); font-size: 1.3rem; font-weight: 800; box-shadow: 0 .6rem 1.4rem rgba(0, 0, 0, .3); cursor: pointer; }
.fx-unlock:focus { outline: .25rem solid #FFD27A; outline-offset: .2rem; }
@keyframes fx-fade { 0% { opacity: 0; } 8%, 80% { opacity: 1; } 100% { opacity: 0; } }
@keyframes fx-pop { 0% { opacity: 1; transform: scale(.2) rotate(-8deg); } 14% { opacity: 1; transform: scale(1.15) rotate(2deg); } 22%, 80% { opacity: 1; transform: scale(1) rotate(0); } 100% { opacity: 0; transform: scale(1.4); } }

/* Le replay du finish (caméra joueur de la borne) : la vidéo en grand, par-dessus tout.
   Pas d'inset ni d'aspect-ratio : les navigateurs des télés sont anciens. Pas
   d'animation d'apparition : arrêtée à mi-course (« réduire les animations »),
   elle laisserait la vidéo translucide. */
.replay { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 80; display: flex; align-items: center; justify-content: center; background: #000; opacity: 1; transition: opacity .5s ease; }
.replay.is-out { opacity: 0; }
.replay video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.replay-badge { position: absolute; top: 1.2rem; left: 1.2rem; z-index: 1; padding: .45rem 1rem; border-radius: 999px; background: var(--red); color: var(--on-accent); font-weight: 800; font-size: 1rem; letter-spacing: .02em; }
.is-spectator .replay-badge { top: 2rem; left: 2rem; font-size: 1.8rem; padding: .6rem 1.4rem; }
/* La photo d'équipe sur la télé : le décompte en grand, le flash du clic, puis la photo. */
.team-shot { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 85; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(21, 18, 13, .92); color: #FFF8E4; text-align: center; opacity: 1; transition: opacity .5s ease, background-color .3s ease; }
.team-shot.is-out { opacity: 0; }
.team-shot.is-flash { background: #FFFFFF; transition: none; }
.team-shot.is-photo { background: #000; }
.team-shot-badge { position: absolute; top: 2rem; left: 2rem; padding: .6rem 1.4rem; border-radius: 999px; background: var(--red); color: var(--on-accent); font-weight: 800; font-size: 1.8rem; }
.team-shot-big { font-family: var(--font-display); font-size: 16rem; line-height: 1; text-shadow: 0 .4rem 0 var(--red), 0 1rem 2.5rem rgba(0, 0, 0, .5); }
.team-shot-note { margin-top: 2rem; font-size: 2.4rem; font-weight: 800; }
.team-shot img { width: 100%; height: 100%; object-fit: contain; }
.replay-close { position: absolute; right: 1rem; bottom: 1rem; z-index: 1; padding: .7rem 1.2rem; border: 0; border-radius: 999px; background: rgba(255, 248, 228, .92); color: #15120D; font-weight: 800; font-size: 1rem; cursor: pointer; }

/* Le son des télés, sur la page de l'établissement. */
.sound-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.sound-form input[type="range"] { flex: 1 1 200px; accent-color: var(--red); }
.sound-form output { min-width: 4.5em; font-weight: 700; }

/* Tableau de bord du gérant : chiffres clés, histogrammes d'une seule série (le vert de La Mire). */
.head-links { display: flex; flex-wrap: wrap; gap: 8px; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 18px; }
.stat-tile { display: grid; gap: 2px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); box-shadow: var(--raise-sm); }
.stat-tile b { font-family: var(--font-display); font-size: 1.7rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-tile span { color: var(--fg-muted); font-size: .85rem; }
.hist { display: flex; align-items: stretch; gap: 2px; height: 180px; padding-top: 8px; }
.hist-col { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; outline: none; }
.hist-track { flex: 1; display: flex; align-items: flex-end; border-bottom: 1px solid var(--line); }
.hist-bar { width: 100%; max-width: 28px; margin: 0 auto; background: var(--green); border-radius: 4px 4px 0 0; min-height: 0; }
.hist-bar.is-zero { height: 0 !important; }
.hist-label { height: 1.4em; margin-top: 4px; font-size: .72rem; color: var(--fg-muted); text-align: center; white-space: nowrap; overflow: visible; }
.hist-col:hover .hist-bar, .hist-col:focus .hist-bar { background: var(--green-hud); }
.hist-col:hover::after, .hist-col:focus::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% - 4px); left: 50%; transform: translateX(-50%); z-index: 5;
  padding: 6px 10px; border-radius: 8px; background: var(--ink); color: var(--cream-fg); font-size: .8rem; font-weight: 600; white-space: nowrap; pointer-events: none;
}
.hist-col:first-child:hover::after, .hist-col:first-child:focus::after { left: 0; transform: none; }
.hist-col:last-child:hover::after, .hist-col:last-child:focus::after { left: auto; right: 0; transform: none; }
.chart-table summary { cursor: pointer; color: var(--fg-muted); font-weight: 600; }
.chart-table[open] summary { margin-bottom: 10px; }
.rank-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rank-bars li { display: grid; grid-template-columns: minmax(90px, 9em) 1fr auto; gap: 10px; align-items: center; }
.rank-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-track { height: 10px; }
.rank-bar { display: block; height: 100%; background: var(--green); border-radius: 0 4px 4px 0; }
.rank-bars b { font-variant-numeric: tabular-nums; min-width: 2ch; text-align: right; }

/* La tablette d'une cible, en attente d'association : le code, en grand. */
.tablet-code { margin: 10px 0 18px; font-family: var(--font-mono); font-weight: 600; font-size: clamp(3rem, 14vw, 5.5rem); letter-spacing: .12em; line-height: 1; }
.tablet-code span { margin-left: .35em; }
.tablet-hint { margin: 14px auto 0; max-width: 32em; font-size: 1.1rem; }

/* Les cibles d'un établissement, sur sa page (le gérant) : chacune mène à la sienne (tablette, télé). */
.venue-eyes { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.venue-eyes li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 14px; border-radius: 12px; background: var(--green-tint); border: 1px solid var(--green-hud); }
.venue-eye-name { font-weight: 700; font-size: 1.05rem; color: var(--fg); text-decoration: none; }

/* Les alertes caméras d'une cible, en détail (le gérant : page de l'établissement, comptoir). */
.eye-camera-alerts { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; flex: 1 1 100%; }
.eye-camera-alerts > li { display: block; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); font-size: .95rem; }
.eye-camera-alerts > li.is-erreur { border-color: var(--red-bright); color: var(--red-bright); font-weight: 700; }
.eye-camera-alerts > li.is-attention { border-color: #FFD27A; }
.eye-camera-alerts > li.is-info { color: var(--fg-muted); }
.venue-eye-sub { color: var(--fg-muted); font-size: .9rem; flex: 1 1 auto; }

/* Les affiches de la télé, sur la page de l'établissement. */
.promo-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.promo-list li { display: grid; grid-template-columns: 112px 1fr auto; gap: 12px; align-items: center; }
.promo-list img { width: 112px; height: 63px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--ink); }
.promo-meta { display: grid; gap: 2px; min-width: 0; }
.promo-meta b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.promo-meta span { color: var(--fg-muted); font-size: .9rem; }
.promo-list li.is-over { opacity: .55; }
.recap-standings { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.recap-standings li { display: grid; grid-template-columns: 2rem 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--sunken); }
.recap-standings li.is-first { background: var(--green-tint); border: 1px solid var(--green-hud); }
.recap-rank { font-weight: 800; text-align: center; color: var(--fg-muted); }
.recap-standings li.is-first .recap-rank { color: var(--green-hud); }
.recap-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.recap-score { color: var(--fg-muted); font-size: .92rem; white-space: nowrap; }
.recap-score b { color: var(--fg); }
.recap-awards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.recap-awards li { display: grid; gap: 2px; justify-items: center; text-align: center; padding: 14px 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); box-shadow: var(--raise-sm); }
.recap-award-icon { font-size: 1.8rem; }
.recap-award-title { color: var(--fg-muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; }
.recap-award-value { color: var(--red-bright); font-weight: 800; }
/* Le détail d'une partie : une feuille par leg, une ligne par tour, une
   colonne par joueur. Sur un téléphone, à plus de trois joueurs, elle défile. */
/* le nom entier, le résultat à côté s'il tient, dessous sinon */
.recap-game .member-row { flex-wrap: wrap; gap: 2px 12px; }
.recap-game .member-row .title { flex: none; }
.recap-detail { margin-top: 12px; border-top: 1px solid var(--line-soft); padding-top: 10px; }
.recap-detail summary { cursor: pointer; font-weight: 700; color: var(--fg-muted); padding: 4px 0; }
.recap-detail[open] summary { margin-bottom: 8px; }
.sheet + .sheet { margin-top: 16px; }
.sheet-head { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; margin: 0 0 6px; }
.sheet-head span { color: var(--fg-muted); font-size: .9rem; }
.sheet-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.sheet-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.sheet-table th, .sheet-table td { padding: 6px 8px; border-bottom: 1px solid var(--line-soft); text-align: center; vertical-align: top; }
.sheet-table thead th { position: sticky; top: 0; background: var(--sunken); font-size: .82rem; font-weight: 800; }
.sheet-table tbody th, .sheet-table tfoot th { width: 1%; white-space: nowrap; font-size: .78rem; font-weight: 700; color: var(--fg-muted); text-align: left; }
.sheet-table td { min-width: 5.5rem; }
.sheet-score { display: flex; justify-content: center; align-items: baseline; gap: 6px; }
.sheet-score b { font-size: 1.05rem; }
.sheet-score small { color: var(--fg-muted); font-size: .78rem; }
.sheet-darts { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; margin-top: 3px; }
.sheet-darts i { font-style: normal; font-size: .7rem; font-weight: 700; padding: 1px 4px; border-radius: 5px; background: var(--chip); color: var(--fg-muted); }
.sheet-darts i.is-t { background: var(--red-tint); color: var(--red-bright); }
.sheet-darts i.is-d { background: var(--green-tint); color: var(--green-hud); }
.sheet-darts i.is-miss { opacity: .6; }
/* random checkout : le restant à finir mène la ligne */
.sheet.is-checkout tbody th { font-family: var(--font-mono); font-size: 1.15rem; color: var(--fg); vertical-align: middle; }
.sheet-by { display: block; margin-top: 2px; font-size: .7rem; color: var(--fg-faint); }
.sheet-table td.is-win { background: var(--green-tint); }
.sheet-table td.is-win b { color: var(--green-hud); }
.sheet-table td.is-bust b, .sheet-table td.is-fail small { color: var(--red-bright); }
.sheet-table td.is-bust b { text-decoration: line-through; }
.sheet-table td.is-ton b { color: var(--red-bright); }
.sheet-table td.is-max { background: var(--red-tint); }
.sheet-table td.is-max b { color: var(--red-bright); }
.sheet-table tfoot td, .sheet-table tfoot th { background: var(--sunken); font-weight: 700; }
.sheet-table tfoot tr:last-child td, .sheet-table tfoot tr:last-child th { border-bottom: 0; }
.sheet-table tfoot tr.is-board td { font-size: 1.05rem; color: var(--green-hud); padding-block: 2px; }
.session-bar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; }
/* La photo d'équipe (caméra joueur) : le bouton sous les pseudos, le compte à rebours, l'aperçu. */
.team-photo-btn { margin-bottom: 10px; }
.team-photo-count { display: block; margin: 6px 0 10px; font-family: var(--font-display); font-size: 6rem; font-weight: 800; line-height: 1; text-align: center; }
.team-photo-img { display: block; width: 100%; height: auto; margin: 4px 0 8px; border-radius: 12px; background: #000; }
.slot-bar input { width: 100%; }
.manual-games summary { cursor: pointer; color: var(--fg-muted); font-weight: 600; padding: 6px 0; }
.manual-games[open] summary { margin-bottom: 10px; }

/* Sur un Œil : le clavier ne sert qu'à corriger, il reste replié. */
.eye-pad-bar { display: flex; flex-direction: column; gap: 10px; align-items: stretch; text-align: center; }
.eye-pad-hint { margin: 0; padding: 14px 12px; border-radius: 12px; background: rgba(28, 122, 71, 0.10); border: 1px solid rgba(28, 122, 71, 0.35); color: var(--fg); }
.eye-pad-hint:empty { display: none; }
.eye-mode:not(.pad-open) .keypad > :not(.pad-actions, .eye-pad-bar) { display: none; }
.eye-mode:not(.pad-open) .keypad .pad-actions .btn-outline { display: none; }
.eye-mode:not(.pad-open) .keypad .pad-actions { grid-template-columns: 1fr; }
/* Le serveur ne répond plus depuis quelques secondes (réseau du téléphone). */
.is-eye-lag .eye-badge { background: rgba(192, 39, 45, 0.12); border-color: rgba(192, 39, 45, 0.45); color: var(--red); }
.is-eye-lag .eye-badge::after { content: " · connexion…"; }

/* Partie solo : un seul panneau, on écrit en grand. */
.scoreboard.is-solo .team-score { font-size: clamp(4.4rem, 24vw, 6.5rem); }
.scoreboard.is-solo .team-turns .t-darts { font-size: .95rem; }
.scoreboard.is-solo .team-turns .t-scored { font-size: 1.5rem; }
.scoreboard.is-solo .team-turns .t-rest { font-size: 1rem; }
@media (min-width: 900px) {
  .scoreboard.is-solo .team-score { font-size: clamp(6rem, 10vw, 9rem); }
  .scoreboard.is-solo .team-name { font-size: 1.6rem; }
  .scoreboard.is-solo .team-turns li { padding: 10px 6px; }
  .scoreboard.is-solo .team-turns .t-darts { font-size: 1.25rem; }
  .scoreboard.is-solo .team-turns .t-scored { font-size: 2.1rem; }
  .scoreboard.is-solo .team-turns .t-rest { font-size: 1.3rem; }
  .scoreboard.is-solo .team-stats { font-size: 1rem; }
}

/* Accueil : où jouer — chaque club, ses cibles et « à la main ». */
.play-venues { display: grid; gap: 18px; }
.play-venue { display: grid; gap: 10px; }
.play-venue-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.play-venue-head a { color: var(--fg); text-decoration: none; }
.play-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.play-choice { display: grid; gap: 4px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); box-shadow: var(--raise-sm); color: var(--fg); text-decoration: none; }
.play-choice b { font-size: 1.1rem; }
.play-choice span { color: var(--fg-muted); font-size: .9rem; }
.play-choice.is-eye { border-color: var(--green-hud); background: var(--green-tint); }
.play-choice:hover { border-color: var(--line-strong); }

/* Bar : la cible fermée (la tablette attend le comptoir), ce qu'il reste de la formule. */
.kiosk-closed { text-align: center; padding: 34px 20px; }
.kiosk-closed h2 { margin: 0 0 8px; font-size: 1.8rem; }
.kiosk-closed-icon { font-size: 3rem; margin: 0 0 6px; }
.kiosk-closed-text { color: var(--fg-muted); font-size: 1.1rem; margin: 0 auto 18px; max-width: 30em; }
.formula-list { list-style: none; margin: 0 auto; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.formula-list li { display: grid; gap: 2px; padding: 12px 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); box-shadow: var(--raise-sm); min-width: 120px; }
.formula-list b { font-size: 1.2rem; }
.formula-list span { color: var(--red-bright); font-weight: 700; }
.session-left { white-space: nowrap; }
.session-left.is-block { display: inline-block; margin: 0 0 10px; padding: 6px 12px; border-radius: 999px; background: var(--green-tint); border: 1px solid var(--green-hud); }
.session-left.is-ending b { color: var(--red-bright); }

/* Pendant la partie, cinq minutes avant la fin du temps payé : un rappel, en bas (le bas est libre à la télé). */
.session-clock { display: none; position: fixed; left: 50%; bottom: 18px; z-index: 40; transform: translateX(-50%); padding: 10px 18px; border-radius: 999px; background: var(--ink); color: var(--cream-fg); font-weight: 700; box-shadow: var(--raise-sm); white-space: nowrap; }
.session-clock.is-ending { display: block; }
.session-clock b { color: #FFD27A; }
.session-clock-over, .session-clock.is-over .session-clock-left { display: none; }
.session-clock.is-over .session-clock-over { display: inline; }
body:not(.is-spectator) .session-clock { bottom: auto; top: 12px; }
.is-spectator .session-clock { font-size: 1.4rem; padding: .6rem 1.4rem; }

/* Les caméras de la cible ont un souci (eye_alert.js) : un bandeau en haut, par-dessus tout. */
.eye-alert { position: fixed; top: 0; left: 0; right: 0; z-index: 45; padding: 10px 16px; background: var(--ink); color: #FFD27A; font-weight: 700; text-align: center; box-shadow: var(--raise-sm); }
.eye-alert.is-erreur { background: var(--red-bright); color: #fff; }
.is-spectator .eye-alert, .is-screen .eye-alert { font-size: 1.4rem; padding: .7rem 1.4rem; }
body.has-eye-alert:not(.is-spectator) .session-clock { top: 64px; }

/* La tablette coupe ou remet le son de la télé de sa cible. */
.kiosk-sound { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 14px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }

/* Le comptoir : chaque cible, ouverte ou fermée, et ses gestes. */
.counter-target.is-open { border-color: var(--green-hud); }
.counter-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.counter-head h2 { margin: 0; font-size: 1.25rem; }
.counter-status { margin: 10px 0 6px; font-size: 1.05rem; }
.counter-left { margin: 0 0 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.counter-left .hint { margin: 0; }
.counter-formulas, .counter-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.counter-formulas .btn, .counter-actions .btn { flex: 1 1 140px; }
.counter-actions form { display: flex; flex: 1 1 140px; }
.counter-formulas small { font-weight: 600; opacity: .85; }

/* ═══════════════════════════════════════════════════════════════
   Grand écran d'une cible (une télé) : il regarde, lisible à 3 m.
   La tablette de la cible devient la télécommande.
   ═══════════════════════════════════════════════════════════════ */

/* Tout ce qui est en rem grandit avec la télé (≈ 21 px sur un écran 1080p). */
/* Pas de :has() ni d'unités récentes ici : les navigateurs des télés sont souvent anciens. */
html.tv { font-size: clamp(16px, 1.1vw, 30px); }
/* Une télé ne se pointe pas : pas de souris, nulle part (liens et boutons compris). */
html.tv, html.tv * { cursor: none !important; }

/*
 * La partie, la même pour tous les jeux : le jeu en plein écran et, en haut,
 * un bandeau — le jeu et la manche à gauche, qui joue et sa volée au centre.
 * Les jeux d'arcade y ajoutent, en surimpression sur la scène, l'équipe ou la
 * vague à gauche et les joueurs à droite ; le bas reste à la scène (les
 * plaques du Siège). Ni pavé, ni actions.
 */
.is-spectator {
  --tv-pad: clamp(10px, 1.2vw, 28px);
  --tv-glass: rgba(18, 15, 10, .72);
  --tv-glass-line: rgba(255, 244, 214, .14);
  --tv-fg: #fff8e4;
  --tv-muted: #c9bfa4;
}
body.is-spectator { padding: 0; overflow: hidden; }
.is-spectator #app { max-width: none; padding: 0; }
/* La borne et ses réglages ne regardent pas les spectateurs. */
.is-spectator .keypad, .is-spectator .head-actions, .is-spectator .back-btn, .is-spectator .eye-badge { display: none !important; }

/* Les pastilles du bandeau : du verre sombre, sur le tableau comme sur la scène. */
.is-spectator .match-info,
.is-spectator .turn-area {
  background: var(--tv-glass); border: 1px solid var(--tv-glass-line); color: var(--tv-fg);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
.is-spectator .match-info { padding: .55rem 1.1rem; border-radius: 18px; font-size: 1rem; color: var(--tv-muted); }
.is-spectator .arcade .match-info { white-space: nowrap; border-radius: 999px; }
.is-spectator .match-info b { color: var(--la-green-bright); }
.is-spectator .turn-area {
  display: flex; flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: .5rem 1.2rem; padding: .7rem 1.6rem; border-radius: 22px; min-height: 0; margin: 0;
}
.is-spectator .turn-who { font-size: 1.6rem; color: var(--tv-muted); }
.is-spectator .turn-who b { color: var(--tv-fg); font-weight: 700; }
.is-spectator .turn-total, .is-spectator .checkout { font-size: 1.2rem; color: var(--tv-muted); }
.is-spectator .turn-total { --num: 2rem; }
.is-spectator .turn-total b { color: var(--tv-fg); }
.is-spectator .darts { flex: none; width: 21rem; max-width: 21rem; }
/*
 * X01 et random checkout : le joueur et ses fléchettes sur une ligne, la sortie et le total
 * sur la suivante. Largeur fixe : que la sortie apparaisse ou que le total s'écrive, le bloc
 * garde sa taille (sinon il suit son texte et la mise en page bascule en pleine volée).
 */
.is-spectator #screen-game > .turn-area { width: min(62vw, 58rem); }
.is-spectator #screen-game > .turn-area::after { content: ""; flex-basis: 100%; order: 2; }
.is-spectator #screen-game > .turn-area > .checkout,
.is-spectator #screen-game > .turn-area > .turn-total { order: 3; }
/* Les autres jeux à tableau : le joueur, puis sa volée sur la ligne suivante, à la même largeur. */
.is-spectator .screen-variant:not(.arcade) > .turn-area { width: min(62vw, 58rem); }
.is-spectator .screen-variant:not(.arcade) > .turn-area > :not(.turn-who) { flex-basis: 100%; text-align: center; }
/* Bob's 27 : on valide sur la tablette. */
.is-spectator .turn-total .btn, .is-spectator .turn-total::after { display: none; }
.is-spectator .checkout { gap: .5rem; }
.is-spectator .co-label { font-size: .9rem; color: var(--tv-muted); }
.is-spectator .co-dart { font-size: 1.5rem; padding: .1rem .8rem; color: var(--tv-fg); background: transparent; border: 2px solid var(--la-green-bright); }
.is-spectator .co-dart.is-final { background: var(--la-green-bright); }
.is-spectator .co-none { font-size: 1.1rem; color: var(--tv-muted); }
.is-spectator .dart-slot { height: 3.8rem; font-size: 2rem; }
.is-spectator .killer-hits { min-height: 0; align-items: center; --chip-fs: 1.7rem; --chip-py: .25rem; --chip-bw: 2px; }
.is-spectator .killer-hits .chip, .is-spectator .chip.is-pickable {
  font-size: var(--chip-fs); padding: var(--chip-py) 1.1rem; cursor: none;
  background: #fff8e4; color: var(--ink); border: var(--chip-bw) solid transparent;
}
.is-spectator .chip.is-cv { border-color: var(--la-green-bright); }
.is-spectator .chip.is-corrected { border-color: var(--la-red-bright); border-style: dashed; }
.is-spectator .turn-area .capital-turn { font-size: 1.2rem; color: var(--tv-muted); }
.is-spectator .turn-area .capital-turn.is-ok { color: var(--la-green-bright); }
.is-spectator .killer-hits .empty { color: var(--tv-muted); font-size: 1rem; }
.is-spectator .eye-badge { font-size: .9rem; }

/* Jeux à tableau (X01, Cricket, Killer…) : le bandeau, puis le tableau sur toute la place. */
.is-spectator #screen-game,
.is-spectator .screen-variant:not(.arcade) {
  height: 100vh; box-sizing: border-box; padding: var(--tv-pad);
  display: grid; gap: var(--tv-pad);
  /* Le jeu à gauche garde sa place ; le bandeau du milieu passe à la ligne s'il est long. */
  grid-template-columns: minmax(14rem, 1fr) minmax(0, auto) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "head turn ." "main main main";
}
.is-spectator .screen-variant:not(.arcade) > .turn-area,
.is-spectator #screen-game > .turn-area { max-width: 62vw; }
.is-spectator #screen-game > .game-head, .is-spectator .screen-variant > .game-head { grid-area: head; align-self: start; }
.is-spectator #screen-game > .turn-area, .is-spectator .screen-variant > .turn-area { grid-area: turn; align-self: start; }
.is-spectator #screen-game > .scoreboard,
.is-spectator .screen-variant > .variant-main { grid-area: main; min-height: 0; overflow: hidden; }
.is-spectator .team-score { font-size: clamp(6rem, 22vh, 17rem); }
.is-spectator .team-name { font-size: 2.2rem; }
.is-spectator .team-turns .t-darts { font-size: 1.3rem; }
.is-spectator .team-turns .t-scored { font-size: 2.3rem; }
.is-spectator .team-turns .t-rest { font-size: 1.3rem; }
.is-spectator .team-stats { font-size: 1.1rem; }
.is-spectator .scoreboard.is-solo .team-score { font-size: clamp(7rem, 26vh, 20rem); }

/* Jeux à cartes (Killer, Capital, Bob's 27) : les cartes des joueurs remplissent l'écran. */
.is-spectator .variant-capital > .variant-main { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: var(--tv-pad); }
.is-spectator .screen-variant:not(.arcade) .players-board {
  height: 100%; padding: 0; gap: var(--tv-pad); overflow: hidden; align-content: stretch;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); grid-auto-rows: minmax(0, 1fr);
}
.is-spectator .screen-variant:not(.arcade) .pcard { align-content: center; justify-items: center; text-align: center; gap: .5rem; padding: 1.2rem; }
.is-spectator .screen-variant:not(.arcade) .pcard-name { font-size: 2rem; }
.is-spectator .screen-variant:not(.arcade) .pcard-score { font-size: clamp(4.5rem, 15vh, 11rem); }
.is-spectator .screen-variant:not(.arcade) .pcard-sub { font-size: 1.05rem; }
.is-spectator .screen-variant:not(.arcade) .pcard-number { font-size: 1.8rem; }
.is-spectator .screen-variant:not(.arcade) .killer-track span { width: 2rem; height: .7rem; border-radius: .35rem; }
.is-spectator .screen-variant:not(.arcade) .bobs-track span { font-size: 1rem; min-width: 2.4rem; }
.is-spectator .capital-track { gap: .4rem; justify-content: center; }
.is-spectator .capital-track span { font-size: 1.05rem; padding: .3rem .8rem; }

/* Cricket : la grille occupe la hauteur. */
.is-spectator .variant-cricket > .variant-main { align-content: stretch; }
.is-spectator .cricket-board { height: 100%; }
.is-spectator .cricket-board thead th:first-child { width: 6.5rem; }
.is-spectator .cricket-board thead th span { font-size: 1.5rem; }
.is-spectator .cricket-board thead th b { font-size: 3.2rem; }
.is-spectator .cricket-board tbody th { font-size: 2.2rem; }
.is-spectator .cricket-board td { font-size: 2.2rem; }

/* Arcade : la scène sur tout l'écran, le reste en surimpression. */
.is-spectator .screen-variant.arcade {
  position: relative; height: 100vh; overflow: hidden; display: block; padding: 0;
  background: #0c0b10;
}
.is-spectator .arcade > .variant-main { display: contents; }
.is-spectator .arcade .siege-stage {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; aspect-ratio: auto; width: auto; height: auto; margin: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 0; box-shadow: none;
}
/* Le dessin entier (1000 × 600), aussi grand que l'écran le permet. */
.is-spectator .arcade .siege-svg { width: min(100vw, 100vh * 1000 / 600); height: min(100vw * 600 / 1000, 100vh); flex: none; }
/* Ce que la scène écrit elle-même en haut (titre, vague…) : les surimpressions le disent déjà. */
.is-spectator .arcade .sg-hud { display: none; }
.is-spectator .arcade .siege-toasts { top: 30%; right: 0; bottom: auto; left: 0; }

.is-spectator .arcade > .game-head { position: absolute; top: var(--tv-pad); left: var(--tv-pad); z-index: 2; }
.is-spectator .arcade .siege-call {
  position: absolute; top: var(--tv-pad); left: 50%; transform: translateX(-50%); z-index: 2;
  width: max-content; max-width: 56vw; margin: 0; font-size: 2.1rem; color: var(--tv-fg); white-space: nowrap;
  text-shadow: 0 3px 0 rgba(0, 0, 0, .55), 0 0 24px rgba(0, 0, 0, .7);
}
.is-spectator .arcade .siege-call-darts { color: var(--tv-muted); }
.is-spectator .arcade > .turn-area {
  position: absolute; top: calc(var(--tv-pad) + 3.6rem); left: 50%; transform: translateX(-50%); z-index: 2;
  max-width: 52vw;
}
.is-spectator .arcade > .turn-area .turn-who { display: none; }
.is-spectator .arcade > .turn-area:not(:has(.chip)) { display: none; }

/* À gauche : les équipes, les compteurs (vague, barricade…), les joueurs des Ballons. */
.is-spectator .arcade .arcade-head {
  position: absolute; top: calc(var(--tv-pad) + 3.4rem); left: var(--tv-pad); z-index: 2;
  width: clamp(16rem, 21vw, 26rem); display: grid; gap: .6rem;
}
.is-spectator .arcade-siege .arcade-head { grid-template-columns: 1fr; }
.is-spectator .arcade .siege-team { padding: .55rem .9rem; background: var(--tv-glass); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.is-spectator .arcade .siege-team-name { font-size: 1.7rem; }
.is-spectator .arcade .siege-team-players { margin: .15rem 0 .4rem; }
.is-spectator .arcade .arcade-stats { grid-template-columns: 1fr; gap: .5rem; }
.is-spectator .arcade .arcade-stat {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .5rem 1rem; text-align: left;
  background: var(--tv-glass); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.is-spectator .arcade .arcade-stat b { font-size: 2rem; }
.is-spectator .arcade .players-board { display: grid; grid-template-columns: 1fr; gap: .4rem; padding: 0; overflow: visible; }
.is-spectator .arcade .pcard {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; column-gap: .8rem;
  padding: .4rem .9rem; background: var(--tv-glass); color: var(--tv-fg);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.is-spectator .arcade .pcard-name { font-size: 1.15rem; }
.is-spectator .arcade .pcard-score { grid-row: span 2; font-size: 2rem; }
.is-spectator .arcade .pcard-sub { font-size: .9rem; color: var(--tv-muted); }

/* Les Ballons n'ont pas d'en-tête : leurs joueurs vont à droite, comme ailleurs. */
.is-spectator .arcade-ballons .arcade-head { left: auto; right: var(--tv-pad); top: var(--tv-pad); width: clamp(14rem, 18vw, 22rem); }
.is-spectator .arcade .players-board .pcard { grid-template-columns: minmax(0, 1fr) auto; }
.is-spectator .arcade .players-board .pcard-sub { display: none; }
.is-spectator .arcade .players-board .pcard-score { grid-row: auto; font-size: 1.6rem; }

/* À droite : les joueurs et leurs points. */
.is-spectator .arcade .siege-roster {
  position: absolute; top: var(--tv-pad); right: var(--tv-pad); z-index: 2;
  width: clamp(14rem, 18vw, 22rem); grid-template-columns: 1fr; gap: .6rem;
  padding: .8rem 1.1rem; border-radius: 18px; font-size: 1.2rem; color: var(--tv-fg);
  background: var(--tv-glass); border: 1px solid var(--tv-glass-line);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.is-spectator .arcade .siege-roster:empty { display: none; }
.is-spectator .arcade .siege-roster h3 { font-size: 1.3rem; }
.is-spectator .arcade .siege-roster li span { color: var(--tv-muted); }
.is-spectator .arcade .siege-roster li.is-current span { color: var(--tv-fg); }
.is-spectator .arcade .siege-roster li b { color: var(--tv-fg); }
.is-spectator .arcade .siege-roster li em { color: var(--la-green-bright); }

/* Fin de partie : le résultat, sans bouton. */
.is-spectator #modal-root .modal-actions:empty { display: none; }
.is-spectator #modal-title { font-size: 3rem; }
.is-spectator #modal-text { font-size: 1.5rem; }
.is-spectator .modal.is-end { width: min(1200px, 88vw); padding: 3.5rem 3rem 3rem; }
.is-spectator .modal.is-end::before { margin-bottom: 1.2rem; font-size: 8rem; }
.is-spectator .is-end #modal-title { margin-bottom: 1.4rem; font-size: clamp(3rem, 7vw, 6.5rem); }
.is-spectator .is-end #modal-text { margin: 0; font-size: clamp(1.4rem, 2.4vw, 2.4rem); }

/* La tablette, quand une télé montre la partie : la télécommande. L'ardoise et la
   scène d'arcade sont sur la télé ; restent qui lance, la volée en grand (on touche
   une fléchette pour la corriger), annuler, abandonner. */
body:not(.is-spectator) .is-remote .siege-stage { display: none; }
body:not(.is-spectator) .is-remote .scoreboard,
body:not(.is-spectator) .is-remote:not(.arcade) > .variant-main { display: none; }
/* En portrait, la volée garde sa hauteur en haut ; les boutons restent en bas, sous le pouce. */
@media (max-width: 899px) {
  body:not(.is-spectator) #screen-game.is-remote,
  body:not(.is-spectator) .screen-variant.is-remote:not(.arcade) { grid-template-rows: auto auto minmax(0, 1fr); }
  body:not(.is-spectator) .is-remote:not(.arcade) > .keypad { align-content: end; }
}
.is-remote .turn-area { gap: 12px; padding: 22px 14px; align-content: center; }
.is-remote .killer-hits { align-items: center; align-content: center; }
.is-remote .turn-who { font-size: 1.3rem; }
.is-remote .turn-total { font-size: 1.15rem; --num: 1.8rem; }
.is-remote .darts { max-width: 520px; gap: 12px; }
.is-remote .dart-slot { height: 96px; font-size: 2.2rem; border-radius: 14px; }
.is-remote .killer-hits { --chip-fs: 2rem; --chip-py: .6rem; }
.is-remote .killer-hits .chip, .is-remote .chip.is-pickable { font-size: var(--chip-fs); padding: var(--chip-py) 1.4rem; }
.eye-remote-actions { display: none; }
.is-remote .eye-remote-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.is-remote .eye-remote-actions .btn { padding: 16px 10px; font-size: 1.05rem; }

/* La télécommande en portrait, clavier replié : la tablette de la cible se lit à
   bout de bras, debout, souvent de loin. La volée prend toute la hauteur libre et
   ses fléchettes s'affichent en très grand (on les touche pour corriger) ; les
   boutons restent en bas, sous le pouce, à la taille d'un doigt pressé. Clavier
   ouvert (pad-open), on revient à la disposition ci-dessus : le pavé a besoin de
   la place. */
@media (max-width: 899px) {
  body:not(.is-spectator) #screen-game.is-remote:not(.pad-open),
  body:not(.is-spectator) .screen-variant.is-remote:not(.arcade):not(.pad-open) { grid-template-rows: auto minmax(0, 1fr) auto; }
  body:not(.is-spectator) .is-remote:not(.arcade):not(.pad-open) > .keypad { align-content: end; }
  body:not(.is-spectator) .is-remote:not(.arcade):not(.pad-open) .turn-area { gap: clamp(14px, 3dvh, 28px); padding: 24px 16px; }
  body:not(.is-spectator) .is-remote:not(.arcade):not(.pad-open) .turn-who { font-size: clamp(1.5rem, 5.5vw, 2.1rem); }
  body:not(.is-spectator) .is-remote:not(.arcade):not(.pad-open) .turn-total { font-size: clamp(1.15rem, 4vw, 1.5rem); --num: clamp(2.4rem, 9vw, 3.4rem); }
  body:not(.is-spectator) .is-remote:not(.arcade):not(.pad-open) .darts { max-width: none; gap: clamp(10px, 2.5vw, 18px); }
  body:not(.is-spectator) .is-remote:not(.arcade):not(.pad-open) .dart-slot {
    height: clamp(120px, 22dvh, 230px);
    font-size: clamp(2.6rem, 11vw, 4.6rem);
    border-radius: 18px; border-width: 2px;
  }
  body:not(.is-spectator) .is-remote:not(.arcade):not(.pad-open) .killer-hits { --chip-fs: clamp(2.2rem, 8vw, 3.2rem); --chip-py: .8rem; }
  /* La consigne et les boutons : lisibles de loin, à la taille d'un doigt. */
  body:not(.is-spectator) .is-remote:not(.pad-open) .eye-pad-bar { gap: 12px; }
  body:not(.is-spectator) .is-remote:not(.pad-open) .eye-pad-hint { padding: 16px 14px; font-size: clamp(1.1rem, 3.6vw, 1.35rem); line-height: 1.4; }
  body:not(.is-spectator) .is-remote:not(.pad-open) .eye-pad-toggle { padding: 18px 12px; font-size: clamp(1.1rem, 3.6vw, 1.3rem); }
  body:not(.is-spectator) .is-remote:not(.pad-open) .eye-remote-actions { gap: 12px; }
  body:not(.is-spectator) .is-remote:not(.pad-open) .eye-remote-actions .btn { padding: 22px 10px; font-size: clamp(1.15rem, 3.8vw, 1.4rem); }
  body:not(.is-spectator) .is-remote:not(.pad-open) .pad-actions .btn { padding: 24px 10px; font-size: clamp(1.3rem, 4.4vw, 1.6rem); }
}

/* Les pages de la télé entre les parties : le code, le repos, désactivé. */
.screen-page {
  min-height: 100vh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 2rem 3rem; box-sizing: border-box; text-align: center;
}
.screen-brand { display: flex; align-items: center; justify-content: center; gap: .7rem; font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; }
.screen-brand svg { width: 2.4rem; height: 2.4rem; }
.screen-idle { align-self: center; display: grid; gap: 1.2rem; justify-items: center; }
.screen-idle h1 { margin: 0; font-family: var(--font-display); font-size: clamp(3rem, 7vw, 6rem); line-height: 1; }
.screen-lead { margin: 0; font-size: 2rem; font-weight: 600; }
.screen-hint { margin: 0; font-size: 1.3rem; color: var(--fg-muted); line-height: 1.5; }
.screen-names { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .8rem; }
.screen-names li { font-family: var(--font-display); font-weight: 700; font-size: 2.2rem; padding: .4rem 1.4rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); box-shadow: var(--raise-sm); }
.screen-code { margin: 0; font-family: var(--font-mono); font-weight: 700; font-size: clamp(5rem, 14vw, 12rem); letter-spacing: .12em; line-height: 1; }
.screen-code span { margin-left: .4em; }
.screen-foot { color: var(--fg-faint); font-size: 1rem; }

/* Kiosque : les télés de la cible. */
.kiosk-screen-list, .kiosk-tablet-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.kiosk-screen-list li, .kiosk-tablet-list li { display: flex; align-items: center; gap: 10px; }
.kiosk-screen-list li span:nth-child(2), .kiosk-tablet-list li span:nth-child(2) { flex: 1; }
.kiosk-screen-list .dot, .kiosk-tablet-list .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.kiosk-screen-list .dot.is-on, .kiosk-tablet-list .dot.is-on { background: var(--green); }
.kiosk-screen-pair { display: flex; gap: 8px; }
.kiosk-screen-pair input { flex: 1; min-width: 0; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .1em; }

/* ── Écran de veille du grand écran (entre les parties) ──────────
   Du CSS seul, sans :has() ni unités récentes (navigateurs des télés),
   et animé même si la box demande moins d'animations : c'est une vitrine. */
.screen-saver { grid-row: 1 / 3; align-self: stretch; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.screen-foot { grid-row: 3; }
.ss-drift {
  display: flex; align-items: center; justify-content: center;
  animation: ss-drift 80s ease-in-out infinite alternate;
}
.ss-target { width: 62vh; height: 62vh; flex: none; margin-right: 6vw; filter: drop-shadow(0 18px 30px rgba(21, 18, 13, .25)); }
.ss-slides { position: relative; width: 44vw; height: 40vh; }
.ss-slide {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  opacity: 0; animation: ss-slide 27s ease-in-out infinite;
}
.ss-slide:nth-child(2) { animation-delay: 9s; }
.ss-slide:nth-child(3) { animation-delay: 18s; }
.ss-slide > * + * { margin-top: 1.2rem; }
.ss-big { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 4.6rem; line-height: 1; }
.ss-url { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 5.8rem; line-height: 1; letter-spacing: -.01em; }
.ss-url b { color: var(--green); }
.ss-slide:nth-child(3) .ss-url b { color: var(--red); }
.ss-small { margin: 0; font-size: 2.1rem; color: var(--fg-muted); }
.ss-slides .screen-names { justify-content: flex-start; }
/* Pendant une session : le classement et les distinctions, lisibles de loin. */
.ss-title { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 3.4rem; line-height: 1; }
.ss-rank, .ss-awards { list-style: none; margin: 0; padding: 0; text-align: left; }
.ss-rank li { display: flex; align-items: baseline; gap: 1rem; font-size: 2.3rem; line-height: 1.35; }
.ss-rank-pos { display: inline-block; min-width: 2.6rem; text-align: center; font-weight: 800; color: var(--fg-muted); }
.ss-rank b { font-family: var(--font-display); font-weight: 700; }
.ss-rank em, .ss-awards em { font-style: normal; font-size: 1.7rem; color: var(--fg-muted); }
.ss-awards li { font-size: 1.9rem; line-height: 1.45; }
.ss-awards span { display: inline-block; min-width: 2.6rem; }
.ss-prices { list-style: none; margin: 0; padding: 0; font-size: 2.1rem; line-height: 1.35; text-align: left; }
.ss-prices b { color: var(--red); }

/* La volée : chaque fléchette arrive de loin, se plante (une onde à l'impact), puis on les retire ensemble. */
.ss-dart { opacity: 0; animation: 9s linear infinite; }
.ss-dart-1 { animation-name: ss-throw-1; }
.ss-dart-2 { animation-name: ss-throw-2; }
.ss-dart-3 { animation-name: ss-throw-3; }
.ss-hit { opacity: 0; transform-origin: center; transform-box: fill-box; animation: 9s ease-out infinite; }
.ss-hit-1 { animation-name: ss-hit-1; }
.ss-hit-2 { animation-name: ss-hit-2; }
.ss-hit-3 { animation-name: ss-hit-3; }

@keyframes ss-throw-1 {
  0% { opacity: 0; transform: translate(70px, -45px) scale(1.8); }
  2% { opacity: 1; }
  7% { opacity: 1; transform: translate(0, 0) scale(1); }
  8% { transform: translate(.6px, -.4px) rotate(-3deg); }
  9.5% { transform: translate(0, 0) rotate(0); }
  88% { opacity: 1; transform: translate(0, 0); }
  94%, 100% { opacity: 0; transform: translate(14px, -9px); }
}
@keyframes ss-throw-2 {
  0%, 30% { opacity: 0; transform: translate(70px, -45px) scale(1.8); }
  32% { opacity: 1; }
  37% { opacity: 1; transform: translate(0, 0) scale(1); }
  38% { transform: translate(.6px, -.4px) rotate(-3deg); }
  39.5% { transform: translate(0, 0) rotate(0); }
  88% { opacity: 1; transform: translate(0, 0); }
  94%, 100% { opacity: 0; transform: translate(14px, -9px); }
}
@keyframes ss-throw-3 {
  0%, 60% { opacity: 0; transform: translate(70px, -45px) scale(1.8); }
  62% { opacity: 1; }
  67% { opacity: 1; transform: translate(0, 0) scale(1); }
  68% { transform: translate(.6px, -.4px) rotate(-3deg); }
  69.5% { transform: translate(0, 0) rotate(0); }
  88% { opacity: 1; transform: translate(0, 0); }
  94%, 100% { opacity: 0; transform: translate(14px, -9px); }
}
@keyframes ss-hit-1 { 0%, 6.9% { opacity: 0; transform: scale(.4); } 7% { opacity: .9; transform: scale(.6); } 16%, 100% { opacity: 0; transform: scale(3.2); } }
@keyframes ss-hit-2 { 0%, 36.9% { opacity: 0; transform: scale(.4); } 37% { opacity: .9; transform: scale(.6); } 46%, 100% { opacity: 0; transform: scale(3.2); } }
@keyframes ss-hit-3 { 0%, 66.9% { opacity: 0; transform: scale(.4); } 67% { opacity: .9; transform: scale(.6); } 76%, 100% { opacity: 0; transform: scale(3.2); } }
@keyframes ss-slide { 0% { opacity: 0; transform: translateY(1.5rem); } 4%, 30% { opacity: 1; transform: translateY(0); } 34%, 100% { opacity: 0; transform: translateY(-1rem); } }
@keyframes ss-drift { from { transform: translate(-1.5vw, -1.2vh); } to { transform: translate(1.5vw, 1.2vh); } }

/* Les affiches de l'établissement, plein écran, entre deux tours de l'animation. */
.ss-promo { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: var(--ink); opacity: 0; visibility: hidden; transition: opacity .8s ease, visibility 0s linear .8s; }
.ss-promo.is-on { opacity: 1; visibility: visible; transition: opacity .8s ease; }
.ss-promo img { width: 100%; height: 100%; object-fit: contain; }

/* Téléphone ou écran étroit : la cible au-dessus des mots. */
@media (max-aspect-ratio: 1/1) {
  .ss-drift { flex-direction: column; }
  .ss-target { width: 70vw; height: 70vw; margin: 0 0 4vh; }
  .ss-slides { width: 90vw; height: 30vh; }
  .ss-slide { align-items: center; text-align: center; }
}

/* ── Tournoi : le tableau (page du gérant, page publique, tablette, télé) ──
   Des colonnes par tour, les matchs répartis dans la hauteur : un match du
   tour suivant tombe entre les deux qui l'alimentent. Sans grid calculé ni
   :has() : la télé l'affiche aussi. */
.bracket { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 4px; }
.bracket-round { display: flex; flex-direction: column; flex: 1 0 8rem; min-width: 8rem; }
.bracket-round h3 { margin: 0 0 8px; font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-muted); text-align: center; }
.bracket-matches { flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: 8px; }
.bm { border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); box-shadow: var(--raise-sm); overflow: hidden; }
.bm-p { display: flex; align-items: baseline; gap: 8px; padding: 6px 10px; font-weight: 600; line-height: 1.25; }
.bm-n { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.bm-s { display: inline-block; min-width: 1ch; text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--fg); }
.bm-p.is-win .bm-s { color: var(--green); }
.bm-p.is-out .bm-s { color: var(--fg-faint); }
.bm-p + .bm-p { border-top: 1px solid var(--line); }
.bm-p.is-win { font-weight: 800; color: var(--green); }
.bm-p.is-out { color: var(--fg-faint); text-decoration: line-through; }
.bm-p.is-tbd { font-weight: 400; color: var(--fg-faint); }
.bm small { display: block; padding: 4px 10px; font-size: .74rem; color: var(--fg-muted); background: var(--sunken); }
.bm.is-playing { border-color: var(--green); box-shadow: 0 0 0 2px var(--green); }
.bm.is-called { border-style: dashed; border-color: var(--red); }
.bm.is-here { box-shadow: 0 0 0 3px var(--red); }
.bm.is-bye { opacity: .55; box-shadow: none; }
.bracket-champion { flex: .6 0 6.5rem; min-width: 6.5rem; }
.bracket-champion .bm { border-color: var(--green); }
.bracket-champion .bm-p { font-size: 1.1rem; text-align: center; }
.bracket-champion .bm-n { text-align: center; }
.bracket.is-compact:not(.is-tv) .bm-p { padding: 4px 8px; font-size: .88rem; }
.bracket.is-compact:not(.is-tv) .bm small { padding: 2px 8px; }
.bracket.is-large .bm-p { padding: 3px 8px; font-size: .82rem; }
.tournament-champion h2 { margin: 0; text-align: center; font-family: var(--font-display); font-size: 1.6rem; }
.tournament-form textarea { width: 100%; font: inherit; }
/* Les inscrits : un champ par joueur ; en double, le partenaire à côté. */
.entrant-list { display: grid; gap: 8px; margin-top: 6px; }
.entrant-row { display: flex; gap: 8px; align-items: center; }
.entrant-row .order { flex: none; width: 22px; text-align: right; font-weight: 700; color: var(--fg-muted); }
.entrant-row input { flex: 1; min-width: 0; }
.entrant-and, .entrant-row .entrant-b, .entrant-hint { display: none; }
.tournament-form.is-double .entrant-and { display: inline; font-weight: 800; color: var(--fg-muted); }
.tournament-form.is-double .entrant-row .entrant-b, .tournament-form.is-double .entrant-hint { display: block; }
.tournament-format { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0; }
.tournament-format .check { display: flex; gap: 6px; align-items: center; font-weight: 600; }
.tournament-eyes { border: 0; margin: 12px 0; padding: 0; }
.tournament-eyes legend { font-weight: 700; margin-bottom: 6px; }
.tournament-eyes .check { display: flex; gap: 8px; align-items: center; margin: 4px 0; }

/* Sur la tablette d'une cible prise par un tournoi : en paysage, le match à
   gauche (il reste en vue), le tableau à droite. */
.kiosk-tourney { display: grid; gap: 14px; }
.kiosk-tournament { text-align: center; }
@media (min-width: 900px) and (orientation: landscape) {
  .kiosk-tourney { grid-template-columns: minmax(250px, 300px) minmax(0, 1fr); align-items: start; }
  .kiosk-tourney .kiosk-tournament { position: sticky; top: 14px; }
  .kiosk-tourney .kiosk-tournament-vs { flex-direction: column; align-items: center; gap: .15rem; font-size: 1.7rem; }
}
.kiosk-tournament-name { margin: 0; font-weight: 800; color: var(--fg-muted); }
.kiosk-tournament-round { margin: 10px 0 0; font-size: .9rem; font-weight: 700; color: var(--red); text-transform: uppercase; letter-spacing: .05em; }
.kiosk-tournament-vs { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: .5rem 1rem; margin: 8px 0 16px; font-family: var(--font-display); font-size: 2rem; }
.kiosk-tournament-vs span { font-family: var(--font-text); font-size: 1rem; color: var(--fg-muted); }

/* Sur la télé : le tableau en grand, et le match qui attend la cible. */
.screen-tournament { grid-row: 1 / 3; display: flex; flex-direction: column; padding: 2rem 2.4rem 0; min-height: 0; }
.st-head { margin-bottom: 1.4rem; }
.st-name { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 2.4rem; }
.st-name small { font-family: var(--font-text); font-size: 1.4rem; color: var(--fg-muted); }
.st-call { margin: .5rem 0 0; font-size: 1.9rem; }
.st-call b { color: var(--red); }
.st-call.is-champion b { color: var(--green); }
.st-call.is-wait { color: var(--fg-muted); }
.bracket.is-tv { flex: 1; overflow: hidden; gap: 1.4rem; }
.bracket.is-tv .bracket-round { min-width: 0; }
.bracket.is-tv .bracket-round h3 { font-size: 1.05rem; }
.bracket.is-tv .bm-p { font-size: 1.35rem; padding: .45rem .8rem; }
.bracket.is-tv .bm-n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bracket.is-tv .bm small { font-size: 1rem; }
.bracket.is-tv.is-large .bm-p { font-size: 1rem; padding: .2rem .6rem; }
