/* Helvetia — feuille unique. Thème sombre, mobile-first (cible 375 px). */

:root {
  --bg: #0d1116;
  --bg-2: #101620;
  --panel: #141b24;
  --panel-2: #1a232e;
  --border: #26313d;
  --border-soft: #1d2630;
  --accent: #e8974e;        /* chaud : chiffres, actions */
  --accent-dim: #f0a967;
  --accent-dark: #8c5322;
  --cool: #7fb8e6;          /* froid : liens, présence, structure */
  --text: #e9eef3;
  --muted: #8b9aa8;
  --gold: #f0c040;
  --silver: #cdd6de;
  --bronze: #c98a4b;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --radius: 14px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
  text-wrap: pretty;
}

a { color: var(--cool); }
a:hover { color: var(--text); }

.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

/* ============ En-tête / hero ============ */

.hero {
  position: relative;
  overflow: hidden;
  padding: 44px 20px 28px;
  border-bottom: 1px solid var(--border-soft);
  background:
    radial-gradient(120% 90% at 50% 118%, rgba(127, 184, 230, .12), transparent 62%),
    linear-gradient(180deg, #101620 0%, #101620 70%, var(--bg));
}

/* Courbes de niveau, 100 % CSS. */
.hero::before {
  content: "";
  position: absolute;
  inset: -10% -20% -30%;
  background: repeating-radial-gradient(circle at 50% 128%,
    transparent 0 21px, rgba(127, 184, 230, .085) 21px 22px);
  mask-image: linear-gradient(180deg, transparent, #000 45%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 45%, #000 88%, transparent);
  pointer-events: none;
}

.hero > * { position: relative; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 600 .68rem/1 var(--mono);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}
.eyebrow::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, var(--border), transparent);
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.6rem, 15vw, 4.2rem);
  line-height: .95;
  letter-spacing: -.03em;
  font-weight: 800;
}
.hero h1 .peak { color: var(--accent); }

.tagline {
  margin: 12px 0 0;
  max-width: 30ch;
  font-size: 1.02rem;
  color: var(--muted);
}
.tagline strong { color: var(--text); font-weight: 600; }

/* ---- Boîte de connexion ---- */

.connect-box {
  margin-top: 26px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px 16px;
  box-shadow: 0 14px 34px -22px #000;
}
.connect-box .label {
  display: block;
  font: 600 .66rem/1 var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}
.connect-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}
#mcAddress {
  flex: 1 1 auto;
  min-width: 0;
  font: 600 1.06rem/1.3 var(--mono);
  color: var(--accent);
  letter-spacing: -.01em;
  overflow-wrap: anywhere;
}
.copy-btn {
  flex: none;
  min-height: 44px;
  padding: 0 16px;
  background: var(--accent);
  color: #17110a;
  border: 1px solid var(--accent-dim);
  border-radius: 10px;
  font: 600 .88rem var(--sans);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.copy-btn:hover { background: var(--accent-dim); color: #17110a; }
.copy-btn:active { transform: translateY(1px); }

/* ---- Bandeau live ---- */

.live-strip {
  display: flex;
  align-items: center;
  gap: 8px 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  font-size: .88rem;
  color: var(--muted);
}
.live-strip .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--cool);
  box-shadow: 0 0 0 0 rgba(127, 184, 230, .5);
  animation: pulse 2.4s infinite;
  flex: none;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 9px rgba(127, 184, 230, 0); }
  100% { box-shadow: 0 0 0 0 rgba(127, 184, 230, 0); }
}
.live-players { display: flex; gap: 6px; flex-wrap: wrap; }
.live-player {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1a2430;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px 3px 4px;
  color: var(--text);
  font-size: .84rem;
}

/* ============ Structure ============ */

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 26px 16px 64px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 20px 16px;
}
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }

.card h2 {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin: 0 0 4px;
  font-size: 1.14rem;
  letter-spacing: -.01em;
}
.card h2 .ico { font-size: 1.05rem; }
.card h2 .step {
  margin-left: auto;
  font: 600 .64rem/1 var(--mono);
  letter-spacing: .14em;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 8px;
  flex: none;
}

