/* AllinTournoi — présentation V2 (nouvelle charte)
   Thème « tapis de poker ». Mobile d'abord, adapté tablette et ordinateur. */

:root {
  /* Deux couleurs de base, modifiables dans Paramètres (et plus tard par tournoi) */
  --c-green: #1E4E3F;
  --c-gold: #E8B04A;

  /* Nuances déduites du vert (tapis) */
  --bg: color-mix(in srgb, var(--c-green) 52%, black);
  --bg-deep: color-mix(in srgb, var(--c-green) 44%, black);
  --surface: color-mix(in srgb, var(--c-green) 72%, black);
  --surface-2: var(--c-green);
  --surface-hover: color-mix(in srgb, var(--c-green) 86%, black);   /* survol */
  --surface-active: color-mix(in srgb, var(--c-green) 62%, black);  /* clic */
  --line: color-mix(in srgb, var(--c-green) 94%, white);
  --line-strong: color-mix(in srgb, var(--c-green) 88%, white);

  /* Nuances déduites du jaune (accent) */
  --gold: var(--c-gold);
  --gold-hover: color-mix(in srgb, var(--c-gold) 80%, white);       /* survol */
  --gold-active: color-mix(in srgb, var(--c-gold) 84%, black);      /* clic */
  --gold-ink: #1A1408;                                              /* texte sur l'accent */

  --text: #F2EFE6;
  --muted: #A9BDB3;
  --ok: #7FD1A8;
  --warn: #F0907A;
  --font: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-num: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  --radius: 14px;
  --gutter: 20px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Structure d'une page ---------- */
.app { min-height: 100dvh; display: flex; flex-direction: column; margin: 0 auto; max-width: 560px; }
.app--wide { max-width: 980px; }
.proto {
  display: block; padding: 8px var(--gutter); font-size: 12px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); text-decoration: none; background: var(--bg-deep);
  border-bottom: 1px solid var(--line);
}
.proto:hover { color: var(--gold); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px var(--gutter) 8px; }
.brand { font-family: var(--font-num); font-weight: 700; font-size: 26px; letter-spacing: .04em; color: var(--gold); text-decoration: none; white-space: nowrap; }
.topbar .context { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.main { flex: 1; padding: 8px var(--gutter) 24px; display: flex; flex-direction: column; gap: 20px; }
.page-title { font-size: 28px; font-weight: 600; line-height: 1.15; text-wrap: balance; }
.lead { color: var(--muted); margin-top: 6px; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

.tabbar {
  position: sticky; bottom: 0; display: flex; background: var(--bg-deep);
  border-top: 1px solid var(--line); padding: 6px 8px calc(8px + env(safe-area-inset-bottom, 0px));
}
.tabbar a {
  flex: 1; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--muted); text-decoration: none; font-size: 12px; border-radius: 10px;
}
.tabbar a:hover { background: var(--surface-hover); }
.tabbar a:active { background: var(--surface-active); }
.tabbar a[aria-current="page"] { color: var(--gold); font-weight: 600; }
.tabbar svg { width: 22px; height: 22px; }
.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Composants ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card--accent { border-color: var(--gold); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 12px; }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.num { font-family: var(--font-num); font-weight: 700; font-variant-numeric: tabular-nums; }

.btn {
  min-height: 48px; padding: 0 20px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: transparent; font-size: 16px; font-weight: 600; display: inline-flex; align-items: center;
  justify-content: center; gap: 8px; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--surface-hover); border-color: var(--gold); }
.btn:active { background: var(--surface-active); }
.btn--primary { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.btn--primary:hover { background: var(--gold-hover); border-color: var(--gold-hover); }
.btn--primary:active { background: var(--gold-active); border-color: var(--gold-active); }
.btn--danger { border-color: var(--warn); color: var(--warn); }
.btn--block { width: 100%; }
.btn--sm { min-height: 44px; padding: 0 16px; font-size: 15px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid var(--line-strong); background: transparent; font-size: 15px; }
.chip:hover { background: var(--surface-hover); }
.chip:active { background: var(--surface-active); }
.chip[aria-pressed="true"]:hover { background: var(--gold-hover); }
.chip[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); font-weight: 600; }

.pill { display: inline-block; padding: 4px 10px; border-radius: 14px; border: 1px solid var(--line-strong); font-size: 13px; font-weight: 600; white-space: nowrap; }
.pill--ok { color: var(--ok); border-color: var(--ok); }
.pill--gold { color: var(--gold); border-color: var(--gold); }
.pill--warn { color: var(--warn); border-color: var(--warn); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 15px; font-weight: 600; }
.field input, .field select, .select {
  min-height: 48px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface);
  padding: 0 14px; font-size: 17px; width: 100%;
}
.select { min-height: 44px; font-size: 15px; width: auto; }
.hint { font-size: 14px; color: var(--muted); }

/* Tournois */
.tournoi h2 { font-size: 20px; font-weight: 600; line-height: 1.2; }
.tournoi .meta { color: var(--muted); font-size: 15px; }

