/* Flip7 Scoreboard — "retro-playful" teal/coral/gold design system.
   Adapted from flip7-card-game-DESIGN.md (rpx → px, ÷2).
   Sizing in rem (base 16px); px values rounded to even before conversion.
   Borders, box-shadows, letter-spacing and animation transforms stay in px. */

/* Design tokens (palette, spacing, radius, elevation, interaction + dark theme)
   live in their own file — must stay the first rule so @import is valid. */
@import url("variables.css?v=1");
/* Thèmes de saison (couleurs uniquement), juste après les tokens qu'ils redéfinissent. */
@import url("seasons.css?v=1");

/* Texte réservé aux lecteurs d'écran (régions d'annonce). */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
/* Focus clavier visible partout (navigation au Tab, clavier Bluetooth…) ;
   rien au clic/tap grâce à :focus-visible. */
:focus-visible {
  outline: 2px solid var(--teal-ink);
  outline-offset: 2px;
}
html.theme-dark :focus-visible {
  outline-color: var(--teal-light);
}

/* Twemoji country-flag glyphs. Many platforms (notably Windows) don't render
   the regional-indicator flag emoji used in the language picker. This face
   supplies them; the unicode-range restricts it to flag codepoints, so it only
   ever overrides those glyphs and every other character falls through to the
   next font. Named "emoji" and prepended (first) to the universal font stack
   below, so flag codepoints resolve to it before any system emoji font. */
@font-face {
  font-family: "emoji";
  src: url("fonts/TwemojiCountryFlags.woff2?v=1") format("woff2");
  font-display: swap;
  unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067,
    U+E006C, U+E006E, U+E0073-E0074, U+E0077, U+E007F;
}

* {
  box-sizing: border-box;
}

/* Strip the browser's default margins (on <p>, headings, lists, etc.). Spacing
   comes from explicit rules and flex gap — never from UA defaults. Any author
   rule with a margin still wins over this (higher specificity). */
* {
  margin: 0;
}

/* Fond SOLIDE sur <html> : c'est lui qui est propagé au "canvas" et remplit les
   bandes de safe-area (encoche, indicateur d'accueil) en PWA standalone. Sans ça,
   iOS y laisse apparaître le background_color crème du manifest → bande « blanche »
   en bas. Le dégradé, lui, est porté par une couche fixe (body::before).
   <body> reste sans fond (transparent) pour ne pas recouvrir cette couche. */
html {
  background: var(--surface);
}
/* Quand un dialog est ouvert, son voile (.overlay) ne couvre pas la bande
   safe-area du bas (cf. NB iOS sur body). Le fond de <html> y apparaît : on le
   peint de la couleur du voile assombri (≈ rgba(var(--scrim-rgb), .45) sur --surface) pour
   que la bande se fonde dans le voile. Variante sombre plus bas. */
html:has(.overlay) {
  background: var(--overlay-floor); /* clair / sombre / saison : variables.css */
}
/* Idem pour le splash (#launch-screen) : son fond crème ne couvre pas la bande
   safe-area du bas → on peint le fond de <html> du même crème. Dupliqué ici (et pas
   seulement dans le <style> inline d'index.html) car styles.css est le seul fichier
   rechargé sans cache (?t=) : ça marche même si l'index.html PWA reste en cache. */
html:has(#launch-screen) {
  background: #fff8e7;
}
html.theme-dark:has(#launch-screen) {
  background: #0f1f1d;
}
html,
body {
  margin: 0;
  padding: 0;
  color: var(--text);
  min-height: 100dvh;
  touch-action: manipulation; /* no double-tap zoom */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Pas de sélection de texte sur l'app : un glissé (notamment la loupe du mode
     cible sur mobile) ne déclenche plus de sélection qui ferait « dériver » le
     geste. -webkit-touch-callout coupe aussi le menu long-press iOS. */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
/* Exception : les champs de saisie restent éditables et sélectionnables. */
input,
textarea,
[contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
}

* {
  font-family:
    "emoji", -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Microsoft YaHei", "Segoe UI", system-ui, Roboto, Helvetica, Arial,
    sans-serif;
}
/* Scroll de DOCUMENT (la page entière scrolle) + topbar en position:sticky : sur
   iOS c'est plus robuste qu'un conteneur scrollable interne (qui souffre du bug du
   padding-bottom ignoré et clippe les fixed). Le scroll document respecte le
   padding bas et les safe-areas. La barre du bas (indicateur d'accueil) reste
   peinte par le fond de <html>, neutralisé selon la couche affichée — voir
   html:has(#launch-screen) et html:has(.overlay). */
/* Le dégradé de page sur une couche FIXE qui couvre tout l'écran (inset:0 fixed,
   comme .overlay) — donc jusqu'au bord physique, safe-areas comprises, quelle que
   soit la hauteur du contenu ou la valeur de 100dvh sur iOS. z-index:-1 → derrière
   le contenu (body sans fond) mais devant le fond solide de <html>. Suit le thème
   via les variables. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(
    900px 500px at 85% -8%,
    var(--teal-bg) 0%,
    var(--surface) 60%
  );
}

/* ---------- topbar / wordmark ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 1rem 0.5rem;
  /* In a PWA (viewport-fit=cover + translucent status bar), the bar starts at
     the very top of the screen, behind the notch / status bar. Pad by the safe
     areas so the logo + buttons clear it; env() is 0 where there's no inset. */
  padding:
    calc(0.875rem + env(safe-area-inset-top))
    calc(1.5rem + env(safe-area-inset-right))
    0.875rem
    calc(1.5rem + env(safe-area-inset-left));
  border-bottom: 3px dashed rgba(var(--teal-rgb), 0.3);
  background: var(--topbar-bg);
  backdrop-filter: blur(6px);
  /* Lift the bar (and its theme dropdown, which overflows below it) above the
     page content, but keep it under modals (.overlay = 20) and toasts (30). */
  z-index: 10;
  /* Sticky : la barre reste collée en haut pendant que la page scrolle dessous.
     Avec viewport-fit=cover, top:0 = bord haut de l'écran (derrière la status bar) ;
     le padding-top en safe-area (plus bas) garde le contenu sous l'encoche. */
  position: sticky;
  top: 0;
}
/* Barre d'activité réseau (cf. app.js) : un trait animé tout en haut de
   l'écran (sous l'encoche), tant qu'une action attend le serveur. Fixe et
   au-dessus des dialogs (.overlay = 20) : renommer un lieu, changer son code ou
   écrire au support se font depuis une dialog. Sous les toasts (30). */
.net-activity {
  position: fixed;
  top: env(safe-area-inset-top, 0px);
  left: 0;
  right: 0;
  height: 3px;
  overflow: hidden;
  pointer-events: none;
  z-index: 25;
}
.net-activity[hidden] {
  display: none;
}
.net-activity::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 35%;
  border-radius: 3px;
  background: var(--teal);
  animation: net-activity 1.1s ease-in-out infinite;
}
@keyframes net-activity {
  from {
    left: -35%;
  }
  to {
    left: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .net-activity::before {
    left: 0;
    width: 100%;
    animation: net-activity-pulse 1.4s ease-in-out infinite;
  }
  @keyframes net-activity-pulse {
    50% {
      opacity: 0.35;
    }
  }
}
/* brand logo in the bar */
.logo {
  display: inline-flex;
  align-items: center;
  margin: 0;
  cursor: pointer;
  transition: transform 0.15s var(--bounce);
}
.logo:hover {
  transform: scale(1.04);
}
.logo img {
  height: 2.25rem;
  width: auto;
  display: block;
}
.topbar-btn {
  appearance: none;
  cursor: pointer;
  height: 2.25rem;
  border: 2px solid var(--teal-light);
  background: var(--cream);
  color: var(--teal-dark);
  font-size: var(--fs-md);
  border-radius: var(--r-round);
  padding: 0.5rem 0.75rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-tab);
    display: flex;
    align-items: center;
    justify-content: center;
}
.topbar-btn:hover {
  filter: var(--hover-bright);
}
.topbar-btn:active {
  transform: var(--press-scale);
}
/* Pastille « mise à jour disponible » sur l'engrenage (cf. watchForUpdate). */
#settingsBtn {
  position: relative;
}
#settingsBtn.has-update::after {
  content: "";
  position: absolute;
  top: -0.125rem;
  right: -0.125rem;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 2px var(--surface);
}

main {
  max-width: 64rem;
  width: 100%;
  margin: 0 auto;
  /* Scroll de document : le padding-bottom EST respecté ici. Il porte le gap du bas
     + la safe-area (indicateur d'accueil) ; ailleurs env() vaut 0 → simple gap. */
  padding: 1.75rem 0 max(1.75rem, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}
/* spacing owned by main's direct children: horizontal gutter + half-gap top/bottom */
main > * {
  padding-left: 1rem;
  padding-right: 1rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  width: 100%;
}

/* The hero brand logo keeps its own top padding; out of the first-child reset. */
main > *:first-child:not(.brand-logo) {
  padding-top: 0;
}

main > *:last-child {
  padding-bottom: 0;
}

h2 {
  margin: 0 0 1rem;
  font-size: var(--fs-2xl);
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--teal-dark);
}
h3 {
  margin: 0 0 0.75rem;
  font-size: var(--fs-lg);
  font-weight: 800;
  color: var(--teal-dark);
  display: inline-flex;
  align-items: center;
  gap: 1rem 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px dashed rgba(var(--teal-rgb), 0.3);
}

/* ---------- brand logo (hero / setup) ---------- */
.brand-logo {
  display: flex;
  justify-content: center;
  user-select: none;
}
.brand-logo img {
  width: min(18rem, 62vw);
  height: auto;
}

/* ---------- buttons ---------- */
.btn {
  appearance: none;
  border: none;
  border-radius: var(--r-round);
  min-height: 2.75rem;
  padding: 0.75rem 1.375rem;
  font-size: var(--fs-md);
  font-weight: 800;
  letter-spacing: 0.3px;
  cursor: pointer;
  color: #fff;
  background: var(--teal);
  box-shadow: var(--shadow-teal-glow);
  transition:
    transform 0.12s var(--bounce),
    filter 0.15s ease,
    box-shadow 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem 0.5rem;
}
/* `.btn`'s display:flex would otherwise override the UA [hidden] rule, leaving
   buttons toggled via the `hidden` attribute (e.g. the setup stepper's back /
   next / start) visible. This makes `hidden` authoritative again. */
.btn[hidden] {
  display: none;
}
.btn:hover {
  filter: brightness(1.05);
}
.btn:active {
  transform: scale(0.95);
}

.btn-primary {
  background: var(--gold);
  color: var(--ink);
  box-shadow: var(--shadow-accent-glow);
}

.btn-ghost {
  background: var(--card);
  color: var(--teal-dark);
  border: 2px solid var(--teal-light);
  box-shadow: var(--shadow-sm);
}
.btn-danger {
  background: var(--card);
  color: var(--coral-dark);
  border: 2px solid var(--coral-light);
  box-shadow: var(--shadow-sm);
}
.btn-danger:hover {
  background: var(--coral);
  color: #fff;
  border-color: var(--coral);
}

.btn-sm {
  height: 2.25rem;
  min-height: 0;
  padding: 0.5rem 0.875rem;
  font-size: var(--fs-sm);
}
/* back button: plain text + arrow, no border/background */
.back-btn {
  appearance: none;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--teal-dark);
  font-weight: 700;
  font-size: var(--fs-md);
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.back-btn:hover {
  color: var(--teal);
}

/* Cibles tactiles ≥ 44 px (WCAG 2.5.5) sans toucher au dessin : une zone de
   toucher invisible, centrée, déborde autour des petits contrôles. */
:is(.back-btn, .modal-close, .topbar-btn, .link-btn, .segmented button, .nav-tab, .entry-player .btn-sm, .btn-icon) {
  position: relative;
}
:is(.back-btn, .modal-close, .topbar-btn, .link-btn, .segmented button, .nav-tab, .entry-player .btn-sm, .btn-icon)::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: max(100%, 2.75rem);
  height: max(100%, 2.75rem);
  transform: translate(-50%, -50%);
}
.back-btn:active {
  transform: var(--press-scale);
}
.btn-icon {
  height: 2.25rem;
  min-height: 0;
  padding: 0.5rem 0.75rem;
  line-height: 1;
}
/* Icon-only button that keeps the full height of regular buttons (footer back). */
.btn-icon-lg {
  width: 2.75rem;
  min-width: 2.75rem;
  padding-inline: 0;
  line-height: 1;
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.row {
  display: flex;
  gap: 1rem 0.5rem;
  align-items: center;
}
.row.wrap {
  flex-wrap: wrap;
}
.muted {
  color: var(--muted);
}
/* Secondary line under a name (e.g. a team's players under its name). */
.name-sub {
  font-size: var(--fs-xs);
  font-weight: 500;
  margin-top: 0.125rem;
  line-height: 1.2;
  white-space: normal;
}

/* ---------- inputs (cream surfaces) ---------- */
input[type="text"],
input[type="number"] {
  background: var(--cream);
  border: 2px solid rgba(35, 48, 56, 0.18);
  color: var(--text);
  border-radius: var(--r-md);
  padding: 0.75rem 0.875rem;
  font-size: var(--fs-md);
  font-weight: 600;
  outline: none;
  width: 100%;
}
input:focus {
  border-color: var(--teal);
  box-shadow: var(--shadow-focus);
}

/* ---------- Home ---------- */
.hero {
  background: var(--card);
  border-radius: var(--r-xl);
  padding: 1.875rem 1.75rem;
  box-shadow: var(--shadow-card);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.hero h2 {
  margin: 0;
  margin-top: -0.25rem; /* tuck the tagline under the logo */
}
.hero p {
  color: var(--muted);
  line-height: 1.55;
  max-width: 32.5rem;
  font-weight: 500;
}
/* feature pills (live sync, multi-device, stats) */
.hero-features {
  list-style: none;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}
.hero-features li {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border-radius: var(--r-round);
  background: var(--teal-bg);
  color: var(--teal-dark);
  font-weight: 700;
  font-size: var(--fs-sm);
  white-space: nowrap;
}
.hero-features li i {
  font-size: var(--fs-sm);
  opacity: 0.85;
}
/* feature badges shown under the logo */
.hero-features-below {
  margin: 0 auto;
}
/* supported-games line under the CTA */
.hero-games {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  font-size: var(--fs-xs);
  letter-spacing: 0.02em;
  /* Games are chunked into rows of 4 (one .hero-games-row each); a light gap
     separates the lines. */
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
/* Stack the panel's sections with a single uniform gap (no per-element
   margins). */
.place-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
/* intro (tagline + feature pills + games) above the place form */
.place-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.875rem;
}
.place-intro h2 {
  margin: 0;
}
.place-panel .place-hint {
  margin: 0.5rem 0 0;
}
/* Quick-access chips for already-visited places, under the field. */
.place-recents-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.place-recents-label {
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: 700;
}
/* "Gérer" toggle: a quiet text button until active, then it turns coral to
   signal the chips are now in remove-mode. */
.place-recents-manage {
  appearance: none;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0.25rem 0.375rem;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--teal-dark);
}
.place-recents-manage.is-active {
  color: var(--coral-dark);
}
.place-recents-manage i {
  font-size: var(--fs-xs);
  margin-right: 0.125rem;
}
/* A visited chip in remove-mode: coral outline + the × icon, so a tap clearly
   deletes it rather than opening it. */
.quick-player-chip.is-removing {
  border-color: var(--coral);
  background: rgba(239, 108, 74, 0.1);
  color: var(--coral-dark);
}

/* Entry screen notices (link to a protected place, migration waiting for the
   network): a quiet teal-tinted strip above the form. */
.place-notice {
  margin: 0;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.625rem 0.75rem;
  border-radius: var(--r-md);
  background: var(--teal-bg);
  color: var(--teal-ink);
  font-size: var(--fs-sm);
  font-weight: 700;
}
.place-notice i {
  margin-top: 0.15rem;
}
/* Access-code field: wide, spaced capitals so "ABCD-EFGH" reads at a glance. */
.place-code-input {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 800;
  text-align: center;
}
.place-code-input::placeholder {
  letter-spacing: 0.18em;
  font-weight: 700;
}
.place-panel .place-legacy-toggle {
  font-size: var(--fs-sm);
  font-weight: 700;
  padding: 0.5rem 0 0;
  text-align: left;
}

/* Home: an older place still open (no access code) invites to secure it — a
   full-width strip right under the top bar, content aligned on <main>. */
.secure-banner {
  background: rgba(var(--gold-rgb), 0.16);
  border-bottom: 2px solid rgba(var(--gold-rgb), 0.55);
  padding: 0.625rem calc(1rem + env(safe-area-inset-right)) 0.625rem
    calc(1rem + env(safe-area-inset-left));
}
.secure-banner-inner {
  max-width: 62rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.secure-banner-icon {
  flex-shrink: 0;
  font-size: var(--fs-lg);
  color: var(--gold-dark);
}
.secure-banner-text {
  flex: 1;
  min-width: 0;
}
.secure-banner-title {
  margin: 0;
  font-weight: 800;
  font-size: var(--fs-md);
}
.secure-banner-body {
  margin: 0.125rem 0 0;
  font-size: var(--fs-sm);
  color: var(--muted);
}
.secure-banner .btn {
  flex-shrink: 0;
}

/* Place settings: name field + rename button on one line; "switch place"
   spans the dialog at the bottom. */
.place-rename {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.place-rename input {
  flex: 1;
  min-width: 0;
}
.place-rename input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
/* Même corps que les descriptions des cartes d'option (.setup-opt-desc). */
.modal .place-rename-hint {
  margin: 0.5rem 0 0;
  font-weight: 400;
}

/* Access code: one card (the code + copy / share icon buttons), then the
   rarer actions as small links on one line. */
.access-intro {
  margin: 0 0 1rem;
}
.access-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.5rem 0.5rem 1rem;
  border: 2px solid var(--teal-light);
  border-radius: var(--r-md);
  background: var(--card);
}
.access-code {
  flex: 1;
  min-width: 0;
  font-size: var(--fs-xl);
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--teal-ink);
  font-variant-numeric: tabular-nums;
  user-select: all;
}
.access-admin {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 1.25rem;
  margin-top: 0.375rem;
  font-size: var(--fs-sm);
  color: var(--muted);
}
.access-admin .access-admin-link {
  font-size: var(--fs-sm);
  font-weight: 700;
  padding: 0.5rem 0;
}
.access-admin .access-danger {
  color: var(--coral-dark);
}
/* QR d'invitation, sous la carte du code : toujours sombre sur blanc (les
   lecteurs lisent mal un QR inversé), y compris en thème sombre. */
.access-qr {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.75rem;
}
.access-qr .qr-svg {
  flex: none;
  width: 132px;
  height: 132px;
  padding: 6px;
  border-radius: var(--r-md);
  background: #fff;
  border: 2px solid var(--teal-light);
}
.modal .access-qr-hint {
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: 400;
}

/* QR agrandi (tap sur le QR du bloc code) : plein cadre, à scanner de loin. */
.access-qr-zoom {
  flex: none;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  border-radius: var(--r-md);
}
.modal-qr-zoom {
  text-align: center;
  cursor: zoom-out;
}
.modal-qr-zoom .qr-svg {
  display: block;
  width: min(100%, 420px);
  height: auto;
  aspect-ratio: 1;
  margin: 1rem auto 0;
  padding: 10px;
  border-radius: var(--r-md);
  background: #fff;
}
.modal-qr-zoom .access-code {
  display: block;
  margin-top: 0.75rem;
}

/* Scanner de QR : bouton icône DANS le champ du code (écran Rejoindre), avec
   un retrait symétrique pour garder le code centré. */
.place-input-wrap {
  position: relative;
}
/* Bloc : un champ inline laisserait sous lui l'espace des descendantes, et le
   conteneur (référence du bouton) serait plus haut que le champ. */
.place-input-wrap > input {
  display: block;
  width: 100%;
}
.place-input-wrap.has-scan input {
  padding-inline: 3.25rem;
}
.place-scan-btn {
  /* Même retrait en haut, en bas et à droite : le bouton prend la hauteur du
     champ moins ce retrait, et reste carré. */
  position: absolute;
  top: 0.375rem;
  right: 0.375rem;
  height: calc(100% - 0.75rem);
  aspect-ratio: 1;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--r-sm, 8px);
  background: transparent;
  color: var(--teal-ink);
  font-size: 1.25rem;
  cursor: pointer;
}
.place-scan-btn:hover,
.place-scan-btn:focus-visible {
  background: rgba(var(--teal-rgb), 0.12);
}
html.theme-dark .place-scan-btn {
  color: var(--teal-light);
}
.modal-qr-scan .qr-scan-view {
  margin-top: 1rem;
}
.qr-scan-view {
  position: relative;
  aspect-ratio: 1;
  width: 100%;
  border-radius: var(--r-md);
  overflow: hidden;
  background: #000;
}
.qr-scan-view video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.qr-scan-view.is-off video {
  visibility: hidden;
}
.qr-scan-frame {
  position: absolute;
  inset: 18%;
  border: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--r-md);
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.qr-scan-view.is-off .qr-scan-frame {
  display: none;
}
.modal .qr-scan-status {
  margin: 0.75rem 0 0;
  text-align: center;
  font-weight: 400;
}
.modal .qr-scan-status.is-warn {
  color: var(--coral-dark);
  font-weight: 700;
}
html.theme-dark .modal .qr-scan-status.is-warn {
  color: var(--coral-light);
}
html.theme-dark :is(.place-notice, .access-code) {
  color: var(--teal-light);
}
html.theme-dark .access-admin .access-danger {
  color: var(--coral-light);
}

/* current-place button (top-left of the header) */
/* Additive modifier on .topbar-btn (the two classes are always paired): the
   base look — border, background, height, padding, hover/active — comes from
   .topbar-btn; .place-btn only sets the label's text params (bold, 0.875rem)
   plus the truncation/gap the label needs. */
.place-btn {
  font-weight: 800;
  font-size: var(--fs-sm);
  max-width: 42vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  gap: 0.5rem;
}
/* .topbar-btn sets display:flex, which would override the native [hidden], so
   the button must be hidden explicitly. */
.place-btn[hidden] {
  display: none;
}
.place-btn-chevron {
  font-size: var(--fs-2xs);
  transition: transform 0.15s ease;
}
.place-btn[aria-expanded="true"] .place-btn-chevron {
  transform: rotate(180deg);
}
/* Menu du lieu, sous le bouton (right posé par app.js) : mêmes bases que le
   menu « … » des parties. */
.place-menu {
  top: calc(100% - 0.25rem);
  min-width: 15rem;
  max-width: min(20rem, calc(100vw - 2rem));
}
.place-menu-label {
  margin: 0.25rem 0.75rem 0.25rem;
  font-size: var(--fs-2xs);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.place-menu .place-menu-item {
  min-height: 2.75rem;
  color: var(--text);
  font-weight: 600;
}
.place-menu .place-menu-item.is-current {
  background: var(--teal-bg);
  font-weight: 800;
}
.place-menu-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.place-menu-open {
  flex-shrink: 0;
  font-size: var(--fs-2xs);
  font-weight: 800;
  color: var(--gold-dark);
  background: rgba(var(--gold-rgb), 0.16);
  border-radius: var(--r-round);
  padding: 0.125rem 0.5rem;
}
.place-menu-check {
  color: var(--teal-dark);
}
.place-menu-sep {
  height: 1px;
  margin: 0.375rem 0;
  background: var(--teal-bg);
}
.place-menu-settings {
  margin: 0.375rem 0.25rem 0.25rem;
  justify-content: center;
}
/* Très étroit : on n'affiche plus que l'icône dans le bouton localisation. */
@media (max-width: 390px) {
  .place-btn {
    max-width: none;
    gap: 0;
    padding: 0.5rem;
    aspect-ratio: 1;
  }
  .place-btn-label,
  .place-btn-chevron {
    display: none;
  }
}

/* Indicateur « Hors ligne » (header, à côté du logo). PAS un bouton : on retire
   le cadre / fond / ombre hérités de .topbar-btn pour ne garder qu'une icône
   ambre qui signale l'état. Reste cliquable (ouvre la dialog explicative), et
   caché par défaut (.topbar-btn force display:flex → [hidden] explicite). */
.topbar-btn-offline {
  border: none;
  background: none;
  box-shadow: none;
  height: auto;
  aspect-ratio: auto;
  padding: 0.25rem;
  color: var(--coral);
  font-size: var(--fs-lg);
  line-height: 1;
  cursor: pointer;
}
/* Pas d'effet « bouton » au survol / à l'appui. */
.topbar-btn-offline:hover {
  filter: none;
}
.topbar-btn-offline:active {
  transform: none;
}
.topbar-btn-offline[hidden] {
  display: none;
}
/* Léger battement : signale un état actif (pas une icône décorative). */
.topbar-btn-offline i {
  animation: offline-blink 2.2s ease-in-out infinite;
}
@keyframes offline-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.65;
  }
}
/* Respecte la réduction des animations (préférence OS + réglage in-app). */
@media (prefers-reduced-motion: reduce) {
  .topbar-btn-offline i {
    animation: none;
  }
}
html.reduce-motion .topbar-btn-offline i {
  animation: none;
}

.game-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr); /* let cards shrink instead of widening the grid */
  gap: 1rem 0.5rem;
}
/* Per-day heading inserted between cards (see renderHome). uppercase renders
   the locale string ("lundi 10 juin") as "LUNDI 10 JUIN". */
.day-separator {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  font-weight: 800;
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--teal-dark);
  padding-bottom: 0.375rem;
  margin-top: 0.5rem;
  border-bottom: 2px solid rgba(var(--teal-rgb), 0.2);
}
/* Game count for the day, shown opposite the heading. */
.day-separator .day-count {
  flex: 0 0 auto;
  font-size: var(--fs-xs);
  letter-spacing: 0.02em;
  color: var(--muted);
}
.day-separator:first-child {
  margin-top: 0; /* no gap above the very first day */
}
/* « Voir plus » — pied de la liste rendue par tranches (gros historiques). */
.load-more {
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  justify-content: center;
}
.game-card {
  display: flex;
  align-items: center;
  gap: 1rem 0.5rem;
  background: var(--card);
  border-radius: var(--r-lg);
  border-left: 6px solid var(--teal-light);
  padding: 1rem 1.125rem;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition:
    transform 0.12s var(--bounce),
    box-shadow 0.15s ease;
}
.game-card.done {
  border-left-color: var(--success);
}
.game-card.ongoing {
  border-left-color: var(--gold);
}
.game-card.cancelled {
  border-left-color: var(--error);
}
.game-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-teal-glow);
}
.game-card .meta {
  flex: 1;
  min-width: 0;
}
.game-card .name {
  display: flex;
  align-items: center;
  gap: 1rem 0.5rem;
  min-width: 0;
  font-weight: 800;
  font-size: var(--fs-lg);
  color: var(--teal-dark);
}
.game-card .name-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.game-card .name .badge {
  flex-shrink: 0;
}
.game-card .sub {
  color: var(--muted);
  font-size: var(--fs-sm);
  margin-top: 0.25rem;
  font-weight: 500;
}
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1rem 0.5rem;
  font-size: var(--fs-sm);
  font-weight: 800;
  padding: 0.375rem 0.75rem;
  border-radius: var(--r-round);
  background: var(--teal-bg);
  color: var(--teal-dark);
  white-space: nowrap;
}
.badge.rank1 {
  background: linear-gradient(135deg, #e3c077, #b3843f);
  color: #fff;
}
.badge.rank2 {
  background: linear-gradient(135deg, #bdc0c5, #8a8f92);
  color: #fff;
}
.badge.rank3 {
  background: linear-gradient(135deg, #e3ab82, #b36b4b);
  color: #fff;
}
.badge.ongoing {
  background: var(--gold);
  color: var(--ink);
}
.badge.cancelled {
  background: var(--error);
  color: #fff;
}
.status-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.status-cell .round-note {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--muted);
}
.badge.badge-sm {
  font-size: var(--fs-xs);
  padding: 0.125rem 0.5rem;
  vertical-align: middle;
}
/* Variant markers after the mode badge on a game card: the darts starting score
   (301/501) as a soft neutral pill, and Vengeance's "Brutal" option in coral so
   it reads as the intense variant it is. */
.badge.badge-variant {
  background: var(--teal-bg);
  color: var(--teal-dark);
}
.badge.badge-brutal {
  background: var(--coral);
  color: #fff;
}
/* Marqueur « non synchronisé » sur une carte de partie (saisie hors-ligne en
   attente d'envoi). Ambre, cohérent avec l'icône hors-ligne du header. */
.badge.badge-unsynced {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: var(--ink);
}
/* small "beta" marker next to a mode label (mode tabs + game cards). Aligned by
   the flex parent (.mode-tab / .game-card .name), so no vertical-align/margin. */
.mode-beta {
  font-size: var(--fs-3xs);
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1;
  padding: 0.125rem 0.375rem;
  border-radius: var(--r-round);
  background: var(--gold);
  color: var(--ink);
}
/* Clickable variant (game headers): opens the beta-info dialog. */
button.mode-beta {
  appearance: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.12s var(--bounce);
}
button.mode-beta:hover {
  transform: scale(1.08);
}

.empty {
  text-align: center;
  color: var(--muted);
  font-weight: 600;
  padding: 2rem;
  border: 3px dashed rgba(var(--teal-rgb), 0.3);
  border-radius: var(--r-lg);
}

/* ---------- Setup ---------- */
.panel {
  background: var(--card);
  border-radius: var(--r-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
}
.field label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--teal-dark);
  font-size: var(--fs-sm);
  font-weight: 700;
}
/* the "Joueurs" label and its count, vertically aligned together (left) */
#playersLabel {
  display: flex;
  align-items: center;
}
/* live count of named players next to the "Joueurs" label */
.players-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.375rem;
  height: 1.375rem;
  padding: 0 0.375rem;
  margin-left: 0.375rem;
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: 800;
  vertical-align: middle;
}

/* Quick-pick bar: registered players for this place, one tap to add a row.
   Chips stay on one horizontally-scrollable row under the label. */
.quick-players-scroll {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.375rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.15rem; /* room so chip shadows aren't clipped while scrolling */
}
.quick-player-chip {
  appearance: none;
  cursor: pointer;
  flex: 0 0 auto; /* don't shrink; let the row scroll instead */
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border: 2px solid var(--teal-light);
  background: var(--teal-bg);
  color: var(--teal-dark);
  font-weight: 700;
  font-size: var(--fs-sm);
  border-radius: var(--r-round);
  padding: 0.375rem 0.75rem;
  transition: var(--transition-tab);
}
.quick-player-chip:hover {
  filter: brightness(1.03);
}
.quick-player-chip:active {
  transform: var(--press-scale);
}
.quick-player-chip i {
  font-size: var(--fs-xs);
  opacity: 0.8;
}
/* Setup — étape Joueurs : grille de pastilles (toggle) des joueurs connus.
   Même famille visuelle que les quick-player-chips, mais en grille qui wrappe
   et avec un état sélectionné plein. */
.player-select-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.player-select-chip {
  appearance: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border: 2px solid var(--teal-light);
  background: var(--teal-bg);
  color: var(--teal-dark);
  font-weight: 700;
  font-size: var(--fs-md);
  border-radius: var(--r-round);
  padding: 0.5rem 0.875rem;
  transition: var(--transition-tab);
}
.player-select-chip i {
  font-size: var(--fs-xs);
  opacity: 0.8;
}
.player-select-chip:hover {
  filter: brightness(1.03);
}
.player-select-chip:active {
  transform: var(--press-scale);
}
.player-select-chip.selected {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}
.player-select-chip.selected i {
  opacity: 1;
}
/* le bouton « Nouveau joueur » : une pastille en pointillés */
.player-select-chip.is-new {
  border-style: dashed;
  background: transparent;
}
/* formulaire d'ajout d'un nouveau joueur (input + valider) */
.player-select-new {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.player-select-new input {
  flex: 1;
  min-width: 0;
}
.psel-empty {
  margin: 0 0 0.75rem;
  font-size: var(--fs-sm);
}
/* Setup — étape Placement : hint sous le label, liste d'ordre numérotée. */
.place-hint {
  margin: -0.25rem 0 0.75rem;
  font-size: var(--fs-sm);
}
/* nom figé présenté comme un champ de la liste de base (fond crème) */
.player-order-name {
  flex: 1;
  min-width: 0;
  background: var(--cream);
  border: 2px solid rgba(35, 48, 56, 0.18);
  border-radius: var(--r-md);
  padding: 0.75rem 0.875rem;
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Time's Up! team builder: cards holding a team name + draggable players. */
.team-card {
  border: 2px solid var(--teal-light);
  border-radius: var(--r-lg);
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  background: var(--teal-bg);
  transition: border-color 0.15s ease;
}
.team-head {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.625rem;
}
.team-head .team-name {
  flex: 1;
  font-weight: 800;
  font-size: var(--fs-md);
  color: var(--teal-dark);
}
/* Nom d'équipe cliquable : le nom + un petit chevron collé, ouvre le menu. */
.team-name-btn {
  appearance: none;
  border: none;
  background: none;
  padding: 0;
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  text-align: left;
}
.team-name-btn .team-name {
  flex: 0 1 auto; /* le chevron colle au texte (pas repoussé à droite) */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.team-name-btn > i {
  flex: 0 0 auto;
  font-size: var(--fs-sm);
  color: var(--teal-dark);
  opacity: 0.7;
}
/* Dropdown de choix du nom d'équipe : PORTAIL fixé au viewport (monté dans
   <body>, position/taille posées en inline par le JS) — il échappe au clipping
   et au scroll de la popup ; noms déjà pris désactivés. */
.team-name-menu {
  position: fixed;
  z-index: 60; /* au-dessus du dialog (20) et des toasts (30) */
  background: var(--card);
  border: 2px solid var(--teal-light);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
  max-height: 13.5rem;
}
.team-name-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  appearance: none;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  color: var(--teal-dark);
  padding: 0.625rem 0.875rem;
}
.team-name-item:hover:not(:disabled),
.team-name-item.is-current {
  background: var(--teal-bg);
}
.team-name-item:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}
.team-name-item i {
  font-size: var(--fs-xs);
}
.team-members {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.625rem;
}
.team-member {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}
.team-member .name-field {
  flex: 1;
}
.team-member .drag-handle,
.team-member > .btn-icon {
  margin-top: 0.5rem; /* align with the input, not its suggestion dropdown */
}
.team-member .drag-handle {
  cursor: grab;
  color: var(--muted);
  touch-action: none;
  padding: 0 0.125rem;
}
.team-member .drag-handle:active {
  cursor: grabbing;
}
.team-member.dragging {
  opacity: 0.55;
  outline: 2px dashed var(--teal-light);
  outline-offset: 2px;
  border-radius: var(--r-md);
}
/* Placement (setup) : membres figés — texte au lieu d'un input, ligne centrée */
.team-member.is-static {
  align-items: center;
}
.team-member.is-static .drag-handle,
.team-member.is-static > .btn-icon {
  margin-top: 0;
}
.team-member-name {
  flex: 1;
  min-width: 0;
  padding: 0.375rem 0;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* équipe vidée par les drags : une zone de dépôt reste visible */
.team-members:empty {
  min-height: 2.5rem;
  border: 2px dashed var(--teal-light);
  border-radius: var(--r-md);
}
/* Insertion line showing where the dragged player will land. */
.drop-indicator {
  height: 4px;
  background: var(--teal);
  border-radius: 2px;
  box-shadow: var(--shadow-teal-glow);
}
/* Contrée: full-width score-target input (ID beats .cell-input width) */
#targetInput.cell-input {
  width: 100%;
}
/* Contrée: live "team A / team B" preview under the roster */
.teams-hint {
  margin: 0.25rem 0 0;
  padding: 0.625rem 0.75rem;
  background: var(--teal-bg);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: var(--fs-xs);
  line-height: 1.4;
}
/* Setup option toggle (e.g. Yam's Chance): a switch-style row button. */
.setup-opt {
  appearance: none;
  cursor: pointer;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-align: left;
  border: 2px solid var(--teal-light);
  background: var(--card);
  border-radius: var(--r-md);
  padding: 0.625rem 0.75rem;
  box-shadow: var(--shadow-sm);
  transition: filter 0.15s ease;
}
.setup-opt:hover {
  filter: var(--hover-bright);
}
.setup-opt-name {
  font-weight: 800;
  color: var(--teal-dark);
}
.setup-opt-desc {
  font-size: var(--fs-sm);
  line-height: 1.4;
}
.setup-opt-switch {
  flex: none;
  width: 2.5rem;
  height: 1.5rem;
  border-radius: 1rem;
  background: var(--muted);
  opacity: 0.55;
  position: relative;
  transition:
    background 0.15s ease,
    opacity 0.15s ease;
}
.setup-opt-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(1.5rem - 4px);
  height: calc(1.5rem - 4px);
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s var(--bounce);
}
.setup-opt.active .setup-opt-switch {
  background: var(--teal);
  opacity: 1;
}
.setup-opt.disabled {
  cursor: not-allowed;
  opacity: 0.6;
}
.setup-opt.disabled:hover {
  filter: none;
}
.setup-opt.active .setup-opt-switch::after {
  transform: translateX(1rem);
}
.player-row {
  display: flex;
  gap: 1rem 0.5rem;
  align-items: center;
}
.name-field {
  position: relative;
}
.name-field input {
  width: 100%;
}
/* custom name autocompletion dropdown (reliable on mobile, unlike <datalist>).
   In-flow under the input so it scrolls with the dialog body and stays put when
   the mobile keyboard resizes the viewport (no position:fixed drift). */
