/* Horizon — thème TRON orbital (d'après la maquette validée « horizon-orbital »).
   CSP stricte : aucune règle inline ; les couleurs de sphère viennent des classes hue-*,
   les positions d'orbite des classes ring-<nombre>-<index> (générées en fin de fichier). */
:root {
  --bg: #060d15;
  --panel: #0b1a24;
  --panel-2: #10212b;
  --ink: #ecfaff;
  --soft: #90a8b5;
  --dim: #607e8b;
  --line: #a1dbe32b;
  --line-strong: #355463;
  --cyan: #8cf5ef;
  --mint: #5ce8fa;
  --gold: #ffb65c;
  --danger-ink: #ffbb9d;
  --danger-bg: #302021;
  --ok: #a0f2d0;
  --color: var(--cyan);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; min-height: 100vh; overflow-x: hidden;
  font: 15px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink); background: var(--bg);
  display: flex; flex-direction: column;
}
a { color: var(--cyan); text-underline-offset: 4px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; color: inherit; }
:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
.visually-hidden {
  position: absolute !important; 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; background: var(--cyan); color: #06111b; padding: 8px 12px; z-index: 20; }
.skip-link:focus { top: 12px; }
.icon { width: 18px; height: 18px; flex-shrink: 0; vertical-align: middle; stroke: currentColor; fill: none; }

/* ---------- Ciel et grille ---------- */
.sky { position: fixed; inset: 0; pointer-events: none; z-index: -2;
  background:
    radial-gradient(ellipse at 50% 55%, #123a4933, transparent 65%),
    radial-gradient(1px 1px at 10% 20%, #b4e7ff 80%, transparent),
    radial-gradient(1px 1px at 30% 70%, #b4e7ff 80%, transparent),
    radial-gradient(1px 1px at 75% 30%, #b4e7ff 80%, transparent),
    radial-gradient(1px 1px at 85% 80%, #b4e7ff 80%, transparent);
  background-size: auto, 251px 251px, 351px 351px, 409px 409px, 567px 567px; }
.floor { position: fixed; bottom: -36vh; left: -40%; width: 180%; height: 65vh; pointer-events: none; z-index: -1;
  transform: perspective(500px) rotateX(58deg);
  background-image: linear-gradient(#62ced311 1px, transparent 1px), linear-gradient(90deg, #62ced311 1px, transparent 1px);
  background-size: 75px 75px;
  -webkit-mask-image: linear-gradient(transparent, #000); mask-image: linear-gradient(transparent, #000); }

/* ---------- En-tête et navigation ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 26px 4vw 14px; }
.brand { letter-spacing: 7px; font-size: 19px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand span { color: var(--cyan); }
.tagline { font-size: 10px; letter-spacing: 2px; color: var(--soft); text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.topbar-actions form { margin: 0; }
.shortcut { background: #10252c; border: 1px solid #75d6db45; padding: 12px 19px; border-radius: 30px; font-size: 12px; color: #baf9f5; text-decoration: none; white-space: nowrap; }
.shortcut:hover { background: #20434d; }
.quiet-link { color: var(--soft) !important; text-decoration: none !important; font-size: 12px !important; }
.quiet-link:hover { color: var(--ink) !important; }
.nav { display: flex; gap: 6px; padding: 0 4vw 14px; border-bottom: 1px solid #b9f5ff12; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 30px; color: var(--soft); text-decoration: none; font-size: 13px; white-space: nowrap; min-height: 40px; }
.nav a .icon { width: 16px; height: 16px; }
.nav a:hover { color: var(--ink); background: #0f2532; }
.nav a[aria-current="page"] { color: var(--cyan); background: #10252c; box-shadow: inset 0 0 0 1px #75d6db45; }

.main { position: relative; flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 34px 4vw 70px; min-width: 0; }
.footer { font-size: 10px; letter-spacing: 1px; color: var(--dim); padding: 20px 4vw; display: flex; justify-content: center; gap: 24px; flex-wrap: wrap; text-transform: uppercase; }
.guide { display: flex; gap: 10px; align-items: flex-start; max-width: 640px; margin: 60px auto 0; color: var(--dim); font-size: 12px; text-align: left; }
.guide .icon { color: var(--gold); width: 16px; height: 16px; margin-top: 2px; }

/* ---------- Typographie ---------- */
h1, h2 { font-weight: 400; letter-spacing: -1px; overflow-wrap: anywhere; }
h1 { font-size: clamp(30px, 3.3vw, 49px); line-height: 1.15; margin: 14px 0 12px; }
h1 em { font-style: normal; color: var(--cyan); }
h2 { font-size: 24px; margin: 0 0 14px; }
h3 { font-size: 15px; margin: 0 0 6px; font-weight: 600; overflow-wrap: anywhere; }
p { margin: 6px 0 14px; }
.eyebrow, .chapter, .section-label { font-size: 10px; letter-spacing: 3px; color: #81a7b5; text-transform: uppercase; overflow-wrap: anywhere; }
.section-label { color: var(--color); }
.chapter { color: var(--cyan); }
.subtitle, .lead { color: var(--soft); font-size: 14px; line-height: 1.7; max-width: 62ch; }
.small { font-size: 12px; color: var(--soft); }
.hint { text-align: center; color: var(--dim); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; margin: 22px 0 0; }
.road-header, .page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 26px; }
.page-head { display: block; text-align: center; margin-bottom: 46px; }
.page-head .subtitle { margin: 0 auto; }
.road-header h1 { margin-bottom: 0; }
.pill { color: var(--cyan); font-size: 11px; }
.tag { font-size: 11px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 30px; color: var(--soft); }

/* ---------- Couleurs de sphère (par icône choisie) ---------- */
.hue-users { --color: #eab998; }
.hue-heart { --color: #cf9bd4; }
.hue-heart-pulse { --color: #9ce0bf; }
.hue-rocket { --color: #79eee7; }
.hue-gem { --color: #92bcf7; }
.hue-sprout { --color: #b3acef; }
.hue-compass { --color: #ecd09a; }
.hue-orbit { --color: #8cf5ef; }

/* ---------- Planètes ---------- */
.orb {
  --size: 125px;
  position: relative; display: grid; place-items: center; width: var(--size); height: var(--size); border-radius: 50%;
  background: radial-gradient(circle at 31% 25%, #e4ffffa8, transparent 21%),
              radial-gradient(circle at 34% 28%, var(--color), #113047 43%, #020914 73%);
  box-shadow: inset 0 0 16px #dbffff44, inset -10px -15px 28px #01060d, 0 0 0 1px var(--color),
              0 0 25px color-mix(in srgb, var(--color) 24%, transparent), 0 0 75px color-mix(in srgb, var(--color) 12%, transparent);
  animation: float 7s ease-in-out infinite;
  transition: filter .4s, scale .4s;
}
.orb::before { content: ""; position: absolute; inset: -11px; border: 1px solid color-mix(in srgb, var(--color) 55%, transparent); border-radius: 50%;
  transform: rotateX(64deg) rotate(-22deg); box-shadow: 0 0 10px color-mix(in srgb, var(--color) 25%, transparent); }
.orb::after { content: ""; position: absolute; inset: 8px; border: 1px solid #dbffff20; border-radius: 50%; clip-path: polygon(0 0, 80% 0, 20% 100%, 0 100%); }
.orb-icon { width: 38%; height: 38%; stroke: #d7fffa; fill: none; stroke-width: 1.2; opacity: .9; filter: drop-shadow(0 0 8px var(--color)); }

/* Hauteur réelle : les cartes (orbe + flottement + nom sur deux lignes + statut) restent entre l'intro et la consigne. */
.space { position: relative; height: 820px; max-width: 1100px; margin: 10px auto 0; }
.orbit-ring { position: absolute; left: 50%; top: 47.1%; width: 80%; height: 70.2%; border: 1px solid #92e9f419; border-radius: 50%; transform: translate(-50%, -50%) rotate(-12deg); pointer-events: none; }
.orbit-ring::after { content: ""; position: absolute; inset: -35px; border: 1px dashed #92e9f40e; border-radius: 50%; }
.planets { list-style: none; margin: 0; padding: 0; }
/* Chaque carte est ancrée sur le CENTRE DE SA PLANÈTE (et non sur la carte entière) :
   les positions d'orbite décrivent donc des centres d'orbes, nom et statut se placent dessous. */
.planet-item { --orb: 125px; position: absolute; left: 50%; top: 50%; transform: translate(-50%, calc(var(--orb) / -2 - 12px)); width: 210px; }
.planet-item .orb { --size: var(--orb); }
.planet { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 12px; color: var(--ink); text-decoration: none; text-align: center; border-radius: 24px; isolation: isolate; }
.planet-name { font-size: 13px; font-weight: 400; letter-spacing: 1.6px; overflow-wrap: anywhere; max-width: 100%; }
.planet-status { color: #83a3af; font-size: 10px; letter-spacing: 1px; margin-top: -15px; text-transform: uppercase; }
.planet:hover .orb, .planet:focus-visible .orb { scale: 1.09; filter: brightness(1.3); }
.primary { --orb: 174px; top: 46%; }
.primary .planet-name { color: color-mix(in srgb, var(--color) 60%, #fff); }
.planet-item:nth-child(2n) .orb { animation-delay: -2.3s; }
.planet-item:nth-child(3n) .orb { animation-delay: -4.1s; }
.planet-item:nth-child(5n) .orb { animation-delay: -5.6s; }
.orbit-controls { display: none; }

/* 9 à 12 sphères : planètes plus petites pour garder l'orbite lisible. */
.space.crowded .planet-item { --orb: 96px; }
.space.crowded .primary { --orb: 150px; }
.space.crowded .planet-item { width: 170px; }
.space.crowded .planet { gap: 16px; }
.space.crowded .planet-status { margin-top: -9px; }

/* Constellation (au-delà de 12 sphères) : flux libre, aucune position calculée. */
.space.dense { height: auto; }
.space.dense .orbit-ring { display: none; }
.space.dense .planets { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px 10px; padding: 20px 0 40px; }
.space.dense .planet-item { position: static; transform: none; width: 190px; }
.space.dense .planet-item:nth-child(even) { margin-top: 46px; }
.space.dense .planet-item { --orb: 104px; }
.space.dense .primary { --orb: 140px; }

/* Entrée dans une planète : zoom doux puis navigation serveur normale (JS). */
.warp-veil { position: fixed; inset: 0; pointer-events: none; opacity: 0; z-index: 15;
  background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--color) 30%, transparent), #060d15 70%); transition: opacity .55s ease .15s; }
.warping .warp-veil { opacity: 1; }
.warping .intro, .warping .hint, .warping .orbit-ring, .warping .orbit-controls { opacity: 0; transition: opacity .35s; }
.warping .planet-item:not(.is-entering) { opacity: 0; transition: opacity .4s; }
.planet-item.is-entering { z-index: 10; }
.planet-item.is-entering .orb { animation: none; scale: 3.4; filter: brightness(1.7); transition: scale .7s cubic-bezier(.6, 0, .3, 1), filter .7s; }
.planet-item.is-entering .planet-name, .planet-item.is-entering .planet-status { opacity: 0; transition: opacity .2s; }

/* ---------- Pages de parcours ---------- */
.intro { text-align: center; }
.intro .subtitle { margin: 0 auto; }
.view { animation: enter .65s ease both; }
.crumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; list-style: none; margin: 0 0 10px; padding: 0; color: #7f9daa; font-size: 12px; }
.crumb li + li::before { content: "/"; margin-right: 14px; color: #3d5966; }
.crumb a { color: #a9c4cd; text-decoration: none; padding: 8px 0; display: inline-block; }
.crumb a:hover { color: #fff; }
.crumb [aria-current] { color: var(--soft); overflow-wrap: anywhere; }

.sphere-view { display: grid; grid-template-columns: 1fr 1.15fr; align-items: center; min-height: 62vh; gap: 7vw; max-width: 1000px; margin: auto; }
.hero-orb { display: grid; place-items: center; min-height: 380px; }
.hero-orb .orb { --size: 290px; animation: arrive 1s cubic-bezier(.2, .7, .2, 1) both, float 7s ease-in-out 1s infinite; }
.sphere-body h1 { margin-bottom: 18px; }

.portals { list-style: none; margin: 8px 0 26px; padding: 0; }
.portal { display: flex; align-items: center; justify-content: space-between; gap: 18px; width: 100%; padding: 24px 0; border-bottom: 1px solid var(--line);
  color: var(--ink); text-decoration: none; text-align: left; font-size: 21px; line-height: 1.4; overflow-wrap: anywhere; }
.portal small { display: block; font-size: 10px; letter-spacing: 2px; color: #80a0ac; margin-bottom: 8px; text-transform: uppercase; }
.portal .arrow { color: var(--cyan); font-size: 13px; letter-spacing: 1px; white-space: nowrap; flex-shrink: 0; }
.portal:hover, .portal:focus-visible { color: var(--cyan); }
.portal.done > span:first-child { color: var(--soft); }
.portals-quiet .portal { font-size: 16px; padding: 16px 0; color: var(--soft); }

.action { display: inline-flex; align-items: center; gap: 10px; background: #9df4e9; color: #062626; border: 1px solid #bdfff4; border-radius: 5px;
  padding: 16px 26px; font-size: 13px; text-decoration: none; box-shadow: 0 0 30px #7be5da22; margin-top: 22px; }
.action:hover { background: #c9fff6; }
.action .icon { width: 16px; height: 16px; }
.action-quiet { background: transparent; color: var(--cyan); border-color: #75d6db66; box-shadow: none; }
.action-quiet:hover { background: #10252c; }
.secondary { display: block; background: none; border: 0; color: #83a8b5; font-size: 12px; margin: 22px auto 0; padding: 10px; text-decoration: underline; text-underline-offset: 4px; }
.secondary-links { display: flex; flex-wrap: wrap; justify-content: inherit; align-items: center; gap: 8px 22px; margin-top: 30px; font-size: 12px; }
.secondary-links a, .secondary-links .text-button { color: #83a8b5; text-decoration: none; display: inline-flex; align-items: center; gap: 7px; font-size: 12px; min-height: 36px; }
.secondary-links a:hover, .secondary-links .text-button:hover { color: #fff; }
.secondary-links .icon { width: 15px; height: 15px; }
.secondary-links form { margin: 0; }
.secondary-links .danger { color: #c79a87; }
.back { display: inline-block; color: #809ca9; font-size: 12px; margin-top: 26px; padding: 10px 0; text-decoration: none; }
.back:hover { color: #fff; }

.quest-view { max-width: 900px; margin: 30px auto 0; text-align: center; }
.quest-view .secondary-links { justify-content: center; }
.progress-block { max-width: 420px; margin: 26px auto 10px; }
.percent { margin: 0; color: var(--color); font-weight: 200; letter-spacing: -2px; line-height: 1; }
.percent strong { font-size: clamp(56px, 7vw, 84px); font-weight: 200; }
.percent span { font-size: 26px; }
.progress-block .subtitle { margin: 8px auto 14px; }
progress { display: block; width: 100%; height: 4px; border: 0; border-radius: 10px; background: #18323d; appearance: none; -webkit-appearance: none; overflow: hidden; }
progress::-webkit-progress-bar { background: #18323d; border-radius: 10px; }
progress::-webkit-progress-value { background: var(--color); border-radius: 10px; box-shadow: 0 0 12px var(--color); }
progress::-moz-progress-bar { background: var(--color); border-radius: 10px; }

details.more { max-width: 560px; margin: 18px auto; text-align: left; }
details.more summary { cursor: pointer; text-align: center; color: #83a8b5; font-size: 12px; padding: 10px; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::after { content: " +"; }
details.more[open] summary::after { content: " −"; }
details.more summary:hover { color: #fff; }
.detail { background: var(--panel-2); border: 1px solid #5fa3b433; border-radius: 12px; margin: 10px 0; padding: 20px 24px; line-height: 1.7; color: #adc5cc; font-size: 14px; }
.detail dt { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: #7f9daa; margin-top: 12px; }
.detail dt:first-child { margin-top: 0; }
.detail dd { margin: 2px 0 0; overflow-wrap: anywhere; }

.path { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 46px 70px; position: relative; margin: 56px 0 30px; padding: 0; }
.path::before { content: ""; position: absolute; top: 43px; left: 18%; right: 18%; height: 1px; background: linear-gradient(90deg, color-mix(in srgb, var(--color) 55%, transparent), #74e7dc11); }
.path li { flex: 0 1 220px; position: relative; }
.node { display: block; color: var(--ink); text-decoration: none; padding: 0 6px; border-radius: 16px; }
.node-icon { display: grid; place-items: center; width: 86px; height: 86px; margin: 0 auto 20px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--color) 40%, transparent);
  box-shadow: 0 0 45px #43cbd91a; background: radial-gradient(circle, #153f4b, #06121f); color: #a6fff6; font-size: 24px; font-weight: 200; }
.node:hover .node-icon, .node:focus-visible .node-icon { box-shadow: 0 0 45px color-mix(in srgb, var(--color) 40%, transparent); }
.node.validated .node-icon { background: radial-gradient(circle, color-mix(in srgb, var(--color) 45%, #06121f), #06121f 75%); border-color: var(--color); color: #fff; }
.node small { display: block; font-size: 10px; letter-spacing: 2px; color: #77939d; text-transform: uppercase; }
.node-title { display: block; font-size: 17px; line-height: 1.5; margin-top: 8px; overflow-wrap: anywhere; }

.focus { max-width: 680px; margin: 6vh auto 0; text-align: center; }
.focus .secondary-links { justify-content: center; }
.focus .portals { text-align: left; margin-top: 30px; }
.focus h1 { font-size: clamp(32px, 4vw, 54px); line-height: 1.15; margin: 26px 0 20px; }
.focus .subtitle { margin-left: auto; margin-right: auto; }
.badge { border: 1px solid color-mix(in srgb, var(--color) 30%, transparent); border-radius: 40px; display: inline-block; padding: 10px 17px; color: color-mix(in srgb, var(--color) 70%, #fff); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; }
.completion { font-size: 54px; color: var(--color); margin: 10px 0 18px; text-shadow: 0 0 30px var(--color); }
.validation { margin: 26px auto 0; }
.validation form { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.validated-note { display: inline-flex; gap: 8px; align-items: center; color: var(--ok); margin: 0; }
.narrow { max-width: 640px; margin: 0 auto; }

.week-group { max-width: 760px; margin: 0 auto 50px; }
.week-group h2 { margin-top: 8px; }
.week-group h2 a { color: var(--ink); text-decoration: none; }
.week-group h2 a:hover { color: var(--cyan); }
.week-group .portal { font-size: 18px; padding: 18px 0; }

/* ---------- Boutons et formulaires (gestion) ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 11px 20px; border-radius: 5px; text-decoration: none; font-size: 14px; }
.btn-primary { background: #9df4e9; color: #062626; border: 1px solid #bdfff4; box-shadow: 0 0 24px #7be5da22; }
.btn-primary:hover { background: #c9fff6; }
.btn-secondary { border: 1px solid #75d6db45; background: #10252c; color: var(--ink); }
.btn-secondary:hover { border-color: var(--cyan); }
.btn-ghost { background: transparent; color: var(--soft); border: 1px solid transparent; }
.text-button { background: transparent; color: var(--cyan); border: 0; padding: 6px 0; min-height: 34px; text-decoration: underline; text-underline-offset: 4px; font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.text-button .icon { width: 15px; height: 15px; }
.text-button.danger { color: var(--danger-ink); }
button:disabled { opacity: .45; cursor: default; }
.inline { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.inline form { margin: 0; }

.messages { margin: 0 auto 22px; padding: 0; list-style: none; max-width: 760px; text-align: center; }
.msg-success { color: var(--ok); padding: 10px 16px; font-size: 13px; border: 1px solid #a0f2d033; border-radius: 30px; display: inline-block; }
.msg-error, .error { color: var(--danger-ink); background: var(--danger-bg); padding: 12px 16px; border-left: 3px solid var(--gold); margin: 12px 0; font-size: 14px; border-radius: 4px; text-align: left; }
.errorlist { list-style: none; margin: 6px 0; padding: 0; color: var(--danger-ink); font-size: 13px; }

.quest, .panel { position: relative; padding: 28px; background: #0b1a24cc; border: 1px solid #5fa3b433; border-radius: 14px; }
.quest-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.quest-list { display: grid; gap: 26px; }
.road-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--cyan); font-size: 12px; margin: 14px 0; }
.road-line span { border: 1px solid var(--line); padding: 5px 10px; border-radius: 30px; overflow-wrap: anywhere; }
.badge-draft { color: var(--gold) !important; border-color: #6a5130 !important; }
.row { padding: 14px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.progress-meta { display: flex; gap: 10px; justify-content: space-between; font-size: 12px; color: var(--soft); }
.quest progress, .panel progress { margin: 10px 0 14px; }
details summary { cursor: pointer; padding: 8px 0; font-size: 13px; color: var(--cyan); }
.empty { padding: 50px 24px; border: 1px dashed #5fa3b444; border-radius: 14px; text-align: center; max-width: 760px; margin: 0 auto; }
.empty .icon { width: 40px; height: 40px; color: var(--cyan); margin-bottom: 10px; }
.draft-list { margin: 0 0 26px; }
.draft-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border: 1px dashed #6a5130; border-radius: 10px; margin-bottom: 10px; flex-wrap: wrap; }

.check-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; font-size: 14px; overflow-wrap: anywhere; cursor: pointer; flex: 1; min-width: 0; }
.check-row input[type=checkbox] { width: 20px; height: 20px; flex-shrink: 0; accent-color: var(--cyan); margin-top: 2px; }
.toggle-form { display: flex; align-items: flex-start; gap: 10px; margin: 0; flex-wrap: wrap; }
.js .toggle-submit { display: none; }
.completed strong { text-decoration: line-through; color: var(--soft); }
.item-actions { display: flex; gap: 16px; flex-wrap: wrap; padding-left: 30px; }
.item-actions form { margin: 0; }
.mission { padding: 10px 0 10px 14px; border-left: 1px solid var(--line); margin: 6px 0; }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 18px 0 30px; padding: 0; list-style: none; }
.steps li { border-top: 2px solid #18323d; padding-top: 10px; font-size: 12px; color: var(--soft); }
.steps li a { color: inherit; text-decoration: none; }
.steps li.done { border-color: #2a6b78; }
.steps li.current { border-color: var(--cyan); color: var(--cyan); }
.steps b { display: inline-grid; place-items: center; border: 1px solid currentColor; width: 24px; height: 24px; border-radius: 50%; margin-right: 6px; font-weight: 400; }
.sphere-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.sphere { display: flex; gap: 14px; align-items: center; background: #0b1a24cc; color: var(--ink); border: 1px solid #5fa3b433; padding: 18px; text-align: left; min-width: 0; border-radius: 12px; width: 100%; }
.sphere .icon { width: 24px; height: 24px; color: var(--cyan); }
.sphere span { overflow-wrap: anywhere; }
button.sphere:hover { border-color: var(--cyan); }
.sphere[aria-pressed="true"] { border-color: var(--cyan); background: #12303d; box-shadow: inset 3px 0 var(--cyan); }
.sphere-card { flex-direction: column; align-items: stretch; }
.sphere-card .sphere-title { display: flex; gap: 12px; align-items: center; }
.draft-context { font-size: 12px; color: var(--soft); border-left: 2px solid var(--cyan); padding-left: 12px; margin-bottom: 18px; overflow-wrap: anywhere; }
.form-actions { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 22px; margin-top: 22px; border-top: 1px solid var(--line); }
.form-actions .right { display: flex; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.entry { display: flex; gap: 14px; align-items: flex-start; padding: 16px 0; border-bottom: 1px solid var(--line); }
.entry-body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.entry p { margin: 4px 0; }
.number { flex-shrink: 0; border: 1px solid var(--line-strong); border-radius: 50%; width: 32px; height: 32px; display: grid; place-items: center; color: var(--cyan); font-size: 13px; }
.number .icon { width: 16px; height: 16px; }
.choice-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; margin: 10px 0 16px; padding: 0; list-style: none; }

.field { display: block; margin: 16px 0; color: var(--ink); font-size: 13px; }
.field small, .field .hint { display: block; color: var(--soft); margin: 3px 0 0; font-size: 12px; text-align: left; letter-spacing: 0; text-transform: none; }
input:not([type=checkbox]):not([type=radio]), textarea, select {
  display: block; width: 100%; min-width: 0; background: #0b1d27; color: var(--ink);
  border: 1px solid #52818b; border-radius: 5px; padding: 13px 14px; font: 16px/1.4 system-ui, sans-serif; margin-top: 8px;
}
textarea { resize: vertical; min-height: 80px; }
input::placeholder, textarea::placeholder { color: #8198a4; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.inline-form { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: end; }
.inline-form input, .inline-form select { margin: 0; }
fieldset { border: 1px solid #5fa3b433; border-radius: 12px; padding: 16px 20px; margin: 18px 0; }
legend { padding: 0 8px; color: var(--cyan); font-size: 13px; }
.status-off { display: inline-flex; gap: 8px; align-items: center; color: var(--gold); border: 1px solid #6a5130; padding: 7px 12px; font-size: 13px; border-radius: 30px; }

/* ---------- Connexion / erreurs ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(ellipse at 50% 80%, #103b49 0, #060d15 65%); }
.login-card { width: min(420px, 100%); background: #0b1a24ee; border: 1px solid #5fa3b444; border-radius: 14px; padding: 32px; position: relative; }
.login-card .brand { display: block; margin-bottom: 6px; }

.mt-s { margin-top: 12px; }
.mt-m { margin-top: 24px; }

/* ---------- Animations ---------- */
@keyframes float { 50% { transform: translateY(-12px); } }
@keyframes enter { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes arrive { from { opacity: 0; scale: 1.45; filter: brightness(1.7) blur(2px); } to { opacity: 1; scale: 1; filter: none; } }

/* ---------- Écrans larges peu hauts ---------- */
@media (min-width: 701px) and (max-height: 800px) {
  .planet-item { --orb: 100px; }
  .primary { --orb: 140px; }
  .planet { gap: 14px; }
  .planet-status { margin-top: -7px; }
  .space { height: 700px; }
  .hero-orb .orb { --size: 240px; }
}

/* ---------- Tablette ---------- */
@media (max-width: 960px) {
  .tagline { display: none; }
  .orbit-ring::after { display: none; }
  .planet-item, .space.crowded .planet-item { width: 150px; }
  .planet { padding: 8px 4px; }
  .sphere-view { grid-template-columns: 1fr; gap: 10px; min-height: 0; }
  .hero-orb { min-height: 300px; }
  .hero-orb .orb { --size: 220px; }
}

/* ---------- Mobile : une sphère majeure à la fois (avec JS), toutes listées sans JS ---------- */
@media (max-width: 700px) {
  .topbar { padding: 18px 20px 10px; gap: 10px; flex-wrap: wrap; }
  .topbar-actions { margin-left: auto; }
  .brand { font-size: 15px; letter-spacing: 4px; }
  .shortcut { font-size: 11px; padding: 10px 13px; white-space: normal; }
  .topbar-actions { gap: 10px; }
  .quiet-link { font-size: 0 !important; }
  .quiet-link .icon { width: 18px; height: 18px; }
  .nav { padding: 0 16px 12px; -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent); mask-image: linear-gradient(90deg, #000 82%, transparent); }
  .main { padding: 24px 20px 40px; }
  h1 { font-size: 30px; }
  .focus h1 { font-size: 32px; }

  .space { height: auto; margin-top: 24px; }
  .orbit-ring { width: 92%; height: 60%; top: 50%; }
  html:not(.js) .orbit-ring { display: none; }
  .planets { display: grid; gap: 34px; justify-items: center; }
  .planet-item, .space.dense .planet-item { position: static; transform: none; width: 260px; margin: 0; }
  .space.dense .planet-item:nth-child(even) { margin-top: 0; }
  .planet .orb, .space.dense .orb, .space.crowded .orb { --size: 150px; }
  .space.crowded .planet-item { width: 260px; }
  .planet-name { font-size: 18px; }
  .planet-status { margin-top: -9px; }

  .js .space { min-height: 360px; display: grid; place-items: center; }
  .js .planet-item:not(.is-current) { display: none; }
  .js .planet-item.is-current .orb { --size: 210px; }
  .js .orbit-controls:not([hidden]) { display: flex; align-items: center; justify-content: center; gap: 34px; margin: 8px 0 10px; }
  .orbit-controls button { background: #10232e; border: 1px solid #335965; border-radius: 50%; width: 48px; height: 48px; color: #b0e9e5; font-size: 18px; }
  .orbit-status { font-size: 11px; letter-spacing: 2px; color: #7f9daa; min-width: 4em; text-align: center; }
  .hint { font-size: 9px; line-height: 1.8; }

  .hero-orb { min-height: 250px; overflow-x: clip; }
  .hero-orb .orb { --size: 180px; }
  .portal { font-size: 19px; }
  .path { flex-direction: column; align-items: center; gap: 34px; margin: 40px 0; }
  .path::before { top: 40px; bottom: 40px; left: 50%; right: auto; width: 1px; height: auto; background: linear-gradient(color-mix(in srgb, var(--color) 50%, transparent), transparent); }
  .path li { flex: none; width: 100%; max-width: 300px; }
  .node-icon { width: 72px; height: 72px; position: relative; }
  .node-title { font-size: 16px; }
  .focus { margin-top: 3vh; }

  .sphere-grid, .two-col, .choice-list { grid-template-columns: 1fr; }
  .inline-form { grid-template-columns: 1fr; }
  .quest, .panel { padding: 18px; }
  .quest-head { display: block; }
  .quest-head .inline { margin-top: 10px; }
  .item-actions { padding-left: 0; }
  .steps { gap: 5px; }
  .steps b { display: grid; margin-bottom: 6px; }
  .steps li { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Positions d'orbite (générées) : centres d'orbes sur une ellipse centrée à 47.1 %, rx 40.0 %, ry 35.1 % de la hauteur.
   Nombre pair : départ symétrique, aucune planète à l'aplomb de la planète centrale (son nom long dessous).
   Nombre impair : une planète en haut, assez haute pour que son nom passe au-dessus de la planète centrale.
   Valeurs de base associées : .space 820px, .primary top 46.0 %, .orbit-ring top 47.1 % / hauteur 70.2 %. */
.ring-1-0 { left: 50.0%; top: 12.0%; }
.ring-2-0 { left: 90.0%; top: 47.1%; } .ring-2-1 { left: 10.0%; top: 47.1%; }
.ring-3-0 { left: 50.0%; top: 12.0%; } .ring-3-1 { left: 84.6%; top: 64.7%; } .ring-3-2 { left: 15.4%; top: 64.7%; }
.ring-4-0 { left: 78.3%; top: 22.3%; } .ring-4-1 { left: 78.3%; top: 71.9%; } .ring-4-2 { left: 21.7%; top: 71.9%; } .ring-4-3 { left: 21.7%; top: 22.3%; }
.ring-5-0 { left: 50.0%; top: 12.0%; } .ring-5-1 { left: 88.0%; top: 36.3%; } .ring-5-2 { left: 73.5%; top: 75.5%; } .ring-5-3 { left: 26.5%; top: 75.5%; } .ring-5-4 { left: 12.0%; top: 36.3%; }
.ring-6-0 { left: 70.0%; top: 16.7%; } .ring-6-1 { left: 90.0%; top: 47.1%; } .ring-6-2 { left: 70.0%; top: 77.5%; } .ring-6-3 { left: 30.0%; top: 77.5%; } .ring-6-4 { left: 10.0%; top: 47.1%; } .ring-6-5 { left: 30.0%; top: 16.7%; }
.ring-7-0 { left: 50.0%; top: 12.0%; } .ring-7-1 { left: 81.3%; top: 25.2%; } .ring-7-2 { left: 89.0%; top: 54.9%; } .ring-7-3 { left: 67.4%; top: 78.7%; } .ring-7-4 { left: 32.6%; top: 78.7%; } .ring-7-5 { left: 11.0%; top: 54.9%; } .ring-7-6 { left: 18.7%; top: 25.2%; }
.ring-8-0 { left: 65.3%; top: 14.7%; } .ring-8-1 { left: 87.0%; top: 33.7%; } .ring-8-2 { left: 87.0%; top: 60.5%; } .ring-8-3 { left: 65.3%; top: 79.5%; } .ring-8-4 { left: 34.7%; top: 79.5%; } .ring-8-5 { left: 13.0%; top: 60.5%; } .ring-8-6 { left: 13.0%; top: 33.7%; } .ring-8-7 { left: 34.7%; top: 14.7%; }
.ring-9-0 { left: 50.0%; top: 12.0%; } .ring-9-1 { left: 75.7%; top: 20.2%; } .ring-9-2 { left: 89.4%; top: 41.0%; } .ring-9-3 { left: 84.6%; top: 64.7%; } .ring-9-4 { left: 63.7%; top: 80.1%; } .ring-9-5 { left: 36.3%; top: 80.1%; } .ring-9-6 { left: 15.4%; top: 64.7%; } .ring-9-7 { left: 10.6%; top: 41.0%; } .ring-9-8 { left: 24.3%; top: 20.2%; }
.ring-10-0 { left: 62.4%; top: 13.7%; } .ring-10-1 { left: 82.4%; top: 26.5%; } .ring-10-2 { left: 90.0%; top: 47.1%; } .ring-10-3 { left: 82.4%; top: 67.7%; } .ring-10-4 { left: 62.4%; top: 80.5%; } .ring-10-5 { left: 37.6%; top: 80.5%; } .ring-10-6 { left: 17.6%; top: 67.7%; } .ring-10-7 { left: 10.0%; top: 47.1%; } .ring-10-8 { left: 17.6%; top: 26.5%; } .ring-10-9 { left: 37.6%; top: 13.7%; }
.ring-11-0 { left: 50.0%; top: 12.0%; } .ring-11-1 { left: 71.6%; top: 17.6%; } .ring-11-2 { left: 86.4%; top: 32.5%; } .ring-11-3 { left: 89.6%; top: 52.1%; } .ring-11-4 { left: 80.2%; top: 70.1%; } .ring-11-5 { left: 61.3%; top: 80.8%; } .ring-11-6 { left: 38.7%; top: 80.8%; } .ring-11-7 { left: 19.8%; top: 70.1%; } .ring-11-8 { left: 10.4%; top: 52.1%; } .ring-11-9 { left: 13.6%; top: 32.5%; } .ring-11-10 { left: 28.4%; top: 17.6%; }
