/* ===================================================================
   Sémaphore — Plateforme (lecteur apprenant + poste manager)
   Salle de classe de nuit : encres profondes, mer phosphorescente,
   or de lanterne. Dérivée de la direction artistique du site vitrine,
   passée en thème sombre (l'apprenant joue le soir, sur le terrain).
   =================================================================== */

:root {
  /* — Fonds (nuit) — */
  --ink:        #101a24;   /* fond le plus profond */
  --ink-1:      #14202c;   /* encre profonde (vitrine) */
  --ink-2:      #1a2b3a;   /* surface soutenue */
  --surface:    #1d3040;   /* carte */
  --surface-2:  #24384a;   /* carte survolée / champ */
  --surface-3:  #2c465b;   /* bord clair */

  /* — Encres claires (papier de lanterne sur la nuit) — */
  --paper:      #f5eeda;   /* texte principal */
  --paper-2:    #e2d5b4;   /* texte secondaire chaud */
  --paper-70:   rgba(245, 238, 218, 0.72);
  --paper-55:   rgba(245, 238, 218, 0.55);
  --paper-40:   rgba(245, 238, 218, 0.40);
  --paper-22:   rgba(245, 238, 218, 0.22);
  --paper-12:   rgba(245, 238, 218, 0.12);
  --paper-07:   rgba(245, 238, 218, 0.07);

  /* — Accents — */
  --gold:       #f8b840;   /* or de lanterne */
  --gold-deep:  #d9962a;
  --gold-soft:  rgba(248, 184, 64, 0.14);
  --sea:        #6dc2ca;   /* courant clair */
  --sea-deep:   #2f6d86;
  --sea-soft:   rgba(109, 194, 202, 0.14);
  --red:        #e0674f;   /* signal d'erreur */
  --red-deep:   #c0472f;
  --red-soft:   rgba(224, 103, 79, 0.14);
  --green:      #7fc98a;   /* réussite */
  --green-deep: #4f9d5c;
  --green-soft: rgba(127, 201, 138, 0.15);

  /* — Typo — */
  --serif: "Hoefler Text", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans:  "Avenir Next", "Avenir", "Segoe UI", "Helvetica Neue", system-ui, sans-serif;
  --mono:  ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  /* — Rythme — */
  --maxw: 1120px;
  --r:    6px;
  --r-lg: 12px;
  --r-xl: 18px;
  --sp:   4px;
  --shadow-1: 0 10px 28px -18px rgba(0,0,0,0.7);
  --shadow-2: 0 22px 48px -24px rgba(0,0,0,0.75);
  --ring: 0 0 0 3px rgba(248, 184, 64, 0.45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  color: var(--paper);
  background-color: var(--ink);
  background-image:
    radial-gradient(ellipse 55% 40% at 15% 0%, rgba(47,109,134,0.20), transparent 60%),
    radial-gradient(ellipse 50% 45% at 90% 8%, rgba(248,184,64,0.08), transparent 55%);
  background-attachment: fixed;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.1; letter-spacing: -0.01em; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button { font-family: inherit; }

/* Accessibilité : focus toujours visible */
:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--r);
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--gold); color: var(--ink-1); padding: 10px 16px;
  border-radius: var(--r); font-weight: 700; transition: top 0.2s ease;
}
.skip-link:focus { top: 12px; }

/* ============================ SHELL ============================ */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.topbar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 18px;
  padding: 12px clamp(16px, 4vw, 32px);
  background: rgba(16, 26, 36, 0.82);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--paper-12);
}
.topbar__brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--serif); font-size: 1.2rem; font-weight: 600;
}
.topbar__brand img { width: 30px; height: 30px; border-radius: 7px; box-shadow: 0 2px 8px -3px rgba(0,0,0,0.6); }
.topbar__crumbs {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 0.9rem; color: var(--paper-55); min-width: 0;
}
.topbar__crumbs a { color: var(--paper-70); transition: color 0.18s ease; }
.topbar__crumbs a:hover { color: var(--gold); }
.topbar__crumbs .sep { color: var(--paper-22); }
.topbar__spacer { margin-left: auto; }
.topbar__right { display: flex; align-items: center; gap: 12px; }

