/* =====================================================================
   Draft&Win : thème
   ===================================================================== */
:root {
  --bg: #f3f4f8;
  --surface: #ffffff;
  --surface-2: #eceef5;
  --ink: #0f1222;
  --muted: #5a607a;
  --line: #e2e5ee;
  --brand: #3b55e6;
  --brand-2: #6a3be6;
  --brand-soft: #e8ecff;
  --brand-ink: #ffffff;
  --accent: #ff6a2b;
  --accent-soft: #fff0e8;
  --accent-ink: #b8400c;
  --win: #15803d;
  --win-soft: #e3f6ea;
  --loss: #c62828;
  --loss-soft: #fde8e8;
  --focus: #ff6a2b;
  --shadow: 0 1px 2px rgb(15 18 34 / 0.05), 0 6px 20px rgb(15 18 34 / 0.06);
  --shadow-lg: 0 10px 40px rgb(30 40 120 / 0.25);
  --radius: 18px;
  --radius-sm: 12px;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Inter", "Segoe UI", system-ui, sans-serif;
  --tabbar-h: 4.25rem;
  color-scheme: light;
  box-sizing: border-box;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0c16;
    --surface: #131726;
    --surface-2: #1b2033;
    --ink: #eef0f8;
    --muted: #9aa1ba;
    --line: #252b42;
    --brand: #6f86ff;
    --brand-2: #9a6bff;
    --brand-soft: #1e2650;
    --brand-ink: #0a0c16;
    --accent: #ff7d45;
    --accent-soft: #3a2015;
    --accent-ink: #ffb08a;
    --win: #4ade80;
    --win-soft: #12301f;
    --loss: #f87171;
    --loss-soft: #3a1717;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 6px 20px rgb(0 0 0 / 0.25);
    --shadow-lg: 0 10px 40px rgb(0 0 0 / 0.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0c16;
  --surface: #131726;
  --surface-2: #1b2033;
  --ink: #eef0f8;
  --muted: #9aa1ba;
  --line: #252b42;
  --brand: #6f86ff;
  --brand-2: #9a6bff;
  --brand-soft: #1e2650;
  --brand-ink: #0a0c16;
  --accent: #ff7d45;
  --accent-soft: #3a2015;
  --accent-ink: #ffb08a;
  --win: #4ade80;
  --win-soft: #12301f;
  --loss: #f87171;
  --loss-soft: #3a1717;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 6px 20px rgb(0 0 0 / 0.25);
  --shadow-lg: 0 10px 40px rgb(0 0 0 / 0.5);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 400 0.975rem/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a {
  color: var(--brand);
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
h1,
h2,
h3 {
  font-family: var(--display);
  line-height: 1.05;
  letter-spacing: 0.005em;
  margin: 0;
}
p {
  margin: 0.4rem 0;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.85rem;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.num {
  font-family: var(--display);
  font-variant-numeric: tabular-nums;
}
.icon-svg {
  width: 1.25em;
  height: 1.25em;
  flex: none;
}

/* =====================================================================
   Structure : barre du haut, page, barre d’onglets
   ===================================================================== */
.appbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: calc(0.6rem + env(safe-area-inset-top, 0px)) 1rem 0.6rem;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font: 800 1.45rem/1 var(--display);
  color: var(--ink);
  text-decoration: none;
}
.brand-mark {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffb27f, transparent 60%), var(--accent);
  box-shadow: inset 0 0 0 2px rgb(0 0 0 / 0.12);
  position: relative;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 47%, rgb(0 0 0 / 0.25) 47% 53%, transparent 53%),
    linear-gradient(0deg, transparent 47%, rgb(0 0 0 / 0.25) 47% 53%, transparent 53%);
}
.appbar-actions {
  margin-left: auto;
  display: flex;
  gap: 0.25rem;
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
.icon-btn:hover {
  background: var(--surface-2);
}

.page {
  max-width: 42rem;
  margin: 0 auto;
  padding: 1.1rem 1rem 3rem;
}
.page.with-tabbar {
  padding-bottom: calc(
    var(--tabbar-h) + 6rem + env(safe-area-inset-bottom, 0px)
  ); /* place pour la bulle de discussion */
}

.tabbar {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: min(calc(100% - 1.5rem), 30rem);
  display: flex;
  justify-content: space-around;
  padding: 0.35rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.tabbar a {
  flex: 1;
  display: grid;
  justify-items: center;
  gap: 0.15rem;
  padding: 0.45rem 0.25rem;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
}
.tabbar a[aria-current="page"] {
  color: var(--brand);
  background: var(--brand-soft);
}

/* =====================================================================
   Titres de page
   ===================================================================== */
.page-head {
  display: grid;
  gap: 0.5rem;
  margin: 0.25rem 0 1.25rem;
}
.page-title {
  font-size: clamp(2rem, 8vw, 2.6rem);
  font-weight: 800;
}
.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  font-size: 1.35rem;
  font-weight: 700;
  margin: 1.75rem 0 0.7rem;
}
.section-title .muted {
  font: 500 0.85rem/1 var(--body);
}

/* =====================================================================
   Composants
   ===================================================================== */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem;
  margin: 0 0 1rem;
}
.card > h2:first-child,
.card > h3:first-child {
  margin-bottom: 0.6rem;
}
.card-title {
  font-size: 1.3rem;
  font-weight: 700;
}
.stack {
  display: grid;
  gap: 0.75rem;
}
.grid-2 {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr 1fr;
}
.duo {
  display: grid;
  gap: 1rem;
}
@media (min-width: 640px) {
  .duo {
    grid-template-columns: 1fr 1fr;
  }
}

/* Pastilles */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: fit-content;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--muted);
  white-space: nowrap;
}
.pill::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: currentColor;
}
.pill.plain::before {
  display: none;
}
.pill.info {
  background: var(--brand-soft);
  color: var(--brand);
}
.pill.accent {
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.pill.win {
  background: var(--win-soft);
  color: var(--win);
}
.pill.loss {
  background: var(--loss-soft);
  color: var(--loss);
}

/* Avatars d’équipe */
.avatar {
  --h: 230;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 14px;
  background: linear-gradient(135deg, hsl(var(--h) 75% 58%), hsl(calc(var(--h) + 35) 70% 48%));
  color: #fff;
  font: 800 1rem/1 var(--display);
  letter-spacing: 0.02em;
}
.avatar.lg {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 18px;
  font-size: 1.3rem;
}
.avatar.sm {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 10px;
  font-size: 0.8rem;
}

/* Badge de poste */
.pos {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  font: 800 0.95rem/1 var(--display);
  background: var(--surface-2);
  color: var(--muted);
}
.pos-G {
  background: #e3ecff;
  color: #2846c9;
}
.pos-F {
  background: #e4f6ec;
  color: #177245;
}
.pos-C {
  background: #fff0e3;
  color: #b4500c;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .pos-G {
    background: #1d2754;
    color: #9fb3ff;
  }
  :root:not([data-theme="light"]) .pos-F {
    background: #13321f;
    color: #7fe0a8;
  }
  :root:not([data-theme="light"]) .pos-C {
    background: #3a2414;
    color: #ffb27f;
  }
}
:root[data-theme="dark"] .pos-G {
  background: #1d2754;
  color: #9fb3ff;
}
:root[data-theme="dark"] .pos-F {
  background: #13321f;
  color: #7fe0a8;
}
:root[data-theme="dark"] .pos-C {
  background: #3a2414;
  color: #ffb27f;
}

/* Statistiques */
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow);
}
.stat-value {
  display: block;
  font: 800 2.1rem/1 var(--display);
  font-variant-numeric: tabular-nums;
}
.stat-label {
  font-size: 0.8rem;
  color: var(--muted);
}

/* Boutons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font: 600 0.95rem/1 var(--body);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 14px;
  padding: 0.85rem 1.15rem;
  cursor: pointer;
  text-decoration: none;
  transition:
    transform 0.08s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}
.btn:hover {
  background: var(--surface-2);
}
.btn:active {
  transform: scale(0.98);
}
.btn.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--brand) 35%, transparent);
}
.btn.small {
  padding: 0.5rem 0.8rem;
  font-size: 0.85rem;
  border-radius: 10px;
}
.btn.wide {
  width: 100%;
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--brand);
  cursor: pointer;
  justify-self: center;
}
.icon {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--surface-2);
  border: 0;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}

/* Formulaires */
.form {
  display: grid;
  gap: 0.9rem;
}
label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}
input,
select {
  font: 500 1rem/1.2 var(--body);
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0.8rem 0.9rem;
  width: 100%;
  transition: border-color 0.15s ease;
}
/* Cases à cocher et boutons radio : pas le style des champs de texte (Safari sur iPhone les
   dessinait en grand carré noir, et le texte d’à côté débordait de l’écran). */
input[type="checkbox"],
input[type="radio"] {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  accent-color: var(--brand);
}
input:focus,
select:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--surface);
}
.search {
  position: relative;
}
.search .icon-svg {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}
.search input {
  padding-left: 2.6rem;
}
.code-input {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 700;
}

/* Volets repliables (créer / rejoindre une ligue) */
.sheet {
  padding: 0;
  overflow: hidden;
}
.sheet > summary {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  cursor: pointer;
  list-style: none;
}
.sheet > summary::-webkit-details-marker {
  display: none;
}
.sheet > summary .chev {
  margin-left: auto;
  color: var(--muted);
  transition: transform 0.2s ease;
}
.sheet[open] > summary .chev {
  transform: rotate(90deg);
}
.sheet .sheet-body {
  padding: 0 1.1rem 1.1rem;
}
.sheet-icon {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand);
}
.sheet-icon.accent {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.empty {
  color: var(--muted);
  text-align: center;
  padding: 1.5rem 1rem;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  margin: 0 0 1rem;
}

/* =====================================================================
   Listes
   ===================================================================== */
.card.list,
.card.standings {
  padding: 0.2rem 1.1rem;
  margin: 0 0 1rem;
}
.list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 0;
}
.list > li + li {
  border-top: 1px solid var(--line);
}
.row-main {
  display: grid;
  flex: 1;
  min-width: 0;
}
.row-main strong {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-main .muted {
  font-size: 0.8rem;
}
.value {
  font: 700 1.25rem/1 var(--display);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.row.out .value,
.row.out .row-main strong {
  color: var(--muted);
}
.row.sub {
  position: relative;
}

/* Cartes de ligue (accueil) */
.league-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  color: inherit;
  text-decoration: none;
  transition:
    transform 0.12s ease,
    box-shadow 0.15s ease;
}
.league-card:hover {
  transform: translateY(-2px);
}
.league-card .row-main strong {
  font: 700 1.3rem/1.1 var(--display);
}
.league-card .chev {
  color: var(--muted);
}

/* =====================================================================
   Connexion
   ===================================================================== */
.hero {
  position: relative;
  overflow: hidden;
  margin: 0 0 1.25rem;
  padding: 2rem 1.4rem 1.6rem;
  border-radius: 24px;
  color: #fff;
  background:
    radial-gradient(circle at 85% 10%, rgb(255 140 80 / 0.55), transparent 45%),
    linear-gradient(140deg, #2a3cc9, #5b2fd1 60%, #8a2bc2);
  box-shadow: var(--shadow-lg);
}
.hero::before {
  content: "";
  position: absolute;
  inset: auto -20% -55% auto;
  width: 22rem;
  height: 22rem;
  border-radius: 50%;
  border: 2px solid rgb(255 255 255 / 0.16);
  box-shadow: 0 0 0 3.5rem rgb(255 255 255 / 0.04);
}
.hero-title {
  position: relative;
  font: 800 clamp(2.6rem, 12vw, 3.8rem)/0.92 var(--display);
  max-width: 11ch;
  margin: 0.4rem 0 0.8rem;
}
.lead {
  position: relative;
  font-size: 1.02rem;
  opacity: 0.9;
  max-width: 34ch;
}
.hero .pill {
  position: relative;
  background: rgb(255 255 255 / 0.16);
  color: #fff;
}

/* =====================================================================
   Ligue
   ===================================================================== */
.league-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 0.25rem 0 1.25rem;
}
.league-head h1 {
  font-size: clamp(1.7rem, 7vw, 2.2rem);
  font-weight: 800;
}
.progress {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  margin-top: 0.4rem;
}
.progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}

/* Code d’invitation */
.ticket {
  text-align: center;
  background:
    radial-gradient(circle at 0 50%, var(--bg) 0.9rem, transparent 0.95rem),
    radial-gradient(circle at 100% 50%, var(--bg) 0.9rem, transparent 0.95rem), var(--surface);
}
.code {
  font: 800 2.9rem/1 var(--display);
  letter-spacing: 0.22em;
  margin: 0.6rem 0 1rem;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Choix titulaire / banc */
.segmented {
  display: inline-flex;
  flex: none;
  padding: 0.2rem;
  border-radius: 12px;
  background: var(--surface-2);
}
.chip {
  min-width: 3.9rem;
  padding: 0.5rem 0.55rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: 600 0.78rem/1 var(--body);
  cursor: pointer;
}
.chip[aria-pressed="true"][data-role="titulaire"] {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 3px 10px color-mix(in srgb, var(--brand) 35%, transparent);
}
.chip[aria-pressed="true"][data-role="banc"] {
  background: var(--surface);
  color: var(--accent-ink);
  box-shadow: var(--shadow);
}
.chip:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.lineup-summary {
  position: sticky;
  bottom: calc(var(--tabbar-h) + 1.25rem + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.6rem 0.6rem 1rem;
  margin-top: 1rem;
  border-radius: 16px;
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--shadow-lg);
}
.lineup-summary .counts {
  flex: 1;
  font-size: 0.85rem;
  line-height: 1.3;
}
.lineup-summary .counts strong {
  font: 800 1.15rem/1 var(--display);
}
.lineup-summary .btn {
  padding: 0.7rem 1rem;
}

/* Mercato */
.amount {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
  color: var(--muted);
}
.amount input {
  width: 4.6rem;
  text-align: right;
  padding: 0.55rem 0.6rem;
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 700;
}
.total {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  font-weight: 600;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}
.total .muted {
  font-size: 0.8rem;
  font-weight: 500;
}
.total.over {
  color: var(--loss);
}

/* =====================================================================
   Tableau des scores
   ===================================================================== */
.scoreboard {
  position: relative;
  overflow: hidden;
  color: #fff;
  border-radius: 24px;
  padding: 1.1rem 1rem 1.2rem;
  margin: 0 0 1.25rem;
  background:
    radial-gradient(circle at 50% 120%, rgb(255 120 60 / 0.45), transparent 55%),
    linear-gradient(150deg, #1f2c8f, #3b2bb0 55%, #5a24a8);
  box-shadow: var(--shadow-lg);
}
.scoreboard::before {
  /* rond central et ligne médiane */
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at 50% 55%,
      transparent 3.4rem,
      rgb(255 255 255 / 0.14) 3.5rem,
      rgb(255 255 255 / 0.14) 3.62rem,
      transparent 3.72rem
    ),
    linear-gradient(
      90deg,
      transparent calc(50% - 1px),
      rgb(255 255 255 / 0.14) calc(50% - 1px),
      rgb(255 255 255 / 0.14) calc(50% + 1px),
      transparent calc(50% + 1px)
    );
  pointer-events: none;
}
.sb-top {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  opacity: 0.9;
}
.sb-top .pill {
  background: rgb(255 255 255 / 0.16);
  color: #fff;
}
.sb-top .pill.live::before {
  background: #ff8a50;
  box-shadow: 0 0 0 0 rgb(255 138 80 / 0.7);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  70% {
    box-shadow: 0 0 0 7px rgb(255 138 80 / 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgb(255 138 80 / 0);
  }
}
.sb-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1rem 0 0.4rem;
}
.sb-team {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 0.45rem;
}
.sb-team .avatar {
  box-shadow: 0 0 0 3px rgb(255 255 255 / 0.25);
}
.sb-name {
  font: 700 1.05rem/1.1 var(--display);
  overflow-wrap: anywhere;
}
.sb-score {
  font: 800 clamp(2.8rem, 14vw, 4rem)/0.9 var(--display);
  font-variant-numeric: tabular-nums;
}
.sb-team:not(.lead) .sb-score {
  opacity: 0.7;
}
.sb-team.lead .sb-score {
  color: #ffc29e;
}
.sb-state {
  position: relative;
  text-align: center;
  font-size: 0.8rem;
  opacity: 0.85;
}

.bench-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font: 700 0.8rem/1 var(--body);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 1rem 0 0.2rem;
}
.bench-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.sub-note {
  color: var(--accent-ink);
  font-weight: 600;
}