.name-suggest {
  margin-top: 0.25rem;
  background: var(--card);
  border: 2px solid var(--teal-light);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
  max-height: 13.5rem;
}
.name-suggest-item {
  display: block;
  width: 100%;
  text-align: left;
  appearance: none;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  color: var(--teal-dark);
  padding: 0.625rem 0.875rem;
}
.name-suggest-item:hover,
.name-suggest-item:active {
  background: var(--teal-bg);
}
.player-error {
  color: var(--error);
  font-size: var(--fs-xs);
  font-weight: 700;
}
.player-row input.dup,
.player-row input.dup:focus {
  border-color: var(--error);
  box-shadow: 0 0 0 0.25rem rgba(231, 76, 60, 0.15);
}
.drag-handle {
  cursor: grab;
  font-size: var(--fs-lg);
  color: var(--muted);
  padding: 0 0.125rem;
  user-select: none;
  flex: 0 0 auto;
  touch-action: none;
  -webkit-user-select: none;
}
.drag-handle:active {
  cursor: grabbing;
}
.player-row.dragging {
  opacity: 0.4;
}
.player-row.drag-over {
  outline: 2px dashed var(--teal);
  border-radius: var(--r-md);
}

/* rules link (place screen) */
.rules-link-wrap {
  text-align: center;
}
.link-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--teal-dark);
  font-weight: 800;
  font-size: var(--fs-md);
  text-decoration: underline;
  text-underline-offset: 0.25rem;
  padding: 0.5rem;
}
.link-btn:hover {
  color: var(--teal);
}
.link-btn:disabled {
  cursor: not-allowed;
  opacity: 0.4;
  text-decoration: none;
}
.link-btn:disabled:hover {
  color: var(--teal-dark);
}

/* per-game stats: Flip 7 / eliminations summary cards */
.game-stat-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.game-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  padding: 1rem 0.75rem;
  background: var(--card);
  border: 2px solid rgba(var(--teal-rgb), 0.22);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.game-stat-card .gsc-num {
  font-size: var(--fs-3xl);
  font-weight: 900;
  line-height: 1;
  color: var(--teal-dark);
}
.game-stat-card .gsc-label {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--muted);
}
.game-stat-card.gsc-flip7 .gsc-label i {
  color: var(--gold);
}
.game-stat-card.gsc-elim .gsc-label i {
  color: var(--coral);
}
/* Fléchettes : trois cartes (Bull · Ratés · T20) sur une ligne. */
.game-stat-cards.gsc-three {
  grid-template-columns: repeat(3, 1fr);
}
.game-stat-card.gsc-bull .gsc-label i {
  color: var(--db-red);
}
.game-stat-card.gsc-miss .gsc-label i {
  color: var(--muted);
}
.game-stat-card.gsc-t20 .gsc-label i {
  color: var(--darts);
}

/* per-game stats: score-progression line chart (inline SVG, frozen Y axis) */
app-game-stats {
  display: block;
}
.game-chart {
  width: 100%;
}
/* metric switcher (Score / Flip 7 / Éliminations) above the chart.
   Doubled class: .date-filter, declared later, would force nowrap — and
   a centred row that overflows clips its first tab out of reach. */
.date-filter.chart-tabs {
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
/* Plot scrolls horizontally when the data is wider than the screen; the Y axis
   (a sibling, not inside this) stays put. min-width:0 lets the flex item shrink
   below its content so the overflow actually scrolls. */
.chart-scroll {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}
.game-chart .grid {
  stroke: rgba(var(--teal-rgb), 0.16);
  stroke-width: 1;
}
.game-chart .axis-zero {
  stroke: rgba(var(--teal-rgb), 0.4);
  stroke-width: 1.5;
}
.game-chart .chart-axis-line {
  stroke: rgba(var(--teal-rgb), 0.4);
  stroke-width: 1;
}
.game-chart .chart-tick {
  stroke: rgba(var(--teal-rgb), 0.35);
  stroke-width: 1;
}
.game-chart .chart-target {
  stroke: var(--muted);
  stroke-width: 1.5;
  stroke-dasharray: 4 3;
  opacity: 0.6;
}
.game-chart text {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.game-chart .target-label {
  font-size: 10px;
}
.game-chart .chart-line {
  fill: none;
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.game-chart .chart-line-win {
  stroke-width: 3.5;
}
.game-chart .chart-dot {
  stroke: var(--card);
  stroke-width: 1.5;
}
.game-chart .chart-series.is-hidden {
  display: none;
}
/* Legend items double as show/hide toggles for each competitor's line. */
.cl-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 700;
  font-size: var(--fs-sm);
  color: var(--text);
  appearance: none;
  font-family: inherit;
  cursor: pointer;
  background: none;
  border: 2px solid transparent;
  border-radius: var(--r-round);
  padding: 0.25rem 0.625rem;
  user-select: none;
  -webkit-user-select: none;
}
.cl-item:hover {
  border-color: rgba(var(--teal-rgb), 0.25);
}
.cl-item b {
  color: var(--teal-dark);
}
.cl-item.cl-off {
  opacity: 0.45;
}
.cl-item.cl-off .cl-name {
  text-decoration: line-through;
}
.cl-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.cl-crown {
  color: var(--gold-dark);
}

/* rules tabs */
.rules-tabs {
  display: flex;
  gap: 1rem 0.5rem;
  flex-wrap: wrap;
}
.rules-tab {
  appearance: none;
  cursor: pointer;
  border: 2px solid var(--teal-light);
  background: var(--card);
  color: var(--teal-dark);
  font-weight: 800;
  font-size: var(--fs-md);
  border-radius: var(--r-round);
  padding: 0.625rem 1.125rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-tab);
}
.rules-tab:hover {
  filter: var(--hover-bright);
}
.rules-tab:active {
  transform: var(--press-scale);
}
/* ---------- Per-game accent system ----------
   Each game key — exposed as data-tab (rules tabs), data-v (stats version
   filter), data-mode (setup mode tabs) or a .badge.mode-* class — publishes its
   accent through --accent / --accent-dark / --accent-glow (+ --accent-text for
   the rare game that needs dark text on its fill). Custom properties inherit, so
   a button's child pill reads them too. The filled surfaces below consume these
   once instead of repeating a gradient + border + glow per game. */
/* "Général" (stats overview, data-v only) has no game colour → fall back to the
   app's teal so its active pill matches the default accent instead of rendering
   blank. */
[data-v="general"] {
  --accent: var(--teal);
  --accent-dark: var(--teal-dark);
  --accent-glow: rgba(var(--teal-rgb), 0.45);
}
[data-tab="classic"], [data-v="classic"], [data-mode="classic"], .badge.mode-classic {
  --accent: var(--classic);
  --accent-dark: var(--classic-dark);
  --accent-glow: var(--classic-glow);
}
[data-tab="vengeance"], [data-v="vengeance"], [data-mode="vengeance"], .badge.mode-vengeance {
  --accent: var(--vengeance);
  --accent-dark: var(--vengeance-dark);
  --accent-glow: var(--vengeance-glow);
}
[data-tab="skyjo"], [data-v="skyjo"], [data-mode="skyjo"], .badge.mode-skyjo {
  --accent: var(--skyjo);
  --accent-dark: var(--skyjo-dark);
  --accent-glow: var(--skyjo-glow);
}
[data-tab="timesup"], [data-v="timesup"], [data-mode="timesup"], .badge.mode-timesup {
  --accent: var(--timesup);
  --accent-dark: var(--timesup-dark);
  --accent-glow: var(--timesup-glow);
  --accent-text: var(--ink); /* yellow fill needs dark text */
}
[data-tab="speedbac"], [data-v="speedbac"], [data-mode="speedbac"], .badge.mode-speedbac {
  --accent: var(--speedbac);
  --accent-dark: var(--speedbac-dark);
  --accent-glow: var(--speedbac-glow);
}
[data-tab="nothanks"], [data-v="nothanks"], [data-mode="nothanks"], .badge.mode-nothanks {
  --accent: var(--nothanks);
  --accent-dark: var(--nothanks-dark);
  --accent-glow: var(--nothanks-glow);
}
[data-tab="dekal"], [data-v="dekal"], [data-mode="dekal"], .badge.mode-dekal {
  --accent: var(--dekal);
  --accent-dark: var(--dekal-dark);
  --accent-glow: var(--dekal-glow);
}
[data-tab="sixquiprend"], [data-v="sixquiprend"], [data-mode="sixquiprend"], .badge.mode-sixquiprend {
  --accent: var(--sixquiprend);
  --accent-dark: var(--sixquiprend-dark);
  --accent-glow: var(--sixquiprend-glow);
}
[data-tab="ligretto"], [data-v="ligretto"], [data-mode="ligretto"], .badge.mode-ligretto {
  --accent: var(--ligretto);
  --accent-dark: var(--ligretto-dark);
  --accent-glow: var(--ligretto-glow);
}
[data-tab="qwirkle"], [data-v="qwirkle"], [data-mode="qwirkle"], .badge.mode-qwirkle {
  --accent: var(--qwirkle);
  --accent-dark: var(--qwirkle-dark);
  --accent-glow: var(--qwirkle-glow);
}
[data-tab="contree"], [data-v="contree"], [data-mode="contree"], .badge.mode-contree {
  --accent: var(--contree);
  --accent-dark: var(--contree-dark);
  --accent-glow: var(--contree-glow);
}
[data-tab="yams"], [data-v="yams"], [data-mode="yams"], .badge.mode-yams {
  --accent: var(--yams);
  --accent-dark: var(--yams-dark);
  --accent-glow: var(--yams-glow);
}
[data-tab="bombu"], [data-v="bombu"], [data-mode="bombu"], .badge.mode-bombu {
  --accent: var(--bombu);
  --accent-dark: var(--bombu-dark);
  --accent-glow: var(--bombu-glow);
}
[data-tab="darts"], [data-v="darts"], [data-mode="darts"], .badge.mode-darts,
[data-v="darts501"], [data-v="darts301"] {
  --accent: var(--darts);
  --accent-dark: var(--darts-dark);
  --accent-glow: var(--darts-glow);
}
[data-tab="petanque"], [data-v="petanque"], [data-mode="petanque"], .badge.mode-petanque {
  --accent: var(--petanque);
  --accent-dark: var(--petanque-dark);
  --accent-glow: var(--petanque-glow);
}
[data-tab="badminton"], [data-v="badminton"], [data-mode="badminton"], .badge.mode-badminton {
  --accent: var(--badminton);
  --accent-dark: var(--badminton-dark);
  --accent-glow: var(--badminton-glow);
}
[data-tab="mouton"], [data-v="mouton"], [data-mode="mouton"], .badge.mode-mouton {
  --accent: var(--mouton);
  --accent-dark: var(--mouton-dark);
  --accent-glow: var(--mouton-glow);
  --accent-text: var(--ink); /* yellow fill needs dark text */
}
[data-tab="molkky"], [data-v="molkky"], [data-mode="molkky"], .badge.mode-molkky {
  --accent: var(--molkky);
  --accent-dark: var(--molkky-dark);
  --accent-glow: var(--molkky-glow);
  --accent-text: var(--ink); /* wood-light fill needs dark text */
}
[data-tab="loupgarou"], [data-v="loupgarou"], [data-mode="loupgarou"], .badge.mode-loupgarou {
  --accent: var(--werewolf);
  --accent-dark: var(--werewolf-dark);
  --accent-glow: var(--werewolf-glow);
}
/* "Flip 7 + Vengeance" (stats only) is a blend: classic stop, vengeance border. */
[data-v="flip7"] {
  --accent: var(--classic);
  --accent-dark: var(--vengeance-dark);
  --accent-glow: var(--classic-glow);
}

/* Filled surfaces: active rules tabs, active setup mode tabs, the active stats
   version filter, and every mode badge — all painted from the accent vars. */
.rules-tab.active,
.mode-tab.active,
#versionFilter button.active,
.badge[class*="mode-"] {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: var(--accent-text, #fff);
}
/* Tabs/filter (not badges) also take the matching border and coloured glow. */
.rules-tab.active,
.mode-tab.active,
#versionFilter button.active {
  border-color: var(--accent-dark);
  box-shadow: 0 2px 12px var(--accent-glow);
}

/* top navigation tabs (Home / Stats) — filled pill for the active tab */
.nav-tab {
  appearance: none;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  font-size: var(--fs-md);
  border-radius: var(--r-round);
  padding: 0.625rem 1.125rem;
  display: inline-flex;
  align-items: center;
  gap: 1rem 0.5rem;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}
.nav-tab:hover {
  color: var(--teal-dark);
  background: var(--teal-bg);
}
.nav-tab.active {
  background: var(--teal);
  color: #fff;
  box-shadow: var(--shadow-teal-glow);
}
.nav-tab.active:hover {
  background: var(--teal-dark);
  color: #fff;
}
@media (max-width: 480px) {
  .nav-tab i {
    display: none;
  }
}

/* "new game" button shows icon only on very small screens */
@media (max-width: 440px) {
  #newGame i {
    display: none;
  }
}
@media (max-width: 400px) {
  #newGame i {
    display: inline-block;
  }
  #newGame .btn-label {
    display: none;
  }
}

/* Game-type filter button: icon only on mobile (label hidden, like the tabs). */
@media (max-width: 480px) {
  .type-filter-btn .btn-label {
    display: none;
  }
}

/* date filter on the games list (Today / This week / All) */
.date-filter {
  display: flex;
  gap: 1rem 0.5rem;
  flex-wrap: nowrap;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.date-filter::-webkit-scrollbar {
  display: none;
}
/* ---- Edge fade for horizontal scrollers ----
   js/scroll-fade.js adds .scroll-x to every horizontally-scrollable row and
   toggles .fade-start / .fade-end for the side(s) with more content off-screen.
   A CSS mask fades the content to transparent there, so it reads correctly on
   any background (light/dark) and disappears once that end is reached. */
.scroll-x {
  --scroll-fade-size: 1.75rem;
}
.scroll-x.fade-end {
  -webkit-mask-image: linear-gradient(
    to right,
    #000 calc(100% - var(--scroll-fade-size)),
    transparent
  );
  mask-image: linear-gradient(
    to right,
    #000 calc(100% - var(--scroll-fade-size)),
    transparent
  );
}
.scroll-x.fade-start {
  -webkit-mask-image: linear-gradient(
    to left,
    #000 calc(100% - var(--scroll-fade-size)),
    transparent
  );
  mask-image: linear-gradient(
    to left,
    #000 calc(100% - var(--scroll-fade-size)),
    transparent
  );
}
.scroll-x.fade-start.fade-end {
  -webkit-mask-image: linear-gradient(
    to right,
    transparent,
    #000 var(--scroll-fade-size),
    #000 calc(100% - var(--scroll-fade-size)),
    transparent
  );
  mask-image: linear-gradient(
    to right,
    transparent,
    #000 var(--scroll-fade-size),
    #000 calc(100% - var(--scroll-fade-size)),
    transparent
  );
}
.date-filter button {
  appearance: none;
  cursor: pointer;
  flex: 0 0 auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.375rem;
  border: 2px solid var(--teal-light);
  background: var(--card);
  color: var(--teal-dark);
  font-weight: 800;
  font-size: var(--fs-sm);
  border-radius: var(--r-round);
  padding: 0.5rem 0.875rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-tab);
}
.date-filter button:hover {
  filter: var(--hover-bright);
}
.date-filter button:active {
  transform: var(--press-scale);
}
.date-filter button.active {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
  box-shadow: var(--shadow-teal-glow);
}
/* Count of games matching each date filter, shown as a small pill. */
.date-filter button .filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  padding: 0 0.25rem;
  font-size: var(--fs-xs);
  line-height: 1.4;
  border-radius: var(--r-round);
  background: var(--teal);
  color: #fff;
}
.date-filter button.active .filter-count {
  background: #fff;
  color: var(--teal);
}
/* Home filter row: the scrollable date filter (left) + game-type button (right). */
.home-filters {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.home-filters .date-filter {
  flex: 1 1 auto;
  min-width: 0;
}
/* Game-type filter button — mirrors the date-filter pills, sits opposite them.
   `align-self: stretch` makes it match the height of the date-filter row (so it
   stays the same size as the pills even when icon-only / inactive). */
.type-filter-btn {
  appearance: none;
  cursor: pointer;
  flex: 0 0 auto;
  align-self: stretch;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  border: 2px solid var(--teal-light);
  background: var(--card);
  color: var(--teal-dark);
  font-weight: 800;
  font-size: var(--fs-sm);
  border-radius: var(--r-round);
  padding: 0.5rem 0.875rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-tab);
}
.type-filter-btn:hover {
  filter: var(--hover-bright);
}
.type-filter-btn:active {
  transform: var(--press-scale);
}
.type-filter-btn.active {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
  box-shadow: var(--shadow-teal-glow);
}
.type-filter-btn .filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  padding: 0 0.25rem;
  font-size: var(--fs-xs);
  line-height: 1.4;
  border-radius: var(--r-round);
  background: #fff;
  color: var(--teal);
}
/* Game-type filter dialog: a wrapping set of toggle chips. */
.modal-type-filter .type-filter-hint {
  margin: 0.5rem 0 0;
  font-size: var(--fs-sm);
}
.modal-type-filter .type-filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 1.25rem;
}
.type-chip {
  appearance: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border: 2px solid var(--teal-light);
  background: var(--card);
  color: var(--teal-dark);
  font-weight: 800;
  font-size: var(--fs-sm);
  border-radius: var(--r-round);
  padding: 0.5rem 0.875rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-tab);
}
.type-chip:hover {
  filter: var(--hover-bright);
}
.type-chip:active {
  transform: var(--press-scale);
}
.type-chip.active {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
  box-shadow: var(--shadow-teal-glow);
}
.type-chip .filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  padding: 0 0.25rem;
  font-size: var(--fs-xs);
  line-height: 1.4;
  border-radius: var(--r-round);
  background: var(--teal);
  color: #fff;
}
.type-chip.active .filter-count {
  background: #fff;
  color: var(--teal);
}
/* Each game chip wears its own accent — a coloured border + count pill while
   idle, a full gradient fill when selected — using the same per-game vars as the
   stats version filter (in scope here via the chip's data-mode). The "all" chip
   has no data-mode, so it keeps the brand teal above. */
.type-chip[data-mode] {
  border-color: var(--accent);
}
.type-chip[data-mode] .filter-count {
  background: var(--accent);
  color: var(--accent-text, #fff);
}
.type-chip[data-mode].active {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: var(--accent-text, #fff);
  border-color: var(--accent-dark);
  box-shadow: 0 2px 12px var(--accent-glow);
}
.type-chip[data-mode].active .filter-count {
  background: var(--accent-text, #fff);
  color: var(--accent-dark);
}
.type-chip[data-mode="timesup"].active .filter-count {
  background: var(--ink); /* timesup's active text is dark, not white */
  color: var(--timesup);
}
.type-chip[data-mode="molkky"].active .filter-count {
  background: var(--ink); /* molkky's active text is dark, not white */
  color: var(--molkky);
}
.type-chip[data-mode="mouton"].active .filter-count {
  background: var(--ink); /* mouton's active text is dark, not white */
  color: var(--mouton);
}
/* The active version filter's fill, border, glow and (white/ink) text all come
   from the per-game accent system — see "Filled surfaces" near the rules tabs.
   "Flip 7 + Vengeance" is handled there too via [data-v="flip7"]. */

/* Version filter pill mirrors its button's own colours: filled with the button's
   TEXT colour, number in the button's BACKGROUND colour. Inactive button:
   teal-dark text on a card background → teal-dark pill, card number. */
#versionFilter button .filter-count {
  background: var(--teal-dark);
  color: var(--card);
}
/* Active: the pill is the button's text colour (white, or dark ink on Time's
   Up!) and the number echoes the game accent. Custom props inherit from the
   button, so --accent-text / --accent-dark are in scope here. */
#versionFilter button.active .filter-count {
  background: var(--accent-text, #fff);
  color: var(--accent-dark);
}
#versionFilter button.active[data-v="nothanks"] .filter-count {
  color: var(--nothanks-dark);
}
#versionFilter button.active[data-v="timesup"] .filter-count {
  color: var(--timesup); /* brighter than --accent-dark on the dark ink pill */
}
#versionFilter button.active[data-v="molkky"] .filter-count {
  color: var(--molkky); /* brighter than --accent-dark on the dark ink pill */
}
#versionFilter button.active[data-v="mouton"] .filter-count {
  color: var(--mouton); /* brighter than --accent-dark on the dark ink pill */
}
/* Version filter pill mirrors its button's own colours: the pill is filled with
   the button's TEXT colour and the number takes the button's BACKGROUND colour.
   Inactive button: teal-dark text on a card background → teal-dark pill, card
   number. Active buttons override below (white text → white pill, game-coloured
   number). */
#versionFilter button .filter-count {
  background: var(--teal-dark);
  color: var(--card);
}
/* Active version filter: the count pill is white (the active text colour) and
   its number echoes the game's accent (the active background). */
#versionFilter button.active .filter-count {
  background: #fff;
}
#versionFilter button.active[data-v="flip7"] .filter-count {
  color: var(--vengeance-dark);
}
#versionFilter button.active[data-v="classic"] .filter-count {
  color: var(--classic-dark);
}
#versionFilter button.active[data-v="vengeance"] .filter-count {
  color: var(--vengeance-dark);
}
#versionFilter button.active[data-v="skyjo"] .filter-count {
  color: var(--skyjo-dark);
}
#versionFilter button.active[data-v="speedbac"] .filter-count {
  color: var(--speedbac-dark);
}
#versionFilter button.active[data-v="dekal"] .filter-count {
  color: var(--dekal-dark);
}
#versionFilter button.active[data-v="sixquiprend"] .filter-count {
  color: var(--sixquiprend-dark);
}
#versionFilter button.active[data-v="timesup"] .filter-count {
  background: var(--ink); /* timesup's active text is dark, not white */
  color: var(--timesup);
}
#versionFilter button.active[data-v="molkky"] .filter-count {
  background: var(--ink); /* molkky's active text is dark, not white */
  color: var(--molkky);
}
#versionFilter button.active[data-v="mouton"] .filter-count {
  background: var(--ink); /* mouton's active text is dark, not white */
  color: var(--mouton);
}
#versionFilter button.active[data-v="qwirkle"] .filter-count {
  color: var(--qwirkle-dark);
}
#versionFilter button.active[data-v="contree"] .filter-count {
  color: var(--contree-dark);
}
#versionFilter button.active[data-v="yams"] .filter-count {
  color: var(--yams-dark);
}
#versionFilter button.active[data-v="bombu"] .filter-count {
  color: var(--bombu-dark);
}
#versionFilter button.active[data-v="loupgarou"] .filter-count {
  color: var(--werewolf-dark);
}
/* Rangée des sélecteurs (métrique + fenêtre de temps) : côte à côte, empilés
   quand l'écran est trop étroit. */
.stat-metric-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.stat-metric-filter .stat-metric-select {
  flex: 1 1 14rem;
  width: auto;
}
.stat-metric-filter .stat-period-select {
  flex: 1 1 9rem;
}
.stat-metric-select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  width: 100%;
  max-width: 100%;
  border: 2px solid var(--teal-light);
  background: var(--card);
  color: var(--teal-dark);
  font-weight: 800;
  font-size: var(--fs-md);
  border-radius: var(--r-round);
  padding: 0.625rem 2.5rem 0.625rem 1rem;
  box-shadow: var(--shadow-sm);
  /* Flèche en deux demi-carrés de couleur d'accent (et non un SVG en dur) :
     elle suit les couleurs de saison et le thème sombre. */
  background-image:
    linear-gradient(45deg, transparent 50%, var(--teal-dark) 50%),
    linear-gradient(135deg, var(--teal-dark) 50%, transparent 50%);
  background-repeat: no-repeat;
  background-position:
    right 1.1875rem center,
    right 0.875rem center;
  background-size: 0.3125rem 0.3125rem;
  transition: filter 0.15s ease;
}
.stat-metric-select:hover {
  filter: var(--hover-bright);
}
.stat-metric-select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: var(--shadow-teal-glow);
}

/* game-mode selector (Setup) — same look as the rules tabs */
.mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* two game modes per row */
  gap: 0.5rem;
  /* vertical room so the active tab's glow isn't clipped */
  padding: 0.5rem 0;
}
/* Téléphone étroit : un seul jeu par ligne. Les libellés ne se coupent pas — le
   plus large (« Hombre Lobo beta », en espagnol) réclame 11rem à lui seul, donc
   deux colonnes en demandent 22.5rem quand le dialogue n'en offre que 22.9 à
   440 px de large. En dessous, la seconde colonne passait sous le bord droit du
   dialogue : la moitié des jeux devenaient illisibles, et intouchables. */
@media (max-width: 440px) {
  .mode-tabs {
    grid-template-columns: 1fr;
  }
}
/* Titres de catégories du choix « Type de partie » (setup) : une ligne pleine
   largeur dans la grille 2 colonnes, entre les familles de jeux. */
.mode-tabs .mode-cat-label {
  grid-column: 1 / -1;
  margin-top: 0.5rem;
  font-size: var(--fs-sm);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.mode-tabs .mode-cat-label:first-child {
  margin-top: 0;
}
/* Edit-game dialog keeps the legacy single-row, horizontally scrollable tabs. */
.mode-tabs.mode-tabs-scroll {
  display: flex;
  grid-template-columns: none;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.mode-tab {
  appearance: none;
  cursor: pointer;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  white-space: nowrap;
  border: 2px solid var(--teal-light);
  background: var(--card);
  color: var(--teal-dark);
  font-weight: 800;
  font-size: var(--fs-sm);
  border-radius: var(--r-round);
  padding: 0.625rem 1rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-tab);
}
.mode-tab:hover {
  filter: var(--hover-bright);
}
.mode-tab:active {
  transform: var(--press-scale);
}
/* locked conversion (started game can't switch to/from Qwirkle) */
.mode-tab:disabled,
.mode-tab.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}
.mode-tab:disabled:hover,
.mode-tab.disabled:hover {
  filter: none;
}
.mode-tab:disabled:active,
.mode-tab.disabled:active {
  transform: none;
}
/* Active mode tabs and mode badges are painted by the per-game accent system
   (see "Filled surfaces" near the rules tabs). */

/* ---------- Loup-Garou (MJ assistant) ---------- */
.ww-head {
  align-items: center;
}
.ww-panel + .ww-panel {
  margin-top: 1rem;
}
.ww-panel h3 {
  margin-top: 0;
}
.ww-hint {
  font-size: var(--fs-sm);
  margin: 0.5rem 0 0;
}
/* selectable player buttons (pickers) */
.ww-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.ww-grid--designate {
  margin: 0;
}
.ww-pick {
  appearance: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  font-size: var(--fs-sm);
  color: var(--teal-dark);
  background: var(--card);
  border: 2px solid var(--teal-light);
  border-radius: var(--r-round);
  padding: 0.5rem 0.875rem;
  box-shadow: var(--shadow-sm);
}
/* Selected player, coloured by the action's intent (set via the grid variant):
   blue = designation/assignment, red = harmful, green = beneficial/info. */
.ww-pick.sel {
  color: #fff;
  background: linear-gradient(135deg, var(--sky), var(--sky-dark));
  border-color: var(--sky-dark);
}
.ww-grid--harm .ww-pick.sel,
.ww-pick.kill {
  background: linear-gradient(135deg, var(--coral), var(--coral-dark));
  border-color: var(--coral-dark);
  color: #fff;
}
.ww-grid--help .ww-pick.sel {
  background: linear-gradient(135deg, var(--success), var(--success-dark));
  border-color: var(--success-dark);
}
/* Already-known wolves at the Loups call: shown selected (blue, via .sel) but
   locked — the MJ sees them, can't unpick them, so they read as disabled. */
.ww-pick.is-locked {
  cursor: not-allowed;
  opacity: 0.6;
}
/* composition counters, grouped into sections */
.ww-section + .ww-section {
  margin-top: 1rem;
}
.ww-section-title {
  font-weight: 900;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--teal-dark);
  margin-bottom: 0.375rem;
}
.ww-count-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--teal-bg);
  border-radius: var(--r-md);
}
/* more copies than the base game has (e.g. 3 Sœurs) — flag the row in red */
.ww-count-row.is-over {
  background: rgba(231, 76, 60, 0.12);
  box-shadow: inset 0 0 0 1.5px var(--error);
}
.ww-count-row.is-over .ww-role-name,
.ww-count-row.is-over .ww-count {
  color: var(--error);
}
/* Dark : --teal-bg (#163330) colle au fond du dialog (--card) → les lignes de
   rôles deviennent invisibles. On les pose sur --cream (#22423d, la surface qui
   "pop"), en laissant l'état is-over garder son rouge. */
html.theme-dark .ww-count-row:not(.is-over) {
  background: var(--cream);
}
.ww-role-name {
  flex: 1;
  font-weight: 800;
  color: var(--teal-dark);
}
/* role name + short "principe" stacked at the left of a composition row */
.ww-role-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}
.ww-role-info .ww-role-name {
  flex: none;
}
.ww-role-blurb {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--muted);
}
.ww-step-btn {
  appearance: none;
  cursor: pointer;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 2px solid var(--teal-light);
  background: var(--card);
  color: var(--teal-dark);
  font-weight: 900;
  font-size: var(--fs-lg);
  line-height: 1;
}
.ww-step-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.ww-count {
  min-width: 1.25rem;
  text-align: center;
  font-weight: 900;
}
.ww-compo-tally {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
  font-size: var(--fs-sm);
  color: var(--muted);
}
.ww-compo-tally .is-bad b {
  color: var(--error);
}
.ww-warn {
  color: var(--error);
  font-weight: 700;
  margin: 0.5rem 0 0;
}
/* softer "unbalanced but playable" warning (too many wolves, not yet broken) */
.ww-warn.is-soft {
  color: var(--coral-dark);
  font-size: var(--fs-xs);
  font-weight: 600;
}
/* the "edit" pen on the Voleur's center cards */
.ww-card-edit {
  opacity: 0.55;
  font-size: 0.85em;
}
/* assignment */
.ww-assign-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--teal-bg);
  border-radius: var(--r-md);
}
.ww-role-select {
  flex: 0 0 auto;
  max-width: 55%;
}
.ww-foot {
  align-items: center;
  margin-top: 1rem;
}
/* When the action bar is pinned in the dialog footer it fills the width (so its
   spacer still pushes the buttons right) and drops the in-content top margin. */
.scores-dialog-foot .ww-foot {
  flex: 1 1 auto;
  margin: 0;
}
/* night / day phases */
.ww-phase {
  font-weight: 900;
  font-size: var(--fs-lg);
  color: var(--teal-dark);
}
/* Alive wolves vs villagers summary, shown in the action cards. */
.ww-livecount {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: var(--fs-sm);
}
/* Night card header: title on the left, alive-count badges on the opposite side. */
.ww-night-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}
/* Day card: recap of the night (deaths) and the day (mayor + council). */
.ww-night-recap {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.ww-recap-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.ww-recap-label {
  margin: 0;
  font-size: var(--fs-xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}
/* Recap row leading icons (in the teal name cell): coral skull, gold medal. */
.ww-recap-skull {
  color: var(--coral-dark);
}
.ww-recap-paw {
  color: var(--teal);
}
.ww-recap-medal {
  color: var(--gold-dark);
}
.ww-livecount-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.625rem;
  border-radius: 999px;
}
.ww-livecount-item.is-loup {
  background: var(--werewolf);
  color: #fff;
}
.ww-livecount-item.is-village {
  background: var(--teal-bg);
  color: var(--teal-dark);
}
.ww-setup-hint {
  text-align: left;
  color: var(--muted);
  font-weight: 700;
}
/* A ghost button toggled "selected" (e.g. « MJ externe » before validating). */
.btn.btn-ghost.is-sel {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}
/* who the MJ must wake up — inline on the "Nuit · tour" line in the header */
.ww-callee {
  color: var(--teal-dark);
  font-weight: 700;
}
/* night panel: next role to be called + its holder(s) */
.ww-next {
  margin: 0 0 0.75rem;
  font-size: var(--fs-md);
  color: var(--text);
}
.ww-next b {
  color: var(--teal-dark);
}
.ww-next-who {
  color: var(--muted);
  font-weight: 600;
}
/* night panel: progress through the wake sequence */
.ww-progress {
  flex: 1 1 auto;
  height: 0.5rem;
  border-radius: var(--r-round);
  background: var(--teal-bg);
  overflow: hidden;
}
.ww-progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--teal-dark));
  transition: width 0.3s ease;
}
.ww-progress-count {
  flex: 0 0 auto;
  font-weight: 800;
  font-size: var(--fs-sm);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.ww-reveal {
  margin: 0;
  padding: 0.625rem 0.75rem;
  border-radius: var(--r-md);
  background: rgba(93, 173, 226, 0.16);
  font-size: var(--fs-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
/* display:flex above would override the [hidden] attribute's display:none, so
   restore it explicitly — no selection → the reveal box is hidden. */
.ww-reveal[hidden] {
  display: none;
}
.ww-reveal-txt {
  min-width: 0; /* let the text wrap/shrink, keeping the button pinned right */
}
.ww-reveal .ww-set-role {
  flex: none; /* button stays its size on the opposite end */
}
/* Tight screens: the (re)define button shows only its icon. */
@media (max-width: 450px) {
  .ww-reveal .ww-set-role-label {
    display: none;
  }
  /* Compact alive-count badges: keep the icon + number, drop the word label. */
  .ww-lc-label {
    display: none;
  }
}
/* Night dialog content: spacing comes only from flex gap — no element margins,
   so every block is evenly 1rem apart however the action is composed.
   .ww-compo = the role-composition picker (create / replay stepper AND the
   in-game "Définir les rôles" dialog). */
.ww-step,
.ww-witch-act,
.ww-witch-kill,
.ww-compo {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.ww-night {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
/* sections keep their title → counts spacing once child margins are stripped */
.ww-compo .ww-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.ww-step *,
.ww-night *,
.ww-compo * {
  margin: 0;
}
/* `.modal p` adds a bottom margin to every modal paragraph; the flex-gap
   night-dialog & composition content manage their own spacing, so override it
   (more specific than `.modal p`). */
.modal .ww-step p,
.modal .ww-compo p,
.modal .ww-compo-foot p {
  margin: 0;
}
/* composition picker: tally + warning + hint pinned in the footer (always
   visible), stacked on the LEFT, on the same row as the Valider button (right).
   The base .scores-dialog-foot is already a centered flex row. */
.ww-compo-foot-info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.ww-compo-foot-info > * {
  margin: 0;
}
/* night panel action button is centered (no spacer pushing it to the edge) */
.ww-night .ww-foot {
  justify-content: center;
}
.ww-toggle.active {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
.ww-sub {
  display: block;
  margin: 1rem 0 0.375rem;
  font-weight: 800;
  color: var(--teal-dark);
  font-size: var(--fs-sm);
}
.ww-win {
  margin: 0.5rem 0;
  padding: 0.625rem 0.75rem;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--ink);
  font-weight: 900;
  text-align: center;
}
/* end-of-game: reuse the standard .banner; just space the Terminer button */
.ww-endwrap .new-scores-bar {
  margin-top: 1rem;
}
/* village elimination list */
.ww-elim {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  appearance: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  color: var(--teal-dark);
  background: var(--teal-bg);
  border: 2px solid rgba(var(--teal-rgb), 0.2);
  border-radius: var(--r-md);
  padding: 0.625rem 0.875rem;
}
.ww-elim:hover {
  border-color: var(--coral);
  color: var(--coral-dark);
}
/* roster reference */
.ww-roster summary {
  cursor: pointer;
  list-style: none;
}
.ww-roster summary h3 {
  display: inline;
}
.ww-rrow {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--r-md);
  background: var(--teal-bg);
}
.ww-rrow.ww-dead {
  opacity: 0.5;
}
.ww-rrow.ww-dead .ww-role-name {
  text-decoration: line-through;
}
.ww-role-of {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem; /* 4px */
  font-weight: 800;
  font-size: var(--fs-sm); /* 14px */
  padding: 0.125rem 0.5rem; /* 2px 8px */
  border-radius: 999px;
  color: #fff;
  min-height: 1.625rem; /* same height as the masked badge → no row shift on toggle */
}
.ww-role-of.village {
  background: var(--teal);
}
.ww-role-of.loups {
  background: var(--werewolf);
}
.ww-role-of.solo {
  background: var(--coral);
}
/* Day-recap status pills (Bear Tamer growl, Chevalier doom) — reuse the role-pill
   box so they line up at the same size as the role badges in the rows above. */
.ww-role-of.is-growl {
  background: var(--werewolf);
}
.ww-role-of.is-calm {
  background: var(--success);
}
.ww-ric {
  flex: 0 0 auto;
}
.ww-ric.village {
  color: var(--teal);
}
.ww-ric.loups {
  color: var(--werewolf);
}
.ww-ric.solo {
  color: var(--coral);
}
/* Active mission button is filled teal → the camp-coloured icon would vanish;
   force it white like the label. */
.yams-mission.active .ww-ric {
  color: #fff;
}
/* Masked role indicator (MJ "hide roles" mode): a neutral icon+label badge with
   the SAME box as .ww-role-of (gap/padding/font/radius/min-height) so toggling
   roles on/off never shifts the rows. */
.ww-role-masked {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: var(--fs-sm);
  font-weight: 800;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  background: var(--teal-bg);
  color: var(--muted);
  min-height: 1.625rem;
}
.ww-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: var(--fs-xs);
  font-weight: 800;
  padding: 0.125rem 0.375rem;
  border-radius: 999px;
}
.ww-tag.is-maire {
  background: var(--gold);
  color: var(--ink);
}
/* Former mayor (now dead): the sash badge, struck through. */
.ww-tag-struck {
  text-decoration: line-through;
  opacity: 0.75;
}
.ww-tag.is-lover {
  background: var(--coral);
  color: #fff;
}
.ww-tag.is-dead {
  background: var(--coral-dark);
  color: #fff;
}
.ww-tag.is-infected {
  background: var(--werewolf);
  color: #fff;
}
/* Role-info dialog, opened by tapping a player's row in the roster. */
.ww-row-info {
  cursor: pointer;
}
/* Role-info dialog body: even 1rem rhythm via gap, so the global .modal p
   bottom-margin is dropped here (scoped — other dialogs keep theirs). */
.ww-info-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.ww-info-body p {
  margin: 0;
}
.ww-info-blurb {
  font-size: var(--fs-sm);
}
.ww-info-status {
  font-size: var(--fs-xs);
  font-weight: 700;
}
.ww-info-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.ww-info-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--fs-md);
}
.ww-info-ok {
  color: var(--success);
}
.ww-info-used {
  color: var(--muted);
}
.ww-qrole {
  margin-left: auto;
  font-weight: 900;
  font-size: var(--fs-lg);
  color: var(--muted);
  width: 1.625rem;
  height: 1.625rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--teal-bg);
}
/* players list: display only — name on the left, role (or "?") at the line end */
.ww-players .summary-row-fg {
  grid-template-columns: 1fr auto;
}
/* name + its badges (Maire, ❤, Infecté) on one centered row, not baseline-aligned */
.ww-players .player-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.375rem;
}
.ww-players .total-cell {
  font-size: var(--fs-md);
}
/* "starting role → current role" for transformed players (Enfant sauvage,
   Voleur, Chien-Loup). The old role is a faded badge before the current chip. */