.card p { font-size: .94rem; }
.hint { color: var(--muted); font-size: .84rem; }
.muted { color: var(--muted); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  background: var(--accent);
  color: #17110a;
  border: 1px solid var(--accent-dim);
  border-radius: 11px;
  text-decoration: none;
  font-weight: 650;
  font-size: .95rem;
  margin-top: 12px;
  transition: background .15s, color .15s;
}
.btn:hover { background: #f5bd85; color: #17110a; }
.btn.secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn.secondary:hover { border-color: var(--cool); color: var(--cool); background: #172130; }
.btn .arrow { font-size: 1.05em; }

/* ============ Mods ============ */

.versions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0 4px;
}
.chip {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  min-width: 104px;
}
.chip span {
  font: 600 .6rem/1 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.chip strong { font: 650 1rem/1.3 var(--mono); color: var(--text); }

.mods-table { width: 100%; border-collapse: collapse; margin: 14px 0 4px; }
.mods-table thead { display: none; }
.mods-table tbody, .mods-table tr, .mods-table td { display: block; }
.mods-table tr {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-soft);
}
.mods-table tr:last-child { border-bottom: none; }
.mods-table td { padding: 0; }
.mods-table td.mod-name {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: var(--text);
  overflow-wrap: anywhere;
}
.mod-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  font: 600 .95rem/1.35 var(--sans);
}
a.mod-link { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border); }
a.mod-link:hover { color: var(--accent); border-bottom-color: var(--accent); }
a.mod-link .arrow { font-size: .78em; color: var(--muted); }
a.mod-link:hover .arrow { color: var(--accent); }
.mod-tag {
  font: 600 .64rem/1 var(--sans);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 7px;
}
.mod-desc { font-size: .84rem; line-height: 1.45; color: var(--muted); }
.mod-file { font: .7rem/1.3 var(--mono); color: var(--muted); opacity: .6; }
.mod-size { font: .78rem var(--mono); color: var(--muted); }
a.dl {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--cool);
  text-decoration: none;
  font-size: .82rem;
  font-weight: 600;
}
a.dl:hover { border-color: var(--cool); color: var(--cool); background: #172130; }
.mods-table td[colspan] { grid-column: 1 / -1; color: var(--muted); font-size: .9rem; }

.howto {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: s;
  display: grid;
  gap: 10px;
}
.howto li {
  counter-increment: s;
  position: relative;
  padding-left: 30px;
  color: var(--muted);
  font-size: .9rem;
}
.howto li::before {
  content: counter(s);
  position: absolute;
  left: 0; top: 1px;
  width: 21px; height: 21px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: 600 .72rem var(--mono);
  color: var(--cool);
}
.howto code, .card p code {
  font: .82em var(--mono);
  background: #101720;
  border: 1px solid var(--border-soft);
  border-radius: 5px;
  padding: 1px 5px;
  color: var(--text);
  overflow-wrap: anywhere;
}

/* ============ Chiffres ============ */

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}
.fact {
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  border-radius: 11px;
  padding: 11px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.fact-icon { font-size: .95rem; line-height: 1.4; opacity: .85; }
.fact strong {
  font: 650 1.18rem/1.15 var(--mono);
  color: var(--accent);
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
.fact span:last-child { font-size: .76rem; color: var(--muted); line-height: 1.35; }
.fact strong.cap { text-transform: capitalize; letter-spacing: -.01em; }

/* Les trois premières cartes portent le récit : pleine largeur, chiffre géant. */
.facts .fact:nth-child(-n+3) {
  grid-column: 1 / -1;
  background:
    radial-gradient(100% 140% at 0% 0%, rgba(232, 151, 78, .07), transparent 70%),
    var(--panel-2);
  border-color: var(--border);
  padding: 14px 16px 16px;
}
.facts .fact:nth-child(-n+3) strong { font-size: 2.15rem; letter-spacing: -.035em; }
.facts .fact:nth-child(-n+3) span:last-child { font-size: .88rem; }
.facts .fact:nth-child(-n+3) .fact-icon { font-size: 1.1rem; }

.verdict {
  margin: 16px 0 0;
  padding: 14px 16px;
  border-left: 2px solid var(--accent);
  background: #131a23;
  border-radius: 0 11px 11px 0;
  font-size: .95rem;
  color: var(--text);
}
.verdict b { color: var(--accent); font-family: var(--mono); font-weight: 650; }

/* ============ Classements ============ */

.board-tabs {
  display: flex;
  gap: 6px;
  margin: 16px -16px 14px;
  padding: 2px 16px 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.board-tabs::-webkit-scrollbar { display: none; }
.board-tab {
  flex: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 13px;
  font: 500 .82rem var(--sans);
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.board-tab:hover { border-color: var(--cool); color: var(--text); }
.board-tab.active {
  background: var(--cool);
  border-color: var(--cool);
  color: #0d1116;
  font-weight: 650;
}

.board { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.board li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 9px;
  overflow: hidden;
  isolation: isolate;
}
.board .bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--p, 0%);
  background: linear-gradient(90deg, rgba(232, 151, 78, .15), rgba(232, 151, 78, .03));
  border-right: 1px solid rgba(232, 151, 78, .3);
  z-index: -1;
  transition: width .4s cubic-bezier(.2, .7, .3, 1);
}
.board .rank {
  flex: none;
  width: 22px;
  font: 650 .84rem var(--mono);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.board .value {
  margin-left: auto;
  font: 650 .96rem var(--mono);
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.board li > span:not(.rank):not(.value):not(.bar) { min-width: 0; overflow-wrap: anywhere; }
.board .rank-1 { background: rgba(240, 192, 64, .05); }
.board .rank-1 .rank { color: var(--gold); }
.board .rank-1 .value { color: var(--accent); font-size: 1.06rem; }
.board .rank-1 .bar { background: linear-gradient(90deg, rgba(240, 192, 64, .16), rgba(240, 192, 64, .04)); border-right-color: rgba(240, 192, 64, .3); }
.board .rank-2 .rank { color: var(--silver); }
.board .rank-3 .rank { color: var(--bronze); }
.board li.muted { color: var(--muted); font-size: .9rem; }

/* ============ Tableau joueurs ============ */

.table-scroll {
  overflow-x: auto;
  margin: 14px -16px 0;
  padding: 0 16px;
  /* Pas de -webkit-overflow-scrolling: touch : cette propriete heritee
     d'iOS 12 casse position:sticky dans Safari iOS, et le defilement
     inertiel est natif depuis iOS 13. */
}
.stats-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .86rem;
  white-space: nowrap;
}
.stats-table th, .stats-table td {
  text-align: right;
  padding: 9px 8px;
  border-bottom: 1px solid var(--border-soft);
}
.stats-table th {
  position: sticky; top: 0;
  color: var(--muted);
  font: 600 .74rem var(--mono);
  letter-spacing: .06em;
  background: var(--panel);
}
.stats-table td { font-variant-numeric: tabular-nums; }
.stats-table th:first-child, .stats-table td:first-child {
  text-align: left;
  position: sticky;
  /* -16px, et non 0: le conteneur deborde de 16px a gauche (margin negative
     + padding). Sans ce decalage, une bande laisse defiler les chiffres
     derriere les pseudos. */
  left: -16px;
  /* Sans z-index, les cellules de chiffres arrivent au ras du pseudo. */
  z-index: 2;
  background: var(--panel);
  padding-left: 0;
  padding-right: 12px;
  /* Ombre marquee: un chiffre a moitie masque doit se lire comme cache,
     pas comme une valeur plus petite. */
  box-shadow: 8px 0 10px -4px rgba(0,0,0,.75);
}
/* L'en-tete doit rester au-dessus de la colonne collee ET des chiffres. */
.stats-table th:first-child { z-index: 3; }
.stats-table tbody tr:hover td { background: var(--panel-2); }
.stats-table tbody tr:hover td:first-child { background: var(--panel-2); }
.stats-table td[colspan] { text-align: left; color: var(--muted); }
.player-cell { display: flex; align-items: center; gap: 8px; }
.zero { color: #5b6875; }

.head {
  width: 24px; height: 24px;
  border-radius: 5px;
  image-rendering: pixelated;
  background: #26313d;
  vertical-align: middle;
  flex: none;
}

/* ============ Chargement ============ */

.skel {
  border-radius: 8px;
  background: linear-gradient(90deg, #18202a, #1e2833, #18202a);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  color: transparent;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.skel-line { height: 14px; margin: 10px 0; }

footer {
  border-top: 1px solid var(--border-soft);
  color: var(--muted);
  font-size: .8rem;
  padding: 22px 16px 34px;
  text-align: center;
}
footer p { margin: 0 auto; max-width: 46ch; }
footer .sig { display: block; margin-top: 8px; font-family: var(--mono); letter-spacing: .12em; opacity: .6; }

/* ============ Écrans larges ============ */

@media (min-width: 700px) {
  .hero { padding: 64px 28px 34px; }
  .hero-inner, main { max-width: 760px; margin: 0 auto; }
  .connect-box { display: flex; flex-direction: column; }
  .card { padding: 26px 28px; }
  .card h2 { font-size: 1.28rem; }
  .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
  .facts .fact:nth-child(-n+3) { grid-column: span 2; }
  .facts .fact:nth-child(1) { grid-column: 1 / -1; }
  .facts .fact:nth-child(1) strong { font-size: 3rem; }
  .mods-table tr { grid-template-columns: 1fr auto auto; gap: 0 16px; padding: 9px 0; }
  .mods-table td.mod-name { grid-column: auto; }
  .board-tabs { flex-wrap: wrap; overflow: visible; margin: 18px 0 16px; padding: 0; }
  .table-scroll { margin: 16px 0 0; padding: 0; }
  /* Sans padding lateral ici, le decalage de -16px ferait deborder. */
  .stats-table th:first-child, .stats-table td:first-child { left: 0; }
  .facts .fact:nth-child(-n+3) span:last-child { font-size: .92rem; }
}

/* Minimalisme : pas d'emoji décoratif dans les titres ni devant les chiffres. */
.card h2 .ico, .fact-icon { display: none; }
.card h2 { margin-bottom: 6px; }

/* ============ Navigation ============ */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(13, 17, 22, .82);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border-soft);
}
.nav-brand {
  font-weight: 800;
  font-size: 1.02rem;
  letter-spacing: -.02em;
  color: var(--text);
  text-decoration: none;
}
.nav-brand .peak { color: var(--accent); }
.nav-links { display: flex; gap: 4px; }
.nav-link {
  padding: 7px 13px;
  border-radius: 999px;
  font-size: .88rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid transparent;
  white-space: nowrap;
}
.nav-link:hover { color: var(--text); background: var(--panel); }
.nav-link.active {
  color: var(--accent);
  border-color: var(--border);
  background: var(--panel);
}

/* Hero raccourci sur les pages secondaires : la marque est deja dans la nav. */
.hero-compact { padding-top: 26px; }
.hero-compact h1 { font-size: clamp(2rem, 9vw, 2.8rem); }

.hero-cta { margin: 16px 0 0; font-size: .9rem; color: var(--muted); }
.hero-cta a { font-weight: 600; text-decoration: none; }
.hero-cta a:hover { text-decoration: underline; }

.card-quiet { background: transparent; border-style: dashed; }

@media (min-width: 700px) {
  .nav { padding: 12px 28px; }
  .hero { padding: 48px 28px 34px; }
}

/* .step etait prevu comme badge aligne a droite (margin-left:auto). Pour une
   procedure numerotee, le numero se lit mieux devant le titre. */
.card h2 .step { margin-left: 0; }

/* ============ Fiche joueur ============ */

/* Lignes cliquables du classement et du tableau des joueurs. */
.board li[data-uuid], .stats-table tbody tr[data-uuid] { cursor: pointer; }
.board li[data-uuid]:focus-visible,
.stats-table tbody tr[data-uuid]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.board li[data-uuid]:hover { background: var(--panel-2); }

body.modal-open { overflow: hidden; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(6, 9, 13, .72);
  backdrop-filter: blur(3px);
}
.modal[hidden] { display: none; }

.modal-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 640px;
  max-height: 82vh;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: 0 -20px 60px -30px #000;
}
.modal-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 16px 10px;
  border-bottom: 1px solid var(--border-soft);
}
/* Poignee: signale que la feuille se referme, la ou le pouce arrive d'abord. */
.modal-head::before {
  content: "";
  position: absolute;
  top: 6px; left: 50%;
  transform: translateX(-50%);
  width: 38px; height: 4px;
  border-radius: 999px;
  background: var(--border);
}
.modal-head h3 { margin: 0; font-size: 1.1rem; flex: 1; }
.modal-close {
  flex: none;
  /* 44x44: minimum recommande pour une cible tactile (Apple, WCAG 2.5.5).
     32px etait trop petit et trop peu contraste pour etre trouve au doigt. */
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
}
.modal-close:hover { color: var(--text); border-color: var(--cool); }

/* En-tete et onglets ne doivent pas etre comprimes par le corps en flex:1. */
.modal-head { flex: none; }
#modalTabs { flex: none; margin: 12px 16px 10px; }

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 18px;
  -webkit-overflow-scrolling: touch;
}

.stat-list { width: 100%; border-collapse: collapse; }
.stat-list td {
  padding: 7px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: .88rem;
  color: var(--muted);
}
.stat-list tr:last-child td { border-bottom: none; }
.stat-value {
  text-align: right;
  white-space: nowrap;
  padding-left: 12px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-family: var(--mono);
}

@media (min-width: 700px) {
  .modal { align-items: center; padding: 24px; }
  .modal-card { border-radius: var(--radius); max-height: 82vh; }
}

/* ============ Encart monde (jour, heure, météo) ============ */

.world-info {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}
.world-info[hidden] { display: none; }
.wi {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  font-size: .82rem;
  color: var(--muted);
}
.wi b { color: var(--text); font-weight: 650; }

/* Dimension du joueur connecté, dans le bandeau live. */
.live-player[data-uuid] { cursor: pointer; }
.live-player .dim { font-size: .82em; margin-left: 2px; }

/* ============ Carte intégrée ============ */

.map-embed {
  position: relative;
  margin: 14px 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel-2);
  aspect-ratio: 4 / 3;
}
.map-poster {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 20px;
  text-align: center;
  /* Rappel discret d'une carte, sans image à charger. */
  background:
    radial-gradient(90% 70% at 50% 0%, rgba(127, 184, 230, .10), transparent 70%),
    repeating-linear-gradient(0deg, transparent 0 23px, var(--border-soft) 23px 24px),
    repeating-linear-gradient(90deg, transparent 0 23px, var(--border-soft) 23px 24px);
}
.map-poster p { margin: 0; max-width: 34ch; font-size: .9rem; color: var(--muted); }
.map-embed.loaded .map-poster { display: none; }
.map-embed iframe { display: block; width: 100%; height: 100%; border: 0; }
.map-full { display: inline-block; font-size: .88rem; font-weight: 600; text-decoration: none; }
.map-full:hover { text-decoration: underline; }

