/* Empyrée
   Mise en page : la carte 3D occupe tout l'écran ; l'interface flotte sur les bords
   en verre sombre (en-tête en haut, page de l'étoile à droite, carnet à gauche, lecteur en bas).
   Hyperliens à l'ancienne : bleu pour l'inconnu, violet pour ce qu'on a déjà visité. */

:root {
  --night: #03040b;
  --ink: #ecebfa;
  --muted: #9a9dbf;
  --faint: #62668e;
  --glass: color-mix(in srgb, rgba(9, 11, 26, 0.74), var(--theme-deep) 30%);
  --glass-strong: color-mix(in srgb, rgba(7, 9, 22, 0.94), var(--theme-deep) 24%);
  --line: color-mix(in srgb, rgba(206, 212, 255, 0.13), var(--theme-line) 55%);
  --line-strong: rgba(206, 212, 255, 0.26);
  --link: #9cc6ff;
  --link-visited: #c7a6ff;
  --gold: var(--theme-accent); /* l'or de l'Empyrée, ou la couleur de l'étoile (js/theme.js) */
  --danger: #ff9a87;

  /* Typographie d'atlas céleste gravé : les caractères Fell (Oxford, XVIIe siècle) pour les titres
     et les noms d'étoiles, leurs petites capitales pour les légendes, et Alegreya Sans, humaniste
     et calligraphique, pour l'interface. Chiffres alignés pour les durées et les coordonnées. */
  --font-display: "IM Fell English", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-caps: "IM Fell English SC", "IM Fell English", Georgia, serif;
  --font-ui: "Alegreya Sans", "Gill Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "Alegreya Sans", "Gill Sans", "Segoe UI", system-ui, sans-serif;

  --gutter: 16px;
  --page-w: min(460px, 100vw);
  --dock-h: 96px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  background: var(--night);
  color: var(--ink);
  font: 400 15.5px/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--font-mono); font-size: 0.86em; letter-spacing: 0.02em; font-variant-numeric: tabular-nums lining-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
cite { font-family: var(--font-display); font-style: italic; font-size: 1.1em; }

/* --- Scène ---------------------------------------------------------------- */
#scene { position: fixed; inset: 0; z-index: 0; isolation: isolate; } /* les noms 3D (z-index de three.js) restent sous l’interface */
#scene canvas { display: block; }
.sky-labels { pointer-events: none !important; }
.sky-label {
  pointer-events: none;
  white-space: nowrap;
  text-align: center;
  padding-top: 4px;
  text-shadow: 0 0 6px rgba(3, 4, 11, 0.95), 0 0 2px rgba(3, 4, 11, 1);
  transition: opacity 0.35s, transform 0.35s var(--ease);
  will-change: opacity;
}
.sky-label.is-track { font: 500 15px/1.1 var(--font-display); color: rgba(236, 235, 250, 0.78); }
.sky-label.is-track.is-visited { color: var(--ink); }
.sky-label.is-track.is-center { font-size: 19px; color: #fff; }
.sky-label.is-tag { font: italic 400 15px/1 var(--font-display); color: rgba(220, 214, 255, 0.82); }
.sky-label.is-registre { font: 400 12px/1 var(--font-ui); letter-spacing: 0.42em; text-transform: uppercase; color: rgba(240, 236, 255, 0.85); padding-top: 10px; }

/* Médaillon : l'image de l'étoile quand on s'en approche */
.medal {
  width: 0;
  height: 0;
  border-radius: 50%;
  overflow: hidden;
  background: var(--night);
  border: 1.5px solid color-mix(in oklab, var(--c) 70%, #fff);
  box-shadow: 0 0 0 3px rgba(3, 4, 11, 0.6), 0 0 24px color-mix(in oklab, var(--c) 60%, transparent), 0 0 70px color-mix(in oklab, var(--c) 28%, transparent);
  opacity: 0;
  transform: scale(0.55);
  transition: opacity 0.45s ease, transform 0.6s var(--ease), width 0.25s, height 0.25s;
  pointer-events: none;
}
.medal.is-shown.is-loaded { opacity: 1; transform: scale(1); }
.medal img { width: 100%; height: 100%; object-fit: cover; object-position: center 22%; display: block; }

/* --- Hyperliens ----------------------------------------------------------- */
.hl {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in oklab, var(--link) 55%, transparent);
  transition: color 0.2s, text-shadow 0.3s;
}
.hl.is-visited { color: var(--link-visited); text-decoration-color: color-mix(in oklab, var(--link-visited) 55%, transparent); }
.hl:hover { text-shadow: 0 0 14px color-mix(in oklab, var(--c, var(--link)) 80%, transparent); color: #fff; }
.hl.is-unknown {
  color: var(--faint);
  font-style: italic;
  text-decoration-style: dashed;
  text-decoration-color: var(--faint);
}
.hl.is-unknown::before { content: "✧ "; color: var(--c); font-style: normal; }
.tag {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.12em;
  color: var(--c);
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in oklab, var(--c) 60%, transparent);
}
.tag:hover { text-shadow: 0 0 12px var(--c); }

/* --- Boutons -------------------------------------------------------------- */
.btn, .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
  padding: 7px 15px;
  font-size: 14px;
  font-weight: 400;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.25s, border-color 0.25s, box-shadow 0.3s, opacity 0.25s, transform 0.2s;
}
.btn:hover, .chip:hover { background: rgba(255, 255, 255, 0.1); }
.btn:active, .chip:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn-small { padding: 5px 12px; font-size: 13px; }
.btn-quiet { border-color: transparent; background: none; color: var(--muted); }
.btn-quiet:hover { color: var(--ink); }
.btn-play { border-color: color-mix(in oklab, var(--c) 70%, transparent); background: color-mix(in oklab, var(--c) 16%, transparent); }
.btn-play:hover { background: color-mix(in oklab, var(--c) 28%, transparent); }
.btn.is-on, .chip[aria-pressed="true"].chip-small { box-shadow: 0 0 18px color-mix(in oklab, var(--c, var(--gold)) 45%, transparent); }
.btn.is-armed { border-color: var(--danger); color: var(--danger); }

.chip { padding: 5px 12px; font-size: 13px; }
/* Constellations de l'en-tête : comme la légende d'une carte céleste, pas des pastilles.
   Une étoile à quatre branches de leur couleur, le nom en petites capitales gravées. */
