/* Le Vestiaire · le carnet de l'arbitre
   Coque marine (portefeuille de l'arbitre), pages de carnet à petits carreaux,
   notes au crayon, cartons vert et rouge. Aucun arrondi, filets à 1 px. */

@font-face { font-family: 'Big Shoulders Display'; src: url('/fonts/big-shoulders-display.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Kalam'; src: url('/fonts/kalam-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Kalam'; src: url('/fonts/kalam-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Barlow'; src: url('/fonts/barlow-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Barlow'; src: url('/fonts/barlow-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Barlow'; src: url('/fonts/barlow-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  /* Coque */
  --marine-950: #0A1326;
  --marine-900: #0F1A31;
  --marine-800: #13203B;
  --marine-700: #1C2B4B;
  --marine-600: #2B3C62;
  --marine-300: #9AA8C5;
  --marine-100: #DCE2EE;

  /* Carnet */
  --papier: #E8E2D3;
  --papier-clair: #EFEADD;
  --papier-marge: #DAD2C0;
  --grille: rgb(58 92 150 / 0.16);
  --grille-forte: rgb(58 92 150 / 0.34);
  --mine: #23252A;
  --mine-douce: #535967;

  /* Accents */
  --orange: #E2601B;
  --orange-clair: #F58A4E;
  --orange-fonce: #A8420E;
  --vert: #258550;
  --vert-fonce: #1C6A3D;
  --rouge: #D7261E;
  --rouge-fonce: #A3170F;
  --jaune: #F2C230;

  --font-display: 'Big Shoulders Display', 'Arial Narrow', sans-serif;
  --font-main: 'Kalam', 'Comic Sans MS', cursive;
  --font-ui: 'Barlow', system-ui, -apple-system, sans-serif;

  /* Une seule face de chiffres (Kalam), cinq tailles fixes */
  --n1: 6rem;
  --n2: 3.5rem;
  --n3: 2.25rem;
  --n4: 1.625rem;
  --n5: 1.25rem;

  --page: 36rem;
  --gutter: 1rem;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-sheet: 0 10px 24px -8px rgb(3 8 20 / 0.55), 0 2px 4px rgb(3 8 20 / 0.35);
  --shadow-card: 0 14px 22px -10px rgb(3 8 20 / 0.6), 0 3px 6px rgb(3 8 20 / 0.3);

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--marine-600) var(--marine-900); }
body {
  min-height: 100dvh;
  background: var(--marine-800);
  color: var(--marine-100);
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.45;
  caret-color: var(--orange);
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}
::selection { background: var(--orange); color: var(--marine-950); }
img, svg { display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.skip { position: absolute; left: 0.5rem; top: -3rem; z-index: 50; background: var(--orange); color: var(--marine-950); padding: 0.6rem 1rem; font-weight: 700; }
.skip:focus { top: 0.5rem; }

/* ---------- En-tête ---------- */

.masthead { background: var(--marine-900); border-bottom: 1px solid var(--marine-600); position: sticky; top: 0; z-index: 20; padding-top: env(safe-area-inset-top); }
.masthead__top { max-width: var(--page); margin: 0 auto; padding: 0.75rem var(--gutter) 0.25rem; display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.brand { font-family: var(--font-display); font-weight: 900; font-size: 1.75rem; line-height: 1; letter-spacing: 0.02em; text-transform: uppercase; text-decoration: none; color: var(--papier-clair); }
.brand::after { content: '.'; color: var(--orange); }
.masthead__team { font-size: 0.8125rem; font-weight: 600; color: var(--marine-300); text-align: right; }
.masthead__top:has(.masthead__me:not([hidden])) .masthead__team { display: none; }
.masthead__me { display: block; align-self: center; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0.3rem 0.65rem; border: 1px solid var(--marine-600); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; text-decoration: none; color: var(--papier-clair); transition: border-color 0.2s; }
.masthead__me:hover { border-color: var(--marine-300); }
.tabs { max-width: var(--page); margin: 0 auto; display: flex; padding: 0 calc(var(--gutter) - 0.5rem); overflow-x: auto; scrollbar-width: none; }
.tabs a { flex: 1 0 auto; min-height: 2.75rem; display: flex; align-items: center; justify-content: center; padding: 0 0.5rem; text-decoration: none; text-transform: uppercase; font-weight: 700; font-size: 0.875rem; letter-spacing: 0.06em; color: var(--marine-300); border-bottom: 3px solid transparent; transition: color 0.2s, border-color 0.2s; }
.tabs a:hover { color: var(--papier-clair); }
.tabs a[aria-current='page'] { color: var(--papier-clair); border-bottom-color: var(--orange); }

@media (max-width: 380px) {
  .masthead__team { display: none; }
  .tabs a { font-size: 0.8125rem; letter-spacing: 0.03em; }
}

/* ---------- Mise en page ---------- */

.view { display: block; max-width: var(--page); margin: 0 auto; padding: 1.25rem var(--gutter) 3rem; outline: none; }
.view[aria-busy='true'] { opacity: 0.6; transition: opacity 0.2s 0.15s; }
.stack > * + * { margin-top: 1.5rem; }
.section-title { font-family: var(--font-display); font-weight: 800; font-size: 1.75rem; line-height: 1.05; text-transform: uppercase; letter-spacing: 0.01em; color: var(--papier-clair); margin: 2.25rem 0 0.75rem; }
.section-title:first-child { margin-top: 0; }
.muted { color: var(--marine-300); }

/* ---------- La page de carnet ---------- */

.sheet {
  position: relative;
  color: var(--mine);
  background-color: var(--papier);
  background-image:
    linear-gradient(var(--grille) 1px, transparent 1px),
    linear-gradient(90deg, var(--grille) 1px, transparent 1px);
  background-size: 1rem 1rem;
  background-position: -1px -1px;
  padding: 2rem 1rem 1.25rem;
  box-shadow: var(--shadow-sheet);
}
/* Reliure à spirale en haut de la page */
.sheet::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 1.25rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='20'%3E%3Ccircle cx='9' cy='11' r='4.5' fill='%2313203B'/%3E%3C/svg%3E") 0.4rem 0 / 1.125rem 1.25rem repeat-x;
  border-bottom: 1px solid var(--grille-forte);
}
.sheet + .sheet { margin-top: 1.25rem; }
.sheet a:not(.btn) { color: var(--marine-800); }

.sheet__title { font-family: var(--font-display); font-weight: 900; font-size: clamp(2.25rem, 9vw, 3rem); line-height: 0.95; text-transform: uppercase; letter-spacing: 0.005em; color: var(--marine-800); text-wrap: balance; }
.sheet__meta { margin-top: 0.5rem; font-size: 0.9375rem; font-weight: 600; color: var(--mine-douce); }
.sheet__rule { border: 0; border-top: 2px solid var(--mine); margin: 1rem 0; }
.sheet p + p { margin-top: 0.5rem; }

/* Score au crayon entre deux noms d'équipe */
/* Tableau d'affichage : domicile à gauche, extérieur à droite, le score au crayon au centre */
.score { display: grid; grid-template-columns: 1fr auto 1fr; align-items: baseline; column-gap: 0.75rem; }
.score__team { font-family: var(--font-display); font-weight: 900; font-size: clamp(2.25rem, 10vw, 3.5rem); line-height: 0.9; text-transform: uppercase; color: var(--marine-800); overflow-wrap: anywhere; }
.score__team:last-child { text-align: right; }
.score__goals { font-family: var(--font-main); font-weight: 700; font-size: clamp(2.75rem, 12vw, var(--n2)); line-height: 0.9; color: var(--mine); white-space: nowrap; }
.score__vs { font-family: var(--font-main); font-weight: 700; font-size: var(--n3); color: var(--mine-douce); white-space: nowrap; }

.verdict { display: inline-block; margin-top: 0.75rem; font-weight: 700; font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.1em; padding: 0.2rem 0.5rem; border: 1px solid currentColor; }
.verdict--win { color: var(--vert-fonce); }
.verdict--loss { color: var(--rouge-fonce); }
.verdict--draw { color: var(--mine-douce); }

/* État du vote */
.vote-state { margin-top: 1.25rem; padding-top: 1rem; border-top: 2px solid var(--mine); }
.vote-state__line { font-size: 1.0625rem; font-weight: 600; }
.vote-state__line strong { font-weight: 700; color: var(--orange-fonce); text-transform: uppercase; letter-spacing: 0.04em; }

/* Participation : plein = a voté, hachuré = pas encore */
.turnout { display: grid; grid-template-columns: repeat(var(--count, 14), 1fr); gap: 3px; margin-top: 0.75rem; max-width: 22rem; }
.turnout__cell { aspect-ratio: 3 / 4; border: 1px solid var(--mine); background: repeating-linear-gradient(135deg, var(--mine) 0 1px, transparent 1px 4px); opacity: 0.55; }
.turnout__cell.is-done { background: var(--mine); opacity: 1; }
.turnout__label { margin-top: 0.4rem; font-family: var(--font-main); font-weight: 700; font-size: var(--n5); }

/* ---------- Boutons ---------- */

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 3rem; padding: 0.5rem 1.25rem; border: 0; border-radius: 0; text-decoration: none; font-family: var(--font-display); font-weight: 800; font-size: 1.375rem; line-height: 1; text-transform: uppercase; letter-spacing: 0.04em; transition: background-color 0.15s, transform 0.15s var(--ease-out), box-shadow 0.15s; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--orange); color: var(--marine-950); box-shadow: 0 6px 12px -6px rgb(3 8 20 / 0.55); }
.btn--primary:active { box-shadow: 0 2px 4px -2px rgb(3 8 20 / 0.55); }
.btn--primary:hover { background: var(--orange-clair); }
.btn--block { display: flex; width: 100%; min-height: 3.5rem; font-size: 1.5rem; margin-top: 1.25rem; }
.btn--ghost { background: transparent; color: inherit; border: 1px solid currentColor; font-size: 1.125rem; min-height: 2.75rem; }
.btn--ghost:hover { background: rgb(255 255 255 / 0.06); }
.sheet .btn--ghost:hover { background: rgb(19 32 59 / 0.06); }
.btn--small { font-family: var(--font-ui); font-weight: 700; font-size: 0.875rem; letter-spacing: 0.04em; min-height: 2.75rem; padding: 0.25rem 0.85rem; }
.btn[disabled], .btn[aria-disabled='true'] { background: transparent; color: var(--mine-douce); border: 1px dashed var(--mine-douce); box-shadow: none; cursor: not-allowed; }
.btn.is-busy { opacity: 0.7; pointer-events: none; }

.link { background: none; border: 0; padding: 0; text-decoration: underline; font-weight: 700; min-height: 2.75rem; }

/* ---------- Cartons ---------- */

.carton {
  --c: var(--vert);
  --c-fonce: var(--vert-fonce);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  aspect-ratio: 3 / 4;
  max-width: 9.5rem;
  padding: 0.75rem;
  color: #fff;
  background: var(--c);
  box-shadow: var(--shadow-card), inset 0 0 0 1px rgb(0 0 0 / 0.12);
  text-align: left;
}
.carton--rouge { --c: var(--rouge); --c-fonce: var(--rouge-fonce); }
.carton__label { font-weight: 700; font-size: 0.8125rem; line-height: 1.2; text-transform: uppercase; letter-spacing: 0.08em; }
.carton__name { font-family: var(--font-display); font-weight: 900; font-size: 2rem; line-height: 0.95; text-transform: uppercase; overflow-wrap: anywhere; }
.carton__name--empty { font-family: var(--font-main); font-weight: 700; font-size: var(--n3); opacity: 0.75; }
.carton__foot { font-family: var(--font-main); font-weight: 700; font-size: var(--n5); line-height: 1.1; }

.cartons { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; justify-items: center; }
.cartons .carton:nth-child(1) { transform: rotate(-4deg); }
.cartons .carton:nth-child(2) { transform: rotate(3.5deg); }

/* Révélation : les cartons sortent de la poche et sont brandis */
.cartons--reveal { padding: 0.5rem 0 1rem; }
.cartons--reveal .carton { max-width: 11rem; }
.cartons--reveal .carton__name { font-size: clamp(2rem, 9vw, 2.75rem); }
@media (prefers-reduced-motion: no-preference) {
  .cartons--reveal.is-playing .carton { animation: brandish 0.9s var(--ease-out) both; }
  .cartons--reveal.is-playing .carton:nth-child(2) { animation-name: brandish-r; animation-delay: 0.55s; }
}
@keyframes brandish {
  0% { transform: translateY(38%) rotate(0deg) scale(0.92); }
  70% { transform: translateY(-4%) rotate(-5deg) scale(1.02); }
  100% { transform: translateY(0) rotate(-4deg) scale(1); }
}
@keyframes brandish-r {
  0% { transform: translateY(38%) rotate(0deg) scale(0.92); }
  70% { transform: translateY(-4%) rotate(4.5deg) scale(1.02); }
  100% { transform: translateY(0) rotate(3.5deg) scale(1); }
}

/* Petit carton dans les tableaux (compte d'élections) */
.mini { display: inline-flex; align-items: center; gap: 0.2rem; font-family: var(--font-main); font-weight: 700; font-size: 1.0625rem; line-height: 1; }
.mini svg { width: 0.65rem; height: 0.9rem; }
.mini--zero { opacity: 0.35; }

/* ---------- Page de vote ---------- */

.intro { font-size: 1rem; color: var(--mine-douce); margin-top: 0.75rem; max-width: 34ch; }

.rates { margin-top: 1.25rem; }
.rate { padding: 0.6rem 0 0.4rem; border-bottom: 1px solid var(--grille-forte); }
.rate:first-of-type { border-top: 2px solid var(--mine); }
.rate__head { display: flex; align-items: center; gap: 0.75rem; }
.rate__head .rate__note { margin-left: auto; }
.rate__name { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; line-height: 1; text-transform: uppercase; color: var(--marine-800); }
.rate__note { font-family: var(--font-main); font-weight: 700; font-size: var(--n3); line-height: 0.9; color: var(--mine); min-width: 3ch; text-align: right; }
.rate__note.is-empty { color: var(--mine-douce); opacity: 0.6; }
.rate.is-set .rate__note { animation: pencil 0.25s var(--ease-out); }
@keyframes pencil { from { transform: translateY(-2px) rotate(-3deg); } }

/* Curseur : la barre remplie mesure exactement la note sur 10.
   Le toucher est géré par .range-wrap pour ne jamais noter en faisant défiler la page. */
.range-wrap { touch-action: pan-y; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.range-wrap .range { pointer-events: none; }
.range { --fill: 50%; -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 2.75rem; margin: 0.25rem 0 0; background: transparent; cursor: pointer; touch-action: pan-y; }
.range::-webkit-slider-runnable-track { height: 0.75rem; border: 1px solid var(--mine); background: linear-gradient(90deg, var(--mine) var(--fill), transparent var(--fill)), var(--papier-clair); }
.range::-moz-range-track { height: 0.75rem; border: 1px solid var(--mine); background: var(--papier-clair); }
.range::-moz-range-progress { height: 0.75rem; background: var(--mine); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 1.75rem; height: 2.25rem; margin-top: -0.8125rem; background: var(--orange); border: 2px solid var(--mine); border-radius: 0; box-shadow: 0 4px 8px -3px rgb(3 8 20 / 0.5); }
.range::-moz-range-thumb { width: 1.5rem; height: 2rem; background: var(--orange); border: 2px solid var(--mine); border-radius: 0; }
.range.is-empty::-webkit-slider-runnable-track { background: repeating-linear-gradient(135deg, var(--grille-forte) 0 1px, transparent 1px 5px), var(--papier-clair); }
.range.is-empty::-moz-range-progress { background: transparent; }
.range.is-empty::-webkit-slider-thumb { background: var(--papier-clair); border-style: dashed; }
.range.is-empty::-moz-range-thumb { background: var(--papier-clair); border-style: dashed; }
.range:focus-visible { outline: none; }
.range:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--orange); outline-offset: 3px; }
.range:focus-visible::-moz-range-thumb { outline: 2px solid var(--orange); outline-offset: 3px; }
.range__scale { display: flex; justify-content: space-between; font-size: 0.75rem; font-weight: 600; color: var(--mine-douce); padding: 0 0.1rem; }

.rate__comment-toggle { color: var(--marine-800); font-size: 0.875rem; padding: 0 0.25rem; text-decoration-color: var(--grille-forte); }
.rate__comment-toggle:hover { text-decoration-color: currentColor; }
.field { display: block; margin-top: 0.5rem; }
.field__input { display: block; width: 100%; border: 1px solid var(--mine); border-radius: 0; background: var(--papier-clair); color: var(--mine); padding: 0.6rem 0.7rem; font-family: var(--font-main); font-size: 1.125rem; line-height: 1.35; resize: vertical; min-height: 2.75rem; }
.field__input::placeholder { color: var(--mine-douce); opacity: 1; font-family: var(--font-ui); font-size: 0.9375rem; }
.field__input:focus-visible { outline: 2px solid var(--orange); outline-offset: 0; }
.field__count { display: block; text-align: right; font-size: 0.8125rem; font-weight: 600; color: var(--mine-douce); margin-top: 0.25rem; }
.field__count.is-over { color: var(--rouge-fonce); }

/* Progression collante */
.progress { position: sticky; bottom: 0; z-index: 5; margin: 0 -1rem; padding: 0.6rem 1rem calc(0.6rem + env(safe-area-inset-bottom)); background: var(--marine-900); color: var(--papier-clair); display: flex; align-items: center; gap: 0.75rem; font-weight: 700; box-shadow: 0 -8px 16px -10px rgb(3 8 20 / 0.6); }
.progress__bar { flex: 1; height: 0.5rem; border: 1px solid var(--marine-300); }
.progress__bar span { display: block; height: 100%; background: var(--orange); width: var(--p, 0%); transition: width 0.3s var(--ease-out); }
.progress__text { font-family: var(--font-main); font-size: var(--n5); white-space: nowrap; }

/* La poche aux cartons */
.pocket { margin-top: 2rem; }
.pocket__title { font-family: var(--font-display); font-weight: 900; font-size: 2rem; text-transform: uppercase; color: var(--marine-800); line-height: 1; }
.pocket__hint { margin-top: 0.35rem; color: var(--mine-douce); font-size: 0.9375rem; }
.pocket__title, .rates { scroll-margin-top: 7rem; }
.pick { margin-top: 1.5rem; display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; align-items: start; }
.pick + .pick { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--grille-forte); }
.pick__slot { position: relative; padding-bottom: 2.25rem; clip-path: inset(-3rem -3rem 0 -3rem); }
/* Le carton dort dans la poche ; choisir un joueur le tire dehors. */
.pick .carton { max-width: none; justify-content: flex-start; gap: 0.6rem; transform: rotate(-3deg) translateY(2.75rem); transition: transform 0.5s var(--ease-out); }
.pick--rouge .carton { transform: rotate(2.5deg) translateY(2.75rem); }
.pick.is-chosen .carton { transform: rotate(-4deg) translateY(-0.25rem); }
.pick--rouge.is-chosen .carton { transform: rotate(3.5deg) translateY(-0.25rem); }
.pick .carton__name { font-size: 1.625rem; }
.pick__slot::after {
  content: '';
  position: absolute;
  left: -0.5rem;
  right: -0.5rem;
  bottom: 0;
  height: 3.25rem;
  background:
    linear-gradient(90deg, rgb(220 226 238 / 0.32) 50%, transparent 50%) 0 0.4rem / 0.5rem 1px repeat-x,
    var(--marine-800);
  box-shadow: 0 -1px 0 var(--marine-600) inset, 0 -8px 14px -8px rgb(3 8 20 / 0.7);
}
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip { min-height: 2.75rem; padding: 0.35rem 0.7rem; border: 1px solid var(--mine); background: var(--papier-clair); color: var(--mine); font-weight: 700; font-size: 0.9375rem; text-transform: uppercase; letter-spacing: 0.03em; transition: background-color 0.15s, color 0.15s; }
.chip:hover { background: #fff; }
.chip[aria-checked='true'] { background: var(--vert); border-color: var(--vert-fonce); color: #fff; }
.pick--rouge .chip[aria-checked='true'] { background: var(--rouge); border-color: var(--rouge-fonce); }
.chip:disabled { opacity: 0.35; text-decoration: line-through; cursor: not-allowed; }

.missing { margin-top: 0.75rem; font-size: 0.9375rem; font-weight: 600; color: var(--rouge-fonce); }
.done-note { margin-top: 1rem; font-family: var(--font-main); font-weight: 700; font-size: var(--n5); }

/* ---------- Tableaux de notes ---------- */

.board { width: 100%; border-collapse: collapse; margin-top: 0.5rem; font-variant-numeric: tabular-nums; }
.board th { text-align: left; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--mine-douce); padding: 0 0.25rem 0.4rem; border-bottom: 2px solid var(--mine); }
.board td { padding: 0.55rem 0.25rem; border-bottom: 1px solid var(--grille-forte); vertical-align: middle; }
.board .num { text-align: right; white-space: nowrap; }
.board__rank { width: 1.75rem; font-weight: 700; color: var(--mine-douce); }
.board__name { font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; line-height: 1; text-transform: uppercase; }
.board__name a { text-decoration: none; color: var(--marine-800); }
.board__name a:hover { text-decoration: underline; }
.board__note { font-family: var(--font-main); font-weight: 700; font-size: var(--n4); line-height: 1; width: 3.25rem; text-align: right; }
.board tr.is-mvp .board__note { color: var(--orange-fonce); }
.tag { display: inline-block; margin-left: 0.35rem; vertical-align: 0.15em; font-family: var(--font-ui); font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; padding: 0.1rem 0.35rem; border: 1px solid currentColor; }
.tag--mvp { color: var(--orange-fonce); }
.tag--off { color: var(--mine-douce); border-style: dashed; }

/* Barre de note : longueur = note / 10 */
.bar { display: block; height: 0.4rem; margin-top: 0.35rem; background: linear-gradient(90deg, var(--mine) var(--v), transparent var(--v)); max-width: 10rem; }

.comments { list-style: none; padding: 0.25rem 0 0.5rem; }
.comments li { font-family: var(--font-main); font-size: 1.125rem; line-height: 1.35; padding: 0.35rem 0 0.35rem 1rem; position: relative; }
.comments li::before { content: '«'; position: absolute; left: 0; color: var(--mine-douce); }
.comments__src { font-family: var(--font-ui); font-size: 0.8125rem; font-weight: 600; color: var(--mine-douce); display: block; }

details.row > summary { list-style: none; cursor: pointer; }
details.row > summary::-webkit-details-marker { display: none; }
.row { border-bottom: 1px solid var(--grille-forte); }
.row__line { display: grid; grid-template-columns: 1.75rem 1fr auto auto; align-items: center; gap: 0.6rem; padding: 0.6rem 0.25rem; min-height: 3rem; }
.row__rank { font-weight: 700; color: var(--mine-douce); font-variant-numeric: tabular-nums; }
.row__who { min-width: 0; }
.row__name { font-family: var(--font-display); font-weight: 800; font-size: 1.375rem; line-height: 1; text-transform: uppercase; color: var(--marine-800); }
.row__marks { display: flex; gap: 0.45rem; }
.row__note { font-family: var(--font-main); font-weight: 700; font-size: var(--n4); line-height: 1; min-width: 2.6rem; text-align: right; }
.row__more { font-size: 0.8125rem; font-weight: 600; color: var(--mine-douce); }
details.row[open] .row__more::after { content: ' · masquer'; }
details.row:not([open]) .row__more:not(:empty)::after { content: ' · lire'; }
.row__body { padding: 0 0.25rem 0.5rem 2.35rem; }
.rows-head { display: flex; justify-content: space-between; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--mine-douce); padding: 0 0.25rem 0.4rem; border-bottom: 2px solid var(--mine); margin-top: 1rem; }

/* ---------- Fiche joueur ---------- */

.player-hero { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 1rem; }
.player-hero__avg { font-family: var(--font-main); font-weight: 700; font-size: var(--n1); line-height: 0.8; color: var(--marine-800); text-align: right; }
.player-hero__avg small { display: block; font-family: var(--font-ui); font-size: 0.8125rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--mine-douce); margin-top: 0.6rem; }
.facts { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin-top: 1rem; padding-top: 0.75rem; border-top: 2px solid var(--mine); }
.fact { display: flex; align-items: baseline; gap: 0.4rem; font-weight: 600; color: var(--mine-douce); }
.fact b { font-family: var(--font-main); font-weight: 700; font-size: var(--n4); color: var(--mine); }

/* ---------- Calendrier ---------- */

.fixture { display: grid; grid-template-columns: 3.25rem 1fr auto; gap: 0.85rem; align-items: center; padding: 0.85rem 0.25rem; border-bottom: 1px solid var(--grille-forte); text-decoration: none; color: inherit; }
.fixture:first-of-type { border-top: 2px solid var(--mine); }
.fixture:hover { background: rgb(255 255 255 / 0.35); }
.fixture__date { text-align: center; border: 1px solid var(--mine); padding: 0.25rem 0; line-height: 1; }
.fixture__date b { display: block; font-family: var(--font-display); font-weight: 900; font-size: 1.75rem; color: var(--marine-800); }
.fixture__date span { font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.fixture__opp { font-family: var(--font-display); font-weight: 800; font-size: 1.375rem; line-height: 1; text-transform: uppercase; color: var(--marine-800); }
.fixture__info { font-size: 0.875rem; font-weight: 600; color: var(--mine-douce); margin-top: 0.2rem; }
.fixture__right { text-align: right; }
.fixture__score { font-family: var(--font-main); font-weight: 700; font-size: var(--n4); line-height: 1; white-space: nowrap; }
.status { display: inline-block; font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; padding: 0.15rem 0.4rem; border: 1px solid currentColor; white-space: nowrap; }
.status--open { color: var(--orange-fonce); border-width: 2px; }
.status--live { color: var(--rouge-fonce); }
.status--closed, .status--upcoming { color: var(--mine-douce); }

/* ---------- Capitaine ---------- */

.form-grid { display: grid; gap: 0.75rem; margin-top: 0.75rem; }
.form-grid--2 { grid-template-columns: 1fr 1fr; }
.label { display: block; font-size: 0.8125rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--mine-douce); margin-bottom: 0.25rem; }
.input { display: block; width: 100%; min-height: 2.75rem; border: 1px solid var(--mine); border-radius: 0; background: var(--papier-clair); color: var(--mine); padding: 0.45rem 0.6rem; font-weight: 600; font-size: 1rem; }
.input--score { font-family: var(--font-main); font-weight: 700; font-size: var(--n4); text-align: center; padding: 0.2rem; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--mine) 50%), linear-gradient(-45deg, transparent 50%, var(--mine) 50%); background-position: right 0.9rem center, right 0.6rem center; background-size: 0.3rem 0.3rem; background-repeat: no-repeat; padding-right: 2rem; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--mine); margin-top: 0.25rem; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; }
.segmented span { display: flex; align-items: center; justify-content: center; min-height: 2.75rem; font-weight: 700; font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.04em; cursor: pointer; }
.segmented label + label span { border-left: 1px solid var(--mine); }
.segmented input:checked + span { background: var(--marine-800); color: var(--papier-clair); }
.segmented input:focus-visible + span { outline: 2px solid var(--orange); outline-offset: -4px; }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; margin-top: 0.5rem; }
.check { display: flex; align-items: center; gap: 0.6rem; min-height: 2.75rem; border-bottom: 1px solid var(--grille-forte); font-weight: 600; cursor: pointer; }
.check input { width: 1.25rem; height: 1.25rem; accent-color: var(--marine-800); }
.admin-player { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0.5rem; padding: 0.5rem 0; border-bottom: 1px solid var(--grille-forte); }
.admin-player__name { font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; text-transform: uppercase; }
.admin-player.is-off .admin-player__name { text-decoration: line-through; color: var(--mine-douce); }
.admin-player__who { display: grid; justify-items: start; }
.admin-player__more { display: flex; gap: 1rem; }
.link--quiet { min-height: 2rem; font-size: 0.8125rem; font-weight: 600; color: var(--mine-douce); text-decoration-color: var(--grille-forte); }
.link--quiet:hover { color: var(--mine); }
.yellow { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.yellow__card { display: inline-flex; align-items: center; gap: 0.45rem; min-height: 2.75rem; padding: 0.35rem 0.7rem 0.35rem 0.45rem; border: 1px solid var(--mine); background: var(--papier-clair); color: var(--mine); font-weight: 700; text-transform: uppercase; font-size: 0.875rem; }
.yellow__card::before { content: ''; width: 0.7rem; height: 0.95rem; background: var(--jaune); box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.25); transform: rotate(-6deg); }
details.panel { margin-top: 1rem; border-top: 2px solid var(--mine); }
details.panel > summary { cursor: pointer; min-height: 2.75rem; display: flex; align-items: center; font-family: var(--font-display); font-weight: 800; font-size: 1.375rem; text-transform: uppercase; color: var(--marine-800); }

