/* LudoGraph — l'appli. Couleurs de la marque : nuit #1e1b4b, accent #e11d48,
   or #f59e0b (harmonisées avec gabarits/style.css du site statique).
   Clair par défaut, sombre selon le système ou le choix fait dans Réglages. */

:root {
  --fond: #f8f7f4; --surface: #ffffff; --surface-2: #f2f0f7; --encre: #1c1a2e; --encre-2: #4a4662; --encre-3: #7a7692;
  --trait: #e7e4ee; --trait-2: #d6d2e2; --nuit: #1e1b4b; --nuit-2: #312e81; --accent: #e11d48; --accent-doux: #ffe4e8;
  --accent-encre: #be123c; --or: #f59e0b; --halo: rgb(225 29 72 / .16); --vig-fond: #e9e6f0;
  --ombre: 0 1px 2px rgb(20 16 60 / .06), 0 8px 24px rgb(20 16 60 / .08);
  --ombre-forte: 0 2px 6px rgb(20 16 60 / .10), 0 18px 48px rgb(20 16 60 / .18);
  --rayon: 16px; --rayon-petit: 10px;
  --h-barre: 60px; --h-onglets: 0px;
  /* les relations du graphe : une couleur chacune, lisibles sur les deux fonds */
  --rel-proche: #7c3aed; --rel-suite: #ea580c; --rel-simple: #0891b2; --rel-tablee: #16a34a;
  --rel-auteur: #db2777; --rel-univers: #ca8a04; --rel-serie: #64748b;
  --etat-adore: #e11d48; --etat-ai: #16a34a; --etat-envie: #d97706; --etat-pas: #6b7280;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="clair"]) {
    --fond: #0f0e1a; --surface: #1a1829; --surface-2: #232036; --encre: #f1effa; --encre-2: #c9c5de; --encre-3: #918cab;
    --trait: #2c2942; --trait-2: #3a3655; --accent: #fb7185; --accent-doux: #3a1823; --accent-encre: #fda4af; --halo: rgb(251 113 133 / .2);
    --vig-fond: #262338; --ombre: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px rgb(0 0 0 / .35);
    --ombre-forte: 0 2px 6px rgb(0 0 0 / .45), 0 18px 48px rgb(0 0 0 / .55);
    --rel-proche: #a78bfa; --rel-suite: #fb923c; --rel-simple: #22d3ee; --rel-tablee: #4ade80;
    --rel-auteur: #f472b6; --rel-univers: #facc15; --rel-serie: #94a3b8;
    --etat-adore: #fb7185; --etat-ai: #4ade80; --etat-envie: #fbbf24; --etat-pas: #9ca3af;
    color-scheme: dark;
  }
}
:root[data-theme="sombre"] {
  --fond: #0f0e1a; --surface: #1a1829; --surface-2: #232036; --encre: #f1effa; --encre-2: #c9c5de; --encre-3: #918cab;
  --trait: #2c2942; --trait-2: #3a3655; --accent: #fb7185; --accent-doux: #3a1823; --accent-encre: #fda4af; --halo: rgb(251 113 133 / .2);
  --vig-fond: #262338; --ombre: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px rgb(0 0 0 / .35);
  --ombre-forte: 0 2px 6px rgb(0 0 0 / .45), 0 18px 48px rgb(0 0 0 / .55);
  --rel-proche: #a78bfa; --rel-suite: #fb923c; --rel-simple: #22d3ee; --rel-tablee: #4ade80;
  --rel-auteur: #f472b6; --rel-univers: #facc15; --rel-serie: #94a3b8;
  --etat-adore: #fb7185; --etat-ai: #4ade80; --etat-envie: #fbbf24; --etat-pas: #9ca3af;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fond); color: var(--encre); overflow: hidden;
  font: 15px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: default; }