/* Résultats / calendrier */
.match-row {
  display: grid;
  gap: 0.35rem;
  padding: 0.75rem 0;
}
.mr-team {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}
.mr-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.mr-team.me .mr-name {
  font-weight: 700;
}
.mr-score {
  font: 700 1.2rem/1 var(--display);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.mr-team.won .mr-score {
  color: var(--ink);
}
.mr-team.won .mr-score::after {
  content: " ◂";
  font-size: 0.8em;
  color: var(--accent);
}
.mr-team.lost .mr-name {
  color: var(--muted);
}
/* Fiche joueur : moyennes détaillées */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
  margin: 0 0 0.75rem;
}
.stat-grid div {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.3rem;
  text-align: center;
}
.stat-grid dt {
  font-size: 0.68rem;
  color: var(--muted);
}
.stat-grid dd {
  margin: 0;
  font: 700 1.05rem/1.2 var(--display);
}
.game-log b {
  color: var(--ink);
}

/* Fiche joueur : pourquoi cette note */
.game-log .row {
  align-items: flex-start;
}
.week-note {
  background: var(--brand-soft);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.8rem 0.6rem;
  margin-bottom: 0.9rem;
}
.note-pill.static.big {
  font-size: 1.15rem;
  padding: 0.2rem 0.6rem;
}
.why summary {
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brand);
  margin-top: 0.2rem;
}
.why-list {
  list-style: none;
  margin: 0.35rem 0 0.2rem;
  padding: 0.45rem 0.6rem;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}
.why-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.1rem 0;
}
.why-list .plus {
  color: var(--win);
  font-weight: 600;
}
.why-list .minus {
  color: var(--loss);
  font-weight: 600;
}
.why-list .why-total {
  border-top: 1px solid var(--line);
  margin-top: 0.2rem;
  padding-top: 0.3rem;
}

/* Historique des offres du mercato */
.bid-round > .list {
  padding: 0 1.1rem 0.6rem;
}
.bid-list {
  list-style: none;
  margin: 0 0 0.6rem 2.6rem;
  padding: 0;
  display: grid;
  gap: 0.25rem;
}
.bid-list li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.bid-list li .row-main {
  font-size: 0.9rem;
}
.bid-list li.won {
  background: var(--win-soft);
}
.bid-list li.won .value {
  color: var(--win);
}
.bid-list li.me .row-main {
  font-weight: 700;
}

/* Rencontre cliquable : ouvre sa page */
.match-link {
  grid-template-columns: 1fr auto;
  align-items: center;
  color: inherit;
  text-decoration: none;
  border-radius: var(--radius-sm);
}
.match-link .mr-team {
  grid-column: 1;
}
.match-link > svg {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 1.1rem;
  height: 1.1rem;
  color: var(--muted);
}
.match-link:hover .mr-name {
  color: var(--brand);
}

/* Matchs NBA d’une semaine, par joueur */
.nba-week {
  flex-wrap: wrap;
  align-items: flex-start;
}
.link-btn {
  all: unset;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
/* Ligne de joueur cliquable : « all: unset » annulait flex et min-width ; un nom long poussait alors
   le bouton de droite hors de l’écran. */
.link-btn.row-main {
  flex: 1;
  min-width: 0;
}
.link-btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}
.game-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  width: 100%;
}
.game-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  background: var(--surface-2);
  color: var(--ink);
  white-space: nowrap;
}
.game-chip b {
  font-weight: 700;
}
.game-chip.soon {
  background: var(--brand-soft);
}
.game-chip.dnp {
  color: var(--muted);
  text-decoration-line: none;
  font-style: italic;
}
.game-chip .note-pill.static {
  font-size: 0.72rem;
  padding: 0.05rem 0.35rem;
}
.mine-card {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent),
    var(--shadow);
}
#semaine-en-cours {
  scroll-margin-top: 5rem;
}
.week-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}
.week-head h3 {
  font-size: 1.2rem;
  font-weight: 700;
}

/* Classement */
.standings {
  list-style: none;
  margin: 0;
  padding: 0;
}
.standings li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.25rem;
}
.standings li + li {
  border-top: 1px solid var(--line);
}
.standings li.mine {
  background: var(--brand-soft);
  border-radius: 12px;
  padding-inline: 0.6rem;
  margin-inline: -0.35rem;
}
.rank {
  width: 1.6rem;
  text-align: center;
  font: 800 1.3rem/1 var(--display);
  color: var(--muted);
}
.rank.top {
  color: var(--accent);
}
.record {
  display: grid;
  justify-items: end;
  gap: 0.1rem;
}
.record .wl {
  font: 700 1.2rem/1 var(--display);
  font-variant-numeric: tabular-nums;
}

/* =====================================================================
   Notifications
   ===================================================================== */
.toast {
  position: fixed;
  left: 50%;
  top: calc(1rem + env(safe-area-inset-top, 0px));
  transform: translateX(-50%);
  max-width: calc(100% - 2rem);
  background: var(--ink);
  color: var(--bg);
  padding: 0.8rem 1.1rem;
  border-radius: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 30;
}
.toast-error {
  background: var(--loss);
  color: #fff;
}
@media (prefers-reduced-motion: no-preference) {
  .toast {
    animation: drop 0.22s ease-out;
  }
  @keyframes drop {
    from {
      opacity: 0;
      transform: translate(-50%, -0.5rem);
    }
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* =====================================================================
   Aide et règles
   ===================================================================== */
.next-step {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.85rem 1rem;
  margin: 0 0 0.75rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--brand-soft), var(--accent-soft));
  border: 1px solid color-mix(in srgb, var(--brand) 25%, var(--line));
}
.next-step .row-main {
  gap: 0.15rem;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
}
.next-step .row-main .muted {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.7rem;
}
.next-step .btn {
  flex: none;
}
@media (max-width: 420px) {
  .next-step {
    flex-wrap: wrap;
  }
  .next-step .btn {
    width: 100%;
  }
}
.help {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: var(--muted);
}
.help summary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--brand);
  cursor: pointer;
  list-style: none;
}
.help summary::-webkit-details-marker {
  display: none;
}
.help p {
  margin: 0.5rem 0 0;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
}

.steps-card {
  list-style: none;
  padding: 0.2rem 1.1rem;
}
.steps-card li + li {
  border-top: 1px solid var(--line);
}
.step-num {
  display: grid;
  place-items: center;
  flex: none;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font: 800 1rem/1 var(--display);
}

.toc {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  margin: 0 -1rem 1.25rem;
  padding: 0 1rem 0.25rem;
  scrollbar-width: none;
}
.toc a {
  flex: none;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}
.rule,
#regle-faq {
  scroll-margin-top: 4.5rem;
}
.rule ul,
.rule ol {
  padding-left: 1.2rem;
  margin: 0.5rem 0;
}
.rule li + li {
  margin-top: 0.35rem;
}
.example {
  margin: 0.75rem 0;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  font-size: 0.92rem;
}
.tip {
  color: var(--accent-ink);
  font-weight: 600;
  font-size: 0.9rem;
}
.points {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0;
}
.points td {
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
}
.points td:last-child {
  text-align: right;
  font: 700 1.1rem/1 var(--display);
}
.timeline {
  list-style: none;
  padding: 0 !important;
  margin: 0;
}
.timeline li {
  position: relative;
  display: grid;
  gap: 0.15rem;
  padding: 0 0 0.9rem 1.5rem;
  margin: 0 !important;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: 0.2rem;
  top: 0.35rem;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: var(--brand);
}
.timeline li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 0.48rem;
  top: 1.1rem;
  bottom: 0.1rem;
  width: 2px;
  background: var(--line);
}
.timeline span {
  color: var(--muted);
  font-size: 0.9rem;
}
.faq summary strong {
  white-space: normal;
}
.faq .sheet-body {
  margin: 0;
  color: var(--muted);
}

/* Bandeau « Du nouveau dans la ligue » (temps réel) */
.live-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.6rem 0.6rem 1rem;
  margin: 0 0 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  font-size: 0.9rem;
}

/* Bonus */
.bonus-emoji {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 1.15rem;
}
.bonus.active .bonus-emoji {
  background: var(--accent-soft);
  box-shadow: 0 0 0 2px var(--accent);
}
.bonus.used {
  opacity: 0.55;
}
.bonus .row-main strong,
.bonus .row-main .muted {
  white-space: normal;
}
.bonus-action {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  flex: none;
}
.captain-pick select {
  margin-top: 0.4rem;
  padding: 0.45rem 0.6rem;
  font-size: 0.85rem;
}
.bonus-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0;
  font-size: 0.9rem;
}
.bonus-table td {
  padding: 0.5rem 0.25rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.bonus-table td:first-child {
  font-weight: 700;
  white-space: nowrap;
  padding-right: 0.75rem;
}

/* Profil */
.profile-btn {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  text-decoration: none;
}
.profile-btn .avatar {
  box-shadow: 0 0 0 2px var(--surface);
}
.team-form label {
  font-size: 0.8rem;
}
.team-form input {
  margin-top: 0.15rem;
}
.danger-zone {
  border-color: color-mix(in srgb, var(--loss) 40%, var(--line));
}
.danger-zone .card-title {
  color: var(--loss);
}
.btn.danger {
  border-color: transparent;
  background: var(--loss);
  color: #fff;
}
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 0.5rem;
  text-align: center;
  margin: 2rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.site-footer a {
  color: var(--muted);
  white-space: nowrap;
}

.formula {
  text-align: center;
  font-size: 1.05rem;
  padding: 0.6rem;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

/* =====================================================================
   Terrain : face-à-face, jetons de joueurs avec la note au-dessus
   ===================================================================== */
.court {
  position: relative;
  display: grid;
  gap: 0.35rem;
  padding: 0.9rem 0.6rem;
  border-radius: 24px;
  color: #fff;
  overflow: hidden;
  background:
    repeating-linear-gradient(90deg, rgb(255 255 255 / 0.025) 0 2px, transparent 2px 46px),
    linear-gradient(160deg, #18307e, #23257a 55%, #3a1f78);
  box-shadow: var(--shadow-lg);
}
.court-half {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  padding: 0.9rem 0 0.3rem;
}
.court-half.far {
  padding: 0.3rem 0 0.9rem;
}
.lane {
  display: grid;
  justify-items: center;
  gap: 1.15rem;
}
.lane-label {
  font: 700 0.62rem/1 var(--body);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.6;
}
.lane-tokens {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.1rem 0.6rem;
}
.court-center {
  position: relative;
  height: 2px;
  margin: 0.4rem -0.6rem;
  background: rgb(255 255 255 / 0.25);
}
.court-center::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  border: 2px solid rgb(255 255 255 / 0.25);
  transform: translate(-50%, -50%);
}
.court-team-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font: 700 1rem/1.1 var(--display);
}
.court-hidden {
  display: grid;
  place-items: center;
  min-height: 9rem;
  text-align: center;
  opacity: 0.75;
  font-size: 0.9rem;
}
.court-solo .court-half {
  padding: 1rem 0 0.4rem;
}

.token {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0.1rem;
  width: 6rem;
  padding: 1rem 0.35rem 0.5rem;
  border-radius: 16px;
  background: rgb(255 255 255 / 0.96);
  color: #0f1222;
  box-shadow: 0 6px 16px rgb(0 0 0 / 0.25);
  transition: transform 0.15s ease;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .token {
    background: #1b2033;
    color: var(--ink);
  }
}
:root[data-theme="dark"] .token {
  background: #1b2033;
  color: var(--ink);
}
.token.broke {
  box-shadow:
    0 0 0 2px #22c55e,
    0 0 22px rgb(34 197 94 / 0.55);
}
.token.captain {
  box-shadow:
    0 0 0 2px #fbbf24,
    0 6px 16px rgb(0 0 0 / 0.25);
}
.token.absent {
  opacity: 0.45;
  filter: grayscale(1);
}
.note-pill {
  position: absolute;
  top: -0.8rem;
  left: 50%;
  transform: translateX(-50%);
  min-width: 2.6rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font: 800 1rem/1 var(--display);
  font-variant-numeric: tabular-nums;
  color: #fff;
  text-align: center;
  box-shadow: 0 3px 10px rgb(0 0 0 / 0.3);
}
.note-hot {
  background: linear-gradient(135deg, #ff8a2b, #ff3d71);
}
.note-good {
  background: linear-gradient(135deg, #22c55e, #0e9f6e);
}
.note-mid {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #3a2600;
}
.note-low {
  background: #94a3b8;
}
.note-none {
  background: #64748b;
}
.token-face {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  margin-top: 0.15rem;
  border-radius: 50%;
  font: 800 0.9rem/1 var(--display);
  background: var(--surface-2);
  color: var(--muted);
}
.token-face.pos-G {
  background: #e3ecff;
  color: #2846c9;
}
.token-face.pos-F {
  background: #e4f6ec;
  color: #177245;
}
.token-face.pos-C {
  background: #fff0e3;
  color: #b4500c;
}
.token-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.74rem;
  font-weight: 700;
}
.token-pts {
  font: 700 0.95rem/1 var(--display);
  font-variant-numeric: tabular-nums;
}
.token-sub {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--accent-ink);
}
.duel {
  margin-top: 0.15rem;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #475569;
  background: #eef2f7;
}
.duel-win {
  color: #fff;
  background: #16a34a;
  letter-spacing: 0;
}
.duel-foul {
  color: #fff;
  background: #dc2626;
  letter-spacing: 0;
}
.duel-off {
  letter-spacing: 0;
}

/* Ordinateur : les deux équipes en colonnes face à face */
/* Le terrain reste vertical sur grand écran : la page ne dépasse pas 640 px, trop étroit pour deux
   demi-terrains côte à côte (le second était coupé à droite). */

/* Composition : places à remplir */
.slot-btn {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  border-radius: 16px;
}
.slot-btn:hover .token {
  transform: translateY(-2px);
}
.slot-btn.empty {
  display: grid;
  place-items: center;
  gap: 0.2rem;
  width: 6rem;
  min-height: 6.4rem;
  border: 2px dashed rgb(255 255 255 / 0.45);
  color: rgb(255 255 255 / 0.85);
  font-size: 0.72rem;
  font-weight: 600;
}
.slot-plus {
  font: 800 1.6rem/1 var(--display);
}
.bench-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.1rem 0.6rem;
  padding: 1.1rem 0.6rem 0.6rem;
  border-radius: var(--radius);
  background: var(--surface-2);
}
.bench-row .slot-btn.empty {
  border-color: var(--line);
  color: var(--muted);
}
.picker-backdrop {
  position: fixed;
  inset: 0;
  z-index: 39;
  background: rgb(10 12 22 / 0.45);
}
.picker {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, 42rem);
  max-height: 78vh;
  overflow: auto;
  padding: 0.9rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
  border-radius: 22px 22px 0 0;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.picker-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}
.picker-head .icon-btn {
  margin-left: auto;
}
.pick-row {
  width: 100%;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 12px;
  padding-inline: 0.4rem;
}
.pick-row:hover,
.pick-row.current {
  background: var(--brand-soft);
}

.nowrap {
  white-space: nowrap;
}

/* Composition : état d’enregistrement, semaine dernière, liste de choix */
.compo-head {
  align-items: center;
}
.save-status {
  font: 600 0.78rem/1.2 var(--body);
  color: var(--muted);
  text-align: right;
}
.save-status.ok {
  color: var(--win);
}
.save-status.warn {
  color: var(--loss);
}
.token-last {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--muted);
}
.note-pill.static {
  position: static;
  transform: none;
  flex: none;
  font-size: 0.9rem;
}
.pick-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 12px;
}
.pick-item.current {
  background: var(--brand-soft);
}
.pick-item .pick-row {
  flex: 1;
  min-width: 0;
}
.info-btn {
  flex: none;
  color: var(--brand);
  font-size: 1.15rem;
}

