/* =========================================================
   Mémoire du Globe — thème sombre, accents néon
   ========================================================= */
:root {
  --bg: #03050b;
  --bg-2: #070b16;
  --ink: #eef1f8;
  --ink-2: #b7c0d3;
  --muted: #8d98ae;
  --line: rgba(255, 255, 255, .09);
  --line-2: rgba(255, 255, 255, .16);
  --glass: rgba(9, 13, 25, .58);
  --glass-strong: rgba(8, 12, 23, .78);
  --neon: #4fe3ff;
  --ember: #ff5b3a;
  --magenta: #ff3d8b;
  --c: var(--neon);                 /* couleur du type sélectionné */

  --f-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --f-body: "Inter", ui-sans-serif, system-ui, sans-serif;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 22px;
  --gap: 20px;
  --panel-w: 440px;
  --filters-w: 236px;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.55 var(--f-body);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  overscroll-behavior: none;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--neon); outline-offset: 3px; border-radius: 8px; }

.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--line);
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .05);
}

/* ================= Globe ================= */
.globe {
  position: fixed; inset: 0;
  transition: transform 1.1s var(--ease), filter 1.6s var(--ease);
  will-change: transform;
}
.globe canvas { display: block; }
body.is-intro .globe { filter: brightness(.72) saturate(.95); transform: scale(1.08); }
@media (min-width: 900px) {
  body.panel-open .globe { transform: translateX(calc(var(--panel-w) / -2)); }
}
@media (max-width: 719px) {
  body.panel-open .globe { transform: translateY(-27dvh); }
}
.vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  background:
    radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(3, 5, 11, .75) 100%),
    linear-gradient(to top, rgba(3, 5, 11, .75), transparent 22%);
}

/* Infobulle au survol (globe.gl) */
.scene-tooltip, .float-tooltip-kap {
  background: none !important; padding: 0 !important; border: 0 !important; box-shadow: none !important;
  font-family: var(--f-body) !important; color: var(--ink) !important;
}
.tt {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 13px 9px 11px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .8), 0 0 0 1px color-mix(in srgb, var(--tc) 25%, transparent);
  white-space: nowrap;
  transform: translate(10px, -6px);
}
.tt-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--tc); box-shadow: 0 0 12px var(--tc); flex: none; }
.tt b { display: block; font: 600 14px/1.2 var(--f-display); letter-spacing: -.01em; }
.tt span { display: block; font-size: 12px; color: var(--ink-2); margin-top: 2px; }

/* ================= Intro ================= */
.intro {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  padding: 24px 16px 96px;
  text-align: center;
  background:
    radial-gradient(60% 55% at 50% 48%, rgba(3, 5, 11, .15), rgba(3, 5, 11, .78) 70%, rgba(3, 5, 11, .96) 100%);
  transition: opacity 1.1s var(--ease), visibility 0s linear 1.1s, transform 1.4s var(--ease);
}
.intro.is-leaving { opacity: 0; visibility: hidden; transform: scale(1.06); pointer-events: none; }
.intro-grain {
  position: absolute; inset: 0; pointer-events: none; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.intro-inner { position: relative; max-width: 980px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0 0 22px; padding: 7px 14px;
  font: 500 12px/1 var(--f-display); letter-spacing: .2em; text-transform: uppercase;
  color: var(--ink-2);
  border: 1px solid var(--line-2); border-radius: 999px;
  background: rgba(255, 255, 255, .03);
}
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 0 0 rgba(255, 91, 58, .7); animation: ping 2s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(255, 91, 58, .6); } 80%, 100% { box-shadow: 0 0 0 10px rgba(255, 91, 58, 0); } }

.intro-title {
  margin: 0;
  font: 700 clamp(3.1rem, 12.5vw, 9.4rem)/.9 var(--f-display);
  letter-spacing: -.055em;
  text-wrap: balance;
}
.intro-title .line { display: block; }
.intro-title .line-2 {
  font-weight: 500;
  font-size: .62em;
  letter-spacing: -.04em;
  margin-top: .12em;
}
.intro-title .ch {
  display: inline-block;
  opacity: 0; transform: translateY(.45em) rotateX(-40deg); filter: blur(14px);
  animation: chIn 1.1s var(--ease-out) forwards;
  animation-delay: calc(.35s + var(--i) * 45ms);
}
.intro-title .line-2 .ch {
  background: linear-gradient(100deg, #ffd1b8 0%, var(--ember) 45%, var(--magenta) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation-delay: calc(.8s + var(--i) * 40ms);
}
.intro-title .sp { display: inline-block; width: .28em; }
@keyframes chIn { to { opacity: 1; transform: none; filter: blur(0); } }

.intro-lede {
  max-width: 560px; margin: 28px auto 0;
  font-size: clamp(15px, 1.6vw, 17px); color: var(--ink-2); line-height: 1.65;
  text-wrap: pretty;
}
.intro-stats {
  list-style: none; display: flex; justify-content: center; gap: clamp(20px, 5vw, 48px);
  margin: 30px 0 0; padding: 0;
}
.intro-stats li { display: flex; flex-direction: column; gap: 2px; }
.intro-stats strong { font: 600 clamp(22px, 3vw, 30px)/1 var(--f-display); letter-spacing: -.03em; }
.intro-stats span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }

.explore-btn {
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; gap: 12px;
  margin-top: 38px; padding: 17px 30px 17px 34px; min-height: 56px;
  font: 600 16px/1 var(--f-display); letter-spacing: .02em;
  color: #0a0d16;
  background: linear-gradient(100deg, #fff 0%, #ffe3d6 100%);
  border: 0; border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .4), 0 10px 40px -6px rgba(255, 91, 58, .55);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), opacity .3s;
}
.explore-btn svg { width: 20px; height: 20px; stroke-width: 2.2; transition: transform .35s var(--ease); }
.explore-btn:hover:not(:disabled) { transform: translateY(-2px) scale(1.02); box-shadow: 0 0 0 1px #fff, 0 16px 60px -6px rgba(255, 91, 58, .8); }
.explore-btn:hover:not(:disabled) svg { transform: translateX(4px); }
.explore-btn:active:not(:disabled) { transform: scale(.98); }
.explore-btn:disabled { opacity: .55; cursor: progress; }
.explore-glow {
  position: absolute; inset: -14px; z-index: -1; border-radius: inherit;
  background: radial-gradient(closest-side, rgba(255, 91, 58, .5), transparent);
  filter: blur(14px); animation: breathe 3.2s ease-in-out infinite;
}
@keyframes breathe { 50% { opacity: .35; transform: scale(.92); } }
.intro-hint { margin: 18px 0 0; font-size: 12.5px; color: var(--muted); }
.intro-support { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }
.intro-legal { margin: 6px 0 0; font-size: 11.5px; color: var(--muted); }
.intro-legal a { color: var(--muted); text-underline-offset: 3px; }
.intro-legal a:hover { color: var(--ink); }

/* Lien de soutien (Tipeee) — volontairement discret */
.support-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: #ffb4a3; text-decoration: none; font-weight: 500;
  transition: color .2s;
}
.support-link svg { width: 14px; height: 14px; flex: none; fill: rgba(255, 91, 58, .25); stroke: var(--ember); transition: fill .25s, transform .3s var(--ease); }
.support-link:hover { color: #fff; }
.support-link:hover svg { fill: var(--ember); transform: scale(1.15); }
.filters-support { display: flex; margin: 10px 6px 0; font-size: 12.5px; }

/* Lien vers les lectures conseillées — même esprit que le lien de soutien, en ambre */
.reading-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: #ffd9a8; text-decoration: none; font-weight: 500;
  transition: color .2s;
}
.reading-link svg { width: 14px; height: 14px; flex: none; fill: rgba(255, 196, 120, .2); stroke: #ffc478; transition: fill .25s, transform .3s var(--ease); }
.reading-link:hover { color: #fff; }
.reading-link:hover svg { fill: #ffc478; transform: translateY(-1px) rotate(-6deg); }
.filters .reading-link { margin-top: 8px; }
.credits-link { color: var(--ink-2); text-underline-offset: 3px; }
.credits-link:hover { color: #fff; }
.filters .credits-link { margin-top: 6px; text-decoration: none; }
.filters .credits-link:hover { text-decoration: underline; }
.sd-support { margin: 14px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }

.reveal { opacity: 0; transform: translateY(14px); animation: revealIn 1s var(--ease-out) forwards; animation-delay: var(--d, 0s); }
@keyframes revealIn { to { opacity: 1; transform: none; } }

.intro-marquee {
  position: absolute; left: 0; right: 0; bottom: 26px; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
  opacity: 0; animation: revealIn 1.4s var(--ease-out) 2.3s forwards;
}
.marquee-track { display: flex; gap: 38px; width: max-content; animation: marquee 140s linear infinite; }
.marquee-track span { font: 500 12.5px/1 var(--f-display); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.marquee-track span i { font-style: normal; color: var(--ink-2); margin-right: 8px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ================= UI générale ================= */
.ui { transition: opacity .8s var(--ease), transform .9s var(--ease); }
body.is-intro .ui { opacity: 0; pointer-events: none; }
body.is-intro .topbar { transform: translateY(-20px); }
body.is-intro .filters { transform: translateX(-24px); }
body.is-intro .timeline { transform: translateY(24px); }
body:not(.is-intro) .filters { transition-delay: .15s; }
body:not(.is-intro) .timeline { transition-delay: .3s; }

/* ---- Top bar ---- */
.topbar {
  position: fixed; z-index: 35; top: 16px; left: var(--gap); right: var(--gap);
  display: flex; align-items: center; gap: 14px;
  pointer-events: none;
  transition: opacity .8s var(--ease), transform .9s var(--ease), right .7s var(--ease);
}
@media (min-width: 720px) {
  body.panel-open .topbar { right: calc(var(--panel-w) + 32px); }
}
@media (min-width: 720px) and (max-width: 1280px) {
  body.panel-open .brand-text { display: none; }
  body.panel-open .btn-neon { width: 44px; padding: 0; justify-content: center; }
  body.panel-open .btn-neon span { display: none; }
}
@media (min-width: 720px) {
  body.panel-open .btn-ghost { width: 44px; padding: 0; justify-content: center; }
  body.panel-open .btn-ghost span { display: none; }
}
.btn-ghost, .btn-neon, .brand { white-space: nowrap; flex: none; }
@media (max-width: 1360px) {
  .btn-ghost { width: 44px; padding: 0; justify-content: center; flex: none; }
  .btn-ghost span { display: none; }
}
.topbar > * { pointer-events: auto; }
.brand {
  display: inline-flex; align-items: center; gap: 10px; margin-right: auto;
  color: var(--ink); text-decoration: none;
  font: 600 17px/1 var(--f-display); letter-spacing: -.02em;
  padding: 8px 4px;
}
.brand em { font-style: normal; font-weight: 400; color: var(--ink-2); }
.brand-mark { width: 30px; height: 30px; stroke: var(--ink); stroke-width: 1.4; }
.brand-ping { fill: var(--ember); stroke: none; filter: drop-shadow(0 0 4px var(--ember)); animation: blink 2.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }

.search { position: relative; width: min(360px, 38vw); }
.search input {
  width: 100%; height: 44px; padding: 0 40px 0 42px;
  background: var(--glass); border: 1px solid var(--line); border-radius: 999px;
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  font-size: 14px; outline: none;
  transition: border-color .25s, box-shadow .25s, background .25s;
}
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { display: none; }
.search input:focus { border-color: rgba(79, 227, 255, .5); box-shadow: 0 0 0 4px rgba(79, 227, 255, .1); background: var(--glass-strong); }
.search-icon { position: absolute; z-index: 1; left: 15px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-kbd {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font: 500 11px/1 var(--f-body); color: var(--muted);
  border: 1px solid var(--line-2); border-radius: 5px; padding: 3px 6px;
}
.search input:focus ~ .search-kbd { opacity: 0; }
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  margin: 0; padding: 6px; list-style: none;
  border-radius: var(--r-md); max-height: 60dvh; overflow: auto;
  background: var(--glass-strong);
}
.search-results li {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 11px; border-radius: 9px; cursor: pointer;
}
.search-results li[aria-selected="true"], .search-results li:hover { background: rgba(255, 255, 255, .07); }
.search-results .r-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--tc); box-shadow: 0 0 10px var(--tc); }
.search-results .r-main { min-width: 0; flex: 1; }
.search-results b { display: block; font: 500 14px/1.3 var(--f-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-results small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-results .r-year { font: 500 12px/1 var(--f-display); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.search-results .r-empty { color: var(--muted); cursor: default; font-size: 13.5px; }
.search-results .r-empty:hover { background: none; }

.btn-neon {
  display: inline-flex; align-items: center; gap: 9px;
  height: 44px; padding: 0 18px 0 15px;
  font: 500 14px/1 var(--f-display);
  background: rgba(79, 227, 255, .08);
  border: 1px solid rgba(79, 227, 255, .35);
  border-radius: 999px; color: #dffaff;
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: 0 0 24px -8px rgba(79, 227, 255, .6), inset 0 0 12px -6px rgba(79, 227, 255, .6);
  transition: background .25s, box-shadow .25s, transform .25s var(--ease);
}
.btn-neon svg { width: 19px; height: 19px; color: var(--neon); transition: transform .5s var(--ease); }
.btn-neon:hover { background: rgba(79, 227, 255, .15); box-shadow: 0 0 34px -6px rgba(79, 227, 255, .8), inset 0 0 14px -6px rgba(79, 227, 255, .8); }
.btn-neon:hover svg { transform: rotate(90deg); }
.btn-neon:active { transform: scale(.97); }

/* ---- Filtres ---- */
.filters {
  position: fixed; z-index: 15;
  top: 84px; left: var(--gap); width: var(--filters-w);
  padding: 16px 12px 14px;
  border-radius: var(--r-lg);
  /* la frise est décalée à droite du panneau : il peut descendre jusqu'en bas de l'écran */
  max-height: calc(100dvh - 84px - var(--gap)); overflow: auto;
  scrollbar-width: thin;
}
.filters-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 6px 10px; }
.filters h2 { margin: 0; font: 600 12px/1 var(--f-display); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); }
.link-btn { background: none; border: 0; padding: 4px 2px; font-size: 12.5px; color: var(--neon); }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.chips { display: flex; flex-direction: column; gap: 2px; }
.chip {
  --tc: #fff;
  display: flex; align-items: center; gap: 11px;
  width: 100%; min-height: 38px; padding: 7px 10px;
  background: transparent; border: 1px solid transparent; border-radius: 10px;
  font-size: 14px; text-align: left; color: var(--ink);
  transition: background .2s, opacity .2s, border-color .2s;
}
.chip:hover { background: rgba(255, 255, 255, .05); }
.chip .dot {
  width: 11px; height: 11px; border-radius: 50%; flex: none;
  background: var(--tc); box-shadow: 0 0 10px var(--tc), 0 0 2px var(--tc);
  transition: transform .25s var(--ease), background .2s, box-shadow .2s;
}
.chip .lbl { flex: 1; min-width: 0; }
.chip .n { font: 500 12px/1 var(--f-display); color: var(--muted); font-variant-numeric: tabular-nums; }
.chip[aria-pressed="false"] { opacity: .5; }
.chip[aria-pressed="false"] .dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--tc); transform: scale(.85); }
.chip[aria-pressed="true"]:hover .dot { transform: scale(1.2); }
.filters-legend {
  display: flex; align-items: center; gap: 10px;
  margin: 10px 6px 0; padding-top: 12px; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--muted); line-height: 1.35;
}
.size-legend { display: inline-flex; align-items: center; gap: 3px; flex: none; }
.size-legend i { display: block; border-radius: 50%; border: 1.3px solid var(--ink-2); }
.size-legend i:nth-child(1) { width: 5px; height: 5px; }
.size-legend i:nth-child(2) { width: 9px; height: 9px; }
.size-legend i:nth-child(3) { width: 14px; height: 14px; }

/* ---- Frise ---- */
.timeline {
  position: fixed; z-index: 15;
  left: calc(var(--gap) * 2 + var(--filters-w)); right: var(--gap); bottom: var(--gap);
  max-width: 980px; margin-left: auto;
  padding: 14px 22px 14px;
  border-radius: var(--r-lg);
  transition: opacity .8s var(--ease), transform .9s var(--ease), right .7s var(--ease);
}
@media (min-width: 900px) {
  body.panel-open .timeline { right: calc(var(--panel-w) + var(--gap) * 2); }
}
.tl-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.tl-range { display: flex; align-items: baseline; gap: 8px; font: 600 20px/1 var(--f-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tl-label { font: 600 11px/1 var(--f-display); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); margin-right: 6px; }
.tl-sep { color: var(--muted); font-weight: 400; }
.tl-count { margin: 0; font-size: 13px; color: var(--ink-2); }
.tl-right { display: flex; align-items: center; gap: 10px; }
.tl-toggle {
  display: grid; place-items: center; width: 30px; height: 30px; flex: none;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--line); border-radius: 50%;
  color: var(--ink-2); transition: background .2s, color .2s;
}
.tl-toggle:hover { background: rgba(255, 255, 255, .1); color: var(--ink); }
.tl-toggle svg { width: 16px; height: 16px; transition: transform .35s var(--ease); }
.timeline.collapsed .tl-toggle svg { transform: rotate(180deg); }
.timeline.collapsed { padding-block: 10px; }
.timeline.collapsed .tl-head { margin-bottom: 0; align-items: center; }
.timeline.collapsed .tl-track-wrap, .timeline.collapsed .tl-eras { display: none; }
.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; }
.tl-count strong { color: var(--ink); font: 600 14px/1 var(--f-display); }

.tl-track-wrap { position: relative; height: 54px; }
.tl-ticks { position: absolute; left: 9px; right: 9px; top: 2px; height: 22px; }
.tl-tick {
  position: absolute; bottom: 0; width: 3px; margin-left: -1.5px; border-radius: 2px;
  background: var(--tc); box-shadow: 0 0 6px var(--tc);
  transition: opacity .3s, height .3s;
}
.tl-tick.off { opacity: .14; box-shadow: none; }
.tl-track { position: absolute; left: 9px; right: 9px; top: 28px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .1); }
.tl-fill { position: absolute; top: 0; bottom: 0; border-radius: 4px; background: linear-gradient(90deg, var(--neon), #9d8bff); box-shadow: 0 0 12px rgba(79, 227, 255, .6); }
.tl-track-wrap input[type="range"] {
  position: absolute; left: 0; right: 0; top: 19px; width: 100%; height: 22px; margin: 0;
  -webkit-appearance: none; appearance: none; background: none; pointer-events: none;
}
.tl-track-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; pointer-events: auto;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 3px solid var(--bg-2);
  box-shadow: 0 0 0 1.5px var(--neon), 0 0 14px rgba(79, 227, 255, .9);
  cursor: grab; transition: transform .2s var(--ease);
}
.tl-track-wrap input[type="range"]::-moz-range-thumb {
  pointer-events: auto; width: 12px; height: 12px; border-radius: 50%;
  background: #fff; border: 3px solid var(--bg-2);
  box-shadow: 0 0 0 1.5px var(--neon), 0 0 14px rgba(79, 227, 255, .9); cursor: grab;
}
.tl-track-wrap input[type="range"]::-moz-range-track { background: none; }
.tl-track-wrap input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.2); cursor: grabbing; }
.tl-track-wrap input[type="range"]:focus-visible { outline: none; }
.tl-track-wrap input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--neon), 0 0 18px rgba(79, 227, 255, 1); }
.tl-axis { position: absolute; left: 9px; right: 9px; top: 44px; height: 14px; }
.tl-axis span { position: absolute; transform: translateX(-50%); font: 500 11px/1 var(--f-display); color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-axis span::before { content: ""; position: absolute; left: 50%; top: -6px; width: 1px; height: 4px; background: var(--line-2); }

.tl-eras { display: flex; gap: 6px; margin-top: 8px; overflow-x: auto; scrollbar-width: none; }
.tl-eras::-webkit-scrollbar { display: none; }
.era {
  flex: none; padding: 7px 12px; min-height: 32px;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line);
  border-radius: 999px; font-size: 12.5px; color: var(--ink-2);
  transition: background .2s, color .2s, border-color .2s;
}
.era:hover { background: rgba(255, 255, 255, .08); color: var(--ink); }
.era[aria-pressed="true"] { color: #dffaff; border-color: rgba(79, 227, 255, .5); background: rgba(79, 227, 255, .12); }

/* ================= Panneau ================= */
.panel {
  position: fixed; z-index: 30;
  top: 16px; right: 16px; bottom: 16px; width: var(--panel-w);
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(12, 17, 32, .7), rgba(6, 9, 18, .72));
  -webkit-backdrop-filter: blur(26px) saturate(150%); backdrop-filter: blur(26px) saturate(150%);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .85), inset 0 1px 0 rgba(255, 255, 255, .06);
  transform: translateX(calc(100% + 32px));
  opacity: 0;
  transition: transform .75s var(--ease), opacity .5s var(--ease);
  overflow: hidden;
}
.panel::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 180px; pointer-events: none;
  background: radial-gradient(80% 100% at 20% 0%, color-mix(in srgb, var(--c) 26%, transparent), transparent 70%);
  transition: background .6s;
}
.panel::after {
  content: ""; position: absolute; left: 24px; right: 24px; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--c), transparent);
  opacity: .8;
}
.panel.open { transform: none; opacity: 1; }
.sheet-handle { display: none; }
.panel-scroll { position: relative; flex: 1; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.panel-content { padding: 22px 26px 28px; transition: opacity .3s var(--ease), transform .4s var(--ease); }
.panel-content.swap { opacity: 0; transform: translateY(10px); }

.p-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.type-tag {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 10px;
  font: 600 11.5px/1 var(--f-display); letter-spacing: .14em; text-transform: uppercase;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 40%, transparent);
  border-radius: 999px;
}
.type-tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); }
.icon-btn {
  display: grid; place-items: center; width: 40px; height: 40px;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--line); border-radius: 50%;
  transition: background .2s, transform .3s var(--ease);
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: rgba(255, 255, 255, .1); transform: rotate(90deg); }
.p-actions { display: flex; gap: 8px; }
.icon-share:hover { transform: none; color: var(--c); border-color: color-mix(in srgb, var(--c) 45%, transparent); }