.main {
  flex: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(24px, 5vw, 52px) clamp(16px, 4vw, 32px) 80px;
}
.view { animation: viewIn 0.4s cubic-bezier(0.2,0.7,0.2,1); }
@keyframes viewIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ============================ TYPO ============================ */
.kicker {
  display: inline-block; font-family: var(--sans);
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--gold-deep);
}
.kicker::before { content: "✦ "; color: var(--gold); }
.page-title { font-size: clamp(1.9rem, 4vw, 2.7rem); margin: 10px 0 6px; }
.page-lead { color: var(--paper-70); font-size: 1.08rem; max-width: 62ch; }
.eyebrow {
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--sea);
}
.section-title { font-size: 1.4rem; margin-bottom: 4px; }
.muted { color: var(--paper-55); }
.serif-i { font-family: var(--serif); font-style: italic; }
.lore {
  font-family: var(--serif); font-size: 1.12rem; line-height: 1.55;
  color: var(--paper-2); max-width: 66ch;
}

/* ============================ BUTTONS ============================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--sans); font-weight: 700; font-size: 0.96rem;
  padding: 12px 22px; border-radius: var(--r);
  border: 1.5px solid transparent; background: transparent; cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn--gold { background: var(--gold); color: var(--ink-1); box-shadow: 0 8px 22px -10px rgba(248,184,64,0.7); }
.btn--gold:not(:disabled):hover { transform: translateY(-2px); background: #ffc652; box-shadow: 0 14px 30px -10px rgba(248,184,64,0.8); }
.btn--ghost { background: transparent; border-color: var(--paper-22); color: var(--paper); }
.btn--ghost:not(:disabled):hover { border-color: var(--paper); transform: translateY(-2px); background: var(--paper-07); }
.btn--sea { background: var(--sea-deep); color: var(--paper); box-shadow: 0 8px 22px -12px rgba(47,109,134,0.9); }
.btn--sea:not(:disabled):hover { transform: translateY(-2px); background: #3a819e; }
.btn--sm { padding: 8px 15px; font-size: 0.85rem; }
.btn--lg { padding: 16px 34px; font-size: 1.05rem; }
.btn--block { width: 100%; }
.btn--icon { padding: 9px; border-radius: 50%; }

/* ============================ CARDS ============================ */
.card {
  background: linear-gradient(165deg, var(--surface), var(--ink-2));
  border: 1px solid var(--paper-12);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--shadow-1);
}
.card--pad-lg { padding: clamp(24px, 4vw, 40px); }
.card__title { font-size: 1.25rem; margin-bottom: 8px; }

.grid { display: grid; gap: 18px; }
.grid--cards { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.stack { display: flex; flex-direction: column; }
.stack > * + * { margin-top: var(--gap, 18px); }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.spacer { flex: 1; }

/* ---- Carte cliquable (île, quête, formation) ---- */
.tile {
  display: flex; flex-direction: column;
  background: linear-gradient(165deg, var(--surface), var(--ink-2));
  border: 1px solid var(--paper-12);
  border-radius: var(--r-lg);
  padding: 22px;
  text-align: left; width: 100%;
  color: inherit; cursor: pointer;
  position: relative; overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.tile::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 4px;
  background: linear-gradient(180deg, var(--gold), var(--gold-deep));
  opacity: 0; transition: opacity 0.2s ease;
}
.tile:not(.tile--locked):hover { transform: translateY(-4px); box-shadow: var(--shadow-2); border-color: var(--paper-22); }
.tile:not(.tile--locked):hover::before { opacity: 1; }
.tile--done::before { background: linear-gradient(180deg, var(--green), var(--green-deep)); opacity: 1; }
.tile--locked { cursor: not-allowed; opacity: 0.62; }
.tile--locked:hover { transform: none; }
.tile__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.tile__eyebrow { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--sea); }
.tile__title { font-size: 1.35rem; margin-bottom: 6px; }
.tile__desc { color: var(--paper-70); font-size: 0.96rem; flex: 1; }
.tile__foot { margin-top: 16px; }
.tile__lock { font-size: 0.82rem; color: var(--paper-55); display: inline-flex; align-items: center; gap: 6px; }