@media (min-width: 700px) {
  .map-embed { aspect-ratio: 16 / 9; }
}

/* ============ Mur des morts et Ledger ============ */

.big {
  font: 700 1.5rem/1 var(--mono);
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.split { display: grid; gap: 22px; margin-top: 16px; }
.split h3 {
  margin: 0 0 10px;
  font-size: .76rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.board.compact li { padding: 6px 0; font-size: .88rem; }
.board-label { flex: 1; overflow-wrap: anywhere; }

.feed { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.feed li {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: .87rem;
  color: var(--muted);
}
.feed li:last-child { border-bottom: none; }
.feed-when {
  flex: none;
  font: .74rem var(--mono);
  color: var(--muted);
  opacity: .7;
}
.feed b { color: var(--text); font-weight: 650; }

@media (min-width: 700px) {
  .split { grid-template-columns: 1fr 1fr; gap: 22px 28px; }
}

/* ============ Tri ============ */

.stats-table th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.stats-table th.sortable:hover { color: var(--text); }
.stats-table th.sortable::after {
  content: "";
  display: inline-block;
  width: .7em;
  margin-left: 3px;
  opacity: .35;
}
/* Fleche seulement sur la colonne active, pour ne pas charger l'en-tete. */
.stats-table th.sortable[data-dir="desc"]::after { content: "↓"; opacity: 1; }
.stats-table th.sortable[data-dir="asc"]::after { content: "↑"; opacity: 1; }
.stats-table th.sorted { color: var(--accent); }
.stats-table th.sortable:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.order-btn {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin: 0 0 12px;
  padding: 0 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font: 600 .8rem var(--sans);
  cursor: pointer;
}
.order-btn:hover { color: var(--text); border-color: var(--cool); }

/* ============ Dernières connexions ============ */

.joins { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 2px; }
.joins li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: .9rem;
}
.joins li:last-child { border-bottom: none; }
.joins li[data-uuid] { cursor: pointer; }
.joins li[data-uuid]:hover { background: var(--panel-2); }
.joins li[data-uuid]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.join-when { margin-left: auto; font-size: .82rem; color: var(--muted); white-space: nowrap; }
.join-when.online {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-weight: 600;
}
.join-when.online::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ============ Encart "ce mois-ci" ============ */

.month-card { border-color: var(--border); }
.month-name { font-weight: 500; color: var(--muted); font-size: .78em; }
.month-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}
.month-tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
}
.month-tile strong {
  font: 700 1.35rem/1 var(--mono);
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.month-tile span { font-size: .8rem; color: var(--muted); }

@media (min-width: 700px) {
  .month-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ============ Bloc à période variable ============ */

/* Le selecteur ne surplombe que les cartes qui le suivent: le tableau cumule
   est place au-dessus, hors de sa portee. */
.scope { display: contents; }
.periods {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 6px -16px 0;
  padding: 0 16px 2px;
}
.period {
  flex: none;
  min-height: 36px;
  padding: 0 15px;
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  color: var(--muted);
  font: 600 .86rem var(--sans);
  cursor: pointer;
  white-space: nowrap;
}
.period:hover { color: var(--text); }
.period.active {
  color: var(--accent);
  border-color: var(--border);
  background: var(--panel-2);
}
.period[disabled] { opacity: .5; cursor: progress; }

.scope-note { margin: 0; font-size: .86rem; color: var(--muted); }
.scope-note b { color: var(--text); font-weight: 650; }

@media (min-width: 700px) {
  .periods { margin: 6px 0 0; padding: 0 0 2px; }
}

/* ============ Squelettes de chargement ============ */

/* Hauteurs calees sur le contenu reel (mesurees: ligne 33 px, fil 38 px,
   tuile 69 px) pour que la page ne se decale pas au remplacement. */
/* `.board.compact li` (0,2,1) l'emporterait sur `.skel-row` (0,1,0): on
   qualifie le selecteur pour que la hauteur calee soit bien appliquee. */
.board li.skel-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
}
/* Largeurs variables: une colonne de barres identiques ferait faux. */
.skel-name { flex: 1; height: 13px; max-width: 60%; }
.skel-row:nth-child(3n) .skel-name { max-width: 45%; }
.skel-row:nth-child(3n+1) .skel-name { max-width: 72%; }
.skel-val { width: 46px; height: 13px; flex: none; }
.skel-row:nth-child(2n) .skel-val { width: 62px; }

.skel-num { display: block; width: 78px; height: 26px; }
.skel-lbl { display: block; width: 58px; height: 11px; margin-top: 4px; }

.feed li:has(.skel-when) { min-height: 38px; align-items: center; }
.feed .skel-when { width: 92px; height: 13px; flex: none; }
.feed .skel-msg { flex: 1; height: 13px; max-width: 68%; }
.feed li:nth-child(2n) .skel-msg { max-width: 52%; }
/* ============ Croisement de mesures ============ */

.cross-picker {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 10px;
  margin: 16px 0 18px;}
.cross-field { display: flex; flex-direction: column; gap: 6px; min-width: 0;}
.cross-label {
  font: 600 .64rem/1 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);}
