/* ============================================================
   La Taverne des Flâneurs — thème « crépuscule à la taverne »
   Nuit chaude, lumière de lanterne, papier crème.
   Les couleurs et polices se règlent dans les variables ci-dessous.
   ============================================================ */
:root {
  /* Fonds sombres et chauds */
  --bg: #1b1410;
  --bg-2: #221810;
  --surface: #2a1d16;      /* panneaux sombres (c'est aussi le fond des graphiques) */
  --surface-2: #35251b;    /* champs, survol */
  --line: rgba(255, 214, 153, .12);
  --line-strong: rgba(255, 214, 153, .26);

  /* Lumières */
  --lantern: #ffc56b;
  --lantern-deep: #f2a240;
  --glow: #ffe3ad;
  --peach: #f0916a;

  /* Papier */
  --cream: #fcf3df;
  --cream-2: #f3e4c6;
  --paper-line: #dfcba0;
  --ink: #33231a;
  --ink-soft: #6a5444;
  --ink-accent: #9a5a14;

  /* Texte sur fond sombre */
  --text: #f7ecd9;
  --text-soft: #dccbb3;
  --text-muted: #b3a08a;
  --good: #8ed081;

  --radius: 20px;
  --radius-sm: 12px;
  --topbar-h: 68px;
  --shadow: 0 22px 44px -22px rgba(0, 0, 0, .7);
  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-hand: 'Caveat', 'Segoe Print', cursive;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 12px); }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 520px at 88% 4%, rgba(240, 145, 106, .10), transparent 70%),
    radial-gradient(800px 600px at 4% 38%, rgba(255, 197, 107, .06), transparent 70%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 40%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, svg, video { max-width: 100%; }
a { color: var(--lantern); text-underline-offset: 3px; }
a:hover { color: var(--glow); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
button, input, select { font: inherit; color: inherit; }
::selection { background: var(--lantern); color: var(--ink); }
:focus-visible { outline: 2px solid var(--lantern); outline-offset: 3px; border-radius: 6px; }
.paper :focus-visible { outline-color: var(--ink-accent); }

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 780px; }
.muted { color: var(--text-muted); }
.small { font-size: .85em; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--lantern); color: var(--ink); padding: 10px 16px; border-radius: 999px; font-weight: 800; text-decoration: none; transition: top .2s; }
.skip-link:focus { top: 12px; color: var(--ink); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  padding: .85em 1.5em; border: 0; border-radius: 999px;
  font-family: var(--font-body); font-weight: 800; font-size: 1rem; line-height: 1.1;
  text-decoration: none; cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.btn-primary {
  background: linear-gradient(180deg, #ffd88f, #f5a843);
  color: #3b2207;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 14px 30px -12px rgba(245, 168, 67, .7);
}
.btn-primary:hover { color: #3b2207; transform: translateY(-2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 20px 36px -12px rgba(245, 168, 67, .85); }
.btn-primary:active { transform: translateY(0); }
.btn-lg { font-size: 1.1rem; padding: 1em 1.75em; }
.btn-ghost { background: transparent; color: var(--lantern); border: 1px solid var(--line-strong); }
.btn-ghost:hover { background: rgba(255, 197, 107, .08); }
.btn-icon { width: 1.25em; height: 1.25em; flex: none; }

/* ---------- Barre du haut ---------- */
.demo-banner {
  position: relative; z-index: 60;
  background: repeating-linear-gradient(45deg, #6b3d10 0 14px, #5a330d 14px 28px);
  color: #fff3d6; text-align: center; padding: 8px 16px; font-size: .9rem;
}
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 clamp(16px, 4vw, 40px);
  transition: background-color .3s ease, box-shadow .3s ease;
}
.topbar.is-stuck {
  background: rgba(27, 20, 16, .84);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; white-space: nowrap; text-decoration: none; color: var(--text); font-family: var(--font-display); font-weight: 700; font-size: 1.08rem; }
.brand:hover { color: var(--glow); }
.brand img { flex: none; }
.nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 28px); }
.nav a { text-decoration: none; white-space: nowrap; color: var(--text-soft); font-weight: 700; font-size: .98rem; transition: color .2s; }
.nav a:hover { color: var(--glow); }
.nav .nav-cta { color: #3b2207; background: linear-gradient(180deg, #ffd88f, #f5a843); padding: .5em 1.15em; border-radius: 999px; font-weight: 800; }
.nav .nav-cta:hover { color: #3b2207; filter: brightness(1.06); }
.menu-toggle { display: none; width: 44px; height: 44px; padding: 9px; background: rgba(27, 20, 16, .5); border: 1px solid var(--line-strong); color: var(--lantern); border-radius: 12px; cursor: pointer; }
.menu-toggle svg { display: block; width: 100%; height: 100%; }

/* ---------- Lucioles (décor) ---------- */
.fireflies { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.fireflies i {
  position: absolute; width: 5px; height: 5px; border-radius: 50%;
  background: #ffe9a8; box-shadow: 0 0 10px 3px rgba(255, 205, 110, .5);
  opacity: 0;
  animation: firefly-drift var(--d, 20s) ease-in-out var(--delay, 0s) infinite, firefly-blink var(--b, 6s) ease-in-out var(--delay, 0s) infinite;
}
/* Placées dans les marges de la page, pour ne pas passer derrière les textes */
.fireflies i:nth-child(1) { left: 3%; top: 14%; --d: 23s; --b: 6.5s; --delay: -2s; }
.fireflies i:nth-child(2) { left: 6%; top: 34%; --d: 19s; --b: 5s; --delay: -7s; }
.fireflies i:nth-child(3) { left: 2%; top: 52%; --d: 26s; --b: 7s; --delay: -11s; }
.fireflies i:nth-child(4) { left: 5%; top: 70%; --d: 21s; --b: 5.5s; --delay: -5s; }
.fireflies i:nth-child(5) { left: 3%; top: 90%; --d: 24s; --b: 8s; --delay: -14s; }
.fireflies i:nth-child(6) { left: 7%; top: 96%; --d: 18s; --b: 6s; --delay: -9s; }
.fireflies i:nth-child(7) { left: 96%; top: 12%; --d: 22s; --b: 7.5s; --delay: -4s; }
.fireflies i:nth-child(8) { left: 93%; top: 30%; --d: 25s; --b: 5.5s; --delay: -16s; }
.fireflies i:nth-child(9) { left: 97%; top: 50%; --d: 20s; --b: 6.5s; --delay: -1s; }
.fireflies i:nth-child(10) { left: 94%; top: 68%; --d: 27s; --b: 8.5s; --delay: -12s; }
.fireflies i:nth-child(11) { left: 96%; top: 86%; --d: 22s; --b: 5s; --delay: -18s; }
.fireflies i:nth-child(12) { left: 92%; top: 95%; --d: 24s; --b: 7s; --delay: -8s; }
@keyframes firefly-drift {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(14px, -26px); }
  50% { transform: translate(-8px, -54px); }
  75% { transform: translate(-16px, -20px); }
}
@keyframes firefly-blink { 0%, 100% { opacity: 0; } 35%, 65% { opacity: .85; } }

main, .footer { position: relative; z-index: 1; }

/* ---------- Héros ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-rows: 1fr auto;
  min-height: clamp(620px, 100svh, 940px);
  margin-top: calc(-1 * var(--topbar-h));
  padding-top: var(--topbar-h);
  background: var(--bg);
}
.hero-media {
  position: absolute; inset: 0; z-index: -2;
  background: #2a2033 url('../assets/hero-wide.webp') 40% 42% / cover no-repeat;
}
.hero-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 40% 42%;
  opacity: 0; transition: opacity 1.4s ease;
}
.hero-video.is-on { opacity: 1; }
/* Voile : sombre à gauche pour le texte, fondu vers la page en bas */
.hero-media::after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(26, 17, 24, .9) 0%, rgba(26, 17, 24, .7) 30%, rgba(26, 17, 24, .22) 56%, rgba(26, 17, 24, 0) 74%),
    linear-gradient(180deg, rgba(26, 17, 24, .6) 0%, rgba(26, 17, 24, 0) 24%, rgba(27, 20, 16, 0) 58%, rgba(27, 20, 16, .82) 88%, var(--bg) 100%);
}
/* Les enfants d'une grille avec des marges auto se réduisent à leur contenu : on force la largeur */
.hero > .container { width: 100%; max-width: 1320px; }
.hero-inner { display: flex; align-items: center; padding-block: 40px 28px; }
/* Le texte reste à gauche de l'enseigne de la taverne, quelle que soit la largeur d'écran */
.hero-copy { max-width: min(520px, 42vw); }
.eyebrow { margin: 0 0 14px; color: var(--lantern); font-weight: 800; font-size: .82rem; letter-spacing: .16em; text-transform: uppercase; }
.hero h1 {
  margin: 0 0 .35em;
  font-size: clamp(2.7rem, 6.4vw, 5.3rem);
  font-weight: 700; line-height: 1; letter-spacing: -.02em;
  color: #fff6e3;
  text-shadow: 0 2px 30px rgba(20, 12, 18, .6);
}
.hero h1 em { display: block; font-style: italic; font-weight: 600; color: var(--lantern); }
.tagline { margin: 0 0 1.7em; font-size: clamp(1.05rem, 1.5vw, 1.22rem); line-height: 1.55; color: var(--text); text-shadow: 0 1px 16px rgba(20, 12, 18, .8); max-width: 34em; }
.hero .btn-icon { animation: nudge 2.4s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(-2px); } 50% { transform: translateY(3px); } }