.p-title { margin: 0; font: 700 clamp(26px, 3vw, 32px)/1.08 var(--f-display); letter-spacing: -.035em; text-wrap: balance; }
.p-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; font-size: 13.5px; color: var(--ink-2); }
.p-meta > span { display: inline-flex; align-items: flex-start; gap: 7px; }
.p-meta svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 22px; }
.stat {
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px 12px 12px;
  background: rgba(255, 255, 255, .035);
  border: 1px solid var(--line); border-radius: var(--r-md);
  min-width: 0;
}
.stat-val { display: block; font: 600 22px/1 var(--f-display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat-val small { font-size: .56em; font-weight: 500; margin-left: 2px; color: var(--ink-2); letter-spacing: 0; }
.stat-val.na { color: var(--muted); font-weight: 500; font-size: 17px; line-height: 24px; }
.stat-deaths { border-color: color-mix(in srgb, var(--c) 30%, transparent); background: color-mix(in srgb, var(--c) 7%, transparent); }
.stat-deaths .stat-val { color: var(--c); text-shadow: 0 0 18px color-mix(in srgb, var(--c) 50%, transparent); }
.stat-lbl { font-size: 11.5px; color: var(--ink-2); line-height: 1.25; }
.stat-notes { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.stat-notes li { position: relative; padding-left: 14px; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.stat-notes li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 4px; height: 4px; border-radius: 50%; background: var(--muted); }

.p-desc { margin: 22px 0 0; font-size: 15px; line-height: 1.7; color: var(--ink); text-wrap: pretty; }

.sec-title { margin: 28px 0 12px; font: 600 12px/1 var(--f-display); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); }
.conseq { display: grid; gap: 8px; }
.cq {
  display: grid; grid-template-columns: 34px 1fr; gap: 12px;
  padding: 13px 14px;
  background: rgba(255, 255, 255, .03); border: 1px solid var(--line); border-radius: var(--r-md);
  opacity: 0; transform: translateY(8px);
  animation: revealIn .6s var(--ease-out) forwards; animation-delay: calc(.25s + var(--i) * 80ms);
}
.cq-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: rgba(255, 255, 255, .05); color: var(--cq); }
.cq-ic svg { width: 18px; height: 18px; }
.cq h4 { margin: 1px 0 3px; font: 600 13.5px/1.3 var(--f-display); color: var(--ink); }
.cq p { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--ink-2); }