/* Étapes d'arrivée */
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.steps li { display: flex; align-items: center; gap: 14px; min-height: 52px; color: var(--muted); }
.steps .dot {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex: none;
}
.steps li.done { color: var(--text); }
.steps li.done .dot { background: var(--ok); border-color: var(--ok); color: var(--bg); }
.steps li.current { color: var(--gold); font-weight: 600; }
.steps li.current .dot { border-color: var(--gold); color: var(--gold); }
.viewfinder {
  aspect-ratio: 1; width: min(100%, 260px); margin: 0 auto; border: 2px dashed var(--line-strong);
  border-radius: 18px; background: var(--surface); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 20px; color: var(--muted);
}
.viewfinder svg { width: 64px; height: 64px; stroke: var(--gold); fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* Niveau, blinds, chrono */
.level { container-type: inline-size; text-align: center; padding: 22px 16px 20px; }
.level .timer { font-family: var(--font-num); font-weight: 700; font-size: clamp(64px, 30cqw, 150px); line-height: 1; color: var(--gold); font-variant-numeric: tabular-nums; margin-top: 4px; }
.level .timer.paused { opacity: .55; }
.level .blinds { font-family: var(--font-num); font-weight: 700; font-size: 40px; margin-top: 6px; }
.blindbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.blindbar .num { font-size: 30px; line-height: 1.1; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat { text-align: center; padding: 12px 6px; }
.stat .num { white-space: nowrap; font-size: 28px; line-height: 1.1; display: block; }
.stat > span:last-child { font-size: 13px; color: var(--muted); }
.seat { display: flex; gap: 20px; align-items: baseline; flex-wrap: wrap; }
.seat .num { font-size: 56px; line-height: 1; }
.seat .num:first-child { color: var(--gold); }
.plist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.plist li { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; }
.plist li.me { background: var(--surface-2); border-color: var(--gold); font-weight: 600; }
.plist .siege { width: 24px; font-family: var(--font-num); font-weight: 700; font-size: 20px; color: var(--muted); }
.plist .chips-count { margin-left: auto; color: var(--muted); font-size: 14px; }

/* Tables : une colonne par table */
.table-scroll { position: relative; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.cols { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr); }
.cols .col { border-right: 1px solid var(--line); padding: 12px; min-width: 0; }
.cols .col:last-child { border-right: 0; }
.cols h3 { font-size: 15px; margin-bottom: 8px; }
.cols .col--final h3 { color: var(--gold); }
.cols ol { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.cols li { display: flex; gap: 8px; min-height: 36px; align-items: center; font-size: 15px; overflow-wrap: anywhere; }
.cols li .siege { width: 20px; color: var(--muted); font-family: var(--font-num); font-weight: 700; flex: none; }
.tables-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.tcard { text-align: center; padding: 14px 8px; }
.tcard .num { font-size: 34px; line-height: 1.1; }
.tcard.final { border-color: var(--gold); }

/* Structure */
.table-wrap { position: relative; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
th { text-align: left; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 12px 14px; font-weight: 600; white-space: nowrap; }
td { padding: 10px 14px; border-top: 1px solid var(--line); white-space: nowrap; }
tr.now td { background: var(--surface-2); color: var(--gold); font-weight: 600; }
tr.break td { color: var(--muted); font-style: italic; }

/* Mise en page tablette / ordinateur */
.split { display: grid; gap: 20px; }
@media (min-width: 760px) {
  :root { --gutter: 32px; }
  .split { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
  .page-title { font-size: 34px; }
}

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 600;
  max-width: calc(100% - 32px); z-index: 20; box-shadow: 0 6px 24px rgba(0,0,0,.4);
}

/* ---------- Administrateur ---------- */
.admin { min-height: 100dvh; display: flex; flex-wrap: wrap; }
.admin nav {
  flex: 1 1 220px; max-width: 260px; background: var(--bg-deep); border-right: 1px solid var(--line);
  padding: 24px 16px; display: flex; flex-direction: column; gap: 6px;
}
.admin nav .brand { padding: 0 10px 16px; }
.admin nav a.link { min-height: 44px; display: flex; align-items: center; padding: 0 12px; border-radius: 10px; color: var(--muted); text-decoration: none; }
.admin nav a.link[aria-current="page"] { background: var(--surface-2); color: var(--text); font-weight: 600; }
.admin main { flex: 999 1 520px; min-width: 0; padding: 28px var(--gutter); display: flex; flex-direction: column; gap: 20px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); font-size: 14px; }
@media (max-width: 700px) {
  .admin nav { flex-basis: 100%; max-width: none; flex-direction: row; flex-wrap: wrap; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 16px; }
  .admin nav .brand { padding: 0 12px 0 0; }
}

/* ---------- Page d'accueil des maquettes ---------- */
.hub { max-width: 920px; margin: 0 auto; padding: 32px var(--gutter) 48px; display: flex; flex-direction: column; gap: 28px; }
.hub h1 { font-size: 34px; font-weight: 600; }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.hub-card { display: flex; flex-direction: column; gap: 4px; text-decoration: none; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-height: 88px; }
.hub-card:hover { border-color: var(--gold); background: var(--surface-hover); }
.hub-card:active { background: var(--surface-active); }
.hub-card strong { font-size: 18px; }
.hub-card span { color: var(--muted); font-size: 14px; }

@media (prefers-reduced-motion: no-preference) {
  .btn, .chip, .hub-card { transition: border-color .15s, filter .15s; }
}

/* Paramètre des couleurs */
input[type="color"] { width: 72px; height: 48px; padding: 4px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); }
.swatches { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; }
.swatch { border-radius: 10px; border: 1px solid var(--line-strong); padding: 10px; min-height: 64px; display: flex; align-items: flex-end; font-size: 13px; font-weight: 600; }

/* Page : en-tête, messages */
.page-head { display: flex; flex-direction: column; gap: 6px; }
.btn--icon { width: 44px; padding: 0; border-radius: 50%; }
.notice { border-radius: 12px; padding: 12px 16px; font-weight: 500; border: 1px solid var(--line-strong); background: var(--surface-2, var(--surface)); }
/* Messages en notification : ils flottent par-dessus la page, en bas de l'écran (toujours visibles, sans pousser le contenu) */
.toast-zone { position: fixed; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 8px; width: min(560px, calc(100vw - 32px)); pointer-events: none; }
.toast-zone .notice { pointer-events: auto; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); animation: toast-in .25s ease-out; cursor: pointer; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (min-width: 1100px) { .toast-zone { bottom: 28px; } }
.notice--info { border-color: var(--ok); }
.notice--alert { border-color: var(--warn); color: var(--warn); }

/* Organisateur : page Joueurs */
a.chip, button.chip { display: inline-flex; justify-content: center; align-items: center; text-decoration: none; }
.section-title { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.section-title .count { font-family: var(--font-num); color: var(--gold); font-size: 20px; }
.prow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px 10px 16px; }
.prow form { margin: 0; }

.qr-panel summary { cursor: pointer; list-style: none; min-height: 28px; }
.qr-panel summary::-webkit-details-marker { display: none; }
.qr-box { background: #fff; border-radius: 12px; padding: 8px; width: min(100%, 320px); margin: 0 auto; }
.qr-box svg { display: block; width: 100%; height: auto; }
.tabbar a { min-width: 0; }

/* Recherche */
.search input {
  min-height: 44px; font-size: 16px; padding-left: 42px;
  border: 1px dashed var(--gold); background-color: var(--bg, transparent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23E8B04A' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 12px center; background-size: 20px;
}
.search input:focus { border-style: solid; outline: 2px solid var(--gold); outline-offset: 1px; }
.search input::placeholder { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[data-row][hidden] { display: none !important; }
a.route { display: inline-block; margin-top: 4px; font-weight: 600; color: var(--gold, inherit); text-decoration: underline; }

/* Structure des blinds */
.srow { display: flex; flex-direction: column; gap: 10px; }
.srow--break { border-style: dashed; }
.srow-head { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; }
.srow-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.srow-fields label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.srow-fields input { min-height: 44px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); padding: 0 12px; font-size: 16px; width: 100%; color: var(--text, inherit); }
.btn[disabled] { opacity: .4; pointer-events: none; }

/* Fiche d'un compte */
.fiche { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.fiche dt { color: var(--muted); }
.fiche dd { margin: 0; overflow-wrap: anywhere; }
a.prow { color: inherit; text-decoration: none; }

/* Chrono */
.timer-card { text-align: center; display: flex; flex-direction: column; gap: 6px; padding: 24px 16px; }
.timer { font-size: 80px; line-height: 1; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--gold); margin: 6px 0; }
.blinds-big { font-size: 40px; font-weight: 700; margin: 0; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row form { flex: 1 1 140px; }
.btn-row .btn { width: 100%; }
.note { font-size: 14px; color: var(--muted); margin: 4px 0 0; }

/* Actions groupées */
.bulkbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.check { display: inline-flex; gap: 8px; align-items: center; font-size: 15px; }
.rowcheck { width: 24px; height: 24px; flex: none; accent-color: var(--gold); }

/* Fenêtre "Joueur déplacé" */
.modal { border: 1px solid var(--gold); border-radius: 16px; padding: 20px; max-width: min(92vw, 460px); width: 100%; background: var(--bg-deep); color: inherit; }
.modal::backdrop { background: rgba(0, 0, 0, .7); }
.modal > * + * { margin-top: 14px; }

/* Jetons et classement */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { padding: 12px 8px; text-align: center; }
.stat .eyebrow { margin: 0; font-size: 12px; }
.stat-num { margin: 4px 0 0; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 380px) { .stats { grid-template-columns: 1fr; } }

/* Couleurs du tournoi (Fiche du tournoi) */
.colors { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.colors legend { padding: 0 6px; color: var(--muted); }
.color-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.color-row input[type="color"] { width: 56px; height: 40px; padding: 2px; border-radius: 10px; border: 1px solid var(--line-strong); background: transparent; }

/* Cases à cocher : même taille partout (plus de case géante dans un champ de formulaire) */
.check input[type="checkbox"], .rowcheck { width: 24px; height: 24px; min-height: 0; padding: 0; flex: none; accent-color: var(--gold); }
.check { cursor: pointer; }
.topbar-gear { margin-left: auto; margin-right: 8px; }

/* ---------- Projection (vidéoprojecteur / grand écran) ---------- */
body.proj { margin: 0; overflow: hidden; --pz: 1; --pvw: calc(1vw / var(--pz)); --pvh: calc(1dvh / var(--pz)); --pvmin: calc(1vmin / var(--pz)); --pvh100: calc(100dvh / var(--pz)); }
/* Zoom propre à l'écran de projection (boutons Z− / Z+, ou automatique sur un petit écran) : l'écran virtuel est plus grand
   que la fenêtre puis réduit, sans toucher au zoom du navigateur (donc sans rien changer sur l'ordinateur principal). */
.proj-app { width: calc(100vw / var(--pz)); height: var(--pvh100); display: flex; background: var(--bg); transform: scale(var(--pz)); transform-origin: 0 0; }
.proj-rail {
  position: absolute; top: 0; bottom: 0; left: 0;
  display: flex; flex-direction: column; gap: 10px; padding: 14px 10px; background: var(--bg-deep);
  border-right: 1px solid var(--line); transition: opacity .4s, transform .4s; z-index: 5;
}
.proj-calm .proj-rail { opacity: 0; transform: translateX(-100%); pointer-events: none; }
.proj-calm { cursor: none; }
.proj-btn {
  width: 52px; height: 52px; border-radius: 14px; border: 1px solid var(--line-strong); background: transparent; color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none;
}
.proj-btn:hover { background: var(--surface-hover); border-color: var(--gold); }
.proj-btn[aria-pressed="true"] { color: var(--gold); border-color: var(--gold); }
.proj-btn--exit { margin-top: auto; }
.proj-btn--txt { font-size: 18px; font-weight: 700; font-family: var(--font-num); }
.proj-live { flex: 1; min-width: 0; padding: calc(2.2 * var(--pvmin)) calc(3 * var(--pvmin)) calc(2.2 * var(--pvmin)) 96px; overflow: hidden; }
.proj-view { display: none; height: 100%; }
body[data-view="chrono"] .proj-view--chrono { display: grid; }
body[data-view="tables"] .proj-view--tables { display: block; overflow: auto; }
body[data-view="classement"] .proj-view--classement { display: block; overflow: auto; }
.proj-view--chrono { grid-template-columns: minmax(0, 1fr) clamp(260px, calc(24 * var(--pvw)), 460px); gap: calc(3 * var(--pvmin)); }
.proj-main { display: flex; flex-direction: column; justify-content: space-between; min-height: 0; }
.proj-top { display: flex; align-items: center; gap: calc(2 * var(--pvmin)); flex-wrap: wrap; font-size: clamp(16px, calc(2.4 * var(--pvmin)), 30px); }
.proj-level { font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.proj-top-right { margin-left: auto; white-space: nowrap; }
.proj-small { color: var(--muted); font-size: .8em; font-weight: 400; }
.proj-pill { font-size: inherit; text-transform: uppercase; letter-spacing: .08em; }
.proj-pill--running { color: var(--ok); border-color: var(--ok); }
.proj-pill--paused, .proj-pill--stopped { color: var(--gold); border-color: var(--gold); }
.proj-clock { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; background: transparent; border: 0; padding: 0; text-align: center; }
.proj-timer { margin: 0; font-family: var(--font-num); font-weight: 700; line-height: .9; font-size: calc(min(calc(24 * var(--pvw)), calc(44 * var(--pvh))) * var(--proj-scale, 1)); font-variant-numeric: tabular-nums; white-space: nowrap; }
.proj-blinds { margin: calc(1.5 * var(--pvmin)) 0 0; font-family: var(--font-num); font-weight: 700; font-size: calc(min(calc(11 * var(--pvw)), calc(17 * var(--pvh))) * var(--proj-scale, 1)); color: var(--gold); line-height: 1; font-variant-numeric: tabular-nums; }
.proj-blinds--break { font-size: min(calc(6 * var(--pvw)), calc(9 * var(--pvh))); color: var(--text); }
.proj-ante { margin: calc(.6 * var(--pvmin)) 0 0; font-size: min(calc(4 * var(--pvw)), calc(6 * var(--pvh))); color: var(--muted); }
.proj-wait { font-size: min(calc(5 * var(--pvw)), calc(8 * var(--pvh))); margin: 0; }
.proj-start { font-size: min(calc(3 * var(--pvw)), calc(4 * var(--pvh))); }
.proj-next { margin: 0; font-size: clamp(18px, calc(3.2 * var(--pvmin)), 40px); text-align: center; }
.proj-prev { margin-left: calc(1 * var(--pvw)); }
.proj-notice { margin: calc(1 * var(--pvmin)) 0 0; text-align: center; color: var(--muted); font-size: clamp(13px, calc(2 * var(--pvmin)), 24px); }
.proj-side { display: flex; flex-direction: column; gap: calc(1.4 * var(--pvmin)); min-height: 0; overflow: hidden; }
.proj-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: calc(1.4 * var(--pvmin)) calc(1.8 * var(--pvmin)); }
.proj-card h3 { margin: 0 0 calc(.6 * var(--pvmin)); font-size: clamp(11px, calc(1.6 * var(--pvmin)), 18px); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.proj-card p { margin: calc(.3 * var(--pvmin)) 0; font-size: clamp(16px, calc(2.6 * var(--pvmin)), 34px); }
.proj-card strong { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 1.15em; }
.proj-card .proj-small { font-size: clamp(12px, calc(1.8 * var(--pvmin)), 22px); }
.proj-rank { display: inline-block; min-width: 2.6em; color: var(--gold); font-weight: 700; }
.proj-h { margin: 0 0 calc(2 * var(--pvmin)); font-size: clamp(22px, calc(4 * var(--pvmin)), 52px); }
.proj-empty { font-size: clamp(18px, calc(3 * var(--pvmin)), 36px); color: var(--muted); }
.proj-tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, calc(24 * var(--pvw))), 1fr)); gap: calc(2 * var(--pvmin)); }
.proj-table { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: calc(1.6 * var(--pvmin)) calc(2 * var(--pvmin)); }
.proj-table h3 { margin: 0 0 calc(1 * var(--pvmin)); color: var(--gold); font-size: clamp(18px, calc(3 * var(--pvmin)), 40px); }
.proj-table ol { margin: 0; padding: 0 0 0 0; list-style: none; }
.proj-table li { font-size: clamp(16px, calc(2.6 * var(--pvmin)), 34px); padding: calc(.4 * var(--pvmin)) 0; }
.proj-table li::before { content: attr(value) ; display: inline-block; min-width: 1.8em; color: var(--muted); font-family: var(--font-num); }
.proj-rank-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: calc(2 * var(--pvmin)); align-items: start; }
.proj-ranking { margin: 0; padding: 0; list-style: none; }
.proj-ranking li { font-size: clamp(16px, calc(2.8 * var(--pvmin)), 36px); padding: calc(.4 * var(--pvmin)) 0; }
.proj-inplay { line-height: 1.6; }
/* écran virtuel étroit (voir projection.js : classe proj-narrow) */
.proj-narrow .proj-view--chrono { grid-template-columns: 1fr; overflow: auto; }
.proj-narrow .proj-rank-cols { grid-template-columns: 1fr; }

/* Impression du QR code : seule la feuille #qr-print sort sur le papier */
.qr-print { display: none; }
@media print {
  @page { margin: 14mm; }
  .topbar, .tabbar, .main > *:not(.qr-print) { display: none !important; }
  .app { display: block; max-width: none; min-height: 0; }
  .main { display: block; padding: 0; max-width: none; }
  .qr-print { display: block; width: 100%; text-align: center; color: #000; background: #fff; }
  .qr-print h1 { font-size: 40pt; margin: 0 0 4mm; color: #000; }
  .qr-print-date { font-size: 18pt; margin: 0 0 10mm; color: #333; }
  .qr-print-box { width: 150mm; margin: 0 auto 10mm; }
  .qr-print-box svg { display: block; width: 100%; height: auto; }
  .qr-print-text { font-size: 22pt; margin: 0 0 6mm; color: #000; }
  .qr-print-small { font-size: 12pt; color: #444; }
  html, body { background: #fff !important; }
}

/* ---------- Ordinateur (écran large) : menu à gauche, blocs côte à côte ----------
   Smartphone et tablette (moins de 1100 px) : inchangés. */
@media (min-width: 1100px) {
  .app { max-width: 1680px; display: grid; grid-template-columns: 224px minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .topbar { grid-column: 1 / -1; padding: 18px 32px 8px; }
  .tabbar {
    grid-column: 1; grid-row: 2; position: sticky; top: 16px; align-self: start;
    flex-direction: column; gap: 4px; background: transparent; border-top: 0; border-right: 1px solid var(--line);
    padding: 12px 12px 12px 24px;
  }
  .tabbar a { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 48px; padding: 0 14px; font-size: 16px; }
  .main { grid-column: 2; grid-row: 2; width: 100%; max-width: 860px; padding: 16px 32px 40px; }

  /* Pages à plusieurs colonnes */
  .main--wide { max-width: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 28px; align-content: start; align-items: start; }
  .main--wide > * { grid-column: 1 / -1; }
  .main--wide > .desk-half { grid-column: auto; }

  /* Joueurs : inscriptions et arrivées à gauche, joueurs acceptés à droite */
  .page-orgaJoueurs #live { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 28px; align-items: start; }
  .page-orgaJoueurs #live > section { grid-column: 1; }
  .page-orgaJoueurs #live > section[aria-labelledby="t-accepted"] { grid-column: 2; grid-row: 1 / span 20; }

  /* Chrono : chrono et commandes à gauche, jetons et classement à droite */
  .page-orgaChrono #live { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 28px; align-items: start; }
  .page-orgaChrono #live > * { grid-column: 1; }
  .page-orgaChrono #live > section[aria-label="Jetons et classement"] { grid-column: 2; grid-row: 1 / span 20; }

  /* Ma table : chrono et classement à gauche, ma place et ma table à droite */
  .page-matable #live { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 28px; align-items: start; }
  .page-matable #live > * { grid-column: 1; }
  .page-matable #live > .desk-col2 { grid-column: 2; grid-row: 1 / span 20; }

  /* Tables : plusieurs tables par ligne */
  .page-orgaTables section[aria-labelledby="t-tables"],
  .page-orgaTables section[aria-labelledby="t-waiting"],
  .page-orgaTables section[aria-labelledby="t-out"] { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; align-items: start; }
  .page-orgaTables section > .section-title { grid-column: 1 / -1; }

  /* Tournois : cartes côte à côte */
  .page-tournois #liste-tournois { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 16px; align-items: start; }
}

/* Fonctions réservées au grand écran (souris + large) : masquées sur smartphone et tablette */
a.chip.only-desk, .only-desk { display: none; }
@media (min-width: 1100px) and (hover: hover) and (pointer: fine) {
    a.chip.only-desk, .only-desk { display: inline-flex; }
}

/* Structure sur ordinateur : une ligne par niveau, champs étroits, boutons à droite */
@media (min-width: 1100px) {
    .srow { flex-direction: row; align-items: center; gap: 18px; padding-top: 10px; padding-bottom: 10px; }
    .page-orgaStructure.main--wide > * { max-width: 980px; }
    .srow-head { flex: 0 0 100px; flex-direction: column; gap: 0; align-items: flex-start; justify-content: center; }
    .srow-fields { display: flex; gap: 10px; flex: 0 0 auto; }
    .srow-fields label { width: 104px; }
    .srow-fields input { -moz-appearance: textfield; appearance: textfield; }
    .srow-fields input::-webkit-outer-spin-button, .srow-fields input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
    .srow-fields input { min-height: 38px; }
    .srow-fields input { padding: 0 8px; }
    .srow > .row { flex: 1 1 auto; flex-wrap: nowrap; justify-content: flex-end; }
    .srow > .row .btn { white-space: nowrap; }
}

/* Chiffres de largeur fixe : rien ne bouge quand la valeur change */
.proj .cell { display: inline-block; width: .6em; text-align: center; }
.proj .cell--sep { width: .3em; }
.proj-timer .cell { width: .62em; }
.proj-timer .cell--sep { width: .34em; }

/* Administration : cartes de raccourcis ; entrées du menu réservées à l'ordinateur */
.tab-desk { display: none !important; }
.admin-card { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit; }
.admin-card:hover { background: var(--surface-hover); }
.admin-card-title { font-weight: 600; font-size: 18px; }
.admin-card-figure { font-size: 34px; font-weight: 700; color: var(--gold); line-height: 1.1; }
.admin-warn { color: var(--gold); }
@media (min-width: 1100px) {
  .tabbar a.tab-desk { display: flex !important; }
  .admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
}

/* Pages d'accès au compte (connexion, inscription, mots de passe) : une carte centrée, sans menu */
.app--guest { display: block; }
.app--guest .topbar { max-width: 520px; margin: 0 auto; }
.app--guest .main { max-width: 520px; margin: 0 auto; width: 100%; display: flex; flex-direction: column; gap: 16px; padding-bottom: 40px; }
.auth-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .auth-row { grid-template-columns: 1fr; } }
.field input[type="file"] { min-height: 0; padding: 10px 12px; }

.topbar-logout { margin: 0; }
.topbar-gear { margin-right: 8px; }
.topbar-logout .btn { margin-left: 8px; }

/* Profil : avatar */
.profile-avatar { display: flex; justify-content: center; }
.profile-avatar img, .profile-avatar__initial { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; border: 2px solid var(--line-strong); }
.profile-avatar__initial { display: flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--muted); font-size: 48px; font-weight: 700; }

/* Info-bulle du profil : pseudo et rôle de la personne connectée */
.who { position: relative; display: inline-flex; }
.who-tip { position: absolute; top: calc(100% + 8px); right: 0; z-index: 30; min-width: 140px; padding: 10px 14px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line-strong); box-shadow: 0 6px 20px rgba(0, 0, 0, .35); text-align: left; white-space: nowrap;
  opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .12s, transform .12s; pointer-events: none; }
.who:hover .who-tip, .who:focus-within .who-tip { opacity: 1; visibility: visible; transform: none; }

/* Un bouton seul dans une ligne : aligné à droite */
.prow > form { margin-left: auto; }

/* Tapis saisi par le joueur : (jetons · heure) */
.stack-note { color: var(--muted); font-size: .9em; white-space: nowrap; }

/* Sous-menu des groupes organisateur (Préparer / En direct) */
.subnav { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.subnav a { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); text-decoration: none; font-size: .95rem; }
.subnav a:hover { background: var(--surface-hover); }
.subnav a[aria-current="page"] { color: var(--gold-ink); background: var(--gold); border-color: var(--gold); font-weight: 600; }

/* Fenêtre « Sortir un joueur » (raccourci X) */
.xdialog { width: min(560px, calc(100vw - 32px)); max-height: 85vh; overflow: auto; padding: 18px; border-radius: 16px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); }
.xdialog::backdrop { background: rgba(0, 0, 0, .6); }
.xdialog [hidden] { display: none !important; }
.prow--free { opacity: .55; }
.proj-table li.proj-free { min-height: 1.4em; }

/* Tables : « Sortir » aligné à droite sur chaque ligne de joueur */
.tcard .prow { justify-content: space-between; }

/* Fenêtre « Joueur(s) à déplacer » : colonnes alignées (joueur · de · → · vers) */
.mv-list { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 8px 14px; margin: 12px 0; align-items: center; }
.mv-head, .mv-row { display: grid; grid-template-columns: subgrid; grid-column: 1 / -1; align-items: center; }
.mv-head { padding: 0 16px; }
.mv-row { padding: 10px 16px; }
.mv-row strong { overflow-wrap: anywhere; }
.mv-row .pill { justify-self: start; white-space: nowrap; }
/* Pastille du joueur : avatar ou initiale */
.avatar-dot { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; overflow: hidden; flex: none;
  background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--muted); font-weight: 700; font-size: .85rem; vertical-align: middle; }
.avatar-dot img { width: 100%; height: 100%; object-fit: cover; }
.who-row { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Sans l'icône Réglages (joueur simple), le profil reste à droite */
.brand + .who { margin-left: auto; }

/* « En direct » : se démarque des autres entrées du menu */
.tabbar a.tab-live svg { color: var(--gold); }
@media (min-width: 1100px) {
  .tabbar a.tab-live { background: color-mix(in srgb, var(--gold) 12%, transparent); color: var(--text); border-left: 3px solid var(--gold); border-radius: 4px 12px 12px 4px; margin: 6px 0; }
  .tabbar a.tab-live svg { color: var(--gold); }
  .tabbar a.tab-live:hover { background: color-mix(in srgb, var(--gold) 20%, transparent); }
  .tabbar a.tab-live[aria-current="page"] { color: var(--gold); background: color-mix(in srgb, var(--gold) 18%, transparent); }
}
.snd-slot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.snd-slot > strong { min-width: 5.5em; }
.snd-slot .snd-name { color: var(--muted); font-size: .9em; }

/* Accueil : groupes de tuiles */
.home-group { display: flex; flex-direction: column; gap: 10px; }
.home-group-title { margin: 0; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.home-sep { border: 0; border-top: 1px solid var(--line); margin: 8px 0; width: 100%; }

/* Règles : cartes d'exemple des combinaisons */
.hand-cards { display: flex; gap: 6px; flex-wrap: wrap; }
.pcard { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 40px; height: 56px; border-radius: 6px; background: #F7F4EA; color: #1A1408; font-weight: 700; font-size: 16px; line-height: 1.1; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.pcard--red { color: #B3261E; }
.pcard--dim { opacity: .45; }
/* Tables des joueurs : plusieurs tables par ligne, mode grand écran */
.tables-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; align-items: start; }
.when-screen { display: none; }
body.is-screen .when-normal { display: none; }
body.is-screen .when-screen { display: inline; }
body.is-screen .card--me { border-color: var(--line); background: var(--surface); box-shadow: none; }
body.is-screen .topbar, body.is-screen .tabbar, body.is-screen .page-head > p, body.is-screen .chips { display: none; }
body.is-screen .app { display: block; max-width: none; }
body.is-screen .main { max-width: none; padding: 24px 32px; }
body.is-screen .tables-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
body.is-screen .prow, body.is-screen .tables-grid h2 { font-size: 1.15em; }

.withdraw-form { max-width: 560px; }

/* Ordinateur : l'en-tête (titre AllinTournoi) reste en haut et le menu de gauche reste en place, dessous, sans le recouvrir */
@media (min-width: 1100px) {
  .topbar { position: sticky; top: 0; z-index: 60; background: var(--bg); }
  .tabbar { top: 76px; }
}

/* Logo du tournoi (à côté du nom) et fond d'écran de la projection */
.t-logo { height: 1.4em; width: auto; max-width: 3.2em; object-fit: contain; vertical-align: middle; margin-right: .35em; border-radius: 4px; }
.t-logo--preview { display: block; height: 64px; max-width: 160px; margin: 6px 0; }
.t-wall--preview { display: block; max-width: 220px; max-height: 120px; border-radius: 8px; margin: 6px 0; }
.proj-view--chrono.has-wallpaper { position: relative; isolation: isolate; }
.proj-wall { position: fixed; inset: 0; z-index: -1; background-position: center; background-size: cover; background-repeat: no-repeat; opacity: .25; pointer-events: none; }
.proj-h .t-logo { height: 1.2em; }
.img-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; align-items: start; }
.fiche-media { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.fiche-media > fieldset { min-width: 0; }
.prow select.select, form select[name="killer_id"] { max-width: 12em; min-height: 36px; padding: 0 8px; }

.fiche-top { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
@media (min-width: 1100px) { .fiche-top { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.avatar-dot--top { width: 34px; height: 34px; }

/* Jetons : fiche du tournoi et projection */
.chip-rows { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.chip-row { display: flex; gap: 8px; align-items: center; }
.chip-row input[type="number"] { min-width: 0; flex: 1; }
.chip-row input[type="color"] { width: 44px; flex: none; padding: 2px; }
.chip-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.chip-list li { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.chip-list li.is-out { opacity: .3; }
.chip-disc { display: inline-flex; align-items: center; justify-content: center; width: 3.4em; height: 3.4em; border-radius: 50%; background: var(--chip); color: var(--ink); font-weight: 700; font-size: .95em; box-shadow: inset 0 0 0 .22em var(--chip), inset 0 0 0 .3em rgba(255, 255, 255, .85), 0 1px 3px rgba(0, 0, 0, .5); border: .18em dashed rgba(255, 255, 255, .8); box-sizing: border-box; }
.proj-chips .chip-disc { font-size: clamp(11px, calc(1.1 * var(--pvw)), 18px); }

/* Championnats : tableau de classement */
.rank-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.rank-table th, .rank-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line, rgba(255,255,255,.12)); white-space: nowrap; }
.rank-table th.num, .rank-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.rank-table thead th { font-size: 13px; color: var(--muted); font-weight: 600; }
.rank-table tr.is-me { background: var(--surface-hover, rgba(255,255,255,.06)); }

/* tous les jetons ont la taille du 25 ; une valeur longue (10 000…) reste sur une ligne, en noir (elle déborde sur le liseret blanc) */
.chip-disc--long, .chip-disc--xlong, .proj-chips .chip-disc--long, .proj-chips .chip-disc--xlong { color: #000; letter-spacing: -.03em; white-space: nowrap; text-shadow: 0 0 .18em rgba(255, 255, 255, .85); }

/* Barème des points : grille compacte de coefficients */
.scale-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.2rem, 1fr)); gap: .4rem; }
.scale-cell { display: flex; flex-direction: column; gap: .15rem; font-size: .8rem; }
.scale-cell input { width: 100%; box-sizing: border-box; text-align: right; }

/* Résultats : liste des tournois et classement côte à côte sur grand écran, défilement interne */
.results-grid { display: grid; gap: 1rem; align-items: start; }
@media (min-width: 900px) { .results-grid { grid-template-columns: minmax(18rem, 2fr) 3fr; } }
.scroll-box { max-height: 65vh; overflow-y: auto; }
.results-grid > details > summary { cursor: pointer; }
.rank-table thead th { position: sticky; top: 0; background: var(--surface, #fff); }

/* Résultats : tournoi affiché à droite entouré d'un liseret */
.results-grid .prow[aria-current="true"] { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }

/* Barre du haut : AllinTournoi n'est plus cliquable, « Accueil » à sa droite */
.topbar .brand { cursor: default; }
.topbar-home { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--text); text-decoration: none; font-weight: 600; font-size: .95rem; }
.topbar-home:hover { background: var(--surface-hover); }
.topbar-home[aria-current="page"] { border-color: var(--gold); color: var(--gold); }
.topbar-home .icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.topbar-home + .who { margin-left: auto; }
@media (max-width: 480px) { .topbar-home span { display: none; } .topbar-home { padding: 8px; } }
/* Modes d'emploi */
.guide-list { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: .6rem; line-height: 1.5; }
/* --- Ajustements d'affichage (27/10) --- */
/* défilement vertical interne pour les longues listes */
.scroll-box--tall { max-height: 70vh; }
.scroll-box--both { max-height: 70vh; overflow: auto; }
details > summary { cursor: pointer; }
details > summary ~ * { margin-top: .75rem; }
/* deux groupes côte à côte sur PC */
.two-cols { display: grid; gap: 1rem; align-items: start; }
@media (min-width: 900px) { .two-cols { grid-template-columns: 1fr 1fr; } }
/* classement du championnat : en-tête, 2 premières colonnes et total toujours visibles */
.rank-table--champ { border-collapse: separate; border-spacing: 0; }
.rank-table--champ thead th { position: sticky; top: 0; z-index: 3; background: var(--surface); }
.rank-table--champ th:nth-child(1), .rank-table--champ td:nth-child(1) { position: sticky; left: 0; z-index: 2; background: var(--surface); min-width: 3rem; }
.rank-table--champ th:nth-child(2) { position: sticky; left: 3rem; z-index: 2; background: var(--surface); }
.rank-table--champ thead th:nth-child(-n+2) { z-index: 4; }
.rank-table--champ .col-total { position: sticky; right: 0; z-index: 2; background: var(--surface-active, var(--surface)); border-left: 2px solid var(--gold); color: var(--gold); font-size: 1.05em; }
.rank-table--champ thead .col-total { z-index: 4; }
/* Tables d'un joueur : 4 par ligne sur PC (pas de bouton Sortir) */
@media (min-width: 1100px) { body:not(.is-screen) .page-tables .tables-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 800px) and (max-width: 1099px) { body:not(.is-screen) .page-tables .tables-grid { grid-template-columns: repeat(3, 1fr); } }

/* Mode d'emploi : remarques (Important / Astuce / Note) */
.guide-note { margin: 0; padding: 10px 12px; border-left: 3px solid var(--gold); background: var(--surface-hover); border-radius: 6px; }
.guide-note--warn { border-left-color: var(--warn, #e0a030); }
/* Titre de section repliable : flèche visible (▸ fermé, ▾ ouvert) */
.fold-title { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.fold-title::-webkit-details-marker { display: none; }
.fold-title::before { content: "\25B8"; color: var(--gold); font-size: 22px; line-height: 1; }
details[open] > .fold-title::before { content: "\25BE"; }
.fold-title .section-title { margin: 0; }

/* Menu : groupes Joueur / Organisateur / Admin séparés par un liseret */
.tabbar a.tab-sep { border-left: 1px solid var(--line-strong); border-radius: 0 10px 10px 0; margin-left: 4px; }
@media (min-width: 1100px) {
  .tabbar a.tab-sep { border-left: 0; border-radius: 12px; margin-left: 0; margin-top: 8px; position: relative; }
  .tabbar a.tab-sep::before { content: ""; position: absolute; left: 14px; right: 14px; top: -6px; border-top: 1px solid var(--line-strong); }
}
/* Création de compte à droite de la liste (PC) */
@media (min-width: 900px) { .two-cols--list { grid-template-columns: 3fr 2fr; } }

/* Sponsors : encart en bas à droite de la projection (carrousel) */
.proj-sponsor { position: relative; margin-top: auto; width: 100%; height: var(--sponsor-h, calc(14 * var(--pvh))); flex: 0 0 auto; background: var(--c-green); border-radius: calc(1 * var(--pvmin)); overflow: hidden; }
.proj-sponsor__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .6s; }
.proj-sponsor__img.is-on { opacity: 1; }

/* Boutons « Parcourir… » en français (le texte natif dépend de la langue du navigateur) */
input[type="file"].file-native { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.file-fr { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.file-fr__name { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
input[type="file"].file-native:focus-visible + .file-fr .btn { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Chip race : bannière de l'organisateur (2 dernières minutes d'un niveau) */
.chip-race-banner { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 50; width: min(94vw, 720px); text-align: left; cursor: pointer;
  background: var(--c-gold); color: var(--gold-ink, #1A1408); border: 0; border-radius: 12px; padding: 12px 16px; font: inherit; font-size: 15px; line-height: 1.35; box-shadow: 0 6px 24px rgba(0, 0, 0, .45); }
.chip-race-banner span { display: block; font-size: 13px; opacity: .85; margin-top: 4px; }
@media (min-width: 1100px) { .chip-race-banner { bottom: 24px; } }

/* Séparateur entre un libellé et sa quantité : « Joueurs · 12 » */
.count::before { content: "\00B7\00A0"; opacity: .7; }

/* Animation KILL sur la projection */
.killfx { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2vmin; text-align: center; color: #fff;
  background: radial-gradient(ellipse at center, rgba(120, 0, 0, .88) 0%, rgba(0, 0, 0, .94) 70%); --fx-lead: .6s; animation: killfx-in .3s ease-out, killfx-shake .7s calc(var(--fx-lead) + .35s); transition: opacity .6s; }
.killfx--out { opacity: 0; }
.killfx--win { background: radial-gradient(ellipse at center, rgba(150, 105, 10, .9) 0%, rgba(0, 0, 0, .94) 72%); overflow: hidden; }
.killfx .killfx__word--win { color: var(--c-gold); font-size: 17vmin; text-shadow: 0 0 .15em rgba(232, 176, 74, .9), 0 .04em 0 #5a3d00; }
.killfx .killfx__line--win { font-size: 11vmin; color: #fff; }
.killfx__confetti { position: absolute; top: -4vmin; width: 1.4vmin; height: 2.4vmin; opacity: .9; animation: killfx-fall linear infinite; }
@keyframes killfx-fall { from { transform: translateY(0) rotate(0); } to { transform: translateY(110vh) rotate(720deg); } }
.killfx__flash { position: absolute; inset: 0; background: #fff; opacity: 0; animation: killfx-flash .7s calc(var(--fx-lead) + .35s) ease-out; pointer-events: none; }
.killfx__skull { font-size: 18vmin; line-height: 1; animation: killfx-slam .7s var(--fx-lead) cubic-bezier(.2, 1.6, .4, 1) both; }
.killfx__word { font-family: var(--font-num); font-weight: 700; font-size: 26vmin; line-height: .9; letter-spacing: .06em; color: #ff2d2d; text-shadow: 0 0 .15em rgba(255, 60, 60, .9), 0 .04em 0 #5a0000; animation: killfx-slam .7s calc(var(--fx-lead) + .35s) cubic-bezier(.2, 1.6, .4, 1) both; }
.killfx__line { font-size: 7vmin; font-weight: 600; animation: killfx-rise .6s calc(var(--fx-lead) + 1.1s) ease-out both; }
.killfx__killer { color: var(--c-gold); }
.killfx__arrow { opacity: .8; }
.killfx__rank { font-size: 3.6vmin; opacity: .85; animation: killfx-rise .6s calc(var(--fx-lead) + 1.5s) ease-out both; }
@keyframes killfx-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes killfx-flash { 0% { opacity: .9; } 100% { opacity: 0; } }
@keyframes killfx-slam { from { transform: scale(3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes killfx-rise { from { transform: translateY(4vmin); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes killfx-shake { 0%, 100% { transform: translate(0, 0); } 20% { transform: translate(-1.2vmin, .8vmin); } 40% { transform: translate(1vmin, -.8vmin); } 60% { transform: translate(-.8vmin, -.6vmin); } 80% { transform: translate(.6vmin, .6vmin); } }
@media (prefers-reduced-motion: reduce) { .killfx, .killfx__skull, .killfx__word, .killfx__line, .killfx__rank, .killfx__flash { animation: none; } }

/* Portée d'une structure enregistrée (standard / club / personnelle) */
.badge { display: inline-block; font-size: .7rem; padding: .05rem .5rem; margin-left: .35rem; border-radius: 999px; background: var(--surface-2, rgba(128,128,128,.18)); color: inherit; vertical-align: middle; }

/* Champ mot de passe avec bouton Afficher / Masquer */
.pwd-wrap { position: relative; display: block; width: 100%; }
.pwd-wrap input { width: 100%; padding-right: 5.5rem; box-sizing: border-box; }
.pwd-toggle { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); background: none; border: 0; padding: 6px 8px; font: inherit; font-size: 14px; font-weight: 600; color: inherit; cursor: pointer; text-decoration: underline; }