.cross-select {
  width: 100%;
  min-height: 44px;
  padding: 0 30px 0 12px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  font: 500 .92rem var(--sans);
  cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 20px, calc(100% - 11px) 20px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  text-overflow: ellipsis;}
.cross-select:hover { border-color: var(--cool);}
.cross-select:focus-visible { outline: 2px solid var(--cool); outline-offset: 1px;}
.cross-swap {
  flex: none;
  width: 44px; height: 44px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  font: 400 1.15rem/1 var(--mono);
  cursor: pointer;
  transition: color .15s, border-color .15s;}
.cross-swap:hover { color: var(--cool); border-color: var(--cool);}
.cross-result {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 16px 18px 17px;
  background:
    radial-gradient(100% 140% at 0% 0%, rgba(232, 151, 78, .09), transparent 70%),
    var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;}
.cross-result strong {
  font: 650 2.6rem/1.05 var(--mono);
  letter-spacing: -.04em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;}
.cross-result span { font-size: .92rem; color: var(--muted);}
.cross-note {
  margin: 8px 0 0;
  font: .76rem/1.5 var(--mono);
  color: var(--muted);
  overflow-wrap: anywhere;}
.cross-board { margin-top: 18px;}
#crossExclusion { margin-top: 10px;}

/* ============ Sous-menu Joueurs ============ */