/* ---------- Bandeaux et états ---------- */

.notice { border: 1px solid var(--marine-600); background: var(--marine-700); padding: 0.9rem 1rem; margin-bottom: 1.25rem; color: var(--marine-100); }
.notice strong { color: var(--papier-clair); }
.notice form { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.notice .input { background: var(--marine-900); color: var(--papier-clair); border-color: var(--marine-300); }
.notice .input::placeholder { color: var(--marine-300); }

.state { text-align: left; padding: 2rem 0; }
.state__title { font-family: var(--font-display); font-weight: 900; font-size: 3rem; line-height: 0.95; text-transform: uppercase; color: var(--papier-clair); }
.state p { margin: 0.75rem 0 1.25rem; color: var(--marine-300); max-width: 40ch; }

.countdown { font-family: var(--font-main); font-weight: 700; font-size: var(--n2); line-height: 1; color: var(--marine-800); margin-top: 0.25rem; }

.podium-link { display: block; margin-top: 1rem; font-weight: 700; }

.skeleton { height: 18rem; background: var(--marine-700); }

/* ---------- Toasts ---------- */

.toasts { position: fixed; left: 50%; bottom: calc(1rem + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 40; display: grid; gap: 0.5rem; width: min(92vw, 26rem); pointer-events: none; }
.toast { background: var(--marine-950); color: var(--papier-clair); border: 1px solid var(--marine-600); border-left: 1px solid var(--orange); padding: 0.75rem 1rem; font-weight: 600; box-shadow: var(--shadow-card); transition: opacity 0.4s, transform 0.4s var(--ease-out); }
.toast--error { border-color: var(--rouge); }
.toast--ok { border-color: var(--vert); }
.toast.is-leaving { opacity: 0; transform: translateY(0.5rem); }
@media (prefers-reduced-motion: no-preference) {
  .toast { animation: toast-in 0.35s var(--ease-out); }
}
@keyframes toast-in { from { transform: translateY(0.75rem); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---------- Grand écran ---------- */

@media (min-width: 48rem) {
  :root { --gutter: 1.5rem; }
  .view { padding-top: 2rem; }
  .sheet { padding: 2.25rem 1.75rem 1.75rem; }
  .progress { margin: 0 -1.75rem; padding-inline: 1.75rem; }
}