/* ============================ BADGES ============================ */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.02em;
  padding: 4px 11px; border-radius: 100px;
  background: var(--paper-12); color: var(--paper-2);
  border: 1px solid transparent;
}
.badge--gold { background: var(--gold-soft); color: var(--gold); border-color: rgba(248,184,64,0.3); }
.badge--sea  { background: var(--sea-soft); color: var(--sea); border-color: rgba(109,194,202,0.3); }
.badge--green{ background: var(--green-soft); color: var(--green); border-color: rgba(127,201,138,0.32); }
.badge--red  { background: var(--red-soft); color: var(--red); border-color: rgba(224,103,79,0.3); }
.badge--dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge--count { min-width: 22px; height: 22px; justify-content: center; padding: 0 7px; }

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.85rem; padding: 7px 13px; border-radius: 100px;
  background: var(--paper-07); border: 1px solid var(--paper-12); color: var(--paper-2);
}

/* ============================ PROGRESS ============================ */
.progress {
  height: 8px; border-radius: 100px; background: var(--paper-12);
  overflow: hidden; position: relative;
}
.progress__bar {
  height: 100%; border-radius: 100px;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold));
  transition: width 0.6s cubic-bezier(0.2,0.7,0.2,1);
}
.progress--green .progress__bar { background: linear-gradient(90deg, var(--green-deep), var(--green)); }
.progress--sea .progress__bar { background: linear-gradient(90deg, var(--sea-deep), var(--sea)); }
.progress__label { display: flex; justify-content: space-between; font-size: 0.82rem; color: var(--paper-55); margin-bottom: 7px; }

/* Anneau de progression (SVG) */
.ring { transform: rotate(-90deg); }
.ring__track { fill: none; stroke: var(--paper-12); }
.ring__fill { fill: none; stroke: var(--gold); stroke-linecap: round; transition: stroke-dashoffset 0.7s cubic-bezier(0.2,0.7,0.2,1); }

/* ============================ FORMS ============================ */
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 0.86rem; font-weight: 600; color: var(--paper-2); }
.field .hint { font-size: 0.8rem; color: var(--paper-55); }
.input, .select, textarea.input {
  width: 100%; font-family: var(--sans); font-size: 0.98rem;
  padding: 12px 14px; border-radius: var(--r);
  background: var(--surface-2); color: var(--paper);
  border: 1.5px solid var(--paper-12);
  transition: border-color 0.16s ease, background 0.16s ease;
}
.input::placeholder { color: var(--paper-40); }
.input:focus, .select:focus { border-color: var(--gold); background: #223648; }
.select { appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--paper-55) 50%), linear-gradient(135deg, var(--paper-55) 50%, transparent 50%);
  background-position: calc(100% - 18px) center, calc(100% - 13px) center;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 38px;
}
.checkline { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.checkline input[type=checkbox] {
  appearance: none; flex: none; width: 22px; height: 22px; margin-top: 2px;
  border: 1.5px solid var(--paper-22); border-radius: 6px; background: var(--surface-2);
  cursor: pointer; position: relative; transition: background 0.16s ease, border-color 0.16s ease;
}
.checkline input[type=checkbox]:checked { background: var(--gold); border-color: var(--gold); }
.checkline input[type=checkbox]:checked::after {
  content: ""; position: absolute; left: 7px; top: 3px; width: 5px; height: 10px;
  border: solid var(--ink-1); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.checkline input[type=checkbox]:focus-visible { box-shadow: var(--ring); }
.checkline__body { font-size: 0.94rem; color: var(--paper-2); }

/* ============================ TABLE ============================ */
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); border: 1px solid var(--paper-12); }
table.data { width: 100%; border-collapse: collapse; font-size: 0.92rem; min-width: 560px; }
table.data th, table.data td { padding: 13px 16px; text-align: left; }
table.data thead th {
  background: var(--ink-2); color: var(--paper-70);
  font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700;
  border-bottom: 1px solid var(--paper-12); position: sticky; top: 0;
}
table.data tbody tr { border-top: 1px solid var(--paper-07); background: var(--surface); transition: background 0.15s ease; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data td .num { font-variant-numeric: tabular-nums; }

/* ---- Drill-down par apprenant (quêtes faites / à faire) ---- */
tr.lrow--drill { cursor: pointer; }
.disclosure {
  display: inline-flex; align-items: center; gap: 9px;
  background: none; border: none; padding: 0; margin: 0;
  color: inherit; font: inherit; cursor: pointer; text-align: left;
}
.disclosure__chev {
  color: var(--gold); font-size: 0.8rem; line-height: 1;
  transition: transform 0.22s cubic-bezier(0.2,0.7,0.2,1);
}
.disclosure[aria-expanded="true"] .disclosure__chev { transform: rotate(90deg); }
.disclosure:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: var(--r); }
tr.lrow--open { background: var(--surface-2); }
tr.lrow--open td { border-bottom-color: transparent; }