/* Illustration Wikipédia */
.p-media {
  position: relative; margin: 18px 0 0; aspect-ratio: 16 / 9; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: linear-gradient(100deg, rgba(255,255,255,.03) 30%, rgba(255,255,255,.08) 50%, rgba(255,255,255,.03) 70%) 0 0 / 300% 100%;
  animation: shimmer 1.4s linear infinite;
}
.p-media[hidden] { display: none; }
.p-media.loaded { animation: none; background: #000; }
.p-media img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.04); transition: opacity .6s var(--ease), transform 1.2s var(--ease);
}
.p-media.loaded img { opacity: 1; transform: none; }
.p-media::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(3, 5, 11, .75), transparent 45%);
}
.p-media figcaption {
  position: absolute; z-index: 1; left: 10px; right: 10px; bottom: 7px;
  font-size: 11px; line-height: 1.35; color: rgba(255, 255, 255, .78); text-align: right;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .9);
}
.p-media figcaption a { color: inherit; text-underline-offset: 2px; }
.p-media figcaption a:hover { color: #fff; }
@keyframes shimmer { to { background-position: -300% 0; } }

/* Liste de propagation */
.spread { list-style: none; margin: 0; padding: 0 0 0 4px; position: relative; }
.spread::before {
  content: ""; position: absolute; left: 8px; top: 10px; bottom: 10px; width: 1px;
  background: linear-gradient(var(--c), color-mix(in srgb, var(--c) 15%, transparent));
}
.spread li { position: relative; padding: 5px 0 5px 24px; font-size: 13.5px; color: var(--ink-2); line-height: 1.45; }
.spread li::before {
  content: ""; position: absolute; left: 1px; top: .72em; width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg-2); border: 2px solid var(--c); box-shadow: 0 0 8px color-mix(in srgb, var(--c) 60%, transparent);
}