.chip[data-reg] {
  gap: 0.45em; padding: 5px 8px 4px; border: 0; border-radius: 0; background: none; box-shadow: none;
  font: 400 14.5px/1 var(--font-caps); letter-spacing: 0.08em;
  color: color-mix(in oklab, var(--c) 22%, #efe7d4);
  text-shadow: 0 0 10px rgba(3, 4, 11, 0.9);
  position: relative;
}
.chip[data-reg]::before { content: "✦"; font: 400 11px/1 var(--font-ui); color: var(--c); text-shadow: 0 0 8px var(--c); transition: transform 0.3s var(--ease); }
.chip[data-reg]::after {
  content: ""; position: absolute; left: 8px; right: 8px; bottom: 0; height: 1px; transform: scaleX(0); transform-origin: center;
  background: linear-gradient(90deg, transparent, color-mix(in oklab, var(--c) 70%, #f4ecd8), transparent);
  transition: transform 0.35s var(--ease);
}
.chip[data-reg]:hover { background: none; color: #fffaf0; }
.chip[data-reg]:hover::before { transform: rotate(45deg) scale(1.15); }
.chip[data-reg]:hover::after { transform: scaleX(1); }
.chip[data-reg][aria-pressed="true"] { box-shadow: none; }
.chip[data-reg][aria-pressed="false"] { opacity: 0.42; }
.chip[data-reg][aria-pressed="false"]::before { content: "✧"; text-shadow: none; }
.filters { gap: 2px 4px; }
.chip-tool[aria-pressed="true"] { border-color: var(--link); color: #fff; box-shadow: 0 0 16px rgba(156, 198, 255, 0.35); }
.chip-gold { border-color: color-mix(in oklab, var(--gold) 55%, transparent); color: var(--gold); }
.chip-small { padding: 4px 10px; font-size: 12px; }
.chip-small[aria-pressed="false"] { opacity: 0.55; }
.count { font-family: var(--font-mono); font-size: 11px; opacity: 0.8; }
.count:empty { display: none; }

.icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: none;
  color: var(--ink);
  font-size: 14px;
  transition: background 0.2s, border-color 0.2s;
}
.icon:hover { background: rgba(255, 255, 255, 0.08); }
.icon-main { width: 42px; height: 42px; border-color: var(--line-strong); font-size: 15px; }

/* --- En-tête --------------------------------------------------------------- */
#hud {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  padding: max(14px, env(safe-area-inset-top, 0px)) max(var(--gutter), env(safe-area-inset-right, 0px)) 26px max(var(--gutter), env(safe-area-inset-left, 0px));
  background: linear-gradient(to bottom, rgba(3, 4, 11, 0.9), rgba(3, 4, 11, 0));
  pointer-events: none;
  transition: padding-right 0.6s var(--ease), opacity 0.8s var(--ease);
}
#hud > * { pointer-events: auto; }
/* à l'accueil, la barre reste utilisable (Curateur, profil, recherche, « Tout le ciel ») au-dessus du voile */
body:has(#intro:not([hidden])) #hud { z-index: 9; }
body.has-page #hud { padding-right: calc(var(--page-w) + var(--gutter)); }
.brand {
  font: 400 15px/1 var(--font-ui);
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}
.brand em { font: italic 500 22px/1 var(--font-display); letter-spacing: 0.02em; text-transform: none; color: var(--gold); }
.tally { margin: 0; font-size: 13px; color: var(--muted); }
.tally b { font-family: var(--font-mono); font-weight: 400; color: var(--ink); }
.sep { margin: 0 0.5em; opacity: 0.5; }
.search { flex: 1 1 220px; max-width: 360px; }
.search input {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.25s, background 0.25s;
}
.search input:focus { border-color: var(--link); background: rgba(255, 255, 255, 0.08); }
.search input::placeholder { color: var(--faint); }
.hud-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-left: auto; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
/* En-tête trop chargé (beaucoup de constellations, page ouverte) : les pastilles se rangent
   derrière un bouton « Constellations », et le fil du parcours se place sous l'en-tête. */
.filters-wrap { position: relative; display: flex; }
.chip-filters { display: none; }
#hud.is-compact .chip-filters { display: inline-flex; gap: 6px; align-items: center; }
#hud.is-compact .filters {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 6;
  width: max-content; max-width: min(420px, calc(100vw - 2 * var(--gutter)));
  padding: 12px; border: 1px solid var(--line); border-radius: 16px;
  background: rgba(10, 12, 26, 0.94); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(14px);
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity 0.2s, transform 0.2s, visibility 0s 0.2s;
}
#hud.is-compact .filters.is-open { opacity: 1; visibility: visible; transform: none; transition: opacity 0.2s, transform 0.2s; }
.chip-filters .count:empty { display: none; }

/* --- Fil d'Ariane ----------------------------------------------------------- */
.trail {
  position: fixed;
  top: var(--hud-h, 66px);
  left: max(var(--gutter), env(safe-area-inset-left, 0px));
  right: var(--gutter);
  z-index: 4;
  display: flex;
  align-items: baseline;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  font: 400 16px/1.3 var(--font-display);
  white-space: nowrap;
  transition: right 0.6s var(--ease), top 0.3s var(--ease);
}
body.has-page .trail { right: calc(var(--page-w) + var(--gutter)); }
.trail::-webkit-scrollbar { display: none; }
.trail-label { font: 400 11px/1 var(--font-ui); letter-spacing: 0.24em; text-transform: uppercase; color: var(--faint); }
.trail .arrow { color: var(--faint); font-size: 13px; }

/* --- Panneaux en verre ---------------------------------------------------- */
.page, .carnet {
  position: fixed;
  z-index: 6;
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.page {
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--page-w);
  border-left: 1px solid var(--line);
  transform: translateX(104%);
  transition: transform 0.65s var(--ease), opacity 0.8s var(--ease);
  padding: max(20px, env(safe-area-inset-top, 0px)) max(28px, env(safe-area-inset-right, 0px)) 40px 28px;
}
.page.is-open { transform: none; }
.close {
  position: sticky;
  top: 0;
  float: right;
  margin: -4px -10px 0 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 16px;
  z-index: 2;
}
.close:hover { color: var(--ink); background: rgba(255, 255, 255, 0.08); }

.sheet { animation: rise 0.6s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.eyebrow {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 6px 0 12px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c);
}
.eyebrow .mono { color: var(--muted); text-transform: none; letter-spacing: 0.02em; }
.desig { color: var(--c); text-decoration: none; font-family: var(--font-display); font-size: 17px; font-style: italic; text-transform: none; letter-spacing: 0.02em; }
.desig:hover { text-decoration: underline; }
.sheet-title {
  margin: 0 0 10px;
  font: 500 clamp(32px, 4.2vw, 42px)/1.04 var(--font-display);
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.sheet-title.is-tag { font-style: italic; color: var(--c); text-shadow: 0 0 30px color-mix(in oklab, var(--c) 40%, transparent); }
.byline { margin: 0 0 16px; color: var(--muted); font-size: 14.5px; }
.note { margin: 0 0 20px; font: 400 20px/1.42 var(--font-display); max-width: 60ch; }
.filed { margin: 18px 0 6px; color: var(--muted); line-height: 1.8; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0; }
.block { margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line); }
.block h2, .carnet h3 {
  margin: 0 0 10px;
  font: 400 11.5px/1 var(--font-ui);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}
.paths, .members { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.paths li, .members li { display: grid; gap: 1px; font: 400 18px/1.3 var(--font-display); }
.why { font: 300 13.5px/1.4 var(--font-ui); color: var(--muted); }
.foot { margin-top: 30px; font-size: 13px; }
.foot a { color: var(--muted); }
.meter { height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; margin: 4px 0 8px; }
.meter span { display: block; height: 100%; background: var(--c); box-shadow: 0 0 10px var(--c); transition: width 0.8s var(--ease); }

.pop-wrap { position: relative; }
.pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 3;
  width: min(300px, 78vw);
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--glass-strong);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
}
.pop-title { margin: 0 0 6px; font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.pop-row { display: flex; gap: 8px; align-items: center; padding: 6px 4px; border-radius: 8px; cursor: pointer; }
.pop-row:hover { background: rgba(255, 255, 255, 0.05); }
.pop-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-row small { font-family: var(--font-mono); color: var(--faint); }
.pop-row input { accent-color: var(--gold); }
.pop-empty { margin: 4px 0 8px; color: var(--muted); font-size: 13px; }
.pop-new, .new-pl, .path-form { display: flex; gap: 6px; margin-top: 8px; }
.pop-new input, .new-pl input, .path-form input, .pl-head input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13.5px;
  outline: none;
}
.pop-new input:focus, .new-pl input:focus, .path-form input:focus, .pl-head input:focus { border-color: var(--gold); }

.path-list { list-style: none; margin: 14px 0 0; padding: 0 0 0 18px; border-left: 1px dashed color-mix(in oklab, var(--gold) 60%, transparent); display: grid; gap: 6px; }
.path-list li { position: relative; font: 400 17px/1.3 var(--font-display); }
.path-list li.is-track::before { content: "✦"; position: absolute; left: -25px; top: 1px; color: var(--gold); font-size: 12px; }
.path-list li.is-via { font: 300 13px/1.3 var(--font-ui); color: var(--muted); }

/* --- Carnet ---------------------------------------------------------------- */
.carnet {
  top: 100px;
  left: max(var(--gutter), env(safe-area-inset-left, 0px));
  bottom: calc(var(--dock-h) + 28px);
  width: min(400px, calc(100vw - 2 * var(--gutter)));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 20px 24px;
  transform: translateX(calc(-100% - 40px));
  transition: transform 0.55s var(--ease);
}
.carnet.is-open { transform: none; }
.carnet-head { display: flex; justify-content: space-between; align-items: center; }
.carnet-head h2 { margin: 0; font: italic 500 26px/1 var(--font-display); color: var(--gold); }
.carnet-head .close { position: static; float: none; margin: 0; }
.tabs { display: flex; gap: 4px; margin: 14px 0 16px; border-bottom: 1px solid var(--line); }
.tab { border: 0; background: none; padding: 8px 10px; font-size: 13.5px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--gold); }
.empty { color: var(--muted); font-size: 14px; }
.list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; counter-reset: row; }
.row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 8px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s;
}
.row:hover { background: rgba(255, 255, 255, 0.04); }
.row.is-now { border-color: color-mix(in oklab, var(--c) 50%, transparent); background: color-mix(in oklab, var(--c) 8%, transparent); }
.row.is-dragging { opacity: 0.4; }
.row.is-drop { border-color: var(--gold); }
.grip { color: var(--faint); cursor: grab; font-size: 12px; letter-spacing: -2px; }
.row-main { flex: 1; min-width: 0; display: grid; font: 400 16.5px/1.25 var(--font-display); }
.row-main a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-main small { font: 300 12px/1.3 var(--font-ui); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-tools { display: flex; opacity: 0.35; transition: opacity 0.2s; }
.row:hover .row-tools, .row:focus-within .row-tools { opacity: 1; }
.row-tools .icon { width: 26px; height: 26px; font-size: 12px; }
.pl { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.pl.is-shown .pl-name { color: var(--gold); text-shadow: 0 0 14px rgba(240, 208, 138, 0.5); }
.pl-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.pl-head form { flex: 1; display: flex; }
.pl-name { border: 0; background: none; padding: 0; text-align: left; font: italic 500 21px/1.2 var(--font-display); color: var(--ink); }
.pl-name:hover { text-decoration: underline dotted; text-underline-offset: 4px; }
.stat { font-size: 15px; }
.stat b { font: 400 28px/1 var(--font-mono); color: var(--gold); }
.trail-list { margin: 10px 0; padding-left: 22px; display: grid; gap: 4px; font: 400 16px/1.3 var(--font-display); color: var(--faint); }
.carnet h3 { margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line); }

/* --- Lecteur ---------------------------------------------------------------- */
.dock {
  position: fixed;
  z-index: 7;
  left: max(var(--gutter), env(safe-area-inset-left, 0px));
  bottom: max(var(--gutter), env(safe-area-inset-bottom, 0px));
  display: flex;
  gap: 14px;
  align-items: stretch;
  max-width: calc(100vw - 2 * var(--gutter));
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2), 0 20px 60px rgba(0, 0, 0, 0.45);
  transition: border-color 0.4s, opacity 0.8s var(--ease);
}
.dock[data-state="playing"] { border-color: color-mix(in oklab, var(--c) 45%, transparent); }
.dock-video {
  flex: none;
  width: 356px;
  height: 200px;
  border-radius: 11px;
  overflow: hidden;
  background: #000;
  transition: width 0.5s var(--ease), height 0.5s var(--ease);
}
.dock-video iframe, .dock-video > div { width: 100%; height: 100%; display: block; border: 0; }
/* qualité maximale : le lecteur est rendu en très grand, puis réduit à la taille du cadre */
.dock-video.is-hq { position: relative; }
.dock-video.is-hq iframe { position: absolute; left: 0; top: 0; width: var(--yt-w); height: var(--yt-h); transform: scale(var(--yt-s)); transform-origin: 0 0; }
.dock.is-big .dock-video { width: min(640px, calc(100vw - 420px)); height: calc(min(640px, calc(100vw - 420px)) * 9 / 16); min-height: 200px; }
.dock[data-state="idle"] .dock-video { display: none; }
.dock-body { display: flex; flex-direction: column; justify-content: space-between; gap: 6px; width: 290px; min-width: 0; padding: 4px 4px 2px 2px; }
.dock-meta { display: grid; min-width: 0; }
.dock-title { font: 500 21px/1.15 var(--font-display); color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.dock-artist { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock-progress { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.dock-progress input { flex: 1; min-width: 0; accent-color: var(--c); height: 18px; }
.dock[data-state="idle"] .dock-progress { display: none; }
.dock-volume { display: flex; align-items: center; gap: 6px; margin: -4px 0 -2px -8px; color: var(--muted); }
.dock-volume input { flex: 1; min-width: 0; max-width: 170px; accent-color: var(--c); height: 18px; }
.dock-volume .mono { width: 3ch; font-size: 12px; text-align: right; }
.icon-vol { width: 30px; height: 30px; color: var(--muted); }
.icon-vol:hover { color: var(--ink); }
.icon-vol .vol-x { display: none; }
.icon-vol.is-low .vol-w2 { display: none; }
.icon-vol.is-off .vol-w1, .icon-vol.is-off .vol-w2 { display: none; }
.icon-vol.is-off .vol-x { display: inline; }
.dock-volume.is-off input, .dock-volume.is-off .mono { opacity: 0.45; }
.dock[data-state="idle"] .dock-volume { display: none; }
.dock-volume .mono.is-own { color: var(--gold); }
.own-mark { color: var(--gold); font-size: 9px; vertical-align: 2px; }
.dock-controls { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.dock-controls .chip-small:first-of-type { margin-left: auto; }
.dock-next { margin: 0; font: 400 14.5px/1.3 var(--font-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock-next .muted { font: 300 12px/1.3 var(--font-ui); }

/* --- Accueil ----------------------------------------------------------------- */
.intro {
  position: fixed;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  padding: 24px max(var(--gutter), env(safe-area-inset-right, 0px)) 24px max(var(--gutter), env(safe-area-inset-left, 0px));
  background: radial-gradient(ellipse at 50% 45%, rgba(3, 4, 11, 0.35), rgba(3, 4, 11, 0.8) 70%);
  animation: fade 1.6s ease both 0.4s;
  overflow-y: auto;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.intro-card { max-width: 640px; text-align: center; }
.intro-kicker { margin: 0 0 14px; font-size: 12px; letter-spacing: 0.32em; text-transform: uppercase; color: var(--muted); }
.intro-title { margin: 0; font: 400 clamp(52px, 9vw, 96px)/0.95 var(--font-display); letter-spacing: -0.01em; }
.intro-title em { color: var(--gold); text-shadow: 0 0 40px rgba(240, 208, 138, 0.35); }
.intro-text { margin: 22px auto 30px; max-width: 52ch; font: 400 20px/1.5 var(--font-display); color: rgba(236, 235, 250, 0.88); }
.intro-text .hl { text-decoration-style: solid; }
.intro-label { margin: 0 0 12px; font-size: 11.5px; letter-spacing: 0.28em; text-transform: uppercase; color: var(--muted); }
.doors { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.door {
  display: grid;
  gap: 4px;
  padding: 16px 14px;
  border: 1px solid color-mix(in oklab, var(--c) 40%, transparent);
  border-radius: 14px;
  background: color-mix(in oklab, var(--c) 7%, rgba(9, 11, 26, 0.6));
  color: var(--ink);
  text-decoration: none;
  text-align: left;
  transition: transform 0.3s var(--ease), box-shadow 0.3s, background 0.3s;
}
.door:hover { transform: translateY(-3px); box-shadow: 0 0 30px color-mix(in oklab, var(--c) 35%, transparent); background: color-mix(in oklab, var(--c) 14%, rgba(9, 11, 26, 0.7)); }
.door-reg { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--c); }
.door-title { font: 500 19px/1.15 var(--font-display); overflow-wrap: anywhere; }
.door-sub { font-size: 12.5px; color: var(--muted); }

/* --- Curateur ------------------------------------------------------------------- */
:root { --ok: #9fe3c1; --warn: #ffcf8a; }
.chip-curator { border-color: color-mix(in oklab, var(--link-visited) 60%, transparent); color: #e6dcff; }
.chip-curator.is-off { color: var(--muted); border-style: dashed; }
.btn-gold { border-color: color-mix(in oklab, var(--gold) 65%, transparent); color: var(--gold); background: rgba(240, 208, 138, 0.08); }
.btn-gold:hover { background: rgba(240, 208, 138, 0.18); }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.found { margin: -4px 0 12px; font-size: 12.5px; color: var(--muted); }
.by { color: var(--faint); }
.listening { display: flex; align-items: center; gap: 10px; margin: 4px 0; font: italic 400 17px/1.4 var(--font-display); color: #e6dcff; }
.orbit {
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid rgba(199, 166, 255, 0.25);
  border-top-color: var(--link-visited);
  animation: spin 1.1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.curator-actions { gap: 8px; }
.model-select {
  border: 1px solid var(--line-strong);
  background: var(--glass-strong);
  color: var(--ink);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
  max-width: 100%;
}
.model-select.wide { width: 100%; border-radius: 10px; padding: 8px 10px; font-size: 14px; }
.curator h3 { margin-top: 22px; }
.key-form { display: grid; gap: 8px; }
.key-form input[type="password"] {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  outline: none;
}
.key-form input[type="password"]:focus { border-color: var(--gold); }
.key-form .btn { justify-self: start; }
.key-status { margin: 0; font-size: 13px; color: var(--muted); }
.keyline { display: flex; gap: 10px; align-items: baseline; }
.check { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; font-size: 13.5px; color: var(--muted); cursor: pointer; }
.check input { accent-color: var(--gold); margin-top: 3px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; }
.seg-btn { border: 0; background: none; padding: 6px 14px; font-size: 13px; color: var(--muted); }
.seg-btn[aria-checked="true"] { background: rgba(199, 166, 255, 0.16); color: #fff; }
/* réglages de lecture */
.pref-row { display: grid; grid-template-columns: auto 1fr 2.5em; align-items: center; gap: 12px; margin-top: 10px; font-size: 13.5px; color: var(--muted); }
.pref-row input[type="range"] { width: 100%; accent-color: var(--link-visited); }
.pref-row output { text-align: right; color: var(--ink); }
.pref-label { margin: 14px 0 6px; font-size: 13px; color: var(--muted); }

/* Ambilight : lueur autour de la vidéo et voile coloré sur l'écran (js/ambilight.js) */
.ambi-glow, .ambi-wash { position: fixed; pointer-events: none; opacity: 0; will-change: opacity; }
.ambi-glow { z-index: 2; left: 0; top: 0; width: 0; height: 0; border-radius: 40%; filter: blur(46px) saturate(1.35); transition: opacity 0.25s linear; }
.ambi-wash { z-index: 1; inset: 0; width: 100vw; height: 100vh; mix-blend-mode: screen; transition: opacity 0.25s linear; }
@media (prefers-reduced-transparency: reduce) { .ambi-wash { display: none; } }

/* Voyage « en vaisseau » : bords assombris, repères d'angle, cap et progression */
.voyage { position: fixed; inset: 0; z-index: 3; pointer-events: none; opacity: 0; transition: opacity 0.7s var(--ease); }
.voyage.is-on { opacity: 1; }
.voyage.is-light::before, .voyage.is-light .voyage-frame { display: none; }
.voyage.is-light .voyage-hud { bottom: 9%; opacity: 0.85; }
/* l'éclair du saut : une onde bleutée qui part du centre */
.voyage::after { content: ""; position: absolute; inset: 0; opacity: 0; background: radial-gradient(circle at 50% 50%, rgba(214, 228, 255, 0.55), rgba(156, 198, 255, 0.12) 35%, transparent 65%); mix-blend-mode: screen; }
.voyage.is-epic.is-on::after { animation: voyage-jump 1.1s var(--jump, 900ms) ease-out both; }
@keyframes voyage-jump { 0% { opacity: 0; transform: scale(0.6); } 18% { opacity: 1; } 100% { opacity: 0; transform: scale(1.6); } }
.voyage::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 75% 70% at 50% 50%, transparent 58%, rgba(3, 4, 11, 0.62) 100%); }
.voyage-frame { position: absolute; inset: 9% 7%; }
.voyage-frame::before, .voyage-frame::after { content: ""; position: absolute; width: 46px; height: 46px; border: 1px solid rgba(240, 208, 138, 0.55); }
.voyage-frame::before { left: 0; top: 0; border-right: 0; border-bottom: 0; box-shadow: -1px -1px 12px -6px var(--gold); }
.voyage-frame::after { right: 0; bottom: 0; border-left: 0; border-top: 0; box-shadow: 1px 1px 12px -6px var(--gold); }
.voyage-hud { position: absolute; left: 50%; bottom: 13%; transform: translateX(-50%); display: grid; justify-items: center; gap: 5px; text-align: center; text-shadow: 0 0 8px rgba(3, 4, 11, 0.9); }
.voyage-to { margin: 0; font: 400 12px/1 var(--font-ui); letter-spacing: 0.32em; text-transform: uppercase; color: rgba(240, 236, 255, 0.9); }
.voyage-to b { font: italic 500 19px/1 var(--font-display); letter-spacing: 0.02em; text-transform: none; color: var(--gold); margin-left: 0.35em; }
.voyage-via { margin: 0; font: italic 400 14px/1.2 var(--font-display); color: var(--muted); }
.voyage-bar { width: 220px; height: 1px; margin-top: 6px; background: rgba(240, 236, 255, 0.16); }
.voyage-bar i { display: block; width: 0; height: 100%; background: var(--gold); box-shadow: 0 0 8px var(--gold); }
@media (max-width: 760px) { .voyage-hud { bottom: 52%; } .voyage-frame { inset: 14% 5%; } }
/* goûts : ♥ aimée (or), ☾ éteinte (pâle) */
.btn-taste.is-like { color: var(--gold); border-color: color-mix(in oklab, var(--gold) 60%, transparent); background: color-mix(in oklab, var(--gold) 12%, transparent); }
.btn-taste.is-dislike { color: var(--muted); border-style: dashed; opacity: 0.85; }
.icon-like { font-size: 17px; }
.icon-like.is-like { color: var(--gold); text-shadow: 0 0 12px color-mix(in oklab, var(--gold) 70%, transparent); }
.icon-like:disabled { opacity: 0.35; }
.carnet-body .seg { flex-wrap: wrap; max-width: 100%; }
.linklike { border: 0; background: none; padding: 0; color: var(--link); text-decoration: underline; text-underline-offset: 3px; font: inherit; }

/* Premier lancement : la question de départ */
.seed-form { display: grid; gap: 10px; margin: 0 auto 14px; max-width: 560px; }
.seed-row { display: flex; gap: 8px; }
.seed-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line-strong);
  background: rgba(9, 11, 26, 0.7);
  border-radius: 999px;
  padding: 11px 18px;
  font: 400 18px/1.2 var(--font-display);
  outline: none;
  transition: border-color 0.25s, box-shadow 0.3s;
}
.seed-row input:focus { border-color: var(--gold); box-shadow: 0 0 30px rgba(240, 208, 138, 0.18); }
.seed-row .btn { padding: 10px 18px; font-size: 14.5px; }
.seed-status { margin: 0; min-height: 1.4em; display: flex; justify-content: center; align-items: center; gap: 10px; font: italic 400 17px/1.4 var(--font-display); color: var(--muted); }
.seed-status.is-error { color: var(--warn); font-style: normal; font-family: var(--font-ui); font-size: 14px; }
.seed-hint { margin: 0 auto 10px; max-width: 52ch; font-size: 13.5px; color: var(--muted); }
.seed-doors { margin: 0; font: 400 16px/1.6 var(--font-display); color: var(--faint); }
@media (max-width: 760px) { .seed-row { flex-direction: column; } }

/* Bannière en tête de la page d'une étoile */
.banner {
  position: relative;
  margin: calc(-1 * max(20px, env(safe-area-inset-top, 0px))) -28px 16px;
  height: 230px;
  overflow: hidden;
  background: var(--night);
}
.banner img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; display: block; animation: banner-in 1.2s var(--ease) both; }
@keyframes banner-in { from { opacity: 0; transform: scale(1.06); } to { opacity: 1; transform: none; } }
.banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(9, 11, 26, 0) 35%, rgba(9, 11, 26, 0.94) 100%),
    linear-gradient(115deg, color-mix(in oklab, var(--c) 22%, transparent), transparent 55%);
  pointer-events: none;
}
.banner figcaption { position: absolute; z-index: 1; right: 14px; bottom: 8px; font-size: 11px; color: var(--muted); }
.banner figcaption a { color: inherit; }
.sheet-track.has-banner .eyebrow { margin-top: 0; }

/* Annonce d'une constellation qui vient de naître */
.herald {
  position: fixed;
  z-index: 9;
  left: 50%;
  top: 22%;
  transform: translateX(-50%);
  width: min(640px, calc(100vw - 2 * var(--gutter)));
  text-align: center;
  pointer-events: none;
}
body.has-page .herald { left: calc((100vw - var(--page-w)) / 2); }
.herald.is-on { animation: herald 4.6s ease both; }
@keyframes herald {
  0% { opacity: 0; transform: translate(-50%, 12px); letter-spacing: 0.2em; }
  15% { opacity: 1; transform: translate(-50%, 0); letter-spacing: 0.02em; }
  78% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -8px); }
}
.herald-kicker { margin: 0 0 6px; font-size: 12px; letter-spacing: 0.34em; text-transform: uppercase; color: var(--muted); }
.herald-title { margin: 0; font: italic 500 clamp(40px, 6vw, 68px)/1 var(--font-display); color: var(--c); text-shadow: 0 0 40px color-mix(in oklab, var(--c) 55%, transparent), 0 0 4px rgba(3, 4, 11, 0.9); }
.herald-desc { margin: 10px auto 0; max-width: 44ch; font: 400 18px/1.4 var(--font-display); color: rgba(236, 235, 250, 0.85); text-shadow: 0 0 6px rgba(3, 4, 11, 0.95); }

/* --- Fiche de survol ------------------------------------------------------------ */
.hovercard {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9;
  max-width: 280px;
  padding: 10px 14px 11px;
  border: 1px solid color-mix(in oklab, var(--c) 45%, transparent);
  border-radius: 12px;
  background: var(--glass-strong);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 24px color-mix(in oklab, var(--c) 18%, transparent);
  pointer-events: none;
}
.hovercard p { margin: 0; }
.hc-kicker { display: flex; justify-content: space-between; gap: 12px; font: italic 400 14px/1.3 var(--font-display); color: var(--c); }
.hc-kicker span { font: 300 11px/1.6 var(--font-ui); font-style: normal; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.hc-title { font: 500 19px/1.2 var(--font-display); color: var(--ink); overflow-wrap: anywhere; }
.hc-title.is-tag { font-style: italic; color: var(--c); }
.hc-sub { font-size: 12.5px; color: var(--muted); }
@media (hover: none) { .hovercard { display: none; } }

/* --- Notifications et démarrage ------------------------------------------------ */
.toasts {
  position: fixed;
  z-index: 9;
  top: 100px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  gap: 8px;
  justify-items: center;
  pointer-events: none;
  width: min(520px, calc(100vw - 2 * var(--gutter)));
}
body.has-page .toasts { left: calc((100vw - var(--page-w)) / 2); }
.toast {
  margin: 0;
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--glass-strong);
  font-size: 13.5px;
  text-align: center;
  animation: toast-in 0.45s var(--ease) both;
  transition: opacity 0.4s, transform 0.4s;
}
.toast.is-out { opacity: 0; transform: translateY(-6px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px) scale(0.98); } to { opacity: 1; transform: none; } }

.boot {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: var(--night);
  transition: opacity 1.4s ease, visibility 1.4s;
}
.boot.is-done { opacity: 0; visibility: hidden; }
.boot-text { font: italic 400 22px/1.4 var(--font-display); color: var(--muted); max-width: 40ch; text-align: center; padding: 0 var(--gutter); animation: breathe 2.4s ease-in-out infinite; }
/* « Et l'univers fut. » : les mots sortent du flou l'un après l'autre, l'univers s'allume en or */
.boot-text:has(> span) { font-size: clamp(30px, 4.6vw, 54px); letter-spacing: 0.04em; color: var(--ink); animation: none; max-width: none; }
.boot-text > span { display: inline-block; opacity: 0; filter: blur(10px); letter-spacing: 0.35em; animation: boot-word 1.5s var(--ease) forwards; }
.boot-text > span:nth-child(2) { animation-delay: 0.45s; }
.boot-text > span:nth-child(3) { animation-delay: 0.9s; }
.boot-text em { color: var(--gold); text-shadow: 0 0 18px color-mix(in oklab, var(--gold) 70%, transparent), 0 0 46px color-mix(in oklab, var(--gold) 35%, transparent); }
@keyframes boot-word { to { opacity: 1; filter: blur(0); letter-spacing: 0.04em; } }
:root[data-anim="off"] .boot-text > span { animation: none; opacity: 1; filter: none; letter-spacing: 0.04em; }
.boot.is-error .boot-text { animation: none; color: var(--ink); }
@keyframes breathe { 50% { opacity: 0.45; } }

/* --- Petits écrans -------------------------------------------------------------- */
@media (max-width: 1100px) {
  .dock-video { width: 300px; height: 200px; }
  .dock-body { width: 250px; }
}
@media (max-width: 760px) {
  :root { --page-w: 100vw; }
  #hud { gap: 8px 12px; padding-bottom: 14px; }
  body.has-page #hud { padding-right: max(var(--gutter), env(safe-area-inset-right, 0px)); }
  .tally { order: 2; flex-basis: 100%; }
  .search { order: 3; max-width: none; flex-basis: 100%; }
  .hud-tools { order: 4; margin-left: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
  .filters { flex-wrap: nowrap; }
  .trail { top: auto; bottom: calc(var(--dock-h) + 2 * var(--gutter)); right: var(--gutter); }
  body.has-page .trail { right: var(--gutter); }
  .page {
    top: auto;
    height: min(50vh, calc(100% - var(--dock-h) - 2 * var(--gutter) - 70px));
    bottom: calc(var(--dock-h) + 2 * var(--gutter));
    border-left: 0;
    border-top: 1px solid var(--line);
    border-radius: 20px 20px 0 0;
    transform: translateY(110%);
    padding: 16px max(20px, env(safe-area-inset-right, 0px)) 28px max(20px, env(safe-area-inset-left, 0px));
  }
  .carnet { top: 150px; bottom: calc(var(--dock-h) + 2 * var(--gutter)); }
  .banner { margin: -16px calc(-1 * max(20px, env(safe-area-inset-right, 0px))) 14px calc(-1 * max(20px, env(safe-area-inset-left, 0px))); height: 170px; border-radius: 20px 20px 0 0; }
  body.has-page .herald { left: 50%; }
  .dock { right: max(var(--gutter), env(safe-area-inset-right, 0px)); flex-direction: column; gap: 8px; }
  .dock-video, .dock.is-big .dock-video { width: 100%; height: auto; aspect-ratio: 16 / 9; min-height: 200px; max-height: 32vh; }
  .dock-body { width: auto; }
  .doors { grid-template-columns: 1fr; }
  .intro-text { font-size: 18px; }
  .toasts { top: 150px; }
  body.has-page .toasts { left: 50%; }
}

/* animations réduites : suit le réglage « Animations » (main.js pose body.is-calm), pas seulement le système,
   sinon « Toujours » laissait l'interface figée quand Windows coupe ses effets d'animation */
body.is-calm *, body.is-calm *::before, body.is-calm *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }

/* --- Après le big bang : l'interface se dessine, comme une carte céleste qu'on grave ------------ */
body.is-veiled #hud, body.is-veiled #dock, body.is-veiled #trail, body.is-veiled #page, body.is-veiled .lyrics { opacity: 0; pointer-events: none; transition: none; }
@keyframes ui-brand { from { opacity: 0; letter-spacing: 0.9em; filter: blur(8px); } to { opacity: 1; letter-spacing: 0.3em; filter: none; } }
@keyframes ui-drop { from { opacity: 0; transform: translateY(-10px) scale(0.96); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes ui-rise { from { opacity: 0; transform: translateY(24px); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes ui-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ui-line { 0% { transform: scaleX(0); opacity: 0; } 25% { opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }
body.is-unveil #hud::after {
  content: ""; position: absolute; left: 6%; right: 6%; bottom: 0; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, color-mix(in oklab, var(--gold) 80%, transparent), transparent);
  box-shadow: 0 0 12px color-mix(in oklab, var(--gold) 60%, transparent);
  animation: ui-line 1.6s var(--ease) both;
}
body.is-unveil .brand { animation: ui-brand 1.4s var(--ease) both; }
body.is-unveil .tally { animation: ui-fade 0.9s ease both 0.5s; }
body.is-unveil .search { animation: ui-drop 0.8s var(--ease) both 0.35s; }
body.is-unveil .hud-tools > * { animation: ui-drop 0.7s var(--ease) both; }
body.is-unveil .hud-tools > :nth-child(1) { animation-delay: 0.45s; }
body.is-unveil .hud-tools > :nth-child(2) { animation-delay: 0.53s; }
body.is-unveil .hud-tools > :nth-child(3) { animation-delay: 0.61s; }
body.is-unveil .hud-tools > :nth-child(4) { animation-delay: 0.69s; }
body.is-unveil .hud-tools > :nth-child(5) { animation-delay: 0.77s; }
body.is-unveil .hud-tools > :nth-child(6) { animation-delay: 0.85s; }
body.is-unveil #dock { animation: ui-rise 1s var(--ease) both 0.7s; }
body.is-unveil #trail { animation: ui-fade 1s ease both 1s; }
body.is-unveil #page { animation: ui-fade 0.9s ease both 0.9s; }

/* renommer une constellation */
.rename-btn { font-size: 0.45em; vertical-align: middle; opacity: 0.45; transition: opacity 0.2s; }
.sheet-title:hover .rename-btn, .rename-btn:focus-visible { opacity: 1; }
.rename-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: -4px 0 14px; }
.rename-form input { flex: 1; min-width: 12ch; padding: 7px 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(8, 9, 22, 0.6); color: var(--ink); font: 400 18px/1.2 var(--font-display); }
.names-form { display: grid; gap: 10px; margin-top: 6px; }
.name-row { display: grid; grid-template-columns: auto auto auto 1fr; gap: 4px 8px; align-items: center; }
.name-old { font: 400 14px/1.2 var(--font-caps); letter-spacing: 0.06em; color: var(--muted); }
.name-arrow { color: var(--gold); }
.name-new { min-width: 0; padding: 5px 10px; border: 1px solid var(--line); border-radius: 8px; background: rgba(8, 9, 22, 0.6); color: var(--ink); font: 400 16px/1.2 var(--font-display); }
.name-why { grid-column: 2 / -1; font: 300 12.5px/1.35 var(--font-ui); color: var(--muted); }

/* porte d'entrée (son) : au retour, avant le big bang */
.boot-gate { position: absolute; left: 0; right: 0; bottom: 18vh; display: grid; justify-items: center; gap: 14px; animation: ui-fade 1.2s ease both 1.6s; transition: opacity 0.45s, transform 0.45s var(--ease); }
.boot-gate.is-gone { opacity: 0; transform: translateY(8px); }
.boot-enter {
  display: inline-flex; align-items: center; gap: 0.8em; padding: 12px 30px 11px; cursor: pointer;
  border: 1px solid color-mix(in oklab, var(--gold) 55%, transparent); border-radius: 999px;
  background: radial-gradient(ellipse at 50% 0%, color-mix(in oklab, var(--gold) 16%, transparent), transparent 70%);
  color: #f6ecd2; font: 400 17px/1 var(--font-caps); letter-spacing: 0.3em;
  box-shadow: 0 0 30px -10px var(--gold), inset 0 0 18px -10px var(--gold);
  transition: box-shadow 0.4s, border-color 0.4s, letter-spacing 0.6s var(--ease);
}
.boot-enter:hover, .boot-enter:focus-visible { border-color: var(--gold); letter-spacing: 0.36em; box-shadow: 0 0 46px -8px var(--gold), inset 0 0 22px -8px var(--gold); outline: none; }
.be-star { color: var(--gold); text-shadow: 0 0 12px var(--gold); animation: breathe 2.4s ease-in-out infinite; }
.boot-mute { font: italic 400 14px/1 var(--font-display); color: var(--muted); }

/* page d'une étoile : le contenu monte en cascade à l'ouverture */
@keyframes page-in { from { opacity: 0; transform: translateY(10px); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }
.page.is-fresh article > * { animation: page-in 0.6s var(--ease) both; }
.page.is-fresh article > :nth-child(2) { animation-delay: 0.05s; }
.page.is-fresh article > :nth-child(3) { animation-delay: 0.1s; }
.page.is-fresh article > :nth-child(4) { animation-delay: 0.15s; }
.page.is-fresh article > :nth-child(5) { animation-delay: 0.2s; }
.page.is-fresh article > :nth-child(n+6) { animation-delay: 0.25s; }

/* --- Légendes gravées : petites capitales Fell -------------------------------------------- */
.brand, .sky-label.is-registre, .trail-label, .eyebrow, .block h2, .carnet h3, .pop-title, .intro-kicker,
.intro-label, .door-reg, .voyage-to, .herald-kicker, .hc-kicker span, .pref-label {
  font-family: var(--font-caps);
  font-weight: 400;
}
.brand { font-size: 19px; letter-spacing: 0.3em; display: inline-flex; align-items: center; gap: 0.5em; }
.brand-star { color: var(--gold); font-size: 15px; letter-spacing: 0; text-shadow: 0 0 10px color-mix(in oklab, var(--gold) 60%, transparent); }
.sky-label.is-registre { font-size: 14px; letter-spacing: 0.34em; }
.trail-label, .block h2, .carnet h3 { font-size: 13px; letter-spacing: 0.2em; }
.eyebrow { font-size: 13.5px; letter-spacing: 0.1em; }
.pref-label { font-size: 14px; letter-spacing: 0.06em; }
/* Fell n'a qu'une graisse : les titres prennent un peu de corps par la taille plutôt que par le gras */
.sky-label.is-track { font-size: 16px; letter-spacing: 0.01em; }

/* --- Statistiques et succès (Carnet → Succès) --------------------------------------------- */
.st-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 6px 0 4px; }
.st { display: grid; gap: 2px; padding: 10px 10px 9px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.03); }
.st b { font: 400 22px/1.05 var(--font-display); color: var(--ink); font-variant-numeric: lining-nums; }
.st b small { font-size: 0.6em; color: var(--muted); }
.st span { font-size: 12px; line-height: 1.25; color: var(--muted); }
.st-bars { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 7px; }
.st-bars li { display: grid; grid-template-columns: 9.5em 1fr 4.6em; gap: 10px; align-items: center; font-size: 13px; }
.st-bar-label { color: var(--c); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-display); font-size: 15px; }
.st-bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.st-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, color-mix(in oklab, var(--c) 55%, transparent), var(--c)); box-shadow: 0 0 10px color-mix(in oklab, var(--c) 60%, transparent); }
.st-bar-val { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.ach-count { margin-left: 0.6em; color: var(--gold); letter-spacing: 0.08em; }
.ach-total { height: 3px; margin: -2px 0 14px; border-radius: 2px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.ach-total i { display: block; height: 100%; background: var(--gold); box-shadow: 0 0 10px var(--gold); }
.ach-list { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 8px; }
.ach { --m: #8f8aa8; display: grid; grid-template-columns: 46px 1fr; gap: 12px; align-items: center; padding: 9px 11px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.02); opacity: 0.62; }
.ach.is-done { opacity: 1; border-color: color-mix(in oklab, var(--m) 40%, transparent); background: linear-gradient(100deg, color-mix(in oklab, var(--m) 10%, transparent), transparent 70%); }
.tier-bronze { --m: #d39a6a; } .tier-argent { --m: #cfd6e6; } .tier-or { --m: #f0d08a; } .tier-astre { --m: #b9a3ff; }
.ach[style*="--c"] { --m: var(--c); }
.ach-medal { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; font: 400 21px/1 var(--font-display); color: var(--m); border: 1px solid color-mix(in oklab, var(--m) 45%, transparent); background: radial-gradient(circle at 35% 30%, color-mix(in oklab, var(--m) 22%, transparent), rgba(3, 4, 11, 0.6) 70%); }
.ach:not(.is-done) .ach-medal { filter: grayscale(0.85); color: var(--faint); }
.ach.is-done .ach-medal { box-shadow: 0 0 16px -4px var(--m), inset 0 0 10px -4px var(--m); }
.ach-body { display: grid; gap: 2px; min-width: 0; }
.ach-title { font: 400 16.5px/1.15 var(--font-display); color: var(--ink); }
.ach-desc { font-size: 13px; color: var(--muted); line-height: 1.3; }
.ach-date { font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.ach.is-done .ach-date { color: color-mix(in oklab, var(--m) 75%, var(--muted)); }
.ach-prog { height: 3px; margin-top: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.ach-prog i { display: block; height: 100%; background: color-mix(in oklab, var(--m) 70%, var(--muted)); }

/* notification « Succès débloqué » */
.ach-pops { position: fixed; z-index: 21; right: var(--gutter); bottom: var(--gutter); display: grid; gap: 8px; pointer-events: none; transition: right 0.4s var(--ease); }
.ach-pop {
  --m: #f0d08a;
  pointer-events: auto; cursor: pointer; text-align: left;
  display: grid; grid-template-columns: 52px 1fr; gap: 14px; align-items: center;
  width: min(360px, calc(100vw - 2 * var(--gutter))); padding: 12px 16px 12px 12px;
  border: 1px solid color-mix(in oklab, var(--m) 45%, transparent); border-radius: 14px;
  background: linear-gradient(110deg, rgba(20, 18, 36, 0.97), rgba(10, 11, 24, 0.97));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55), 0 0 30px -12px var(--m);
  color: var(--ink); overflow: hidden; position: relative;
  transform: translateY(24px) scale(0.98); opacity: 0;
  transition: transform 0.55s var(--ease), opacity 0.4s;
}
.ach-pop[style*="--c"] { --m: var(--c); }
.ach-pop.is-in { transform: none; opacity: 1; }
.ach-pop::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, color-mix(in oklab, var(--m) 28%, transparent) 50%, transparent 70%); transform: translateX(-100%); }
.ach-pop.is-in::after { animation: ach-shine 1.6s 0.35s var(--ease) both; }
@keyframes ach-shine { to { transform: translateX(100%); } }
.ach-pop .ach-medal { width: 52px; height: 52px; font-size: 24px; color: var(--m); border: 1px solid color-mix(in oklab, var(--m) 55%, transparent); background: radial-gradient(circle at 35% 30%, color-mix(in oklab, var(--m) 30%, transparent), rgba(3, 4, 11, 0.7) 70%); box-shadow: 0 0 22px -6px var(--m); }
.ach-kicker { font: 400 12px/1 var(--font-caps); letter-spacing: 0.22em; text-transform: uppercase; color: var(--m); }
.ach-pop .ach-title { font-size: 19px; }
@media (max-width: 760px) { .st-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .st-bars li { grid-template-columns: 7em 1fr 4.2em; } .ach-pops { bottom: calc(var(--dock-h) + 2 * var(--gutter)); } }

/* --- Vue éloignée : les constellations en plaques gravées, lisibles par-dessus leurs étoiles --- */
/* Comme sur un atlas céleste gravé (Bayer, Bode) : pas de pastille, un nom en capitales gravées,
   des filets dorés de part et d'autre, et le nombre d'étoiles en chiffres romains dessous. */
.sky-label.is-registre { display: grid; justify-items: center; gap: 5px; }
.sky-label.is-registre .lab-name { display: inline-flex; align-items: center; }
.sky-label.is-registre .lab-sub { display: none; font: italic 400 12.5px/1 var(--font-display); letter-spacing: 0.06em; text-transform: none; color: color-mix(in oklab, var(--c, #f0d08a) 45%, #d9d2c0); opacity: 0.85; }
.sky-labels.is-far .sky-label.is-registre {
  padding: 4px 0;
  color: color-mix(in oklab, var(--c, #f0d08a) 30%, #f4ecd8);
  font: 400 18px/1 var(--font-caps);
  letter-spacing: 0.34em;
  text-shadow: 0 0 2px rgba(3, 4, 11, 0.95), 0 0 9px rgba(3, 4, 11, 0.9), 0 0 22px color-mix(in oklab, var(--c, #f0d08a) 40%, transparent);
  transform: translateY(-50%);
  transition: transform 0.35s var(--ease), color 0.35s, text-shadow 0.35s;
}
.sky-labels.is-far .sky-label.is-registre .lab-sub { display: block; }
.sky-labels.is-far .sky-label.is-registre .lab-name::before,
.sky-labels.is-far .sky-label.is-registre .lab-name::after {
  content: ""; width: 38px; height: 1px; margin: 0 0.9em 0 0;
  background: linear-gradient(90deg, transparent, color-mix(in oklab, var(--c, #f0d08a) 60%, #f4ecd8));
  box-shadow: 0 0 6px color-mix(in oklab, var(--c, #f0d08a) 50%, transparent);
}
.sky-labels.is-far .sky-label.is-registre .lab-name::after { margin: 0 0 0 0.55em; transform: scaleX(-1); }
.sky-labels.is-far .sky-label.is-registre.is-hover {
  color: #fffaf0;
  text-shadow: 0 0 2px rgba(3, 4, 11, 0.95), 0 0 9px rgba(3, 4, 11, 0.9), 0 0 30px var(--c, #f0d08a);
  transform: translateY(-50%) scale(1.06);
}

/* --- Sous-genres d'une grande constellation : plaques plus petites, avec le nombre d'étoiles --- */
.sky-label.is-tag.is-genre {
  padding: 3px 0;
  color: #f1ead8;
  font: italic 400 19px/1 var(--font-display);
  text-shadow: 0 0 2px rgba(3, 4, 11, 0.95), 0 0 9px rgba(3, 4, 11, 0.9), 0 0 20px rgba(240, 208, 138, 0.25);
  transform: translateY(-50%);
  transition: transform 0.35s var(--ease), text-shadow 0.35s;
}
.sky-label.is-tag.is-genre::after { content: " · " attr(data-count); font: italic 400 14px/1 var(--font-display); color: rgba(240, 208, 138, 0.75); }
.sky-label.is-tag.is-genre.is-hover { text-shadow: 0 0 2px rgba(3, 4, 11, 0.95), 0 0 9px rgba(3, 4, 11, 0.9), 0 0 28px rgba(240, 208, 138, 0.7); transform: translateY(-50%) scale(1.06); }

/* --- Mode scène ------------------------------------------------------------------------------ */
.chip-stage:not(:disabled) { color: var(--gold); border-color: color-mix(in oklab, var(--gold) 45%, transparent); }
.chip-stage:disabled { opacity: 0.35; }
body.is-stage #hud, body.is-stage .trail, body.is-stage .page, body.is-stage .carnet, body.is-stage .voyage, body.is-stage .ach-pops { opacity: 0; pointer-events: none; transition: opacity 0.6s var(--ease); }
body.is-stage #scene { transition: filter 0.09s linear; filter: brightness(var(--stage-b, 0.5)) saturate(1.2); }
body.is-stage::after { content: ""; position: fixed; inset: 0; z-index: 3; pointer-events: none; background: radial-gradient(ellipse 70% 65% at 50% 46%, transparent 40%, rgba(2, 3, 9, 0.78) 100%); }
body.is-stage .dock {
  inset: 0; left: 0; bottom: 0; max-width: none; z-index: 8;
  flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  padding: 4vh 4vw; border: 0; border-radius: 0; background: transparent; box-shadow: none;
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
body.is-stage .dock-video, body.is-stage .dock.is-big .dock-video {
  width: min(82vw, calc((100vh - 190px) * 16 / 9)); height: auto; aspect-ratio: 16 / 9; max-height: none; min-height: 0;
  border-radius: 0; box-shadow: none; background: transparent;
  /* les bords de l'image s'estompent dans l'univers : plus de rectangle « collé » */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 9%, #000 91%, transparent), linear-gradient(to bottom, transparent, #000 11%, #000 89%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 9%, #000 91%, transparent), linear-gradient(to bottom, transparent, #000 11%, #000 89%, transparent);
  mask-composite: intersect;
  transform: scale(var(--beat, 1));
  filter: brightness(var(--flash, 1));
  transition: width 0.5s var(--ease), height 0.5s var(--ease), transform 0.06s ease-out;
}
body.is-stage .dock-body { width: min(82vw, calc((100vh - 190px) * 16 / 9)); display: grid; grid-template-columns: 1fr auto; grid-template-areas: "meta controls" "progress progress"; align-items: end; gap: 10px 24px; transition: opacity 0.6s var(--ease); }
body.is-stage .dock-meta { grid-area: meta; }
body.is-stage .dock-title { font-size: clamp(26px, 3.2vw, 42px); }
body.is-stage .dock-artist { font-size: 15px; }
body.is-stage .dock-progress { grid-area: progress; }
body.is-stage .dock-controls { grid-area: controls; }
body.is-stage .dock-volume, body.is-stage .dock-next, body.is-stage #btn-drift, body.is-stage #btn-video { display: none; }
body.is-stage-idle .dock-body { opacity: 0; }
body.is-stage-idle, body.is-stage-idle * { cursor: none !important; }
@media (max-width: 760px) { body.is-stage .dock-video, body.is-stage .dock-body { width: 94vw; } body.is-stage .dock-body { grid-template-columns: 1fr; grid-template-areas: "meta" "progress" "controls"; } }

/* univers de la scène (js/stagefx.js) */
.stage-fx { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 2; pointer-events: none; opacity: 0; filter: blur(1.5px); }
.chip-react { display: none; }
body.is-stage .chip-react { display: inline-flex; }
.chip-react[aria-pressed="true"] { color: var(--gold); border-color: var(--gold); box-shadow: 0 0 14px -4px var(--gold); }

/* bouton plein écran */
.chip-full { padding: 6px 9px; display: inline-grid; place-items: center; }
.chip-full .fs-out { display: none; }
.chip-full[aria-pressed="true"] .fs-in { display: none; }
.chip-full[aria-pressed="true"] .fs-out { display: inline; }

/* en scène : YouTube ne voit pas la souris (pas de barre ni de ligne au survol) */
.video-shield { display: none; }
body.is-stage .dock-video { position: relative; }
body.is-stage .dock-video iframe { pointer-events: none; }
body.is-stage .video-shield { display: block; position: absolute; inset: 0; z-index: 2; cursor: pointer; background: transparent; }

/* --- Traveling au repos : bandes de cinéma, interface effacée, légendes ----------------------- */
.tour { position: fixed; inset: 0; z-index: 19; pointer-events: none; }
.tour-bar { position: absolute; left: 0; right: 0; height: 9vh; background: #020308; transform: scaleY(0); transition: transform 1.4s var(--ease); }
.tour-bar.is-top { top: 0; transform-origin: top; }
.tour-bar.is-bottom { bottom: 0; transform-origin: bottom; }
body.is-tour .tour-bar { transform: scaleY(1); }
body.is-tour #hud, body.is-tour .trail, body.is-tour .dock, body.is-tour .ach-pops, body.is-tour .page { opacity: 0; pointer-events: none; transition: opacity 1.2s var(--ease); }
#hud, .trail { transition: opacity 0.5s var(--ease); }
.tour-cap { position: absolute; left: 6vw; bottom: calc(9vh + 26px); margin: 0; display: grid; gap: 4px; opacity: 0; transform: translateY(8px); transition: opacity 1.4s var(--ease), transform 1.4s var(--ease); }
.tour-cap.is-on { opacity: 1; transform: none; }
.tour-sub { font: 400 13px/1 var(--font-caps); letter-spacing: 0.32em; text-transform: uppercase; color: var(--gold); }
.tour-title { font: italic 400 clamp(28px, 3.4vw, 46px)/1.05 var(--font-display); color: #f6f2ff; text-shadow: 0 0 24px rgba(3, 4, 11, 0.9); }
.tour-hint { position: absolute; left: 0; right: 0; bottom: calc(4.5vh - 8px); margin: 0; text-align: center; font: 400 12px/1 var(--font-caps); letter-spacing: 0.28em; text-transform: uppercase; color: rgba(240, 236, 255, 0.55); opacity: 0; transition: opacity 1s; }
body.is-tour .tour.show-hint .tour-hint { opacity: 1; animation: tour-hint 6s 1.5s forwards; }
@keyframes tour-hint { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }

/* --- Paroles synchronisées ------------------------------------------------------------------ */
/* la ligne chantée au centre, qui s'illumine au fil du chant ; la précédente monte et s'efface ;
   les suivantes attendent, plus petites. Couleur et lueur du clip (--lyr-ink, --lyr-glow), battement (--beat). */
.lyrics {
  --lyr-ink: #f6eedb; --lyr-glow: #b9a2ff; --dim: rgba(232, 228, 248, 0.5);
  position: fixed; left: 50%; bottom: 36px; width: 900px; transform: translateX(-50%);
  z-index: 5; pointer-events: none; opacity: 0; text-align: center;
  font-family: var(--font-display);
}
.lyrics.is-on { opacity: 1; }
/* les couleurs du clip changent en fondu (propriétés typées : le navigateur sait les animer) */
@property --lyr-ink { syntax: "<color>"; inherits: true; initial-value: #f6eedb; }
@property --lyr-glow { syntax: "<color>"; inherits: true; initial-value: #b9a2ff; }
.lyrics { transition: opacity 0.7s var(--ease), left 0.5s var(--ease), width 0.5s var(--ease), bottom 0.5s var(--ease), transform 0.5s var(--ease), --lyr-ink 1.2s linear, --lyr-glow 1.2s linear; }
.lyrics::before {
  content: ""; position: absolute; inset: -18% -6% -22%; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 50% 48% at 50% 52%, rgba(3, 4, 11, 0.62), rgba(3, 4, 11, 0.28) 55%, transparent 75%);
}
.lyrics-track { position: relative; height: 4.3em; font-size: clamp(19px, 1.5vw, 27px); }
.lyrics-line {
  position: absolute; left: 0; right: 0; top: 1.4em; margin: 0;
  font-size: calc(1em * var(--fit, 1)); line-height: 1.2; white-space: nowrap; font-style: italic;
  /* position, taille, flou et opacité : calculés à chaque image (défilement continu, js/lyrics.js) */
  transform-origin: 50% 50%;
  will-change: transform, opacity;
}
.lyrics-text {
  color: transparent; padding: 0 0.15em;
  background: linear-gradient(90deg, var(--lyr-ink) 0%, var(--lyr-ink) var(--p, 0%), var(--dim) calc(var(--p, 0%) + 11%), var(--dim) 100%);
  -webkit-background-clip: text; background-clip: text;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.8));
}
.lyrics-line .lyrics-text { filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 calc(var(--near, 0) * 16px) color-mix(in srgb, var(--lyr-glow) calc(var(--near, 0) * 60%), transparent)); }
.lyrics.is-paused .lyrics-track { opacity: 0.65; transition: opacity 0.4s var(--ease); }
/* respiration : un long passage sans paroles */
.lyrics-line.is-breath { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.42em; height: 1.2em; }
/* la barre discrète d'un passage sans paroles : elle se remplit jusqu'au retour du chant */
.b-bar { position: relative; display: block; width: min(34%, 220px); height: 2px; border-radius: 2px; background: rgba(232, 228, 248, 0.12); overflow: hidden; opacity: calc(0.35 + 0.65 * var(--near, 0)); }
.b-bar i { position: absolute; inset: 0 auto 0 0; width: var(--p, 0%); border-radius: inherit; background: linear-gradient(90deg, color-mix(in srgb, var(--lyr-glow) 70%, transparent), var(--lyr-ink)); box-shadow: 0 0 8px var(--lyr-glow); }
.lyrics.is-stage .b-bar { height: 3px; }
/* barre de synchro : état et calage */
.lyrics-bar { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 6px; pointer-events: auto; opacity: 0.55; transition: opacity 0.4s var(--ease); }
.lyrics-bar:hover { opacity: 1; }
.lyrics-sync { font: 400 11px/1.2 var(--font-ui); letter-spacing: 0.04em; color: var(--muted); margin-right: auto; text-align: left; }
.lyrics.is-sync-ok .lyrics-sync::before { content: "✓ "; color: var(--gold); }
.lyrics-bar button { font: 500 11px/1 var(--font-ui); color: var(--ink); background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); border-radius: 999px; padding: 4px 9px; cursor: pointer; }
.lyrics-bar button:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.09); }
/* ciel libre : carte de verre posée sur le lecteur */
.lyrics.is-docked { z-index: 7; padding: 12px 16px 9px; border: 1px solid var(--line); border-radius: 18px; background: var(--glass); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.9); transform: translateX(-50%) translateY(8px); }
.lyrics.is-docked.is-on { transform: translateX(-50%); }
.lyrics.is-docked::before { display: none; }
.lyrics.is-docked .lyrics-track { height: 2.9em; font-size: clamp(18px, 1.25vw, 22px); overflow: hidden; -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent); mask-image: linear-gradient(to bottom, #000 72%, transparent); }
.lyrics.is-docked .lyrics-line { top: 0.1em; white-space: normal; }

.lyrics.is-stage { z-index: 9; }
.lyrics.is-stage .lyrics-track { font-size: clamp(24px, 2.5vw, 46px); }
/* mode scène : un voile sous les paroles, à la mesure de l'image (--scrim : 0 sombre, 1 claire ou chargée).
   Sur une image claire, il assombrit et floute légèrement la vidéo derrière le texte. */
@property --scrim { syntax: "<number>"; inherits: true; initial-value: 0.6; }
.lyrics.is-stage { transition: opacity 0.7s var(--ease), --scrim 0.9s var(--ease), --lyr-ink 1.2s linear, --lyr-glow 1.2s linear; }
.lyrics.is-stage::before {
  inset: -26% -8% -30%;
  background: radial-gradient(ellipse 56% 54% at 50% 54%, rgba(3, 4, 11, calc(0.28 + 0.62 * var(--scrim))), rgba(3, 4, 11, calc(0.1 + 0.48 * var(--scrim))) 60%, transparent 82%);
  -webkit-backdrop-filter: blur(calc(var(--scrim) * 9px)) saturate(calc(1 - 0.3 * var(--scrim)));
  backdrop-filter: blur(calc(var(--scrim) * 9px)) saturate(calc(1 - 0.3 * var(--scrim)));
  -webkit-mask-image: radial-gradient(ellipse 58% 56% at 50% 54%, #000 40%, transparent 82%);
  mask-image: radial-gradient(ellipse 58% 56% at 50% 54%, #000 40%, transparent 82%);
}
.lyrics.is-stage .lyrics-text { filter: drop-shadow(0 1px calc(3px + 3px * var(--scrim)) rgba(0, 0, 0, calc(0.75 + 0.2 * var(--scrim)))) drop-shadow(0 0 calc(var(--near, 0) * 16px) color-mix(in srgb, var(--lyr-glow) calc(var(--near, 0) * 60%), transparent)); }
.lyrics.is-stage .lyrics-tr { text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9), 0 0 calc(6px * var(--scrim)) rgba(0, 0, 0, 0.8); }
.lyrics.is-stage .lyrics-bar { opacity: 0.4; }
body.is-stage-idle .lyrics.is-stage .lyrics-bar { opacity: 0; pointer-events: none; }
.chip-lyrics[aria-pressed="true"] { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 60%, transparent); }
@media (max-width: 760px) { .lyrics-track { font-size: 17px; } }
.chip-cc[aria-pressed="true"] { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 60%, transparent); }
/* traduction : une ligne plus petite sous la ligne chantée */
.lyrics-tr { display: block; height: 0; overflow: hidden; opacity: 0; margin-top: 0.18em; font: 400 0.6em/1.25 var(--font-ui); font-style: normal; letter-spacing: 0.02em; color: rgba(226, 222, 246, 0.78); white-space: normal; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8); }
.lyrics.has-tr .lyrics-tr { height: auto; }
.lyrics.has-tr .lyrics-tr { opacity: calc(0.1 + 0.9 * var(--near, 0)); }
.lyrics.has-tr .lyrics-track { height: 5.4em; }
.lyrics.is-docked.has-tr .lyrics-track { height: 3.5em; }
.lyrics.is-docked.has-tr .lyrics-tr { opacity: var(--near, 0); }
.lyrics-tr-btn[aria-pressed="true"] { color: var(--gold) !important; border-color: color-mix(in srgb, var(--gold) 55%, transparent) !important; }

/* --- Profils ------------------------------------------------------------------------------- */
.pf-avatar { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; flex: none;
  font: 400 13px/1 var(--font-display); color: #0b0c18;
  background: radial-gradient(circle at 32% 28%, color-mix(in srgb, var(--pc) 55%, #fff), var(--pc) 55%, color-mix(in srgb, var(--pc) 55%, #000));
  box-shadow: 0 0 12px -2px color-mix(in srgb, var(--pc) 70%, transparent); }
.pf-avatar.is-big { width: 108px; height: 108px; font-size: 52px; transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease); }
.pf-avatar.is-add { color: var(--muted); background: rgba(255, 255, 255, 0.04); border: 1px dashed var(--line-strong); box-shadow: none; font-family: var(--font-ui); font-weight: 300; }
.chip-profile { gap: 7px; padding-left: 5px; }
.chip-profile .pf-avatar { width: 20px; height: 20px; font-size: 12px; }
.pf-chip-name { max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-wrap { position: relative; }
.profile-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 6; min-width: 210px; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--glass-strong); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.9); }
.profile-menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.pf-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 9px; border: 0; border-radius: 9px; background: transparent; color: var(--ink); font: 400 14px/1.2 var(--font-ui); text-align: left; cursor: pointer; }
.pf-item:hover, .pf-item:focus-visible { background: rgba(255, 255, 255, 0.06); }
.pf-item.is-me { color: var(--gold); }
.pf-here { margin-left: auto; font-size: 11px; color: var(--muted); }

.profiles { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px 16px; overflow-y: auto;
  background: radial-gradient(ellipse at 50% 38%, #1a163a, #03040b 70%); opacity: 0; transition: opacity 0.45s var(--ease); }
.profiles.is-open { opacity: 1; }
.pf-inner { text-align: center; max-width: 980px; }
.pf-kicker { margin: 0 0 6px; font: 400 13px/1 var(--font-caps); letter-spacing: 0.42em; text-transform: uppercase; color: var(--gold); }
.pf-title { margin: 0 0 34px; font: italic 400 clamp(34px, 5vw, 58px)/1.05 var(--font-display); color: var(--ink); }
.pf-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 26px; }
.pf-card { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 140px; padding: 12px 6px; border: 0; border-radius: 18px; background: transparent; color: var(--muted); cursor: pointer; font: 400 16px/1.2 var(--font-ui); position: relative; }
.pf-card:hover .pf-avatar.is-big, .pf-card:focus-visible .pf-avatar.is-big { transform: scale(1.06); box-shadow: 0 0 34px -2px color-mix(in srgb, var(--pc, #c7a6ff) 80%, transparent); }
.pf-card:hover, .pf-card:focus-visible { color: var(--ink); outline: none; }
.pf-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-pen { position: absolute; top: 14px; right: 22px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--glass-strong); border: 1px solid var(--line-strong); color: var(--ink); font-size: 13px; }
.pf-card.is-editing { width: 230px; cursor: default; background: rgba(255, 255, 255, 0.035); border: 1px solid var(--line); }
.pf-card.is-editing input { width: 100%; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 9px; background: rgba(0, 0, 0, 0.3); color: var(--ink); font: 400 15px/1.2 var(--font-ui); text-align: center; }
.pf-colors { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.pf-color { width: 20px; height: 20px; border-radius: 50%; border: 2px solid transparent; background: var(--pc); cursor: pointer; padding: 0; }
.pf-color[aria-checked="true"] { border-color: #fff; box-shadow: 0 0 10px var(--pc); }
.pf-row { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.pf-note { min-height: 1.3em; margin: 26px 0 0; color: var(--muted); font-size: 13px; }
.pf-actions { display: flex; flex-wrap: wrap; gap: 14px 22px; justify-content: center; align-items: center; margin-top: 18px; }
.pf-ask { color: var(--muted); font-size: 13px; }
@media (max-width: 560px) { .pf-avatar.is-big { width: 84px; height: 84px; font-size: 40px; } .pf-card { width: 112px; } .pf-grid { gap: 14px; } }

/* --- Interface aux couleurs de l'étoile (js/theme.js) ------------------------------------- */
/* propriétés typées : les teintes changent en fondu ; sans thème, l'or et le verre d'origine */
@property --theme-accent { syntax: "<color>"; inherits: true; initial-value: #f0d08a; }
@property --theme-accent-2 { syntax: "<color>"; inherits: true; initial-value: #c7a6ff; }
@property --theme-glow { syntax: "<color>"; inherits: true; initial-value: #b9a2ff; }
@property --theme-deep { syntax: "<color>"; inherits: true; initial-value: rgba(9, 11, 26, 0.74); }
@property --theme-line { syntax: "<color>"; inherits: true; initial-value: rgba(206, 212, 255, 0.13); }
:root { transition: --theme-accent 1.4s var(--ease), --theme-accent-2 1.4s var(--ease), --theme-glow 1.4s var(--ease), --theme-deep 1.4s var(--ease), --theme-line 1.4s var(--ease); }
.lyrics { --lyr-glow: var(--theme-glow); }
.has-theme .page { background: linear-gradient(180deg, color-mix(in srgb, var(--theme-glow) 16%, transparent), transparent 320px), var(--glass); }
.has-theme .dock { box-shadow: 0 18px 46px -24px rgba(0, 0, 0, 0.9), 0 0 46px -22px var(--theme-glow); }
.has-theme .dock-progress input, .has-theme .dock-volume input { accent-color: var(--theme-accent); }
.has-theme .lyrics.is-docked { box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.9), 0 0 40px -24px var(--theme-glow); }
.has-theme .page h1, .has-theme .page .page-title { text-shadow: 0 0 30px color-mix(in srgb, var(--theme-glow) 45%, transparent); }

/* --- Notes d'écoute ------------------------------------------------------------------------ */
.notes .notes-p { margin: 0 0 0.85em; font: 400 15.5px/1.62 var(--font-display); color: color-mix(in srgb, var(--ink) 92%, transparent); }
.notes .notes-k { display: block; margin-bottom: 0.2em; font: 400 11px/1 var(--font-caps); letter-spacing: 0.24em; text-transform: uppercase; color: var(--gold); }
.notes .notes-p::first-letter { font-size: 1.15em; }
.notes-anec { margin: 0.4em 0 0.9em; padding: 0.75em 0.95em; border-left: 2px solid color-mix(in srgb, var(--gold) 70%, transparent); border-radius: 0 10px 10px 0; background: color-mix(in srgb, var(--gold) 7%, transparent); font: italic 400 15px/1.55 var(--font-display); color: var(--ink); }
.notes-foot { margin: 0; font-size: 12px; color: var(--faint); }
.notes-foot a { color: var(--muted); }
.linkish { padding: 0; border: 0; background: none; color: var(--muted); font: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.linkish:hover { color: var(--ink); }
.notes-wait { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13.5px; }
.notes-ghost { display: grid; gap: 8px; margin-top: 10px; }
.notes-ghost i { display: block; height: 10px; border-radius: 5px; background: linear-gradient(90deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04)); background-size: 200% 100%; animation: notes-shimmer 1.6s linear infinite; }
.notes-ghost i:nth-child(2) { width: 92%; } .notes-ghost i:nth-child(3) { width: 96%; } .notes-ghost i:nth-child(4) { width: 64%; }
@keyframes notes-shimmer { to { background-position: -200% 0; } }
.notes.is-fresh .notes-p, .notes.is-fresh .notes-anec { animation: notes-in 0.9s var(--ease) both; }
.notes.is-fresh .notes-p:nth-of-type(2) { animation-delay: 0.12s; }
.notes.is-fresh .notes-anec { animation-delay: 0.24s; }
@keyframes notes-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
[data-anim="off"] .notes-ghost i, [data-anim="off"] .notes.is-fresh * { animation: none !important; }

/* --- Recherche : aller vers une étoile, ou en ajouter une ------------------------------------ */
.search { position: relative; }
.search-pop { position: absolute; top: calc(100% + 8px); left: 0; z-index: 8; width: max(100%, 340px); padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--glass-strong); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.9); }
.sp-title { margin: 4px 8px 4px; font: 400 10.5px/1 var(--font-caps); letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted); }
.sp-hit, .sp-add { display: flex; align-items: baseline; gap: 8px; width: 100%; padding: 7px 9px; border: 0; border-radius: 9px; background: transparent; color: var(--ink); font: 400 14px/1.25 var(--font-ui); text-align: left; cursor: pointer; }
.sp-hit small { color: var(--muted); font-size: 12px; }
.sp-hit:hover, .sp-add:hover, .sp-hit:focus-visible, .sp-add:focus-visible { background: rgba(255, 255, 255, 0.06); outline: none; }
.sp-add { align-items: flex-start; margin-top: 2px; border-top: 1px solid var(--line); border-radius: 0 0 9px 9px; padding-top: 10px; }
.sp-add b { display: block; font-weight: 500; color: var(--gold); }
.sp-add small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.sp-plus { color: var(--gold); font-size: 15px; line-height: 1.2; }
.sp-busy, .sp-note { display: flex; align-items: center; gap: 10px; margin: 0; padding: 9px; color: var(--muted); font-size: 13px; }