.ww-role-cell {
  flex-wrap: wrap;
}
.ww-was {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem; /* 4px */
  font-size: var(--fs-xs); /* 12px */
  font-weight: 700;
  color: var(--muted);
  background: var(--card);
  border: 2px solid var(--teal-bg);
  padding: 0.125rem 0.5rem; /* 2px 8px */
  border-radius: var(--r-round);
  white-space: nowrap;
}
.ww-was-arrow {
  color: var(--muted);
  font-size: var(--fs-xs);
}
/* ---- Loup-Garou action recap (the "Détails" screen) ---- */
/* Uniform spacing: night↔day inside a cycle matches the gap between cycles.
   On desktop the night and day of one cycle sit side by side; they stack on
   mobile. A lone phase (e.g. the current night before its day) spans full width. */
.ww-recap-cycle {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: stretch; /* night & day of a cycle share the same height */
}
@media (min-width: 700px) {
  .ww-recap-cycle {
    grid-template-columns: 1fr 1fr;
  }
  .ww-recap-cycle .ww-recap-phase:only-child {
    grid-column: 1 / -1;
  }
}
/* Translucent tints (not the mode-flipping --teal-bg / --cream) so the blocks
   keep the same contrast on the white card AND the dark card; a coloured left
   accent makes night vs day unmistakable. */
.ww-recap-phase {
  border-radius: var(--r-lg);
  padding: 0.75rem 0.875rem;
  border: 1px solid transparent;
  border-left-width: 4px;
}
.ww-recap-phase.is-night {
  background: rgba(93, 173, 226, 0.12);
  border-color: rgba(93, 173, 226, 0.3);
  border-left-color: var(--sky);
}
.ww-recap-phase.is-day {
  background: rgba(var(--gold-dark-rgb), 0.13);
  border-color: rgba(var(--gold-dark-rgb), 0.32);
  border-left-color: var(--gold-dark);
}
.ww-recap-phase-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: var(--fs-md);
  color: var(--text);
  margin-bottom: 0.375rem;
}
.ww-recap-phase.is-night .ww-recap-phase-head i {
  color: var(--sky);
}
.ww-recap-phase.is-day .ww-recap-phase-head i {
  color: var(--gold-dark);
}
.ww-recap-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.ww-recap-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  color: var(--text);
  font-size: var(--fs-sm);
  line-height: 1.4;
}
/* role icon in place of the list bullet */
.ww-recap-ico {
  flex: 0 0 auto;
  width: 1.125rem;
  text-align: center;
  line-height: 1.4;
  color: var(--muted);
}
/* night summary: list of the night's victims */
.ww-deaths {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.ww-deaths li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.75rem;
  border-radius: var(--r-md);
  background: var(--teal-bg);
  font-size: var(--fs-md);
}
/* Only the row's own icon (skull) is coral — a role badge's nested icon keeps the
   badge's text colour. */
.ww-deaths li > i {
  color: var(--coral-dark);
}
/* Role (or "rôle inconnu" / the define button) sits at the end of the line. */
.ww-deaths li .ww-role-of,
.ww-deaths li .ww-role-masked,
.ww-deaths li .muted,
.ww-deaths li .ww-def-role {
  margin-left: auto;
}
/* day board: Mayor line + setup tally */
.ww-setup .new-scores-bar {
  margin-top: 0.75rem;
}
.btn-danger-soft {
  color: var(--coral-dark);
}
/* Loup-Garou rules tab: headings + role names in the werewolf colour */
.ww-rules h3 {
  color: var(--werewolf);
}
.ww-rules .ww-rrole-name {
  color: var(--text);
}
.ww-roles {
  list-style: none;
  padding-left: 0;
}
.ww-roles li {
  margin-bottom: 0.5rem;
  line-height: 1.4;
}
.ww-camp {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 800;
  padding: 0 0.375rem;
  border-radius: 999px;
  color: #fff;
  vertical-align: middle;
}
.ww-camp.village {
  background: var(--teal);
}
.ww-camp.loups {
  background: var(--werewolf);
}
.ww-camp.solo {
  background: var(--coral);
}

/* ---------- Bombu ---------- */
/* Contract picker reuses .yams-missions / .yams-mission; each contract shows its
   score in a badge (.yams-fixed), like the Yam's missions. */
.bombu-note {
  margin: 0 0 0.875rem;
  font-size: var(--fs-sm);
}
/* Per-contract score entry: computed points, rank buttons, "who took it" pick. */
.bombu-pts {
  font-weight: 800;
  white-space: nowrap;
}
.bombu-rank {
  flex-wrap: wrap;
  justify-content: flex-end;
}
.bombu-rank-btn.active,
.bombu-pick-btn.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
  box-shadow: var(--shadow-teal-glow);
}
/* Capot: the sweep declaration wears the Bombu blue — distinct from the teal
   of the regular entry buttons — and its score shows as a matching pill. */
.bombu-capot-btn {
  color: var(--bombu);
  border-color: var(--bombu);
}
/* Sombre : le bleu Bombu plein est illisible sur la carte foncée. */
html.theme-dark .bombu-capot-btn:not(.active) {
  color: #7fbef0;
  border-color: #4a98d8;
}
.bombu-capot-btn.active {
  background: var(--bombu);
  border-color: var(--bombu-dark);
  color: #fff;
  box-shadow: 0 2px 10px var(--bombu-glow);
}
.bombu-pts.capot {
  display: inline-block;
  background: var(--bombu);
  color: #fff;
  font-size: var(--fs-sm);
  line-height: 1;
  padding: 0.3125rem 0.625rem;
  border-radius: 999px;
  margin-left: 0.375rem;
  vertical-align: middle;
}
.bombu-check {
  margin-top: 0.875rem;
  font-weight: 800;
  font-size: var(--fs-sm);
  min-height: 1.2em;
}
.bombu-check.ok {
  color: var(--success);
}
.bombu-check.under {
  color: var(--muted);
}
.bombu-check.over {
  color: var(--error);
}
/* Details table: deal number + contract on the left, one tappable score per
   player (rouvre la saisie de la donne) ; la case de celui qui a choisi le
   contrat est cerclée aux couleurs du jeu. */
.bombu-table .bombu-deal {
  white-space: nowrap;
}
.bombu-deal-no {
  font-weight: 900;
  color: var(--muted);
  margin-right: 0.375rem;
}
.bombu-table .cell-edit.chooser {
  border-color: var(--bombu);
  box-shadow: 0 0 0 2px var(--bombu-glow);
}
/* Le badge Capot : la forme du badge Flip 7, dans le bleu du Bombu (spécificité
   doublée : .flip7-tag est défini plus bas et reprendrait la main). */
.flip7-tag.bombu-capot-tag {
  background: var(--bombu);
}

/* rules page */
.rules-intro {
  background: var(--teal-bg);
  border-radius: var(--r-md);
  padding: 0.875rem 1rem;
}
/* Dark mode: --teal-bg is darker than the card, so these on-card surfaces vanish.
   Use --cream (the "raised pill" token tuned to pop on dark) instead. */
html.theme-dark .ww-role-masked,
html.theme-dark .rules-intro,
html.theme-dark .ww-deaths li,
html.theme-dark .ww-livecount-item.is-village,
html.theme-dark .ww-qrole,
html.theme-dark .ww-progress {
  background: var(--cream);
}
/* Day-card recap rows: roster layout, but raised pills so each row keeps a fill
   distinct from the card it sits on. */
.ww-recap-rows {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.ww-recap-rows .summary-row {
  border-radius: var(--r-md);
}
.ww-recap-rows .summary-row + .summary-row {
  border-top: none; /* pills with a gap, not a continuous bordered list */
}
.ww-recap-rows .summary-row-fg {
  background: var(--teal-bg);
}
html.theme-dark .ww-recap-rows .summary-row-fg {
  background: var(--cream);
}
/* The "?" chip gets a solid accent fill (no border) so it clearly pops on the
   raised row in both themes. */
.ww-recap-rows .ww-qrole {
  background: var(--teal);
  color: #fff;
}
.rules h3 {
  margin-top: 1.25rem;
}
.rules h3:first-child {
  margin-top: 0;
}
.rules p {
  color: var(--text);
  line-height: 1.6;
  margin: 0 0 0.875rem;
  font-weight: 500;
}
.rules ul {
  margin: 0 0 1rem;
  padding-left: 1rem;
}
.rules li {
  color: var(--text);
  line-height: 1.55;
  margin-bottom: 0.5rem;
  font-weight: 500;
}
.rules b {
  color: var(--teal-dark);
}

/* ---------- Game / scoreboard ---------- */
.game-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.game-head h2 {
  margin: 0;
}
.game-title-main {
  display: flex;
  align-items: center;
  gap: 1rem 0.5rem;
  flex-wrap: nowrap;
  min-width: 0;
}
/* the title shrinks (and ellipsises) so the type badge stays on the same line */
.game-title-main h2 {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.game-title-main .badge {
  flex-shrink: 0;
}
/* Game screen header: title row on top, meta row (rounds, timer, actions)
   stacked below. */
/* Wraps the back row and the game info/actions as one vertical block. */
.game-head-stacked {
  flex-direction: column;
  align-items: stretch;
  flex-wrap: nowrap; /* column-wrap would size to the title's content width */
  gap: 0.5rem;
  min-width: 0; /* allow the title row to shrink instead of overflowing */
}
.game-meta-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.5rem 0.75rem;
  flex-wrap: wrap;
}
.game-round-num {
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: 700;
}
/* Chiffres à chasse fixe : le chrono garde sa largeur d'une seconde à l'autre. */
#durationChip {
  font-variant-numeric: tabular-nums;
}
.target-note {
  color: var(--teal-dark);
  font-size: var(--fs-sm);
  font-weight: 800;
  background: var(--teal-bg);
  padding: 0.375rem 0.75rem;
  border-radius: var(--r-round);
}

.banner {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #e3c077, #b3843f);
  border-radius: var(--r-xl);
  padding: 1.375rem 1.5rem;
  font-size: var(--fs-lg);
  font-weight: 700;
  color: white;
  text-align: center;
  box-shadow: var(--shadow-accent-glow);
  animation: glow-pulse 2s ease-in-out infinite;
}
.banner-sub {
  margin-top: 0.25rem;
  font-size: var(--fs-sm);
  font-weight: 600;
  opacity: 0.9;
}
.banner b {
  font-weight: 800;
}
.banner .crown {
  display: inline-block;
  animation: crown-bounce 1.5s infinite;
}
/* "..." options menu in the game header */
.kebab {
  position: relative;
  display: inline-flex;
}
.kebab-menu {
  position: absolute;
  top: calc(100% + 0.375rem);
  right: 0;
  /* float above the following panels (table, action bars) while staying below
     modals (20) and toasts (30). The kebab/header don't create their own
     stacking context, so this resolves against the root — unlike a high z-index
     trapped inside the header, which Safari iOS paints behind the scoreboard. */
  z-index: 15;
  min-width: 11rem;
  /* Largeur de l'entrée la plus longue (le bloc est absolu dans le petit
     .kebab : sans ça il se figeait à min-width et les libellés passaient sur
     deux lignes — « Écran copilote » + badge beta, « Afficher l'ordre… »),
     bornée à l'écran sur les très petits mobiles. */
  width: max-content;
  max-width: calc(100vw - 2rem);
  display: flex;
  flex-direction: column;
  padding: 0.375rem;
  background: var(--card);
  border: 2px solid var(--teal-light);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  /* Hauteur bornée à l'écran par fitMenuHeight (js/ui.js) : le surplus défile
     au lieu de sortir de l'écran, sans écraser les entrées (flex-shrink). */
  overflow-y: auto;
  overscroll-behavior: contain;
}
.kebab-menu > * {
  flex-shrink: 0;
}
.kebab-menu[hidden] {
  display: none;
}
.kebab-item {
  appearance: none;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--teal-dark);
  font-weight: 800;
  font-size: var(--fs-sm);
  text-align: left;
  border-radius: var(--r-sm);
  padding: 0.625rem 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 1rem 0.5rem;
}
.kebab-item:hover {
  background: var(--teal-bg);
}
/* Badge « beta » d'une entrée du menu (écran copilote) : calé à droite. */
.kebab-item .mode-beta {
  margin-left: auto;
}
.kebab-item:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}
.kebab-item:disabled:hover {
  background: transparent;
}
.kebab-item#del {
  color: var(--coral-dark);
}
.kebab-item#del:hover {
  background: rgba(239, 108, 74, 0.12);
}
/* "Modifier" lives in the standalone button by default; at/below 600px it folds
   into the "..." menu instead. */
.kebab-edit {
  display: none;
}
@media (max-width: 600px) {
  .game-meta-row #editPlayers {
    display: none;
  }
  /* The standalone button carried ml-auto; once hidden, the "..." takes over —
     but only when there's no beta badge, which already holds the ml-auto (else
     two ml-auto split the row and leave a gap between the badge and the menu). */
  /* `> .mode-beta` : le badge beta de la RANGÉE (jeu en bêta) — pas celui de
     l'entrée « Écran copilote » dans le menu « ... », lui aussi .mode-beta. */
  .game-meta-row:not(:has(> .mode-beta)) .kebab {
    margin-left: auto;
  }
  /* Le « ... » reste ancré en haut à droite : quand les pastilles (chrono,
     cible…) ne tiennent pas sur une ligne, ce sont elles qui passent à la
     ligne, sans entraîner le menu. Sinon, le chrono qui s'élargit d'une
     seconde à l'autre faisait sauter le bouton d'une ligne à l'autre. */
  .game-meta-row:has(> .kebab) {
    position: relative;
    padding-right: calc(var(--kebab-w, 2.75rem) + 0.75rem);
  }
  .game-meta-row > .kebab {
    position: absolute;
    top: 0;
    right: 0;
    margin-left: 0;
  }
  .kebab-edit {
    display: inline-flex;
  }
}
/* Jeux en beta : leur meta row est plus chargée (badge beta + chips spécifiques
   + durée + actions). Sous 470px, on masque le temps écoulé pour désencombrer.
   Cible via le badge .mode-beta présent dans l'en-tête → couvre tous les jeux
   beta (Contrée, Fléchettes, Loup-Garou…) sans les lister un par un. */
@media (max-width: 470px) {
  .game-head:has(.game-meta-row > .mode-beta) #durationChip {
    display: none;
  }
}

.banner.banner-cancelled {
  background: linear-gradient(135deg, var(--coral), var(--coral-dark));
  box-shadow: var(--shadow-coral-glow);
  animation: none;
}

.table-wrap {
  overflow-x: auto;
  border-radius: var(--r-xl);
  background: var(--card);
  box-shadow: var(--shadow-card);
  padding: 0.375rem;
  /* Own stacking context so the sticky header/name cells (z-index inside the
     table) stay trapped below this panel and can't surface above the kebab
     menu, which floats from the root context at z-index 15. */
  position: relative;
  z-index: 0;
}
table.score {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  min-width: 32.5rem;
}
table.score.summary-table,
table.score.stats-table {
  min-width: 0;
}
/* Leaderboard rows are tappable: open the rename dialog for that player. */
table.score.stats-table tbody tr.stats-row {
  cursor: pointer;
}
table.score.stats-table tbody tr.stats-row:active td {
  background: var(--teal-bg);
}
@media (hover: hover) {
  table.score.stats-table tbody tr.stats-row:hover td {
    background: var(--teal-bg);
  }
}
/* Merge warning in the rename-player dialog. */
.renamep-warn {
  color: var(--coral-dark);
  font-weight: 600;
  font-size: var(--fs-sm);
  line-height: 1.35;
}
/* Hard block (the two players co-played → distinct people) vs the soft merge
   warning above. */
.renamep-warn.is-error {
  color: var(--error);
}
/* Yam's scorecard: fill the width (no 32.5rem floor so it also fits narrow
   screens). The mission column shrinks to its content (see .yams-table
   .player-name) so the value columns spread across the remaining width. */
table.score.yams-table {
  min-width: 0;
}
/* Secondary "Parties" column: compact and muted next to the ranked metric. */
table.score.stats-table .games-col {
  width: 2px;
  white-space: nowrap;
  color: var(--muted);
  font-weight: 700;
}
table.score th,
table.score td {
  padding: 0.875rem 0.75rem;
  text-align: center;
  white-space: nowrap;
}
table.score thead th {
  color: var(--teal-dark);
  font-size: var(--fs-sm);
  font-weight: 800;
  letter-spacing: 0.5px;
  border-bottom: 3px dashed rgba(var(--teal-rgb), 0.28);
  position: sticky;
  top: 0;
  background: var(--card);
}
table.score tbody td {
  border-bottom: 1px solid rgba(var(--teal-rgb), 0.12);
}
table.score .player-name {
  text-align: left;
  font-weight: 800;
  color: var(--teal-dark);
  position: sticky;
  left: 0;
  background: var(--card);
  z-index: 1;
}

.cell-box {
  position: relative;
  display: inline-block;
}
input.cell-input {
  width: 4rem;
  text-align: center;
  font-weight: 700;
  -moz-appearance: textfield;
  appearance: textfield;
}
input.cell-input::-webkit-outer-spin-button,
input.cell-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
/* negative score: the input turns red so the sign reads at a glance — also
   while the sign is only ARMED (± on an empty field), via the − placeholder */
input.cell-input.is-neg {
  color: var(--coral-dark);
  border-color: var(--coral-light);
}
input.cell-input.is-neg::placeholder {
  color: var(--coral-dark);
  opacity: 0.7;
}
/* zero-value cell: editable, but visually muted like a disabled field */
input.cell-input.cell-zero {
  color: var(--muted);
  opacity: 0.55;
}
input.cell-input.cell-zero:focus {
  color: var(--text);
  opacity: 1;
}
/* read-only score cell in the details table — looks like the old editable field
   but taps open the single-cell editor dialog */
.cell-edit {
  appearance: none;
  cursor: pointer;
  width: 4rem;
  text-align: center;
  font-weight: 700;
  font-size: var(--fs-md);
  font-family: inherit;
  color: var(--text);
  background: var(--cream);
  border: 2px solid rgba(35, 48, 56, 0.18);
  border-radius: var(--r-md);
  padding: 0.625rem 0.5rem;
  transition:
    border-color 0.15s ease,
    filter 0.15s ease;
}
.cell-edit:hover {
  border-color: var(--teal);
}
.cell-edit:active {
  filter: brightness(0.97);
}
.cell-edit.cell-zero {
  color: var(--muted);
  opacity: 0.55;
}
.cell-edit.is-bust {
  border-color: var(--coral-light);
  color: var(--coral-dark);
}
/* Mode vue (détails en lecture seule) : cases non cliquables, suppressions masquées. */
.is-readonly .cell-edit,
.is-readonly .yams-cell-edit,
.is-readonly .yams-cell-edit:hover,
.is-readonly .yams-cell-edit:active,
.is-readonly .cell-edit:active {
  cursor: default;
  filter: none;
  transform: none;
}
.is-readonly .cell-edit:hover {
  border-color: rgba(35, 48, 56, 0.18);
}
.is-readonly .cell-edit.is-bust:hover {
  border-color: var(--coral-light);
}
.is-readonly tfoot,
.is-readonly th.rank-col:last-child,
.is-readonly td.rank-col:last-child {
  display: none;
}
.flip7-tag {
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  background: var(--sky);
  color: #fff;
  font-size: var(--fs-3xs);
  font-weight: 800;
  line-height: 1;
  padding: 0.25rem 0.375rem;
  border-radius: var(--r-round);
  box-shadow: var(--shadow-sm);
}
/* Brutal : −15 reçu d'un Flip 7 redirigé — coin opposé au +15, corail */
.f7malus-tag {
  right: auto;
  left: -0.5rem;
  background: var(--coral);
}
/* "Doublé" badge (Skyjo ×2) — same shape as the Flip 7 tag, green accent */
.dbl-tag {
  background: var(--skyjo-dark);
}
/* Skyjo : a terminé la manche sans être doublé */
.closer-tag {
  background: var(--teal-dark);
}
.total-cell {
  font-weight: 800;
  font-size: var(--fs-xl);
  color: var(--text);
}
/* Game scoreboard: larger totals for at-a-glance reading (no colour change). */
table.score.summary-table .total-cell {
  font-size: var(--fs-2xl);
}
.score-badge {
  display: inline-flex;
  align-items: center;
  gap: 1rem 0.5rem;
  font-weight: 800;
  white-space: nowrap;
  line-height: 1;
  vertical-align: middle; /* align with the (smaller) preview pill beside it */
}
/* Saisie en cours (manche ou volée pas encore validée) : c'est le total PROJETÉ
   qui s'affiche à la place du total actuel, teinté tant qu'il n'est pas acquis —
   un seul chiffre à lire, au lieu du score actuel suivi d'une pastille
   « 46 (+23) ». Bleu — la couleur « en attente », distincte du teal des noms et
   du texte des totaux acquis ; corail quand la manche fait RECULER le joueur,
   ce qui dépend du sens du jeu (marquer des points, ou en éviter au Skyjo et au
   Bombu où ce sont des pénalités — cf. is-loss, posé côté JS). */
.score-badge.is-preview,
.copilot-total-val.is-preview,
.copilot-team-total.is-preview {
  color: var(--sky-dark);
}
/* Le bleu foncé se noie dans le fond sombre : on remonte d'un cran. */
html.theme-dark .score-badge.is-preview,
html.theme-dark .copilot-total-val.is-preview,
html.theme-dark .copilot-team-total.is-preview {
  color: var(--sky);
}
.score-badge.is-preview.is-loss,
.copilot-total-val.is-preview.is-loss,
.copilot-team-total.is-preview.is-loss,
html.theme-dark .score-badge.is-preview.is-loss,
html.theme-dark .copilot-total-val.is-preview.is-loss,
html.theme-dark .copilot-team-total.is-preview.is-loss {
  color: var(--coral-dark);
}
/* Mise en cours d'annonce (Contrée) : la table la voit se composer, dans la
   couleur « en attente » des totaux projetés, jusqu'à ce qu'elle soit validée. */
.bid-current.is-preview,
.copilot-bid.is-preview {
  color: var(--sky-dark);
}
html.theme-dark .bid-current.is-preview,
html.theme-dark .copilot-bid.is-preview {
  color: var(--sky);
}
/* Pastille d'une volée qui dépasse (fléchettes) : le reste ne bouge pas, donc
   rien à projeter — seul ce marqueur signale la volée perdue. */
.score-preview {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 0.5rem;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  background: rgba(239, 108, 74, 0.16);
  color: var(--coral-dark);
  font-size: var(--fs-sm);
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
}
/* eliminated player in the in-progress round */
.elim-tag {
  margin-left: 0.5rem;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
  vertical-align: middle;
  box-shadow: var(--shadow-coral-glow);
}
/* stopped player in the in-progress round (preview-only marker, swipe right) */
.stop-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 0.25rem;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
  vertical-align: middle;
}
/* Pétanque : badge « Fanny » de l'équipe perdante restée à 0 (partie finie),
   affiché juste avant le score (la .total-cell espace via son gap). */
.fanny-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
  vertical-align: middle;
}
table.score .eliminated-row .player-name {
  color: var(--coral-dark);
  text-decoration: line-through;
  text-decoration-color: rgba(212, 82, 51, 0.5);
  background: rgba(239, 108, 74, 0.16);
}
.eliminated-row .total-cell .score-badge {
  color: var(--coral-dark);
  opacity: 0.7;
}
.eliminated-row td {
  background: rgba(239, 108, 74, 0.16);
}
.rank-col {
  width: 2px;
  white-space: nowrap;
  text-align: center;
  padding-right: 0.25rem;
}
.total-cell .crown {
  display: inline-block;
  color: var(--gold-dark);
  animation: crown-bounce 1.5s infinite;
}
/* Tête de mort : le pendant de la couronne là où le moins de points l'emporte —
   ce total franchit la barre, donc il met fin à la partie, et du mauvais côté.
   Même emplacement et même taille que la couronne, le corail du total qu'elle
   accompagne, et pas de rebond : il n'y a rien à fêter. */
.total-cell .doom,
.copilot .doom {
  display: inline-block;
  color: var(--coral-dark);
}

/* ---------- score-summary list (swipe-to-eliminate / swipe-to-stop) ----------
   The game scoreboard is a div list (not a table) so each row can be swiped
   left to toggle a player's elimination, or right to flag them "stopped"
   (preview-only) for the in-progress round. */
.table-wrap.summary-list {
  padding: 0;
  overflow: hidden; /* clip rows to the card's rounded corners */
  user-select: none; /* double-tap toggles the display — don't select names */
  -webkit-user-select: none;
}
.summary-row {
  position: relative;
  overflow: hidden; /* hide the foreground as it slides past the edge */
}
.summary-row + .summary-row {
  border-top: 1px solid rgba(var(--teal-rgb), 0.12);
}
/* Le temps de rejoindre sa nouvelle place au classement (cf. _animateChanges),
   une ligne passe au-dessus de celles qui ne bougent pas. */
.summary-row.is-moving {
  z-index: 2;
}
.summary-row.is-moving.is-rising {
  z-index: 3;
}
.summary-row-fg {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 0.75rem;
  background: var(--card);
  touch-action: pan-y; /* keep vertical scroll; we claim horizontal swipes */
}
.summary-row .rank-col {
  width: auto;
  padding: 0;
}
.summary-row .player-name {
  text-align: left;
  font-weight: 800;
  color: var(--teal-dark);
  min-width: 0;
}
/* Tableau des scores et classement des stats : le gamer score (étoiles) passe
   SOUS le nom, sur sa propre ligne, plutôt qu'à sa suite — le nom et ses
   pastilles d'état (stoppé) restent seuls sur la première ligne. */
.summary-row .player-name .gs-badge,
table.score.stats-table .player-name .gs-badge {
  display: flex;
  margin-left: 0;
  margin-top: 0.125rem;
  line-height: 1.2;
}
.summary-row .total-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.375rem;
  font-size: var(--fs-2xl);
}
/* ---------- « C'est moi » (identité locale du lieu, choisie dans Réglages) ----------
   La ligne du porteur de l'appareil : liseré + teinte or. Déclaré AVANT les
   états eliminated/stopped pour qu'une ligne à la fois « moi » et éliminée/
   stoppée garde la teinte de l'état — le liseré or (box-shadow), lui, survit à
   l'écrasement du fond. */
/* Membre « moi » dans une liste de membres (.name-sub) ou un nom d'équipe
   fusionné (Contrée) : pas de pastille, juste le nom en évidence. */
.me-name {
  color: var(--gold-dark);
  font-weight: 800;
}
html.theme-dark .me-name {
  color: var(--gold);
}
/* Scoreboard (liste .summary-row) : teinte opaque (dégradé sur la card, comme
   les états) pour que l'action de swipe derrière ne transparaisse pas. */
.summary-row.is-me .summary-row-fg {
  background:
    linear-gradient(0deg, rgba(var(--gold-rgb), 0.14), rgba(var(--gold-rgb), 0.14)),
    var(--card);
  box-shadow: inset 0.1875rem 0 0 var(--gold);
}
html.theme-dark .summary-row.is-me .summary-row-fg {
  background:
    linear-gradient(0deg, rgba(var(--gold-rgb), 0.18), rgba(var(--gold-rgb), 0.18)),
    var(--card);
}
/* Tableaux de scores : la ligne entière (classement, Contrée) — fond opaque
   pour couvrir aussi la cellule nom sticky. */
table.score tr.is-me td {
  background:
    linear-gradient(0deg, rgba(var(--gold-rgb), 0.14), rgba(var(--gold-rgb), 0.14)),
    var(--card);
}
/* … ou la seule cellule/colonne du joueur (tables tour par tour, en-têtes
   Yam's / Bombu). */
table.score td.player-name.is-me,
table.score thead th.is-me {
  background:
    linear-gradient(0deg, rgba(var(--gold-rgb), 0.18), rgba(var(--gold-rgb), 0.18)),
    var(--card);
}
html.theme-dark table.score tr.is-me td,
html.theme-dark table.score td.player-name.is-me,
html.theme-dark table.score thead th.is-me {
  background:
    linear-gradient(0deg, rgba(var(--gold-rgb), 0.22), rgba(var(--gold-rgb), 0.22)),
    var(--card);
}
/* Pastille joueur (setup / Réglages) : liseré or sur « moi ». */
.player-select-chip.is-me {
  border-color: var(--gold);
}
/* eliminated row: red tint kept opaque (gradient over card) so the swipe
   action behind never shows through at rest. Liseré coral : même langage que
   les lignes stoppées (teal) et « moi » (or). */
.summary-row.eliminated-row .summary-row-fg {
  background:
    linear-gradient(
      0deg,
      rgba(239, 108, 74, 0.16),
      rgba(239, 108, 74, 0.16)
    ),
    var(--card);
  box-shadow: inset 0.1875rem 0 0 var(--coral);
}
.summary-row.eliminated-row .player-name {
  color: var(--coral-dark);
  text-decoration: line-through;
  text-decoration-color: rgba(212, 82, 51, 0.5);
}
/* Brutal : le compteur « ×2 » d'un re-tué n'hérite pas du barré du nom. */
.summary-row .player-name .elim-tag {
  display: inline-block;
}

/* ---- ce qui vient de changer ----
   Deux marques posées après coup par le rendu qui découvre le changement (le
   tableau des scores, l'écran copilote), et retirées ensuite :
     .is-bumped   — un badge qui apparaît ou dont la valeur change : il tressaute ;
     .is-striking — une élimination : le trait se trace sur le nom au lieu
                    d'arriver déjà barré, puis le barré natif reprend la main,
                    au même endroit. Le trait vise le milieu de la PREMIÈRE ligne
                    (une équipe porte ses membres en sous-ligne). */
.is-bumped {
  animation: badge-pop 0.4s var(--bounce);
}
.summary-row.is-striking .player-name {
  text-decoration: none;
}
/* Le trait suit le NOM, pas la colonne : dans la ligne du tableau, .player-name
   est étiré par la grille et le trait aurait barré toute la largeur — d'où le
   span qui épouse le texte (l'écran copilote a déjà le sien). */
.summary-row.is-striking .pname-text,
.copilot .is-eliminated.is-striking .copilot-name-text {
  position: relative;
}
.summary-row.is-striking .pname-text::after,
.copilot .is-eliminated.is-striking .copilot-name-text::after {
  content: "";
  position: absolute;
  left: -2%;
  top: 0.62em;
  height: 0.09em;
  width: 0;
  border-radius: 999px;
  background: currentColor;
  animation: elim-strike 0.42s ease forwards;
}
@keyframes elim-strike {
  to {
    width: 104%;
  }
}
html.reduce-motion .is-bumped,
html.reduce-motion .summary-row.is-striking .pname-text::after,
html.reduce-motion .copilot .is-eliminated.is-striking .copilot-name-text::after {
  animation: none;
}
html.reduce-motion .summary-row.is-striking .player-name,
html.reduce-motion .copilot .is-eliminated.is-striking .copilot-name-text {
  text-decoration: line-through;
}
/* recolor the rank (standings) badge to the eliminated coral — but only past
   3rd place; the top-3 medals (gold/silver/bronze) keep their colors */
.summary-row.eliminated-row .rank-col .badge:not(.rank1):not(.rank2):not(.rank3) {
  background: linear-gradient(135deg, var(--coral-light), var(--coral-dark));
  color: #fff;
}
/* stopped row: teal tint kept opaque (gradient over card) so the swipe action
   behind never shows through at rest. Teinte à 30 % + liseré (comme la ligne
   « moi ») : le teal est la famille de couleur du fond de page, en dessous la
   ligne s'y confond (surtout quand toutes les lignes sont teintées). Le nom
   passe sur un teal plus foncé pour garder son contraste sur la teinte. */
.summary-row.stopped-row .summary-row-fg {
  background:
    linear-gradient(
      0deg,
      rgba(var(--teal-rgb), 0.3),
      rgba(var(--teal-rgb), 0.3)
    ),
    var(--card);
  box-shadow: inset 0.1875rem 0 0 var(--teal);
}
.summary-row.stopped-row .player-name {
  color: var(--teal-ink); /* --teal-dark assombri : ≥ 3:1 sur la teinte à 30 % */
}
/* « Moi » + un état : même code couleur que l'état mais PLUS SOMBRE (teal
   soutenu si stoppé, coral soutenu si éliminé) — le joueur identifié se
   distingue des autres lignes du même état par la profondeur de la teinte.
   Le liseré repasse à l'or (celui de « moi »), le nom s'assombrit pour rester
   lisible sur la teinte renforcée. */
.summary-row.is-me.stopped-row .summary-row-fg {
  background:
    linear-gradient(0deg, rgba(var(--teal-dark-rgb), 0.42), rgba(var(--teal-dark-rgb), 0.42)),
    var(--card);
  box-shadow: inset 0.1875rem 0 0 var(--gold);
}
.summary-row.is-me.stopped-row .player-name {
  color: var(--teal-ink-deep);
}
.summary-row.is-me.eliminated-row .summary-row-fg {
  background:
    linear-gradient(0deg, rgba(212, 82, 51, 0.32), rgba(212, 82, 51, 0.32)),
    var(--card);
  box-shadow: inset 0.1875rem 0 0 var(--gold); /* l'or de « moi » prime sur le coral */
}
.summary-row.is-me.eliminated-row .player-name {
  color: #9e3417;
}
/* Dark mode: the 14–16% tints over the dark card nearly vanish (and teal-on-teal
   blends in), so strengthen them and use a brighter teal for the stopped row. */
html.theme-dark .summary-row.eliminated-row .summary-row-fg {
  background:
    linear-gradient(0deg, rgba(239, 108, 74, 0.32), rgba(239, 108, 74, 0.32)),
    var(--card);
}
html.theme-dark .summary-row.eliminated-row .player-name {
  color: var(--coral-light);
}
html.theme-dark .summary-row.stopped-row .summary-row-fg {
  background:
    linear-gradient(0deg, rgba(var(--teal-light-rgb), 0.45), rgba(var(--teal-light-rgb), 0.45)),
    var(--card);
}
/* Sur la teinte sombre renforcée, le teal clair du nom se fondrait (teal sur
   teal) : blanc, le badge « Stoppé » porte le code couleur. */
html.theme-dark .summary-row.stopped-row .player-name {
  color: #fff;
}
/* « Moi » + état en sombre : même logique qu'en clair, teinte de l'état
   nettement plus soutenue que celle des autres joueurs du même état. */
html.theme-dark .summary-row.is-me.stopped-row .summary-row-fg {
  background:
    linear-gradient(0deg, rgba(var(--teal-light-rgb), 0.62), rgba(var(--teal-light-rgb), 0.62)),
    var(--card);
}
html.theme-dark .summary-row.is-me.stopped-row .player-name {
  color: #fff;
}
html.theme-dark .summary-row.is-me.eliminated-row .summary-row-fg {
  background:
    linear-gradient(0deg, rgba(239, 108, 74, 0.52), rgba(239, 108, 74, 0.52)),
    var(--card);
}
html.theme-dark .summary-row.is-me.eliminated-row .player-name {
  color: #ffe0d6;
}
/* still-active players: white name on dark (the eliminated/stopped rows keep
   their coral / teal name colors). */