.hero-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  margin: 0 0 clamp(18px, 3.5vh, 36px);
  background: rgba(30, 21, 17, .62);
  -webkit-backdrop-filter: blur(16px) saturate(1.25); backdrop-filter: blur(16px) saturate(1.25);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.hero-stats div { display: flex; flex-direction: column-reverse; justify-content: flex-end; padding: 16px 24px 18px; }
.hero-stats div + div { border-left: 1px solid var(--line); }
.hero-stats dt { font-size: .86rem; color: var(--text-soft); font-weight: 600; }
.hero-stats dd { margin: 0; font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 800; line-height: 1.15; color: #fff6e3; }

.video-toggle {
  position: absolute; right: 16px; top: calc(var(--topbar-h) + 10px); z-index: 2;
  width: 38px; height: 38px; padding: 9px;
  background: rgba(27, 20, 16, .5); color: var(--text-soft);
  border: 1px solid var(--line-strong); border-radius: 50%; cursor: pointer;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: .7; transition: opacity .2s, color .2s;
}
.video-toggle:hover, .video-toggle:focus-visible { opacity: 1; color: var(--glow); }
.video-toggle svg { display: block; width: 100%; height: 100%; }

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 9vw, 116px) 0; }
.section-alt {
  background: linear-gradient(180deg, rgba(255, 226, 173, .05), rgba(255, 226, 173, .018));
  border-block: 1px solid var(--line);
}
.section-head { text-align: center; margin: 0 auto clamp(30px, 5vw, 50px); max-width: 720px; }
.kicker { margin: 0 0 2px; font-family: var(--font-hand); font-size: 1.6rem; line-height: 1.2; color: var(--lantern); transform: rotate(-2deg); }
.section-head h2, .join h2 { font-size: clamp(1.95rem, 4vw, 2.85rem); margin: 0; }
.section-head h2::after {
  content: ''; display: block; width: 112px; height: 10px; margin: 16px auto 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 112 10'%3E%3Cpath d='M2 6c9-6 14 4 23 0s14-6 23 0 14 4 23 0 14-6 23 0 11 3 16 0' fill='none' stroke='%23ffc56b' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.lead { margin: 18px auto 0; color: var(--text-soft); font-size: 1.08rem; max-width: 620px; }

/* Apparition douce au défilement (uniquement si JS actif) */
.js .reveal { opacity: 0; translate: 0 18px; transition: opacity .7s ease, translate .7s ease; }
.js .reveal.is-in { opacity: 1; translate: 0 0; }

/* ---------- Papier ---------- */
.paper {
  background: linear-gradient(165deg, var(--cream), var(--cream-2));
  color: var(--ink);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), var(--shadow);
}
.paper a { color: var(--ink-accent); font-weight: 700; }
.paper a:hover { color: var(--ink); }
.paper h3 { color: var(--ink); }