/* Les .nav-link freres s'etirent sur la hauteur de la barre (align-items par
   defaut). Imbrique dans .nav-drop, celui des joueurs gardait sa hauteur
   naturelle et se calait 4 px plus haut: on lui rend le meme comportement. */
.nav-drop {
  position: relative;
  display: flex;
  align-items: stretch;
}
.nav-drop > .nav-link {
  display: flex;
  align-items: center;
}
.nav-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 190px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 18px 40px -18px #000;
  display: none;
  z-index: 30;
}
/* Ouverture au survol ET au focus clavier, pour rester atteignable au Tab. */
.nav-drop:hover .nav-menu,
.nav-drop:focus-within .nav-menu { display: block; }
.nav-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: .86rem;
  font-weight: 600;
  white-space: nowrap;
}
.nav-menu a:hover { color: var(--text); background: var(--panel-2); }

/* ============ Page profil ============ */

.profil-tete { display: flex; align-items: center; gap: 16px; }
.profil-head {
  width: 72px; height: 72px;
  flex: none;
  border-radius: 12px;
  image-rendering: pixelated;
}
.profil-titre {
  margin: 0;
  font: 600 .74rem var(--sans);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}
.profil-nom { margin: 2px 0 6px; font-size: 1.7rem; letter-spacing: -.02em; }
.profil-phrase { margin: 0; color: var(--muted); font-size: .95rem; }
.profil-tuiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.podiums, .signature, .piques { list-style: none; margin: 14px 0 0; padding: 0; }
.podiums li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: .92rem;
}
.podiums li:last-child, .signature li:last-child { border-bottom: none; }
.podiums .value { margin-left: auto; }
.podium-rang {
  flex: none;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 8px;
  font: 700 .8rem var(--mono);
  background: var(--panel-2);
  color: var(--muted);
}
.podium-1 .podium-rang { background: rgba(240,192,64,.16); color: var(--gold); }
.podium-2 .podium-rang { background: rgba(205,214,222,.12); color: var(--silver); }
.podium-3 .podium-rang { background: rgba(201,138,75,.14); color: var(--bronze); }