a { color: var(--accent-encre); text-underline-offset: 3px; }
svg { fill: currentColor; }
h1, h2, h3, h4 { letter-spacing: -0.015em; line-height: 1.2; margin: 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.evite { position: absolute; left: 8px; top: -60px; z-index: 200; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.evite:focus { top: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.petit { font-size: .82rem; color: var(--encre-3); }

/* ------------------------------------------------------------ boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--trait-2); background: var(--surface); color: var(--encre);
  font-weight: 600; font-size: .9rem; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:hover { border-color: var(--encre-3); }
.btn-plein { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-plein:hover { background: var(--accent-encre); border-color: var(--accent-encre); }
:root[data-theme="sombre"] .btn-plein { color: #1c1a2e; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="clair"]) .btn-plein { color: #1c1a2e; } }
.btn-icone { width: 40px; height: 40px; padding: 0; border-radius: 12px; }
.btn-icone svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.btn-lien { color: var(--accent-encre); font-weight: 700; padding: 4px 2px; }
.btn-lien:hover { text-decoration: underline; }
.btn-danger { color: var(--accent-encre); border-color: var(--accent); }
.btn-danger-plein { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-x { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--encre-2); flex: none; }
.btn-x:hover { background: var(--surface-2); }
.btn-x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* ------------------------------------------------------------ structure */
.app {
  position: fixed; inset: 0; display: grid; grid-template-rows: auto 1fr;
  padding-top: env(safe-area-inset-top, 0px);
}
.barre {
  display: flex; align-items: center; gap: 14px; height: var(--h-barre); padding: 0 16px;
  background: var(--surface); border-bottom: 1px solid var(--trait); position: relative; z-index: 60;
}
.marque { display: inline-flex; align-items: center; gap: 10px; color: var(--encre); text-decoration: none; font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; flex: none; }
.logo { width: 34px; height: 34px; border-radius: 10px; background: var(--nuit); color: #fb7185; display: grid; place-items: center; flex: none; }
.logo svg { width: 22px; height: 22px; }
.logo.grand { width: 64px; height: 64px; border-radius: 18px; }
.logo.grand svg { width: 40px; height: 40px; }

.quete { position: relative; flex: 1 1 320px; max-width: 480px; min-width: 0; }
.quete input {
  width: 100%; height: 40px; border-radius: 999px; border: 1px solid var(--trait-2); background: var(--surface-2);
  padding: 0 40px 0 38px; font-size: .95rem; outline: none; -webkit-appearance: none; appearance: none;
}
.quete input::-webkit-search-cancel-button { display: none; }
.quete input:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--halo); }
.loupe { position: absolute; left: 13px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); fill: none; stroke: var(--encre-3); stroke-width: 1.8; stroke-linecap: round; pointer-events: none; }
.b-fermer-rech { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--encre-2); }
.b-fermer-rech svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.res-boite {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 80; background: var(--surface);
  border: 1px solid var(--trait); border-radius: var(--rayon); box-shadow: var(--ombre-forte); max-height: 70vh; overflow: auto; padding: 6px;
}
.res-titre { margin: 8px 10px 4px; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--encre-3); }
.res-ligne { display: flex; align-items: center; gap: 12px; padding: 7px 10px; border-radius: 12px; cursor: pointer; }
.res-ligne:hover, .res-ligne.sel { background: var(--surface-2); }
.res-ligne .vig { width: 40px; height: 40px; border-radius: 9px; flex: none; }
.res-txt { display: flex; flex-direction: column; min-width: 0; }
.res-txt b { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-txt span { font-size: .8rem; color: var(--encre-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-pic { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-doux); color: var(--accent-encre); display: grid; place-items: center; flex: none; }
.res-pic svg { width: 20px; height: 20px; }
.res-vide { margin: 12px; color: var(--encre-3); }

.onglets { display: flex; gap: 4px; margin-left: auto; }
.onglet {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px;
  color: var(--encre-2); font-weight: 650; font-size: .92rem; position: relative;
}
.onglet svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.onglet:hover { background: var(--surface-2); color: var(--encre); }
.onglet[aria-current="page"] { background: var(--accent-doux); color: var(--accent-encre); }
.compteur { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 800; display: inline-grid; place-items: center; }

.pages { position: relative; overflow: hidden; min-height: 0; }
.page {
  position: absolute; inset: 0; transform: translateX(calc(var(--pos, 0) * 100% + var(--g, 0px)));
  transition: transform .32s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .32s; visibility: hidden; background: var(--fond);
}
.page.courante { visibility: visible; transition: transform .32s cubic-bezier(.2, .8, .2, 1), visibility 0s; }
.app.glisse .page { transition: none; visibility: visible; }
@media (prefers-reduced-motion: reduce) { .page, .page.courante { transition: none; } }
/* pan-y : le défilement vertical reste au navigateur, l'horizontale revient au
   balayage entre pages (les rangées de cartes, qui défilent elles-mêmes, gardent la leur) */
.page-corps { height: 100%; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; padding: 22px max(20px, calc((100% - 1180px) / 2)) 48px; }

/* ------------------------------------------------------------ Ma tablée */
.tablee { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tablee-nom { font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--encre-3); margin-right: 2px; }
.puce-tablee {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--trait-2); color: var(--encre-2); font-size: .86rem; font-weight: 600;
  white-space: nowrap; box-shadow: 0 1px 2px rgb(20 16 60 / .05);
}
.puce-tablee svg { width: 16px; height: 16px; opacity: .8; }
.puce-tablee:hover { border-color: var(--encre-3); color: var(--encre); }
.puce-tablee.active { background: var(--nuit); border-color: var(--nuit); color: #fff; }
:root[data-theme="sombre"] .puce-tablee.active { background: #4338ca; border-color: #4338ca; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="clair"]) .puce-tablee.active { background: #4338ca; border-color: #4338ca; } }
.puce-tablee.raccourcis { color: var(--accent-encre); }
.puce-tablee.effacer { width: 34px; padding: 0; justify-content: center; }
.puce-tablee.effacer svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; width: 14px; height: 14px; }
.puce-tablee[aria-expanded="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--halo); }
.menu-tablee {
  position: fixed; z-index: 120; background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon);
  box-shadow: var(--ombre-forte); padding: 10px;
}
.menu-titre { margin: 2px 6px 8px; font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--encre-3); }
.menu-choix { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.choix { min-height: 38px; padding: 6px 10px; border-radius: 10px; background: var(--surface-2); font-weight: 600; font-size: .88rem; text-align: left; border: 1px solid transparent; }
.choix:first-child { grid-column: 1 / -1; }
.choix:hover { border-color: var(--trait-2); }
.choix.actif { background: var(--accent-doux); color: var(--accent-encre); border-color: var(--accent); }

/* ------------------------------------------------------------ le graphe */
.scene {
  position: absolute; inset: 0; overflow: hidden; cursor: grab; touch-action: none; outline: none; isolation: isolate;
  background: radial-gradient(ellipse 80% 70% at 50% 55%, var(--halo) 0%, transparent 70%), var(--fond);
  user-select: none; -webkit-user-select: none;
}
.scene:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.scene.tire { cursor: grabbing; }
#aretes { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#noeuds { position: absolute; inset: 0; z-index: 1; }
.n { position: absolute; left: 0; top: 0; width: 0; height: 0; will-change: transform, opacity; }
.n-in {
  position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 4px; border-radius: var(--rayon); color: var(--encre); -webkit-touch-callout: none; width: max-content;
}
.n-in .vig { max-width: none; }
.n-in:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.vig {
  border-radius: 12px; background-color: var(--vig-fond); object-fit: cover; display: block; flex: none;
  box-shadow: 0 2px 8px rgb(0 0 0 / .18); border: 1px solid rgb(127 120 150 / .25);
}
img.vig { transition: opacity .3s ease; }
img.vig.vig-chargement { opacity: 0; }
.n-in .vig { border: 2px solid var(--c, transparent); transition: transform .09s ease-out, opacity .3s ease; }
.n-c .vig { border: 3px solid var(--accent); box-shadow: 0 0 0 5px var(--halo), 0 8px 22px rgb(0 0 0 / .22); }
.n-in.touche .vig { transform: scale(.92); }
.n-in.choisi .vig { box-shadow: 0 0 0 4px var(--halo), 0 0 0 6px var(--accent), 0 4px 14px rgb(0 0 0 / .22); }
@media (hover: hover) { .n-in:hover .vig { box-shadow: 0 0 0 3px var(--c, var(--accent)), 0 6px 16px rgb(0 0 0 / .25); } }
.etiq {
  width: max-content; max-width: 128px; text-align: center; font-size: 12.5px; line-height: 1.2; font-weight: 600; color: var(--encre);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  text-shadow: 0 0 6px var(--fond), 0 0 3px var(--fond), 0 0 1px var(--fond);
}
.n-c .etiq { font-size: 15px; font-weight: 800; max-width: 200px; -webkit-line-clamp: 3; }
.etiq .hors { display: block; font-size: 11px; font-weight: 600; color: var(--encre-3); }

/* la couverture dessinée d'un jeu sans photo */
.vig-dessin {
  position: relative; overflow: hidden; color: #fff; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, hsl(var(--t) 70% 52%), hsl(calc(var(--t) + 40) 65% 30%));
}
.vig-dessin svg { position: absolute; top: 9%; right: 7%; width: 46%; height: auto; opacity: .22; }
.vig-ini { font-weight: 800; letter-spacing: .02em; text-shadow: 0 1px 6px rgb(0 0 0 / .3); position: relative; }
.vig-nom {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 14px; font-weight: 800; font-size: 1.05rem; line-height: 1.15;
  letter-spacing: -0.01em; text-shadow: 0 1px 8px rgb(0 0 0 / .3); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

.surcouche-haut { position: absolute; top: 12px; left: 14px; right: 14px; z-index: 20; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.surcouche-haut > * { pointer-events: auto; }
.fil-ligne { display: flex; align-items: center; gap: 8px; pointer-events: none; min-width: 0; }
.tablee-barre { flex: 0 1 auto; min-width: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
.tablee-barre::-webkit-scrollbar { display: none; }
.tablee-barre .tablee-nom { display: none; }
.tablee-barre .puce-tablee { flex: none; height: 34px; }
.fil-ligne > * { pointer-events: auto; }
.fil { display: flex; gap: 6px; }
.fil button, .btn-affiner {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 11px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--trait); color: var(--encre-2); font-size: .85rem; font-weight: 600; box-shadow: var(--ombre);
}
.fil button svg, .btn-affiner svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.fil .b-nav { width: 34px; padding: 0; justify-content: center; }
.fil button:disabled { opacity: .45; }
.btn-affiner { position: relative; }
.btn-affiner[aria-expanded="true"], .b-histo[aria-expanded="true"] { border-color: var(--accent); color: var(--accent-encre); background: var(--accent-doux); }
.pastille { position: absolute; top: 5px; right: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.historique {
  align-self: flex-start; width: min(340px, 100%); max-height: 50vh; overflow: auto; background: var(--surface);
  border: 1px solid var(--trait); border-radius: var(--rayon); box-shadow: var(--ombre-forte); padding: 6px;
}
.historique ol { list-style: none; margin: 0; padding: 0; }
.histo-l { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border-radius: 10px; text-align: left; font-weight: 600; font-size: .9rem; }
.histo-l .vig { width: 32px; height: 32px; border-radius: 8px; }
.histo-l:hover { background: var(--surface-2); }
.histo-l.ici { background: var(--accent-doux); color: var(--accent-encre); }
.historique .vide { margin: 10px; color: var(--encre-3); }

.legende { position: absolute; left: 14px; bottom: 14px; z-index: 20; background: var(--surface); border: 1px solid var(--trait); border-radius: 12px; box-shadow: var(--ombre); padding: 4px; max-width: calc(100% - 28px); }
.legende-b { display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px; font-size: .8rem; font-weight: 700; color: var(--encre-2); }
.legende-b::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-135deg) translate(-2px, -1px); }
.legende-b[aria-expanded="false"]::after { transform: rotate(45deg) translate(-2px, -2px); }
.legende-l { list-style: none; margin: 0; padding: 2px 8px 6px; display: grid; gap: 3px; font-size: .8rem; color: var(--encre-2); }
.legende-l li { display: flex; align-items: center; gap: 8px; }
.legende .trait { width: 22px; height: 0; border-top: 3px solid var(--c, var(--encre-3)); border-radius: 2px; flex: none; }
.legende .pointille .trait { border-top-style: dotted; border-top-color: var(--encre-3); }

.zoom { position: absolute; right: 14px; bottom: 14px; z-index: 20; display: flex; flex-direction: column; border: 1px solid var(--trait); border-radius: 12px; overflow: hidden; background: var(--surface); box-shadow: var(--ombre); }
.zoom .btn { border: 0; border-radius: 0; min-height: 38px; width: 40px; padding: 0; font-size: 1.2rem; border-top: 1px solid var(--trait); }
.zoom .btn:first-child { border-top: 0; }
.zoom .btn svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; width: 17px; height: 17px; }
body.fiche-ouverte .zoom { display: none; }

.bulle {
  position: absolute; z-index: 50; pointer-events: none; max-width: 270px; background: var(--surface); border: 1px solid var(--trait);
  border-radius: 12px; padding: 9px 12px; box-shadow: var(--ombre-forte); transform: translate(-50%, -100%);
}
.bulle.dessous { transform: translate(-50%, 0); }
.bulle b { display: block; font-size: .92rem; }
.bulle i { display: block; font-style: normal; font-size: .84rem; color: var(--encre-2); line-height: 1.4; margin-top: 2px; }
.bulle small { display: block; font-size: .76rem; color: var(--encre-3); margin-top: 4px; }
.bulle-rel { display: inline-flex; align-items: center; gap: 6px; font-style: normal; font-size: .76rem; font-weight: 700; color: var(--c); margin-top: 3px; }
.bulle-rel::before { content: ""; width: 14px; height: 3px; border-radius: 2px; background: var(--c); }
.graphe-vide { position: absolute; left: 50%; top: 62%; transform: translate(-50%, 0); z-index: 25; background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 14px 18px; text-align: center; width: min(340px, 90%); }
.graphe-vide p { margin: 0 0 10px; }
.attente { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 30; display: flex; align-items: center; gap: 10px; background: var(--surface); border-radius: 999px; padding: 8px 16px; box-shadow: var(--ombre); font-size: .88rem; color: var(--encre-2); }
.rond { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--trait-2); border-top-color: var(--accent); animation: tourne .8s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ panneaux (Affiner, Réglages) */
.panneau {
  position: fixed; z-index: 90; top: calc(env(safe-area-inset-top, 0px) + var(--h-barre) + 10px); right: 14px; width: min(380px, calc(100vw - 28px));
  max-height: calc(100% - var(--h-barre) - 24px - env(safe-area-inset-top, 0px)); display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--trait); border-radius: 18px; box-shadow: var(--ombre-forte); overflow: hidden;
}
.panneau-tete { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 10px 6px 18px; }
.panneau-tete h2 { font-size: 1.05rem; }
.panneau-corps { overflow-y: auto; padding: 4px 18px 14px; overscroll-behavior: contain; }
.panneau-pied { border-top: 1px solid var(--trait); padding: 8px 14px; display: flex; justify-content: flex-end; }
.curseur { padding: 10px 0; border-bottom: 1px solid var(--trait); }
.curseur-tete { display: flex; justify-content: space-between; gap: 10px; font-weight: 650; font-size: .92rem; }
.curseur-val { color: var(--encre-3); font-weight: 600; font-size: .84rem; text-align: right; }
.curseur.actif .curseur-val { color: var(--accent-encre); }
.crans { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; margin-top: 8px; }
.crans-bout { font-size: .76rem; color: var(--encre-3); line-height: 1.15; hyphens: auto; -webkit-hyphens: auto; }
.crans-bout.d { text-align: right; }
.crans-ligne {
  position: relative; display: flex; justify-content: space-between; align-items: center; width: 156px; height: 32px; touch-action: pan-y;
  background: linear-gradient(var(--trait-2), var(--trait-2)) center / calc(100% - 20px) 3px no-repeat;
}
.cran { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--trait-2); background: var(--surface); }
.cran.milieu { border-color: var(--encre-3); }
.cran[aria-checked="true"] { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--halo); }
.interrupteurs { border: 0; margin: 12px 0 0; padding: 0; }
.interrupteurs legend { font-weight: 700; font-size: .92rem; margin-bottom: 6px; padding: 0; }
.inter { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: .9rem; cursor: pointer; }
.inter input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.rel-pastille { width: 22px; height: 0; border-top: 3px solid var(--c); border-radius: 2px; }
.choix-theme { border: 0; padding: 0; margin: 4px 0 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.choix-theme legend { font-weight: 700; margin-bottom: 8px; padding: 0; }
.radio { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; background: var(--surface-2); cursor: pointer; font-weight: 600; font-size: .9rem; }
.radio input { accent-color: var(--accent); margin: 0; }
.zone-ludo { padding: 12px 0; border-top: 1px solid var(--trait); }
.confirme { background: var(--accent-doux); border-radius: 12px; padding: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.confirme p { margin: 0 0 4px; width: 100%; font-size: .9rem; }
.liens { font-size: .86rem; }

/* ------------------------------------------------------------ fiche */
.fiche {
  position: fixed; z-index: 70; top: calc(env(safe-area-inset-top, 0px) + var(--h-barre) + 10px); right: 14px; bottom: 14px;
  width: min(430px, calc(100vw - 28px)); background: var(--surface); border: 1px solid var(--trait); border-radius: 20px;
  box-shadow: var(--ombre-forte); display: flex; flex-direction: column; overflow: hidden;
  transform: translateX(24px); opacity: 0; transition: transform .25s ease, opacity .2s ease;
}
.fiche.ouverte { transform: none; opacity: 1; }
.fiche-poignee { display: none; }
.fiche-fermer { position: absolute; top: 10px; right: 10px; z-index: 3; background: var(--surface); box-shadow: var(--ombre); }
.fiche-corps { overflow-y: auto; overscroll-behavior: contain; padding: 18px 18px 28px; }
.fiche-tete { display: grid; grid-template-columns: 128px 1fr; gap: 16px; align-items: start; padding-right: 30px; }
.fiche-visuel { position: relative; width: 128px; aspect-ratio: 1; border-radius: 16px; overflow: hidden; box-shadow: var(--ombre); }
.fiche-visuel .vig { width: 100%; height: 100%; border-radius: 0; border: 0; box-shadow: none; }
.fiche-visuel .vig-nom { font-size: .85rem; padding: 8px 10px; }
.fiche-titre { font-size: 1.35rem; font-weight: 800; }
.par { margin: 4px 0 0; color: var(--encre-3); font-size: .88rem; }
.lien-auteur { color: var(--encre-2); font-weight: 600; text-decoration: underline; text-decoration-color: var(--trait-2); text-underline-offset: 3px; }
.lien-auteur:hover { color: var(--accent-encre); text-decoration-color: currentColor; }
.accroche { margin: 8px 0 0; font-size: .93rem; color: var(--encre-2); line-height: 1.45; }
.faits { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.fait { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--encre); background: var(--surface-2); padding: 4px 10px; border-radius: 999px; }
.fait svg { width: 15px; height: 15px; opacity: .7; flex: none; }
.hors-tablee { display: inline-block; margin: 8px 0 0; font-size: .78rem; font-weight: 700; color: var(--encre-3); border: 1px dashed var(--trait-2); border-radius: 999px; padding: 2px 10px; }
.ludo-boutons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 16px; }
.ludo-b {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px; border-radius: 12px; border: 1px solid var(--trait-2);
  background: var(--surface); color: var(--encre-2); font-size: .76rem; font-weight: 700; line-height: 1.1; text-align: center;
}
.ludo-b svg { width: 20px; height: 20px; }
.ludo-b:hover { border-color: var(--encre-3); }
.ludo-adore { --e: var(--etat-adore); } .ludo-ai { --e: var(--etat-ai); } .ludo-envie { --e: var(--etat-envie); } .ludo-pas { --e: var(--etat-pas); }
.ludo-b svg { color: var(--e); }
.ludo-b.actif { background: var(--e); border-color: var(--e); color: #fff; }
.ludo-b.actif svg { color: #fff; }
.fiche-suite > section, .fiche-suite > .bloc-puces { margin-top: 22px; }
.fiche-suite h3 { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--encre-3); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.mode { margin: 0 0 8px; font-weight: 650; font-size: .92rem; }
.jauge { display: grid; grid-template-columns: 1fr auto 70px; align-items: center; gap: 10px; padding: 4px 0; font-size: .88rem; }
.jauge-barre { display: inline-flex; gap: 4px; }
.jauge-barre i { width: 26px; height: 8px; border-radius: 4px; background: var(--trait); }
.jauge-barre i.plein { background: var(--nuit-2); }
:root[data-theme="sombre"] .jauge-barre i.plein { background: #818cf8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="clair"]) .jauge-barre i.plein { background: #818cf8; } }
.jauge-val { color: var(--encre-3); font-size: .8rem; }
.puces { display: flex; flex-wrap: wrap; gap: 6px; }
.puce { padding: 5px 12px; border-radius: 999px; background: var(--surface-2); font-size: .84rem; font-weight: 600; color: var(--encre); border: 1px solid transparent; }
.puce:hover { border-color: var(--accent); color: var(--accent-encre); }
.presentation p { margin: 0 0 10px; font-size: .93rem; line-height: 1.6; }
.presentation .source { font-size: .78rem; color: var(--encre-3); margin-top: 8px; }
.presentation .source a { color: inherit; }
.presentation .detail { font-size: .86rem; color: var(--encre-2); }
.attente-texte { color: var(--encre-3); font-size: .9rem; }
.acheter { background: var(--surface-2); border-radius: var(--rayon); padding: 14px; }
.acheter h3 svg { width: 18px; height: 18px; color: var(--accent); }
.boutiques { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.boutiques a { display: flex; flex-direction: column; padding: 10px 14px; border-radius: 12px; background: var(--nuit); color: #fff; text-decoration: none; }
.boutiques a:hover { background: var(--nuit-2); }
.boutiques span { font-size: .76rem; color: #c7c4ea; }
.acheter .petit { margin: 8px 0 0; }
.groupe { margin-bottom: 14px; }
.groupe h4 { display: flex; align-items: center; gap: 8px; font-size: .86rem; font-weight: 750; margin-bottom: 6px; color: var(--encre); }
.groupe h4::before { content: ""; width: 18px; height: 3px; border-radius: 2px; background: var(--c); }
.voisin { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px; border-radius: 12px; text-align: left; }
.voisin:hover { background: var(--surface-2); }
.voisin .vig { width: 44px; height: 44px; border-radius: 9px; }
.voisin-txt { display: flex; flex-direction: column; min-width: 0; }
.voisin-txt b { font-size: .9rem; }
.voisin-txt span { font-size: .8rem; color: var(--encre-3); line-height: 1.3; }
.voisin-txt small { font-size: .72rem; color: var(--encre-3); font-weight: 700; }
.voisin.hors { opacity: .6; }

/* ------------------------------------------------------------ Découvrir, listes, ludothèque */
.pg-titre { font-size: clamp(1.5rem, 3.2vw, 2rem); font-weight: 800; outline: none; }
.dec-sous { color: var(--encre-3); margin: 6px 0 0; }
.dec-tablee { margin-top: 16px; background: var(--surface); border: 1px solid var(--trait); border-radius: 18px; padding: 12px 14px; box-shadow: var(--ombre); }
.en-liste .dec-tete { display: none; }
.rayon { margin-top: 30px; }
.rayon-tete { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 12px; }
.rayon-tete h2 { font-size: 1.2rem; font-weight: 800; }
.rayon-tete p { margin: 3px 0 0; color: var(--encre-3); font-size: .9rem; }
.rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: 172px; gap: 14px; overflow-x: auto; scroll-snap-type: x proximity;
  padding: 4px 2px 10px; margin: 0 -2px; overscroll-behavior-x: contain; scrollbar-width: thin; touch-action: pan-x pan-y;
}
.rail > * { scroll-snap-align: start; }
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 14px; }
.carte {
  display: flex; flex-direction: column; text-align: left; background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon);
  overflow: hidden; box-shadow: var(--ombre); transition: transform .18s, box-shadow .18s; width: 100%; height: 100%; color: var(--encre);
}
@media (hover: hover) { .carte:hover { transform: translateY(-3px); box-shadow: var(--ombre-forte); } }
.carte.hors { opacity: .62; }
.carte-visuel { position: relative; aspect-ratio: 4 / 3; background: var(--vig-fond); overflow: hidden; }
.carte-visuel .vig { width: 100%; height: 100%; border-radius: 0; border: 0; box-shadow: none; }
.carte-etat { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--e); color: #fff; box-shadow: 0 2px 8px rgb(0 0 0 / .25); }
.carte-etat svg { width: 16px; height: 16px; }
.etat-adore { --e: var(--etat-adore); } .etat-ai { --e: var(--etat-ai); } .etat-envie { --e: var(--etat-envie); } .etat-pas { --e: var(--etat-pas); }
.carte-txt { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px 12px; flex: 1; }
.carte-txt strong { font-size: .92rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.carte-txt em { font-style: normal; font-size: .76rem; color: var(--accent-encre); font-weight: 650; line-height: 1.25; }
.carte-bas { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 6px; margin-top: auto; }
.carte-faits { font-size: .76rem; color: var(--encre-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.entrees-l { display: flex; flex-wrap: wrap; gap: 8px; }
.entree { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--trait); font-weight: 650; font-size: .88rem; box-shadow: 0 1px 2px rgb(20 16 60 / .05); }
.entree small { color: var(--encre-3); font-weight: 600; }
.entree:hover { border-color: var(--accent); color: var(--accent-encre); }
.invitation { background: linear-gradient(135deg, var(--nuit) 0%, #3b2a7a 100%); color: #fff; border-radius: 22px; padding: 20px; }
.invitation .rayon-tete p { color: #d6d3f0; }
.invitation-compte { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-weight: 700; color: #fda4af; }
.invitation-barre { display: inline-flex; gap: 4px; }
.invitation-barre i { width: 28px; height: 6px; border-radius: 3px; background: rgb(255 255 255 / .2); }
.invitation-barre i.plein { background: #fb7185; }
.invitation-g { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.invitation .carte { color: var(--encre); }
.invitation .carte.aime { outline: 3px solid #fb7185; outline-offset: -3px; }
.coeur { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgb(0 0 0 / .35); color: #fff; }
.coeur svg { width: 17px; height: 17px; }
.aime .coeur { background: #e11d48; }
.liste-tete { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.btn-retour { display: inline-flex; align-items: center; gap: 4px; color: var(--encre-2); font-weight: 650; font-size: .9rem; padding: 4px 6px 4px 0; }
.btn-retour svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.liste-compte { color: var(--encre-3); margin: 4px 0 14px; }
.masques { font-size: .88rem; color: var(--encre-2); background: var(--surface-2); border-radius: 12px; padding: 8px 12px; margin: -4px 0 16px; }
.vide-texte { color: var(--encre-3); }
.ludo-vide { text-align: center; max-width: 440px; margin: 40px auto; display: flex; flex-direction: column; align-items: center; gap: 14px; color: var(--encre-2); }
.ludo-resume { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.ludo-compte { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--trait); font-weight: 650; font-size: .9rem; }
.ludo-compte svg { width: 18px; height: 18px; color: var(--e); }
.ludo-compte b { background: var(--surface-2); border-radius: 999px; padding: 0 8px; font-size: .8rem; }
.ludo-compte:disabled { opacity: .5; }
.ludo-rayon h2 { display: flex; align-items: center; gap: 8px; font-size: 1.2rem; margin-bottom: 12px; scroll-margin-top: 12px; }
.ludo-rayon h2 svg { width: 22px; height: 22px; color: var(--e); }
.ludo-rayon h2 small { color: var(--encre-3); font-size: .85rem; font-weight: 600; }
.carte-cadre { position: relative; }
.carte-retirer { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 50%; background: rgb(15 14 26 / .6); color: #fff; display: grid; place-items: center; z-index: 2; }
.carte-retirer svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.carte-retirer:hover { background: var(--accent); }

/* ------------------------------------------------------------ messages, voile */
.fugace {
  position: fixed; left: 50%; bottom: calc(24px + var(--h-onglets) + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 150;
  background: var(--nuit); color: #fff; padding: 10px 18px; border-radius: 999px; box-shadow: var(--ombre-forte); font-size: .9rem; font-weight: 600;
  max-width: calc(100vw - 32px); text-align: center; transition: opacity .3s;
}
.fugace.parti { opacity: 0; }
.voile { position: fixed; inset: 0; z-index: 300; background: var(--nuit); color: #fff; display: grid; place-items: center; transition: opacity .35s; }
.voile.parti { opacity: 0; }
.voile-in { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding: 20px; max-width: 360px; }
.voile .logo { background: #2e2a6b; animation: pulse 1.4s ease-in-out infinite; }
.voile p { color: #d6d3f0; margin: 0; }
@keyframes pulse { 50% { transform: scale(.92); } }
.bandeau-maj { position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 10px); transform: translateX(-50%); z-index: 160; display: flex; align-items: center; gap: 12px; background: var(--nuit); color: #fff; padding: 8px 8px 8px 16px; border-radius: 999px; box-shadow: var(--ombre-forte); font-size: .88rem; max-width: calc(100vw - 24px); }
.bandeau-maj button { background: #fb7185; color: #1c1a2e; font-weight: 700; border-radius: 999px; padding: 6px 12px; }

/* ------------------------------------------------------------ téléphone */
@media (max-width: 900px) {
  :root { --h-barre: 56px; --h-onglets: 62px; }
  body { font-size: 14.5px; }
  .app { grid-template-rows: auto 1fr; padding-bottom: calc(var(--h-onglets) + env(safe-area-inset-bottom, 0px)); }
  .barre { gap: 10px; padding: 0 10px 0 12px; }
  .marque-nom { display: none; }
  .quete { max-width: none; }
  .onglets {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 65; margin: 0; gap: 0; display: grid; grid-template-columns: repeat(3, 1fr);
    height: calc(var(--h-onglets) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--surface); border-top: 1px solid var(--trait);
  }
  .onglet { flex-direction: column; justify-content: center; gap: 2px; height: 100%; border-radius: 0; font-size: .72rem; padding: 0 4px; }
  .onglet:hover { background: none; }
  .onglet[aria-current="page"] { background: none; color: var(--accent-encre); }
  .onglet[aria-current="page"] svg { stroke-width: 2.1; }
  .onglet .compteur { position: absolute; top: 6px; left: calc(50% + 6px); height: 17px; min-width: 17px; font-size: .66rem; padding: 0 5px; }
  /* la recherche prend toute la page sous la barre (champ + liste : jamais un panneau qui bouge) */
  body.recherche-ouverte .res-boite { position: fixed; top: calc(env(safe-area-inset-top, 0px) + var(--h-barre)); left: 0; right: 0; bottom: 0; max-height: none; border-radius: 0; border: 0; border-top: 1px solid var(--trait); box-shadow: none; z-index: 100; padding: 8px; }
  body.recherche-ouverte .marque { display: none; }
  body.recherche-ouverte #b-reglages { display: none; }
  .page-corps { padding: 16px 14px 32px; }
  .surcouche-haut { top: 8px; left: 8px; right: 8px; gap: 6px; }
  .tablee-barre { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: 100%; padding: 2px; margin: -2px; }
  .tablee-barre::-webkit-scrollbar { display: none; }
  .tablee-barre .tablee-nom { display: none; }
  .puce-tablee { height: 32px; padding: 0 10px; font-size: .82rem; flex: none; }
  .fil button, .btn-affiner { height: 32px; }
  .b-histo span { display: none; }
  .b-histo { width: 32px; padding: 0 !important; justify-content: center; }
  .zoom { display: none; }
  .legende { left: 8px; bottom: 8px; }
  .etiq { font-size: 12px; max-width: 100px; }
  .n-c .etiq { font-size: 13.5px; max-width: 150px; }
  .menu-choix { grid-template-columns: 1fr 1fr; }
  .crans-ligne { width: 128px; }
  .panneau { top: auto; left: 0; right: 0; bottom: calc(var(--h-onglets) + env(safe-area-inset-bottom, 0px)); width: auto; max-height: 78%; border-radius: 20px 20px 0 0; border-bottom: 0; }
  .fiche {
    top: calc(env(safe-area-inset-top, 0px) + 8px); left: 0; right: 0; bottom: calc(var(--h-onglets) + env(safe-area-inset-bottom, 0px)); width: auto;
    border-radius: 20px 20px 0 0; border-bottom: 0; opacity: 1;
    transform: translateY(100%); transition: transform .3s cubic-bezier(.2, .8, .2, 1);
  }
  .fiche.ouverte[data-etat="apercu"] { transform: translateY(calc(100% - var(--apercu, 46vh) + var(--glisse, 0px))); }
  .fiche.ouverte[data-etat="pleine"] { transform: translateY(max(0px, var(--glisse, 0px))); }
  .fiche.tiree { transition: none; }
  .fiche-poignee { display: flex; justify-content: center; align-items: center; height: 22px; flex: none; cursor: grab; touch-action: none; }
  .fiche-poignee span { width: 42px; height: 5px; border-radius: 3px; background: var(--trait-2); }
  .fiche-fermer { top: 8px; right: 8px; width: 34px; height: 34px; }
  .fiche-corps { padding: 2px 14px 24px; }
  .fiche[data-etat="apercu"] .fiche-tete { touch-action: none; }
  .fiche-tete { grid-template-columns: 96px 1fr; gap: 12px; padding-right: 34px; }
  .fiche-visuel { width: 96px; }
  .fiche-titre { font-size: 1.15rem; }
  .accroche { font-size: .86rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .fiche[data-etat="pleine"] .accroche { display: block; }
  .fait { font-size: .78rem; padding: 3px 8px; }
  .ludo-boutons { margin-top: 12px; }
  .boutiques { grid-template-columns: 1fr; }
  .rail { grid-auto-columns: 148px; gap: 10px; }
  .grille { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .invitation { padding: 16px 12px; margin-inline: -4px; }
  .invitation-g { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .carte-txt { padding: 8px 10px 10px; }
  .menu-tablee { max-height: 70vh; overflow: auto; }
}
@media (max-width: 380px) {
  .puce-tablee span { max-width: 92px; overflow: hidden; text-overflow: ellipsis; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}


/* ------------------------------------------------------------ retours du 06/10/2026 */
/* Affiner dans la barre, comme PodGraph ; il ne sert que sur le graphe */
.barre .btn-affiner { height: 40px; border-radius: 12px; box-shadow: none; flex: none; }
.app:not([data-page="graphe"]) .barre .btn-affiner { display: none; }
/* Affiner : une bulle compacte sous son bouton, le graphe reste visible à côté */
.panneau.affiner { width: 340px; max-height: min(72vh, 620px); }
.affiner .panneau-tete { padding: 8px 8px 2px 16px; }
.affiner .panneau-tete h2 { font-size: .95rem; }
.affiner .panneau-corps { padding: 0 16px 8px; }
.affiner .curseur { padding: 7px 0; }
.affiner .curseur-tete { font-size: .86rem; }
.affiner .curseur-val { font-size: .78rem; }
.affiner .crans { margin-top: 4px; gap: 8px; }
.affiner .crans-ligne { width: 130px; height: 28px; }
.affiner .cran { width: 20px; height: 20px; }
.affiner .crans-bout { font-size: .72rem; }
.affiner .panneau-pied { padding: 4px 10px; }
.interrupteurs { margin: 8px 0 0; }
.inter-titre { font-weight: 650; font-size: .86rem; margin: 0 0 6px; }
.inter-l { display: flex; flex-wrap: wrap; gap: 6px; }
.inter-l .inter { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--trait-2); font-size: .8rem; font-weight: 600; color: var(--encre-3); background: var(--surface); }
.inter-l .inter .rel-pastille { width: 14px; border-top: 3px solid var(--c); opacity: .35; }
.inter-l .inter.actif { color: var(--encre); border-color: var(--c); }
.inter-l .inter.actif .rel-pastille { opacity: 1; }

/* cartes : les faits en toutes lettres, l'exigence en mots */
.carte-bas { flex-direction: column; align-items: flex-start; gap: 2px; }
.carte-faits { white-space: normal; font-size: .76rem; line-height: 1.3; }
.carte-exigence { font-size: .76rem; font-weight: 650; color: var(--encre-2); }

/* fiche : en-tête clair, une rangée discrète pour la ludothèque, puis des onglets */
.fiche-tete { grid-template-columns: 112px 1fr; gap: 14px; align-items: center; padding-right: 34px; }
.fiche-visuel { width: 112px; }
.btn-centre { margin-top: 10px; min-height: 34px; padding: 0 14px; font-size: .86rem; }
.fiche-corps > .accroche { margin: 12px 0 0; }
.fiche-corps > .faits { margin-top: 12px; }
.fiche .fait { font-size: .84rem; }
.ludo-boutons.petit { display: flex; flex-wrap: nowrap; gap: 6px; margin-top: 12px; overflow-x: auto; scrollbar-width: none; }
.ludo-boutons.petit::-webkit-scrollbar { display: none; }
.ludo-boutons.petit .ludo-b { flex: none; flex-direction: row; gap: 5px; padding: 4px 10px; white-space: nowrap; border-radius: 999px; font-size: .78rem; font-weight: 650; border-color: var(--trait); background: none; color: var(--encre-3); }
.ludo-boutons.petit .ludo-b svg { width: 15px; height: 15px; opacity: .8; }
.ludo-boutons.petit .ludo-b.actif { background: var(--e); border-color: var(--e); color: #fff; }
.ludo-boutons.petit .ludo-b.actif svg { opacity: 1; }
.fiche-onglets {
  position: sticky; top: -2px; z-index: 2; display: flex; gap: 2px; margin: 18px -18px 0; padding: 0 12px;
  background: var(--surface); border-bottom: 1px solid var(--trait); overflow-x: auto; scrollbar-width: none;
}
.fiche-onglets::-webkit-scrollbar { display: none; }
.fiche-onglet { flex: none; padding: 11px 10px 9px; font-size: .88rem; font-weight: 650; color: var(--encre-3); border-bottom: 2px solid transparent; white-space: nowrap; }
.fiche-onglet:hover { color: var(--encre); }
.fiche-onglet[aria-selected="true"] { color: var(--accent-encre); border-bottom-color: var(--accent); }
.fiche-panneau { padding-top: 16px; }
.fiche-panneau h3 { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--encre-3); margin: 22px 0 8px; display: flex; align-items: center; gap: 8px; }
.fiche-panneau .profil h3:first-child { margin-top: 18px; }
.fiche-panneau .bloc-puces h3 { margin-top: 18px; }
.prix ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.prix li { display: flex; align-items: flex-start; gap: 8px; font-size: .9rem; }
.prix li svg { width: 17px; height: 17px; color: var(--or); flex: none; margin-top: 2px; }
.photo-partie { margin: 20px 0 0; border-radius: 14px; overflow: hidden; background: var(--vig-fond); }
.photo-partie img { display: block; width: 100%; height: auto; max-height: 320px; object-fit: cover; }
.credits { margin-top: 18px; border-top: 1px solid var(--trait); padding-top: 10px; }
.credits .source { font-size: .78rem; color: var(--encre-3); margin: 0 0 4px; }
.credits a { color: inherit; }
.videos { display: grid; gap: 14px; }
.video { display: grid; gap: 6px; }
.video-vis { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; }
.video-vis img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .92; }
.video-lecture { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 58px; height: 40px; border-radius: 12px; background: rgb(0 0 0 / .7); color: #fff; display: grid; place-items: center; }
.video-vis:hover .video-lecture { background: #e11d48; }
.video-lecture svg { width: 24px; height: 24px; }
.video-duree { position: absolute; right: 8px; bottom: 8px; background: rgb(0 0 0 / .75); color: #fff; font-size: .74rem; font-weight: 700; padding: 1px 6px; border-radius: 6px; }
.video-cadre { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 12px; background: #000; }
.video-txt { display: flex; flex-direction: column; gap: 1px; }
.video-txt b { font-size: .9rem; line-height: 1.3; }
.video-txt span { font-size: .78rem; color: var(--encre-3); }
.video-txt .video-type { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-encre); }
.lien-plus { font-weight: 650; }
.fiche-panneau .boutiques { grid-template-columns: 1fr; }
.fiche-panneau .petit { margin-top: 10px; }
.hors-tablee { margin: 10px 0 0; }

/* la présentation du premier lancement */
.tuto { position: fixed; inset: 0; z-index: 250; display: flex; align-items: flex-end; justify-content: center; padding: 16px 16px calc(16px + var(--h-onglets) + env(safe-area-inset-bottom, 0px)); }
.tuto-voile { position: absolute; inset: 0; background: rgb(15 14 26 / .45); }
.tuto-carte {
  position: relative; width: min(440px, 100%); background: var(--surface); color: var(--encre); border-radius: 22px; box-shadow: var(--ombre-forte);
  padding: 20px 20px 14px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; touch-action: pan-y;
}
.tuto-dessin { width: 76px; height: 76px; fill: none; stroke: var(--accent); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.tuto-dessin .plein { fill: var(--accent); stroke: none; }
.tuto-dessin .plein.doux { fill: var(--accent-doux); }
.tuto-dessin .masque { fill: var(--surface); }
.tuto-dessin .r1 { stroke: var(--rel-proche); } .tuto-dessin .r2 { stroke: var(--rel-suite); } .tuto-dessin .r3 { stroke: var(--rel-tablee); }
.tuto-carte h2 { font-size: 1.15rem; font-weight: 800; }
.tuto-texte p { margin: 0; color: var(--encre-2); font-size: .95rem; line-height: 1.5; }
.tuto-liens { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; text-align: left; font-size: .84rem; }
.tuto-liens li { display: flex; align-items: center; gap: 8px; }
.tuto-liens .trait { width: 20px; border-top: 3px solid var(--c); border-radius: 2px; flex: none; }
.tuto-points { display: flex; gap: 6px; margin: 6px 0 2px; }
.tuto-points i { width: 7px; height: 7px; border-radius: 50%; background: var(--trait-2); }
.tuto-points i.ici { width: 20px; border-radius: 4px; background: var(--accent); }
.tuto-actions { display: flex; justify-content: space-between; width: 100%; gap: 10px; }
.tuto-passer { color: var(--encre-3); font-weight: 650; padding: 10px 8px; }
.tuto-suivant { margin-left: auto; background: var(--accent); color: #fff; font-weight: 700; border-radius: 999px; padding: 10px 20px; }
.tuto-anneau { position: fixed; border-radius: 16px; border: 3px solid var(--accent); box-shadow: 0 0 0 6px var(--halo); pointer-events: none; }
.zone-tuto { padding: 10px 0; border-top: 1px solid var(--trait); }

@media (max-width: 900px) {
  .barre .btn-affiner { width: 40px; padding: 0; justify-content: center; }
  .barre .btn-affiner .b-texte { display: none; }
  .fil .b-nav { display: none; }
  .tablee-barre { flex: 1 1 auto; }
  .tablee-barre .puce-tablee { height: 34px; }
  /* Affiner : une feuille basse à mi-hauteur, le graphe se cale au-dessus */
  .panneau.affiner { width: auto; max-height: 46%; right: 0 !important; }
  .ludo-boutons.petit { gap: 5px; }
  .ludo-boutons.petit .ludo-b { padding: 4px 8px; font-size: .74rem; gap: 4px; }
  .affiner .crans-ligne { width: 120px; }
  .fiche-tete { grid-template-columns: 92px 1fr; gap: 12px; }
  .fiche-visuel { width: 92px; }
  .fiche-onglets { margin: 14px -14px 0; padding: 0 6px; }
  .fiche-onglet { padding: 11px 8px 9px; font-size: .84rem; }
  .tuto-carte { padding: 16px 16px 10px; }
}