html.theme-dark
  .summary-row:not(.eliminated-row):not(.stopped-row)
  .player-name {
  color: #fff;
}
/* swipe action revealed behind the foreground */
.summary-row-action {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 1.5rem;
  font-size: var(--fs-xl);
  color: #fff;
}
.summary-row-action.is-eliminate {
  background: var(--coral);
}
.summary-row-action.is-restore {
  background: var(--skyjo);
}
.summary-row-action.is-stop {
  background: var(--teal);
}
/* swipe-right action: the foreground uncovers the LEFT edge, so anchor the
   icon there instead of the right */
.summary-row-action.is-right {
  justify-content: flex-start;
  padding-right: 0;
  padding-left: 1.5rem;
}
.summary-row.will-trigger .summary-row-action {
  font-size: var(--fs-2xl); /* subtle grow once past the trigger threshold */
}

/* Plein écran à l'élimination d'un joueur : nom barré sur fond rouge opaque.
   Une seule couche est réutilisée ; les éliminations successives empilent leurs
   noms dans .elim-flash-list. Le fondu de sortie est piloté par .is-leaving (JS)
   pour que la durée s'allonge tant que de nouveaux noms arrivent. */
/* ---------- points perdus (Flip 7 Mode Brutal) ----------
   Tampons « nom −21 » posés au hasard (position + inclinaison, cf.
   js/components/loss-stamps.js) dans la zone centrale. Couche transparente aux
   clics : la partie continue dessous. Chaque tampon arrive de haut et grand,
   s'écrase, rebondit à peine et se cale sur son inclinaison ; à la sortie, il
   tombe comme le nom d'une élimination (cf. elim-flash-fall). */
.loss-stamps {
  position: fixed;
  inset: 0;
  z-index: 85; /* au-dessus des toasts (30), sous les flashs (90) et la célébration (100) */
  pointer-events: none;
}
/* Le voile rouge vit sur un pseudo-élément : il s'efface à la sortie sans
   estomper les tampons, qui restent visibles le temps de tomber. */
.loss-stamps::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(212, 82, 51, 0.18), transparent 70%);
  animation: loss-stamps-in 0.3s ease both;
  transition: opacity 0.4s ease;
}
.loss-stamps.is-leaving::before {
  opacity: 0;
}
.loss-stamp {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  max-width: 60vw;
  padding: 0.5rem 1rem 0.625rem;
  border: 4px solid var(--coral-dark);
  border-radius: 1rem;
  background: var(--card);
  color: var(--coral-dark);
  box-shadow:
    0 0 0 3px var(--card),
    0 10px 28px rgba(0, 0, 0, 0.28);
  transform: translate(-50%, -50%) rotate(var(--tilt, 0deg));
  animation: loss-stamp-slam 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.25) var(--in-delay, 0ms) both;
}
.loss-stamps.is-leaving .loss-stamp {
  animation: loss-stamp-fall 0.42s ease-in var(--out-delay, 0ms) forwards;
}
.loss-stamp-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 900;
  font-size: var(--fs-lg);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.loss-stamp-pts {
  font-weight: 900;
  font-size: clamp(2.5rem, 13vw, 4.5rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
/* 3 tampons ou plus : plus compacts (surtout sur mobile, où la zone est petite). */
.loss-stamps.is-crowded .loss-stamp {
  padding: 0.375rem 0.75rem 0.5rem;
  border-width: 3px;
}
.loss-stamps.is-crowded .loss-stamp-name {
  font-size: var(--fs-md);
}
.loss-stamps.is-crowded .loss-stamp-pts {
  font-size: clamp(2rem, 9vw, 3.75rem);
}
html.theme-dark .loss-stamp {
  border-color: var(--coral);
  color: var(--coral);
}
@keyframes loss-stamp-fall {
  from {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(var(--tilt, 0deg)) scale(1);
  }
  to {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 70vh)) rotate(calc(var(--tilt, 0deg) + var(--spin, 9deg))) scale(1);
  }
}
@keyframes loss-stamps-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes loss-stamp-slam {
  0% {
    opacity: 0;
    transform: translate(-50%, -90%) rotate(calc(var(--tilt, 0deg) * 2.2)) scale(2.3);
  }
  55% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(var(--tilt, 0deg)) scale(0.92);
  }
  78% {
    transform: translate(-50%, -50%) rotate(var(--tilt, 0deg)) scale(1.04);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(var(--tilt, 0deg)) scale(1);
  }
}

.elim-flash {
  position: fixed;
  /* Débordement volontaire : la couche encaisse la secousse de l'impact, et un
     inset nul découvrirait le bord de l'écran le temps qu'elle dure. */
  inset: -14px;
  z-index: 90; /* au-dessus des toasts (30), sous la célébration (100) */
  display: flex;
  flex-direction: column; /* le titre au-dessus du (ou des) nom(s) */
  align-items: center;
  justify-content: center;
  gap: 0.15em;
  padding: 1.5rem;
  background: rgba(212, 82, 51, 0.55); /* --coral-dark, translucide */
  backdrop-filter: blur(3px);
  opacity: 0;
  /* L'impact : le rouge frappe à pleine force puis se calme, le temps que le
     nom se pose, et tout l'écran accuse le coup. */
  animation:
    elim-flash-in 0.5s ease forwards,
    elim-flash-shake 0.45s ease-out both;
  transition: opacity 0.3s ease;
}
.elim-flash.is-leaving {
  opacity: 0;
}
/* Le titre du revers (« Dépassé », « Éliminé »), au-dessus du ou des noms :
   même arrivée tamponnée que le nom, en plus gros. */
.elim-flash-title {
  color: #fff;
  font-weight: 900;
  font-size: clamp(2.25rem, 12vw, 5rem);
  line-height: 0.95;
  text-align: center;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  animation: elim-flash-name 0.42s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
.elim-flash.is-leaving .elim-flash-title {
  animation: elim-flash-fall 0.4s ease-in forwards;
}
.elim-flash-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35em;
  max-width: 90vw;
}
/* Les éclats : une gerbe qui jaillit du nom, comme les étoiles d'un Flip 7 —
   en éclats sombres, eux (mêmes variables --a / --d : angle et distance). */
.elim-flash-burst {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.elim-flash-shard {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 0.15rem;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 8px rgba(90, 20, 5, 0.45);
  transform: translate(-50%, -50%) rotate(var(--a)) translateY(0) scale(0.2);
  opacity: 0;
  animation: elim-flash-shard 0.75s ease-out both;
}
/* Sous un titre, le nom passe au second plan : la taille ci-dessous a été
   calibrée quand il s'affichait SEUL (élimination Flip 7). */
.elim-flash-title ~ .elim-flash-list .elim-flash-name {
  font-size: clamp(1.25rem, 6vw, 2.25rem);
}
.elim-flash-name {
  position: relative;
  color: #fff;
  font-weight: 800;
  font-size: clamp(1.75rem, 10vw, 4rem); /* même taille pour tous les noms */
  text-align: center;
  line-height: 1.1;
  word-break: break-word;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  /* Tamponné : il arrive de trop loin, s'écrase un peu, puis se cale. */
  animation: elim-flash-name 0.42s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
/* La chute : au moment de partir, les noms basculent et tombent (le JS laisse
   le temps à l'animation avant de retirer la couche). */
.elim-flash.is-leaving .elim-flash-name {
  animation: elim-flash-fall 0.4s ease-in forwards;
}
.elim-flash-name.is-plain::after {
  content: none; /* dépassement : il perd sa volée, pas sa place */
}
.elim-flash-name::after {
  content: "";
  position: absolute;
  top: 50%;
  left: -4%;
  height: 0.12em;
  width: 0;
  transform: translateY(-50%);
  border-radius: 0.06em;
  background: #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
  animation: elim-flash-bar 0.55s ease 0.18s forwards;
}
@keyframes elim-flash-in {
  0% { opacity: 0; background-color: rgba(168, 55, 30, 0.92); }
  30% { opacity: 1; background-color: rgba(168, 55, 30, 0.92); }
  100% { opacity: 1; background-color: rgba(212, 82, 51, 0.55); }
}
@keyframes elim-flash-shake {
  0% { transform: translate3d(0, 0, 0); }
  15% { transform: translate3d(-10px, 2px, 0) rotate(-1.2deg); }
  32% { transform: translate3d(9px, -2px, 0) rotate(1deg); }
  50% { transform: translate3d(-6px, 1px, 0) rotate(-0.6deg); }
  70% { transform: translate3d(4px, 0, 0) rotate(0.3deg); }
  100% { transform: translate3d(0, 0, 0); }
}
@keyframes elim-flash-name {
  0% { transform: scale(1.8); opacity: 0; }
  45% { opacity: 1; }
  62% { transform: scale(0.94); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes elim-flash-fall {
  to { transform: translateY(70vh) rotate(9deg); opacity: 0; }
}
@keyframes elim-flash-shard {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(var(--a)) translateY(0) scale(0.2);
  }
  20% { opacity: 1; }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(var(--a)) translateY(calc(var(--d) * -1)) scale(0.75);
  }
}
@keyframes elim-flash-bar {
  from { width: 0; }
  to { width: 108%; }
}
/* Multi-kill (Flip 7 Mode Brutal) : la même couche, en plus sombre et plus
   violente — rouge sang vers le noir, double secousse — et au centre le
   rappel du nombre d'éliminations, « ×N », tamponné en travers puis pulsant. */
.elim-flash.is-multi {
  background:
    radial-gradient(circle at center, rgba(212, 82, 51, 0.5), rgba(40, 8, 2, 0) 65%),
    rgba(70, 14, 4, 0.82);
  animation:
    elim-flash-multi-in 0.6s ease forwards,
    elim-flash-shake 0.45s ease-out both,
    elim-flash-shake 0.4s ease-out 0.5s both;
}
.elim-flash-count {
  color: #fff;
  font-weight: 900;
  font-size: clamp(5rem, 32vw, 12rem);
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
  text-shadow:
    0 0 24px rgba(255, 120, 90, 0.75),
    0 12px 36px rgba(0, 0, 0, 0.55);
  animation:
    elim-flash-count-slam 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.25) 0.08s both,
    elim-flash-count-pulse 0.9s ease-in-out 0.6s infinite;
}
/* Le nom du re-tué, sous le compteur : moins effacé que sous un titre simple. */
.elim-flash.is-multi .elim-flash-list .elim-flash-name {
  font-size: clamp(1.5rem, 8vw, 2.75rem);
}
.elim-flash.is-multi .elim-flash-list {
  margin-top: 0.25em;
}
.elim-flash.is-leaving .elim-flash-count {
  animation: elim-flash-fall 0.4s ease-in forwards;
}
.is-multi .elim-flash-shard {
  background: #ffd5c8;
}
@keyframes elim-flash-multi-in {
  0% { opacity: 0; background-color: rgba(20, 2, 0, 0.95); }
  35% { opacity: 1; background-color: rgba(20, 2, 0, 0.95); }
  100% { opacity: 1; background-color: rgba(70, 14, 4, 0.82); }
}
@keyframes elim-flash-count-slam {
  0% { opacity: 0; transform: scale(3) rotate(-24deg); }
  55% { opacity: 1; transform: scale(0.9) rotate(-6deg); }
  78% { transform: scale(1.06) rotate(-9deg); }
  100% { opacity: 1; transform: scale(1) rotate(-8deg); }
}
@keyframes elim-flash-count-pulse {
  0%, 100% { transform: scale(1) rotate(-8deg); }
  50% { transform: scale(1.07) rotate(-8deg); }
}
@media (prefers-reduced-motion: reduce) {
  .elim-flash,
  .elim-flash-list,
  .elim-flash-title,
  .elim-flash-count,
  .elim-flash.is-leaving .elim-flash-count,
  .elim-flash-name,
  .elim-flash.is-leaving .elim-flash-name,
  .elim-flash-shard,
  .elim-flash-name::after {
    animation-duration: 0.01ms;
  }
  .elim-flash-count { animation-iteration-count: 1; }
  .elim-flash-name::after { width: 108%; }
  .elim-flash-shard { opacity: 0; }
}

/* Flip 7 ! — brève célébration quand un joueur décroche le bonus Flip 7.
   Badge doré + nom + gerbe d'étoiles qui jaillit, puis disparition automatique.
   Rejouée sur les écrans des AUTRES joueurs via le polling (jamais sur l'appareil
   qui l'a saisie) ; un tap la ferme plus tôt. */
.feat-flash {
  position: fixed;
  /* Débordement volontaire : la couche est secouée à l'impact, et un inset nul
     découvrirait le bord de l'écran le temps de la secousse. */
  inset: -14px;
  z-index: 95; /* au-dessus de la dialog de saisie (20), sous la célébration (100) */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  /* glow doré au centre, posé sur un fond teal sombre translucide */
  background:
    radial-gradient(circle at center, rgba(var(--gold-rgb), 0.32), rgba(var(--scrim-rgb), 0) 60%),
    rgba(var(--scrim-rgb), 0.55);
  backdrop-filter: blur(3px);
  animation:
    feat-flash-fade 3s ease forwards,
    feat-flash-jolt 0.5s ease-out both;
}
/* Célébration plein écran : les confettis traversent l'écran, et vite — ils
   n'ont que le temps de la fête. */
.feat-flash .confetti i {
  --fall: 108vh;
}
.feat-flash-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  /* Elle claque à l'arrivée, puis s'envole au moment où la couche s'efface
     (`forwards` et non `both` : sans quoi l'état de départ de la sortie
     écraserait le « pop » pendant les deux secondes d'attente). */
  animation:
    feat-flash-pop 0.5s cubic-bezier(0.2, 1.35, 0.4, 1) both,
    feat-flash-lift 0.55s ease-in 2.45s forwards;
}
/* Le titre de l'exploit : du très gros lettrage doré, nu — ni pastille (sur le
   tableau elle se confondait avec les boutons jaunes de l'app), ni liseré, ni
   icône. Il se détache par sa taille et une ombre portée, pas par un cerne. */
.feat-flash-badge {
  position: relative;
  text-align: center;
  color: var(--gold);
  font-weight: 900;
  font-size: clamp(2.75rem, 14vw, 6.5rem);
  line-height: 0.95;
  letter-spacing: -0.01em;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  /* Le dégradé (background-clip: text, plus bas) n'est peint que dans la boîte :
     avec ce line-height serré, les jambages (g, y) en sortaient, coupés net.
     On agrandit la boîte vers le bas sans décaler ce qui suit. */
  padding-bottom: 0.18em;
  margin-bottom: -0.18em;
}
/* Or : le remplissage est le dégradé du badge, découpé à la forme des lettres.
   L'ombre
   passe par drop-shadow et non text-shadow : sur un texte au remplissage
   transparent, cette dernière se verrait À TRAVERS les lettres. Sous @supports,
   le lettrage doré uni plus haut reste le repli. */
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .feat-flash-badge {
    /* Exactement le dégradé qu'avait le badge doré : --gold-light → --gold-dark,
       à 135°. */
    background-image: linear-gradient(135deg, var(--gold-light), var(--gold-dark));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.45));
  }
}
.feat-flash-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1em;
  max-width: 90vw;
}
.feat-flash-name {
  color: #fff;
  font-weight: 800;
  /* Remonté avec le titre : sous un lettrage de cette taille, l'ancienne
     échelle faisait sous-titre perdu. */
  font-size: clamp(1.5rem, 7vw, 2.5rem);
  text-align: center;
  word-break: break-word;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}
.feat-flash-burst {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
/* L'onde de choc : deux anneaux dorés qui s'ouvrent depuis le badge, le second
   en retard, pour que l'impact ait une épaisseur. */
.feat-flash-ring {
  position: absolute;
  left: 50%;
  top: 45%; /* même ancrage que les étoiles */
  width: 4rem;
  height: 4rem;
  margin: -2rem 0 0 -2rem;
  border-radius: 50%;
  border: 0.2rem solid rgba(var(--gold-rgb), 0.9);
  transform: scale(0.15);
  opacity: 0;
  animation: feat-flash-ring 0.8s ease-out both;
}
.feat-flash-ring.is-late {
  border-width: 0.12rem;
  animation-delay: 0.12s;
}
.feat-flash-ring.is-last {
  border-width: 0.08rem;
  border-color: rgba(255, 255, 255, 0.75);
  animation-delay: 0.26s;
  animation-duration: 1s;
}
.feat-flash-star {
  position: absolute;
  left: 50%;
  top: 45%;
  color: var(--gold);
  font-size: clamp(1rem, 4vw, 1.6rem);
  text-shadow: 0 2px 8px rgba(var(--gold-dark-rgb), 0.6);
  transform: translate(-50%, -50%) rotate(var(--a)) translateY(0) scale(0.2);
  opacity: 0;
  animation: feat-flash-star 1s ease-out both;
}
@keyframes feat-flash-fade {
  /* Un éclair doré à l'impact, qui retombe aussitôt sur la teinte de fond. */
  0% { opacity: 0; background-color: rgba(255, 236, 170, 0.32); }
  8% { opacity: 1; background-color: rgba(255, 236, 170, 0.32); }
  22% { background-color: rgba(var(--scrim-rgb), 0.55); }
  80% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes feat-flash-jolt {
  0% { transform: scale(1.04); }
  18% { transform: scale(1) translate3d(-9px, 4px, 0); }
  36% { transform: translate3d(8px, -4px, 0); }
  56% { transform: translate3d(-5px, 2px, 0); }
  76% { transform: translate3d(3px, -1px, 0); }
  100% { transform: translate3d(0, 0, 0); }
}
@keyframes feat-flash-pop {
  0% { transform: scale(0.25) rotate(-6deg); opacity: 0; }
  42% { transform: scale(1.22) rotate(2deg); opacity: 1; }
  64% { transform: scale(0.94) rotate(-1deg); }
  82% { transform: scale(1.04); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
@keyframes feat-flash-lift {
  to { transform: translateY(-12vh) scale(0.94); opacity: 0; }
}
@keyframes feat-flash-ring {
  0% { opacity: 0; transform: scale(0.1); }
  12% { opacity: 1; }
  100% { opacity: 0; transform: scale(5); }
}
@keyframes feat-flash-star {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(var(--a)) translateY(0) scale(0.2);
  }
  25% { opacity: 1; }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(var(--a)) translateY(calc(var(--d) * -1))
      rotate(var(--r, 0deg)) scale(var(--s, 1));
  }
}
@media (prefers-reduced-motion: reduce) {
  .feat-flash,
  .feat-flash-card,
  .feat-flash-ring,
  .feat-flash-star {
    animation-duration: 0.01ms;
  }
  .feat-flash-star,
  .feat-flash-ring {
    opacity: 0;
  }
}

tfoot td {
  padding-top: 0.625rem;
}
/* Pied du tableau des statistiques : nombre de joueurs classés. */
.stats-table .stats-count {
  text-align: center;
  font-size: var(--fs-sm);
  font-weight: 700;
}
tfoot td .btn-icon {
  display: inline-flex;
  margin: 0 auto;
}

/* big "new scores" button on the scoreboard screen */
.new-scores-bar {
  display: flex;
  justify-content: center;
}
.btn-big {
  min-height: 4rem;
  padding: 1.125rem 3rem;
  font-size: var(--fs-xl);
  letter-spacing: 0.5px;
  width: 100%;
  max-width: 27.5rem;
}
/* Very narrow screens: drop the big action buttons' icons to keep the label fitting. */
@media (max-width: 350px) {
  .btn-big i {
    display: none;
  }
}
/* Tiniest screens: shrink the big action buttons' label so it still fits.
   `.btn.btn-big` (higher specificity) so it beats the 40rem `.btn-big` rule that
   also matches at this width. */
@media (max-width: 320px) {
  .btn.btn-big {
    font-size: var(--fs-md); /* 16px */
  }
}

/* turn-based action bar (Qwirkle): score button + "Terminer" side by side */
.new-scores-bar.turn-bar {
  gap: 0.5rem;
  width: 100%;
  max-width: 32rem;
  margin: 0 auto;
}
.new-scores-bar.turn-bar .btn-big {
  width: auto;
  max-width: none;
  flex: 1 1 auto;
}
/* "Dernière tuile" toggle in the Qwirkle score dialog — inline with the input and
   the "A pioché" button. Active = saving will close the game (gold, like a win). */
.last-tile-btn {
  color: var(--teal-dark);
  border-color: var(--teal-light);
}
.last-tile-btn.active {
  background: var(--gold);
  color: var(--ink);
  border-color: var(--gold-dark);
}

/* "Qui commence ?" starter picker */
/* Liste de choix « qui commence ? » / « qui distribue ? ». En équipes, le bouton
   porte aussi les joueurs sous le nom (cf. entityChoiceHTML) : il s'empile donc
   en colonne, au lieu de poser la sous-ligne à côté du nom. `gap` remis à zéro
   sur l'axe principal — celui de .btn (1rem) séparerait les deux lignes. */
.starter-item {
  width: 100%;
  flex-direction: column;
  justify-content: center;
  gap: 0.1rem;
  min-height: 3.25rem;
  font-size: var(--fs-md);
  font-weight: 800;
}
/* La sous-ligne suit la couleur du bouton, en retrait : `muted` la rendrait
   grise sur un fond déjà clair, et illisible sur un bouton plein. */
.starter-item .name-sub {
  margin-top: 0;
  color: inherit;
  opacity: 0.7;
}
/* Choisir n'est pas toujours partir : à la pétanque, l'équipe désignée reste à
   l'écran pendant qu'on saisit ses points. Sélection teal pleine, comme partout
   ailleurs dans l'app (la sous-ligne suit, cf. `color: inherit`). */
.starter-item.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
  box-shadow: var(--shadow-teal-glow);
}

/* single-player turn entry */
.turn-meta {
  color: var(--muted);
  font-weight: 700;
}
.turn-entry .entry-controls {
  width: 100%;
  flex-wrap: wrap; /* garde input + "A pioché" + "Dernière tuile" en ligne ; replie seulement si l'écran est vraiment trop étroit */
}
.turn-entry .cell-input {
  flex: 1;
  font-size: var(--fs-xl);
}

/* turn-by-turn details table (Qwirkle) */
/* Tables tour par tour (Qwirkle, Contrée, Fléchettes, Mölkky) : une ligne par
   tour, la colonne « Tour » précède le nom → un nom collant à gauche la
   recouvrait, puis masquait les points en défilant. Sur mobile, cellules
   resserrées pour que points et total tiennent à l'écran. */
table.score.turn-table {
  min-width: 0; /* la largeur plancher des grilles joueurs × manches forçait le défilement */
}
table.score.turn-table .player-name {
  position: static;
}
table.score.turn-table .ct-bid {
  white-space: normal;
  min-width: 7rem;
}
@media (max-width: 30rem) {
  table.score.turn-table th,
  table.score.turn-table td {
    padding: 0.625rem 0.375rem;
  }
  table.score.turn-table thead th {
    white-space: normal; /* « Emma & Gaspard » sur deux lignes plutôt que hors écran */
  }
  table.score.turn-table .cell-edit {
    width: auto;
    min-width: 3rem;
    padding-inline: 0.375rem;
  }
  table.score.turn-table .btn-icon {
    padding-inline: 0.5rem; /* × de suppression : ne pas déborder de la carte */
  }
  table.score.turn-table .darts-detail-cell {
    white-space: normal; /* « T20 · T20 · T20 » replié pour garder « Reste » à l'écran */
    min-width: 4.5rem;
    font-size: var(--fs-sm);
  }
}
.turn-table .turn-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  height: 1.75rem;
  padding: 0 0.375rem;
  border-radius: var(--r-round);
  background: var(--teal-bg);
  color: var(--teal-dark);
  font-weight: 800;
}
.turn-table .cell-box {
  position: relative;
}
.turn-table .draw-tag {
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  background: var(--coral);
  color: #fff;
  font-size: var(--fs-3xs);
  font-weight: 800;
  line-height: 1;
  padding: 0.25rem 0.375rem;
  border-radius: var(--r-round);
  box-shadow: var(--shadow-sm);
}
/* Last-tile +6 bonus badge: gold (a reward), vs the coral "Pioche" tag. */
.turn-table .draw-tag.last-tile-tag {
  background: var(--gold);
  color: var(--ink);
}

/* ---------- Contrée ---------- */
/* current bid shown as a white card above the scoreboard (no left border):
   dealer on the left, bid opposed on the right */
.bid-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.375rem 1rem;
  justify-content: space-between;
  font-size: var(--fs-md);
}
.bid-dealer {
  color: var(--teal-dark);
  font-weight: 700;
}
.bid-current {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.375rem;
}
/* score dialog: bid recap styled like .bid-current (no card), centered */
.deal-bid {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 1rem;
  font-size: var(--fs-md);
}
/* Belote (+20) toggle, in the green Contrée accent */
.belote-btn {
  white-space: nowrap;
  color: var(--contree-dark);
  border-color: rgba(111, 158, 105, 0.5);
}
.belote-btn.active {
  background: var(--contree);
  color: #fff;
  border-color: var(--contree);
  box-shadow: 0 2px 8px var(--contree-glow);
}
/* contract made / failed message */
.contract-msg {
  margin-top: 0.875rem;
  padding: 0.625rem 0.875rem;
  border-radius: var(--r-md);
  background: rgba(39, 174, 96, 0.12);
  color: #1e7e44;
  font-weight: 700;
  font-size: var(--fs-sm);
  text-align: center;
}
.contract-msg.fail {
  background: rgba(239, 108, 74, 0.14);
  color: var(--coral-dark);
}
.bid-contract {
  font-weight: 800;
  font-size: var(--fs-md);
  color: var(--text);
}
.suit,
.suit-sym {
  font-size: var(--fs-xl);
  line-height: 1;
}
.suit {
  color: var(--ink); /* black suits ♠ ♣ */
}
.suit.red {
  color: #d4322f; /* red suits ♥ ♦ */
}
.bid-coinche {
  padding: 0.125rem 0.5rem;
  border-radius: var(--r-round);
  background: var(--coral);
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: 800;
}
/* bid dialog: suit / team / coinche pickers */
/* suits: two per row, each in its real colour (red ♥ ♦, black ♠ ♣) */
.suit-picker {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}
.suit-btn {
  appearance: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-height: 3rem;
  border: 2px solid var(--teal-light);
  background: var(--card);
  color: var(--ink); /* black suits (symbol + label) */
  border-radius: var(--r-md);
  font-weight: 800;
  font-size: var(--fs-md);
}
.suit-btn.red {
  color: #d4322f; /* red suits at rest */
}
/* active suit takes its real colour: black for ♠ ♣, red for ♥ ♦ */
.suit-btn.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  box-shadow: var(--shadow-md);
}
.suit-btn.red.active {
  background: #d4322f;
  border-color: #d4322f;
  color: #fff;
}
.pick-btn {
  flex: 1;
  appearance: none;
  cursor: pointer;
  min-height: 2.75rem;
  padding: 0.5rem 0.75rem;
  border: 2px solid var(--teal-light);
  background: var(--card);
  color: var(--teal-dark);
  border-radius: var(--r-round);
  font-weight: 800;
  font-size: var(--fs-sm);
  white-space: nowrap;
}
.pick-btn.active {
  border-color: var(--contree-dark);
  background: var(--contree);
  color: #fff;
  box-shadow: 0 2px 10px var(--contree-glow);
}
/* contract segmented control: buttons sized to content, wrapping when needed */
.contract-picker .pick-btn {
  flex: 0 0 auto;
  min-height: 2.5rem;
  padding: 0.5rem 1rem;
}
/* running total under each deal's points in the details table */
.run-total {
  display: block;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--muted);
}

/* round entry */
.entry-player {
  position: relative; /* anchors the Brutal Flip 7 +15/−15 effect badge */
  display: flex;
  align-items: center;
  gap: 1rem 0.5rem;
  background: var(--teal-bg);
  border: 1.5px solid rgba(var(--teal-rgb), 0.2);
  border-left: 6px solid var(--teal-light);
  border-radius: var(--r-lg);
  padding: 0.75rem 1rem;
  box-shadow: var(--shadow-sm);
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}
.entry-player .pname {
  flex: 1;
  font-weight: 800;
  color: var(--teal-dark);
}
.entry-controls {
  display: flex;
  align-items: center;
  gap: 1rem 0.5rem;
}
/* Action buttons show their text label; the icon is a compact fallback swapped
   in on very narrow screens (≤400px) so the row stays on one line. */
.entry-controls .btn-ico {
  display: none;
}
@media (max-width: 400px) {
  .entry-controls .btn-label {
    display: none;
  }
  .entry-controls .btn-ico {
    display: inline-block;
    font-size: var(--fs-md);
  }
}

/* ± sign toggle for games that allow negative scores (Skyjo) */
.sign-btn {
  font-weight: 800;
  font-size: var(--fs-lg);
  min-width: 2.75rem;
  color: var(--teal-dark);
}

/* Flip7 bonus toggle button — sky blue */
.flip7-btn {
  color: var(--sky);
  border-color: rgba(93, 173, 226, 0.55);
}
.flip7-btn.active {
  background: var(--sky);
  color: #fff;
  border-color: var(--sky);
  box-shadow: var(--shadow-sky-glow);
}

/* Éliminé (bust) button — coral */
.bust-btn {
  color: var(--coral-dark);
  border-color: var(--coral-light);
}
.bust-btn.active {
  background: var(--coral);
  color: #fff;
  border-color: var(--coral);
  box-shadow: var(--shadow-coral-glow);
  animation: boom-pulse 2s infinite;
}
/* Brutal : « − ×2 + », à la place du Flip 7 d'un éliminé — habillé comme le
   bouton Éliminé au repos (bord corail, fond carte). */