.signature li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
}
.sig-t { flex: none; min-width: 148px; font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sig-v { font-weight: 650; color: var(--text); }
.sig-d { margin-left: auto; font: .8rem var(--mono); color: var(--muted); }

.piques { display: grid; gap: 10px; }
.piques li {
  padding: 11px 13px;
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  font-size: .9rem;
  color: var(--muted);
}

@media (min-width: 700px) {
  .profil-tuiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .profil-head { width: 88px; height: 88px; }
  .profil-nom { font-size: 2.1rem; }
}
.nav-drop.open .nav-menu { display: block; }
.nav-menu-all {
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 4px;
  padding-bottom: 9px !important;
  color: var(--accent) !important;
}
@media (max-width: 699px) {
  /* Au doigt, le menu occupe la largeur sous la barre plutot qu'une colonne
     etroite collee au bord droit. */
  .nav-menu { right: -8px; min-width: 200px; max-height: 70vh; }
}

/* Biographie: colonne étroite et interlignage aéré, ça se lit comme un texte. */
.bio { margin-top: 14px; max-width: 62ch; }
.bio p {
  margin: 0 0 12px;
  font-size: .96rem;
  line-height: 1.65;
  color: var(--muted);
}
.bio p:first-child { color: var(--text); font-size: 1.02rem; }
.bio p:last-child {
  margin-bottom: 0;
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
  color: var(--accent);
  font-style: italic;
}