.values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.value-card { padding: 28px 26px 22px; transition: transform .25s ease, rotate .25s ease, box-shadow .25s ease, opacity .7s ease, translate .7s ease; }
.value-card:nth-child(1) { rotate: -.7deg; }
.value-card:nth-child(2) { rotate: .5deg; }
.value-card:nth-child(3) { rotate: -.4deg; }
.value-card:hover { rotate: 0deg; transform: translateY(-4px); }
.value-card h3 { font-size: 1.32rem; margin-bottom: .4em; }
.value-card p { margin: 0; color: var(--ink-soft); }
.value-icon {
  width: 58px; height: 58px; margin-bottom: 16px;
  display: grid; place-items: center; font-size: 1.75rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff1c9, #ffd88f 70%);
  box-shadow: 0 6px 16px -6px rgba(242, 162, 64, .8);
}

/* Ardoise « À la carte » : cadre en bois, intérieur papier, lignes façon menu */
.menu-board {
  max-width: 840px;
  margin: clamp(36px, 6vw, 60px) auto 0;
  padding: 11px;
  border-radius: 24px;
  background: linear-gradient(145deg, #6a4526, #3f2815 55%, #573820);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 214, 153, .35), inset 0 2px 6px rgba(255, 255, 255, .12);
}
.menu-inner {
  position: relative;
  padding: 36px clamp(18px, 5vw, 52px) 28px;
  border-radius: 15px;
  background: linear-gradient(165deg, var(--cream), var(--cream-2));
  color: var(--ink);
  box-shadow: inset 0 0 44px rgba(154, 90, 20, .16);
  text-align: center;
}
.menu-inner::before {
  content: '';
  position: absolute; inset: 9px;
  border: 1px solid rgba(154, 90, 20, .35);
  border-radius: 9px;
  pointer-events: none;
}
.menu-kicker { margin: 0; font-family: var(--font-hand); font-size: 1.45rem; line-height: 1.2; color: var(--ink-accent); }
.menu-title { margin: 2px 0 0; font-size: clamp(1.5rem, 3.6vw, 2.05rem); color: var(--ink); }
.menu-divider { display: flex; align-items: center; gap: 12px; margin: 14px auto 20px; max-width: 260px; color: var(--ink-accent); }
.menu-divider::before, .menu-divider::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--ink-accent), transparent); }
.menu-list { list-style: none; margin: 0; padding: 0; text-align: left; }
.menu-list li { display: flex; align-items: baseline; gap: 10px; padding: 13px 0; }
.menu-list li + li { border-top: 1px dashed rgba(154, 90, 20, .3); }
.menu-dish { font-family: var(--font-display); font-weight: 700; font-size: 1.08rem; color: var(--ink); white-space: nowrap; }
.menu-dots { flex: 1; min-width: 24px; border-bottom: 2px dotted rgba(106, 84, 68, .45); transform: translateY(-4px); }
.menu-desc { max-width: 58%; text-align: right; color: var(--ink-soft); }
.menu-note { margin: 18px 0 0; font-family: var(--font-hand); font-size: 1.25rem; color: var(--ink-soft); }

