/* ==========================================================================
   Fantasy Pad — PISTE 3 « Six Signatures »
   Parti pris : chaque pronostiqueur a SA couleur, reprise partout — carte du
   classement, en-tête de colonne, séparateur de bloc — pour qu'on puisse
   suivre une seule personne à travers 30 lignes de chiffres.
   Registre clair, arrondi, aéré. Aucune transition, aucune animation.
   ========================================================================== */

:root {
  color-scheme: light dark;

  --bg:      #faf7f4;
  --panel:   #ffffff;
  --panel-2: #f2eeea;
  --panel-3: #e7e1db;
  --text:    #1e1b18;
  --muted:   #6e675f;
  --line:    #e2dcd5;
  --line-2:  #cec6bd;

  /* Données : direction sémantique, volontairement désaturée. */
  --up:   #b04a3d;       /* surestimé */
  --dn:   #33688f;       /* sous-estimé */
  --eq:   #3d7a55;       /* pile */
  --warn: #9a6f14;

  /* Les six signatures : même clarté, même chroma, six teintes. */
  --s1: oklch(.60 .13  28);
  --s2: oklch(.60 .13  72);
  --s3: oklch(.60 .13 148);
  --s4: oklch(.60 .13 205);
  --s5: oklch(.60 .13 268);
  --s6: oklch(.60 .13 330);

  --radius: 16px;
  --radius-s: 10px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:      #17150f;
    --panel:   #201d18;
    --panel-2: #2a2620;
    --panel-3: #35302a;
    --text:    #f3efe9;
    --muted:   #a49b90;
    --line:    #322d27;
    --line-2:  #4a443c;
    --up:   #e08a7d;
    --dn:   #7fb3d8;
    --eq:   #7cbd94;
    --warn: #d7b158;
    --s1: oklch(.72 .12  28);
    --s2: oklch(.72 .12  72);
    --s3: oklch(.72 .12 148);
    --s4: oklch(.72 .12 205);
    --s5: oklch(.72 .12 268);
    --s6: oklch(.72 .12 330);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--sans);
  -webkit-text-size-adjust: 100%;
  text-wrap: pretty;
}

/* ------------------------------------------------------------------ header */
/* Identité : le mot-symbole, et les six signatures en bande sous le titre. */
header {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 1.5rem 1rem 1.2rem;
}
header h1 {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; gap: .6rem;
  font: 800 clamp(1.35rem, 4.6vw, 1.8rem)/1.1 var(--sans);
  letter-spacing: -.02em;
}
header h1 .mark { flex: none; display: inline-flex; color: var(--s5); }
header h1 .mark svg { width: 1.35em; height: 1.35em; }
header h1 .season {
  margin-left: auto; align-self: center;
  font: 700 .58em/1 var(--sans);
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted);
  background: var(--panel-2);
  border-radius: 99px;
  padding: .45em .8em;
}
.status { max-width: 1200px; margin: .5rem auto 0; color: var(--muted); font-size: .9rem; }

main { max-width: 1200px; margin: 0 auto; padding: 1.2rem 1rem 2.5rem; }
#app { padding-bottom: 8rem; }
section { margin: 2.6rem 0; }

h2 {
  display: flex; align-items: center; gap: .6rem;
  margin: 0 0 1rem;
  font: 800 clamp(1.05rem, 3.4vw, 1.25rem)/1.2 var(--sans);
  letter-spacing: -.01em;
}

footer { text-align: center; padding: 2rem 1rem 5rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.ok { color: var(--eq); }
.ko { color: var(--up); }
.center { text-align: center; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--panel-2); padding: .1em .4em; border-radius: 6px; }
a { color: var(--s5); }
a:hover { color: var(--text); }

/* -------------------------------------------------------- cartes classement */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 980px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .cards { grid-template-columns: 1fr; } }