/* Lien source */
.p-source {
  display: flex; align-items: center; gap: 12px; margin-top: 26px; padding: 13px 14px;
  color: var(--ink); text-decoration: none;
  background: rgba(255, 255, 255, .03); border: 1px solid var(--line); border-radius: var(--r-md);
  transition: background .2s, border-color .2s;
}
.p-source:hover { background: rgba(255, 255, 255, .06); border-color: var(--line-2); }
.p-source svg { width: 20px; height: 20px; flex: none; color: var(--ink-2); }
.p-source span { flex: 1; min-width: 0; }
.p-source small { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.p-source b { display: block; font: 500 13.5px/1.35 var(--f-display); }
.p-source .p-source-ext { width: 16px; height: 16px; transition: transform .3s var(--ease); }
.p-source:hover .p-source-ext { transform: translate(2px, -2px); }
.p-video { margin-top: 8px; }
.p-video[hidden] { display: none; }
.p-book { margin-top: 8px; }
.p-book > svg:first-child { color: #ffd9a8; }
.p-book small em { font-style: normal; text-transform: none; letter-spacing: 0; }
.p-affil { margin: 6px 2px 0; font-size: 11px; line-height: 1.45; color: var(--muted); }
.p-affil a { color: var(--ink-2); text-underline-offset: 2px; }
.p-affil a:hover { color: #fff; }
.p-video > svg:first-child { color: #ff5a5a; }
.p-video small em { font-style: normal; text-transform: none; letter-spacing: 0; }

/* Étiquettes des lieux atteints (arcs) */
.arc-pin {
  display: flex; align-items: center; gap: 6px; transform: translate(-5px, -50%);
  pointer-events: none; white-space: nowrap;
  font: 500 11.5px/1 var(--f-display); color: var(--ink);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .9), 0 0 8px rgba(0, 0, 0, .8);
}
.arc-pin i { width: 8px; height: 8px; border-radius: 50%; background: var(--tc); box-shadow: 0 0 10px var(--tc); flex: none; }

.p-nav {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(5, 8, 16, .55);
}
.nav-btn {
  display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 48px;
  padding: 8px 10px; text-align: left;
  background: transparent; border: 1px solid transparent; border-radius: 12px;
  transition: background .2s, border-color .2s;
}
.nav-btn:hover { background: rgba(255, 255, 255, .05); border-color: var(--line); }
.nav-btn svg { width: 18px; height: 18px; flex: none; color: var(--ink-2); transition: transform .3s var(--ease); }
.nav-btn:hover svg { transform: translateX(-3px); }
.nav-next { justify-content: flex-end; text-align: right; }
.nav-next:hover svg { transform: translateX(3px); }
.nav-btn span { min-width: 0; }
.nav-btn small { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.nav-btn b { display: block; font: 500 13px/1.3 var(--f-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-pos { font: 500 12px/1 var(--f-display); color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---- Boutons secondaires de la barre ---- */
.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 16px 0 13px;
  font: 500 14px/1 var(--f-display);
  background: var(--glass); border: 1px solid var(--line-2); border-radius: 999px;
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  transition: background .25s, border-color .25s, transform .25s var(--ease);
}
.btn-ghost svg { width: 18px; height: 18px; color: var(--ink-2); }
.btn-ghost:hover { background: rgba(255, 255, 255, .09); border-color: rgba(255, 255, 255, .26); }
.btn-ghost:active { transform: scale(.97); }
.btn-ghost[hidden] { display: none; }
.btn-light svg { display: none; }
.btn-light[data-mode="real"] .i-real,
.btn-light[data-mode="day"] .i-day,
.btn-light[data-mode="night"] .i-night { display: block; }
.btn-light[data-mode="day"] svg { color: #ffd166; }
.btn-light[data-mode="night"] svg { color: #9db8ff; }
.btn-light span { min-width: 5.2em; text-align: left; }
body.touring #tourBtn { border-color: rgba(255, 91, 58, .55); background: rgba(255, 91, 58, .12); }
body.touring #tourBtn svg { color: var(--ember); }

/* ================= Visite guidée ================= */
/* Mode cinéma : filtres et frise s'effacent pendant la visite */
body.touring .filters, body.touring .timeline { opacity: 0; pointer-events: none; transform: translateY(16px); }
.tour {
  position: fixed; z-index: 25; left: var(--gap); right: var(--gap); bottom: 28px;
  display: flex; justify-content: center; pointer-events: none;
  transition: right .7s var(--ease);
}
.tour[hidden] { display: none; }
@media (min-width: 900px) {
  body.panel-open .tour { right: calc(var(--panel-w) + var(--gap) * 2); }
}
.tour-pill {
  position: relative; overflow: hidden; pointer-events: auto;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 8px 8px 18px; border-radius: 999px;
  animation: revealIn .6s var(--ease-out) both;
}
.tour-label { display: inline-flex; align-items: center; gap: 9px; font: 600 12px/1 var(--f-display); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); }
.tour-pos { font: 500 13px/1 var(--f-display); color: var(--ink); font-variant-numeric: tabular-nums; min-width: 52px; text-align: center; }
.tour-btn {
  display: grid; place-items: center; width: 40px; height: 40px;
  background: rgba(255, 255, 255, .06); border: 1px solid var(--line); border-radius: 50%;
  transition: background .2s;
}
.tour-btn:hover { background: rgba(255, 255, 255, .12); }
.tour-btn svg { width: 17px; height: 17px; }
.tour-btn .i-play { display: none; fill: currentColor; }
.tour.paused .i-play { display: block; }
.tour.paused .i-pause { display: none; }
.tour.paused .pulse-dot { animation: none; opacity: .4; }
.tour-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(255, 255, 255, .06); }
.tour-bar i {
  display: block; height: 100%; width: 100%; transform-origin: left;
  background: linear-gradient(90deg, var(--ember), var(--magenta));
  box-shadow: 0 0 10px rgba(255, 91, 58, .8);
  animation: tourFill var(--dur, 12s) linear forwards;
}
.tour.paused .tour-bar i { animation-play-state: paused; }
@keyframes tourFill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ================= Bilan ================= */
.stats-dlg {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 48px);
  padding: 24px 26px 22px; overflow: auto;
  color: var(--ink);
  background: linear-gradient(180deg, rgba(12, 17, 32, .9), rgba(6, 9, 18, .92));
  -webkit-backdrop-filter: blur(26px) saturate(150%); backdrop-filter: blur(26px) saturate(150%);
  border: 1px solid var(--line-2); border-radius: 24px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .06);
  scrollbar-width: thin;
}
.stats-dlg[open] { animation: revealIn .45s var(--ease-out); }
.stats-dlg::backdrop { background: rgba(3, 5, 11, .55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.sd-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.sd-head h2 { margin: 4px 0 0; font: 700 26px/1.1 var(--f-display); letter-spacing: -.03em; }
.sd-eyebrow { margin: 0; font: 500 12px/1.3 var(--f-display); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.sd-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 20px; }
.sd-hero { border-color: rgba(255, 91, 58, .35); background: rgba(255, 91, 58, .07); }
.sd-hero .stat-val { color: #ff8a70; }

.sd-bars, .sd-top { list-style: none; margin: 0; padding: 0; display: grid; }
.sd-bars { gap: 4px; }
.sd-bars li {
  display: grid; grid-template-columns: 150px 1fr 64px; align-items: center; gap: 12px;
  padding: 5px 6px; border-radius: 8px;
}
.sd-bars li:hover { background: rgba(255, 255, 255, .04); }
.sb-lbl { display: flex; align-items: center; gap: 9px; min-width: 0; font-size: 13.5px; white-space: nowrap; overflow: hidden; }
.sb-lbl .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--tc); box-shadow: 0 0 8px var(--tc); }
.sb-lbl small { margin-left: auto; font: 500 11.5px/1 var(--f-display); color: var(--muted); }
.sb-track { height: 10px; }
.sb-track i { display: block; height: 100%; min-width: 3px; border-radius: 0 4px 4px 0; background: var(--tc); opacity: .9; transition: width .6s var(--ease); }
.sb-val { font: 600 13.5px/1 var(--f-display); text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.sb-val small { font-size: .78em; font-weight: 500; color: var(--ink-2); margin-left: 1px; }
.sd-empty { color: var(--muted); font-size: 13.5px; }

.sd-top { gap: 2px; counter-reset: top; }
.sd-top button {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 10px 11px; text-align: left;
  background: transparent; border: 1px solid transparent; border-radius: 10px;
  transition: background .2s, border-color .2s;
}
.sd-top button::before {
  counter-increment: top; content: counter(top);
  width: 16px; font: 600 12px/1 var(--f-display); color: var(--muted); text-align: center;
}
.sd-top button:hover { background: rgba(255, 255, 255, .06); border-color: var(--line); }
.sd-top .r-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--tc); box-shadow: 0 0 10px var(--tc); }
.sd-top .r-main { flex: 1; min-width: 0; }
.sd-top b { display: block; font: 500 14px/1.3 var(--f-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-top .r-main small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-note { margin: 18px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; }

/* ================= Partage ================= */
.share-dlg { width: min(460px, calc(100vw - 32px)); }
.share-dlg .sd-head h2 { font-size: 21px; }
.share-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 8px; margin-top: 20px; }
.share-item {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 6px 2px;
  font: 500 12.5px/1.2 var(--f-body); color: var(--ink-2); text-decoration: none; text-align: center;
  background: none; border: 0; border-radius: 12px; transition: color .2s;
}
.share-item:hover { color: var(--ink); }
.share-ic {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
  color: var(--sc); background: color-mix(in srgb, var(--sc) 13%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sc) 38%, transparent);
  transition: transform .25s var(--ease), background .2s, box-shadow .25s;
}
.share-ic svg { width: 23px; height: 23px; }
.share-item:hover .share-ic { transform: translateY(-2px); background: color-mix(in srgb, var(--sc) 22%, transparent); box-shadow: inset 0 0 0 1px var(--sc), 0 8px 22px -10px var(--sc); }
.share-link { display: flex; gap: 8px; margin-top: 22px; }
.share-link input {
  flex: 1; min-width: 0; height: 42px; padding: 0 12px; font-size: 13px; color: var(--ink-2);
  background: rgba(255, 255, 255, .05); border: 1px solid var(--line-2); border-radius: 12px; outline: none;
}
.share-link input:focus { border-color: rgba(79, 227, 255, .5); color: var(--ink); }
.share-link .gh-next { flex: none; }
@media (max-width: 400px) { .share-link { flex-direction: column; } }

/* ================= Jeux ================= */
.btn-games svg { color: #ff9ad8; }

/* Menu des jeux */
.games-list { display: grid; gap: 10px; margin-top: 20px; }
.game-card {
  display: grid; grid-template-columns: 48px 1fr; gap: 14px; align-items: start; width: 100%;
  padding: 16px; text-align: left; color: var(--ink);
  background: rgba(255, 255, 255, .03); border: 1px solid var(--line); border-radius: 16px;
  transition: background .2s, border-color .2s, transform .25s var(--ease);
}
.game-card:hover { background: color-mix(in srgb, var(--gc) 8%, transparent); border-color: color-mix(in srgb, var(--gc) 45%, transparent); transform: translateY(-1px); }
.gc-ic {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px;
  color: var(--gc); background: color-mix(in srgb, var(--gc) 12%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gc) 35%, transparent), 0 0 24px -8px var(--gc);
}
.gc-ic svg { width: 24px; height: 24px; }
.gc-body { display: grid; gap: 4px; }
.gc-body b { font: 600 18px/1.2 var(--f-display); letter-spacing: -.01em; }
.gc-body > span { font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
.gc-body small { font: 500 12px/1.2 var(--f-display); color: var(--gc); margin-top: 2px; }

/* Mode jeu : on retire tout ce qui pourrait donner la réponse ou distraire */
body.gaming .filters, body.gaming .timeline, body.gaming .tour { opacity: 0; pointer-events: none; transform: translateY(16px); }
body.gaming .search, body.gaming #statsBtn, body.gaming #tourBtn, body.gaming #randomBtn { display: none; }

/* Panneau de jeu */
.game-hud {
  position: fixed; z-index: 28; left: 0; right: 0; bottom: 22px; margin: 0 auto;
  width: min(700px, calc(100% - 32px)); padding: 14px 16px 16px;
  border-radius: 22px; background: var(--glass-strong);
  animation: revealIn .45s var(--ease-out) both;
}
.game-hud[hidden] { display: none; }
.gh-top { display: flex; align-items: center; gap: 12px; }
.gh-title { font: 600 12px/1 var(--f-display); letter-spacing: .16em; text-transform: uppercase; color: #ff9ad8; }
.gh-round { font: 500 13px/1 var(--f-display); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.gh-score { margin-left: auto; font: 600 14px/1 var(--f-display); color: var(--ink); font-variant-numeric: tabular-nums; padding: 7px 11px; border-radius: 999px; background: rgba(255, 255, 255, .06); }
.gh-quit { width: 34px; height: 34px; }
.gh-quit svg { width: 15px; height: 15px; }
.gh-body { margin-top: 12px; }
.gh-q { margin: 0 0 12px; font: 600 clamp(17px, 2.2vw, 21px)/1.3 var(--f-display); letter-spacing: -.015em; text-wrap: balance; }

/* Duel : deux cartes face à face */
.duel { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: stretch; }
.duel-vs { align-self: center; font: 600 12px/1 var(--f-display); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.duel-opt {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 14px 14px 13px; text-align: left; color: var(--ink);
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line-2); border-radius: 16px;
  transition: background .2s, border-color .2s, transform .2s var(--ease), box-shadow .25s;
}
.duel-opt:hover:not(:disabled) { transform: translateY(-2px); border-color: color-mix(in srgb, var(--tc) 60%, transparent); background: color-mix(in srgb, var(--tc) 9%, transparent); box-shadow: 0 10px 30px -14px var(--tc); }
.duel-opt b { font: 600 16px/1.25 var(--f-display); letter-spacing: -.01em; }
.do-type { font: 600 10.5px/1 var(--f-display); letter-spacing: .12em; text-transform: uppercase; color: var(--tc); }
.do-key { position: absolute; top: 10px; right: 12px; font: 600 11px/1 var(--f-display); color: var(--muted); border: 1px solid var(--line-2); border-radius: 5px; padding: 3px 6px; }
.do-fact { font-size: 13px; color: var(--ink-2); line-height: 1.4; }
.duel-opt:disabled { cursor: default; }
.duel-opt.right { border-color: rgba(94, 230, 168, .7); background: rgba(94, 230, 168, .1); box-shadow: 0 0 0 1px rgba(94, 230, 168, .35), 0 12px 30px -14px rgba(94, 230, 168, .8); }
.duel-opt.wrong { border-color: rgba(255, 91, 90, .65); background: rgba(255, 91, 90, .08); }
.duel-opt.other { opacity: .75; }
.duel-opt.right .do-key, .duel-opt.wrong .do-key { display: none; }
.duel-opt.right::after, .duel-opt.wrong::after {
  position: absolute; top: 10px; right: 12px; font: 700 13px/1 var(--f-display);
}
.duel-opt.right::after { content: "✓"; color: #5ee6a8; }
.duel-opt.wrong::after { content: "✕"; color: #ff7a7a; }

/* Quiz : 4 réponses, chrono, séries */
.game-hud[data-mode="quiz"] .gh-title { color: #ffd166; }
.gh-timer { height: 4px; margin-top: 12px; border-radius: 4px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.gh-timer[hidden] { display: none; }
.gh-timer i {
  display: block; height: 100%; transform-origin: left;
  background: linear-gradient(90deg, #ffd166, #5ee6a8);
  box-shadow: 0 0 10px rgba(255, 209, 102, .7);
}
.gh-timer i.urgent { background: linear-gradient(90deg, #ff5b3a, #ff9a5c); box-shadow: 0 0 12px rgba(255, 91, 58, .8); }
.gh-subject { margin: 0 0 2px; font: 600 12px/1.4 var(--f-display); letter-spacing: .08em; text-transform: uppercase; color: #ffd166; }
.quiz { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quiz-opt {
  display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 10px 12px; text-align: left; color: var(--ink);
  font: 500 14.5px/1.3 var(--f-display);
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line-2); border-radius: 14px;
  transition: background .2s, border-color .2s, transform .2s var(--ease), opacity .2s;
}
.quiz-opt:hover:not(:disabled) { transform: translateY(-2px); border-color: rgba(255, 209, 102, .6); background: rgba(255, 209, 102, .08); }
.qo-key {
  display: grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 7px;
  font: 600 12px/1 var(--f-display); color: var(--ink-2); background: rgba(255, 255, 255, .06); border: 1px solid var(--line-2);
}
.quiz-opt:disabled { cursor: default; }
.quiz-opt.right { border-color: rgba(94, 230, 168, .75); background: rgba(94, 230, 168, .12); animation: qoRight .5s var(--ease-out); }
.quiz-opt.right .qo-key { color: #062a1c; background: #5ee6a8; border-color: #5ee6a8; }
.quiz-opt.wrong { border-color: rgba(255, 91, 90, .65); background: rgba(255, 91, 90, .09); animation: qoWrong .4s; }
.quiz-opt.wrong .qo-key { color: #fff; background: #ff5b5a; border-color: #ff5b5a; }
.quiz-opt.other { opacity: .5; }
@keyframes qoRight { 40% { transform: scale(1.04); } }
@keyframes qoWrong { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
.gh-fact { flex-basis: 100%; font-size: 13px !important; line-height: 1.55; color: var(--ink-2) !important; }
.gh-fact span { font: 600 11px/1 var(--f-display); letter-spacing: .1em; text-transform: uppercase; color: #ffd166; margin-right: 4px; }
.gh-fact b { color: var(--ink) !important; font-family: var(--f-body) !important; font-weight: 600; }
.gh-streak {
  display: inline-block; margin-left: 4px; padding: 3px 8px; border-radius: 999px;
  font: 700 11.5px/1.2 var(--f-display); color: #1a1000; background: linear-gradient(90deg, #ffd166, #ff9a5c);
  box-shadow: 0 0 16px rgba(255, 154, 92, .6); animation: qoRight .6s var(--ease-out);
}
.gh-score.pop { animation: scorePop .5s var(--ease-out); }
@keyframes scorePop { 30% { transform: scale(1.18); background: rgba(255, 209, 102, .25); color: #ffd166; } }
.gh-sub { margin: 6px 0 0; font-size: 13.5px; color: var(--ink-2); }
@media (max-width: 719px) {
  .quiz { grid-template-columns: 1fr; gap: 6px; }
  .quiz-opt { min-height: 44px; }
}

/* Résultat d'une manche */
.gh-result {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
  margin-top: 12px; padding: 12px 14px; border-radius: 14px;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line);
}
.gh-result p { margin: 0; font-size: 14px; color: var(--ink-2); }
.gh-result p b { color: var(--ink); font-family: var(--f-display); }
.gh-result small { color: var(--muted); }
.gh-result.ok { border-color: rgba(94, 230, 168, .4); background: rgba(94, 230, 168, .07); }
.gh-result.ok p b { color: #5ee6a8; }
.gh-result.ko { border-color: rgba(255, 122, 122, .35); background: rgba(255, 122, 122, .06); }
.gh-result.ko p b { color: #ff9a9a; }
.gh-next, .gh-alt {
  display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 18px;
  font: 600 14px/1 var(--f-display); border-radius: 999px; transition: transform .2s var(--ease), box-shadow .25s, background .2s, opacity .2s;
}
.gh-next { color: #0a0d16; background: linear-gradient(100deg, #fff, #ffd9ef); border: 0; box-shadow: 0 8px 26px -10px rgba(255, 92, 200, .8); }
.gh-next:hover:not(:disabled) { transform: translateY(-1px); }
.gh-next:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.gh-body > .gh-next { width: 100%; }
.gh-alt { color: var(--ink); background: rgba(255, 255, 255, .06); border: 1px solid var(--line-2); }
.gh-alt:hover { background: rgba(255, 255, 255, .12); }

/* Fin de partie */
.gh-end { text-align: center; padding: 4px 0 2px; }
.gh-final { margin: 0; font: 500 18px/1 var(--f-display); color: var(--ink-2); }
.gh-final b { font: 700 48px/1 var(--f-display); letter-spacing: -.04em; color: var(--ink); background: linear-gradient(100deg, #fff, #ff9ad8); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.gh-msg { margin: 10px 0 14px; color: var(--ink-2); font-size: 14.5px; }
.gh-record { color: #ffd166; }
.gh-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

/* Repères sur le globe pendant les jeux */
.game-pin span { font-size: 12.5px; font-weight: 600; }
.game-pin.win i { width: 11px; height: 11px; box-shadow: 0 0 0 3px rgba(255, 255, 255, .25), 0 0 14px var(--tc); }
body.gaming .globe { transform: translateY(-11vh); }
@media (max-width: 719px) { body.gaming .globe { transform: translateY(-18vh); } }

@media (max-width: 719px) {
  .game-hud { bottom: max(10px, env(safe-area-inset-bottom)); padding: 12px 12px 14px; border-radius: 18px; }
  .duel { grid-template-columns: 1fr; gap: 6px; }
  .duel-vs { justify-self: center; }
  .gh-result { padding: 10px 12px; }
  .gh-result .gh-next { width: 100%; }
}

/* Toast */
.toast {
  position: fixed; z-index: 60; left: 50%; top: 84px;
  transform: translate(-50%, -12px); opacity: 0; pointer-events: none;
  padding: 10px 16px; font-size: 13.5px;
  background: var(--glass-strong); border: 1px solid var(--line-2); border-radius: 999px;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  transition: opacity .3s, transform .4s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ================= Responsive ================= */
@media (max-width: 1100px) {
  :root { --panel-w: 400px; }
  .filters {
    top: 74px; left: 12px; right: 12px; width: auto; max-height: none;
    padding: 6px; border-radius: 16px; overflow: visible;
  }
  .filters-head, .filters-legend, .filters-support { display: none; }
  .chips { flex-direction: row; overflow-x: auto; scrollbar-width: none; gap: 4px; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { width: auto; flex: none; min-height: 36px; padding: 6px 12px 6px 10px; font-size: 13px; border-radius: 999px; }
  .chip[aria-pressed="true"] { background: rgba(255, 255, 255, .06); }
  .timeline { left: 12px; right: 12px; bottom: 12px; max-width: none; }
  body.is-intro .filters { transform: translateY(-16px); }
  .topbar { left: 12px; right: 12px; top: 14px; }
}

@media (max-width: 719px) {
  body { font-size: 14.5px; }
  .brand-text { display: none; }
  .brand { margin-right: 0; }
  .search { flex: 1; width: auto; }
  .search-kbd { display: none; }
  .btn-neon { width: 44px; padding: 0; justify-content: center; flex: none; }
  .btn-neon span { display: none; }
  .timeline { padding: 12px 14px; bottom: max(10px, env(safe-area-inset-bottom)); left: 10px; right: 10px; }
  .tl-range { font-size: 17px; }
  .tl-label { display: none; }
  .tl-count { font-size: 12px; }
  .intro { padding-bottom: 80px; }
  .topbar { gap: 6px; }
  .topbar .btn-ghost, .topbar .btn-neon { width: 40px; height: 40px; }
  .search input { height: 40px; }
  /* Recherche repliée en loupe ; elle s'étend sur toute la barre quand on la touche */
  .brand { margin-right: auto; }
  .search { flex: 0 0 40px; width: 40px; }
  .search input { padding: 0; color: transparent; cursor: pointer; }
  .search input::placeholder { color: transparent; }
  .search-icon { left: 50%; transform: translate(-50%, -50%); }
  .search:focus-within { position: absolute; z-index: 5; left: 0; right: 0; width: auto; }
  .search:focus-within input { padding: 0 16px 0 42px; color: var(--ink); cursor: text; }
  .search:focus-within input::placeholder { color: var(--muted); }
  .search:focus-within .search-icon { left: 15px; transform: translateY(-50%); }
  .brand-mark { width: 28px; height: 28px; }
  .tour { top: 70px; bottom: auto; left: 10px; right: 10px; }
  .tour-label { font-size: 11px; letter-spacing: .1em; }
  .stats-dlg { padding: 20px 16px 18px; }
  .sd-head h2 { font-size: 22px; }
  .sd-kpis { gap: 6px; }
  .sd-kpis .stat { padding: 12px 10px 10px; }
  .sd-kpis .stat-val { font-size: 18px; }
  .sd-bars li { grid-template-columns: 116px 1fr 52px; gap: 8px; }
  .sb-lbl { font-size: 12.5px; }
  .intro-hint { max-width: 280px; margin-inline: auto; }

  /* Panneau : bottom sheet */
  .panel {
    top: auto; left: 0; right: 0; bottom: 0; width: auto;
    max-height: 66dvh; height: 66dvh;
    border-radius: 24px 24px 0 0; border-bottom: 0;
    transform: translateY(105%); opacity: 1;
    transition: transform .6s var(--ease);
  }
  .panel.dragging { transition: none; }
  .panel::after { left: 60px; right: 60px; }
  .sheet-handle { display: grid; place-items: center; height: 26px; flex: none; cursor: grab; touch-action: none; }
  .sheet-handle span { width: 44px; height: 5px; border-radius: 5px; background: rgba(255, 255, 255, .28); }
  .panel-content { padding: 4px 18px 24px; }
  .stats { gap: 6px; }
  .stat { padding: 12px 10px 10px; }
  .stat-val { font-size: 20px; }
  .stat-lbl { font-size: 11px; }
  .p-nav { padding-inline: 8px; }
  .nav-btn b { font-size: 12.5px; }
}

@media (max-width: 380px) {
  .stat-val { font-size: 18px; }
  .intro-stats { gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .intro-title .ch, .reveal, .cq { opacity: 1; transform: none; filter: none; }
}