/* ---------- Roster ---------- */
.roster-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 16px; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: .8rem; font-weight: 700; color: var(--text-muted); }
.field input, .field select, .combo input {
  height: 48px; padding: 0 14px;
  font-size: 1rem; font-weight: 600; color: var(--text);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px;
  transition: border-color .2s, background-color .2s;
}
.field select { min-width: 170px; padding-right: 36px; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%23ffc56b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
.field select option { background: var(--surface); color: var(--text); }
.field input::placeholder, .combo input::placeholder { color: var(--text-muted); font-weight: 600; opacity: 1; }
.field input:hover, .field select:hover, .combo input:hover { border-color: var(--lantern); }
.field input:focus-visible, .field select:focus-visible, .combo input:focus-visible { outline: 2px solid var(--lantern); outline-offset: 1px; border-radius: 14px; }
.field-search { position: relative; flex: 1 1 260px; }
.field-search svg, .combo svg { position: absolute; left: 14px; bottom: 14px; width: 20px; height: 20px; color: var(--lantern); pointer-events: none; }
.field-search input, .combo input { width: 100%; padding-left: 44px; }

.class-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.class-chip, .chip-btn, .legend-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 13px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line-strong);
  color: var(--text-soft); font-size: .88rem; font-weight: 700; line-height: 1.2;
  cursor: pointer; transition: background-color .2s, border-color .2s, color .2s;
}
.class-chip:hover, .chip-btn:hover, .legend-chip:hover { border-color: var(--lantern); color: var(--text); }
.class-chip i, .bar-name i, .suggest i, .lb-sub i { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--cls, #999); box-shadow: 0 0 0 1px rgba(0, 0, 0, .28); }
.class-chip small { font-size: .82em; font-weight: 600; color: var(--text-muted); }
.class-chip[aria-pressed="true"] { background: var(--cream); border-color: var(--cream); color: var(--ink); }
.class-chip[aria-pressed="true"] small { color: var(--ink-soft); }

.roster-count { margin: 0 0 12px; font-size: .92rem; color: var(--text-muted); }
.roster-count b { color: var(--text); }
.roster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 12px; }
.member {
  --cls: #999;
  display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 11px 13px; border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: transform .2s ease, border-color .2s ease, background-color .2s ease;
}
.member:hover { transform: translateY(-2px); border-color: var(--cls); background: var(--surface-2); }
.avatar {
  width: 46px; height: 46px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--cls, var(--line-strong)); background: var(--bg);
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--cls, var(--text));
}
.member-name { font-weight: 800; line-height: 1.25; color: var(--cls-text, var(--cls)); overflow-wrap: anywhere; }
.member-name span { font-weight: 600; color: var(--text-soft); }
.member-meta { font-size: .8rem; line-height: 1.35; color: var(--text-muted); }
.member-rank { display: inline-block; margin-top: 4px; padding: 1px 9px; border-radius: 999px; font-size: .7rem; font-weight: 800; letter-spacing: .02em; color: #3b2207; background: var(--lantern); }
.member-side { display: flex; flex-direction: column; align-items: center; gap: 2px; }
/* Anneau de progression vers le niveau maximum */
.level-ring {
  position: relative; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(var(--lantern) calc(var(--p, 0) * 1%), rgba(255, 255, 255, .1) 0);
}
.level-ring::before { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: var(--surface); transition: background-color .2s ease; }
.member:hover .level-ring::before { background: var(--surface-2); }
.level-ring b { position: relative; font-size: 1rem; font-weight: 800; line-height: 1; }
.member.maxed .level-ring b { color: var(--lantern); }
.gain { font-size: .72rem; font-weight: 800; color: var(--good); white-space: nowrap; }
.empty { text-align: center; color: var(--text-muted); padding: 24px 0; }

.pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin-top: 26px; }
.pager button {
  min-width: 42px; height: 42px; padding: 0 12px;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px;
  color: var(--text-soft); font-weight: 800; font-size: .92rem; cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s;
}
.pager button:hover:not(:disabled) { border-color: var(--lantern); color: var(--text); }
.pager button[aria-current="page"] { background: var(--lantern); border-color: var(--lantern); color: #3b2207; }
.pager button:disabled { opacity: .4; cursor: default; }
.pager svg { width: 16px; height: 16px; }
.pager .prev svg { transform: scaleX(-1); }
.pager .gap { color: var(--text-muted); padding: 0 2px; }
.pager .page-status { display: none; padding: 0 8px; font-size: .92rem; font-weight: 700; color: var(--text-soft); }

/* ---------- Statistiques ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-12 { grid-column: 1 / -1; }
.panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px 24px;
  box-shadow: var(--shadow);
}
.panel-head { margin-bottom: 16px; }
.panel-head h3 { font-size: 1.22rem; font-weight: 600; margin: 0; color: var(--text); }
.panel-sub { margin: 2px 0 0; font-size: .88rem; color: var(--text-muted); }
.figure { margin: 4px 0 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.figure b { font-size: 2.5rem; font-weight: 800; line-height: 1.1; color: #fff6e3; }
.delta { font-size: .9rem; font-weight: 700; color: var(--text-muted); }
.delta.up { color: var(--good); }
.chart-box { position: relative; height: 200px; }
.chart-tall { height: 330px; }

.table-view { margin-top: -6px; font-size: .9rem; color: var(--text-soft); }
.panel .table-view { margin-top: 14px; }
.table-view summary { display: inline-block; cursor: pointer; padding: 4px 2px; color: var(--text-muted); font-weight: 700; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; list-style: none; }
.table-view summary::-webkit-details-marker { display: none; }
.table-view summary:hover { color: var(--text); }
.table-scroll { max-height: 320px; overflow: auto; margin-top: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.table-view table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table-view th, .table-view td { padding: 7px 14px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table-view th:first-child, .table-view td:first-child { text-align: left; }
.table-view thead th { position: sticky; top: 0; background: var(--surface-2); color: var(--text); font-weight: 800; }
.table-view tbody tr:last-child td { border-bottom: 0; }

/* Histogramme des niveaux : colonnes fines, valeur sur le chapeau */
.histogram {
  --axis: rgba(255, 255, 255, .16);
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px;
  height: 236px; margin-bottom: 30px;
  border-bottom: 1px solid var(--axis);
}
.hist-col { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.hist-val { font-size: .86rem; font-weight: 800; color: var(--text); }
.hist-col.is-empty .hist-val { color: var(--text-muted); font-weight: 600; }
.hist-bar { width: 24px; height: calc((100% - 30px) * var(--f, 0)); border-radius: 4px 4px 0 0; background: var(--lantern); transition: background-color .2s; }
.hist-col:hover .hist-bar { background: var(--glow); }
.hist-label { position: absolute; top: calc(100% + 8px); font-size: .8rem; color: var(--text-muted); white-space: nowrap; }

/* Classes : barres horizontales classées, une seule teinte */
.bar-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.bar-row { display: grid; grid-template-columns: 116px minmax(0, 1fr) 78px; align-items: center; gap: 12px; font-size: .93rem; }
.bar-name { display: flex; align-items: center; gap: 9px; font-weight: 700; color: var(--text-soft); }
.bar-track { height: 12px; }
.bar-fill { display: block; height: 100%; width: calc(var(--f, 0) * 100%); min-width: 2px; border-radius: 0 4px 4px 0; background: var(--lantern); transition: background-color .2s; }
.bar-row:hover .bar-fill { background: var(--glow); }
.bar-val { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-val small { margin-left: 6px; font-weight: 600; color: var(--text-muted); }

/* Classement de la semaine */
.leaderboard { list-style: none; margin: 0; padding: 0; counter-reset: lb; }
.leaderboard li { counter-increment: lb; display: grid; grid-template-columns: 26px 38px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.leaderboard li:last-child { border-bottom: 0; padding-bottom: 0; }
.leaderboard li::before { content: counter(lb); text-align: center; font-weight: 800; color: var(--text-muted); }
.leaderboard li:nth-child(1)::before { content: '🥇'; }
.leaderboard li:nth-child(2)::before { content: '🥈'; }
.leaderboard li:nth-child(3)::before { content: '🥉'; }
.leaderboard li.lb-empty { display: block; color: var(--text-muted); }
.leaderboard li.lb-empty::before { content: none; }
.leaderboard .avatar { width: 38px; height: 38px; font-size: 1rem; }
.lb-name { display: block; font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }
.lb-sub { display: flex; align-items: center; gap: 7px; font-size: .82rem; color: var(--text-muted); }
.lb-gain { font-weight: 800; color: var(--good); white-space: nowrap; }
.lb-gain small { font-weight: 600; color: var(--text-muted); }

/* Courbes de niveau : recherche, raccourcis, légende */
.curve-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.combo { position: relative; flex: 1 1 220px; }
.combo input { height: 44px; }
.combo svg { bottom: 12px; }
.suggest {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px);
  margin: 0; padding: 6px; list-style: none;
  max-height: 300px; overflow: auto;
  background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 14px;
  box-shadow: var(--shadow);
}
.suggest li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; cursor: pointer; font-weight: 700; }
.suggest li small { margin-left: auto; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.suggest li[aria-selected="true"], .suggest li:hover { background: rgba(255, 197, 107, .14); }
.suggest .suggest-empty { cursor: default; color: var(--text-muted); font-weight: 600; }
.suggest .suggest-empty:hover { background: none; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { padding: 8px 13px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; min-height: 34px; margin-bottom: 10px; }
.legend-chip { padding: 5px 9px 5px 11px; font-size: .85rem; color: var(--text); }
.legend-chip .key { flex: none; width: 16px; height: 3px; border-radius: 2px; background: var(--c); }
.legend-chip .x { font-size: 1.1em; line-height: 1; color: var(--text-muted); }
.legend-chip:hover .x { color: var(--text); }
.legend-empty { margin: 0; align-self: center; font-size: .9rem; color: var(--text-muted); }

/* ---------- Chroniques ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: ''; position: absolute; top: 10px; bottom: 34px; left: 139px; width: 2px; border-radius: 2px;
  background: linear-gradient(180deg, var(--lantern), rgba(255, 197, 107, .18));
}
.tl-item { display: grid; grid-template-columns: 118px 44px minmax(0, 1fr); grid-template-areas: 'date dot card'; align-items: start; padding-bottom: 26px; }
.tl-item[hidden] { display: none; }
.tl-item:last-child { padding-bottom: 0; }
.tl-date { grid-area: date; padding: 4px 18px 0 0; text-align: right; line-height: 1.15; color: var(--text-soft); }
.tl-date b { display: block; font-size: 1.9rem; font-weight: 800; color: #fff6e3; }
.tl-date span { display: block; font-size: .86rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.tl-date small { display: block; font-size: .8rem; color: var(--text-muted); }
.tl-dot {
  grid-area: dot; position: relative; z-index: 1;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.25rem;
  background: var(--surface); border: 2px solid var(--lantern);
  box-shadow: 0 0 0 6px #20170f, 0 0 26px rgba(255, 197, 107, .35);
}
.tl-card { grid-area: card; position: relative; margin-left: 20px; padding: 16px 22px 18px; }
.tl-card::before { content: ''; position: absolute; left: -8px; top: 15px; width: 16px; height: 16px; background: var(--cream); transform: rotate(45deg); border-radius: 3px; }
.tl-card h3 { position: relative; font-size: 1.3rem; margin: 0 0 .25em; }
.tl-card p { position: relative; margin: 0; color: var(--ink-soft); }
.tl-badge { position: relative; display: inline-block; margin-bottom: 6px; padding: 2px 10px; border-radius: 999px; font-size: .74rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; background: var(--ink); color: var(--cream); }
.tl-item.is-upcoming .tl-dot { border-style: dashed; }
.timeline-actions { margin: 22px 0 0; text-align: center; }

/* ---------- Rejoindre ---------- */
.join { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .9fr); gap: clamp(24px, 4vw, 56px); align-items: center; padding: clamp(24px, 4.5vw, 56px); }
.join .kicker { color: var(--ink-accent); transform-origin: left center; }
.join h2 { color: var(--ink); }
.join-lead { margin: 14px 0 0; font-size: 1.08rem; color: var(--ink-soft); }
.steps { list-style: none; margin: 26px 0 0; padding: 0; counter-reset: step; display: grid; gap: 18px; }
.steps li { counter-increment: step; position: relative; padding-left: 60px; min-height: 44px; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; color: #3b2207;
  background: radial-gradient(circle at 35% 30%, #ffe5ae, #f5a843 75%);
  box-shadow: 0 6px 14px -6px rgba(242, 162, 64, .9);
}
.steps strong { display: block; font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; line-height: 1.3; }
.steps span { display: block; color: var(--ink-soft); }
.steps span b { color: var(--ink); }
.join-card {
  text-align: center; padding: clamp(24px, 3vw, 36px) clamp(20px, 2.6vw, 32px);
  border-radius: 18px; color: var(--text);
  background: radial-gradient(420px 260px at 50% -10%, rgba(255, 197, 107, .2), transparent 70%), linear-gradient(170deg, #35251b, #231710);
  box-shadow: 0 20px 40px -20px rgba(51, 35, 26, .9);
}
.join-badge { width: 66px; height: 66px; margin: 0 auto 14px; padding: 15px; border-radius: 50%; color: #3b2207; background: radial-gradient(circle at 35% 30%, #ffe5ae, #f5a843 75%); box-shadow: 0 0 34px rgba(255, 197, 107, .45); }
.join-badge svg { display: block; width: 100%; height: 100%; }
.join-card h3 { color: var(--text); font-size: 1.4rem; margin-bottom: .6em; }
.join-card .btn { width: 100%; margin-top: 6px; }
.checklist { list-style: none; margin: 0 0 20px; padding: 0; text-align: left; display: grid; gap: 8px; color: var(--text-soft); font-size: .97rem; }
.checklist li { position: relative; padding-left: 1.7em; }
.checklist li::before { content: '✦'; position: absolute; left: 0; color: var(--lantern); }

.faq-block { margin: clamp(40px, 6vw, 64px) auto 0; }
.faq-title { text-align: center; font-size: 1.5rem; margin-bottom: 18px; }
.faq { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; margin-bottom: 10px; transition: border-color .2s; }
.faq:hover, .faq[open] { border-color: var(--line-strong); }
.faq summary { position: relative; cursor: pointer; padding: 15px 52px 15px 20px; font-weight: 800; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; position: absolute; right: 20px; top: 50%; translate: 0 -50%; font-size: 1.5rem; font-weight: 600; line-height: 1; color: var(--lantern); transition: rotate .2s ease; }
.faq[open] summary::after { rotate: 45deg; }
.faq p { margin: 0; padding: 0 20px 18px; color: var(--text-soft); }

/* ---------- Pied de page ---------- */
.footer { text-align: center; padding: 44px 16px 52px; border-top: 1px solid var(--line); color: var(--text-soft); }
.footer img { opacity: .9; margin-bottom: 8px; }
.footer p { margin: 4px 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .span-5, .span-6, .span-7 { grid-column: 1 / -1; }
  .join { grid-template-columns: 1fr; }
}
/* Écran en hauteur : image et vidéo recadrées en carré, centrées sur l'enseigne et la porte */
@media (orientation: portrait) {
  .hero-media { background-image: url('../assets/hero-tall.webp'); background-position: 50% 50%; }
  .hero-video { object-position: 50% 50%; }
}
@media (max-width: 960px) {
  .hero-media::after {
    background:
      linear-gradient(180deg, rgba(26, 17, 24, .78) 0%, rgba(26, 17, 24, .58) 38%, rgba(27, 20, 16, .5) 66%, rgba(27, 20, 16, .9) 90%, var(--bg) 100%);
  }
  .hero-inner { justify-content: center; text-align: center; }
  .hero-copy { max-width: 620px; }
  .tagline { margin-inline: auto; }
  .values { grid-template-columns: 1fr; max-width: 560px; margin-inline: auto; }
  .value-card:nth-child(n) { rotate: 0deg; }
}
/* En dessous de 900 px les liens ne tiennent plus sur une ligne : menu déroulant */
@media (max-width: 900px) {
  .menu-toggle { display: block; }
  .nav {
    display: none; position: absolute; top: calc(100% + 6px); left: 12px; right: 12px;
    flex-direction: column; align-items: stretch; gap: 2px; padding: 10px;
    background: rgba(33, 24, 16, .97); border: 1px solid var(--line-strong); border-radius: 18px;
    box-shadow: var(--shadow);
  }
  .nav.open { display: flex; }
  .nav a { padding: 13px 14px; border-radius: 12px; font-size: 1.05rem; }
  .nav a:hover { background: rgba(255, 197, 107, .08); }
  .nav .nav-cta { margin-top: 6px; text-align: center; padding: 13px 14px; }
}
@media (max-width: 760px) {
  .fireflies { display: none; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .hero-stats div { padding: 13px 16px 14px; }
  .hero-stats div + div { border-left: 0; }
  .hero-stats div:nth-child(even) { border-left: 1px solid var(--line); }
  .hero-stats div:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .hero-stats dt { font-size: .8rem; }
  .roster-tools .field { flex: 1 1 140px; }
  .field select { min-width: 0; width: 100%; }
  .roster-tools .field-search { flex-basis: 100%; }
  .panel { padding: 18px 16px 20px; }
  .chart-tall { height: 290px; }
  .pager .num, .pager .gap { display: none; }
  .pager .page-status { display: inline; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .menu-list li { flex-direction: column; gap: 2px; text-align: center; align-items: center; }
  .menu-dots { display: none; }
  .menu-desc { max-width: none; text-align: center; }
  .class-filter { flex-wrap: nowrap; overflow-x: auto; margin-inline: -20px; padding: 2px 20px 8px; scrollbar-width: none; }
  .class-filter::-webkit-scrollbar { display: none; }
  .class-chip { flex: none; }
  .bar-row { grid-template-columns: 104px minmax(0, 1fr) 70px; gap: 8px; }
  .hist-bar { width: 20px; }
  .hist-label { font-size: .72rem; }
  .timeline::before { left: 21px; bottom: 60px; }
  .tl-item { grid-template-columns: 44px minmax(0, 1fr); grid-template-areas: 'dot date' 'dot card'; }
  .tl-date { display: flex; align-items: baseline; gap: 6px; padding: 8px 0 8px 16px; text-align: left; }
  .tl-date b { font-size: 1.3rem; }
  .tl-date b, .tl-date span, .tl-date small { display: inline; }
  .tl-card { margin-left: 16px; }
  .tl-card::before { top: -7px; left: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .fireflies { display: none; }
  .js .reveal { opacity: 1; translate: none; }
}