.kills-stepper {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  height: 2.25rem;
  box-sizing: border-box;
  border: 2px solid var(--coral-light);
  border-radius: var(--r-round);
  background: var(--card);
  color: var(--coral-dark);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.kills-stepper[hidden] {
  display: none;
}
.kills-btn {
  appearance: none;
  border: none;
  background: none;
  color: inherit;
  width: 2rem;
  height: 100%;
  padding: 0;
  font-size: 0.875rem;
  cursor: pointer;
}
.kills-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.kills-count {
  min-width: 1.75rem;
  text-align: center;
  font-weight: 900;
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}

/* entry row in BOOM state */
.entry-player.busted {
  border-color: rgba(239, 108, 74, 0.35);
  border-left-color: var(--coral);
  background: linear-gradient(
    90deg,
    rgba(239, 108, 74, 0.16),
    var(--teal-bg) 55%
  );
}
.entry-player.busted .pname {
  color: var(--coral-dark);
}
/* entry row with Flip7 active */
.entry-player.flipped {
  border-color: rgba(93, 173, 226, 0.4);
  border-left-color: var(--sky);
  background: linear-gradient(
    90deg,
    rgba(93, 173, 226, 0.16),
    var(--teal-bg) 55%
  );
}
.entry-player.flipped .pname {
  color: var(--sky);
}
/* Brutal (Vengeance): top-right badge on a score-entry row showing the +15/−15
   that player receives this round (their own kept Flip 7, or one redirected to
   them by an opponent). */
/* Brutal : le champ de score porte le badge +15/−15 reçu (coin haut droit). */
.f7-input-wrap {
  position: relative;
  display: inline-flex;
  min-width: 0;
}
.entry-focus .f7-input-wrap {
  flex: 1; /* le champ remplit la carte, comme sans enveloppe */
}
.entry-focus .f7-input-wrap > .cell-input {
  width: 100%;
}
.flip7-effect-badge {
  position: absolute;
  top: -10px;
  right: -6px;
  min-width: 2rem;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-weight: 900;
  font-size: var(--fs-sm);
  text-align: center;
  color: #fff;
  border: 2px solid var(--card, #fff);
  box-shadow: var(--shadow-sm);
  z-index: 2;
}
.flip7-effect-badge.is-plus {
  background: var(--sky);
}
.flip7-effect-badge.is-minus {
  background: var(--coral);
}
.flip7-effect-badge[hidden] {
  display: none;
}
/* +15 / −15 badges in the Flip 7 destination dialog */
.yams-fixed.f7-plus {
  color: var(--sky);
}
.yams-fixed.f7-minus {
  color: var(--coral-dark);
}

/* ×2 doubling toggle (Skyjo) — green like the Skyjo accent */
/* « A terminé la manche » (Skyjo) : on désigne le premier sorti, et c'est le
   calcul qui décide du ×2 — la ligne s'allume alors d'elle-même (.doubled). */
.closer-btn {
  font-weight: 900;
  color: var(--skyjo-dark);
  border-color: rgba(81, 180, 124, 0.55);
}
.closer-btn.active {
  background: linear-gradient(135deg, var(--skyjo), var(--skyjo-dark));
  color: #fff;
  border-color: var(--skyjo-dark);
  box-shadow: 0 2px 12px var(--skyjo-glow);
}
/* ligne dont le score est doublé (pénalité du premier sorti) */
.entry-player.doubled {
  border-color: rgba(81, 180, 124, 0.4);
  border-left-color: var(--skyjo);
  background: linear-gradient(
    90deg,
    rgba(81, 180, 124, 0.16),
    var(--teal-bg) 55%
  );
}
.entry-player.doubled .pname {
  color: var(--skyjo-dark);
}

/* ---------- guided score entry (one player at a time) ---------- */
/* The stepper reuses .entry-player but lays it out as a big centered card. */
/* title + sub-line stacked at the left of the dialog header */
/* Each setup step lays its fields out in a column with a consistent gap. Scoped
   to :not([hidden]) so the flex `display` doesn't override the `hidden`
   attribute (which only sets display:none) and reveal every step at once. Hidden
   option fields drop out of the flow, so games with no options get no extra
   space before the players list. */
.setup-step-panel:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
/* Step indicator under the setup dialog title, e.g. "Étape 2/3 · Joueurs". */
.setup-step-indicator {
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.3px;
  color: var(--muted);
}
.turn-meta.step-progress {
  margin: 0;
  font-weight: 800;
  font-size: var(--fs-sm);
  color: var(--muted);
}
/* current player's name, centered in the dialog header (overlays the middle, so
   it stays centered regardless of the side blocks; ellipsised if too long) */
.head-player {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: 55%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  pointer-events: none;
}
/* Mobile : un statut long sous le titre (Mölkky « Dépasse 50 → retombe à 25 »,
   fléchettes « Reste … ») passait sous le nom centré. Le nom se cale alors sur
   la ligne du titre, le statut garde la ligne du dessous pour lui. */
@media (max-width: 30rem) {
  .rules-dialog-head:has(.turn-meta):not(:has(.head-player-sub)) .head-player {
    top: 1rem;
    transform: translateX(-50%);
    max-width: 40%;
  }
}
.head-player-name {
  font-weight: 900;
  font-size: var(--fs-xl);
  color: var(--teal-dark);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  /* Re-rendered on every focus-card step, so this pops on each player change —
     making the round's player handoff as visible as the turn-based dialogs. */
  animation: turn-name-pop 0.45s var(--bounce);
}
.head-player-sub {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--muted);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* the name now lives in the header, so drop it from the focus card */
.entry-focus .entry-player .pname {
  display: none;
}
.entry-focus {
  margin: 0;
}
/* single line: the input fills the available width, the per-game action buttons
   sit beside it. No card chrome here — the row sits flat on the dialog (the
   teal/green background, accent border and shadow are dropped, states included).
   Button active states still convey Flip 7 / Éliminé. */
.entry-focus .entry-player,
.entry-focus .entry-player.busted,
.entry-focus .entry-player.flipped,
.entry-focus .entry-player.doubled {
  gap: 0.5rem;
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
}
.entry-focus .entry-controls {
  flex: 1; /* fill the card width (the name is hidden) */
  flex-wrap: nowrap;
  gap: 0.5rem;
  padding: 0.5rem;
}
.entry-focus .cell-input {
  flex: 1;
  width: auto;
  min-width: 0; /* let it shrink so the buttons stay on the same line */
  height: 3.25rem;
  font-size: var(--fs-2xl);
  text-align: center;
}

/* Brutal malus step: one row per eliminated player — name + the quick-pick
   −2…−10 buttons on a single line (cumulative: the score is the sum of the
   active ones). The name truncates so the buttons always fit. */
.bust-malus-row {
  gap: 0.5rem;
}
.bust-malus-row .pname {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.malus-btns {
  display: flex;
  gap: 0.375rem;
}
.malus-btn {
  width: 3.5rem; /* fixed: −2 and −10 render the same size */
  min-width: 0;
  padding: 0.5rem 0;
  font-weight: 800;
  font-size: var(--fs-md);
  color: var(--coral-dark);
  border-color: var(--coral-light);
}
.malus-btn.active {
  background: var(--coral);
  color: #fff;
  border-color: var(--coral);
  box-shadow: var(--shadow-coral-glow);
}

/* recap step: tappable list of every player + their round score */
.recap-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  appearance: none;
  cursor: pointer;
  background: var(--teal-bg);
  border: 1.5px solid rgba(var(--teal-rgb), 0.2);
  border-left: 6px solid var(--teal-light);
  border-radius: var(--r-lg);
  padding: 0.75rem 1rem;
  font-family: inherit;
  box-shadow: var(--shadow-sm);
  transition: filter 0.15s ease;
}
.recap-row:hover {
  filter: brightness(1.03);
}
.recap-row.is-bust {
  border-left-color: var(--coral);
}
.recap-name {
  flex: 1;
  font-weight: 800;
  font-size: var(--fs-lg);
  color: var(--teal-dark);
}
.recap-val {
  font-weight: 900;
  font-size: var(--fs-xl);
  color: var(--teal-dark);
  min-width: 2.5rem;
  text-align: right;
}
.recap-tag {
  font-weight: 800;
  font-size: var(--fs-xs);
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
}
.recap-tag.is-bust {
  color: #fff;
  background: var(--coral);
}
.recap-tag.is-flip7 {
  color: #fff;
  background: var(--sky);
}
.recap-tag.is-dbl {
  color: #fff;
  background: var(--skyjo);
}
/* Le premier sorti de la manche (Skyjo). Contour plutôt que fond plein : il dit
   un rôle, pas un effet sur le score — le ×2 à côté, lui, dit ce qu'il coûte
   (ils cohabitent quand la pénalité tombe). */
.recap-tag.is-closer {
  display: inline-block;
  margin-left: 0.5rem;
  vertical-align: middle;
  white-space: nowrap;
  color: var(--skyjo-dark);
  background: transparent;
  border: 2px solid rgba(81, 180, 124, 0.55);
  padding: 0 0.5rem;
}
/* Brutal: −15 taken from a redirected Flip 7 (already folded into the value) */
.recap-tag.is-f7malus {
  color: #fff;
  background: var(--coral);
}

/* ---------- modal ---------- */
.overlay {
  position: fixed;
  /* Recadré sur la zone réellement visible via --vvh (posée par js/viewport.js
     depuis window.visualViewport) : à l'ouverture du clavier mobile, le voile
     rétrécit à l'espace au-dessus du clavier et `place-items:center` y centre le
     dialog — toujours à la même hauteur, quelle que soit la barre d'adresse. Sans
     cette variable (desktop), le fallback 100dvh = plein écran. La transition lisse
     la remontée à l'ouverture du clavier (instantanée sous .reduce-motion, qui
     force transition-duration à ~0).
     NB : ce recadrage ne sert qu'au CENTRAGE ; le fond sombre est peint par
     .overlay::before (plein écran), sinon son bord remonterait avec le voile et
     laisserait une bande claire au-dessus du clavier.
     Seuls les dialogs de saisie SIMPLE (classe kb-fit, opt-in via mountDialog)
     sont recadrés : les dialogs complexes (contrats Yam's/Bombu…) restent en
     plein écran natif — le recadrage s'y battait avec le layout.
     --vvt suit le PAN du visual viewport (iOS décale la zone visible pour
     révéler un champ focusé) : le voile reste collé à la zone visible au lieu
     de partir au-dessus de l'écran. PAS de transition sur top : iOS anime déjà
     le pan lui-même — un lissage par-dessus ferait « courir » l'overlay derrière
     la zone visible avec 250 ms de retard. */
  top: 0;
  left: 0;
  right: 0;
  height: 100dvh;
  display: grid;
  place-items: center;
  z-index: 20;
  /* En PWA (viewport-fit=cover), l'overlay couvre tout l'écran, derrière
     l'encoche / Dynamic Island (haut) et l'indicateur d'accueil (bas). On pad
     par les safe areas pour que la dialog centrée — et surtout son en-tête /
     pied fixes — ne passe jamais sous ces zones. env() = 0 sans inset. */
  padding:
    calc(1rem + env(safe-area-inset-top))
    calc(1rem + env(safe-area-inset-right))
    calc(1rem + env(safe-area-inset-bottom))
    calc(1rem + env(safe-area-inset-left));
}
/* Saisie simple : recadré au-dessus du clavier (voir js/viewport.js). */
.overlay.kb-fit {
  top: var(--vvt, 0px);
  height: var(--vvh, 100dvh);
  transition: height 0.25s ease;
}
/* Libéré en fin de saisie (étape sans champ) : retour immédiat, sans suivre
   le clavier qui se range. */
.overlay.kb-fit.kb-released {
  transition: none;
}
/* Fond sombre + flou, DÉCOUPLÉ du recadrage : il couvre tout l'écran (plein
   100dvh), y compris derrière le clavier, pendant que .overlay (ci-dessus) se
   réduit à la zone visible pour y centrer le dialog. z-index:-1 → derrière le
   dialog (enfant de .overlay) mais devant la page. */
.overlay::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  /* +--vvt : quand le visual viewport est pané (iOS révèle un champ), la zone
     visible descend d'autant — on rallonge le fond pour qu'il la couvre. */
  height: calc(100dvh + var(--vvt, 0px));
  z-index: -1;
  background: rgba(var(--scrim-rgb), 0.45);
  backdrop-filter: blur(3px);
}
/* Lock background scroll whenever any dialog is open. On fige le scroll de DOCUMENT
   à la racine (<html>) : overflow:hidden sur <html> stoppe le scroll de page sans
   rogner les éléments fixed (l'overlay) — contrairement à overflow:hidden sur <body>. */
html:has(.overlay) {
  overflow: hidden;
}
.modal {
  background: var(--card);
  border-radius: var(--r-xl);
  padding: 1rem;
  width: 100%;
  max-width: 26.25rem;
  box-shadow: var(--shadow-lg);
}
/* Le dialog reçoit le focus à l'ouverture (js/ui.js) : pas d'anneau sur la
   boîte entière, seulement sur ses contrôles. */
.modal:focus {
  outline: none;
}
.modal h3 {
  color: var(--teal-dark);
  font-size: var(--fs-xl);
  margin-bottom: 0.625rem;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
/* Center the badge label inside its pill (all-caps + line-height:1 otherwise
   sits a hair high). */
.modal h3 .mode-beta {
  display: inline-flex;
  align-items: center;
}
/* Texte courant des dialogs : 14 px partout (confirmations, explications ;
   les descriptions d'options suivent, cf. .setup-opt-desc) — sauf les règles,
   texte de lecture, qui gardent la taille courante. */
.modal p {
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.5;
  font-weight: 500;
}
.modal .rules-dialog-body p {
  font-size: var(--fs-md);
  line-height: 1.55;
}
/* Button row in the simple confirm/prompt dialogs: keep it off the content above
   (these have no card foot; the row is a direct child of .modal). */
.modal > .row {
  margin-top: 1.25rem;
}
.modal .row {
  justify-content: flex-end;
}
/* Rangées de boutons des dialogs simples (confirmation, hors connexion, filtre,
   récap de manche…) : boutons EMPILÉS, pleine largeur, le principal en haut
   (il est le dernier dans le DOM, d'où column-reverse). Côte à côte, deux
   libellés un peu longs (« Continuer d'attendre » / « Passer hors connexion »)
   passaient chacun sur deux lignes. Les pieds des grands dialogs
   (.scores-dialog-foot, ww-foot) gardent leur rangée : flèche de retour +
   Annuler + Suivant, déjà réduits à leur icône sur petit écran. */
.modal .row:not(.ww-foot):has(> .btn ~ .btn) {
  flex-direction: column-reverse;
  align-items: stretch;
  gap: 0.625rem;
}
.modal .row:not(.ww-foot):has(> .btn ~ .btn) > .btn {
  width: 100%;
  justify-content: center;
}
.modal .row:not(.ww-foot):has(> .btn ~ .btn) > .u-flex-1 {
  display: none;
}

/* rules dialog (opened from the top bar): fixed header, scrollable body */
.modal-rules {
  max-width: 50rem;
  height: 100%;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.rules-dialog-head {
  position: relative; /* anchors the centered .head-player overlay */
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1rem;
  border-bottom: 2px solid var(--teal-bg);
}
.rules-dialog-head h3 {
  margin: 0;
  border: none;
  padding: 0;
  color: var(--teal-dark);
  font-size: var(--fs-xl);
}
.modal-close {
  appearance: none;
  margin-left: auto;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  font-size: var(--fs-lg);
  padding: 0.25rem 0.5rem;
  border-radius: var(--r-sm);
}
.modal-close:hover {
  background: var(--teal-bg);
  color: var(--teal-dark);
}
.rules-dialog-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1rem 1rem;
}
.rules-dialog-body .rules-tabs {
  margin-bottom: 0.875rem;
}

/* ---------- Settings dialog (top-bar gear): theme + language ---------- */
.settings-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.settings-head h3 {
  margin: 0;
}
.settings-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1rem;
}
/* Réglages (app et lieu) : bornés à la hauteur de l'écran — l'en-tête reste,
   le corps défile. Le corps déborde dans le padding du dialog (marges
   négatives) pour que les contours et ombres des options ne soient pas rognés
   par le défilement. */
.modal-settings {
  max-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-settings .settings-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 0.5rem -1rem -1rem;
  padding: 0.5rem 1rem 1rem;
}
.settings-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.settings-label {
  font-weight: 800;
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
/* Icône d'ouverture en tête d'une option (Réglages → « Nous écrire »). */
.setup-opt-icon {
  flex: 0 0 auto;
  width: 1.5rem;
  text-align: center;
  font-size: var(--fs-lg);
  color: var(--teal);
}

/* ---------- Demande de support (js/dialogs/support.js) ---------- */
.modal-support .support-intro {
  margin: 0;
}
/* Type de demande : quatre tuiles sur une ligne, chacune avec sa couleur
   (pastille d'icône teintée ; la tuile choisie prend la couleur pleine et une
   coche). --tc = couleur du type, --tc-rgb pour les teintes, --tc-ink = icône
   sur teinte claire, --tc-on = icône sur la pastille pleine. */
.support-types {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}
.support-types [data-type="bug"] {
  --tc: var(--coral);
  --tc-rgb: 239, 108, 74;
  --tc-ink: var(--coral-dark);
  --tc-on: #fff;
}
.support-types [data-type="feature"] {
  --tc: var(--gold);
  --tc-rgb: var(--gold-rgb);
  --tc-ink: var(--gold-dark);
  --tc-on: #233038;
}
.support-types [data-type="game"] {
  --tc: var(--teal);
  --tc-rgb: var(--teal-rgb);
  --tc-ink: var(--teal-dark);
  --tc-on: #fff;
}
.support-types [data-type="other"] {
  --tc: var(--muted);
  --tc-rgb: 107, 139, 136;
  --tc-ink: var(--muted);
  --tc-on: #fff;
}
.support-types button {
  position: relative;
  appearance: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.375rem;
  padding: 0.625rem 0.25rem 0.5rem;
  border: 2px solid rgba(var(--tc-rgb), 0.25);
  background: var(--card);
  color: var(--text);
  border-radius: var(--r-md);
  font-weight: 700;
  font-size: var(--fs-sm);
  line-height: 1.15;
  text-align: center;
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease;
}
.support-types .support-type-icon {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: rgba(var(--tc-rgb), 0.16);
  color: var(--tc-ink);
  font-size: var(--fs-lg);
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}
.support-types button:hover {
  border-color: rgba(var(--tc-rgb), 0.6);
}
.support-types button:active {
  transform: var(--press-scale);
}
.support-types button.active {
  border-color: var(--tc);
  background: rgba(var(--tc-rgb), 0.1);
  font-weight: 800;
  box-shadow: 0 2px 10px rgba(var(--tc-rgb), 0.25);
}
.support-types button.active .support-type-icon {
  background: var(--tc);
  color: var(--tc-on);
}
/* Coche de la tuile choisie, à cheval sur le coin haut droit. */
.support-types .support-type-check {
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  display: none;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--tc);
  color: var(--tc-on);
  font-size: 0.6875rem;
  box-shadow: 0 0 0 2px var(--card);
}
.support-types button.active .support-type-check {
  display: grid;
}
/* Mêmes champs que input[type=text] (fond crème, bordure, focus turquoise). */
.support-form textarea,
.support-form input[type="email"] {
  background: var(--cream);
  border: 2px solid rgba(35, 48, 56, 0.18);
  color: var(--text);
  border-radius: var(--r-md);
  padding: 0.75rem 0.875rem;
  font-size: var(--fs-md);
  font-weight: 600;
  outline: none;
  width: 100%;
}
.support-form textarea {
  resize: none;
  min-height: 8rem;
  line-height: 1.4;
}
.support-form textarea:focus,
.support-form input[type="email"]:focus {
  border-color: var(--teal);
  box-shadow: var(--shadow-focus);
}
.support-hint {
  margin: 0;
  font-size: var(--fs-sm);
}
.support-error {
  margin: 0;
  color: var(--coral);
  font-weight: 700;
}
/* Captcha Turnstile (interaction-only) : invisible, il garde pourtant son
   iframe (hauteur nulle) dans le flux — qui doublerait l'espacement du
   formulaire. On annule cet écart tant que la case n'est pas affichée
   (.is-open, posée par support.js). Pas de display:none : l'iframe doit
   continuer de tourner pour obtenir le jeton. */
.support-captcha:not(.is-open) {
  margin-top: -1.25rem; /* = gap de .settings-body */
}
/* Champ piège anti-robots : hors écran, jamais vu ni atteint au clavier. */
.support-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.support-send {
  width: 100%;
}
/* Version de l'app : SHA + date, puis l'état (à jour / mise à jour dispo). */
.settings-version {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: var(--fs-md);
}
/* Tout sur une ligne : numéro, pastille d'alerte, puis le bouton calé à droite.
   L'état (texte, hors mise à jour) se replie sur deux lignes si la place manque. */
.settings-version-value,
.settings-version .btn {
  flex-shrink: 0;
}
.settings-version .btn {
  margin-left: auto;
}
/* Pastille rouge « nouvelle version » : même gabarit que le numéro. */
.settings-version-alert {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 1.625rem;
  padding: 0 0.5rem;
  border-radius: var(--r-sm, 0.375rem);
  background: var(--coral);
  color: #fff;
  font-size: var(--fs-sm);
}

.settings-version-id {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  padding: 0.125rem 0.5rem;
  border-radius: var(--r-sm, 0.375rem);
  background: var(--teal-bg);
  color: var(--teal-dark);
}
.settings-version-status {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-width: 0;
  line-height: 1.25;
  font-weight: 700;
  font-size: var(--fs-sm);
}
.settings-version-status.is-ok {
  color: var(--teal-dark);
}
/* Carte « Qui suis-je ? » : même habillage que les options à toggle, avec un
   dropdown (joueurs connus du lieu) à la place de l'interrupteur. */
.setup-opt.settings-me {
  cursor: default;
}
.settings-me-select {
  flex: 0 1 auto;
  width: auto;
  min-width: 0;
  max-width: 45%;
  font-size: var(--fs-md);
  padding: 0.5rem 2.25rem 0.5rem 0.875rem;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  /* la carte porte déjà sa bordure : le select reste nu (le chevron suffit) */
  border: none;
  box-shadow: none;
}

/* Segmented control: a tinted track holding equal-width segments; the selected
   one becomes a raised pill (iOS-style). */
.segmented {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  background: var(--teal-bg);
  border-radius: var(--r-round);
}
.segmented button {
  appearance: none;
  cursor: pointer;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: var(--fs-sm);
  padding: 0.5rem 0.5rem;
  border-radius: var(--r-round);
  transition: var(--transition-tab);
}
.segmented button > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.segmented button:hover {
  color: var(--teal-dark);
}
.segmented button:active {
  transform: var(--press-scale);
}
.segmented button.active {
  background: var(--card);
  color: var(--teal-dark);
  box-shadow: var(--shadow-sm);
}
.segmented .seg-flag {
  font-size: var(--fs-md);
  line-height: 1;
  flex: 0 0 auto;
}
/* Dark theme: --teal-bg (#163330) sits right on top of the card (#18322e), so
   the track vanishes. Recess it onto --surface (the darkest page token) so the
   track reads, and lift the active pill onto --cream to keep it raised above. */
html.theme-dark .segmented {
  background: var(--surface);
}
html.theme-dark .segmented button.active {
  background: var(--cream);
  color: var(--teal-dark);
}

/* scores dialog: fixed header, scrollable body, fixed footer */
.modal-scores {
  max-width: 50rem;
  max-height: 100%;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
/* Rename-player dialog reuses the head/body/foot structure (each carries its own
   padding), so drop the base .modal padding to avoid doubling it. Keeps the
   default narrow modal width. */
.modal-rename {
  padding: 0;
  overflow: hidden;
}

/* ---------- Player profile dialog (opened from the stats leaderboard) ---------- */
/* Same head/body shell as the rename dialog (no base padding, the head/body
   carry their own), but with a flexible height so the stat grid can grow. */
.modal-profile {
  padding: 0;
  overflow: hidden;
  max-height: 100%;
  display: flex;
  flex-direction: column;
}
/* Swipe horizontal (bascule Stats ↔ Succès) : le body ne pan que verticalement
   en natif, les gestes horizontaux restent délivrés aux pointer events. */
.modal-profile .scores-dialog-body {
  touch-action: pan-y;
}
/* Name + pencil on the first line, the game name (.profile-sub) beneath them;
   the close button pushes to the right via its own margin-left:auto. */
.profile-head {
  gap: 0.625rem;
  align-items: flex-start;
}
.profile-head-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}
.profile-title-row {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  min-width: 0;
}
.profile-name {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-edit {
  appearance: none;
  flex: 0 0 auto;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  font-size: var(--fs-md);
  padding: 0.25rem 0.5rem;
  border-radius: var(--r-sm);
  transition: var(--transition-tab);
}
.profile-edit:hover {
  background: var(--teal-bg);
  color: var(--teal-dark);
}
.profile-edit:active {
  transform: var(--press-scale);
}
.profile-sub {
  margin: 0;
  font-weight: 800;
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
/* Stat sheet: auto-fit tiles, two-plus per row, each a value-over-label card. */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: 0.625rem;
}
.profile-stat {
  background: var(--teal-bg);
  border-radius: var(--r-md);
  padding: 0.625rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}
/* Dark : --teal-bg (#163330) colle au fond du dialog (--card) → les tuiles de
   stats deviennent invisibles. On les pose sur --cream (#22423d, la surface qui
   "pop") pour les détacher de la carte. */
html.theme-dark .profile-stat {
  background: var(--cream);
}
.profile-stat-val {
  font-size: var(--fs-2xl);
  font-weight: 800;
  color: var(--teal-dark);
  line-height: 1.1;
}
.profile-stat-label {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--muted);
}

/* ---------- Succès (achievements) : section du profil joueur ----------
   Trophées façon jeu vidéo : badges "première fois" + cartes de familles à
   paliers avec barre de progression. Or = palier max atteint, teal = en cours. */
.ach-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  /* "Or" métallique (comme la médaille du 1er au classement), pas le jaune vif
     --gold. --ach-gold sert de couleur de texte/accent (plus clair sur fond
     sombre pour rester lisible) ; le dégradé et le halo habillent médailles,
     badges et barres. */
  --ach-gold: #b3843f;
  --ach-gold-grad: linear-gradient(135deg, #e3c077, #b3843f);
  --ach-gold-glow: 0 3px 14px rgba(179, 132, 63, 0.45);
}
html.theme-dark .ach-section {
  --ach-gold: #e3c077;
}
/* Gamer-score "hero" banner: a gold medallion + big XP score + a completion bar
   (succès débloqués / total). Gold accents on a tinted, glowing card. */
.ach-summary {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  border-radius: var(--r-lg);
  border: 2px solid var(--ach-gold);
  background:
    linear-gradient(135deg, rgba(227, 192, 119, 0.22), rgba(227, 192, 119, 0.05)),
    var(--teal-bg);
  box-shadow: var(--ach-gold-glow);
}
html.theme-dark .ach-summary {
  background:
    linear-gradient(135deg, rgba(227, 192, 119, 0.16), rgba(227, 192, 119, 0.03)),
    var(--cream);
}
.ach-summary-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
/* Score (gros, or) à gauche, compteur de succès à droite, barre en dessous. */
.ach-summary-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.ach-summary-count {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--muted);
}
.ach-summary-count b {
  font-weight: 900;
  color: var(--teal-dark);
}
.ach-gs {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  line-height: 1;
}
.ach-gs-val {
  font-size: var(--fs-3xl);
  font-weight: 900;
  line-height: 1;
  color: var(--ach-gold);
}
.ach-gs-unit {
  font-size: var(--fs-md);
  font-weight: 800;
  color: var(--ach-gold);
}
.ach-summary-bar {
  height: 0.375rem;
  margin-top: 0.125rem;
  border-radius: var(--r-round);
  background: rgba(var(--teal-rgb), 0.22);
  overflow: hidden;
}
.ach-summary-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--ach-gold-grad);
}
/* XP rewards (gold): next-tier reward in a card's meta, and each special's worth. */
.ach-xp {
  color: var(--ach-gold);
  font-weight: 800;
}
/* Badges "première fois" et paliers partagent la même carte (.ach-card) ; les
   deux listes sont juste des colonnes. */
.ach-specials,
.ach-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.ach-card {
  display: flex;
  gap: 0.625rem;
  padding: 0.625rem 0.75rem;
  border-radius: var(--r-md);
  background: var(--teal-bg);
}
html.theme-dark .ach-card {
  background: var(--cream);
}
/* Tout succès NON débloqué (verrouillé ou palier en cours) → look désactivé :
   badge gris, titre et XP en gris muté, carte légèrement estompée. Seuls les
   succès débloqués gardent leurs couleurs (badge doré, titre teal, XP or). */
.ach-card.is-locked,
.ach-card.is-active {
  opacity: 0.8;
}
.ach-card.is-locked .ach-title,
.ach-card.is-active .ach-title,
.ach-card.is-locked .ach-xp,
.ach-card.is-active .ach-xp {
  color: var(--muted);
}
.ach-badge {
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--r-round);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-md);
  background: var(--surface);
  color: var(--muted); /* couleur de l'icône quand désactivé */
}
/* Débloqué : badge or métallique (comme la médaille du 1er), icône blanche. */
.ach-card.is-done .ach-badge {
  background: var(--ach-gold-grad);
  color: #fff;
  box-shadow: var(--ach-gold-glow);
}
/* Dark : l'icône sur or reprend la teinte foncée du texte de la bannière de
   victoire (#473d14, comme .banner / .badge.rank1) plutôt que le blanc. */
html.theme-dark .ach-card.is-done .ach-badge {
  color: #473d14;
}
.ach-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.ach-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}
.ach-title {
  font-weight: 800;
  font-size: var(--fs-sm);
  color: var(--teal-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ach-bar {
  height: 0.4375rem;
  border-radius: var(--r-round);
  /* Teal-tinted groove: the card is already --teal-bg, so a near-white --surface
     track vanished in light. A translucent teal reads on both themes. */
  background: rgba(var(--teal-rgb), 0.22);
  overflow: hidden;
}
.ach-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
  transition: width 0.4s ease;
}
.ach-meta {
  font-size: var(--fs-2xs);
  font-weight: 700;
  color: var(--muted);
}

/* "Gamer score" à côté d'un nom de joueur dans les listes (réglage) : texte
   discret, muté et petit. */
.gs-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  margin-left: 0.375rem;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 600;
  vertical-align: middle;
  white-space: nowrap;
}
.gs-badge i {
  font-size: 0.85em;
  opacity: 0.8;
}

.scores-dialog-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.scores-dialog-foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1rem;
  border-top: 2px solid var(--teal-bg);
}
/* Petit écran : les boutons du pied se réduisent à leur icône. « Commencer la
   partie » réclame 184 px à lui seul — avec « Annuler » et la flèche de retour,
   le pied demandait 293 px quand un téléphone de 320 px n'en offre que 256, et
   le bouton principal sortait du dialogue par la droite.
   Le libellé n'est pas retiré du DOM, seulement rendu invisible : il reste le
   nom accessible du bouton (lecteurs d'écran, survol) — un aria-label par
   bouton aurait fait la même chose, en cinquante exemplaires à tenir à jour.
   Les .btn-big en sont exemptés : ils occupent leur ligne à eux seuls (« Appeler
   les rôles », « Élire le Maire ») — rien ne les serre, et réduire une pleine
   largeur à une icône perdue au milieu n'aurait fait qu'obscurcir l'action. */
@media (max-width: 400px) {
  .scores-dialog-foot .btn:has(> i):not(.btn-big),
  .ww-foot .btn:has(> i):not(.btn-big) {
    gap: 0;
    font-size: 0;
    /* L'interlettrage est une LONGUEUR ABSOLUE : il survit à font-size: 0 et
       chaque lettre du libellé masqué gardait ses 0,3 px. « Commencer la
       partie » pesait ainsi 5,7 px de vide, tous du même côté — l'icône
       n'était plus au centre de sa pastille. */
    letter-spacing: 0;
    word-spacing: 0;
    padding-left: 0.875rem;
    padding-right: 0.875rem;
  }
  .scores-dialog-foot .btn:has(> i):not(.btn-big) > i,
  .ww-foot .btn:has(> i):not(.btn-big) > i {
    font-size: var(--fs-md);
  }
}

/* Turn-based entry (Qwirkle / Yam's): the dialog pops in and the active player's
   name is highlighted, so auto-advancing to the next player reads as a clear
   handoff — not a static screen that leaves a "did my entry register?" doubt. */
.modal-turn {
  animation: turn-pop 0.28s var(--bounce);
}
@keyframes turn-pop {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(10px);
  }
}
@keyframes turn-name-pop {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  65% {
    transform: scale(1.15);
  }
}

.toast {
  position: fixed;
  bottom: calc(1.5rem + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  /* `left: 50%` alone caps shrink-to-fit at ~50vw, forcing long messages to
     wrap; size to content instead, bounded so it never overflows the screen. */
  width: max-content;
  max-width: calc(100vw - 2rem);
  box-sizing: border-box;
  background: var(--teal-dark);
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: var(--r-round);
  box-shadow: var(--shadow-teal-glow);
  z-index: 30;
  font-size: var(--fs-sm);
  font-weight: 700;
  animation: rise 0.25s var(--bounce);
}
/* Variantes couleur (info réseau, etc.). "success" = vert (retour en ligne),
   "warning" = ambre (passage hors connexion, cohérent avec l'icône du header). */
.toast.toast-success {
  background: var(--success);
  color: #fff;
  box-shadow: 0 2px 10px rgba(39, 174, 96, 0.35);
}
.toast.toast-warning {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: var(--ink);
  box-shadow: var(--shadow-accent-glow);
}

/* Dialog de conflit de synchronisation (offline) : une ligne par partie avec le
   choix « ma version / serveur ». */
.conflict-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0.5rem 0 1rem;
}
.conflict-row {
  padding: 0.75rem;
  border-radius: var(--r-md);
  background: var(--teal-bg);
}
.conflict-game {
  font-weight: 800;
  margin-bottom: 0.5rem;
}
.conflict-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}
.conflict-choice {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  cursor: pointer;
  font-weight: 700;
  font-size: var(--fs-sm);
}
/* Bandeau "Succès débloqué" glissé depuis le haut (or métallique). */
.ach-toast {
  position: fixed;
  top: calc(0.75rem + env(safe-area-inset-top));
  left: 50%;
  transform: translate(-50%, -160%);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: max-content;
  max-width: calc(100vw - 1.5rem);
  box-sizing: border-box;
  padding: 0.5rem 1rem 0.5rem 0.5rem;
  border-radius: var(--r-round);
  background: var(--card);
  border: 2px solid #b3843f;
  box-shadow: 0 6px 24px rgba(179, 132, 63, 0.45);
  z-index: 150;
  opacity: 0;
  transition:
    transform 0.35s var(--bounce),
    opacity 0.35s ease;
}
.ach-toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}
.ach-toast-badge {
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--r-round);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-lg);
  color: #fff;
  background: linear-gradient(135deg, #e3c077, #b3843f);
}
html.theme-dark .ach-toast-badge {
  color: #473d14;
}
.ach-toast-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ach-toast-label {
  font-size: var(--fs-3xs);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #b3843f;
}
.ach-toast-title {
  font-weight: 900;
  color: var(--teal-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ach-toast-sub {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--muted);
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
}

/* A replay of the finished game was created on another device. Same look as
   toast() (bottom pill), but persistent and actionable (Rejoindre + dismiss). */
.replay-banner {
  position: fixed;
  bottom: calc(1.5rem + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.5rem 0.625rem;
  max-width: calc(100vw - 2rem);
  background: var(--teal-dark);
  color: #fff;
  padding: 0.5rem 0.625rem 0.5rem 1rem;
  border-radius: var(--r-round);
  box-shadow: var(--shadow-teal-glow);
  z-index: 40; /* above toasts (30), below the celebration overlay (100) */
  font-weight: 700;
  font-size: var(--fs-sm);
  animation: rise 0.25s var(--bounce);
}
.replay-banner-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.replay-banner .replay-join {
  flex-shrink: 0;
  background: #fff;
  color: var(--teal-dark);
}
.replay-dismiss {
  flex-shrink: 0;
  background: transparent;
  border: 0;
  color: #fff;
  opacity: 0.8;
  cursor: pointer;
  font-size: var(--fs-md);
  line-height: 1;
  padding: 0.25rem;
}
.replay-dismiss:hover {
  opacity: 1;
}

/* ---------- confetti ---------- */
.confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.confetti i {
  position: absolute;
  top: -0.75rem;
  width: 0.625rem;
  height: 0.875rem;
  opacity: 0;
  animation: confetti-fall linear infinite;
}

/* ---------- keyframes ---------- */
@keyframes glow-pulse {
  /* gold tones matching the banner gradient (#e3c077 → #b3843f) */
  0%,
  100% {
    box-shadow: 0 4px 16px rgba(179, 132, 63, 0.45);
  }
  50% {
    box-shadow: 0 6px 26px rgba(227, 192, 119, 0.7);
  }
}
@keyframes crown-bounce {
  0%,
  100% {
    transform: translateY(0) rotate(0);
  }
  25% {
    transform: translateY(-4px) rotate(-8deg);
  }
  50% {
    transform: translateY(-2px) rotate(0);
  }
  75% {
    transform: translateY(-4px) rotate(8deg);
  }
}
@keyframes boom-pulse {
  0%,
  100% {
    box-shadow: var(--shadow-coral-glow);
  }
  50% {
    box-shadow: 0 4px 22px rgba(239, 108, 74, 0.6);
  }
}
@keyframes confetti-fall {
  0% {
    transform: translateY(0) rotate(0);
    opacity: 1;
  }
  100% {
    /* 220px : la hauteur d'une bannière de victoire. Un conteneur plein écran
       redéfinit --fall pour que les pièces le traversent vraiment. */
    transform: translateY(var(--fall, 220px)) rotate(540deg);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .banner,
  .total-cell .crown,
  .banner .crown,
  .bust-btn.active,
  .confetti i {
    animation: none !important;
  }
  .cel-confetti i,
  .cel-inner {
    animation: none !important;
    opacity: 1 !important;
  }
  /* Recadrage clavier des dialogs : instantané sous préférence OS (le réglage
     app « Animations désactivées » le neutralise déjà via html.reduce-motion). */
  .overlay {
    transition: none;
  }
}

/* ---------- victory celebration (full screen) ---------- */
.celebrate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  overflow: hidden;
  cursor: pointer;
  background: radial-gradient(
    circle at 50% 38%,
    rgba(var(--gold-rgb), 0.28),
    rgba(var(--scrim-rgb), 0.82)
  );
  backdrop-filter: blur(4px);
  animation: cel-fade 0.3s ease;
}
/* Variante v3 : reprend le fond des dialogs (.overlay) plutôt que le dégradé. */
.celebrate.cel-v3 {
  background: rgba(var(--scrim-rgb), 0.45);
  backdrop-filter: blur(3px);
}
.cel-inner {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 1.5rem;
  max-width: 92vw;
}
.cel-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 0.25rem;
}
.cel-logo .brand-logo img {
  width: min(18rem, 62vw);
  height: auto;
}
.cel-title {
  margin: 0.625rem 0;
  font-size: var(--fs-3xl);
  font-weight: 800;
  color: var(--gold);
  text-shadow:
    2px 2px 0 var(--ink),
    3px 3px 0 var(--ink);
}
.cel-name {
  font-size: 3.25rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 2px 2px 0 var(--ink);
  line-height: 1.05;
}
.cel-name-sub {
  margin-top: 0.25rem;
  font-size: var(--fs-md);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.82);
}
.cel-score {
  margin-top: 0.375rem;
  font-size: var(--fs-xl);
  font-weight: 800;
  /* Fixed light tone (not the themeable --cream, which darkens in dark mode).
     The cel-v3 variant swaps in the lighter dialog backdrop, so an ink shadow
     keeps the score readable there in light mode too. */
  color: #fff8e7;
  text-shadow: 1px 1px 0 var(--ink);
}
.cel-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem 0.5rem;
  align-items: center;
  margin-top: 1.5rem;
  width: 100%;
}
.cel-actions .btn {
  width: 100%;
  max-width: 17.5rem;
}