.qdetail-cell { padding: 0 !important; background: var(--ink-2); }
.quest-drill {
  padding: 18px 20px 22px;
  animation: quest-drill-in 0.24s cubic-bezier(0.2,0.7,0.2,1);
}
@keyframes quest-drill-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .quest-drill { animation: none; }
  .disclosure__chev { transition: none; }
}
.quest-drill__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.quest-drill__title {
  font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase;
  font-weight: 700; color: var(--sea);
}
.quest-drill__count { font-size: 0.82rem; color: var(--paper-55); }
.quest-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px;
}
.quest-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--r);
  background: var(--paper-07); border: 1px solid var(--paper-12);
  font-size: 0.9rem;
}
.quest-item__mark {
  flex: none; width: 20px; height: 20px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 700;
  border: 1.5px solid var(--paper-22); color: transparent;
}
.quest-item__title { flex: 1; min-width: 0; color: var(--paper-70); }
.quest-item__state {
  flex: none; font-size: 0.72rem; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--paper-40);
}
.quest-item--done {
  background: var(--green-soft); border-color: rgba(127,201,138,0.32);
}
.quest-item--done .quest-item__mark {
  background: var(--green-deep); border-color: var(--green-deep); color: var(--ink-1);
}
.quest-item--done .quest-item__title { color: var(--paper-2); }
.quest-item--done .quest-item__state { color: var(--green); }
.quest-item--boss { border-style: dashed; }
.quest-item--boss.quest-item--done {
  background: var(--gold-soft); border-color: rgba(248,184,64,0.3); border-style: solid;
}
.quest-item--boss.quest-item--done .quest-item__mark {
  background: transparent; border-color: transparent; color: inherit; font-size: 1rem;
}
.quest-item--boss.quest-item--done .quest-item__state { color: var(--gold); }

/* ============================ EMPTY STATES ============================ */
.empty {
  text-align: center; padding: clamp(40px, 8vw, 72px) 24px;
  border: 1.5px dashed var(--paper-12); border-radius: var(--r-xl);
  background: var(--paper-07);
}
.empty__mark { font-size: 2.6rem; margin-bottom: 14px; filter: saturate(0.9); }
.empty h3 { font-size: 1.4rem; margin-bottom: 10px; }
.empty p { color: var(--paper-70); max-width: 48ch; margin: 0 auto 8px; }
.empty__steps {
  list-style: none; counter-reset: s; max-width: 460px; margin: 26px auto 0;
  text-align: left; display: flex; flex-direction: column; gap: 12px;
}
.empty__steps li { counter-increment: s; display: flex; gap: 14px; align-items: flex-start; }
.empty__steps li::before {
  content: counter(s); flex: none; width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 600;
  background: var(--gold-soft); color: var(--gold); border: 1.5px solid rgba(248,184,64,0.4);
}
.empty__steps b { color: var(--paper); }

/* ============================ NOTICES ============================ */
.notice {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: var(--r-lg);
  background: var(--sea-soft); border: 1px solid rgba(109,194,202,0.28);
  font-size: 0.92rem; color: var(--paper-2);
}
.notice--warn { background: var(--gold-soft); border-color: rgba(248,184,64,0.3); }
.notice--error { background: var(--red-soft); border-color: rgba(224,103,79,0.3); }
.notice__mark { font-size: 1.2rem; line-height: 1.3; flex: none; }