/* Chaque carte porte sa signature : --sig est ensuite réutilisée partout. */
.cards .card:nth-child(1) { --sig: var(--s1); }
.cards .card:nth-child(2) { --sig: var(--s2); }
.cards .card:nth-child(3) { --sig: var(--s3); }
.cards .card:nth-child(4) { --sig: var(--s4); }
.cards .card:nth-child(5) { --sig: var(--s5); }
.cards .card:nth-child(6) { --sig: var(--s6); }

.card {
  --sig: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem 1.2rem;
  /* Bandeau de signature en haut de carte. */
  box-shadow: inset 0 4px 0 var(--sig);
}
.card.leader { border-color: var(--sig); background: color-mix(in oklab, var(--sig) 7%, var(--panel)); }

.card-head { display: flex; align-items: center; gap: .6rem; }
.card-head h3 {
  margin: 0; font: 700 1.05rem/1.2 var(--sans);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Rang : jeton rond dans la couleur du pronostiqueur. */
.medal {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.1rem; height: 2.1rem;
  border-radius: 50%;
  background: var(--sig);
  color: var(--panel);
  font: 800 .95rem/1 var(--sans);
  font-variant-numeric: tabular-nums;
}
.medal .pos { font: inherit; color: inherit; }
.medal.medal-wait { background: var(--panel-3); color: var(--muted); }

.score-total {
  margin: .8rem 0 .3rem;
  display: flex; align-items: baseline; flex-wrap: wrap; gap: .5rem;
  font: 800 clamp(2.3rem, 7vw, 2.9rem)/1 var(--sans);
  letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
}
.score-total small { font: 600 .78rem/1 var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

.gap {
  font: 700 .74rem/1 var(--sans);
  color: var(--muted);
  background: var(--panel-2);
  border-radius: 99px;
  padding: .3rem .55rem;
  font-variant-numeric: tabular-nums;
}
.gap-leader { background: var(--sig); color: var(--panel); letter-spacing: .04em; }

.score-bar { height: 6px; background: var(--panel-2); border-radius: 99px; overflow: hidden; margin: .5rem 0 .7rem; }
.score-bar div { height: 100%; border-radius: 99px; background: var(--sig); }

.score-sub { margin: 0; font-size: .86rem; color: var(--muted); }
.score-sub strong { color: var(--text); font-weight: 700; }
.score-wait {
  margin: 1rem 0 .3rem;
  font-size: .9rem; color: var(--muted);
  background: var(--panel-2);
  border-radius: var(--radius-s);
  padding: .6rem .8rem;
  text-align: center;
}

.card.center {
  text-align: center; padding: 2.6rem 1.4rem;
  box-shadow: none; border: 1px solid var(--line);
}
.card.center h2 { display: block; }
.with-icon::before {
  content: "";
  display: block; width: 2.6rem; height: 2.6rem; margin: 0 auto .7rem;
  border-radius: 50%;
  background: currentColor;
  -webkit-mask: var(--icon) center / 78% no-repeat;
          mask: var(--icon) center / 78% no-repeat;
}
.ok-icon { color: var(--eq); --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E"); }
.bad-icon { color: var(--up); --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7L7 17'/%3E%3C/svg%3E"); }

/* ---------------------------------------------------------------- tableaux */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { padding: .5rem .6rem; text-align: left; white-space: nowrap; }

thead th {
  background: var(--panel-2);
  font: 700 .7rem/1.3 var(--sans);
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted);
}
/* Les six colonnes de pronostiqueurs sont dans l'ordre des cartes : même
   couleur, donc on retrouve « sa » colonne sans lire les en-têtes.
   (Structure générée : th.p-head 2 à 7 = les 6 pronostiqueurs.) */
th.p-head:nth-child(2) { --sig: var(--s1); }
th.p-head:nth-child(3) { --sig: var(--s2); }
th.p-head:nth-child(4) { --sig: var(--s3); }
th.p-head:nth-child(5) { --sig: var(--s4); }
th.p-head:nth-child(6) { --sig: var(--s5); }
th.p-head:nth-child(7) { --sig: var(--s6); }
th.p-head {
  --sig: var(--muted);
  text-align: center;
  color: var(--text);
  text-transform: none; font-size: .84rem; letter-spacing: 0;
  box-shadow: inset 0 3px 0 var(--sig);
}
th.p-sub { text-align: center; font-size: .66rem; }
th.p-sub.th-team { text-align: left; }

/* Séparateur de bloc coloré : dans les DEUX tableaux, la 1re cellule du bloc
   d'un pronostiqueur porte .pgap — index 5,7,9… en live et 2,4,6… en
   pré-saison, d'où les deux séries. */
td.pgap:nth-child(5),  td.pgap:nth-child(2)  { --sig: var(--s1); }
td.pgap:nth-child(7),  td.pgap:nth-child(4)  { --sig: var(--s2); }
td.pgap:nth-child(9),  td.pgap:nth-child(6)  { --sig: var(--s3); }
td.pgap:nth-child(11), td.pgap:nth-child(8)  { --sig: var(--s4); }
td.pgap:nth-child(13), td.pgap:nth-child(10) { --sig: var(--s5); }
td.pgap:nth-child(15), td.pgap:nth-child(12) { --sig: var(--s6); }
th.pgap, td.pgap { border-left: 1px solid var(--line); }
td.pgap { box-shadow: inset 2px 0 0 color-mix(in oklab, var(--sig, var(--line-2)) 60%, transparent); }

tbody tr { border-top: 1px solid var(--line); }
tbody tr:hover { background: var(--panel-2); }
tr.sep td { border-bottom: 2px solid var(--line-2); }

/* Colonnes épinglées : fonds pleins, jamais translucides. */
th.th-rank, td.rank { position: sticky; left: 0; z-index: 2; width: 2.6rem; min-width: 2.6rem; }
th.th-team, td.fix  { position: sticky; left: 2.6rem; z-index: 2; }
th.th-team, td.fix  { border-right: 1px solid var(--line-2); }
thead th.th-rank, thead th.th-team { background: var(--panel-2); z-index: 3; }
tbody td.rank, tbody td.fix { background: var(--panel); }
tbody tr:hover td.rank, tbody tr:hover td.fix { background: var(--panel-2); }

td.rank { text-align: center; padding: .5rem .2rem; }
td.rank span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.7rem; height: 1.7rem;
  border-radius: 8px;
  font: 700 .84rem/1 var(--sans);
  font-variant-numeric: tabular-nums;
}
td.rank.z-po span { background: color-mix(in oklab, var(--eq) 18%, transparent); color: var(--eq); }
td.rank.z-pi span { background: color-mix(in oklab, var(--warn) 18%, transparent); color: var(--warn); }
td.rank.z-lo span { background: var(--panel-2); color: var(--muted); }

td.team { font-weight: 700; }
td.team .logo { vertical-align: -5px; margin-right: .5rem; }
td.team .tabbr { display: none; }
@media (max-width: 760px) {
  td.team .tname { display: none; }
  td.team .tabbr { display: inline; }
}
td.team.abbr { font-weight: 700; }
td.rec, td.num { font-variant-numeric: tabular-nums; }
td.rec { color: var(--muted); }
td.num { text-align: right; }

/* Écart = une petite BARRE sous le chiffre (longueur = ampleur, couleur =
   direction). Plus aucun aplat derrière les nombres. */
.delta {
  display: inline-flex; flex-direction: column; align-items: flex-end;
  min-width: 2.4em;
  font: 600 .74rem/1.15 var(--sans);
  font-variant-numeric: tabular-nums;
  margin-left: .2rem;
}
.delta::after { content: ""; display: block; height: 3px; border-radius: 2px; margin-top: 2px; background: currentColor; }
.delta.m1::after { width: 34%; }
.delta.m2::after { width: 66%; }
.delta.m3::after { width: 100%; }
.delta.eq { color: var(--eq); }
.delta.eq::after { width: 100%; height: 2px; opacity: .5; }
.delta.up { color: var(--up); }
.delta.dn { color: var(--dn); }

.legend { line-height: 2.2; }
.zchip {
  display: inline-block;
  font: 700 .72rem/1 var(--sans);
  border-radius: 99px; padding: .28rem .6rem;
}
.zchip.z-po { background: color-mix(in oklab, var(--eq) 18%, transparent); color: var(--eq); }
.zchip.z-pi { background: color-mix(in oklab, var(--warn) 18%, transparent); color: var(--warn); }
.zchip.z-lo { background: var(--panel-2); color: var(--muted); }

.rules ul, .howto ul {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem 1.2rem 2.6rem;
  margin: 0;
  font-size: .95rem;
  max-width: 68ch;
}
.rules li, .howto li { margin: .5rem 0; }
.rules li::marker, .howto li::marker { color: var(--s4); }

/* -------------------------------------------------------------- formulaire */
.confs { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem 1.8rem; }
@media (max-width: 900px) { .confs { grid-template-columns: 1fr; } }

.conf-sum {
  margin-left: auto;
  font: 700 .78rem/1 var(--sans);
  color: var(--text);
  background: var(--panel-2);
  border-radius: 99px;
  padding: .35rem .7rem;
  font-variant-numeric: tabular-nums;
}

.conf-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
/* Grandes lignes arrondies, confortables au pouce. */
.team-row {
  display: grid;
  grid-template-columns: 2.2rem auto 26px 1fr auto auto;
  grid-template-areas: "rank moves logo name stepper losses";
  align-items: center;
  gap: .5rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: .4rem .55rem;
}
.team-row:hover { border-color: var(--line-2); }
/* Erreur : la ligne devient une alerte lisible, sans crier. */
.team-row.invalid {
  border-color: var(--up);
  background: color-mix(in oklab, var(--up) 8%, var(--panel));
}
/* Séparateur playoffs / play-in : un vrai blanc, pas un pointillé. */
.team-row.sep { margin-bottom: .8rem; position: relative; }
.team-row.sep::after {
  content: "";
  position: absolute; left: 10%; right: 10%; bottom: -.6rem;
  border-bottom: 2px solid var(--line-2);
}

.rank-badge {
  grid-area: rank;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2rem; height: 1.9rem;
  border-radius: 8px;
  font: 700 .88rem/1 var(--sans);
  font-variant-numeric: tabular-nums;
}
.rank-badge.z-po { background: color-mix(in oklab, var(--eq) 18%, transparent); color: var(--eq); }
.rank-badge.z-pi { background: color-mix(in oklab, var(--warn) 18%, transparent); color: var(--warn); }
.rank-badge.z-lo { background: var(--panel-2); color: var(--muted); }

.moves { grid-area: moves; display: flex; gap: 3px; }
.moves button {
  width: 36px; min-height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0;                     /* ▲▼ remplacés par des chevrons SVG */
}
.moves button::before {
  content: "";
  width: 13px; height: 13px;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
          mask: var(--icon) center / contain no-repeat;
}
.moves button:first-child { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 15l7-7 7 7'/%3E%3C/svg%3E"); }
.moves button:last-child  { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 9l7 7 7-7'/%3E%3C/svg%3E"); }
.moves button:disabled { opacity: .3; cursor: default; }
.moves button:not(:disabled):hover { background: var(--s4); border-color: var(--s4); color: var(--panel); }

.team-row .logo { grid-area: logo; }
.team-row .team {
  grid-area: name; min-width: 0;
  font-size: .94rem; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.stepper { grid-area: stepper; display: flex; align-items: stretch; }
.stepper button {
  width: 36px; min-height: 36px;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line);
  cursor: pointer; font-size: 1.15rem; line-height: 1;
}
.stepper button:first-child { border-radius: 8px 0 0 8px; border-right: none; }
.stepper button:last-child { border-radius: 0 8px 8px 0; border-left: none; }
.stepper button:hover { background: var(--s4); border-color: var(--s4); color: var(--panel); }
.stepper input {
  width: 3.5rem; min-height: 36px;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line);
  font: 700 1.05rem/1 var(--sans);
  text-align: center;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield; appearance: textfield;
}
.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus-visible { outline: 2px solid var(--s4); outline-offset: 1px; }
.team-row.invalid .stepper input { border-color: var(--up); }

.losses {
  grid-area: losses;
  min-width: 3rem; text-align: right;
  color: var(--muted); font-size: .84rem;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------- mobile : la ligne
   Sous 470px la ligne se réorganise en deux étages : l'identité de l'équipe en
   haut, TOUTES les commandes en bas, sur une bande de 44px atteignable au
   pouce sans viser. Aucun changement de markup : seules les zones bougent. */
@media (max-width: 470px) {
  .team-row {
    grid-template-columns: 2.1rem 22px minmax(0, 1fr) auto;
    grid-template-areas:
      "rank logo  name    losses"
      "moves moves stepper stepper";
    row-gap: .45rem;
    padding: .5rem .55rem .55rem;
  }
  .team-row .team { font-size: .95rem; }
  .team-row .logo { width: 22px; height: 22px; }
  .losses { min-width: 0; font-size: .8rem; }
  /* Les deux flèches se partagent la moitié gauche, le stepper la moitié
     droite : deux zones larges, plus de micro-cibles côte à côte. */
  .moves { gap: .4rem; }
  .moves button { flex: 1; width: auto; min-height: 44px; }
  .stepper { justify-self: end; }
  .stepper button { width: 46px; min-height: 44px; font-size: 1.3rem; }
  .stepper input { width: 4rem; min-height: 44px; font-size: 1.15rem; }
  .rank-badge { height: 1.8rem; }
}

/* --------------------------------------------------- barre de validation */
/* Panneau flottant arrondi, détaché du bord : moins écrasant que la barre
   pleine largeur (~118px en mobile), et il laisse voir la dernière ligne. */
.submit-bar {
  position: fixed;
  left: .6rem; right: .6rem; bottom: .6rem;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  padding: .7rem .9rem;
  display: flex; flex-wrap: wrap; gap: .5rem 1.4rem;
  align-items: center; justify-content: space-between;
  max-width: 1200px; margin: 0 auto;
  z-index: 10;
}
.submit-status { display: flex; flex-direction: column; gap: .2rem; flex: 1 1 260px; max-width: 460px; }
.counter-line { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
#total-counter { font: 800 1.15rem/1 var(--sans); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
#total-counter.ok { color: var(--eq); }
#total-counter.ko { color: var(--up); }
#balance-hint { font-size: .82rem; font-variant-numeric: tabular-nums; }
.total-bar { height: 6px; background: var(--panel-2); border-radius: 99px; overflow: hidden; }
#total-bar-fill { height: 100%; width: 0; border-radius: 99px; background: var(--s4); }
#total-bar-fill.ok { background: var(--eq); }
#total-bar-fill.ko { background: var(--up); }
#check-msg { font-size: .82rem; }
.submit-actions { display: flex; gap: .45rem; flex-wrap: wrap; align-items: center; }

.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  min-height: 38px;
  border: 1px solid var(--line-2); border-radius: 99px;
  padding: .5rem 1rem;
  font: 700 .88rem/1 var(--sans);
  background: var(--panel-2); color: var(--text);
  cursor: pointer; text-decoration: none;
}
.btn.primary { background: var(--s5); border-color: var(--s5); color: #fff; }
.btn.primary:disabled { opacity: .35; cursor: default; }
.btn.primary:not(:disabled):hover { background: color-mix(in oklab, var(--s5) 85%, #000); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--panel-2); }
#btn-balance::before {
  content: "";
  width: 14px; height: 14px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 3v18M4 7h16M7 7l-3 6h6zM17 7l-3 6h6z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 3v18M4 7h16M7 7l-3 6h6zM17 7l-3 6h6z'/%3E%3C/svg%3E") center / contain no-repeat;
}

@media (max-width: 560px) {
  .submit-bar { left: .4rem; right: .4rem; bottom: .4rem; padding: .55rem .6rem; gap: .4rem .6rem; }
  .submit-status { flex: 1 1 100%; max-width: none; }
  .submit-actions { flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; }
  .btn { padding: .45rem .8rem; font-size: .82rem; }
  .btn.primary { margin-left: auto; }
}


/* ==========================================================================
   MOBILE — le site se consulte surtout au téléphone, et le formulaire s'y
   remplit en entier (une seule session, ~10 min). Tout ce bloc sert ça.
   ========================================================================== */
@media (max-width: 560px) {
  header { padding: 1.1rem .8rem .9rem; }
  /* Le titre passe sur deux lignes plutôt que de comprimer la pastille. */
  header h1 { flex-wrap: wrap; gap: .45rem; }
  header h1 .season { margin-left: 0; font-size: .62em; padding: .4em .7em; }
  .status { font-size: .84rem; }

  main { padding: .9rem .7rem 2rem; }
  section { margin: 1.9rem 0; }
  #app { padding-bottom: 9.5rem; }

  .card { padding: .9rem 1rem 1rem; }
  .score-total { font-size: 2.25rem; }
  .cards { gap: .7rem; }

  /* Tableaux : on gagne de la place sans descendre sous 13px de texte. */
  table { font-size: .86rem; }
  th, td { padding: .38rem .45rem; }
  th.th-rank, td.rank { width: 2.1rem; min-width: 2.1rem; }
  th.th-team, td.fix { left: 2.1rem; }
  td.team .logo { width: 18px; height: 18px; vertical-align: -4px; margin-right: .35rem; }
  td.rank span { min-width: 1.5rem; height: 1.5rem; font-size: .8rem; }
  /* Le défilement horizontal EST le geste de ces tableaux : le swipe se cale
     sur le bloc de chaque pronostiqueur, et une ombre portée sous la colonne
     épinglée dit qu'il y a du contenu qui passe dessous. */
  .table-wrap { scroll-snap-type: x proximity; overscroll-behavior-x: contain; }
  th.pgap, td.pgap { scroll-snap-align: start; }
  th.th-team, td.fix { box-shadow: 6px 0 8px -6px rgba(0, 0, 0, .3); }

  .legend { font-size: .82rem; line-height: 1.9; }
  .rules ul, .howto ul { padding: 1rem 1rem 1rem 1.9rem; font-size: .9rem; }
  .rules li, .howto li { margin: .4rem 0; }

  .confs { gap: 1.6rem; }
  h2 { margin-bottom: .7rem; }
  .conf-sum { padding: .3rem .6rem; }
}

/* Barre de validation en mobile : deux rangs serrés (~105px au lieu de ~160),
   le compteur reste l'élément le plus gros, le bouton d'envoi toujours à
   droite sous le pouce. */
@media (max-width: 560px) {
  .submit-bar { padding: .5rem .6rem .55rem; gap: .35rem .5rem; }
  #total-counter { font-size: 1.25rem; }
  #check-msg { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .submit-actions { gap: .35rem; padding-bottom: 2px; }
  .btn { min-height: 40px; padding: .45rem .75rem; font-size: .82rem; }
  .btn.primary { padding: .45rem .95rem; }
}

/* 360px : dernier cran, rien ne doit déborder. */
@media (max-width: 380px) {
  header h1 { font-size: 1.3rem; }
  .score-total { font-size: 2rem; }
  .team-row { grid-template-columns: 1.9rem 20px minmax(0, 1fr) auto; padding: .45rem .45rem .5rem; }
  .stepper button { width: 42px; }
  .stepper input { width: 3.6rem; }
  .btn { font-size: .8rem; padding: .45rem .65rem; }
}