/* full-screen confetti */
.cel-confetti {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.cel-confetti i {
  position: absolute;
  top: -10vh;
  opacity: 0;
  animation: cel-fall linear infinite;
}

/* random animation variants applied to .cel-inner */
.cel-v1 .cel-inner {
  animation: cel-pop 0.7s var(--bounce);
}
.cel-v2 .cel-inner {
  animation: cel-zoom 1.6s ease-in-out infinite;
}
.cel-v3 .cel-inner {
  animation: cel-wobble 1.2s ease-in-out infinite;
}
.cel-v4 .cel-inner {
  animation: cel-spin 0.8s var(--bounce);
}
.cel-v5 .cel-inner {
  animation: cel-rise 0.7s var(--bounce);
}

@keyframes cel-fade {
  from {
    opacity: 0;
  }
}
@keyframes cel-pop {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }
  60% {
    transform: scale(1.12);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
@keyframes cel-zoom {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}
@keyframes cel-wobble {
  0%,
  100% {
    transform: rotate(-3deg);
  }
  50% {
    transform: rotate(3deg);
  }
}
@keyframes cel-spin {
  0% {
    transform: rotate(-360deg) scale(0.2);
    opacity: 0;
  }
  100% {
    transform: rotate(0) scale(1);
    opacity: 1;
  }
}
@keyframes cel-rise {
  0% {
    transform: translateY(60px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}
@keyframes cel-fall {
  0% {
    transform: translateY(-10vh) rotate(0);
    opacity: 1;
  }
  100% {
    transform: translateY(112vh) rotate(720deg);
    opacity: 0.85;
  }
}

/* ---------- responsive (phones) ---------- */
@media (max-width: 40rem) {
  main {
    padding: 1rem 0 max(1rem, env(safe-area-inset-bottom));
  }
  main > * {
    padding-left: 0.875rem;
    padding-right: 0.875rem;
  }
  h2 {
    font-size: var(--fs-xl);
  }

  .topbar {
    padding:
      calc(0.75rem + env(safe-area-inset-top))
      calc(0.875rem + env(safe-area-inset-right))
      0.75rem
      calc(0.875rem + env(safe-area-inset-left));
    gap: 1rem 0.5rem;
    flex-wrap: wrap;
  }
  .logo img {
    height: 1.875rem;
  }
  .place-btn {
    max-width: 52vw;
    font-size: var(--fs-sm);
    padding: 0.375rem 0.75rem;
  }

  .hero {
    padding: 0.375rem 1rem 1.375rem;
  }
  .hero p {
    font-size: var(--fs-sm);
  }

  .panel {
    padding: 1.125rem;
  }
  .btn {
    padding: 0.625rem 1rem;
    font-size: var(--fs-sm);
  }
  .btn-big {
    min-height: 3.5rem;
    padding: 1rem 1.5rem;
    font-size: var(--fs-lg);
  }

  .game-card {
    padding: 0.875rem;
    gap: 1rem 0.5rem;
    flex-wrap: wrap;
  }
  .game-card .meta {
    flex-basis: 100%;
  }
  /* round number sits beside the badge instead of below it */
  .status-cell {
    flex-direction: row;
  }

  .game-head {
    gap: 0.25rem;
  }
  .game-head h2 {
    font-size: var(--fs-xl);
  }

  /* score table: tighter cells */
  table.score th,
  table.score td {
    padding: 0.625rem 0.5rem;
  }
  input.cell-input {
    width: 3.25rem;
    padding: 0.5rem 0.25rem;
  }
  .total-cell {
    font-size: var(--fs-lg);
  }

  /* round entry: keep the name and its controls on one line; shrink the
     controls so they fit, and let the name truncate if needed. */
  .entry-player {
    flex-wrap: nowrap;
    gap: 0.5rem;
    padding: 0.75rem 0.75rem;
  }
  .entry-player .pname {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .entry-controls {
    flex: none;
    gap: 0.375rem;
  }
  .entry-controls .cell-input {
    width: 2.75rem;
  }
  .flip7-btn,
  .bust-btn,
  .closer-btn,
  .sign-btn {
    font-size: var(--fs-xs);
    padding: 0.375rem 0.625rem;
    min-width: 0;
  }
  .malus-btn {
    font-size: var(--fs-xs);
    padding: 0.375rem 0;
    width: 2.75rem;
  }
  .malus-btns {
    gap: 0.25rem;
  }

  .modal {
    padding: 1rem;
  }
  /* dialogs keep child-managed padding on mobile, using the modal's value */
  .modal-rules,
  .modal-scores,
  .modal-profile,
  .modal-rename {
    padding: 0;
  }
  .modal-rules > *,
  .modal-scores > * {
    padding: 1rem;
  }

  .cel-logo .brand-logo img {
    width: 66vw;
  }
  .cel-title {
    font-size: var(--fs-2xl);
  }
  .cel-name {
    font-size: 2.5rem;
  }
  .cel-score {
    font-size: var(--fs-lg);
  }
}

@media (max-width: 23.75rem) {
  .brand-logo img {
    width: 80vw;
  }
}

/* ---------- Yams (dice scorecard) ---------- */
/* Entry dialog: pick a mission, then set its value or scratch it. */
.yams-missions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.875rem;
}
/* Dans les dialogs à corps flex (.scores-dialog-body, gap 1rem), l'espacement
   vient du gap : pas de marge en plus (picker Flip 7, déplacement de partie). */
.scores-dialog-body .yams-missions {
  margin-bottom: 0;
}
/* one mission per line on very narrow screens */
@media (max-width: 370px) {
  .yams-missions {
    grid-template-columns: 1fr;
  }
}
/* Full-width section label ("Section haute" / "Section basse") spanning both
   grid columns; the upper one shows the bonus progress on the right. */
.yams-section-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0 0.25rem;
  color: var(--teal-dark);
  font-weight: 900;
  font-size: var(--fs-md);
}
.yams-section-head:not(:first-child) {
  margin-top: 0.375rem;
}
.yams-section-bonus {
  font-size: var(--fs-sm);
  font-weight: 800;
  color: var(--muted);
}
.yams-bonus-n {
  color: var(--teal-dark);
  font-weight: 900;
  font-size: 1.15em;
}
.yams-section-bonus.ok {
  color: var(--teal);
}
/* Pétanque (saisie d'une mène) : équipes en colonne, joueurs sous le nom. */
/* « Combien de points ? » : pas de marge (l'espace vient de la liste au-dessus). */
#ptqPointsWrap .turn-meta {
  margin: 0;
}
.yams-mission {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.625rem 0.75rem;
  border: 2px solid var(--teal-light);
  border-radius: var(--r-round);
  background: var(--card);
  color: var(--teal-dark);
  font-weight: 800;
  font-size: var(--fs-md);
  cursor: pointer;
  transition:
    filter 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}
.yams-mission:hover {
  filter: brightness(1.03);
}
.yams-mission.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
  box-shadow: var(--shadow-teal-glow);
}
/* Already-played mission: visible but locked, showing the marked score. */
.yams-mission:disabled,
.yams-mission.filled {
  opacity: 0.6;
  cursor: default;
  background: var(--surface);
  color: var(--muted);
  border-color: var(--teal-light);
  box-shadow: none;
  filter: none;
}
.yams-mission.filled .yams-fixed {
  background: var(--teal-bg);
  color: var(--muted);
}
.yams-mission-name {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Mobile : un nom long (« Petite suite », « Pas de dames », « Barbu (Roi ♥) »)
   passe sur deux lignes au lieu d'être coupé en « Petite su… » / « Pas … ». */
@media (max-width: 30rem) {
  .yams-mission {
    padding-inline: 0.625rem;
  }
  .yams-mission-name {
    white-space: normal;
    overflow: visible;
    line-height: 1.15;
    text-align: left;
    overflow-wrap: anywhere;
  }
}
/* Constructeur d'équipes : « Ajouter une équipe » / « Mélanger les joueurs »
   se partagent la ligne ; sur deux lignes, le bouton grandit (texte aéré). */
.team-tools .btn {
  flex: 1 1 0;
  height: auto;
  min-height: 2.75rem;
  padding-block: 0.5rem;
  line-height: 1.15;
}
/* Contrat à 0 (barré pendant son tour, ou saisi à 0) : son nom est rayé partout
   où les contrats sont listés — saisie, correction d'un tour, écran copilote. */
.yams-mission-name.struck {
  text-decoration: line-through;
}
/* Werewolf role pickers (the name carries a camp icon): keep the icon to the
   left of the name and vertically centred — not bumped onto its own line when a
   long name wraps. Names wrap fully instead of being clipped; the ×N count stays
   on the right. Other .yams-mission lists (Yam's, Bombu…) keep the nowrap above. */
.yams-mission-name:has(.ww-ric) {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  white-space: normal;
}
.yams-fixed {
  flex: none;
  font-size: var(--fs-sm);
  font-weight: 900;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  background: var(--surface);
  color: var(--teal-dark);
}
.yams-mission.active .yams-fixed {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}
/* Contrat en cours marqué à 0 (barré, ou valeur nulle) : TOUTE la mission passe
   au rouge, partout où on la voit — saisie, correction d'un tour, écran copilote
   (où c'est, de loin, le détail qui change la suite de la partie). Même dégradé
   que le bouton « barrer » (.yams-scratch.active) qui la met à 0.

   Le dégradé est porté par un CALQUE dont on anime l'opacité, et non par le fond
   du bouton : un dégradé ne s'interpole pas, si bien qu'en le posant directement
   le fond sautait pendant que la bordure, elle, prenait ses 0.15s — d'où un
   aller-retour bancal dans la dialog de saisie (l'écran copilote, lui, recrée
   ses nœuds et ne transitionne jamais). Le calque ne suit que les listes à
   sections (Yam's, et les contrats Bombu qui empruntent yams-lower) — il y reste
   invisible faute d'état « à 0 » — et jamais les rôles du Loup-Garou ni les
   équipes de Pétanque, qui n'ont pas ces classes. */
.yams-mission.yams-upper,
.yams-mission.yams-lower {
  position: relative;
}
.yams-mission.yams-upper::before,
.yams-mission.yams-lower::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--yams), var(--yams-dark));
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}
.yams-mission.yams-upper > *,
.yams-mission.yams-lower > * {
  position: relative; /* le nom et la pastille restent au-dessus du calque */
}
.yams-mission.is-zero::before {
  opacity: 1;
}
.yams-mission.is-zero {
  border-color: var(--yams-dark);
  color: #fff;
  box-shadow: 0 2px 10px var(--yams-glow);
}
.yams-mission.is-zero .yams-fixed {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}
/* La pastille suit le même fondu que la mission qui la porte. */
.yams-mission .yams-fixed {
  transition:
    background 0.15s ease,
    color 0.15s ease;
}
.yams-value {
  border-top: 2px dashed var(--teal-light);
  padding-top: 0.875rem;
}
.yams-value-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}
.yams-value-label {
  font-weight: 900;
  color: var(--teal-dark);
}
.yams-value-row .cell-input {
  width: 5rem;
  flex: none;
}
.yams-value-fixed {
  font-weight: 900;
  font-size: var(--fs-lg);
  color: var(--teal-dark);
}
.yams-value-fixed.struck {
  text-decoration: line-through;
  color: var(--muted);
}
.yams-scratch.active {
  background: linear-gradient(135deg, var(--yams), var(--yams-dark));
  border-color: var(--yams-dark);
  color: #fff;
}
.yams-hint {
  margin: 0;
  font-size: var(--fs-sm);
}

/* Details scorecard: missions × players. */
.yams-table th,
.yams-table td {
  text-align: center;
}
.yams-table .player-name {
  text-align: left;
  white-space: nowrap;
  width: 1px; /* shrink to the mission label; value columns take the rest */
}
.yams-section td {
  background: var(--surface);
  font-weight: 900;
  color: var(--teal-dark);
  text-transform: uppercase;
  font-size: var(--fs-xs);
  letter-spacing: 0.03em;
  text-align: left;
}
.yams-fixed-tag {
  display: inline-block;
  margin-left: 0.25rem;
  font-size: var(--fs-xs);
  font-weight: 900;
  line-height: 1;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: var(--teal-bg);
  color: var(--teal-dark);
  vertical-align: middle;
}
.yams-cell {
  position: relative;
}
.yams-pts {
  font-weight: 800;
}
.yams-pts.struck {
  text-decoration: line-through;
  color: var(--muted);
}
/* Filled cell: a tappable chip showing the score; opens the turn editor. */
.yams-cell-edit {
  min-width: 3.25rem;
  padding: 0.375rem 0.625rem;
  border: 2px solid var(--teal-light);
  border-radius: var(--r-round);
  background: var(--card);
  color: var(--teal-dark);
  font-weight: 800;
  cursor: pointer;
  transition:
    filter 0.15s ease,
    transform 0.12s var(--bounce);
}
.yams-cell-edit:hover {
  filter: var(--hover-bright);
}
.yams-cell-edit:active {
  transform: var(--press-scale);
}
.yams-cell-edit.struck {
  color: var(--muted);
  text-decoration: line-through;
  border-style: dashed;
}
.yams-empty {
  color: var(--teal-light);
}
.yams-subtotal td,
.yams-bonus td {
  background: var(--teal-bg);
  font-weight: 800;
}
.yams-bonus-on {
  color: var(--success);
  font-weight: 900;
}
.yams-total td {
  border-top: 2px solid var(--teal-light);
  font-weight: 900;
}

/* Custom elements default to inline; make the block-level ones behave. */
app-logo,
app-stats-table,
app-score-summary {
  display: block;
}

/* ---------- dark mode (auto, follows the OS — no toggle) ----------
   Built on the design's CSS variables: dark mode just remaps the neutral
   surfaces, text and shadows. Brand accents (teal/coral/gold + per-mode
   colours) stay as-is — they read well on dark. --teal-dark is mostly used as
   text on light surfaces, so it's brightened here; the two spots that use it as
   a background keep white text (same contrast as light-mode buttons). A handful
   of hardcoded-light spots are patched below. */
/* Brand logo: the white wordmark on dark, the colored one on light. Driven by
   the `theme-dark` class (set for both a forced-dark choice and auto+OS-dark) so
   it follows a manual theme override, not only the OS. The not()/class ancestor
   selectors outrank `.logo img` / `.brand-logo img`, which set display:block. */
html:not(.theme-dark) .brand-img-dark {
  display: none;
}
html.theme-dark .brand-img-light {
  display: none;
}

/* ---------- Dark theme ----------
   Applied via the `theme-dark` class on <html> (set by js/theme.js + the inline
   boot script in index.html): forced when the user picks "Sombre", or when the
   default "Auto" runs on an OS that prefers dark. Light is the class-less base.
   The dark token redefinitions live in variables.css (imported at the top);
   below are the component-level dark overrides that aren't just token swaps. */

/* On dark, the gold/silver/bronze chips (and the gold victory banner) read
   better with a dark number/text than white. Light mode keeps white. */
html.theme-dark .badge.rank1 {
  color: #473d14;
}
html.theme-dark .badge.rank2 {
  color: #4f4f5a;
}
html.theme-dark .badge.rank3 {
  color: #58401a;
}
html.theme-dark .banner {
  color: #473d14;
}
/* …but the cancelled banner keeps its coral background (not gold), so dark
   ink reads poorly — restore white like in light mode. */
html.theme-dark .banner.banner-cancelled {
  color: #fff;
}

/* Toasts and the replay pill use the bright teal accent (--teal-dark, which
   is light on dark) as their background, so white text washes out — switch
   their text/controls to dark ink for contrast. */
html.theme-dark :is(.toast, .replay-banner, .replay-banner .replay-join, .replay-dismiss) {
  color: var(--ink);
}

/* Active filled buttons fill with the solid --teal (#2ba8a2) and white text —
   only ~2.9:1 on dark, below WCAG AA. Same fix as the toasts above: brighten
   the fill to --teal-light and switch to dark --ink text (~5.7:1). */
html.theme-dark .nav-tab.active,
html.theme-dark .nav-tab.active:hover,
html.theme-dark .date-filter button.active {
  background: var(--teal-light);
  border-color: var(--teal-light);
  color: var(--ink);
}
html.theme-dark .nav-tab.active:hover {
  background: var(--teal-hover-dark); /* a touch brighter for hover feedback */
}
/* Count pills are white-on-teal (~2.9:1) too — brighten the inactive pill, and
   invert the active pill to a dark chip so it reads on the bright button. */
html.theme-dark .date-filter button .filter-count {
  background: var(--teal-light);
  color: var(--ink);
}
html.theme-dark .date-filter button.active .filter-count {
  background: var(--ink);
  color: var(--teal-light);
}
/* Type filter button: same dark fix as the date filter above. Per-game chips
   keep their own accent colours in both themes. */
html.theme-dark .type-filter-btn.active {
  background: var(--teal-light);
  border-color: var(--teal-light);
  color: var(--ink);
}
html.theme-dark .type-filter-btn .filter-count {
  background: var(--ink);
  color: var(--teal-light);
}

/* Shadows barely show on dark, so elevated surfaces get a hairline border to
   stand out from the page. The cards keep their coloured left accent. */
html.theme-dark .game-card {
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  border-right: 1px solid rgba(255, 255, 255, 0.09);
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}
html.theme-dark :is(.panel, .modal) {
  border: 1px solid rgba(255, 255, 255, 0.09);
}
/* Stronger dim behind dialogs so the modal reads as a distinct layer. */
html.theme-dark .overlay::before {
  background: rgba(0, 0, 0, 0.6);
}
/* Inputs read as recessed "wells": darker than their surface + clear border. */
html.theme-dark :is(input[type="text"], input[type="number"]) {
  background: var(--well-dark);
  border-color: rgba(255, 255, 255, 0.32);
}
html.theme-dark .entry-player {
  background: var(--raised-dark); /* lighter than the modal so rows read as raised */
  border-color: rgba(var(--teal-light-rgb), 0.45);
  border-left-color: var(--teal-light);
}
/* Row state tints: blend the accent into the dark row colour (not --teal-bg,
   which is much darker) and lighten the name so it stays readable. */
html.theme-dark .entry-player.busted {
  background: linear-gradient(90deg, rgba(239, 108, 74, 0.32), var(--raised-dark) 60%);
}
html.theme-dark .entry-player.flipped {
  background: linear-gradient(90deg, rgba(93, 173, 226, 0.32), var(--raised-dark) 60%);
}
html.theme-dark .entry-player.doubled {
  background: linear-gradient(90deg, rgba(81, 180, 124, 0.32), var(--raised-dark) 60%);
}
html.theme-dark .entry-player.busted .pname {
  color: var(--coral-light);
}
html.theme-dark .entry-player.doubled .pname {
  color: #74cf9a;
}
/* Hardcoded-light topbar background. */
html.theme-dark .topbar {
  background: var(--topbar-bg);
  border-bottom-color: rgba(var(--teal-light-rgb), 0.25);
}
/* Contrée: "black" suits use --ink (dark) — flip them light on dark cards. */
html.theme-dark :is(.suit, .suit-btn) {
  color: var(--text);
}
html.theme-dark .suit-btn.active {
  background: var(--text);
  border-color: var(--text);
  color: var(--surface);
}

/* =====================================================================
   UTILITY LAYER (token-mapped, Tailwind-like)
   ---------------------------------------------------------------------
   Single-class, low-specificity helpers that map onto the design tokens
   in :root — so colours/spacing/radius stay in one place and adapt to
   dark mode automatically (the utilities read the same vars that the
   theme redefines). Placed last so a utility reliably wins over a
   same-specificity component declaration during migration.

   Scale: xs/sm/md/lg/xl mirror the --xs … --xl spacing tokens; radius
   uses --r-* ; colours/shadows reuse the palette + elevation tokens.
   Add new utilities here rather than minting one-off component classes.
   ===================================================================== */

/* ---- display ---- */
.u-flex { display: flex; }
.u-inline-flex { display: inline-flex; }
.u-grid { display: grid; }
.u-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.u-block { display: block; }
.u-inline-block { display: inline-block; }
.u-hidden { display: none; }
.u-contents { display: contents; }

/* ---- flex direction / wrap ---- */
.u-flex-row { flex-direction: row; }
.u-flex-col { flex-direction: column; }
.u-wrap { flex-wrap: wrap; }
.u-nowrap { flex-wrap: nowrap; }
.u-flex-1 { flex: 1; }
.u-flex-auto { flex: 0 0 auto; }
.u-grow { flex-grow: 1; }
.u-shrink-0 { flex-shrink: 0; }

/* ---- align / justify ---- */
.u-items-center { align-items: center; }
.u-items-start { align-items: flex-start; }
.u-items-end { align-items: flex-end; }
.u-items-baseline { align-items: baseline; }
.u-items-stretch { align-items: stretch; }
.u-justify-center { justify-content: center; }
.u-justify-between { justify-content: space-between; }
.u-justify-start { justify-content: flex-start; }
.u-justify-end { justify-content: flex-end; }
.u-justify-around { justify-content: space-around; }
.u-self-center { align-self: center; }
.u-text-center { text-align: center; }
.u-text-left { text-align: left; }
.u-text-right { text-align: right; }

/* ---- gap (mirrors --xs … --xl) ---- */
.u-gap-0 { gap: 0; }
.u-gap-xs { gap: var(--xs); }
.u-gap-sm { gap: var(--sm); }
.u-gap-md { gap: var(--md); }
.u-gap-lg { gap: var(--lg); }
.u-gap-xl { gap: var(--xl); }
/* directional gaps — many wrappers want a wider row-gap than column-gap; each
   axis still maps to a token so nothing drifts off the scale. */
.u-gap-x-xs { column-gap: var(--xs); }
.u-gap-x-sm { column-gap: var(--sm); }
.u-gap-x-md { column-gap: var(--md); }
.u-gap-x-lg { column-gap: var(--lg); }
.u-gap-y-xs { row-gap: var(--xs); }
.u-gap-y-sm { row-gap: var(--sm); }
.u-gap-y-md { row-gap: var(--md); }
.u-gap-y-lg { row-gap: var(--lg); }
.u-gap-y-xl { row-gap: var(--xl); }

/* ---- padding ---- */
.u-p-0 { padding: 0; }
.u-p-xs { padding: var(--xs); }
.u-p-sm { padding: var(--sm); }
.u-p-md { padding: var(--md); }
.u-p-lg { padding: var(--lg); }
.u-p-xl { padding: var(--xl); }
.u-px-xs { padding-inline: var(--xs); }
.u-px-sm { padding-inline: var(--sm); }
.u-px-md { padding-inline: var(--md); }
.u-px-lg { padding-inline: var(--lg); }
.u-px-xl { padding-inline: var(--xl); }
.u-py-xs { padding-block: var(--xs); }
.u-py-sm { padding-block: var(--sm); }
.u-py-md { padding-block: var(--md); }
.u-py-lg { padding-block: var(--lg); }
.u-py-xl { padding-block: var(--xl); }

/* ---- margin ---- */
.u-m-0 { margin: 0; }
.u-mx-auto { margin-inline: auto; }
.u-ml-auto { margin-left: auto; }
.u-mr-auto { margin-right: auto; }
.u-mt-xs { margin-top: var(--xs); }
.u-mt-sm { margin-top: var(--sm); }
.u-mt-md { margin-top: var(--md); }
.u-mt-lg { margin-top: var(--lg); }
.u-mt-xl { margin-top: var(--xl); }
.u-mb-xs { margin-bottom: var(--xs); }
.u-mb-sm { margin-bottom: var(--sm); }
.u-mb-md { margin-bottom: var(--md); }
.u-mb-lg { margin-bottom: var(--lg); }

/* ---- sizing ---- */
.u-w-full { width: 100%; }
.u-h-full { height: 100%; }
.u-max-w-full { max-width: 100%; }
.u-min-w-0 { min-width: 0; }

/* ---- radius (mirrors --r-*) ---- */
.u-rounded-sm { border-radius: var(--r-sm); }
.u-rounded-md { border-radius: var(--r-md); }
.u-rounded-lg { border-radius: var(--r-lg); }
.u-rounded-xl { border-radius: var(--r-xl); }
.u-rounded-round { border-radius: var(--r-round); }

/* ---- elevation ---- */
.u-shadow-sm { box-shadow: var(--shadow-sm); }
.u-shadow-md { box-shadow: var(--shadow-md); }
.u-shadow-lg { box-shadow: var(--shadow-lg); }
.u-shadow-card { box-shadow: var(--shadow-card); }
.u-shadow-none { box-shadow: none; }

/* ---- typography ---- */
.u-fw-500 { font-weight: 500; }
.u-fw-700 { font-weight: 700; }
.u-fw-800 { font-weight: 800; }
.u-text-xs { font-size: var(--fs-xs); }
.u-text-sm { font-size: var(--fs-sm); }
.u-text-md { font-size: var(--fs-md); }
.u-text-lg { font-size: var(--fs-lg); }
.u-leading-tight { line-height: 1.2; }
.u-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-nowrap-text { white-space: nowrap; }

/* ---- colours (read the palette tokens → theme-aware) ---- */
.u-text-ink { color: var(--text); }
.u-text-muted { color: var(--muted); }
.u-text-teal { color: var(--teal-dark); }
.u-text-white { color: #fff; }
.u-bg-card { background: var(--card); }
.u-bg-surface { background: var(--surface); }
.u-bg-teal-soft { background: var(--teal-bg); }

/* ---- misc / interaction ---- */
.u-pointer { cursor: pointer; }
.u-btn-reset { appearance: none; -webkit-appearance: none; border: none; background: none; }
.u-overflow-x-auto { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.u-relative { position: relative; }
.u-absolute { position: absolute; }

/* ---- Réduire les animations (réglage Animations « Désactivées ») ----
   Coupe toutes les animations et transitions, quel que soit le réglage de l'OS.
   On force une durée quasi nulle (plutôt que `animation: none`) pour que les
   animations en `forwards` atterrissent sur leur image finale au lieu de revenir
   à leur état de base — la barre d'élimination garde sa largeur, les "pops" leur
   position finale, etc. Les effets purement décoratifs (confettis, halos pulsés,
   icônes animées) sont en plus explicitement neutralisés plus bas. */
html.reduce-motion *,
html.reduce-motion *::before,
html.reduce-motion *::after {
  animation-duration: 0.001ms !important;
  animation-delay: 0ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  transition-delay: 0ms !important;
  scroll-behavior: auto !important;
}
/* Écrans/effets plein écran retirés complètement (plutôt que joués en accéléré)
   quand les animations sont désactivées — l'écran de victoire est aussi supprimé
   côté JS (voir celebrate.js) ; cette règle est une ceinture-bretelles. L'info
   reste visible : bannière du gagnant, joueur éliminé / badge Flip 7 sur le
   tableau. */
html.reduce-motion .celebrate,
html.reduce-motion .loss-stamps,
html.reduce-motion .elim-flash,
html.reduce-motion .feat-flash,
html.reduce-motion .ach-toast {
  display: none !important;
}
/* Bannière de victoire : on retire les confettis et on fige les animations
   décoratives en boucle — le halo pulsé de la bannière, le rebond de l'icône
   trophée/couronne (bannière + cellule de total) et la pulsation du bouton BOOM.
   (Reprend ce que fait déjà le bloc @media prefers-reduced-motion, mais piloté
   par le réglage de l'app.) */
html.reduce-motion .confetti {
  display: none !important;
}
html.reduce-motion .banner,
html.reduce-motion .banner .crown,
html.reduce-motion .total-cell .crown,
html.reduce-motion .bust-btn.active {
  animation: none !important;
}
/* Badge « En cours » des cartes de partie : son icône est un spinner (fa-spin).
   Figé, il aurait l'air bloqué — on le retire complètement quand les animations
   sont désactivées (le libellé « En cours » suffit). */
html.reduce-motion .badge.ongoing i {
  display: none !important;
}

/* ===================== Fléchettes (501 / 301) ===================== */
/* Résumé : le scoreboard réutilise .table-wrap.summary-list / .summary-row
   (mêmes cards que les autres jeux) ; ce wrapper empile card + conseil + cible. */
.darts-summary {
  display: flex;
  flex-direction: column;
  gap: var(--sm);
}

/* Bandeau de conseil (checkout) */
/* Conseils + cible (mode clavier) en ligne, sans habillage de card. */
.darts-checkout {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--md);
}
.darts-checkout-chips {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}
/* « Reste » de l'en-tête de la dialog, mis à jour en direct. */
#dartsRemain.is-bust {
  color: var(--error);
}
#dartsRemain.is-win {
  color: var(--success-dark);
}

/* ---------- Mölkky ---------- */
/* Saisie d'un lancer : on retape le PLAN des quilles, dans leur vraie formation
   (7 9 8 au fond, puis 5 11 12 6, 3 10 4, et 1 2 devant) — même geste que la
   cible des fléchettes. Boutons repris des fléchettes (.darts-num), mais ronds :
   une quille, pas une case. La sélection est persistante (on choisit, on valide).
   Une quille tombée vaut son numéro, plusieurs valent leur nombre : c'est la
   saisie qui le sait, pas la CSS. */
.molkky-plan {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sm);
}
.molkky-plan-row {
  display: flex;
  justify-content: center;
  gap: var(--sm);
}
.molkky-plan .darts-num {
  width: 3.25rem;
  height: 3.25rem;
  padding: 0;
  border-radius: 50%;
  font-size: var(--fs-xl);
}
/* « Raté » : sous le plan, centré et à sa propre largeur — c'est l'autre issue
   du lancer, pas une 13e quille, et pleine largeur il pesait plus lourd que le
   plan lui-même. */
/* « Raté » : le même bouton que celui de la cible des fléchettes
   (.darts-board-miss dans sa rangée .darts-board-actions), à qui il suffit d'un
   peu d'air sous le plan. */
.molkky-plan + .darts-board-actions {
  margin-top: var(--md);
}
/* Sélection : le teal plein de l'app (celui des puces de joueurs et des onglets),
   et non la couleur du jeu — c'est un état « choisi », pas une identité.
   Sélecteur appuyé sur le Raté : .darts-num.darts-miss, déclaré plus bas, lui
   impose sinon son texte gris, illisible sur le teal. */
.molkky-grid .darts-num.active,
.darts-num.molkky-miss.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
  box-shadow: var(--shadow-teal-glow);
}
/* Plan de la dialog : les mêmes quilles en bois que le copilote. Touchée, une
   quille se couche (animation de chute) ; relâchée, elle se relève. Spécificité
   renforcée : passe devant .darts-num, son thème sombre et la sélection teal. */
.molkky-plan .darts-num.molkky-pin,
html.theme-dark .molkky-plan .darts-num.molkky-pin {
  color: #5a3b1a;
  background: radial-gradient(circle at 35% 30%, #f6dfb5, #d9b27a 70%, #c49a5f);
  border: 3px solid #a87a43;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
  font-weight: 900;
  transition: transform 0.3s ease, opacity 0.3s ease, filter 0.3s ease;
}
.molkky-plan .darts-num.molkky-pin.active,
html.theme-dark .molkky-plan .darts-num.molkky-pin.active {
  transform: translateY(15%) rotate(var(--fall, -82deg)) scale(0.88);
  opacity: 0.55;
  filter: grayscale(0.4);
  box-shadow: none;
  animation: molkky-pin-tap 0.5s cubic-bezier(0.5, 0, 0.6, 1);
}
@keyframes molkky-pin-tap {
  0% { transform: none; opacity: 1; filter: none; }
  20% { transform: rotate(calc(var(--fall) * -0.12)); }
  75% { transform: translateY(15%) rotate(var(--fall)) scale(0.9); }
  88% { transform: translateY(9%) rotate(calc(var(--fall) * 0.9)) scale(0.88); }
  100% { transform: translateY(15%) rotate(var(--fall)) scale(0.88); opacity: 0.55; filter: grayscale(0.4); }
}
.molkky-plan .darts-num.molkky-pin.is-goal,
html.theme-dark .molkky-plan .darts-num.molkky-pin.is-goal {
  color: #fff;
  background: radial-gradient(circle at 35% 30%, var(--success), var(--success-dark));
  border-color: var(--success-dark);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.7), 0 0 16px var(--success);
  animation: copilot-pin-glow 1.4s ease-in-out infinite;
}
.molkky-plan .darts-num.molkky-pin.is-danger,
html.theme-dark .molkky-plan .darts-num.molkky-pin.is-danger {
  color: #fff;
  background: radial-gradient(circle at 35% 30%, #f08a7e, var(--error));
  border-color: var(--error);
}
.molkky-plan.is-missed .darts-num.molkky-pin {
  opacity: 0.5;
}
html.reduce-motion .molkky-plan .darts-num.molkky-pin {
  animation: none;
  transition: none;
}
/* Statut de l'en-tête (total projeté, mis à jour en direct) : rouge sur une
   retombée à 25 / élimination, vert sur un 50 gagnant. */
#mkStatus.is-bust {
  color: var(--error);
}
#mkStatus.is-win {
  color: var(--success-dark);
}
/* Scoreboard : croix des ratés consécutifs (1–2), « reste n » avant le badge. */
.molkky-misses {
  color: var(--error);
  font-weight: 900;
  letter-spacing: 0.08em;
}
.molkky-remain {
  font-size: var(--fs-sm);
  margin-right: 0.4rem;
}
/* Détails : le tag « Éliminé » (gold sur la ligne du 3ᵉ raté) se distingue du
   « → 25 » (corail, style .draw-tag de base) — même logique que last-tile-tag. */
.turn-table .draw-tag.molkky-elim-tag {
  background: var(--ink);
  color: #fff;
}
.darts-chip-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.55rem;
  border-radius: var(--r-round);
  background: var(--card);
  border: 1px solid var(--teal);
  color: var(--text);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: var(--transition-tab);
}
.darts-chip-hint:hover {
  filter: var(--hover-bright);
}
/* Conseil actif (cliqué) : la cible n'affiche plus que celui-ci. */
.darts-chip-hint.active {
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  border-color: var(--teal-dark);
  color: #fff;
  box-shadow: 0 2px 8px var(--teal-glow, rgba(var(--teal-rgb), 0.3));
}
.darts-chip-hint.active .muted {
  color: rgba(255, 255, 255, 0.8);
}

/* Saisie d'une volée : état live, multiplicateurs, grille, puces */
/* Fléchettes saisies (puces) + conseils (tips) sur une même ligne ; passent à la
   ligne suivante si la place manque. */
.darts-entry-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between; /* puces à gauche, conseils à droite */
  gap: 0.4rem 1rem;
}
.darts-entry-row .darts-chips {
  min-height: 0; /* la ligne se dimensionne sur le contenu, pas de hauteur réservée */
}
.darts-live {
  display: flex;
  flex-direction: column;
  gap: var(--sm);
}
.darts-live-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sm);
}
.darts-live-score {
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.darts-live-rem {
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--darts-dark);
}
.darts-live-bust {
  font-weight: 900;
  color: var(--error);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.darts-live-win {
  font-weight: 900;
  color: var(--success-dark);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* Pavé clavier : espace entre la rangée Simple/Double/Triple et la grille via le
   gap du conteneur (plutôt qu'une marge sur les multiplicateurs). */
#dartsKeypad {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
/* `display:flex` (auteur) l'emporte sur le `[hidden]` de l'UA → on rétablit le
   masquage, sinon le pavé reste visible en mode Cible. */
#dartsKeypad[hidden] {
  display: none;
}
.darts-mults {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sm);
}
.darts-mult {
  appearance: none;
  cursor: pointer;
  border: 2px solid var(--ink);
  background: var(--cream);
  color: var(--text);
  font-weight: 800;
  padding: 0.6rem 0.5rem;
  border-radius: var(--r-md);
  transition: var(--transition-tab);
}
.darts-mult:hover {
  filter: var(--hover-bright);
}
.darts-mult.active {
  background: linear-gradient(135deg, var(--darts), var(--darts-dark));
  border-color: var(--darts-dark);
  color: #fff;
  box-shadow: 0 2px 10px var(--darts-glow);
}

.darts-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sm);
}
/* Petit écran : moins de colonnes → boutons plus grands et lisibles. */
@media (max-width: 400px) {
  .darts-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
/* ≤400px : la ligne malus (Brutal) passe en colonne — nom au-dessus, les cinq
   boutons en pleine largeur dessous. Placé APRÈS le bloc 40rem, dont le
   .entry-player { flex-wrap: nowrap } doit céder ici. */
@media (max-width: 400px) {
  .bust-malus-row {
    flex-wrap: wrap;
  }
  .bust-malus-row .pname {
    flex: 1 1 100%;
  }
  .malus-btns {
    flex: 1 1 100%;
  }
  .malus-btn {
    flex: 1;
    width: auto;
  }
}
@media (max-width: 320px) {
  .darts-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.darts-num {
  appearance: none;
  cursor: pointer;
  border: 2px solid var(--ink);
  background: var(--card);
  color: var(--text);
  font-weight: 800;
  font-size: var(--fs-lg);
  font-variant-numeric: tabular-nums;
  padding: 0.7rem 0.25rem;
  border-radius: var(--r-md);
  transition: var(--transition-tab);
}
.darts-num:hover {
  filter: var(--hover-bright);
}
.darts-num:active {
  transform: var(--press-scale);
}
.darts-num.darts-bull {
  color: var(--coral-dark);
  border-color: var(--coral-dark);
}
.darts-num.darts-miss {
  color: var(--muted);
}
.darts-grid.is-full .darts-num {
  opacity: 0.4;
  pointer-events: none;
}
/* Dark mode : les boutons prenaient le fond des cards (--card, identique au panneau)
   avec un contour quasi noir (--ink) → quasi invisibles. On éclaircit le fond
   (--cream) et on pose un contour clair translucide pour des cibles bien lisibles.
   Le coral du Bull/25 et le multiplicateur actif gardent leur style. */
html.theme-dark .darts-num {
  background: var(--cream);
}
html.theme-dark .darts-num:not(.darts-bull),
html.theme-dark .darts-mult:not(.active) {
  border-color: rgba(233, 245, 243, 0.22);
}

.darts-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.25rem;
}
/* Fléchettes de la volée en cours : même vocabulaire que l'écran copilote —
   puce pleine portant la notation ET ses points, et une puce fantôme pour ce
   qu'il reste à lancer. Ici s'ajoute la croix, qui retire la fléchette. */
.darts-chip {
  appearance: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.6rem;
  border-radius: var(--r-round);
  border: 2px solid var(--sky-dark);
  background: var(--sky);
  color: #fff;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.darts-chip .darts-chip-pts {
  color: rgba(255, 255, 255, 0.8);
}
.darts-chip i {
  color: rgba(255, 255, 255, 0.75);
}
/* Total de la volée (somme des fléchettes saisies), à côté des puces. */
.darts-chip-total {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border-radius: var(--r-round);
  background: linear-gradient(135deg, var(--darts), var(--darts-dark));
  color: #fff;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.darts-chip-empty {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.6rem;
  border-radius: var(--r-round);
  border: 2px dashed var(--teal-light);
  color: var(--muted);
  font-weight: 800;
  font-size: var(--fs-sm);
}

/* Bouton « Raté » du mode cible : centré, largeur modérée (un raté = 0 pt qui ne
   peut pas se viser sur le plateau). Désactivé visuellement quand la volée est pleine. */
.darts-board-actions {
  display: flex;
  justify-content: center;
}
/* `display:flex` (règle d'auteur) l'emporte sur le `[hidden]` de l'UA → on rétablit
   explicitement le masquage, sinon le bouton « Raté » reste visible en mode clavier. */
.darts-board-actions[hidden] {
  display: none;
}
.darts-board-miss {
  min-width: 8rem;
}
.darts-board-actions.is-full {
  opacity: 0.4;
  pointer-events: none;
}

/* Saisie d'une volée sur mobile : compacter pour que tout tienne sans scroller. */
@media (max-width: 600px) {
  .darts-volley-body {
    gap: 0.6rem;
    padding: 0.75rem 0.85rem;
  }
  .darts-mults {
    gap: 0.4rem;
  }
  .darts-mult {
    padding: 0.5rem 0.4rem;
  }
  .darts-grid {
    gap: 0.4rem;
  }
  .darts-num {
    padding: 0.5rem 0.2rem;
    font-size: var(--fs-md);
  }
}

/* L'option 501 / 301 du setup réutilise le segmented control des réglages
   (.segmented), donc pas de style dédié ici — juste un peu d'air sous le track. */
#dartsStartOpts {
  font-variant-numeric: tabular-nums;
}

/* Détails : colonne fléchettes (le reste à 0 garde le style normal du badge) */
.darts-detail-cell {
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-sm);
}
.darts-bust-tag {
  color: var(--error);
}

/* ---- Cible SVG (thémable + clignotement des zones à viser) ---- */
.dartboard {
  /* `display:block` indispensable : <app-dartboard> est un élément personnalisé,
     donc inline par défaut → max-width ignoré et le SVG (width:100%) débordait à
     toute la largeur de la modale sur grand écran. En block, le max-width cape. */
  display: block;
  width: 100%;
  max-width: 22rem;
  margin: 0 auto;
}
/* Cible dans la dialog de saisie : plus compacte, centrée. */
.darts-board-entry {
  max-width: 13rem;
  margin: 0 auto var(--sm);
}
/* Mode « cible » (clic pour saisir) : taille raisonnable sur grand écran (la
   précision est assurée par la loupe), et pleine largeur sur mobile pour viser. */
.darts-board-entry.is-picking {
  max-width: 20rem;
}
@media (max-width: 600px) {
  .darts-board-entry.is-picking {
    max-width: 100%;
  }
}
.dartboard.is-picking,
.dartboard.is-picking svg {
  cursor: crosshair;
}
/* En saisie, on gère nous-mêmes le geste : pas de scroll/zoom natif sur la cible. */
.dartboard.is-picking svg {
  touch-action: none;
}
/* Survol d'une section (mode cible) : on l'éclaircit nettement. */
.dartboard.is-picking svg path[id]:hover,
.dartboard.is-picking svg circle[id]:hover {
  filter: brightness(1.35) saturate(1.1);
}