/* Bandeau démo / hors-ligne */
.banner {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 8px 16px; font-size: 0.85rem; font-weight: 600;
  background: var(--gold-soft); color: var(--gold); border-bottom: 1px solid rgba(248,184,64,0.25);
  text-align: center;
}
.banner--offline { background: var(--red-soft); color: var(--red); border-color: rgba(224,103,79,0.25); }
.banner__dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ============================ LESSON / QUEST ============================ */
.keypoints { list-style: none; display: flex; flex-direction: column; gap: 12px; margin: 18px 0; }
.keypoints li {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: var(--r);
  background: var(--paper-07); border-left: 3px solid var(--gold);
}
.keypoints li::before { content: "◆"; color: var(--gold); font-size: 0.7rem; margin-top: 5px; flex: none; }

.shots { display: grid; gap: 16px; margin: 22px 0; }
.shot {
  border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--paper-12); background: var(--ink-2);
}
.shot img { display: block; width: 100%; height: auto; }
.shot figcaption { padding: 12px 16px; font-size: 0.88rem; color: var(--paper-70); font-family: var(--serif); font-style: italic; }

/* Round (QCM) */
.round__meta { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.bubble {
  position: relative; padding: 16px 18px; border-radius: var(--r-lg);
  background: var(--surface-2); border: 1px solid var(--paper-12);
  font-size: 1.02rem; color: var(--paper); max-width: 60ch; margin: 6px 0 4px;
}
.bubble::before { content: "“"; font-family: var(--serif); color: var(--gold); font-size: 1.6rem; margin-right: 4px; }
.bubble__who { font-size: 0.78rem; color: var(--paper-55); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.1em; }
.prompt { font-size: 1.12rem; font-weight: 600; margin: 20px 0 16px; }

.choices { display: flex; flex-direction: column; gap: 12px; }
.choice {
  text-align: left; width: 100%; cursor: pointer;
  padding: 16px 18px; border-radius: var(--r-lg);
  background: var(--surface); border: 1.5px solid var(--paper-12);
  color: var(--paper); font-size: 1rem; line-height: 1.45;
  transition: transform 0.14s ease, border-color 0.16s ease, background 0.16s ease;
}
.choice:not(:disabled):hover { border-color: var(--sea); transform: translateX(3px); background: var(--surface-2); }
.choice:disabled { cursor: default; }
.choice--correct { border-color: var(--green); background: var(--green-soft); }
.choice--wrong { border-color: var(--red); background: var(--red-soft); }
.choice--muted { opacity: 0.5; }
.choice__mark { font-weight: 700; margin-right: 8px; }
.feedback {
  margin-top: 8px; padding: 14px 16px; border-radius: var(--r);
  font-size: 0.94rem; animation: viewIn 0.3s ease;
}
.feedback--ok { background: var(--green-soft); border: 1px solid rgba(127,201,138,0.3); color: var(--paper); }
.feedback--ko { background: var(--red-soft); border: 1px solid rgba(224,103,79,0.3); color: var(--paper); }

/* Monstre / boss */
.monster {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px 18px; border-radius: var(--r-lg);
  background: linear-gradient(165deg, rgba(192,71,47,0.16), var(--ink-2));
  border: 1px solid rgba(224,103,79,0.28); margin-bottom: 20px;
}
.monster__mark { font-size: 1.8rem; flex: none; }
.monster__name { font-family: var(--serif); font-size: 1.15rem; color: var(--red); }
.monster__taunt { font-style: italic; color: var(--paper-2); font-family: var(--serif); }

/* Bilan */
.result { text-align: center; padding: 20px 0; }
.result__score { font-family: var(--serif); font-size: 3.4rem; color: var(--gold); line-height: 1; }
.result__xp { color: var(--sea); font-weight: 700; margin-top: 8px; }

/* ============================ MEMORY PATH ============================ */
.mempath { position: relative; margin: 26px 0; padding-left: 10px; }
.mempath::before {
  content: ""; position: absolute; left: 27px; top: 10px; bottom: 30px; width: 2px;
  background: linear-gradient(180deg, var(--gold), var(--sea-deep));
  opacity: 0.5;
}
.locus {
  position: relative; display: grid; grid-template-columns: 54px 1fr; gap: 18px;
  padding: 10px 0 26px;
}
.locus__node {
  width: 36px; height: 36px; margin: 0 auto; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 600; color: var(--ink-1);
  background: radial-gradient(circle at 35% 30%, #ffd97a, var(--gold-deep));
  box-shadow: 0 0 0 6px var(--gold-soft), 0 6px 16px -6px rgba(248,184,64,0.8);
  z-index: 1;
}
.locus__card {
  background: var(--surface); border: 1px solid var(--paper-12);
  border-radius: var(--r-lg); padding: 18px 20px;
}
.locus__place { font-family: var(--serif); font-size: 1.2rem; color: var(--gold); margin-bottom: 8px; }
.locus__anchor { color: var(--paper-2); margin-bottom: 12px; }
.locus__rule {
  font-size: 0.92rem; color: var(--paper-70); padding: 10px 14px;
  background: var(--paper-07); border-radius: var(--r); border-left: 3px solid var(--sea);
}
.locus__rule b { color: var(--sea); }

/* ============================ RETENTION CHART ============================ */
.chart-card { padding: clamp(20px, 3vw, 32px); }
.retention svg { display: block; width: 100%; height: auto; overflow: visible; }
.retention .axis { stroke: var(--paper-12); stroke-width: 1; }
.retention .grid-line { stroke: var(--paper-07); stroke-width: 1; }
.retention .axis-label { fill: var(--paper-55); font-size: 12px; font-family: var(--sans); }
.retention .curve { fill: none; stroke: var(--gold); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.retention .area { fill: url(#retGrad); opacity: 0.85; }
.retention .pt { fill: var(--ink-1); stroke: var(--gold); stroke-width: 2.5; }
.retention .pt-label { fill: var(--paper); font-size: 13px; font-weight: 700; font-family: var(--sans); text-anchor: middle; }
.retention .pt-sub { fill: var(--paper-55); font-size: 11px; text-anchor: middle; }

/* Légende KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.kpi { padding: 18px 20px; border-radius: var(--r-lg); background: var(--paper-07); border: 1px solid var(--paper-12); }
.kpi__val { font-family: var(--serif); font-size: 2.1rem; color: var(--gold); line-height: 1; }
.kpi__val--sea { color: var(--sea); }
.kpi__val--green { color: var(--green); }
.kpi__label { margin-top: 8px; font-size: 0.82rem; color: var(--paper-55); }

/* ============================ COPY LINK ============================ */
.copyrow { display: flex; gap: 8px; }
.copyrow .input { font-family: var(--mono); font-size: 0.85rem; }

/* ============================ MISC ============================ */
.divider { height: 1px; background: var(--paper-12); margin: 28px 0; border: 0; }
.back-link { display: inline-flex; align-items: center; gap: 7px; color: var(--paper-70); font-size: 0.9rem; font-weight: 600; transition: color 0.16s ease; }
.back-link:hover { color: var(--gold); }
.back-link::before { content: "←"; }
.center-narrow { max-width: 520px; margin: 0 auto; }
.center-page { min-height: 72vh; display: flex; align-items: center; justify-content: center; }
.glossary { display: grid; gap: 10px; }
.glossary dt { font-family: var(--serif); color: var(--gold); font-size: 1.02rem; }
.glossary dd { color: var(--paper-70); margin-bottom: 6px; }
.loader { display: inline-block; width: 26px; height: 26px; border: 3px solid var(--paper-12); border-top-color: var(--gold); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.center-load { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 80px 0; color: var(--paper-55); }

/* ============================ RESPONSIVE ============================ */
@media (max-width: 720px) {
  .grid--2 { grid-template-columns: 1fr; }
  .topbar__crumbs { font-size: 0.82rem; }
  .locus { grid-template-columns: 42px 1fr; gap: 12px; }
  .mempath::before { left: 21px; }
  .result__score { font-size: 2.8rem; }
  .btn--lg { padding: 14px 24px; }
}
@media (max-width: 480px) {
  .topbar { gap: 10px; padding: 10px 14px; }
  .topbar__brand span { display: none; }
  .row--stack-sm { flex-direction: column; align-items: stretch; }
  .row--stack-sm .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