/* Fiche joueur */
.sheet-player {
  padding-top: 1.1rem;
}
.sheet-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
}
.sheet-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 0 2.5rem 0.9rem 0;
}
.token-face.big {
  width: 3.2rem;
  height: 3.2rem;
  font-size: 1.3rem;
  margin: 0;
}
.sheet-name {
  font: 800 1.45rem/1.1 var(--display);
}
.sheet-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}
.sheet-stats > div {
  display: grid;
  justify-items: center;
  gap: 0.3rem;
  padding: 0.6rem 0.25rem;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 0.68rem;
  color: var(--muted);
  text-align: center;
}
.sheet-stats strong {
  font: 800 1.35rem/1 var(--display);
  color: var(--ink);
}
.game-log .row {
  padding: 0.55rem 0;
}
.sheet-actions {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

/* Mercato : postes et filtre */
.pos-need {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.7rem;
  margin-top: 0.45rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
}
.pos-need.ok {
  background: var(--win-soft);
}
.pos-need-label {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 600;
}
.pos-need strong {
  font: 800 1.15rem/1 var(--display);
}
.pos-need-state {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-ink);
}
.pos-need.ok .pos-need-state {
  color: var(--win);
}
.pos-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.25rem 0 0.5rem;
}
.pos-filter .chip {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.pos-filter .chip[aria-pressed="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* Classements */
.seg {
  margin-bottom: 0.8rem;
}
.avatar.xs {
  width: 1.1rem;
  height: 1.1rem;
  font-size: 0.5rem;
  border-radius: 5px;
  vertical-align: -0.2rem;
}
.forms {
  display: flex;
  gap: 0.2rem;
  margin-top: 0.25rem;
}
.fpill {
  width: 1.15rem;
  height: 1.15rem;
  display: grid;
  place-items: center;
  border-radius: 5px;
  font: 700 0.62rem/1 var(--body);
}
.fpill-V {
  background: var(--win-soft);
  color: var(--win);
}
.fpill-D {
  background: var(--loss-soft);
  color: var(--loss);
}
.fpill-N {
  background: var(--surface-2);
  color: var(--muted);
}
.records {
  margin-bottom: 0.9rem;
}
.record-card {
  display: grid;
  gap: 0.15rem;
  align-content: start;
}
.record-card .stat-value.small-value {
  font-size: 1.05rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rank-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}
.rank-tools .pos-filter {
  margin: 0;
}
.rank-tools select {
  width: auto;
  max-width: 100%;
  padding: 0.45rem 2rem 0.45rem 0.75rem;
  font-size: 0.85rem;
}
.players-rank .link-btn {
  flex: 1;
  min-width: 0;
}
.players-rank .record {
  min-width: 3.2rem;
  text-align: right;
}

/* Page équipe */
.team-link {
  color: inherit;
  text-decoration: none;
}
.team-link:hover {
  color: var(--brand);
}
.team-hero {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1rem;
}
.team-hero h2 {
  margin: 0;
  font: 800 1.6rem/1.1 var(--display);
}
.team-rank {
  display: grid;
  justify-items: center;
  font: 800 1.9rem/1 var(--display);
  color: var(--brand);
}
.team-rank sup {
  font-size: 0.5em;
}
.grid-3 {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(3, 1fr);
}
.team-tiles .stat {
  padding: 0.65rem 0.6rem;
}
.team-tiles .stat-value {
  font-size: 1.45rem;
}
.week-hist summary {
  gap: 0.6rem;
}
.week-tag {
  font: 800 0.85rem/1 var(--display);
  color: var(--muted);
  min-width: 1.8rem;
}
.hist-score {
  font: 800 1.15rem/1 var(--display);
  white-space: nowrap;
}
.hist-score small {
  font-size: 0.8em;
  color: var(--muted);
}
.hist-score.res-V {
  color: var(--win);
}
.hist-score.res-D {
  color: var(--loss);
}
.week-lineup,
.week-hist > .btn {
  margin: 0 1.1rem 0.9rem;
}
.week-hist > .btn {
  display: inline-block;
}
.week-lineup .row {
  gap: 0.5rem;
}
.week-lineup .link-btn {
  flex: 1;
  min-width: 0;
}
.week-lineup .note-pill.static {
  min-width: 2.3rem;
  padding: 0.15rem 0.35rem;
  font-size: 0.85rem;
}
.week-lineup .value {
  flex: none;
  min-width: 2.6rem;
  text-align: right;
}

/* Discussion */
.chat {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.chat-list {
  list-style: none;
  margin: 0;
  padding: 0.8rem 0.9rem 0.4rem;
  max-height: min(60vh, 32rem);
  min-height: 8rem;
  overflow-y: auto;
  display: grid;
  gap: 0.15rem;
  align-content: start;
}
.msg {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  padding-top: 0.5rem;
}
.msg.grouped {
  padding-top: 0;
}
.msg-avatar {
  width: 1.9rem;
  flex: none;
}
.msg-body {
  flex: 1;
  min-width: 0;
}
.msg-head {
  display: block;
  font-size: 0.85rem;
}
.msg-body p {
  margin: 0.1rem 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.4;
}
.msg.me .msg-head strong {
  color: var(--brand);
}
.msg-del {
  opacity: 0;
  width: 1.8rem;
  height: 1.8rem;
  color: var(--muted);
}
.msg-del svg {
  width: 0.95rem;
  height: 0.95rem;
}
.msg:hover .msg-del,
.msg-del:focus-visible {
  opacity: 1;
}
@media (hover: none) {
  .msg-del {
    opacity: 0.55;
  }
}
.chat-form {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  padding: 0.6rem 0.7rem;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.chat-form textarea {
  flex: 1;
  resize: none;
  min-height: 2.6rem;
  max-height: 10rem;
  font: inherit;
}
.send-btn {
  flex: none;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
}

/* Échanges */
.trade-sides {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.5rem;
  align-items: start;
}
.trade-arrow {
  align-self: center;
  font-size: 1.3rem;
  color: var(--brand);
}
.trade-players {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.3rem;
  font-size: 0.9rem;
}
.trade-players li {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}
.link-btn.inline {
  display: inline;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.trade-money {
  font: 800 1rem/1 var(--display);
  color: var(--accent-ink);
}
.trade-msg {
  margin: 0.6rem 0 0;
  font-style: italic;
}
.check-row {
  cursor: pointer;
  gap: 0.55rem;
}
.check-row input {
  width: 1.1rem;
  height: 1.1rem;
  flex: none;
  accent-color: var(--brand);
}
.trade-form .list {
  max-height: 18rem;
  overflow-y: auto;
}

/* Joueurs et équipes cliquables partout */
[data-player],
[data-team] {
  cursor: pointer;
}
strong[data-player]:hover,
.tap[data-team]:hover {
  color: var(--brand);
}
.avatar {
  overflow: hidden;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.logo-tools {
  display: flex;
  gap: 0.5rem;
  margin: -0.4rem 0 1rem;
}

/* Notes d’équipe */
.team-notes {
  display: grid;
  gap: 0.35rem;
}
.team-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
}

/* Pastille d’un onglet */
.tabbar a {
  position: relative;
}
.tab-badge {
  position: absolute;
  top: 0.15rem;
  right: 50%;
  transform: translateX(1.15rem);
  min-width: 1.05rem;
  height: 1.05rem;
  padding: 0 0.25rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--loss);
  color: #fff;
  font: 700 0.65rem/1 var(--body);
}

/* Rappel de composition */
.compo-alert {
  margin: 0.5rem 0 0.8rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 0.88rem;
}
.compo-alert ul {
  margin: 0.3rem 0 0;
  padding-left: 1.1rem;
}

/* Équipe réelle : ville et pastille de ses couleurs */
.club {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}
.club-dot {
  flex: none;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c1) 0 55%, var(--c2) 55% 100%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 25%, transparent);
}

/* Inscription et signalements */
.consent {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-weight: 500;
  color: var(--ink);
}
.consent input {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.1rem;
  flex: none;
}
.report {
  flex-wrap: wrap;
}
.report-excerpt {
  font-style: italic;
  overflow-wrap: anywhere;
}
.report-logo {
  width: 3rem;
  height: 3rem;
  border-radius: 10px;
  object-fit: cover;
}
.report-actions {
  display: flex;
  gap: 0.4rem;
}

/* Composition : vivier et glisser-déposer */
.tray {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(6.4rem, 1fr));
  gap: 0.45rem;
}
.tray-item {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0.2rem;
  padding: 0.7rem 0.35rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  box-shadow: var(--shadow);
  transition:
    transform 0.12s,
    opacity 0.12s;
}
.tray-item:active {
  cursor: grabbing;
}
.tray-item.placed {
  opacity: 0.72;
  box-shadow: none;
}
.tray-item.hurt-out {
  border-color: var(--loss);
}
.tray-item.hurt-doute {
  border-color: var(--accent);
}
.tray-name {
  font-weight: 700;
  font-size: 0.82rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tray-meta,
.tray-at {
  font-size: 0.68rem;
  color: var(--muted);
}
.tray-at {
  color: var(--brand);
  font-weight: 600;
}
.slot-btn[data-drag-id] {
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.drag-ghost {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  max-width: 12rem;
  padding: 0.4rem 0.75rem 0.4rem 0.4rem;
  border-radius: 999px;
  background: var(--surface);
  border: 2px solid var(--brand);
  box-shadow: var(--shadow-lg);
  color: var(--ink, inherit);
  pointer-events: none;
  white-space: nowrap;
}
.drag-ghost strong {
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.9rem;
}
.drag-ghost .token-face {
  flex: none;
  width: 1.9rem;
  height: 1.9rem;
  font-size: 0.85rem;
}
.drag-source {
  opacity: 0.35;
  filter: grayscale(0.6);
}
.is-dragging .drop-ok {
  outline: 2px dashed color-mix(in srgb, var(--win) 70%, transparent);
  outline-offset: 2px;
  border-radius: 14px;
}
.is-dragging .drop-no {
  opacity: 0.4;
}
.is-dragging .drop-hover.drop-ok,
.is-dragging #tray.drop-hover {
  outline: 3px solid var(--win);
  background: color-mix(in srgb, var(--win) 12%, transparent);
}

/* Accueil : score en direct */
.home-live {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.home-live:empty {
  display: none;
}
.home-live b {
  white-space: nowrap;
}
.home-live b.up {
  color: var(--win);
}
.home-live b.down {
  color: var(--loss);
}
.live-dot {
  flex: none;
  margin-top: 0.35em;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--loss);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.25;
  }
}

/* Écran de résultat de la semaine */
.result-root {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.result-root .picker-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.result-root .result-card {
  z-index: 1;
}
.result-card .stat-value.small-value {
  font-size: 1.2rem;
  line-height: 1.15;
}
.result-card {
  position: relative;
  overflow: hidden;
  width: min(100%, 24rem);
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  padding: 1.6rem 1.2rem 1.2rem;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: pop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.result-card.win {
  background: linear-gradient(160deg, var(--win-soft), var(--surface) 60%);
}
.result-card.loss {
  background: linear-gradient(160deg, var(--loss-soft), var(--surface) 60%);
}
.result-title {
  margin: 0;
  font: 800 2.4rem/1 var(--display);
}
.result-card.win .result-title {
  color: var(--win);
}
.result-card.loss .result-title {
  color: var(--loss);
}
.result-score {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font: 800 2.8rem/1 var(--display);
}
.result-card .grid-2 {
  width: 100%;
}
.result-card .sheet-actions {
  width: 100%;
}
@keyframes pop {
  from {
    transform: scale(0.85);
    opacity: 0;
  }
}
.confetti i {
  position: absolute;
  top: -10px;
  left: calc(var(--i) * 4.2%);
  width: 8px;
  height: 14px;
  border-radius: 2px;
  background: hsl(calc(var(--i) * 47) 85% 55%);
  animation: fall 1.8s ease-in calc(var(--i) * 40ms) forwards;
}
@keyframes fall {
  to {
    transform: translateY(26rem) rotate(calc(var(--i) * 90deg));
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .result-card,
  .confetti i,
  .live-dot {
    animation: none;
  }
  .confetti {
    display: none;
  }
}

/* Trophées de la page équipe */
.trophies {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.7rem 0 1rem;
}
.trophy {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 0.8rem;
  font-weight: 700;
}

.result-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  z-index: 2;
}
.result-players {
  width: 100%;
  max-height: 40vh;
  overflow-y: auto;
  text-align: left;
}
.result-players .value {
  min-width: 2.6rem;
  text-align: right;
}

/* Série de victoires */
.row-main > .streak {
  align-self: flex-start;
  margin-left: 0;
}
.streak {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 0.05rem;
  margin-left: 0.3rem;
  padding: 0.05rem 0.35rem 0.05rem 0.2rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffe0b3, #ffc2a3);
  color: #b3360a;
  font: 800 0.72rem/1.2 var(--body);
  vertical-align: middle;
  white-space: nowrap;
}
.streak > span {
  display: inline-block;
  animation: flicker 1.4s ease-in-out infinite;
  transform-origin: 50% 90%;
}
.streak.hot2 {
  background: linear-gradient(135deg, #ffb36b, #ff6a2b);
  color: #fff;
}
.streak.hot3 {
  background: linear-gradient(135deg, #ff6a2b, #e0245e);
  color: #fff;
  box-shadow: 0 0 10px rgb(255 106 43 / 0.55);
}
.streak.hot3 > span {
  animation-duration: 0.9s;
}
.streak-banner {
  margin: 0;
  font-weight: 800;
  color: #d9480f;
}
@keyframes flicker {
  0%,
  100% {
    transform: scale(1) rotate(-3deg);
  }
  50% {
    transform: scale(1.18) rotate(4deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .streak > span {
    animation: none;
  }
}

/* Invitation */
.invite-card {
  display: grid;
  justify-items: center;
  gap: 0.45rem;
  text-align: center;
  padding: 1.6rem 1rem;
}
.invite-name {
  margin: 0;
  font: 800 1.9rem/1.1 var(--display);
}
.invite-banner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  color: var(--ink);
  font-weight: 600;
}
.invite-banner .icon-svg {
  flex: none;
  width: 1.3rem;
  height: 1.3rem;
  color: var(--brand);
}
.invite-link {
  margin: 0.3rem 0 0.6rem;
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font: 600 0.8rem/1.3 var(--body);
  overflow-wrap: anywhere;
  user-select: all;
}
.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

/* Résumé de la semaine dans la discussion */
.msg.summary {
  display: block;
  padding: 0.6rem 0;
}
.summary-card {
  padding: 0.8rem 0.9rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--brand-soft), var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--brand) 25%, var(--line));
}
.summary-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.summary-head strong {
  flex: 1;
}
.summary-results,
.summary-awards {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.3rem;
  font-size: 0.86rem;
}
.summary-results li {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.5rem;
  align-items: center;
}
.summary-results li > span:last-child {
  text-align: right;
}
.summary-results .won {
  font-weight: 700;
}
.summary-awards li {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Réactions et mentions */
.reactions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.3rem;
}
.reaction {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.12rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: 600 0.78rem/1.3 var(--body);
  cursor: pointer;
}
.reaction.mine {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.reaction.add {
  opacity: 0.55;
}
.msg:hover .reaction.add,
.reactions.open .reaction.add {
  opacity: 1;
}
.reaction-pick {
  display: none;
  gap: 0.2rem;
}
.reactions.open .reaction-pick {
  display: inline-flex;
}
.reaction-pick .reaction {
  font-size: 1rem;
  padding: 0.1rem 0.35rem;
}
.mention {
  color: var(--brand);
  font-weight: 700;
}
.mention-me {
  padding: 0 0.2rem;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.mention-tips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0 0.7rem;
}
.mention-tips:not(:empty) {
  padding: 0.5rem 0.7rem 0;
}
.mention-tips .chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
}

/* =====================================================================
   Cartes à collectionner : chaque joueur est une carte, sa rareté vient de sa note
   (bronze < 5, argent < 7, or < 8,5, légende au-delà), avec une bande aux couleurs de son équipe.
   ===================================================================== */
@property --holo {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}
.pcard {
  --card-bg: linear-gradient(#ffffff, #ffffff);
  --card-ink: #0f1222;
  --frame: linear-gradient(135deg, #d6dae6, #f4f6fb, #c3c9d8);
  position: relative;
  overflow: visible;
  isolation: isolate;
  border: 2.5px solid transparent;
  background:
    var(--card-bg) padding-box,
    var(--frame) border-box;
  color: var(--card-ink);
}
.pcard-band {
  position: absolute;
  inset: 0 0 auto;
  height: 0.42rem;
  border-radius: 12px 12px 0 0;
  background: linear-gradient(90deg, var(--c1) 0 62%, var(--c2) 62% 100%);
  z-index: -1;
}
.pcard.rar-bronze {
  --frame: linear-gradient(135deg, #e2a878, #8a5531 45%, #d99a6c 70%, #6e3f22);
  --card-bg: linear-gradient(180deg, #fff6ef, #ffffff 45%);
}
.pcard.rar-silver {
  --frame: linear-gradient(135deg, #f8fafc, #8d99ae 40%, #eef2f7 65%, #9aa5b8);
  --card-bg: linear-gradient(180deg, #f3f6fb, #ffffff 45%);
}
.pcard.rar-gold {
  --frame: linear-gradient(135deg, #fff3b0, #d4a017 35%, #fde68a 60%, #a8770a);
  --card-bg: linear-gradient(180deg, #fff8dc, #fffdf4 50%);
  box-shadow:
    0 6px 18px rgb(212 160 23 / 0.35),
    0 2px 6px rgb(0 0 0 / 0.15);
}
.pcard.rar-legend {
  --frame: conic-gradient(from var(--holo), #ff6ad5, #c774e8, #8795e8, #94d0ff, #6affb2, #fff27a, #ff6ad5);
  --card-bg: linear-gradient(160deg, #1e1b4b, #312e81 55%, #1e1b4b);
  --card-ink: #ffffff;
  box-shadow:
    0 0 18px rgb(173 140 255 / 0.55),
    0 6px 18px rgb(0 0 0 / 0.3);
  animation: holo 6s linear infinite;
}
.pcard.rar-legend .token-sub,
.pcard.rar-legend .token-last,
.pcard.rar-legend .tray-meta {
  color: #e0d7ff;
}
.pcard.rar-legend .token-face {
  background: rgb(255 255 255 / 0.15);
  color: #fff;
}
@keyframes holo {
  to {
    --holo: 360deg;
  }
}
/* Reflet qui balaie les cartes or et légende. */
.pcard.rar-gold::after,
.pcard.rar-legend::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, transparent 30%, rgb(255 255 255 / 0.55) 45%, transparent 60%);
  background-size: 250% 100%;
  mix-blend-mode: soft-light;
  pointer-events: none;
  animation: shine 3.8s ease-in-out infinite;
}
@keyframes shine {
  0%,
  55% {
    background-position: 120% 0;
  }
  100% {
    background-position: -120% 0;
  }
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .pcard {
    --card-bg: linear-gradient(#1b2033, #1b2033);
    --card-ink: #eef0f8;
  }
  :root:not([data-theme="light"]) .pcard.rar-bronze {
    --card-bg: linear-gradient(180deg, #2c2019, #1b2033 50%);
  }
  :root:not([data-theme="light"]) .pcard.rar-silver {
    --card-bg: linear-gradient(180deg, #232a3d, #1b2033 50%);
  }
  :root:not([data-theme="light"]) .pcard.rar-gold {
    --card-bg: linear-gradient(180deg, #3a2f10, #1f1d22 55%);
  }
}
:root[data-theme="dark"] .pcard {
  --card-bg: linear-gradient(#1b2033, #1b2033);
  --card-ink: #eef0f8;
}
:root[data-theme="dark"] .pcard.rar-bronze {
  --card-bg: linear-gradient(180deg, #2c2019, #1b2033 50%);
}
:root[data-theme="dark"] .pcard.rar-silver {
  --card-bg: linear-gradient(180deg, #232a3d, #1b2033 50%);
}
:root[data-theme="dark"] .pcard.rar-gold {
  --card-bg: linear-gradient(180deg, #3a2f10, #1f1d22 55%);
}
@media (prefers-reduced-motion: reduce) {
  .pcard.rar-legend,
  .pcard.rar-gold::after,
  .pcard.rar-legend::after {
    animation: none;
  }
}
.token.pcard {
  padding-top: 1.1rem;
  border-radius: 14px;
}
.tray-item.pcard {
  border-radius: 14px;
  padding-top: 0.95rem;
}

/* ---------- Fond : légère texture de terrain ---------- */
body {
  background:
    radial-gradient(
      60rem 30rem at 110% -10%,
      color-mix(in srgb, var(--brand) 12%, transparent),
      transparent 60%
    ),
    radial-gradient(
      40rem 24rem at -20% 30%,
      color-mix(in srgb, var(--accent) 9%, transparent),
      transparent 60%
    ),
    var(--bg);
  background-attachment: fixed;
}

/* ---------- Chargement ---------- */
.skel {
  display: grid;
  gap: 0.7rem;
  padding: 0.4rem 0;
}
.skel span {
  display: block;
  border-radius: var(--radius-sm);
  background: linear-gradient(
    90deg,
    var(--surface-2) 0%,
    color-mix(in srgb, var(--surface-2) 55%, var(--surface)) 50%,
    var(--surface-2) 100%
  );
  background-size: 200% 100%;
  animation: skel 1.2s ease-in-out infinite;
}
.skel-line {
  height: 1rem;
}
.skel-line.w60 {
  width: 60%;
}
.skel-line.w80 {
  width: 80%;
}
.skel-card {
  height: 8rem;
  border-radius: var(--radius) !important;
}
.skel-card.short {
  height: 4.5rem;
}
@keyframes skel {
  to {
    background-position: -200% 0;
  }
}

/* ---------- Apparition des contenus d’onglet ---------- */
#tab > * {
  animation: rise 0.32s ease both;
}
#tab > *:nth-child(2) {
  animation-delay: 0.04s;
}
#tab > *:nth-child(3) {
  animation-delay: 0.08s;
}
#tab > *:nth-child(n + 4) {
  animation-delay: 0.12s;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
@media (prefers-reduced-motion: reduce) {
  #tab > *,
  .skel span {
    animation: none;
  }
}

/* ---------- Accueil : match en cours ---------- */
.avatar.xl {
  width: 4rem;
  height: 4rem;
  border-radius: 20px;
  font-size: 1.6rem;
  box-shadow: 0 6px 18px rgb(0 0 0 / 0.25);
}
.feature-match {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.7rem;
  margin: 0 0 1.2rem;
  padding: 1rem 1rem 1.1rem;
  border-radius: 24px;
  overflow: hidden;
  color: #fff;
  text-decoration: none;
  background:
    radial-gradient(18rem 10rem at 85% 0%, hsl(var(--h) 90% 60% / 0.55), transparent 70%),
    linear-gradient(150deg, #1e1b4b, #312e81 55%, #4c1d95);
  box-shadow: 0 14px 36px rgb(49 46 129 / 0.45);
}
.feature-match::before {
  /* Lignes du terrain */
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 120%, transparent 38%, rgb(255 255 255 / 0.1) 38.5% 39.5%, transparent 40%),
    linear-gradient(
      90deg,
      transparent calc(50% - 1px),
      rgb(255 255 255 / 0.1) 50%,
      transparent calc(50% + 1px)
    );
  pointer-events: none;
}
.fm-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  opacity: 0.9;
}
.fm-week {
  margin-left: -0.25rem;
}
.fm-top .pill,
.fm-week {
  flex: none;
}
.fm-league {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fm-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0.4rem;
  align-items: center;
}
.fm-team {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  text-align: center;
  min-width: 0;
}
.fm-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 700 1rem/1.1 var(--display);
}
.fm-score {
  font: 800 clamp(1.9rem, 10vw, 2.6rem) / 1 var(--display);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  opacity: 0.75;
}
.fm-team.lead .fm-score {
  opacity: 1;
  color: #fde68a;
  text-shadow: 0 0 18px rgb(253 230 138 / 0.5);
}
.fm-vs {
  font: 800 1.1rem/1 var(--display);
  opacity: 0.5;
}
.fm-foot {
  position: relative;
  justify-self: center;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.14);
  font-size: 0.82rem;
  font-weight: 600;
}

/* ---------- Bannière des ligues ---------- */
.league-card {
  background: linear-gradient(120deg, hsl(var(--h) 85% 60% / 0.16), transparent 55%), var(--surface);
  border-left: 5px solid hsl(var(--h) 75% 55%);
}

/* ---------- Encadrés « À faire » et aide : plus compacts ---------- */
.next-step {
  padding: 0.7rem 0.85rem;
  border-left: 4px solid var(--accent);
}
.help summary {
  font-size: 0.85rem;
}

/* Invitation à activer les notifications : icône | texte | ✕, bouton sous le texte. */
.next-step.push-nudge {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 0.7rem;
  row-gap: 0.6rem;
}
.push-nudge .sheet-icon {
  grid-row: 1 / span 2;
  align-self: start;
}
.push-nudge #nudge-off {
  grid-column: 3;
  grid-row: 1;
  align-self: start;
}
.push-nudge #nudge-on {
  grid-column: 2;
  grid-row: 2;
  justify-self: start;
  width: auto;
}

/* ---------- Records et trophées : façon cartes or ---------- */
.record-card {
  border: 2px solid transparent;
  background:
    linear-gradient(180deg, color-mix(in srgb, #fde68a 22%, var(--surface)), var(--surface) 55%) padding-box,
    linear-gradient(135deg, #fff3b0, #d4a017 35%, #fde68a 60%, #a8770a) border-box;
}
.trophy {
  border: 1px solid color-mix(in srgb, #d4a017 45%, transparent);
  background: linear-gradient(135deg, color-mix(in srgb, #fde68a 40%, var(--surface)), var(--surface));
  color: color-mix(in srgb, #8a5a00 80%, var(--ink));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .trophy {
    color: #fde68a;
  }
}
:root[data-theme="dark"] .trophy {
  color: #fde68a;
}

/* ---------- Tableau des scores : chiffres plus marqués ---------- */
.sb-score {
  text-shadow: 0 0 24px rgb(255 255 255 / 0.25);
}

/* Fiche joueur : en-tête façon grande carte */
.sheet-head.pcard {
  position: relative;
  padding: 1.1rem 0.9rem 0.8rem;
  border-radius: 18px;
  margin-bottom: 0.9rem;
}
.sheet-head.pcard .pcard-band {
  height: 0.55rem;
  border-radius: 16px 16px 0 0;
}
.sheet-head.rar-legend .muted,
.sheet-head.rar-legend .sheet-name {
  color: #fff;
}
.rarity-tag {
  position: absolute;
  top: 0.85rem;
  right: 0.8rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font: 800 0.7rem/1.4 var(--body);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgb(0 0 0 / 0.06);
}
.rarity-tag:empty {
  display: none;
}
.rar-gold .rarity-tag {
  background: linear-gradient(135deg, #fde68a, #d4a017);
  color: #4a3200;
}
.rar-legend .rarity-tag {
  background: linear-gradient(135deg, #ff6ad5, #8795e8, #6affb2);
  color: #fff;
}
.rar-silver .rarity-tag {
  background: linear-gradient(135deg, #f1f5f9, #94a3b8);
  color: #1e293b;
}
.rar-bronze .rarity-tag {
  background: linear-gradient(135deg, #f5c9a3, #a0643a);
  color: #3b1d08;
}
.sheet-player .sheet-close {
  z-index: 3;
}

/* Podium du classement */
.standings li:nth-child(-n + 3) .rank {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  color: #fff;
  box-shadow: 0 3px 10px rgb(0 0 0 / 0.2);
}
.standings li:nth-child(1) .rank {
  background: linear-gradient(135deg, #fde68a, #d4a017);
  color: #4a3200;
}
.standings li:nth-child(2) .rank {
  background: linear-gradient(135deg, #f1f5f9, #94a3b8);
  color: #1e293b;
}
.standings li:nth-child(3) .rank {
  background: linear-gradient(135deg, #f5c9a3, #a0643a);
}

/* ---------- Paquet de nouvelles recrues ---------- */
.pack {
  position: relative;
  z-index: 1;
  width: min(100%, 26rem);
  max-height: 90dvh;
  overflow-y: auto;
  display: grid;
  justify-items: center;
  gap: 0.6rem;
  padding: 1.4rem 1rem 1.1rem;
  border-radius: var(--radius);
  background: linear-gradient(160deg, #1e1b4b, #312e81 60%, #4c1d95);
  color: #fff;
  box-shadow: var(--shadow-lg);
  animation: pop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.pack .muted {
  color: #c7d2fe;
}
.pack-title {
  margin: 0;
  font: 800 2rem/1 var(--display);
  background: linear-gradient(90deg, #fde68a, #fff, #fde68a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.pack-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
  padding: 0.9rem 0 0.4rem;
  perspective: 800px;
}
.pack-slot {
  position: relative;
  width: 6.4rem;
  min-height: 9rem;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.pack-slot .token {
  width: 100%;
  min-height: 9rem;
}
.card-back {
  display: block;
  width: 100%;
  height: 9rem;
  border-radius: 14px;
  border: 2.5px solid #fde68a;
  background:
    url("logo-dw.svg") center / 2.6rem no-repeat,
    repeating-linear-gradient(45deg, rgb(255 255 255 / 0.07) 0 8px, transparent 8px 16px),
    linear-gradient(160deg, #ff6a2b, #b8400c);
  box-shadow: 0 8px 20px rgb(0 0 0 / 0.35);
  animation: wobble 2.4s ease-in-out infinite;
}
.pack-slot:nth-child(2n) .card-back {
  animation-delay: -1.2s;
}
@keyframes wobble {
  50% {
    transform: translateY(-4px) rotate(-1.5deg);
  }
}
.pack-slot.burst::before {
  content: "";
  position: absolute;
  inset: -1rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(253 230 138 / 0.75), transparent 65%);
  animation: burst 0.9s ease-out forwards;
  pointer-events: none;
}
.pack-slot[data-rarity="legend"].burst::before {
  background: radial-gradient(circle, rgb(196 181 253 / 0.9), rgb(110 255 178 / 0.4) 40%, transparent 70%);
}
@keyframes burst {
  from {
    transform: scale(0.3);
    opacity: 1;
  }
  to {
    transform: scale(1.6);
    opacity: 0;
  }
}
.pack-slot .confetti i {
  top: 0;
}

/* ---------- Fiche joueur : courbe de forme ---------- */
.spark {
  width: 100%;
  max-width: 16rem;
  height: 3rem;
  color: var(--brand);
}
.spark circle {
  fill: var(--accent);
}

/* ---------- Célébrations : percée sur le terrain ---------- */
.token.broke {
  animation: breakthrough 1.1s ease-out 0.3s backwards;
}
.token.broke::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 18px;
  border: 2px solid #22c55e;
  animation: ring 1.4s ease-out 0.3s 2;
  pointer-events: none;
}
@keyframes breakthrough {
  0% {
    transform: scale(0.9);
  }
  40% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes ring {
  from {
    opacity: 1;
    transform: scale(0.95);
  }
  to {
    opacity: 0;
    transform: scale(1.25);
  }
}
@media (prefers-reduced-motion: reduce) {
  .card-back,
  .token.broke,
  .token.broke::before,
  .pack-slot.burst::before,
  .pack {
    animation: none;
  }
}
.pack-slot [hidden] {
  display: none;
}

/* Message annulable */
.toast-undo {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  overflow: hidden;
}
.toast-undo .link {
  color: var(--accent);
  font-weight: 800;
}
.toast-timer {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  background: var(--accent);
  transform-origin: left;
  animation: timer var(--d) linear forwards;
}
@keyframes timer {
  to {
    transform: scaleX(0);
  }
}

.msg.pending {
  opacity: 0.6;
}

/* ---------- Entrée des pages ---------- */
body {
  overscroll-behavior-y: contain;
}
.page.enter {
  animation: page-in 0.28s ease both;
}
.page.slide-left {
  animation: from-right 0.28s ease both;
}
.page.slide-right {
  animation: from-left 0.28s ease both;
}
@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}
@keyframes from-right {
  from {
    opacity: 0;
    transform: translateX(28px);
  }
}
@keyframes from-left {
  from {
    opacity: 0;
    transform: translateX(-28px);
  }
}
/* Dernière vue affichée pendant le chargement */
.stale {
  pointer-events: none;
  opacity: 0.7;
  filter: saturate(0.7);
}
/* Tirer pour actualiser */
.ptr {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 40;
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: var(--surface);
  color: var(--brand);
  font: 800 1.3rem/1 var(--body);
  box-shadow: var(--shadow-lg);
  transform: translate(-50%, -60px);
  transition: transform 0.2s ease;
  pointer-events: none;
}
.ptr.ready {
  color: var(--win);
}
.ptr.spin {
  transform: translate(-50%, 30px);
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    rotate: 360deg;
  }
}
@media (prefers-reduced-motion: reduce) {
  .page.enter,
  .page.slide-left,
  .page.slide-right,
  .ptr.spin {
    animation: none;
  }
}

/* Fil de la semaine */
.feed {
  list-style: none;
  padding: 0.6rem 1rem;
}
.feed-day + .feed-day {
  border-top: 1px solid var(--line);
  margin-top: 0.4rem;
  padding-top: 0.4rem;
}
.feed-date {
  display: block;
  margin: 0.2rem 0 0.3rem;
  font: 700 0.75rem/1 var(--body);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.feed ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}
.feed ul li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.feed ul li .row-main {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.35rem;
  align-items: baseline;
}
.feed li.hot strong {
  color: var(--accent-ink);
}
.feed li.miss {
  opacity: 0.75;
}

/* Visite guidée */
.tour {
  position: fixed;
  inset: 0;
  z-index: 70;
}
.tour-hole {
  position: fixed;
  border-radius: 16px;
  box-shadow: 0 0 0 9999px rgb(10 12 22 / 0.68);
  outline: 2px solid #fde68a;
  transition: all 0.25s ease;
  pointer-events: none;
}
.tour-bubble {
  position: fixed;
  left: 1rem;
  right: 1rem;
  max-width: 24rem;
  margin: 0 auto;
  display: grid;
  gap: 0.35rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
  animation: pop 0.3s ease;
}
.tour-bubble strong {
  font: 800 1.25rem/1.1 var(--display);
}
.tour-bubble p {
  margin: 0;
}
.tour-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Écrans vides : plus parlants */
.empty {
  display: grid;
  justify-items: center;
  gap: 0.4rem;
  padding: 1.6rem 1.2rem;
  border: 1.5px dashed color-mix(in srgb, var(--brand) 30%, var(--line));
  background: color-mix(in srgb, var(--brand-soft) 45%, transparent);
  line-height: 1.45;
}
.empty::before {
  content: "🏀";
  font-size: 2rem;
  filter: drop-shadow(0 4px 8px rgb(0 0 0 / 0.15));
  animation: bounce 1.6s ease-in-out infinite;
}
li.empty::before,
.empty.small::before {
  font-size: 1.4rem;
}
@keyframes bounce {
  50% {
    transform: translateY(-6px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .empty::before,
  .tour-bubble {
    animation: none;
  }
}

/* Cloche et centre de notifications */
.bell {
  position: relative;
}
.bell-badge {
  position: absolute;
  top: 0.1rem;
  right: 0.1rem;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.2rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--loss);
  color: #fff;
  font: 700 0.6rem/1 var(--body);
}
.bell-badge[hidden] {
  display: none;
}
.notif {
  color: inherit;
  text-decoration: none;
  gap: 0.7rem;
  align-items: flex-start;
}
/* Titre sur deux lignes au plus, heure sous le texte : rien n'est coupé sur petit écran. */
.notif .row-main strong {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
}
.notif .row-main .muted {
  overflow-wrap: anywhere;
}
.notif-time {
  margin-top: 0.15rem;
  font-size: 0.72rem;
  color: var(--muted);
}
.notif-icon {
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  flex: none;
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 1.1rem;
}
.notif.unread .notif-icon {
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 2px var(--brand);
}
.notif.unread strong::after {
  content: "";
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin-left: 0.35rem;
  border-radius: 50%;
  background: var(--brand);
  vertical-align: middle;
}

/* Écran de lancement (avant le premier affichage de l’appli) */
.splash {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1.4rem;
  background: radial-gradient(30rem 20rem at 70% 10%, #4c1d95, transparent 70%), #1e1b4b;
}
.splash img {
  width: 6rem;
  height: 6rem;
  border-radius: 22%;
  box-shadow: 0 14px 40px rgb(124 58 237 / 0.5);
  animation: splash-in 0.6s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.splash-dots {
  display: flex;
  gap: 0.45rem;
}
.splash-dots i {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #fde68a;
  animation: dots 1s ease-in-out infinite;
}
.splash-dots i:nth-child(2) {
  animation-delay: 0.15s;
}
.splash-dots i:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes splash-in {
  from {
    transform: scale(0.6) rotate(-12deg);
    opacity: 0;
  }
}
@keyframes dots {
  50% {
    transform: translateY(-6px);
    opacity: 0.5;
  }
}
@media (prefers-reduced-motion: reduce) {
  .splash img,
  .splash-dots i {
    animation: none;
  }
}

/* Logo de la barre du haut : l’icône de l’appli */
.brand-mark {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 9px;
  background: url("logo-dw.svg") center / cover;
  box-shadow: 0 3px 10px rgb(124 58 237 / 0.35);
}
.brand-mark::after {
  display: none;
}

/* Règles de la ligue */
.bonus-choice {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}
.bonus-choice legend {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.rules-summary strong {
  font-weight: 700;
}

/* Comparateur de joueurs */
.compare #cmp-search {
  width: 100%;
  margin: 0.6rem 0;
}
.cmp-heads {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 0.5rem;
  margin: 0.6rem 0;
}
.cmp-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0.2rem;
  padding: 1rem 0.5rem 0.7rem;
  border-radius: var(--radius, 14px);
  overflow: hidden;
  text-align: center;
  min-width: 0;
}
.cmp-name {
  font-size: 0.95rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.cmp-vs {
  align-self: center;
  font-weight: 800;
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
}
.cmp-forms,
.cmp-row {
  display: grid;
  grid-template-columns: 1fr minmax(6.5rem, auto) 1fr;
  align-items: center;
  gap: 0.4rem;
  text-align: center;
}
.cmp-spark {
  color: var(--accent);
  display: flex;
  justify-content: center;
}
.cmp-spark .spark {
  width: 100%;
  max-width: 140px;
}
.cmp-row {
  padding: 0.45rem 0;
  border-top: 1px solid var(--line, rgba(127, 127, 127, 0.18));
}
.cmp-label {
  font-size: 0.8rem;
  color: var(--muted);
}
.cmp-val {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  justify-self: center;
}
.cmp-val.win {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
  font-weight: 800;
}

/* Ligues publiques */
a.sheet-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  color: inherit;
  text-decoration: none;
}
a.sheet-link .chev {
  margin-left: auto;
  color: var(--muted);
}
.public-rules summary {
  cursor: pointer;
  list-style: none;
}
.public-rules summary::-webkit-details-marker {
  display: none;
}
.public-rules summary .link {
  color: var(--brand);
  font-weight: 600;
  white-space: nowrap;
}
.public-rules[open] summary .link {
  display: none;
}
.public-rules ul {
  margin: 0.6rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
  display: grid;
  gap: 0.2rem;
}
.public-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}
.public-league {
  display: grid;
  gap: 0.6rem;
}
.public-league > .row {
  padding: 0;
}
.places {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.places span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}
.public-join {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
}
.public-join input {
  min-width: 0;
}
.public-badge {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  margin: 0.6rem 0 0;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  font-size: 0.85rem;
  text-align: left;
}
.public-badge svg {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.1rem;
}
.round-deadline {
  margin: 0 0 0.75rem;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  font-size: 0.85rem;
}
@media (max-width: 380px) {
  #league-settings .grid-2 {
    grid-template-columns: 1fr;
  }
}

.free-note,
.last-spot-note {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--brand);
}
.last-spot-note {
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.public-league.last-spot {
  box-shadow:
    0 0 0 2px var(--accent),
    var(--shadow, 0 8px 24px rgb(0 0 0 / 0.08));
}
.public-rules-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
  margin: 0;
}
.public-rules-grid div {
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  min-width: 0;
}
.public-rules-grid dt {
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.public-rules-grid dd {
  margin: 0;
  font-weight: 700;
  font-size: 0.88rem;
}
.public-bonus {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Pastilles de bonus : nom au survol (ou appui long), détail au toucher */
.bonus-chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.bonus-chip {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-size: 1.05rem;
  cursor: pointer;
  -webkit-touch-callout: none;
  user-select: none;
  transition: transform 0.15s ease;
}
.bonus-chip:active {
  transform: scale(0.92);
}
.bonus-chip::after {
  content: attr(data-name);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translate(-50%, 4px);
  padding: 0.25rem 0.55rem;
  border-radius: 8px;
  background: #0f172a;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
  z-index: 5;
}
.bonus-chip.show-name::after,
.bonus-chip:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}
@media (hover: hover) {
  .bonus-chip:hover::after {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}
.rules-summary .bonus-chips {
  justify-content: flex-end;
}
.bonus-sheet {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  text-align: center;
}
.bonus-sheet-emoji {
  font-size: 3rem;
  line-height: 1;
  margin-top: 0.5rem;
}
.bonus-sheet p {
  margin: 0;
}
.public-league .row-main strong {
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Consignes de remplacement */
.tactics {
  display: grid;
  gap: 0.6rem;
}
.tactic-list > li {
  padding: 0.6rem 0;
}
.tactic {
  display: grid;
  gap: 0.35rem;
}
.tactic-line {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.tactic select {
  flex: 1 1 7rem;
  min-width: 0;
  padding: 0.35rem 0.5rem;
  font-weight: 600;
}
.tactic select[data-field="below"] {
  flex: 0 0 4.2rem;
}
.tactic-arrow {
  color: var(--brand);
  font-weight: 800;
}

/* Onglets regroupés : bascule en haut de page */
.seg-tabs {
  display: flex;
  gap: 0.25rem;
  margin: 0 0 1rem;
  padding: 0.25rem;
  border-radius: 14px;
  background: var(--surface-2);
}
.seg-tabs > a,
.seg-tabs > button {
  flex: 1;
  min-width: 0;
  padding: 0.55rem 0.4rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: 700 0.85rem/1.1 var(--body);
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.seg-tabs > [aria-current="page"],
.seg-tabs > [aria-selected="true"] {
  background: var(--surface);
  color: var(--ink, inherit);
  box-shadow: var(--shadow);
}

/* Menu de la ligue (⋯) dans l’en-tête */
.league-head .league-menu {
  position: relative;
  margin-left: auto;
  align-self: flex-start;
  flex: none;
}
.league-menu .tab-badge,
.chat-bubble .tab-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  transform: none;
}

/* Bulle de discussion, au-dessus de la barre d’onglets */
.chat-bubble {
  position: fixed;
  z-index: 11;
  right: max(1rem, calc(50% - 15rem + 0.5rem));
  bottom: calc(5.4rem + env(safe-area-inset-bottom, 0px));
  display: grid;
  place-items: center;
  width: 3.3rem;
  height: 3.3rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2, var(--brand)));
  color: #fff;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--brand) 45%, transparent);
  transition: transform 0.15s ease;
}
.chat-bubble.no-tabbar {
  bottom: calc(1.2rem + env(safe-area-inset-bottom, 0px));
}
.chat-bubble:active {
  transform: scale(0.92);
}
.chat-bubble svg {
  width: 1.45rem;
  height: 1.45rem;
}

/* Onglet Joueurs */
.players-filter {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}
.chip-toggle {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}
.leaders .leader {
  gap: 0.6rem;
}
.leaders .rank {
  flex: none;
  width: 1.4rem;
  text-align: center;
  font: 800 0.95rem/1 var(--display);
  color: var(--muted);
}
.leaders .top .rank {
  color: var(--accent);
}
.leaders .top-1 .rank {
  font-size: 1.2rem;
}
.leader .row-main {
  text-align: left;
  gap: 0.1rem;
}
.leader-note {
  display: grid;
  justify-items: end;
  gap: 0.15rem;
  flex: none;
}
.trend {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
}
.trend.up {
  color: var(--win);
}
.trend.down {
  color: var(--loss);
}
.free-pill {
  font-size: 0.7rem;
  padding: 0.05rem 0.45rem;
}

/* Fiche joueur : actions en haut, volets */
.sheet-actions.top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.8rem 0;
}
.sheet-actions.top .btn {
  flex: 1 1 8rem;
}
.sheet-tabs {
  position: sticky;
  top: -1px;
  z-index: 2;
  margin: 0 0 0.8rem;
}
.sheet-form {
  display: grid;
  gap: 0.2rem;
  margin: 0.8rem 0 0.4rem;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.sheet-player .why summary {
  display: inline-block;
  margin-top: 0.25rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
}
/* L’étiquette de rareté ne recouvre plus les noms longs : le nom passe à la ligne sous elle. */
.sheet-head .row-main {
  padding-top: 1.4rem;
}
.sheet-head .sheet-name {
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Transferts : fenêtre, solidarité et primes dans une seule carte */
.info-card .row {
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.55rem 0;
}
.info-ico {
  flex: none;
  font-size: 1.15rem;
  line-height: 1.3;
}

/* Sixième homme mis en avant */
.sixth-man {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin: 0.4rem auto;
  padding: 0.35rem 0.8rem;
  width: fit-content;
  border-radius: 16px;
  background: rgb(253 230 138 / 0.16);
  border: 1px dashed rgb(253 230 138 / 0.7);
}
.sixth-label {
  font: 800 0.72rem/1.2 var(--body);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fde68a;
  max-width: 5.5rem;
}
.token.sixth {
  box-shadow:
    0 0 0 2px #f59e0b,
    0 0 18px rgb(245 158 11 / 0.45);
}
.sixth-row {
  background: color-mix(in srgb, #f59e0b 10%, transparent);
  border-radius: var(--radius-sm);
}
.sixth-note {
  color: #b45309;
  font-weight: 700;
}

/* ---------- En-tête de ligue compact ---------- */
.league-head {
  position: relative;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 0.75rem;
}
.lh-main {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex: 1;
  min-width: 0;
}
.league-head h1 {
  font-size: clamp(1.25rem, 5.6vw, 1.6rem);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lh-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.2rem;
}
.lh-status .progress {
  flex: 1;
  margin-top: 0;
  max-width: 7rem;
}
.lh-actions {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  flex: none;
  align-self: flex-start;
}
.league-head .league-menu {
  margin-left: 0;
  align-self: auto;
}
/* Aide de l’onglet : bouton « ? », texte sous l’en-tête */
.help-pop {
  margin: 0;
}
.help-pop > summary {
  color: var(--muted);
}
.help-pop[open] > summary {
  color: var(--brand);
}
.help-pop > p {
  position: absolute;
  z-index: 6;
  left: 0;
  right: 0;
  top: calc(100% + 0.3rem);
  margin: 0;
  box-shadow: var(--shadow-lg);
  font-size: 0.86rem;
  line-height: 1.45;
}
/* « À faire » : un bandeau d’une ou deux lignes */
.next-step.todo-bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.6rem 0.5rem 0.75rem;
  margin: 0 0 0.75rem;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.3;
}
.todo-bar .row-main {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.todo-bar .todo-icon {
  flex: none;
  color: var(--accent);
  display: grid;
}
.todo-bar .todo-icon svg {
  width: 1.15rem;
  height: 1.15rem;
}
.todo-bar .btn {
  flex: none;
  width: auto;
  white-space: nowrap;
}
.seg-tabs {
  margin-bottom: 0.75rem;
}

/* ---------- Sections repliables ---------- */
.fold {
  margin: 0 0 0.6rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}
.fold > summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1rem;
  cursor: pointer;
  list-style: none;
}
.fold > summary::-webkit-details-marker {
  display: none;
}
.fold-title {
  flex: none;
  font: 800 1rem/1.2 var(--display);
  white-space: nowrap;
}
.fold-sub {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--muted);
  font-size: 0.82rem;
}
.fold > summary .chev {
  margin-left: auto;
  flex: none;
  color: var(--muted);
  transition: transform 0.2s ease;
}
.fold[open] > summary .chev {
  transform: rotate(90deg);
}
.fold-body {
  padding: 0 0.6rem 0.7rem;
}
.fold-body > .card,
.fold-body .duo > .card {
  box-shadow: none;
}

/* Bonus de la semaine (page Match) : une ligne chacun */
.bonus-mini-list {
  padding-top: 0.2rem;
  padding-bottom: 0.2rem;
}
.bonus-mini {
  gap: 0.7rem;
  padding: 0.45rem 0;
}
.bonus-mini .bonus-chips {
  flex: none;
}
.info-card .row-main strong {
  white-space: normal;
}

/* ---------- Consignes de remplacement : cartes visuelles ---------- */
.tactic-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}
.tactic-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: 0.4rem;
  padding: 0.6rem 0.5rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.tc-player {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 0.15rem;
  padding: 0.55rem 0.3rem 0.45rem;
  border-radius: 12px;
  background: var(--surface);
  text-align: center;
  min-width: 0;
  cursor: pointer;
}
.tc-player strong {
  font-size: 0.85rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.tc-player.out {
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--loss) 55%, transparent);
}
.tc-player.in {
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--win) 60%, transparent);
}
.tc-tag {
  position: absolute;
  top: -0.55rem;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  font: 800 0.65rem/1.4 var(--body);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff;
}
.out .tc-tag {
  background: var(--loss);
}
.in .tc-tag {
  background: var(--win);
}
.tc-change {
  font-size: 0.68rem;
  color: var(--brand);
  font-weight: 700;
}
/* Le sélecteur natif couvre la carte : toucher la carte ouvre la liste du téléphone. */
.tc-player select {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  cursor: pointer;
}
.tc-mid {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 0.25rem;
  text-align: center;
  max-width: 6.2rem;
}
.tc-mid .muted {
  font-size: 0.7rem;
  line-height: 1.2;
}
.stepper {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.15rem;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.stepper button {
  width: 1.7rem;
  height: 1.7rem;
  border: 0;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font: 800 1rem/1 var(--body);
  cursor: pointer;
}
.stepper button:disabled {
  opacity: 0.35;
  cursor: default;
}
.tc-below {
  min-width: 2.1rem;
  text-align: center;
  font: 800 1.05rem/1 var(--display);
}
.tc-arrow {
  color: var(--brand);
  font-size: 1.2rem;
  font-weight: 800;
}
.tc-del {
  position: absolute;
  top: -0.6rem;
  right: -0.4rem;
  width: 1.7rem;
  height: 1.7rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.tactic-tag {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tactic-tag.out {
  background: color-mix(in srgb, var(--loss) 85%, #000);
  color: #fff;
}
.tactic-tag.in {
  background: color-mix(in srgb, var(--win) 85%, #000);
  color: #fff;
}

/* ---------- Bonus : rangée de tuiles (Compo) ---------- */
.bonus-strip {
  margin: 0 0 1rem;
  padding: 0.75rem 0.75rem 0.6rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--brand-soft), var(--accent-soft));
  border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--line));
}
.bonus-strip-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}
.bonus-tiles {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding: 0.15rem 0.1rem 0.45rem;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.bonus-tile {
  flex: 0 0 5.2rem;
  display: grid;
  justify-items: center;
  gap: 0.15rem;
  padding: 0.55rem 0.3rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: inherit;
  text-align: center;
  scroll-snap-align: start;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.bonus-tile:active {
  transform: scale(0.95);
}
.bt-emoji {
  font-size: 1.7rem;
  line-height: 1;
}
.bt-name {
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.15;
}
.bt-tag {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.bonus-tile.attack .bt-tag {
  color: var(--loss);
}
.bonus-tile.used {
  opacity: 0.45;
  filter: grayscale(0.8);
}
.bonus-tile.active {
  border: 2px solid var(--accent);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent),
    0 8px 20px color-mix(in srgb, var(--accent) 35%, transparent);
}
.bonus-tile.active .bt-tag {
  color: var(--accent-ink);
}
.bonus-active-line {
  margin: 0.2rem 0 0;
  font-size: 0.86rem;
}
.bonus-sheet .captain-pick {
  display: grid;
  gap: 0.3rem;
  width: 100%;
  text-align: left;
  font-weight: 600;
}

/* Bonus dans le tableau de score */
.bonus-chip.sb-chip {
  width: auto;
  height: auto;
  display: inline-flex;
  gap: 0.3rem;
  margin-top: 0.35rem;
  padding: 0.25rem 0.65rem;
  border: 1px solid rgb(255 255 255 / 0.35);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.16);
  color: #fff;
  font: 700 0.78rem/1.2 var(--body);
}
.bonus-chip.sb-chip.attack {
  background: rgb(239 68 68 / 0.28);
  border-color: rgb(252 165 165 / 0.6);
}
.sb-chip::after {
  display: none;
}
.sb-bonus-detail {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  opacity: 0.85;
}

/* Changements de la semaine (page Match) */
.swaps .card-title {
  margin-bottom: 0.4rem;
}
.swap-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}
.swap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-areas: "av out arrow in" "av why why why";
  align-items: center;
  column-gap: 0.45rem;
  row-gap: 0.1rem;
  padding: 0.4rem 0;
  font-size: 0.86rem;
}
.swap + .swap {
  border-top: 1px solid var(--line);
}
.swap > .avatar {
  grid-area: av;
}
.swap-out {
  grid-area: out;
  color: var(--loss);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.swap-arrow {
  grid-area: arrow;
  color: var(--muted);
}
.swap-in {
  grid-area: in;
  color: var(--win);
  font-weight: 700;
  min-width: 0;
}
.swap-why {
  grid-area: why;
  color: var(--muted);
  font-size: 0.76rem;
}

.sixth-tag {
  background: #f59e0b;
  color: #1f1300;
  white-space: nowrap;
}

/* ---------- Terrain moderne ---------- */
/* Nuit profonde, halo aux couleurs de chaque équipe à son bout du terrain, lumière lente au centre. */
.court {
  --h-far: 265;
  --h-near: 195;
  isolation: isolate;
  background:
    radial-gradient(70% 34% at 50% 0%, hsl(var(--h-far) 85% 58% / 0.38), transparent 72%),
    radial-gradient(70% 34% at 50% 100%, hsl(var(--h-near) 85% 55% / 0.4), transparent 72%),
    linear-gradient(180deg, #0a0f26 0%, #111a44 48%, #111a44 52%, #0a0f26 100%);
  border: 1px solid rgb(255 255 255 / 0.08);
}
.court::after {
  content: "";
  position: absolute;
  inset: -20%;
  z-index: -1;
  background: radial-gradient(30% 22% at 50% 50%, rgb(140 170 255 / 0.16), transparent 70%);
  animation: court-breath 7s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes court-breath {
  from {
    transform: translateY(-4%) scale(0.95);
    opacity: 0.7;
  }
  to {
    transform: translateY(4%) scale(1.08);
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .court::after {
    animation: none;
  }
}
/* Marquages : raquette, cercle des lancers francs, ligne à 3 points, panier. */
.court-half {
  position: relative;
}
.court-half::before {
  content: "";
  position: absolute;
  left: 50%;
  width: min(100%, 25rem);
  aspect-ratio: 2 / 1;
  background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%20400%20200%22%20fill%3D%22none%22%20stroke%3D%22%23fff%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%3E%3Cg%20opacity%3D%22.22%22%3E%3Cpath%20d%3D%22M28%200v52a172%20172%200%200%200%20344%200V0%22/%3E%3Crect%20x%3D%22140%22%20y%3D%220%22%20width%3D%22120%22%20height%3D%22118%22/%3E%3Ccircle%20cx%3D%22200%22%20cy%3D%22118%22%20r%3D%2240%22/%3E%3Cpath%20d%3D%22M178%2034a22%2022%200%200%200%2044%200%22/%3E%3C/g%3E%3Cg%20opacity%3D%22.55%22%3E%3Cpath%20d%3D%22M176%2018h48%22/%3E%3Ccircle%20cx%3D%22200%22%20cy%3D%2230%22%20r%3D%229%22%20stroke%3D%22%23ff8a4c%22/%3E%3C/g%3E%3C/svg%3E")
    center / contain no-repeat;
  filter: drop-shadow(0 0 6px rgb(160 190 255 / 0.35));
  pointer-events: none;
  z-index: -1;
}
.court-half.far::before {
  top: -0.9rem;
  transform: translateX(-50%);
}
.court-half.near::before {
  bottom: -0.9rem;
  transform: translateX(-50%) scaleY(-1);
}
.court-half > .lane,
.court-half > .sixth-man {
  position: relative;
}
/* Ligne médiane lumineuse */
.court-center {
  height: 2px;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 0.55), transparent);
  box-shadow: 0 0 12px rgb(160 190 255 / 0.45);
}
.court-center::after {
  width: 5rem;
  height: 5rem;
  border: 2px solid rgb(255 255 255 / 0.3);
  box-shadow:
    0 0 18px rgb(160 190 255 / 0.3),
    inset 0 0 18px rgb(160 190 255 / 0.2);
}
.lane-label {
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.07);
  backdrop-filter: blur(4px);
  opacity: 0.85;
}
.court-team-label {
  position: relative;
  z-index: 1;
}

/* ---------- Parquet ---------- */
/* Lames de bois verticales, joints décalés, vernis ; raquettes peintes aux couleurs des équipes. */
.court {
  background:
    radial-gradient(ellipse at 50% 50%, transparent 55%, rgb(40 18 4 / 0.38)),
    linear-gradient(160deg, rgb(255 255 255 / 0.2), transparent 38%, transparent 62%, rgb(0 0 0 / 0.16)),
    repeating-linear-gradient(0deg, transparent 0 150px, rgb(60 30 10 / 0.16) 150px 151px),
    repeating-linear-gradient(90deg, rgb(60 30 10 / 0.18) 0 1px, transparent 1px 38px),
    repeating-linear-gradient(
      90deg,
      rgb(255 230 190 / 0.07) 0 38px,
      rgb(90 45 15 / 0.07) 38px 76px,
      rgb(255 230 190 / 0.03) 76px 114px,
      rgb(90 45 15 / 0.1) 114px 152px
    ),
    linear-gradient(180deg, #cf9358, #c2864c 50%, #cf9358);
  border: 1px solid rgb(120 60 20 / 0.35);
}
.court::after {
  background: radial-gradient(28% 20% at 50% 50%, rgb(255 245 220 / 0.22), transparent 70%);
}
.court-half::before {
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%20400%20200%22%20fill%3D%22none%22%20stroke%3D%22%23fff%22%20stroke-linecap%3D%22round%22%3E%3Cg%20stroke-width%3D%223%22%20opacity%3D%22.9%22%3E%3Cpath%20d%3D%22M28%200v52a172%20172%200%200%200%20344%200V0%22/%3E%3Crect%20x%3D%22140%22%20y%3D%220%22%20width%3D%22120%22%20height%3D%22118%22/%3E%3Ccircle%20cx%3D%22200%22%20cy%3D%22118%22%20r%3D%2240%22/%3E%3C/g%3E%3Cg%20stroke-width%3D%222.5%22%20opacity%3D%22.9%22%3E%3Cpath%20d%3D%22M178%2034a22%2022%200%200%200%2044%200%22/%3E%3Cpath%20d%3D%22M176%2018h48%22/%3E%3C/g%3E%3Ccircle%20cx%3D%22200%22%20cy%3D%2230%22%20r%3D%229%22%20stroke%3D%22%23ff6a1f%22%20stroke-width%3D%223%22/%3E%3C/svg%3E");
  filter: none;
}
/* Raquette peinte (sous les lignes), à la couleur de l’équipe. */
.court-half::after {
  content: "";
  position: absolute;
  left: 50%;
  width: calc(min(100%, 25rem) * 0.3);
  height: calc(min(100%, 25rem) * 0.295);
  transform: translateX(-50%);
  z-index: -2;
  pointer-events: none;
}
.court-half.far::after {
  top: -0.9rem;
  background: hsl(var(--h-far) 62% 42% / 0.8);
}
.court-half.near::after {
  bottom: -0.9rem;
  background: hsl(var(--h-near) 62% 42% / 0.8);
}
.court-center {
  background: rgb(255 255 255 / 0.9);
  box-shadow: none;
}
.court-center::after {
  border: 3px solid rgb(255 255 255 / 0.9);
  background: rgb(255 255 255 / 0.12);
  box-shadow: none;
}
.lane-label {
  background: rgb(30 14 4 / 0.55);
  color: #fff;
  opacity: 1;
}
.court-team-label {
  padding: 0.25rem 0.7rem 0.25rem 0.3rem;
  width: fit-content;
  margin: 0 auto;
  border-radius: 999px;
  background: rgb(30 14 4 / 0.55);
}
.court-hidden p {
  padding: 0.5rem 0.8rem;
  border-radius: 12px;
  background: rgb(30 14 4 / 0.55);
}
.sixth-man {
  background: rgb(30 14 4 / 0.5);
  border: 1px dashed rgb(253 230 138 / 0.9);
}

/* ---------- Tableau de score : écran géant de salle ---------- */
.scoreboard {
  --h-home: 200;
  --h-away: 20;
  border-radius: 20px;
  border: 1px solid rgb(255 255 255 / 0.08);
  background:
    radial-gradient(rgb(255 255 255 / 0.07) 1px, transparent 1.3px) 0 0 / 6px 6px,
    linear-gradient(
      90deg,
      hsl(var(--h-home) 85% 45% / 0.55),
      transparent 42%,
      transparent 58%,
      hsl(var(--h-away) 85% 45% / 0.55)
    ),
    #090b14;
  box-shadow:
    0 18px 40px rgb(5 8 20 / 0.45),
    inset 0 1px 0 rgb(255 255 255 / 0.08);
}
.scoreboard::before {
  /* reflet de l’écran */
  background: linear-gradient(180deg, rgb(255 255 255 / 0.07), transparent 38%);
}
.sb-row {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.4rem;
}
.sb-vs {
  font: 800 0.8rem/1 var(--display);
  letter-spacing: 0.1em;
  color: rgb(255 255 255 / 0.35);
}
.sb-team .avatar {
  box-shadow:
    0 0 0 3px hsl(var(--h) 80% 60% / 0.6),
    0 0 22px hsl(var(--h) 80% 55% / 0.45);
}
.sb-team:first-child {
  --h: var(--h-home);
}
.sb-team:last-child {
  --h: var(--h-away);
}
.sb-score {
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow:
    0 0 10px hsl(var(--h) 90% 60% / 0.8),
    0 0 28px hsl(var(--h) 90% 55% / 0.5);
}
.sb-team:not(.lead) .sb-score {
  opacity: 0.55;
  text-shadow: none;
}
.sb-team.lead .sb-score {
  color: #fff;
}
.sb-team.lead .sb-score::after {
  content: "▲";
  display: block;
  margin-top: 0.15rem;
  font-size: 0.7rem;
  color: hsl(var(--h) 90% 65%);
  text-shadow: none;
}
/* Barre de domination : la part du score de chaque équipe. */
.sb-momentum {
  position: relative;
  height: 6px;
  margin: 0.7rem 0.2rem 0.5rem;
  border-radius: 999px;
  overflow: hidden;
  background: hsl(var(--h-away) 85% 55%);
  box-shadow: 0 0 14px rgb(255 255 255 / 0.12);
}
.sb-momentum span {
  display: block;
  height: 100%;
  background: hsl(var(--h-home) 85% 55%);
  border-right: 2px solid #090b14;
  transition: width 0.8s ease;
}
.sb-state {
  opacity: 0.7;
}
.sb-top .pill.live {
  background: rgb(239 68 68 / 0.2);
  color: #fecaca;
}
.sb-top .pill.live::before {
  background: #ef4444;
}

/* Accueil : la grande carte du match en écran de salle, comme le tableau de score. */
.feature-match {
  --h-home: 200;
  --h-away: 20;
  background:
    radial-gradient(rgb(255 255 255 / 0.07) 1px, transparent 1.3px) 0 0 / 6px 6px,
    linear-gradient(
      90deg,
      hsl(var(--h-home) 85% 45% / 0.55),
      transparent 42%,
      transparent 58%,
      hsl(var(--h-away) 85% 45% / 0.55)
    ),
    #090b14;
  border: 1px solid rgb(255 255 255 / 0.08);
  box-shadow:
    0 14px 34px rgb(5 8 20 / 0.45),
    inset 0 1px 0 rgb(255 255 255 / 0.08);
}
.feature-match::before {
  background: linear-gradient(180deg, rgb(255 255 255 / 0.07), transparent 38%);
}
.fm-team.lead .fm-score {
  color: #fff;
  text-shadow: 0 0 12px rgb(255 255 255 / 0.45);
}
.fm-momentum {
  margin: 0.2rem 0 0;
}

/* Barre de domination animée : glisse jusqu’à la nouvelle part, éclat quand elle bouge. */
.sb-momentum span {
  width: 50%;
  transition: width 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}
.sb-momentum.moved::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 0.7), transparent);
  transform: translateX(-100%);
  animation: momentum-shine 1.1s ease-out 0.2s;
  pointer-events: none;
}
@keyframes momentum-shine {
  to {
    transform: translateX(100%);
  }
}

/* ---------- Parquet sombre (thème sombre) : noyer foncé, même dessin ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .court {
    background:
      radial-gradient(ellipse at 50% 50%, transparent 50%, rgb(0 0 0 / 0.5)),
      linear-gradient(160deg, rgb(255 255 255 / 0.1), transparent 38%, transparent 62%, rgb(0 0 0 / 0.25)),
      repeating-linear-gradient(0deg, transparent 0 150px, rgb(0 0 0 / 0.25) 150px 151px),
      repeating-linear-gradient(90deg, rgb(0 0 0 / 0.3) 0 1px, transparent 1px 38px),
      repeating-linear-gradient(
        90deg,
        rgb(255 210 160 / 0.05) 0 38px,
        rgb(0 0 0 / 0.08) 38px 76px,
        rgb(255 210 160 / 0.025) 76px 114px,
        rgb(0 0 0 / 0.12) 114px 152px
      ),
      linear-gradient(180deg, #5b3a22, #4a2e1a 50%, #5b3a22);
    border-color: rgb(0 0 0 / 0.4);
  }
  :root:not([data-theme="light"]) .court::after {
    background: radial-gradient(28% 20% at 50% 50%, rgb(255 200 140 / 0.14), transparent 70%);
  }
}
:root[data-theme="dark"] .court {
  background:
    radial-gradient(ellipse at 50% 50%, transparent 50%, rgb(0 0 0 / 0.5)),
    linear-gradient(160deg, rgb(255 255 255 / 0.1), transparent 38%, transparent 62%, rgb(0 0 0 / 0.25)),
    repeating-linear-gradient(0deg, transparent 0 150px, rgb(0 0 0 / 0.25) 150px 151px),
    repeating-linear-gradient(90deg, rgb(0 0 0 / 0.3) 0 1px, transparent 1px 38px),
    repeating-linear-gradient(
      90deg,
      rgb(255 210 160 / 0.05) 0 38px,
      rgb(0 0 0 / 0.08) 38px 76px,
      rgb(255 210 160 / 0.025) 76px 114px,
      rgb(0 0 0 / 0.12) 114px 152px
    ),
    linear-gradient(180deg, #5b3a22, #4a2e1a 50%, #5b3a22);
  border-color: rgb(0 0 0 / 0.4);
}
:root[data-theme="dark"] .court::after {
  background: radial-gradient(28% 20% at 50% 50%, rgb(255 200 140 / 0.14), transparent 70%);
}

/* Sixième homme : l’étiquette au-dessus de la carte, centrée (place pour la pastille de note). */
.sixth-man {
  flex-direction: column;
  gap: 1rem;
  padding: 0.45rem 0.7rem 0.55rem;
}
.sixth-label {
  max-width: none;
  text-align: center;
  white-space: nowrap;
}

/* Fenêtre ouverte : la page derrière ne défile plus, seule la fenêtre défile (voir fenetres.js). */
html.overlay-open,
html.overlay-open body {
  overflow: hidden;
  overscroll-behavior: none;
}
.picker {
  overscroll-behavior: contain;
}

/* Joueurs : « Libres seulement » en pastille, juste après les postes (elle était repoussée à droite). */
.players-filter .chip-toggle {
  flex: none;
  max-width: 100%;
  margin-left: 0.15rem;
  padding: 0.42rem 0.75rem 0.42rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
}
.players-filter .chip-toggle input {
  margin: 0;
  accent-color: var(--brand);
}
.players-filter .chip-toggle:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}
.duel-soon {
  background: rgb(148 163 184 / 0.25);
  color: #e2e8f0;
}

/* Résultat d’un vrai match : V (victoire) ou D (défaite) et le score. */
.res {
  font-weight: 700;
  white-space: nowrap;
}
.res-w {
  color: var(--win);
}
.res-l {
  color: var(--loss);
}
.game-chip .res-w,
.game-chip .res-l {
  font-size: 0.95em;
}

/* Lignes cliquables (boutons) : contenu aligné à gauche partout. Safari centre le contenu des boutons,
   ce qui poussait le texte (et « Libre ») vers la droite dans le classement des joueurs. */
.link-btn {
  text-align: left;
  align-items: flex-start;
  justify-content: flex-start;
}
.link-btn > * {
  text-align: left;
  align-self: flex-start;
  max-width: 100%;
}
/* Bonus volé par le Miroir : barré et atténué. */
.bonus-chip.sb-chip.lost {
  text-decoration: line-through;
  opacity: 0.6;
}

/* ---------- Profil : trois volets aérés ---------- */
.profile-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0.4rem 0 1.25rem;
}
.profile-head h1 {
  font: 800 clamp(1.4rem, 6vw, 1.8rem) / 1.1 var(--display);
}
.profile-pane {
  display: grid;
  gap: 1.1rem;
  margin-top: 0.4rem;
}
.profile-pane > .card {
  margin: 0;
}
.profile-pane .form {
  gap: 0.9rem;
}
.team-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}
.team-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  padding: 1.1rem;
}
/* Le logo, en grand : le toucher ouvre l’appareil photo ou la galerie. */
.team-logo-pick {
  position: relative;
  display: grid;
  place-items: center;
  width: 5.2rem;
  height: 5.2rem;
  border-radius: 22px;
  cursor: pointer;
}
.team-logo-pick img,
.team-logo-pick .avatar {
  width: 100%;
  height: 100%;
  border-radius: 22px;
  object-fit: cover;
  font-size: 1.8rem;
}
.logo-badge {
  position: absolute;
  right: -0.35rem;
  bottom: -0.35rem;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 0 0 3px var(--surface);
}
.logo-badge svg {
  width: 1rem;
  height: 1rem;
}
.team-card-main {
  display: grid;
  gap: 0.5rem;
  min-width: 0;
}
.team-card .team-form {
  display: flex;
  gap: 0.4rem;
}
.team-card .team-form input {
  flex: 1;
  min-width: 0;
}
.team-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.team-card-actions .btn svg {
  width: 1rem;
  height: 1rem;
}
.danger-fold > summary .fold-title {
  color: var(--loss);
}
.danger-fold .danger-zone {
  border: 0;
  padding: 0 0.4rem 0.4rem;
}

/* Page d’une équipe : rencontres en lignes cliquables (en cours, prochaine, historique). */
.week-links {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.week-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.8rem 0.9rem;
  margin: 0;
  color: inherit;
  text-decoration: none;
}
.week-link .row-main {
  min-width: 0;
}
.week-link .chev {
  flex: none;
  color: var(--muted);
}
.week-link .hist-score {
  flex: none;
}
.logo-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.9rem 0 1.2rem;
}
.profile-pane[hidden] {
  display: none;
}

/* Effectifs : joueurs repliés sous le nom de l’équipe */
.roster-fold {
  margin-top: 0.6rem;
}
.roster-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  list-style: none;
  cursor: pointer;
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  background: var(--surface-2, rgb(127 127 127 / 0.1));
  color: var(--brand);
  font-weight: 700;
  font-size: 0.92rem;
}
.roster-toggle::-webkit-details-marker {
  display: none;
}
.roster-toggle svg {
  width: 1rem;
  height: 1rem;
  transform: rotate(90deg);
  transition: transform 0.2s;
}
.roster-fold[open] .roster-toggle svg {
  transform: rotate(-90deg);
}
.roster-fold .roster-close,
.roster-fold[open] .roster-open {
  display: none;
}
.roster-fold[open] .roster-close {
  display: inline;
}
.roster-fold[open] .list {
  margin-top: 0.5rem;
}

/* Match : remplacements par équipe et bancs avec stats */
.swap.planned {
  opacity: 0.75;
}
.bench-stats {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.bench-card .row.out .value {
  opacity: 0.8;
}

/* ---------- Échanges : bascules, cartes face à face, constructeur ---------- */
.seg-count {
  display: inline-grid;
  place-items: center;
  min-width: 1.2rem;
  height: 1.2rem;
  margin-left: 0.2rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.72rem;
}
.seg-count.hot {
  background: var(--accent);
  color: #fff;
}
.trade-pane {
  display: grid;
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.deal {
  position: relative;
  overflow: hidden;
  animation: deal-in 0.35s ease both;
}
.deal::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}
.deal.wait::before {
  background: linear-gradient(90deg, var(--accent), #ffb347);
}
.deal.ok::before {
  background: linear-gradient(90deg, var(--win), #4ade80);
}
.deal.ko {
  opacity: 0.72;
}
.deal.ko::before {
  background: var(--line);
}
@keyframes deal-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
.deal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}
.deal-status {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font: 800 0.72rem/1.2 var(--body);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--surface-2);
  color: var(--muted);
}
.deal-status.wait {
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.deal-status.ok {
  background: var(--win-soft);
  color: var(--win);
}
.deal-sides {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.5rem;
  align-items: start;
}
.deal-swap {
  align-self: center;
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-size: 1.1rem;
  box-shadow: 0 4px 14px rgb(59 85 230 / 0.35);
}
.deal.wait .deal-swap {
  animation: swap-pulse 2.4s ease-in-out infinite;
}
@keyframes swap-pulse {
  50% {
    transform: rotate(180deg) scale(1.08);
  }
}
.deal-side {
  min-width: 0;
}
.deal-team {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.5rem;
  min-width: 0;
}
.deal-team > span {
  display: grid;
  min-width: 0;
}
.deal-team strong {
  font: 700 0.95rem/1.15 var(--display);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.deal-team small {
  color: var(--muted);
  font-size: 0.72rem;
}
.deal-players {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}
.deal-player {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.45rem;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  min-width: 0;
}
.deal-player-btn {
  display: grid;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.deal-player-btn strong {
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.deal-player-btn small {
  color: var(--muted);
  font-size: 0.72rem;
}
.deal-money {
  justify-self: start;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffd66b, #f5a623);
  color: #5a3a00;
  font-weight: 800;
  font-size: 0.82rem;
}
.deal-nothing {
  color: var(--muted);
  font-size: 0.85rem;
  padding: 0.35rem 0;
}
.deal-msg {
  position: relative;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin: 0.9rem 0 0;
  padding: 0.6rem 0.8rem;
  border-radius: 14px 14px 14px 4px;
  background: var(--brand-soft);
  font-style: italic;
}
.deal-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.9rem;
}
.deal-actions .btn {
  flex: 1;
}
.deal-empty {
  text-align: center;
  padding: 1.6rem 1rem;
  color: var(--muted);
}
.deal-empty span {
  font-size: 2.2rem;
  display: block;
  margin-bottom: 0.3rem;
}

.trade-builder {
  display: grid;
  gap: 0.8rem;
}
.builder-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.3rem 0 0;
  font: 800 1.05rem/1 var(--display);
}
.builder-step span {
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font: 800 0.8rem/1 var(--body);
}
.team-pick {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.2rem 0.1rem 0.4rem;
  scroll-snap-type: x proximity;
}
.team-pick-btn {
  flex: none;
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  width: 5.6rem;
  padding: 0.6rem 0.4rem;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: inherit;
  font: 600 0.78rem/1.15 var(--body);
  text-align: center;
  cursor: pointer;
  scroll-snap-align: start;
  transition:
    border-color 0.2s,
    transform 0.2s;
}
.team-pick-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.team-pick-btn[aria-checked="true"] {
  border-color: var(--brand);
  background: var(--brand-soft);
  transform: translateY(-2px);
}
.deal.preview {
  padding: 0.9rem;
  border-radius: var(--radius);
  background: var(--bg);
  animation: none;
  overflow: visible;
}
.deal.preview::before {
  display: none;
}
.deal.preview .deal-player {
  background: var(--surface);
  animation: pop 0.25s ease;
}
.deal-checks {
  list-style: none;
  margin: 0.7rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.25rem;
  font-size: 0.8rem;
}
.deal-checks .ok {
  color: var(--win);
  font-weight: 700;
}
.deal-checks .ko {
  color: var(--accent-ink);
}
.center {
  text-align: center;
}
.ptiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.6rem, 1fr));
  gap: 0.5rem;
}
.ptile {
  position: relative;
  display: grid;
  justify-items: start;
  gap: 0.15rem;
  padding: 0.6rem;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s,
    transform 0.15s;
}
.ptile strong {
  font-size: 0.86rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ptile small {
  color: var(--muted);
  font-size: 0.72rem;
}
.ptile-stats {
  font-size: 0.74rem;
  color: var(--muted);
}
.ptile-stats b {
  color: var(--ink);
  font-size: 0.85rem;
}
.ptile:active {
  transform: scale(0.97);
}
.ptile.on {
  border-color: var(--brand);
  background: var(--brand-soft);
  animation: pop 0.25s ease;
}
.ptile-check {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  display: grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  border: 2px solid var(--line);
  color: transparent;
  font-size: 0.75rem;
  font-weight: 900;
}
.ptile.on .ptile-check {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
@keyframes pop {
  50% {
    transform: scale(1.04);
  }
}
.money-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
  font-weight: 700;
  font-size: 0.9rem;
}
.stepper {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.stepper button {
  min-width: 2.2rem;
  height: 2.2rem;
  border: 0;
  border-radius: 10px;
  background: var(--surface-2);
  color: inherit;
  font: 800 1.1rem/1 var(--body);
  cursor: pointer;
}
.stepper button.step5 {
  font-size: 0.8rem;
  padding: 0 0.5rem;
}
.stepper button:disabled {
  opacity: 0.4;
  cursor: default;
}
.stepper output {
  min-width: 3.6rem;
  text-align: center;
  font: 800 1.1rem/1 var(--display);
}
@media (prefers-reduced-motion: reduce) {
  .deal,
  .deal.wait .deal-swap,
  .ptile.on,
  .deal.preview .deal-player {
    animation: none;
  }
}

/* Transferts : joueurs libres (consultation) */
.free-agents .pos-filter {
  margin-bottom: 0.4rem;
}
.free-side {
  display: grid;
  justify-items: end;
  gap: 0.15rem;
}
.free-side small {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.75rem;
}
#free-more {
  margin-top: 0.6rem;
}
.trade-segs > button {
  padding-inline: 0.15rem;
  font-size: 0.8rem;
  text-overflow: clip;
}
.trade-segs .seg-count {
  margin-left: 0.1rem;
  min-width: 1.05rem;
  height: 1.05rem;
  font-size: 0.66rem;
}
#free-more[hidden] {
  display: none;
}

/* Fil d’actu de la ligue dans la discussion */
.msg.actu {
  display: block;
  padding: 0.35rem 0;
}
.actu-card {
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border-left: 3px solid var(--accent);
  font-size: 0.88rem;
}
.actu-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.actu-head strong {
  flex: 1;
  font: 800 0.98rem/1.1 var(--display);
}
.actu-emoji {
  font-size: 1.05rem;
}
.actu-body p {
  margin: 0.35rem 0 0;
}
.actu-body .avatar {
  vertical-align: middle;
}
.actu-buys {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.3rem;
}
.actu-money {
  display: inline-block;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffd66b, #f5a623);
  color: #5a3a00;
  font-weight: 800;
  font-size: 0.78rem;
}

/* Badges des joueurs */
.ubadge {
  display: inline-grid;
  place-items: center;
  height: 1.1rem;
  min-width: 1.1rem;
  margin-left: 0.25rem;
  padding: 0 0.3rem;
  border-radius: 6px;
  font: 900 0.62rem/1 var(--body);
  letter-spacing: 0.04em;
  vertical-align: middle;
}
.ubadge-og {
  background: linear-gradient(135deg, #1f2937, #4b5563);
  color: #fcd34d;
  box-shadow: inset 0 0 0 1px #fcd34d;
}
.ubadge-lancement {
  background: linear-gradient(135deg, #7c3aed, #ec4899);
  color: #fff;
  font-size: 0.7rem;
}
.my-badges {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.my-badge {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.8rem 0.5rem 0.55rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.my-badge .ubadge {
  height: 1.8rem;
  min-width: 1.8rem;
  margin: 0;
  font-size: 0.85rem;
  border-radius: 9px;
}
.my-badge > span:last-child {
  display: grid;
}
.my-badge small {
  color: var(--muted);
  font-size: 0.75rem;
}

/* Concours : carte d’accueil, podium, classement inter-ligues */
.contest-card {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.9rem;
  color: inherit;
  text-decoration: none;
  background: linear-gradient(135deg, #fff4d6, var(--surface));
  border: 1px solid #f5c451;
}
.contest-trophy {
  font-size: 1.8rem;
}
.contest-trophy.big {
  font-size: 3rem;
  display: block;
  text-align: center;
  animation: pop 0.5s ease;
}
.contest-head {
  text-align: center;
}
.contest-mine {
  display: grid;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
}
.contest-me {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.contest-me .muted {
  color: rgb(255 255 255 / 0.8);
}
.contest-me-rank {
  font: 900 2.2rem/1 var(--display);
}
.contest-podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 0.5rem;
  margin: 1rem 0;
}
.podium-step {
  display: grid;
  justify-items: center;
  gap: 0.25rem;
  padding: 0.7rem 0.4rem;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
  font-size: 0.8rem;
  min-width: 0;
}
.podium-step strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.85rem;
}
.podium-step b {
  font-size: 1.6rem;
}
.podium-step.p1 {
  padding-top: 1.4rem;
  background: linear-gradient(180deg, #fff4d6, var(--surface));
}
.podium-step.p2 {
  padding-top: 0.9rem;
}
.contest-rank {
  flex: none;
  width: 1.8rem;
  text-align: center;
  font: 800 1rem/1 var(--display);
  color: var(--muted);
}
.contest-row.me {
  background: var(--brand-soft);
  border-radius: var(--radius-sm);
}
.contest-score {
  display: grid;
  justify-items: end;
}
.contest-score b {
  font: 800 1.05rem/1 var(--display);
}
.contest-score small {
  color: var(--muted);
  font-size: 0.7rem;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .contest-card,
  :root:not([data-theme="light"]) .podium-step.p1 {
    background: linear-gradient(135deg, #3a2e0c, var(--surface));
  }
}
:root[data-theme="dark"] .contest-card,
:root[data-theme="dark"] .podium-step.p1 {
  background: linear-gradient(135deg, #3a2e0c, var(--surface));
}
.referral-card {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1rem;
}
.referral-card .ubadge {
  height: 2rem;
  min-width: 2rem;
  margin: 0;
  font-size: 1rem;
  border-radius: 10px;
}
.referral-dots {
  display: flex;
  gap: 0.25rem;
}
.referral-dots i {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--line);
}
.referral-dots i.on {
  background: var(--win);
}
.ubadge-champion {
  background: linear-gradient(135deg, #f59e0b, #fcd34d);
  color: #5a3a00;
  font-size: 0.7rem;
}
.ubadge-parrain {
  background: linear-gradient(135deg, #0ea5e9, #22c55e);
  color: #fff;
  font-size: 0.7rem;
}

/* Inscription au concours : règles claires puis formulaire */
.contest-card.invite {
  background: linear-gradient(135deg, #e8f0ff, var(--surface));
  border-color: var(--brand);
}
.contest-join {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 1rem;
  color: inherit;
  text-decoration: none;
}
.contest-join.done {
  border: 1px solid var(--brand);
}
.contest-join-title {
  margin: 0;
  font: 800 1.15rem/1.2 var(--display);
}
.contest-rules {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.9rem;
  line-height: 1.4;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .contest-card.invite {
    background: linear-gradient(135deg, #142347, var(--surface));
  }
}
:root[data-theme="dark"] .contest-card.invite {
  background: linear-gradient(135deg, #142347, var(--surface));
}

/* Publicités : emplacement discret, toujours marqué « Publicité » */
.ad {
  display: grid;
  justify-items: center;
  gap: 0.25rem;
  margin: 1rem 0;
}
.ad-label {
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.ad-box {
  display: grid;
  place-items: center;
  min-height: 50px;
  max-width: 100%;
  overflow: hidden;
}
.ad-carre .ad-box {
  min-height: 250px;
}
/* Démo : emplacements factices */
.ad-box:not(:has(iframe)):not(:empty) {
  width: min(320px, 100%);
  border: 1px dashed var(--line, #8884);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.8rem;
}
.ad-carre .ad-box:not(:has(iframe)):not(:empty) {
  width: min(300px, 100%);
}
.ad-row {
  list-style: none;
  padding: 0;
}

/* Bannière collante : en bas de l’écran, au-dessus des onglets quand il y en a */
.ad-anchor {
  position: fixed;
  z-index: 9;
  left: 0;
  right: 0;
  bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.ad-anchor[hidden] {
  display: none;
}
.anchor-tabbar .ad-anchor {
  bottom: calc(var(--tabbar-h) + 1.1rem + env(safe-area-inset-bottom, 0px));
}
.ad-anchor .ad {
  margin: 0;
  padding: 0.2rem 0.4rem 0.3rem;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  pointer-events: auto;
}
.has-anchor .page {
  padding-bottom: calc(3rem + 72px + env(safe-area-inset-bottom, 0px));
}
.has-anchor .page.with-tabbar {
  padding-bottom: calc(var(--tabbar-h) + 6rem + 72px + env(safe-area-inset-bottom, 0px));
}
.anchor-tabbar .chat-bubble {
  bottom: calc(5.4rem + 72px + env(safe-area-inset-bottom, 0px));
}
.has-anchor:not(.anchor-tabbar) .chat-bubble.no-tabbar {
  bottom: calc(1rem + 72px + env(safe-area-inset-bottom, 0px));
}

/* Démo : interstitiel factice */
.ad-interstitial {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgb(0 0 0 / 0.75);
}
.ad-interstitial-box {
  display: grid;
  justify-items: center;
  gap: 0.6rem;
  width: min(100%, 22rem);
  padding: 1rem;
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}
.ad-interstitial-box .ad-box {
  width: 100%;
  min-height: 50vh;
  border: 1px dashed var(--line, #8884);
  border-radius: var(--radius-sm);
  color: var(--muted);
}

/* Signalement : motifs en liste, comme un menu iPhone */
.report-sheet .sheet-name {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.report-reasons {
  display: grid;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-2, var(--bg));
}
.report-reason {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid var(--line, #8882);
  cursor: pointer;
}
.report-reason:last-child {
  border-bottom: 0;
}
.report-reason:has(input:checked) {
  font-weight: 600;
  color: var(--brand);
}

/* Page Modération */
.mod-list {
  display: grid;
  gap: 0.7rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.mod-card {
  display: grid;
  gap: 0.4rem;
}
.mod-card.done {
  opacity: 0.65;
}
.mod-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.mod-card .report-excerpt {
  margin: 0;
  padding: 0.5rem 0.7rem;
  border-left: 3px solid var(--danger, #e5484d);
  border-radius: 4px;
  background: var(--surface-2, var(--bg));
}
.mod-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.btn.danger {
  color: var(--danger, #e5484d);
}
.pill.warn {
  color: var(--danger, #e5484d);
}
.mod-link {
  margin-bottom: 1rem;
}
.report-league {
  width: 100%;
  border: 0;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

/* ===== Discussion façon messagerie de téléphone (iMessage / Instagram) ===== */
.chat-list {
  gap: 0;
  padding: 0.6rem 0.7rem 0.3rem;
  scroll-behavior: smooth;
}
.chat .msg {
  gap: 0.4rem;
  align-items: flex-end;
  padding-top: 2px;
  touch-action: pan-y;
}
.chat .msg.first {
  padding-top: 0.55rem;
}
.chat .msg.me {
  justify-content: flex-end;
}
.chat .msg-avatar {
  width: 1.7rem;
  align-self: flex-end;
}
.msg-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 78%;
  min-width: 0;
}
.msg.me .msg-col {
  align-items: flex-end;
}
.msg-name {
  margin: 0 0 0.15rem 0.7rem;
  font-size: 0.72rem;
  color: var(--muted);
}
.bubble {
  position: relative;
  padding: 0.5rem 0.8rem;
  border-radius: 1.15rem;
  background: var(--surface-2);
  color: var(--ink, inherit);
  line-height: 1.35;
  transition: transform 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  cursor: default;
}
.bubble p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.msg.them:not(.last) .bubble {
  border-bottom-left-radius: 0.35rem;
}
.msg.them:not(.first) .bubble {
  border-top-left-radius: 0.35rem;
}
.msg.me .bubble {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
}
.msg.me .bubble .mention {
  color: #fff;
  text-decoration: underline;
}
.msg.me:not(.last) .bubble {
  border-bottom-right-radius: 0.35rem;
}
.msg.me:not(.first) .bubble {
  border-top-right-radius: 0.35rem;
}
.bubble:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.bubble.flash {
  animation: flash 1.2s ease;
}
@keyframes flash {
  30% {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 40%, transparent);
  }
}
.bubble.hearted::after {
  content: "❤️";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  animation: heart 0.7s ease forwards;
  pointer-events: none;
}
@keyframes heart {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }
  40% {
    transform: scale(1.2);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0;
  }
}
.msg.swiping .bubble::before {
  content: "↩";
  position: absolute;
  left: -1.6rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}
.msg-quote {
  display: grid;
  max-width: 100%;
  margin-bottom: -0.35rem;
  padding: 0.35rem 0.75rem 0.6rem;
  border: 0;
  border-radius: 0.9rem 0.9rem 0.3rem 0.3rem;
  background: color-mix(in srgb, var(--surface-2) 60%, transparent);
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  text-align: left;
  opacity: 0.85;
  cursor: pointer;
}
.msg-quote span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.msg-quote.gone {
  font-style: italic;
}
.reacts {
  display: flex;
  gap: 0.2rem;
  margin: -0.35rem 0.4rem 0;
  position: relative;
  z-index: 1;
}
.react {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.05rem 0.4rem;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 0.8rem;
  line-height: 1.4;
}
.react span {
  font-size: 0.7rem;
  color: var(--muted);
}
.react.mine {
  background: color-mix(in srgb, var(--brand) 22%, var(--surface));
}
.msg-time {
  margin: 0.15rem 0.5rem 0;
  font-size: 0.68rem;
  color: var(--muted);
}
.day-sep {
  display: flex;
  justify-content: center;
  margin: 0.8rem 0 0.2rem;
  font-size: 0.72rem;
  color: var(--muted);
}
.day-sep span::first-letter {
  text-transform: uppercase;
}
.msg-hidden {
  display: flex;
  justify-content: center;
  padding: 0.3rem 0;
}
.msg-hidden button {
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
}
.msg.pending .bubble {
  opacity: 0.6;
}

/* « … écrit » */
.typing {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0 1rem 0.3rem;
  font-size: 0.75rem;
  color: var(--muted);
}
.typing[hidden] {
  display: none;
}
.typing-dots {
  display: inline-flex;
  gap: 3px;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  background: var(--surface-2);
}
.typing-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: dot 1.2s infinite ease-in-out;
}
.typing-dots i:nth-child(2) {
  animation-delay: 0.15s;
}
.typing-dots i:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes dot {
  0%,
  60%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

/* Réponse en cours, émojis rapides */
.reply-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0.7rem;
  padding: 0.45rem 0.7rem;
  border-left: 3px solid var(--brand);
  border-radius: 0.6rem;
  background: var(--surface-2);
  font-size: 0.8rem;
}
.reply-bar[hidden],
.quick-emojis[hidden] {
  display: none;
}
.reply-bar-text {
  display: grid;
  flex: 1;
  min-width: 0;
}
.reply-bar-text span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}
.reply-cancel {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
}
.quick-emojis {
  display: flex;
  justify-content: space-around;
  padding: 0.3rem 0.5rem;
}
.quick-emojis button {
  border: 0;
  background: none;
  font-size: 1.4rem;
  cursor: pointer;
}

/* Barre d’écriture : champ en pilule, bouton d’envoi rond (flèche vers le haut) */
.chat .chat-form {
  align-items: flex-end;
  gap: 0.4rem;
  padding: 0.5rem 0.6rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
  border-top: 0;
  background: transparent;
}
.chat .chat-form textarea {
  min-height: 2.3rem;
  max-height: 8.75rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  background: var(--surface);
  line-height: 1.3;
}
.chat-tool {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  border: 0;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
}
.chat-tool svg,
.chat .send-btn svg {
  width: 1.15rem;
  height: 1.15rem;
}
.chat .send-btn {
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  border: 0;
  background: var(--brand);
  transition:
    transform 0.15s ease,
    opacity 0.15s ease;
  cursor: pointer;
}
.chat .send-btn svg {
  stroke-width: 2.6;
}
.chat .send-btn:disabled {
  opacity: 0.35;
  transform: scale(0.9);
}
.chat .send-btn:not(:disabled):active {
  transform: scale(0.9);
}

/* Menu au doigt appuyé : fond flouté, réactions, actions groupées (comme sur iPhone) */
.ctx {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.ctx-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 0.25);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: fade 0.18s ease;
}
.ctx-sheet {
  position: relative;
  display: grid;
  gap: 0.5rem;
  justify-items: start;
  width: min(100%, 20rem);
  animation: pop-in 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.ctx-sheet.me {
  justify-items: end;
}
@keyframes pop-in {
  from {
    transform: scale(0.92);
    opacity: 0;
  }
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
.ctx-emojis {
  display: flex;
  gap: 0.15rem;
  padding: 0.3rem 0.4rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: 0 8px 30px rgb(0 0 0 / 0.18);
}
.ctx-emojis button {
  border: 0;
  border-radius: 50%;
  background: none;
  width: 2.3rem;
  height: 2.3rem;
  font-size: 1.45rem;
  cursor: pointer;
  transition: transform 0.12s ease;
}
.ctx-emojis button:hover,
.ctx-emojis button:focus-visible {
  transform: scale(1.25);
}
.ctx-preview {
  max-width: 100%;
  padding: 0.55rem 0.85rem;
  border-radius: 1.15rem;
  background: var(--surface);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 30vh;
  overflow: auto;
}
.ctx-preview.me {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
}
.ctx-actions {
  display: grid;
  width: 15rem;
  border-radius: 0.9rem;
  overflow: hidden;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: 0 8px 30px rgb(0 0 0 / 0.18);
}
.ctx-actions button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: inherit;
  font: inherit;
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
}
.ctx-actions button:last-child {
  border-bottom: 0;
}
.ctx-actions button:active {
  background: var(--surface-2);
}
.ctx-actions button svg {
  width: 1.1rem;
  height: 1.1rem;
}
.ctx-actions .danger {
  color: var(--danger, #e5484d);
}
@media (prefers-reduced-motion: reduce) {
  .ctx-sheet,
  .ctx-backdrop,
  .bubble.hearted::after,
  .typing-dots i {
    animation: none;
  }
}

/* Installer l’appli */
.install-card {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 14%, var(--surface)), var(--surface));
  border: 1px solid color-mix(in srgb, var(--brand) 35%, transparent);
}
.install-card .row-main {
  display: grid;
}
.install-card.compact {
  padding-block: 0.6rem;
}
.install-icon {
  flex: none;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 22%;
  box-shadow: 0 4px 14px rgb(0 0 0 / 0.18);
}
.install-icon.big {
  display: block;
  width: 4.5rem;
  height: 4.5rem;
  margin: 0 auto 0.3rem;
}
.install-btn {
  flex: none;
  border-radius: 999px;
}
.install-card.compact .install-icon {
  width: 2.6rem;
  height: 2.6rem;
}
.install-hide {
  flex: none;
  align-self: flex-start;
  color: var(--muted);
}
.install-card:not(.compact) {
  flex-wrap: wrap;
}
.install-card:not(.compact) .row-main {
  flex: 1;
  min-width: 12rem;
}
.install-card:not(.compact) .install-btn {
  width: 100%;
  justify-content: center;
}
.install-sheet {
  text-align: left;
}
.install-sheet .sheet-name {
  text-align: center;
}
.install-steps {
  display: grid;
  gap: 0.8rem;
  margin: 0.5rem 0;
  padding: 0;
  list-style: none;
}
.install-steps li {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  line-height: 1.5;
}
.install-num {
  flex: none;
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
}
.install-glyph {
  display: inline-grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  margin: 0 0.1rem;
  vertical-align: -0.45rem;
  border-radius: 0.4rem;
  background: var(--surface-2);
  color: #0a84ff;
}
.install-glyph svg {
  width: 1.1rem;
  height: 1.1rem;
}

/* Règles : résumé « En bref » en tête de chaque partie */
.rule-summary {
  margin: 0 0 0.8rem;
  padding: 0.6rem 0.8rem;
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
  line-height: 1.45;
}

/* Partager le match en image (story) */
.sb-share {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0.7rem auto 0;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.16);
  color: #fff;
  border: 1px solid rgb(255 255 255 / 0.3);
}

/* ---------- Cartes en relief : inclinaison et reflet sous le doigt (web/js/relief.js) ---------- */
.pcard {
  --rx: 0deg;
  --ry: 0deg;
  --gx: 50%;
  --gy: 30%;
}
/* Doublé pour passer devant le petit saut au survol du terrain (.slot-btn:hover .token). */
.pcard.pcard.tilting {
  transform: perspective(560px) rotateX(var(--rx)) rotateY(var(--ry)) scale(1.04);
  transition: transform 0.08s linear;
  z-index: 2;
}
.token.pcard,
.sheet-head.pcard {
  transition:
    transform 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.35),
    box-shadow 0.3s;
}
.pcard.tilting.token {
  box-shadow: 0 14px 26px rgb(0 0 0 / 0.3);
}
.pcard-glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(
    circle at var(--gx) var(--gy),
    rgb(255 255 255 / 0.6),
    rgb(255 255 255 / 0) 50%
  );
  mix-blend-mode: soft-light;
  opacity: 0;
  transition: opacity 0.25s;
  z-index: 3;
}
.pcard.tilting > .pcard-glare {
  opacity: 1;
}
/* Or et légende : un voile holographique qui suit l’angle. */
.pcard.rar-gold.tilting > .pcard-glare,
.pcard.rar-legend.tilting > .pcard-glare {
  background:
    radial-gradient(circle at var(--gx) var(--gy), rgb(255 255 255 / 0.5), rgb(255 255 255 / 0) 45%),
    linear-gradient(
      115deg,
      transparent 20%,
      rgb(255 190 60 / 0.55) calc(var(--gx) - 10%),
      rgb(120 200 255 / 0.45) var(--gx),
      rgb(255 120 210 / 0.4) calc(var(--gx) + 10%),
      transparent 85%
    );
  mix-blend-mode: soft-light;
}

/* Paquet des recrues : étincelles des cartes or */
.pack-spark {
  position: absolute;
  left: 50%;
  top: 45%;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 4;
  animation: pack-spark 0.9s ease-out forwards;
}
@keyframes pack-spark {
  from {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  to {
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(200deg) scale(0.4);
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .pcard.tilting {
    transform: none;
  }
  .pack-spark {
    display: none;
  }
}

/* ---------- Écusson de ligue (web/js/ecusson.js) ---------- */
.avatar.crest {
  background: none;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  filter: drop-shadow(0 3px 6px rgb(30 10 90 / 0.25));
}
.avatar.crest .crest-svg {
  width: 100%;
  height: 100%;
  display: block;
}
.avatar.crest.lg {
  width: 3.5rem;
  height: 3.5rem;
}
.avatar.crest.xl {
  width: 6.5rem;
  height: 6.5rem;
  filter: drop-shadow(0 10px 18px rgb(30 10 90 / 0.3));
}
.crest-field {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  min-width: 0;
}
.crest-field legend {
  padding: 0;
  margin-bottom: 8px;
  font-weight: 600;
}
.crest-picker {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.crest-preview {
  display: grid;
  place-items: center;
  padding-top: 4px;
}
.crest-controls {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.crest-letters {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}
.crest-letters input {
  width: 5.5em;
  font: 800 1.1rem/1 var(--display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.crest-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.crest-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 4px 9px;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink);
  font: 600 0.78rem/1 var(--body);
  cursor: pointer;
}
.crest-chip span {
  display: none;
}
.crest-chip svg {
  width: 20px;
  height: 20px;
}
.crest-chip.swatch {
  width: 30px;
  min-height: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  border-color: transparent;
}
.crest-chip[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent);
}
.crest-ring {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 3px solid;
}
.crest-edit {
  padding: 14px;
}
@media (max-width: 360px) {
  .crest-picker {
    grid-template-columns: 1fr;
    justify-items: center;
  }
}