/* ---- Loupe de visée (mode cible) : cercle zoomé suivant le doigt ---- */
.dartboard-loupe {
  position: fixed;
  width: 8.5rem;
  height: 8.5rem;
  z-index: 9999;
  pointer-events: none; /* purement visuelle, n'intercepte jamais le geste */
}
.dartboard-loupe-glass {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  background: var(--card);
  border: 3px solid var(--card);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.35),
    0 0 0 2px var(--ink);
}
.dartboard-loupe-inner {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  will-change: transform;
}
.dartboard-loupe-inner svg {
  display: block;
}
/* Viseur au centre de la loupe : anneau blanc + point. */
.dartboard-loupe-cross {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1rem;
  height: 1rem;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow:
    0 0 0 1.5px rgba(0, 0, 0, 0.6),
    inset 0 0 0 1.5px rgba(0, 0, 0, 0.45);
}
.dartboard-loupe-cross::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3px;
  height: 3px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6);
}
/* Libellé de la zone visée : au-dessus de la loupe par défaut, pour rester
   visible (le doigt est sous la loupe et le masquerait s'il était dessous). */
.dartboard-loupe-label {
  position: absolute;
  left: 50%;
  bottom: 100%;
  margin-bottom: 0.45rem;
  transform: translateX(-50%);
  white-space: nowrap;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
  padding: 0.2rem 0.65rem;
  border-radius: var(--r-round);
}
/* Loupe rabattue sous le doigt (haut d'écran) : le libellé passe dessous,
   à nouveau du côté opposé au doigt. */
.dartboard-loupe.is-below .dartboard-loupe-label {
  bottom: auto;
  top: 100%;
  margin-bottom: 0;
  margin-top: 0.45rem;
}
.dartboard-loupe.is-off .dartboard-loupe-label {
  background: var(--muted);
}
.dartboard svg {
  width: 100%;
  height: auto;
  display: block;
}
/* Remappe les couleurs figées de la cible importée sur les tokens de thème.
   Le combinateur descendant l'emporte sur le <style> interne du SVG (.cls-*).
   S'applique aussi au clone de la loupe (rattaché au body, hors .dartboard). */
.dartboard svg .cls-1,
.dartboard-loupe svg .cls-1 { fill: var(--db-red); }
.dartboard svg .cls-4,
.dartboard-loupe svg .cls-4 { fill: var(--db-green); }
.dartboard svg .cls-2,
.dartboard-loupe svg .cls-2 { fill: var(--db-bed-light); }
.dartboard svg .cls-3,
.dartboard-loupe svg .cls-3 { fill: var(--db-bed-dark); }
.dartboard svg .cls-5,
.dartboard-loupe svg .cls-5 { fill: var(--db-number); }
.dartboard svg .cls-1,
.dartboard svg .cls-2,
.dartboard svg .cls-3,
.dartboard svg .cls-4,
.dartboard-loupe svg .cls-1,
.dartboard-loupe svg .cls-2,
.dartboard-loupe svg .cls-3,
.dartboard-loupe svg .cls-4 {
  stroke: var(--db-wire);
}
/* Zone conseillée : pulse doré pour la mettre en évidence. */
.dartboard svg .db-blink,
.dartboard-loupe svg .db-blink {
  fill: var(--gold) !important;
  stroke: var(--gold-dark);
  animation: db-blink 0.9s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes db-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}
html.reduce-motion .dartboard svg .db-blink,
html.reduce-motion .dartboard-loupe svg .db-blink {
  animation: none;
  fill: var(--gold) !important;
}
/* Zone sélectionnée (fléchette saisie) : couleur fixe, distincte du conseil.
   Définie après .db-blink → l'emporte si une zone est à la fois visée et saisie. */
.dartboard svg .db-picked,
.dartboard-loupe svg .db-picked {
  fill: var(--sky) !important;
  stroke: var(--sky-dark);
  animation: none;
}
/* Conseillée ET déjà touchée : elle garde le bleu de la fléchette saisie, mais
   clignote comme un conseil — sinon on ne voit plus qu'elle est visée. */
.dartboard svg .db-picked.db-blink,
.dartboard-loupe svg .db-picked.db-blink {
  animation: db-blink 0.9s ease-in-out infinite;
}
html.reduce-motion .dartboard svg .db-picked.db-blink,
html.reduce-motion .dartboard-loupe svg .db-picked.db-blink {
  animation: none;
  fill: var(--sky) !important;
}

/* ===================== Écran copilote (second écran) =====================
   Vue plein écran en lecture seule (route #/[lieu]/[id]/copilot, js/copilot.js),
   pensée pour une tablette / TV posée près de la table. Elle recouvre la page en
   fixed (z-index 12 : au-dessus de la topbar (10), sous les dialogs (20) et les
   flashs / célébration (90+), qui doivent rester visibles par-dessus). Les
   tailles internes sont en em sur une base qui suit la taille de l'écran
   (clamp sur vmin) pour rester lisibles de loin. */
body.copilot-mode {
  overflow: hidden; /* le document ne défile pas : seules les zones internes le font */
}
body.copilot-mode .topbar {
  display: none;
}
/* Sous-ligne d'un nom (les joueurs d'une équipe). Sa taille générale est en rem
   FIXE (0.75rem) : sur un écran regardé de loin, elle devient illisible à côté
   d'un nom qui, lui, suit la taille de l'écran. Ici tout est en em — les
   contextes qui veulent une autre échelle la redéfinissent plus bas. */
.copilot .name-sub {
  font-size: 0.7em;
  font-weight: 600;
}
/* Fin de partie : les confettis couvrent l'écran entier (la racine est en fixed
   inset:0) et les pièces le traversent vraiment, au lieu des 220px d'une
   bannière de victoire. z-index négatif : ils tombent DERRIÈRE le contenu —
   au-dessus du fond de l'écran (peint avant, .copilot ouvre son propre plan),
   sous le podium, la bannière et les listes, qu'ils ne doivent pas piqueter. */
.copilot > .confetti {
  z-index: -1;
}
.copilot .confetti i {
  --fall: 108vh;
}
.copilot {
  position: fixed;
  inset: 0;
  z-index: 12;
  display: flex;
  flex-direction: column;
  gap: var(--copilot-gap);
  background: radial-gradient(
    900px 500px at 85% -8%,
    var(--teal-bg) 0%,
    var(--surface) 60%
  );
  color: var(--text);
  font-size: clamp(0.95rem, 0.6rem + 1.1vmin, 1.6rem);
  /* Espacements communs à toutes les déclinaisons : marge intérieure des cartes
     (lignes de liste, carte Yam's, cellules de la grille) et gap entre blocs —
     un podium, une grille ou une cible doivent respirer pareil. */
  --copilot-pad: 1em;
  --copilot-gap: 0.75em;
}
/* Marges de l'écran, safe-areas comprises (barre d'état / encoche en haut,
   indicateur d'accueil en bas, en PWA). Sélecteur appuyé à dessein : .copilot
   est l'enfant direct de <main>, et les règles `main > *:first-child:not(…)`
   (padding-top 0) et `main > *:last-child` (padding-bottom 0) sont plus
   spécifiques qu'une simple classe — elles écrasaient ces marges et l'en-tête
   passait sous la barre d'état iOS. */
main > .copilot:first-child,
main > .copilot:last-child,
.copilot {
  padding:
    calc(0.75em + env(safe-area-inset-top))
    calc(1.1em + env(safe-area-inset-right))
    calc(0.75em + env(safe-area-inset-bottom))
    calc(1.1em + env(safe-area-inset-left));
}

/* ---- en-tête : état (manche / tour de…) à gauche, ✕ à droite ---- */
/* Largeur bornée et centrée (une TV large ne doit pas étirer le podium d'un
   bord à l'autre) ; en-tête et corps partagent la même colonne. */
.copilot-head,
.copilot-body {
  width: 100%;
  max-width: 80rem;
  margin-inline: auto;
}
.copilot-head {
  display: flex;
  align-items: center;
  gap: 0.6em 0.9em;
  flex: 0 0 auto;
}
.copilot-status {
  font-size: 1.45em;
  font-weight: 900;
  color: var(--teal-dark);
  min-width: 0;
  flex: 1 1 auto;
}
/* Hors-ligne / synchro bloquée : le seul endroit du copilote qui dit que ce
   qu'on lit n'est peut-être plus à jour. Discret, mais pas au point de passer
   inaperçu — c'est justement l'écran que personne ne touche. */
.copilot-sync {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  flex: 0 0 auto;
  padding: 0.25em 0.7em;
  border-radius: 999px;
  background: rgba(212, 82, 51, 0.16);
  box-shadow: inset 0 0 0 2px rgba(212, 82, 51, 0.45);
  color: var(--coral-dark);
  font-size: 0.85em;
  font-weight: 800;
}
html.theme-dark .copilot-sync {
  color: #ff9d7f;
}
.copilot-sync[hidden] {
  display: none;
}
/* ✕ : icône nue (ni fond ni bordure). La zone tactile (2.4em) est plus large
   que l'icône (~1em) : sans compensation, l'icône se retrouverait ~0.7em plus
   loin du bord droit que le texte d'état ne l'est du bord gauche. La marge
   négative aligne l'icône sur le bord du contenu (la zone tactile déborde dans
   le padding de l'écran, plus large qu'elle). Fond discret au survol seulement. */
.copilot-exit {
  appearance: none;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: auto;
  margin-right: -0.7em;
  width: 2.4em;
  height: 2.4em;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--teal-dark);
  font-size: 1.3em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  transition: var(--transition-tab);
}
.copilot-exit:hover {
  background: var(--teal-bg);
}
.copilot-exit:active {
  transform: var(--press-scale);
}
/* Le contenu est centré verticalement quand il tient dans l'écran : ses blocs
   ne grandissent pas (flex 0 1 auto) mais peuvent se réduire (min-height 0) —
   quand ça déborde, c'est la zone défilante qui se contracte et défile. */
.copilot-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--copilot-gap);
}

/* ---- bandeau de fin (vainqueur / annulée), comme la bannière du tableau ---- */
.copilot-winline {
  flex: 0 0 auto;
  text-align: center;
  font-size: 1.2em;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #e3c077, #b3843f);
  border-radius: var(--r-xl);
  padding: 0.65em 1em;
  box-shadow: var(--shadow-accent-glow);
}
.copilot-winline b {
  font-weight: 900;
}
.copilot-winline.is-cancelled {
  background: linear-gradient(135deg, var(--coral), var(--coral-dark));
  box-shadow: var(--shadow-coral-glow);
}

/* ---- bandeau « c'est enregistré » ----
   Annonce en haut de l'écran le score qui vient d'arriver (cf. js/copilot.js).
   Reprend le toast de l'app, en plus grand (l'écran se lit de loin) et ancré en
   haut : il passe au-dessus de l'en-tête, dont le milieu est libre. */
.copilot-toast {
  position: fixed;
  /* Un cran sous le bord : collé tout en haut il se confondait avec l'en-tête.
     Il peut déborder sur sa ligne — le milieu est libre, statut et ✕ tenant les
     deux côtés. */
  top: calc(3rem + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100vw - 2rem);
  box-sizing: border-box;
  background: var(--teal-dark);
  color: #fff;
  padding: 0.7em 1.2em;
  border-radius: var(--r-round);
  box-shadow: var(--shadow-teal-glow);
  z-index: 30;
  font-size: var(--fs-md);
  font-weight: 800;
  animation: copilot-toast-drop 0.3s var(--bounce);
}
@keyframes copilot-toast-drop {
  from {
    opacity: 0;
    transform: translate(-50%, -0.8em);
  }
}

/* ---- attente (rien de joué) + liste des joueurs ---- */
/* Le cadre en pointillés : ce qu'un écran montre quand il n'a QUE ça à montrer
   (qui commence ?, en attente de l'annonce…). */
.copilot-waiting {
  flex: 0 0 auto;
  text-align: center;
  color: var(--muted);
  font-weight: 800;
  font-size: 1.3em;
  padding: 1.1em 1em;
  border: 3px dashed rgba(var(--teal-rgb), 0.3);
  border-radius: var(--r-lg);
}
/* Sauf avant le premier score : la table est déjà là, ce sont les joueurs qu'on
   lit. L'attente redevient ce qu'elle est — une note de bas d'écran, sans cadre
   qui lui donnerait plus d'importance que les noms. */
.copilot-waiting.is-quiet {
  border: 0;
  padding: 0.3em 1em 0;
  font-size: 1.05em;
}
/* Rangées équilibrées : le nombre de colonnes est calculé d'après le nombre de
   joueurs (cf. js/copilot.js) — à six, 3 + 3 et non 5 + 1, qui laissait un nom
   seul en bas. */
.copilot-roster {
  display: grid;
  grid-template-columns: repeat(var(--roster-cols, 3), minmax(0, 1fr));
  gap: 0.6em;
}
/* Écran étroit (un téléphone posé sur la table) : deux colonnes quoi que dise
   ce compte — trois noms côte à côte n'y tiendraient pas. */
@media (max-width: 34rem) {
  .copilot-roster {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.copilot-roster-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15em;
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 1.3em 0.9em;
  font-size: 1.6em;
  font-weight: 800;
  color: var(--teal-dark);
  box-shadow: var(--shadow-card);
  text-align: center;
  overflow-wrap: anywhere;
}
/* Grande tablée : les cartes se resserrent pour que tout le monde tienne à
   l'écran — personne ne va faire défiler un écran posé au milieu de la table
   (même parti pris que les camps du Loup-Garou). */
.copilot-roster.is-dense .copilot-roster-item {
  padding: 0.7em 0.8em;
  font-size: 1.15em;
}
/* Avant la première manche validée, la liste porte déjà les marqueurs de la
   manche en cours (nom barré d'un éliminé, pastille « stoppé », points saisis —
   règles communes avec le podium plus bas) ; le joueur courant est cerclé,
   comme sa puce de total au Yam's. */
.copilot-roster-item.is-current {
  box-shadow:
    0 0 0 2px var(--coral),
    var(--shadow-card);
}
/* Points déjà saisis dans la manche en cours : le total projeté sous le nom,
   comme sur une marche du podium (.copilot-entry-total), à l'échelle de la carte. */
.copilot-roster-item .copilot-entry-total {
  font-size: 1.15em;
}

/* ---- podium : 2 · 1 · 3, noms au-dessus de chaque marche ---- */
.copilot-podium-wrap {
  flex: 0 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: var(--copilot-gap);
}
.copilot-podium {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 0.6em;
  padding: 0.5em 0 0; /* les marches extérieures s'alignent sur les bords des cartes */
}
/* Les marches se partagent la largeur, la 1re un peu plus large — et non des
   colonnes fixes : seules les marches OCCUPÉES sont dessinées (moins de trois
   concurrents, ou une égalité qui absorbe la place suivante), si bien qu'un
   podium peut être 2 · 1 · 3, 1 · 3, 2 · 1 ou la seule 1re. */
.copilot-step {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4em;
  min-width: 0;
}
.copilot-step-1 {
  flex-grow: 1.25;
}
.copilot-step-names {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25em;
  width: 100%;
  text-align: center;
}
.copilot-name {
  font-size: 1.15em;
  font-weight: 900;
  line-height: 1.15;
  color: var(--teal-dark);
  max-width: 100%;
  overflow-wrap: anywhere;
}
.copilot-step-1 .copilot-name {
  font-size: 1.5em;
}
/* Beaucoup de noms sur une même marche (égalité) : on resserre. */
.copilot-step.is-many .copilot-name {
  font-size: 0.9em;
}
.copilot-step-1.is-many .copilot-name {
  font-size: 1.1em;
}
.copilot-step-total {
  font-size: 2.3em;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.copilot-step-1 .copilot-step-total {
  font-size: 2.9em;
}
.copilot-step-block {
  width: 100%;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 0.45em;
  box-shadow: var(--shadow-md);
  color: #fff;
}
/* Même or / argent / bronze que les badges de rang (.badge.rank1/2/3). */
.copilot-step-1 .copilot-step-block {
  height: 6.5em;
  background: linear-gradient(135deg, #e3c077, #b3843f);
}
.copilot-step-2 .copilot-step-block {
  height: 4.6em;
  background: linear-gradient(135deg, #bdc0c5, #8a8f92);
}
.copilot-step-3 .copilot-step-block {
  height: 3.4em;
  background: linear-gradient(135deg, #e3ab82, #b36b4b);
}
.copilot-rank {
  font-size: 1.9em;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
/* Partie terminée : la 1re marche pulse en or, confettis par-dessus le podium. */
.copilot-podium.is-over .copilot-step-1 .copilot-step-block {
  animation: glow-pulse 2s ease-in-out infinite;
}

/* ---- états d'un joueur (podium et listes) ---- */
.copilot .crown {
  display: inline-block;
  color: var(--gold-dark);
  animation: crown-bounce 1.5s infinite;
}
.copilot .copilot-name-text.is-me {
  color: var(--gold-dark);
}
.copilot .is-eliminated .copilot-name-text {
  color: var(--coral-dark);
  text-decoration: line-through;
  text-decoration-color: rgba(212, 82, 51, 0.5);
}
/* Marqueur « c'est à lui » (tour par tour), devant le nom, qui pulse. */
.copilot-turn-ico {
  color: var(--coral);
  font-size: 0.7em;
  vertical-align: middle;
  margin-right: 0.15em;
  animation: copilot-turn-pulse 1.2s ease-in-out infinite;
}
@keyframes copilot-turn-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}
/* Skyjo : score de la manche doublé (pénalité du premier sorti). Même pastille
   que « Éliminé » / « Pioche », au vert du jeu — c'est l'explication du total
   projeté en corail juste à côté. */
.x2-tag {
  margin-left: 0.5rem;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  background: var(--skyjo);
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: 800;
  white-space: nowrap;
  vertical-align: middle;
}
/* Les pastilles d'état (éliminé, stoppé, Fanny, ratés, ×2) suivent l'échelle des
   noms plutôt que leur taille rem du tableau. */
.copilot .elim-tag,
.copilot .stop-tag,
.copilot .fanny-tag,
.copilot .x2-tag {
  font-size: 0.5em;
  vertical-align: middle;
  margin-left: 0.4em;
}
/* « Stoppé » : icône seule, un peu plus grande pour rester lisible de loin. */
.copilot .stop-tag {
  font-size: 0.6em;
  padding: 0.3em 0.55em;
}
.copilot-step-total .elim-tag,
.copilot-row-total .elim-tag {
  margin-left: 0.4em;
}
/* Égalité projetée de scores actuels différents : chaque nom porte son total. */
.copilot-entry {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15em;
}
.copilot-entry-total {
  font-size: 1.6em;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* Ratés consécutifs : une ligne à eux, au-dessus du nom (à sa droite, ils se
   lisaient comme une partie du nom d'équipe). */
.copilot .molkky-misses {
  display: block;
  font-size: 0.7em;
  line-height: 1;
  margin: 0 0 0.15em;
  letter-spacing: 0.1em;
}

/* ---- zone défilante (suite du classement, grille Yam's, joueurs fléchettes) ----
   Défilement piloté en JS (js/copilot.js) : la barre est masquée, le fond de la
   liste s'estompe en bas tant qu'il reste du contenu à venir (.is-overflow). */
.copilot-scroll {
  position: relative;
  flex: 0 1 auto;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
  border-radius: var(--r-xl);
  background: var(--card);
  box-shadow: var(--shadow-card);
}
.copilot-scroll::-webkit-scrollbar {
  display: none;
}
.copilot-scroll.is-overflow {
  -webkit-mask-image: linear-gradient(
    to bottom,
    #000 0,
    #000 calc(100% - 2.5em),
    transparent 100%
  );
  mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 2.5em), transparent 100%);
}
/* Quand ça défile, une réserve en bas du contenu de la hauteur du fondu : la
   dernière ligne (le total de la grille, le dernier joueur) remonte au-dessus
   de la bande estompée en fin de course au lieu d'y rester noyée. */
.copilot-scroll.is-overflow > :last-child {
  margin-bottom: 2.5em;
}
.copilot-list {
  display: flex;
  flex-direction: column;
}
.copilot-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.8em;
  padding: 0.6em var(--copilot-pad);
  font-size: 1.2em;
}
.copilot-row + .copilot-row {
  border-top: 1px solid rgba(var(--teal-rgb), 0.12);
}
/* Ligne du joueur courant : teinte DORÉE et liseré assorti. En teal elle se
   confondait avec le fond de page (teal très pâle lui aussi) ; en corail elle
   sonnait comme un avertissement, alors que c'est simplement à lui de jouer. */
.copilot-row.is-current {
  background: rgba(var(--gold-rgb), 0.26);
  box-shadow: inset 0.25rem 0 0 var(--gold-dark);
}
html.theme-dark .copilot-row.is-current {
  background: rgba(var(--gold-rgb), 0.16);
}
.copilot-row .badge {
  font-size: 0.85em;
  min-width: 2.3em;
  padding: 0.3em 0.6em;
}
.copilot-row-name {
  font-weight: 800;
  color: var(--teal-dark);
  min-width: 0;
  overflow-wrap: anywhere;
}
.copilot-row-total {
  font-size: 1.35em;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.copilot-row-total.is-finish {
  color: var(--success-dark);
}
.copilot .is-eliminated .copilot-row-total {
  color: var(--coral-dark);
  opacity: 0.7;
}

/* ---- puces (missions restantes, conseils, fléchettes lancées) ---- */
.copilot-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45em;
}
.copilot-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.35em 0.75em;
  border-radius: var(--r-round);
  border: 2px solid var(--teal-light);
  background: var(--cream);
  color: var(--teal-dark);
  font-weight: 800;
  font-size: 1.05em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.copilot-chip .yams-fixed-tag {
  font-size: 0.7em;
  margin-left: 0;
}
/* Conseil de fin (checkout) : or, comme les zones qui clignotent sur la cible. */
/* Conseils de fin : même habillage que dans la dialog de saisie — puce claire
   cerclée de teal, les points entre parenthèses, en retrait. */
.copilot-chip.is-hint {
  border-width: 1px;
  border-color: var(--teal);
  background: var(--card);
  color: var(--text);
}
/* Celui que le marqueur a désigné dans la dialog : mis en avant ici aussi, et
   seul à faire clignoter sa zone sur la cible. */
.copilot-chip.is-hint.active {
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  border-color: var(--teal-dark);
  color: #fff;
}
.copilot-chip.is-hint.active .muted {
  color: rgba(255, 255, 255, 0.8);
}
.copilot-chip.is-hint .muted {
  color: rgba(35, 48, 56, 0.65);
}
/* Fléchette déjà lancée : bleu, comme la zone marquée sur la cible (.db-picked). */
.copilot-chip.is-thrown {
  border-color: var(--sky-dark);
  background: var(--sky);
  color: #fff;
}
.copilot-chip.is-thrown .muted {
  color: rgba(255, 255, 255, 0.85);
}
.copilot-chip.is-ghost {
  border-style: dashed;
  background: transparent;
  color: var(--muted);
}

/* ---- Yam's : la liste des missions du joueur courant, reprise de la dialog de
   saisie (.yams-missions / .yams-mission : jouées grisées avec leur score, en
   cours de choix en actif), + les totaux de tous les joueurs en bas ---- */
.copilot-yams,
.copilot-bombu {
  flex: 0 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: var(--copilot-gap);
}
.copilot-yams-card {
  flex: 0 1 auto; /* prend sa hauteur ; défile seulement si l'écran est trop petit */
  display: flex;
  flex-direction: column;
  gap: 0.7em;
  padding: var(--copilot-pad);
}
.copilot-yams-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6em;
  flex-wrap: wrap;
}
.copilot-yams-name {
  font-size: 1.6em;
  font-weight: 900;
  color: var(--teal-dark);
}
.copilot-yams-count {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-size: 1.05em;
  font-weight: 800;
}
.copilot-yams-count .badge {
  font-size: 0.9em;
}
/* La liste de la dialog, remise à l'échelle de l'écran : 2 missions par ligne
   sur mobile, 3 sur desktop / tablette large / TV, items plus grands. */
.copilot .yams-missions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55em;
  margin-bottom: 0;
}
@media (min-width: 760px) {
  .copilot .yams-missions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.copilot .yams-section-head {
  font-size: 1em;
}
.copilot .yams-section-bonus {
  font-size: 0.85em;
}
.copilot-yams-count .yams-section-bonus {
  font-size: 1em;
}
.copilot .yams-mission {
  font-size: 1.15em;
  padding: 0.6em 0.9em;
  cursor: default; /* lecture seule : rien à cliquer */
}
.copilot .yams-mission:hover {
  filter: none;
}
/* Mobile : la dialog de saisie laisse un nom long passer sur deux lignes
   (cf. .yams-mission-name) ; sur le copilote, au texte plus grand, ça déformait
   les pastilles (« Grande suite » sur deux lignes, et sur un petit écran les
   noms coupés lettre par lettre). Ici, le nom tient sur une ligne : le texte
   suit la largeur de l'écran (≈ 12 px sur iPhone SE, 15 px sur iPhone 13), avec
   marges et pastilles resserrées. */
@media (max-width: 30rem) {
  .copilot .copilot-yams .yams-mission {
    font-size: min(1.15em, 3.8vw);
    padding: 0.55em 0.65em;
    gap: 0.35em;
  }
  .copilot .copilot-yams .yams-mission-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    overflow-wrap: normal;
  }
  .copilot .copilot-yams .yams-fixed {
    padding: 0.15em 0.4em;
  }
}
.copilot .yams-fixed {
  font-size: 0.8em;
  padding: 0.15em 0.6em;
}
@keyframes badge-pop {
  0% {
    transform: scale(0.65);
  }
  55% {
    transform: scale(1.25);
  }
}
/* Changement de joueur (tour validé) : les deux listes de contrats glissent
   dans une fenêtre qui les rogne — celle du joueur qui vient de jouer descend
   et sort par le bas, celle du suivant monte d'en dessous et la recouvre. La
   sortante est une copie (cf. js/copilot.js) posée en absolu, donc hors du
   flux : la hauteur reste celle de la nouvelle carte et rien ne saute. La
   fenêtre est démontée dès le glissement fini, pour ne pas rogner l'ombre de
   la carte le reste du temps. */
.copilot-yams-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  min-height: 0;
  overflow: hidden;
}
.copilot .copilot-yams-card.is-leaving {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1; /* dessous : la liste qui arrive lui passe par-dessus */
  pointer-events: none;
  animation: copilot-card-out 0.5s ease-in-out forwards;
}
.copilot .copilot-yams-card.is-entering {
  position: relative;
  z-index: 2; /* au-dessus : elle recouvre la sortante en montant */
  animation: copilot-card-in 0.5s ease-in-out;
}
@keyframes copilot-card-out {
  to {
    transform: translateY(100%);
    opacity: 0;
  }
}
@keyframes copilot-card-in {
  from {
    transform: translateY(100%);
  }
}
/* Changement de contrat : la mission qui vient d'être choisie sur l'appareil de
   saisie surgit avec un halo, pour attraper l'œil depuis l'autre bout de la
   table (posée une seule fois, cf. js/copilot.js). */
.copilot .yams-mission.is-picked {
  position: relative; /* le temps du « pop », passe au-dessus de ses voisines */
  z-index: 1;
  --pick-glow: rgba(var(--teal-rgb), 0.7); /* halo : la couleur de la mission… */
  --pick-glow-fade: rgba(var(--teal-rgb), 0);
  animation: copilot-pick-pop 0.55s var(--bounce);
}
.copilot .yams-mission.is-picked.is-zero {
  --pick-glow: rgba(216, 45, 33, 0.7); /* … rouge quand le contrat vaut déjà 0 */
  --pick-glow-fade: rgba(216, 45, 33, 0);
}
@keyframes copilot-pick-pop {
  0% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 var(--pick-glow);
  }
  55% {
    transform: scale(1.06);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 1.1em var(--pick-glow-fade);
  }
}
/* Totaux de tous les joueurs : puces compactes, le joueur courant cerclé. */
.copilot-totals {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5em;
}
.copilot-total-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.45em 0.9em;
  border-radius: var(--r-round);
  background: var(--card);
  box-shadow: var(--shadow-card);
  font-size: 1.1em;
  font-weight: 800;
  color: var(--teal-dark);
}
.copilot-total-chip.is-current {
  box-shadow:
    0 0 0 2px var(--coral),
    var(--shadow-card);
}
.copilot-total-chip .badge {
  font-size: 0.8em;
  padding: 0.25em 0.55em;
  min-width: 2em;
}
.copilot-total-chip .name-sub {
  display: none; /* équipes : pas de sous-ligne dans une puce (Yam's = joueurs) */
}
.copilot-total-num {
  font-size: 1.2em;
  font-weight: 900;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
/* Partie finie : la grille complète (structure de <app-yams-table>), agrandie. */
.copilot-scroll table.score {
  min-width: 0;
}
/* Colonnes joueurs de largeur ÉGALE : chaque <th> joueur reçoit la même largeur
   en % (posée en JS, 80 % / nombre de joueurs) ; la colonne mission garde le
   « au plus serré » de .yams-table (width:1px + nowrap) et ne passe donc JAMAIS
   à la ligne — si elle a besoin de plus de place, les colonnes joueurs se
   réduisent, mais toutes de la même quantité. */
.copilot-yams-table th,
.copilot-yams-table td {
  padding: 0.5em 0.7em;
  font-size: 1em;
}
/* Bords de la grille alignés sur la marge intérieure commune des cartes. */
.copilot-yams-table th:first-child,
.copilot-yams-table td:first-child {
  padding-left: var(--copilot-pad);
}
.copilot-yams-table th:last-child,
.copilot-yams-table td:last-child {
  padding-right: var(--copilot-pad);
}
.copilot-yams-table thead th {
  font-size: 1.05em;
}
/* L'en-tête reste collé en haut pendant le défilement auto : au-dessus des
   cellules (.yams-cell est en position relative, donc peinte après lui sans ce
   z-index) et des noms de mission collés à gauche (z-index 1) — y compris pour
   la cellule « Mission », elle-même .player-name (d'où le sélecteur appuyé). */
.copilot .copilot-yams-table thead th,
.copilot .copilot-yams-table thead th.player-name {
  z-index: 3;
}
.copilot-yams-table .yams-pts {
  font-size: 1.15em;
}
.copilot-yams-table .yams-fixed-tag {
  font-size: 0.7em;
}

/* ---- Loup-Garou : le cycle du village ----
   L'écran prend la couleur de l'heure : bleu de nuit quand le village dort,
   ciel clair au matin. Le bilan des morts n'apparaît que le jour. */
.copilot-ww {
  position: relative;
  overflow: hidden; /* le voile de transition suit les coins arrondis */
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  padding: 1.2em;
  border-radius: var(--r-xl);
  text-align: center;
}
.copilot-ww > * {
  position: relative;
  z-index: 1; /* au-dessus du voile */
}
/* … sauf les confettis de fin de partie : la carte a un fond opaque qui cacherait
   ceux de l'écran (cf. .copilot > .confetti), alors ils tombent dedans — sur son
   fond, mais sous tout ce qu'elle porte. */
.copilot-ww > .confetti {
  position: absolute;
  z-index: 0;
}
/* Le lever du jour (ou la tombée de la nuit) : l'heure précédente recouvre
   encore tout l'écran, puis se retire lentement. Une transition ne conviendrait
   pas — le nœud est recréé à chaque synchro et naîtrait déjà dans sa couleur
   d'arrivée (cf. js/copilot.js). */
.copilot-ww.is-turning::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* Par-dessus TOUTE la scène, texte compris : au premier instant, l'écran
     porte déjà les couleurs de la nouvelle heure (texte sombre le jour), qui
     seraient illisibles sur le fond de l'heure précédente. Tout se révèle donc
     ensemble, comme une lumière qu'on remonte.
     `opacity: 0` au repos ET `both` : si l'animation ne démarre pas (onglet en
     arrière-plan au montage), le voile reste invisible au lieu de masquer tout
     l'écran. */
  z-index: 2;
  opacity: 0;
  animation: copilot-ww-daylight 2.8s ease-in-out both;
}
.copilot-ww.is-day.is-turning::after,
.copilot-ww.is-over.is-turning::after {
  background: #16233f; /* la nuit qui se dissipe */
}
.copilot-ww.is-night.is-turning::after {
  background: #cfeaf3; /* le jour qui s'éteint */
}
@keyframes copilot-ww-daylight {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
html.reduce-motion .copilot-ww.is-turning::after {
  animation: none;
  opacity: 0;
}
.copilot-ww.is-night {
  background: radial-gradient(circle at 50% 22%, #2b3f6b 0%, #16233f 55%, #0d1526 100%);
  color: #dce7ff;
}
.copilot-ww.is-day {
  background: radial-gradient(circle at 50% 22%, #fff3c9 0%, #cfeaf3 55%, #bfe3ef 100%);
  color: var(--ink);
}
/* Fin de partie : couleurs écrites en clair (et non via --cream, qui vire au
   vert sombre dans le thème nuit et troublait le doré). */
/* ---- Fin de partie : dans le thème de l'app ----
   Pas de décor : un panneau aux couleurs de l'app (clair ou sombre), comme les
   autres écrans copilote. Les panneaux de camp portent la palette — turquoise
   pour le village, accent Loup-Garou pour les loups — et l'anneau doré va au
   vainqueur. */
/* Fin de partie : le fond prend le parti du vainqueur, dans la même écriture que
   le jour et la nuit (un halo en haut, qui s'assombrit vers le bas). L'aube quand
   le village s'en sort, la nuit rouge quand la meute l'emporte, un crépuscule
   neutre quand aucun camp n'est identifié. Les cartes des camps sont bâties sur
   --card : elles ressortent sur ces fonds sombres sans rien changer. */
.copilot-ww.is-over {
  background: radial-gradient(circle at 50% 20%, #3b4b7a 0%, #22304f 50%, #101a2c 100%);
  color: #dce7ff;
}
.copilot-ww.is-over.is-win-village {
  background: radial-gradient(circle at 50% 20%, #f7c78b 0%, #8a6484 45%, #2b1f3d 100%);
  color: #fff4e2;
}
.copilot-ww.is-over.is-win-loups {
  background: radial-gradient(circle at 50% 20%, #8e2b36 0%, #45161f 48%, #180a0e 100%);
  color: #ffe2e2;
}
/* Les cartes restées dans la boîte : sur fond sombre, le voile noir les rendait
   invisibles. */
.copilot-ww.is-over .copilot-ww-card {
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
}
.copilot-ww-sky {
  display: block;
  font-size: 4.5em;
  line-height: 1;
}
/* L'astre se balance doucement — le wrapper porte le lever, l'icône le
   balancement : deux transformations sur deux nœuds, sinon l'une écrase
   l'autre. Lent et de faible amplitude : c'est une respiration, pas un métronome. */
.copilot-ww-sky i,
.copilot-ww-moon svg {
  display: block;
  animation: copilot-ww-sway 5s ease-in-out infinite;
}
@keyframes copilot-ww-sway {
  0%,
  100% {
    transform: rotate(-7deg);
  }
  50% {
    transform: rotate(7deg);
  }
}

/* ---- la nuit : le cycle en arc ----
   La lune se lève à gauche, passe au zénith, se couche à droite, et la portion
   d'arc déjà parcourue s'éclaire derrière elle. Rien d'autre : une graduation
   dirait combien d'étapes compte la nuit, donc combien de rôles sont en jeu.
   Le trajet se joue par un BRAS qui tourne (centre de l'arc → lune) : tourner
   un rayon fait suivre le cercle, là où un déplacement en x/y couperait par la
   corde. La lune contre-tourne pour rester droite (cf. animateBoard). */
.copilot-ww-arc {
  position: relative;
  width: min(100%, 30em);
  aspect-ratio: 200 / 104;
}
/* Enfant DIRECT : la lune porte elle aussi un <svg>, et cette règle l'étirait
   sur tout le cadre — sa boîte s'effondrait à zéro et elle se retrouvait
   dessinée n'importe où. */
.copilot-ww-arc > svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.ww-arc-line,
.ww-arc-done {
  fill: none;
  stroke-width: 2.5;
}
/* Les deux bouts de la piste sont arrondis (les horizons) ; la portion éclairée,
   elle, est coupée net — un bout arrondi dépasserait de la lune posée au bout. */
.ww-arc-line {
  stroke-linecap: round;
}
.ww-arc-done {
  stroke-linecap: butt;
}
.ww-arc-line {
  stroke: rgba(255, 255, 255, 0.18);
}
/* Pas de transition CSS : le nœud est recréé à chaque synchro et naîtrait déjà
   à sa longueur finale. C'est animateBoard qui rejoue l'allongement, dans le
   même temps que la rotation du bras. */
.ww-arc-done {
  stroke: #ffe9a8;
  opacity: 0.7;
}
/* Le bras : du centre de l'arc (bas, milieu) jusqu'à son rayon. */
.copilot-ww-arm {
  position: absolute;
  left: 50%;
  bottom: calc(100% * 4 / 104);
  width: 0;
  height: calc(100% * 96 / 104);
  transform-origin: bottom center;
  transform: rotate(var(--a, -90deg));
}
.copilot-ww-moon {
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%) rotate(calc(-1 * var(--a, -90deg)));
  font-size: 2.2em;
  line-height: 1;
  color: #ffe9a8;
  filter: drop-shadow(0 0 14px rgba(255, 233, 168, 0.6));
}
.copilot-ww-moon svg {
  width: 1em;
  height: 1em;
}
/* Les mers de la lune : un rond nu n'était qu'une pastille. Une ocre chaude
   posée en transparence sur le disque — assez pour lui donner du relief, pas
   assez pour la salir. */
.ww-moon-seas circle {
  fill: #c08b3a;
  opacity: 0.17;
}
.ww-moon-seas circle:nth-child(2) {
  opacity: 0.13;
}
.ww-moon-seas circle:nth-child(3),
.ww-moon-seas circle:nth-child(4),
.ww-moon-seas circle:nth-child(5) {
  opacity: 0.11;
}

/* ---- le jour : le bilan d'un côté, le village de l'autre ----
   Empilés, deux morts suffisaient à repousser la liste hors de l'écran. */
.copilot-ww-day {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  align-items: center;
  gap: 1.2em;
}
.copilot-ww-day-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5em;
  min-width: 0;
}
.copilot-ww-day-right {
  min-width: 0;
}
/* Écran étroit ou debout : on retombe sur une seule colonne. */
@media (max-width: 52rem), (orientation: portrait) {
  .copilot-ww-day {
    grid-template-columns: minmax(0, 1fr);
  }
}
.copilot-ww.is-night .copilot-ww-sky {
  color: #ffe9a8;
  filter: drop-shadow(0 0 18px rgba(255, 233, 168, 0.55));
}
.copilot-ww.is-day .copilot-ww-sky {
  color: #f6b93b;
  filter: drop-shadow(0 0 18px rgba(246, 185, 59, 0.5));
}
/* L'astre se lève à chaque bascule : il monte à sa place en grandissant. */
.copilot-ww-sky.is-rising {
  /* Il monte pendant que le voile se retire, pas avant. */
  animation: copilot-ww-rise 2.2s cubic-bezier(0.25, 0.8, 0.3, 1) both;
}
@keyframes copilot-ww-rise {
  from {
    opacity: 0;
    transform: translateY(1.1em) scale(0.5);
  }
  60% {
    opacity: 1;
  }
}
.copilot-ww-phase {
  font-size: 2.6em;
  font-weight: 900;
  line-height: 1;
}
/* Fin de partie : le titre respire avant les deux sections. */
.copilot-ww.is-over .copilot-ww-phase {
  margin-bottom: 0.35em;
}
.copilot-ww-hint {
  font-size: 1.2em;
  font-weight: 700;
  opacity: 0.75;
}
.copilot-ww-deaths {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4em;
}
.copilot-ww-deaths-label {
  font-size: 1.05em;
  font-weight: 800;
  opacity: 0.7;
}
/* ---- La révélation finale : un panneau par camp ----
   Les cartes sont retournées, chacun rejoint les siens. Deux panneaux côte à
   côte (trois si un solitaire jouait sa propre partie), celui qui l'emporte
   cerclé d'or. Les couleurs sont posées en variables : le fond de fin de partie
   passe du doré clair au brun sombre selon le thème, l'encre doit suivre. */
.copilot-ww-camps {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: 0.7em;
  width: 100%;
  min-height: 0;
  overflow-y: auto;
}
.copilot-ww-camp {
  flex: 1 1 15rem;
  max-width: 26rem;
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  padding: 0.7em 0.8em 0.8em;
  border-radius: var(--r-xl);
  /* La teinte du camp posée sur un voile clair : sans lui elle virerait au
     kaki sur le doré de fin de partie. */
  background:
    linear-gradient(var(--camp-tint), var(--camp-tint)),
    var(--card);
  box-shadow: inset 0 0 0 2px var(--camp-ring);
}
/* Une longue section passe sur deux colonnes, sinon elle sort de l'écran — et
   un écran posé au milieu de la table, personne ne le fait défiler. En dessous
   de 600 px de large il n'y a pas la place : on revient à une colonne. */
.copilot-ww-camp.is-split {
  max-width: none;
  flex-grow: 2;
}
@media (min-width: 600px) {
  .copilot-ww-camp.is-split .copilot-ww-fallen {
    display: grid;
    grid-auto-flow: column;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(var(--rows, 1), auto);
  }
}
/* Dans un camp, on lit une liste : un joueur par ligne, le nom puis son rôle. */
.copilot-ww-camp .copilot-ww-fallen {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.4em;
}
.copilot-ww-camp .copilot-ww-dead {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.9em;
  padding: 0.45em 0.8em;
  text-align: left;
}
.copilot-ww-camp .copilot-ww-dead-name {
  font-size: 1.3em;
}
.copilot-ww-camp.is-fallen .copilot-ww-dead-name {
  text-decoration: none;
}
/* Ici l'or revient au camp vainqueur, pas aux survivants : le barré suffit à
   dire qui n'a pas vu la fin. Toutes les cartes ont le MÊME fond, franc : une
   carte à moitié transparente prenait la teinte du panneau et virait au beige
   sale. Les disparus se lisent au barré et au texte estompé. */
.copilot-ww-camp .copilot-ww-dead {
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-card);
}
html.theme-dark .copilot-ww-camp .copilot-ww-dead {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  box-shadow: none;
}
.copilot-ww-camp .copilot-ww-dead:not(.is-alive) .copilot-ww-dead-name,
.copilot-ww-camp .copilot-ww-dead:not(.is-alive) .copilot-ww-dead-role {
  opacity: 0.65;
}
/* Pas d'anneau doré sur les survivants ici (la règle du bilan du matin en met
   un) : dans la révélation, l'or ne dit qu'une chose, le camp qui a gagné. */
.copilot-ww-camp .copilot-ww-dead.is-alive {
  box-shadow: var(--shadow-card);
}
html.theme-dark .copilot-ww-camp .copilot-ww-dead.is-alive {
  box-shadow: none;
}
/* Les cartes suivent le thème ici (pas les cartes blanches du bilan du matin) :
   le rôle reprend la couleur atténuée du thème. */
html.theme-dark .copilot-ww-camp .copilot-ww-dead-role {
  color: var(--muted);
}
html.theme-dark .copilot-ww-camp .copilot-ww-dead:not(.is-alive) {
  background: rgba(255, 255, 255, 0.04);
}
.copilot-ww-camps.is-dense .copilot-ww-camp {
  padding: 0.5em 0.6em 0.6em;
  gap: 0.35em;
}
.copilot-ww-camps.is-dense .copilot-ww-fallen {
  gap: 0.3em;
}
.copilot-ww-camps.is-dense .copilot-ww-dead {
  padding: 0.28em 0.7em;
}
.copilot-ww-camps.is-dense .copilot-ww-dead-name {
  font-size: 1.15em;
}
.copilot-ww-camps.is-dense .copilot-ww-dead-role {
  font-size: 0.85em;
}
/* Les couleurs viennent de la palette : le turquoise de l'app pour le village,
   l'accent Loup-Garou pour les loups. */
.copilot-ww-camp.is-village {
  --camp-tint: rgba(var(--teal-rgb), 0.14);
  --camp-ring: rgba(var(--teal-dark-rgb), 0.45);
  --camp-ink: var(--teal-dark);
}
.copilot-ww-camp.is-loups {
  --camp-tint: rgba(179, 45, 27, 0.14);
  --camp-ring: rgba(138, 33, 20, 0.45);
  --camp-ink: var(--werewolf-dark);
}
html.theme-dark .copilot-ww-camp.is-village {
  --camp-ink: #6fd7d0;
}
html.theme-dark .copilot-ww-camp.is-loups {
  --camp-ink: #f0917f;
}
/* Repli quand aucun rôle n'a été désigné : ceux qui ont tenu, ceux qui sont
   tombés. Mêmes couleurs, même lecture. */
.copilot-ww-camp.is-surv {
  --camp-tint: rgba(var(--teal-rgb), 0.18);
  --camp-ring: rgba(var(--teal-dark-rgb), 0.5);
  --camp-ink: var(--teal-dark);
}
.copilot-ww-camp.is-fallen {
  --camp-tint: rgba(179, 45, 27, 0.14);
  --camp-ring: rgba(138, 33, 20, 0.4);
  --camp-ink: var(--werewolf-dark);
}
.copilot-ww-camp.is-solo {
  --camp-tint: rgba(54, 49, 160, 0.16);
  --camp-ring: rgba(36, 32, 116, 0.45);
  --camp-ink: #3631a0;
}
html.theme-dark .copilot-ww-camp.is-surv {
  --camp-ink: #6fd7d0;
}
html.theme-dark .copilot-ww-camp.is-fallen {
  --camp-ink: #f0917f;
}
html.theme-dark .copilot-ww-camp.is-solo {
  --camp-ink: #b1adf5;
}
/* Le « ? » d'un joueur dont la carte n'a jamais été désignée — même signe que
   dans le tableau des joueurs de l'écran de jeu. */
.copilot-ww-dead-role.is-unknown {
  min-width: 1.4em;
  text-align: center;
  font-size: 1.05em;
  opacity: 0.55;
}
/* Sous les deux sections : les cartes restées dans la boîte, en petites
   étiquettes qui vont à la ligne — une seule ligne de texte déborderait de
   l'écran (le parent centre ses enfants, qui prennent leur largeur naturelle). */
.copilot-ww-undealt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35em;
  max-width: 100%;
  font-size: 0.9em;
  font-weight: 700;
}
.copilot-ww-undealt-label {
  opacity: 0.7;
}
.copilot-ww-card {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  padding: 0.2em 0.6em;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
}
html.theme-dark .copilot-ww-card {
  background: rgba(255, 255, 255, 0.1);
}
.copilot-ww-camp-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  font-size: 1.1em;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--camp-ink);
}
/* Le camp vainqueur : l'or, comme partout ailleurs dans l'app. */
.copilot-ww-camp.is-win {
  box-shadow:
    inset 0 0 0 3px var(--gold-dark),
    0 0 26px rgba(var(--gold-rgb), 0.35);
}
.copilot-ww-fallen {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5em;
}
.copilot-ww-dead {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15em;
  padding: 0.5em 1em;
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-card);
  color: var(--ink);
}
.copilot-ww-dead-name {
  /* Le nom peut porter des pastilles (❤ des amoureux, écharpe du Maire) : elles
     se posent à sa suite, sur sa ligne. Étant inline-flex, le barré du nom ne
     les traverse pas — c'est voulu, une pastille reste lisible. */
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-size: 1.5em;
  font-weight: 900;
  text-decoration: line-through;
  /* Le trait doit se lire depuis l'autre bout de la table : franc et épais. */
  text-decoration-color: rgba(212, 82, 51, 0.9);
  text-decoration-thickness: 0.1em;
}
.copilot-ww-dead-name .ww-tag {
  flex: none;
  font-size: 0.55em;
  /* Le rembourrage du badge est en rem ; ici le nom est écrit en em et bien plus
     gros, la pastille s'y serait retrouvée écrasée autour de son cœur. */
  padding: 0.25em 0.45em;
}
/* Fin de partie : tous les rôles sont montrés, les survivants sans le barré. */
.copilot-ww-dead.is-alive .copilot-ww-dead-name {
  text-decoration: none;
}
.copilot-ww-dead.is-alive {
  box-shadow:
    0 0 0 2px var(--gold-dark),
    var(--shadow-card);
}
.copilot-ww-dead-role {
  font-size: 0.95em;
  font-weight: 800;
  color: var(--muted);
}
/* La carte reste blanche même en thème sombre : --muted y virerait au gris
   clair, illisible sur le blanc. */
html.theme-dark .copilot-ww-dead-role {
  color: #5c6b74;
}
.copilot-ww-nodeath {
  font-size: 1.5em;
  font-weight: 900;
  opacity: 0.8;
}
/* ---- L'état du village, le jour ----
   Une grille de cartes compactes (nom, et le rôle des seuls disparus), en second
   plan sous le bilan du matin : plus petites que lui, nom et rôle sur une ligne,
   4 à 5 colonnes sur une table, 2 sur un téléphone — dix-huit joueurs tiennent. */
.copilot-ww-village {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45em;
}
.copilot-ww-village-head {
  font-size: 1.05em;
  font-weight: 800;
  opacity: 0.75;
}
.copilot-ww-villagers {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  gap: 0.4em;
}
.copilot-ww-villager {
  flex-direction: row;
  flex-wrap: wrap; /* filet : si vraiment rien ne tient, le rôle passe dessous */
  align-items: center;
  justify-content: space-between;
  gap: 0.05em 0.5em;
  padding: 0.28em 0.6em;
  font-size: 0.85em; /* second plan : plus petit que le bilan du matin */
  text-align: left;
  background: #fff;
}
/* Pas d'anneau doré sur les vivants (la règle du bilan du matin en met un) :
   ici, être en vie n'est pas un exploit, c'est l'état normal. */
.copilot-ww-villager.is-alive {
  box-shadow: var(--shadow-card);
}
.copilot-ww-villager .copilot-ww-dead-name {
  font-size: 1.1em;
}
.copilot-ww-villager .copilot-ww-dead-role {
  font-size: 0.85em;
  white-space: nowrap;
  margin-left: auto;
}
.copilot-ww-villager .ww-tag {
  font-size: 0.6em;
}
/* Les disparus : le nom barré et estompé — dans l'encre de la carte, pas dans
   le corail des éliminés du podium —, le rôle en clair : c'est lui qu'on lit. */
.copilot-ww-villager.is-eliminated .copilot-name-text {
  color: inherit;
  opacity: 0.6;
}
/* Une mort qui arrive : le trait se trace (cf. .is-striking) à la place du
   barré natif, et dans la même couleur que lui. */
.copilot-ww-villager.is-striking .copilot-ww-dead-name {
  text-decoration: none;
}
.copilot-ww-villager.is-striking .copilot-name-text::after {
  background: rgba(212, 82, 51, 0.9);
  height: 0.1em;
}
html.reduce-motion .copilot-ww-sky.is-rising {
  animation: none;
}

/* ---- Bombu : même carte qu'au Yam's (cf. .copilot-yams-*), grille complète en
   fin de partie (.copilot-bombu-table hérite de .copilot-yams-table) ---- */

/* ---- Contrée : le contrat en grand, les deux équipes, le distributeur ---- */
.copilot-contree {
  flex: 0 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--copilot-gap);
  text-align: center;
}
.copilot-bid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15em;
}
.copilot-bid-value {
  font-size: 4.2em;
  font-weight: 900;
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.copilot-bid-value .suit {
  font-size: 1.05em; /* écrase la taille en rem de .suit : l'atout suit le chiffre */
}
/* Les deux équipes côte à côte, dans un ordre qui ne change jamais. */
.copilot-teams {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--copilot-gap);
  width: 100%;
  max-width: 44rem;
}
/* Pendant son « pop », la carte grandit et mord sur sa voisine. Sans plan
   au-dessus, celle de GAUCHE passerait derrière celle de droite : à plan égal,
   c'est l'ordre du document qui l'emporte. Le temps de l'animation, elle passe
   devant (la classe repart au rendu suivant, comme partout ailleurs). */
.copilot-team.is-bumped {
  z-index: 2;
}
.copilot-team {
  position: relative; /* ancre la pastille contré / surcontré, et le plan ci-dessus */
  padding: 0.7em 1em;
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--shadow-card);
}
/* Contré / surcontré : posé SUR la carte de l'équipe qui l'a dit. À cheval sur
   le bord haut, comme les pastilles du tableau. */
.copilot-team-coinche {
  position: absolute;
  top: -0.6em;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.15em 0.7em;
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
  font-size: 0.7em;
  font-weight: 900;
  letter-spacing: 0.3px;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
/* Elle arrive PAR LE BAS, en se posant sur la carte. Entrée à elle : le
   `badge-pop` générique n'anime qu'un `scale` et écraserait le translateX(-50%)
   du centrage — la pastille partait alors de sa position décalée, donc « de la
   droite ». Ici la translation horizontale est tenue à chaque image. */
.copilot-team-coinche.is-bumped {
  animation: copilot-coinche-in 0.45s var(--bounce) both;
}
@keyframes copilot-coinche-in {
  from {
    opacity: 0;
    transform: translate(-50%, 1.1em) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}
/* L'équipe qui a pris : c'est elle qui doit réaliser le contrat. */
.copilot-team.is-taking {
  box-shadow:
    0 0 0 3px var(--gold-dark),
    var(--shadow-card);
}
.copilot-team-name {
  font-size: 1.25em;
  font-weight: 800;
  color: var(--teal-dark);
  overflow-wrap: anywhere;
}
.copilot-team-total {
  font-size: 2.6em;
  font-weight: 900;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
/* Badminton : même face-à-face que la Contrée (.copilot-teams), mêmes couleurs.
   Le serveur est cerclé d'or (.is-taking) et porte sa pastille ; les points du
   set en grand, les sets gagnés en pastilles dessous. */
/* Score à venir dans le titre de la saisie du point (couleur « en attente »). */
.bad-preview {
  color: var(--sky-dark);
}
html.theme-dark .bad-preview {
  color: var(--sky);
}
.copilot-team-coinche.is-serve {
  background: var(--teal);
}
.copilot-bad-members {
  color: var(--muted);
  font-weight: 700;
  overflow-wrap: anywhere;
}
.copilot-team-total.copilot-bad-points {
  font-size: 5em;
  line-height: 1.05;
}
.copilot-bad-sets {
  display: flex;
  justify-content: center;
  gap: 0.4em;
  margin-top: 0.2em;
}
.copilot-bad-dot {
  width: 0.8em;
  height: 0.8em;
  border-radius: 50%;
  border: 2px solid var(--teal);
}
.copilot-bad-dot.is-won {
  background: var(--teal);
}
.copilot-bad-stake {
  padding: 0.3em 1em;
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  font-size: 1.3em;
  font-weight: 900;
}
.copilot-bad-history {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.3em 1.2em;
  font-size: 1.1em;
  font-weight: 700;
  color: var(--muted);
}
.copilot-bad-history b {
  color: var(--text);
}
.copilot-dealer {
  font-size: 1.15em;
  font-weight: 800;
  color: var(--muted);
}

/* ---- Fléchettes : joueurs à gauche, joueur courant + cible à droite ---- */
.copilot-darts {
  /* Toute la hauteur disponible, et non celle du contenu : la colonne de droite
     enfle et rétrécit au fil de la volée (fléchettes lancées, conseils qui
     disparaissent à la dernière), et comme le corps centre ce qu'il contient,
     le tableau de gauche se serait déplacé à chaque lancer. */
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  grid-template-rows: minmax(0, 1fr); /* borne la hauteur des colonnes → la liste défile */
  gap: var(--copilot-gap);
}
.copilot-darts-left {
  display: flex;
  flex-direction: column;
  gap: var(--copilot-gap);
  min-height: 0;
}
.copilot-darts-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--copilot-gap);
  min-height: 0;
}
.copilot-focus {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* De l'air entre le titre et la volée : le titre est en line-height 1, donc
     ses jambages (« Dépassé ») descendent hors de sa ligne et venaient toucher
     les pastilles — l'écart réel est toujours plus petit que celui déclaré. */
  gap: 1.3em;
  text-align: center;
}
.copilot-focus-rem {
  font-size: 2.6em;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.copilot-focus-rem.is-bust {
  color: var(--error);
}
.copilot-focus-rem.is-win {
  color: var(--success-dark);
}
.copilot-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35em;
  /* Place réservée : la volée finie ou dépassée n'a plus de conseil à donner, et
     sans cette réserve la colonne se raccourcirait d'un coup (cf. js/copilot.js). */
  min-height: 3.6em;
}
.copilot-hint-label {
  font-weight: 800;
  color: var(--muted);
  font-size: 0.95em;
}
/* La cible prend la place restante de la colonne, bornée par la hauteur d'écran.
   Deux boîtes, et non une : un CADRE qui négocie la place avec la colonne, et
   un CARRÉ à l'intérieur, qui est exactement le disque et sert de repère aux
   habillages (fêlures, orbite, panneau « ici »).
   LARGEUR DÉFINIE sur le cadre, et non « auto » borné par un max-width : au
   centre d'une colonne, une largeur auto se résout sur la taille intrinsèque du
   SVG — 300px, quelle que soit la place offerte, et le plafond n'était jamais
   atteint. Le plafond en vh laisse la place aux voisins de la colonne (le focus
   au-dessus, les conseils en dessous). Sur un écran très bas, où ces voisins
   coûtent plus cher que le plafond ne le prévoit, le cadre rend les pixels de
   trop plutôt que de pousser les conseils hors de la colonne — et c'est
   précisément là que le carré intérieur gagne sa place : le cadre n'est alors
   plus carré, le disque suit la largeur, les habillages auraient suivi le cadre. */
.copilot .copilot-board-wrap {
  /* Carré tant que la colonne l'accepte ; s'il faut rendre de la hauteur, c'est
     ce cadre-là qui s'aplatit (flex-shrink), et le carré intérieur qui garde le
     disque rond. */
  aspect-ratio: 1;
  width: min(100%, var(--board-max, 60vh));
  flex: 0 1 auto;
  min-height: 0;
  margin: 0 auto;
}
/* Le carré exact du disque, à l'intérieur du cadre : hauteur du cadre, largeur
   déduite (aspect-ratio) — donc TOUJOURS la plus petite des deux dimensions,
   même quand le cadre s'est aplati. C'est lui le repère des habillages (fêlures,
   orbite des fléchettes, panneau « ici ») : posés sur le cadre, ils visaient son
   centre et sa taille, alors que le disque, lui, se cale sur la largeur — d'où
   des fêlures trop grandes et décentrées dès que le cadre n'était plus carré. */
.copilot .copilot-board-stage {
  position: relative;
  height: 100%;
  aspect-ratio: 1;
  margin-inline: auto;
}
.copilot .copilot-board {
  display: block;
  width: 100%;
  height: 100%;
  /* Écrase le plafond générique de .dartboard (22rem, taille des dialogues) :
     ici la cible doit remplir son carré, sinon le disque reste petit et collé en
     haut pendant que les habillages occupent tout le cadre. */
  max-width: none;
}
/* Dépassement : le plateau encaisse le coup — il se fige, se ternit, part de
   travers, et des fêlures se tracent depuis le centre. */
.copilot .copilot-board-wrap.is-bust .copilot-board {
  filter: grayscale(0.55) brightness(0.82) contrast(1.05);
  transform: rotate(-1.2deg);
  animation: copilot-board-hit 0.5s ease-out both;
}
.copilot-board-crack {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  fill: none;
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 0.9;
  stroke-linecap: round;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.6));
  clip-path: circle(49% at 50% 50%); /* les fêlures s'arrêtent au bord du plateau */
  /* Les traits se dessinent depuis le centre au lieu d'apparaître d'un coup. */
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: copilot-crack-draw 0.45s ease-out 0.08s forwards;
}
/* Volée entièrement ratée : trois fléchettes tournent autour du plateau, qui
   s'assombrit à peine — rien n'a été touché, il n'y a pas de casse. Au centre,
   là où aucune fléchette n'est arrivée, un panneau se balance pour rappeler où
   il fallait viser. */
.copilot-board-here {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 0.35em 0.9em;
  border-radius: var(--r-round);
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: var(--ink);
  font-weight: 900;
  font-size: 1.15em;
  white-space: nowrap;
  box-shadow: var(--shadow-accent-glow);
  animation: copilot-here-wobble 2.4s ease-in-out infinite;
}
@keyframes copilot-here-wobble {
  0%,
  100% {
    transform: translate(-50%, -50%) rotate(-2.5deg) scale(1);
  }
  50% {
    transform: translate(-50%, -50%) rotate(2.5deg) scale(1.05);
  }
}
html.reduce-motion .copilot-board-here {
  animation: none;
}
.copilot .copilot-board-wrap.is-missed .copilot-board {
  filter: grayscale(0.25) brightness(0.94);
}
.copilot-board-orbit {
  position: absolute;
  inset: -7%;
  pointer-events: none;
  animation: copilot-orbit 4.5s linear infinite;
}
/* Chaque fléchette occupe tout le carré et se colle en haut : la rotation du
   carré la promène alors sur le cercle — un rayon en pourcentage se serait
   référé à l'icône (quelques pixels), qui serait restée au centre. */
.copilot-board-orbit span {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  transform: rotate(var(--a));
}
.copilot-board-orbit i {
  font-size: 2.1em;
  color: var(--gold);
  /* Elles tournent à l'extérieur du plateau, sur le fond clair de l'écran : le
     doré seul s'y noierait, d'où le liseré sombre et l'ombre portée. */
  -webkit-text-stroke: 1.5px var(--ink);
  paint-order: stroke fill;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.35));
  transform: rotate(135deg); /* la pointe suit le sens de la marche */
  animation: copilot-dart-pulse 1.6s ease-in-out var(--d, 0s) infinite;
}
@keyframes copilot-dart-pulse {
  0%,
  100% {
    transform: rotate(135deg) scale(0.85);
  }
  50% {
    transform: rotate(135deg) scale(1.3);
  }
}
html.reduce-motion .copilot-board-orbit i {
  animation: none;
}
@keyframes copilot-orbit {
  to {
    transform: rotate(360deg);
  }
}
html.reduce-motion .copilot-board-orbit {
  animation: none;
}
@keyframes copilot-board-hit {
  0% { transform: rotate(0) scale(1); }
  25% { transform: rotate(-3deg) scale(0.97); }
  55% { transform: rotate(1.5deg) scale(1.01); }
  100% { transform: rotate(-1.2deg) scale(1); }
}
@keyframes copilot-crack-draw {
  to { stroke-dashoffset: 0; }
}
html.reduce-motion .copilot .copilot-board-wrap.is-bust .copilot-board,
html.reduce-motion .copilot-board-crack {
  animation: none;
}
html.reduce-motion .copilot-board-crack {
  stroke-dashoffset: 0;
}
/* ---- Mölkky : même découpe que les fléchettes, le plan des quilles en guise de
   cible. Les quilles sont des disques en bois clair (le jeu est en bois) ; la
   taille suit la colonne et la hauteur d'écran, comme la cible. ---- */
/* Total du lancer : clair cerclé de bleu, texte du thème (lisible clair/sombre). */
.copilot-chip.is-thrown.is-sum {
  font-weight: 900;
  background: var(--card);
  color: var(--text);
}
.copilot-row-rem {
  font-size: 0.6em;
  font-weight: 700;
  color: var(--muted);
  margin-right: 0.6em;
}
.copilot-pins {
  position: relative; /* porte le bâton et les panneaux */
  --pin: min(4.6em, 9vh);
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(var(--pin) * 0.18);
}
.copilot-pins-row {
  display: flex;
  justify-content: center;
  gap: calc(var(--pin) * 0.22);
}
.copilot-pin {
  width: var(--pin);
  height: var(--pin);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--pin) * 0.42);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: #5a3b1a;
  background: radial-gradient(circle at 35% 30%, #f6dfb5, #d9b27a 70%, #c49a5f);
  border: 3px solid #a87a43;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
  transition: transform 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease;
}
/* Tombée (lancer en cours) : couchée, pâlie. Le sens de chute (--fall)
   alterne d'une quille à l'autre. */
.copilot-pin.is-down {
  transform: translateY(18%) rotate(var(--fall, -82deg)) scale(0.86);
  opacity: 0.45;
  filter: grayscale(0.4);
}
/* Elle vient de tomber : elle vacille, bascule et rebondit au sol. */
.copilot-pin.is-falling {
  animation: copilot-pin-fall 0.75s cubic-bezier(0.5, 0, 0.6, 1) var(--delay, 0s) both;
}
@keyframes copilot-pin-fall {
  0% { transform: none; opacity: 1; filter: none; }
  18% { transform: rotate(calc(var(--fall) * -0.12)); }
  70% { transform: translateY(18%) rotate(var(--fall)) scale(0.9); opacity: 0.8; }
  82% { transform: translateY(10%) rotate(calc(var(--fall) * 0.9)) scale(0.88); }
  100% { transform: translateY(18%) rotate(var(--fall)) scale(0.86); opacity: 0.45; filter: grayscale(0.4); }
}
/* Une quille tombe : celles qui restent debout vacillent, en décalé. */
.copilot-pins.is-jolt .copilot-pin:not(.is-down) {
  animation: copilot-pin-wobble 0.6s ease-in-out calc(0.15s + var(--i, 0) * 0.03s) both;
}
@keyframes copilot-pin-wobble {
  0%, 100% { transform: none; }
  30% { transform: rotate(-7deg); }
  60% { transform: rotate(5deg); }
  80% { transform: rotate(-2deg); }
}
/* La quille qui finit pile : elle brille, en vert « victoire ». */
.copilot-pin.is-goal {
  color: #fff;
  background: radial-gradient(circle at 35% 30%, var(--success), var(--success-dark));
  border-color: var(--success-dark);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.7), 0 0 24px var(--success);
  animation: copilot-pin-glow 1.4s ease-in-out infinite;
}
@keyframes copilot-pin-glow {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}
/* Seule, elle ferait dépasser la cible : en rouge. */
.copilot-pin.is-danger {
  color: #fff;
  background: radial-gradient(circle at 35% 30%, #f08a7e, var(--error));
  border-color: var(--error);
  opacity: 0.85;
}
/* Victoire : la quille gagnante reste en couleur, cerclée de vert, avec une
   onde qui s'en échappe ; les autres sautent de joie, en décalé. */
.copilot-pin.is-down.is-win {
  opacity: 1;
  filter: none;
  color: #fff;
  background: radial-gradient(circle at 35% 30%, var(--success), var(--success-dark));
  border-color: var(--success-dark);
  box-shadow: 0 0 22px var(--success);
  position: relative;
}
.copilot-pins.is-win .copilot-pin.is-win::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 3px solid var(--success);
  animation: copilot-pin-ring 1.6s ease-out infinite;
}
@keyframes copilot-pin-ring {
  from { transform: scale(1); opacity: 0.9; }
  to { transform: scale(2.4); opacity: 0; }
}
.copilot-pins.is-win.is-fresh .copilot-pin:not(.is-down) {
  animation: copilot-pin-jump 0.55s ease-out calc(0.5s + var(--i, 0) * 0.06s) 2 both;
}
@keyframes copilot-pin-jump {
  0%, 100% { transform: translateY(0); }
  45% { transform: translateY(-38%) rotate(-6deg); }
  70% { transform: translateY(4%); }
}
/* Dépassement : le plan tremble (une fois, au changement), les quilles se
   cerclent de rouge. */
.copilot-pins.is-over .copilot-pin {
  border-color: var(--error);
}
.copilot-pins.is-over.is-fresh {
  animation: copilot-pins-shake 0.6s ease-in-out 0.5s 2;
}
@keyframes copilot-pins-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px) rotate(-1deg); }
  40% { transform: translateX(9px) rotate(1deg); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(4px); }
}
/* Raté : le plan reste debout, intact, et pâlit ; éliminé, il grisonne. */
.copilot-pins.is-missed .copilot-pin {
  opacity: 0.55;
}
.copilot-pins.is-elim .copilot-pin {
  filter: grayscale(1);
  opacity: 0.4;
}
/* Le bâton (le « mölkky ») passe à côté du plan en tournoyant. */
.copilot-pins-stick {
  position: absolute;
  top: 38%;
  left: -30%;
  width: calc(var(--pin) * 0.55);
  height: calc(var(--pin) * 1.9);
  border-radius: calc(var(--pin) * 0.28);
  background: linear-gradient(90deg, #c49a5f, #f0d3a0 45%, #b5864d);
  border: 3px solid #8a6131;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  animation: copilot-stick-fly 1s cubic-bezier(0.3, 0.1, 0.5, 1) forwards;
}
@keyframes copilot-stick-fly {
  0% { transform: translate(0, 40%) rotate(0); opacity: 0; }
  10% { opacity: 1; }
  100% { transform: translate(calc(var(--pin) * 12), -90%) rotate(900deg); opacity: 0; }
}
/* Panneau posé sur le plan (raté, éliminé, retombée), qui se balance — le
   pendant de « C'est par ici ! » des fléchettes. */
.copilot-pins-sign {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 0.35em 0.9em;
  border-radius: var(--r-round);
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: var(--ink);
  font-weight: 900;
  font-size: 1.25em;
  white-space: nowrap;
  box-shadow: var(--shadow-accent-glow);
  animation: copilot-here-wobble 2.4s ease-in-out infinite;
}
.copilot-pins-sign.is-over,
.copilot-pins-sign.is-elim {
  background: linear-gradient(135deg, #f08a7e, var(--error));
  color: #fff;
  box-shadow: 0 6px 18px rgba(231, 76, 60, 0.45);
}
.copilot-pins.is-fresh .copilot-pins-sign {
  animation:
    copilot-sign-in 0.45s cubic-bezier(0.3, 1.6, 0.5, 1) 0.6s both,
    copilot-here-wobble 2.4s ease-in-out 1.05s infinite;
}
@keyframes copilot-sign-in {
  from { transform: translate(-50%, -50%) scale(0); }
  to { transform: translate(-50%, -50%) scale(1); }
}
html.reduce-motion .copilot-pin,
html.reduce-motion .copilot-pins,
html.reduce-motion .copilot-pins-sign,
html.reduce-motion .copilot-pins.is-fresh .copilot-pins-sign,
html.reduce-motion .copilot-pins.is-win .copilot-pin.is-win::after {
  animation: none;
  transition: none;
}
html.reduce-motion .copilot-pins-stick {
  display: none;
}
@media (orientation: portrait) {
  .copilot-pins {
    --pin: min(4.2em, 6.5vh);
  }
}

/* Portrait (tablette debout) : cible en haut, liste des joueurs en dessous. */
@media (orientation: portrait) {
  .copilot-darts {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }
  .copilot-darts-right {
    order: -1;
  }
  /* Portrait : la colonne n'a plus qu'un tiers de la hauteur, la cible suit. */
  .copilot .copilot-board-wrap {
    --board-max: 44vh;
  }
}

/* Animations désactivées (réglage) : ni pulsation ni rebond sur cet écran
   (le défilement passe lui-même en sauts de page, cf. js/copilot.js). */
html.reduce-motion .copilot-ww-sky i,
html.reduce-motion .copilot-ww-moon svg,
html.reduce-motion .copilot-podium.is-over .copilot-step-block,
html.reduce-motion .copilot-turn-ico,
html.reduce-motion .copilot .yams-mission.is-picked,
html.reduce-motion .copilot .crown {
  animation: none;
}
/* Le passage de main n'est PAS coupé ici : la règle globale plus haut ramène
   déjà ses deux animations à une durée nulle (le glissement ne se voit pas), et
   c'est leur fin qui démonte la fenêtre et la liste sortante — sans elle, la
   copie resterait affichée (cf. js/copilot.js). */

/* Non merci ! : grille des cartes 3-35 + jetons + total en direct */
.nt-entry {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  width: 100%;
}
.nt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(3rem, 1fr));
  gap: 0.4375rem;
}
.nt-card {
  position: relative;
  appearance: none;
  font: inherit;
  aspect-ratio: 2 / 3; /* format d'une vraie carte */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 0.5rem;
  border: 2px solid hsl(var(--h) 60% 30%);
  background: linear-gradient(160deg, hsl(var(--h) 66% 53%), hsl(var(--h) 64% 41%));
  color: #fff;
  font-size: var(--fs-xl);
  font-weight: 900;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.55);
  cursor: pointer;
  opacity: 0.5;
  filter: saturate(0.5);
  transition: opacity 0.12s ease, transform 0.12s ease, filter 0.12s ease;
}
/* petits indices dans les coins, comme sur la carte */
.nt-card::before,
.nt-card::after {
  content: attr(data-n);
  position: absolute;
  font-size: 0.5625rem;
  line-height: 1;
  font-weight: 800;
  text-shadow: none;
  opacity: 0.9;
}
.nt-card::before {
  top: 0.3125rem;
  left: 0.375rem;
}
.nt-card::after {
  bottom: 0.3125rem;
  right: 0.375rem;
  transform: rotate(180deg);
}
.nt-card.is-on {
  opacity: 1;
  filter: saturate(1.15);
  transform: translateY(-3px) scale(1.07);
  z-index: 1;
  border-color: hsl(var(--h) 70% 24%);
  box-shadow:
    inset 0 0 0 4px #fff,
    0 0 0 2px hsl(var(--h) 70% 30%),
    0 8px 16px hsl(var(--h) 70% 30% / 0.55);
}
/* carte d'une suite qui ne compte pas : barrée, plus pâle */
.nt-card.is-free {
  opacity: 0.6;
  text-decoration: line-through;
}
.nt-card:disabled {
  opacity: 0.15;
  cursor: not-allowed;
  filter: grayscale(1);
}
.nt-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.nt-chips,
.nt-total {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.nt-label {
  font-weight: 800;
  color: var(--muted);
}
.nt-step {
  font-weight: 900;
  font-size: var(--fs-lg);
  min-width: 2.5rem;
}
input.cell-input.nt-chips-input {
  width: 4.5rem;
}
.nt-total-val {
  font-size: var(--fs-2xl);
  font-weight: 900;
  color: var(--nothanks-dark);
}
.nt-total-val.is-neg {
  color: var(--coral-dark);
}

/* Ligretto : cartes posées / restées dans la pile + score calculé en direct */
.lg-entry {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}
.lg-line,
.lg-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.lg-label {
  font-weight: 800;
  color: var(--muted);
}
.lg-label i {
  color: var(--ligretto-dark);
  margin-right: 0.25rem;
}
.lg-hint {
  display: block;
  font-size: var(--fs-xs);
  font-weight: 600;
}
.lg-ctrl {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.lg-step {
  font-weight: 900;
  font-size: var(--fs-lg);
  min-width: 2.5rem;
}
input.cell-input.lg-input {
  width: 4.5rem;
  text-align: center;
}
.lg-total {
  padding-top: 0.5rem;
}
.lg-total-val {
  font-size: var(--fs-2xl);
  font-weight: 900;
  color: var(--ligretto-dark);
}
.lg-total-val.is-neg {
  color: var(--coral-dark);
}
