/* NeuroQuest — site vitrine, légal et assistance.
   Valeurs alignées sur le design system du jeu « casual magique »
   (docs/design/DESIGN_SYSTEM.md, game/scripts/ui/design_tokens.gd). */

:root {
  --violet: #7B5CFF;
  --violet-dark: #4B32C3;
  --violet-light: #B9A8FF;
  --night: #3B23A8;
  --dusk: #8A5CFF;
  --deep: #241466;
  --green: #2FD36B;
  --green-dark: #1C9A4A;
  --gold: #FFC83D;
  --gold-dark: #D9921A;
  --gold-light: #FFE89A;
  --heart: #FF5A6E;
  --hint: #3FB6FF;
  --cream: #FFF8EC;
  --cream-border: #E9D9B8;
  --cream-inset: #F3E7CF;
  --ink: #2B2140;
  --ink-muted: #6B5F84;
  --white: #FFFFFF;

  --font-display: "Fredoka", "Nunito", ui-rounded, system-ui, sans-serif;
  --font-body: "Nunito", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 1120px;
  --gutter: 20px;

  /* Contour sombre « jeu casual » autour du texte blanc (DS §3). */
  --outline-s:
    1.5px 0 0 var(--ink), -1.5px 0 0 var(--ink), 0 1.5px 0 var(--ink), 0 -1.5px 0 var(--ink),
    1px 1px 0 var(--ink), -1px 1px 0 var(--ink), 1px -1px 0 var(--ink), -1px -1px 0 var(--ink),
    0 3px 0 var(--ink);
  --outline-m:
    2.5px 0 0 var(--ink), -2.5px 0 0 var(--ink), 0 2.5px 0 var(--ink), 0 -2.5px 0 var(--ink),
    1.8px 1.8px 0 var(--ink), -1.8px 1.8px 0 var(--ink), 1.8px -1.8px 0 var(--ink), -1.8px -1.8px 0 var(--ink),
    0 5px 0 var(--ink), 2px 4.5px 0 var(--ink), -2px 4.5px 0 var(--ink);
  --outline-l:
    4px 0 0 var(--ink), 3.7px 1.5px 0 var(--ink), 2.8px 2.8px 0 var(--ink), 1.5px 3.7px 0 var(--ink),
    0 4px 0 var(--ink), -1.5px 3.7px 0 var(--ink), -2.8px 2.8px 0 var(--ink), -3.7px 1.5px 0 var(--ink),
    -4px 0 0 var(--ink), -3.7px -1.5px 0 var(--ink), -2.8px -2.8px 0 var(--ink), -1.5px -3.7px 0 var(--ink),
    0 -4px 0 var(--ink), 1.5px -3.7px 0 var(--ink), 2.8px -2.8px 0 var(--ink), 3.7px -1.5px 0 var(--ink),
    0 8px 0 var(--ink), 3px 7px 0 var(--ink), -3px 7px 0 var(--ink);

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--violet-dark); text-underline-offset: 3px; text-decoration-thickness: 2px; }
a:hover { color: var(--violet); }
p { margin: 0 0 1em; }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 8px;
}

.nowrap { white-space: nowrap; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: 12px; top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--gold);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  border-radius: 12px;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.icon { width: 1.2em; height: 1.2em; flex: none; fill: currentColor; }

/* ---------- Typo ---------- */

.display,
.h-section {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.005em;
  margin: 0;
}

.display {
  font-size: clamp(2.35rem, 1.4rem + 4.6vw, 4.1rem);
  line-height: 1.04;
  color: var(--white);
  text-shadow: var(--outline-l);
  text-wrap: balance;
}
.display .line { display: block; text-wrap: balance; }

.h-section {
  font-size: clamp(1.9rem, 1.35rem + 2.4vw, 2.75rem);
  line-height: 1.1;
  text-wrap: balance;
}

.on-sky .h-section {
  color: var(--white);
  text-shadow: var(--outline-m);
}

.on-cream .h-section { color: var(--violet-dark); }

.lead {
  font-size: clamp(1.08rem, 1rem + 0.35vw, 1.25rem);
  line-height: 1.55;
  max-width: 38em;
}

/* ---------- Boutons « chunky 3D » (DS §5) ---------- */

.btn {
  --btn-top: #5FE48F;
  --btn-face: var(--green);
  --btn-edge: var(--green-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  min-height: 56px;
  padding: 0 1.4em;
  border: 0;
  border-radius: 18px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--white);
  text-decoration: none;
  text-shadow: var(--outline-s);
  background-color: var(--btn-face);
  background-image: linear-gradient(180deg, var(--btn-top) 0%, var(--btn-face) 58%);
  box-shadow: 0 6px 0 var(--btn-edge), 0 12px 22px rgba(24, 10, 70, 0.28);
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { color: var(--white); filter: brightness(1.06); transform: translateY(-1px); }
.btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--btn-edge), 0 4px 10px rgba(24, 10, 70, 0.22);
}
.btn .icon { width: 1.05em; height: 1.05em; filter: drop-shadow(0 2px 0 var(--ink)); }

.btn--violet { --btn-top: #9C85FF; --btn-face: var(--violet); --btn-edge: var(--violet-dark); }
.btn--gold { --btn-top: #FFDB75; --btn-face: #F7B52C; --btn-edge: var(--gold-dark); }
.btn--small { min-height: 44px; padding: 0 1em; font-size: 1.05rem; border-radius: 14px; box-shadow: 0 4px 0 var(--btn-edge); }
.btn--small:active { box-shadow: 0 1px 0 var(--btn-edge); transform: translateY(3px); }

/* Boutons stores : sobres, sombres (codes visuels des badges officiels). */
.stores { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
@media (min-width: 960px) { .hero__copy .stores { justify-content: flex-start; } }

.store {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 188px;
  min-height: 60px;
  padding: 8px 18px 8px 14px;
  border-radius: 16px;
  border: 2px solid rgba(255, 255, 255, 0.22);
  background: var(--ink);
  color: var(--white);
  text-decoration: none;
  box-shadow: 0 5px 0 #150d2a;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.store:hover { color: var(--white); transform: translateY(-1px); }
a.store:active { transform: translateY(3px); box-shadow: 0 2px 0 #150d2a; }
.store .icon { width: 28px; height: 28px; }
.store__text { display: flex; flex-direction: column; line-height: 1.15; }
.store__small { font-size: 0.78rem; font-weight: 700; opacity: 0.85; }
.store__name { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; }
.store--soon { cursor: default; box-shadow: 0 5px 0 #150d2a; }
.store--soon:hover { transform: none; }
.store--soon .store__small { color: var(--gold-light); opacity: 1; }

/* ---------- En-tête ---------- */

.site-header { position: relative; z-index: 10; color: var(--white); }
.page-home .site-header { position: absolute; top: 0; left: 0; right: 0; }

.nav {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 76px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.45rem;
  text-shadow: var(--outline-s);
}
.brand:hover { color: var(--white); }
.brand img {
  width: 40px; height: 40px;
  border-radius: 11px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85), 0 4px 0 var(--ink);
}

.nav__links {
  display: none;
  margin: 0 0 0 auto;
  padding: 0;
  list-style: none;
  gap: 4px;
}
.nav__links a {
  display: block;
  padding: 8px 12px;
  border-radius: 12px;
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.05rem;
  text-decoration: none;
}
.nav__links a:hover { background: rgba(255, 255, 255, 0.14); color: var(--white); }
.nav__links a[aria-current="page"] { background: rgba(255, 255, 255, 0.18); }

.nav__tools { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.nav__links + .nav__tools { margin-left: 8px; }

.lang {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
}
.lang:hover { background: rgba(255, 255, 255, 0.14); color: var(--white); }

@media (min-width: 900px) {
  .nav__links { display: flex; }
  .nav__tools { margin-left: 8px; }
}

/* ---------- Ciel violet (DS : dégradé écrans menu) ---------- */

.sky {
  position: relative;
  color: var(--white);
  background-color: var(--night);
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, rgba(255, 255, 255, 0.85) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 78% 9%, rgba(255, 255, 255, 0.7) 50%, transparent 51%),
    radial-gradient(2px 2px at 64% 31%, rgba(255, 232, 154, 0.9) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 33% 41%, rgba(255, 255, 255, 0.6) 50%, transparent 51%),
    radial-gradient(2px 2px at 90% 47%, rgba(255, 255, 255, 0.75) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 6% 63%, rgba(255, 232, 154, 0.8) 50%, transparent 51%),
    linear-gradient(180deg, var(--night) 0%, #5A3BD6 55%, var(--dusk) 100%);
}

/* ---------- Hero ---------- */

.hero { padding: 92px 0 72px; overflow: hidden; }

.hero__grid {
  display: grid;
  gap: 40px;
  align-items: center;
}

.hero__copy { text-align: center; }
.hero__copy .lead { margin: 22px auto 30px; color: #F4F0FF; text-shadow: 0 2px 0 rgba(43, 33, 64, 0.35); }

.hero__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.promises {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}
.promises li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px 5px 7px;
  border-radius: 999px;
  background: rgba(23, 10, 70, 0.42);
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  font-weight: 800;
  font-size: 0.9rem;
}
.promises .icon { width: 20px; height: 20px; color: var(--green); }

.hero__art {
  position: relative;
  min-height: 560px;
  display: flex;
  justify-content: center;
}

@media (min-width: 960px) {
  .hero { padding: 108px 0 96px; }
  .hero__grid { grid-template-columns: 1.08fr 0.92fr; gap: 32px; }
  .hero__copy { text-align: left; }
  .hero__copy .lead { margin-left: 0; }
  .hero__actions { align-items: flex-start; }
  .promises { justify-content: flex-start; }
  .hero__art { min-height: 640px; }
}

/* ---------- Téléphones (maquettes) ---------- */

.phone {
  position: relative;
  width: 290px;
  aspect-ratio: 290 / 600;
  padding: 11px;
  border-radius: 46px;
  background: linear-gradient(160deg, #3A2D5C, var(--ink) 40%, #1B1330);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.16) inset,
    0 10px 0 #150d2a,
    0 30px 60px rgba(14, 4, 50, 0.45);
}
.phone::before {
  content: "";
  position: absolute;
  top: 20px; left: 50%;
  width: 84px; height: 22px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #0E0820;
  z-index: 3;
}
.phone__screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 36px;
  background: var(--night);
}
.phone__screen > img { width: 100%; height: 100%; object-fit: cover; }

.hero__art .phone--map { z-index: 2; transform: rotate(3deg); }
.hero__art .phone--puzzle {
  position: absolute;
  z-index: 1;
  width: 250px;
  top: 64px;
  left: 50%;
  margin-left: -250px;
  transform: rotate(-9deg);
  opacity: 0.98;
}
.hero__art .phone--map { margin-left: 200px; }

@media (max-width: 480px) {
  .stores { flex-wrap: nowrap; width: 100%; }
  .store { flex: 1 1 0; min-width: 0; gap: 8px; padding: 8px 10px; }
  .store .icon { width: 24px; height: 24px; }
  .store__small { font-size: 0.7rem; }
  .store__name { font-size: 1.08rem; }
  .hero__art { min-height: 500px; }
  .phone { width: 250px; border-radius: 40px; }
  .phone__screen { border-radius: 31px; }
  .hero__art .phone--map { margin-left: 86px; }
  .hero__art .phone--puzzle { width: 214px; margin-left: -206px; top: 54px; }
}

/* Maquette : carte du monde (Japon d'Edo, palette « jour »). */
.mock-map {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #FFE3EA 0%, #FFC2D3 46%, #FFB0C6 100%);
}
.mock-map__scene { position: absolute; inset: 0; width: 100%; height: 100%; }

.mock-hud {
  position: absolute;
  top: 46px; left: 0; right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
  z-index: 2;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px 3px 5px;
  border-radius: 999px;
  background: rgba(26, 15, 61, 0.62);
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  text-shadow: 0 1.5px 0 var(--ink);
}
.pill svg { width: 18px; height: 18px; }

.mock-ribbon {
  position: absolute;
  top: 84px; left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  padding: 5px 18px 6px;
  border-radius: 10px;
  background: linear-gradient(180deg, #957BFF, var(--violet));
  box-shadow: 0 4px 0 var(--violet-dark);
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  white-space: nowrap;
  text-shadow: var(--outline-s);
}

.mock-play {
  position: absolute;
  left: 50%; bottom: 26px;
  transform: translateX(-50%);
  z-index: 2;
  min-height: 46px;
  padding: 0 34px;
  font-size: 1.15rem;
  border-radius: 15px;
  box-shadow: 0 5px 0 var(--green-dark);
  pointer-events: none;
}

/* Maquette : sudoku en kanjis dans une carte crème. */
.mock-puzzle {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 58px 14px 18px;
  background: linear-gradient(180deg, var(--night), var(--dusk));
}
.mock-puzzle .mock-ribbon { position: relative; top: auto; left: auto; transform: none; margin-bottom: -14px; z-index: 3; font-size: 0.95rem; }
.mock-card {
  width: 100%;
  padding: 24px 12px 14px;
  border-radius: 20px;
  background: var(--cream);
  border: 3px solid var(--cream-border);
  box-shadow: 0 5px 0 rgba(23, 10, 70, 0.35);
}
.mock-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  padding: 4px;
  border-radius: 12px;
  background: var(--violet);
}
.mock-grid span {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 7px;
  background: var(--white);
  color: var(--violet-dark);
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", "Noto Sans JP", serif;
  font-weight: 700;
  font-size: 1.3rem;
  line-height: 1;
}
.mock-grid .g { background: #EDE6FF; color: var(--ink); }
.mock-grid .r { background: #F6F0FF; }
.mock-grid .s { background: var(--gold-light); box-shadow: inset 0 0 0 3px var(--gold); }
.mock-grid span:nth-child(4n + 2) { margin-right: 2px; }
.mock-grid span:nth-child(n + 5):nth-child(-n + 8) { margin-bottom: 2px; }
.mock-pad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 12px;
}
.mock-pad span {
  display: grid;
  place-items: center;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(180deg, #9C85FF, var(--violet) 60%);
  box-shadow: 0 4px 0 var(--violet-dark);
  color: var(--white);
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  font-weight: 700;
  font-size: 1.1rem;
  text-shadow: 0 1.5px 0 var(--ink);
}
.mock-stars {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
}
.mock-stars svg { width: 30px; height: 30px; }
.mock-stars svg:nth-child(2) { transform: translateY(-6px) scale(1.15); }

/* Animation d'arrivée : le chemin se dessine, les étapes s'allument. */
@media (prefers-reduced-motion: no-preference) {
  .js .path-draw {
    stroke-dasharray: 900;
    stroke-dashoffset: 900;
    animation: draw 1.6s 0.25s cubic-bezier(0.6, 0.05, 0.3, 1) forwards;
  }
  .js .node-pop {
    transform-box: fill-box;
    transform-origin: center;
    animation: pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  }
  .js .node-pop:nth-of-type(1) { animation-delay: 0.5s; }
  .js .node-pop:nth-of-type(2) { animation-delay: 0.8s; }
  .js .node-pop:nth-of-type(3) { animation-delay: 1.1s; }
  .js .node-pop:nth-of-type(4) { animation-delay: 1.4s; }
  .js .node-here { animation: glow 2.4s 2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { from { transform: scale(0.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes glow { 0%, 100% { transform: scale(1); opacity: 0.55; } 50% { transform: scale(1.18); opacity: 0.15; } }

/* ---------- Sections ---------- */

.section { padding: 80px 0; }
.section__head { max-width: 720px; margin: 0 auto 48px; text-align: center; }
.section__head .lead { margin: 16px auto 0; }
.on-sky .section__head .lead { color: #F1ECFF; }
.on-cream .section__head .lead { color: var(--ink-muted); }

.on-cream { background: var(--cream); }

@media (min-width: 900px) {
  .section { padding: 112px 0; }
}

/* ---------- Le voyage : chemin sinueux des 18 mondes ---------- */

.journey {
  padding: 0 0 96px;
  background-image: linear-gradient(180deg, var(--dusk) 0%, #6E4BF0 50%, var(--night) 100%);
}
.journey .section__head { padding-top: 24px; }

.trail-wrap { position: relative; max-width: 880px; margin: 0 auto; }

.trail {
  --node: 64px;
  --x-left: 16%;
  --x-right: 84%;
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: world;
}

.stop {
  position: relative;
  display: grid;
  align-items: center;
  min-height: 150px;
}
.stop + .stop { margin-top: 56px; }

/* Chemin sinueux (tracé par site.js d'après la position des étapes). */
.trail__path {
  position: absolute;
  top: 0; left: 0;
  z-index: 0;
  overflow: visible;
  pointer-events: none;
}
.trail__road { fill: none; stroke: rgba(36, 20, 102, 0.45); stroke-width: 26; stroke-linecap: round; }
.trail__dash { fill: none; stroke: var(--cream); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 2 16; }

.stop__node {
  position: absolute;
  top: 50%;
  width: var(--node);
  height: var(--node);
  margin: calc(var(--node) / -2) 0 0 calc(var(--node) / -2);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--world, var(--violet));
  border: 4px solid var(--white);
  box-shadow: 0 6px 0 var(--ink), 0 12px 24px rgba(14, 4, 50, 0.35);
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.6rem;
  text-shadow: var(--outline-s);
  z-index: 2;
}
.stop__node::before { counter-increment: world; content: counter(world); }

.stop:nth-of-type(odd) .stop__node { left: var(--x-left); }
.stop:nth-of-type(even) .stop__node { left: var(--x-right); }

.stop__card {
  position: relative;
  z-index: 1;
  width: calc(100% - var(--x-left) - var(--node) / 2 - 18px);
  padding: 18px 20px 18px 22px;
  border-radius: 22px;
  background: var(--cream);
  border: 4px solid var(--cream-border);
  box-shadow: 0 6px 0 rgba(23, 10, 70, 0.4);
  color: var(--ink);
}
.stop:nth-of-type(odd) .stop__card { margin-left: auto; }
.stop:nth-of-type(even) .stop__card { margin-right: auto; }

.stop__card::before {
  content: "";
  position: absolute;
  top: 14px; bottom: 14px;
  left: -4px;
  width: 7px;
  border-radius: 0 6px 6px 0;
  background: var(--world, var(--violet));
}

.stop__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  line-height: 1.15;
  color: var(--ink);
}
.stop__era { margin: 2px 0 8px; color: var(--ink-muted); font-weight: 700; font-size: 0.98rem; }
.stop__new {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.stop__new li {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--cream-inset);
  font-size: 0.88rem;
  font-weight: 800;
}

@media (min-width: 720px) {
  .trail { --node: 80px; --x-left: 22%; --x-right: 78%; }
  .stop { min-height: 170px; }
  .stop + .stop { margin-top: 40px; }
  .stop__node { font-size: 2rem; }
  .stop__card { width: min(420px, calc(100% - var(--x-left) - 64px)); padding: 22px 26px; }
  .stop:nth-of-type(odd) .stop__card { margin-left: calc(var(--x-left) + 64px); }
  .stop:nth-of-type(even) .stop__card { margin-right: calc(100% - var(--x-right) + 64px); margin-left: auto; }
}

.trail-end {
  margin: 56px auto 0;
  max-width: 34em;
  text-align: center;
  color: #F1ECFF;
}

/* ---------- Casse-têtes ---------- */

.families {
  display: grid;
  gap: 22px;
}
@media (min-width: 700px) { .families { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1060px) { .families { grid-template-columns: repeat(4, 1fr); } }

.family {
  --fam: var(--violet);
  --fam-edge: var(--violet-dark);
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  background: var(--white);
  border: 4px solid var(--cream-border);
  box-shadow: 0 6px 0 var(--cream-border);
  overflow: hidden;
}
.family--gold { --fam: #F7B52C; --fam-edge: var(--gold-dark); }
.family--hint { --fam: var(--hint); --fam-edge: #1F7FC4; }
.family--heart { --fam: var(--heart); --fam-edge: #C93A4D; }

.family__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: var(--fam);
  box-shadow: inset 0 -5px 0 var(--fam-edge);
  color: var(--white);
}
.family__head svg { width: 44px; height: 44px; flex: none; }
.family__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  line-height: 1.15;
  text-shadow: var(--outline-s);
}
.family__body { padding: 16px 18px 20px; }
.family__body p { margin: 0 0 14px; color: var(--ink-muted); font-size: 0.98rem; }

.tiles { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tiles li {
  padding: 5px 11px 6px;
  border-radius: 10px;
  background: var(--cream);
  border: 2px solid var(--cream-border);
  box-shadow: 0 3px 0 var(--cream-border);
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1.25;
}

.puzzles-note { margin: 36px auto 0; max-width: 40em; text-align: center; color: var(--ink-muted); }

/* ---------- Zen ---------- */

.zen { background-image: linear-gradient(180deg, var(--night) 0%, var(--deep) 100%); }

.vows {
  display: grid;
  gap: 18px;
  margin: 0 0 56px;
  padding: 0;
  list-style: none;
}
@media (min-width: 820px) { .vows { grid-template-columns: repeat(3, 1fr); gap: 22px; } }

.vow {
  padding: 26px 24px 24px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.07);
  border: 2px solid rgba(255, 255, 255, 0.16);
}
.vow__mark {
  display: grid;
  place-items: center;
  width: 58px; height: 58px;
  margin-bottom: 16px;
  border-radius: 18px;
  background: var(--cream);
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.35);
}
.vow__mark svg { width: 34px; height: 34px; }
@media (max-width: 819px) {
  .vow { display: grid; grid-template-columns: 58px 1fr; column-gap: 16px; align-items: start; padding: 20px; }
  .vow__mark { grid-row: span 2; margin: 0; }
}
.vow h3 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--white);
  text-shadow: var(--outline-s);
}
.vow p { margin: 0; color: #E4DDFF; }

.extras__title {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.45rem;
  text-align: center;
  color: var(--white);
  text-shadow: var(--outline-s);
}

.extras {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 700px) { .extras { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1060px) { .extras { grid-template-columns: repeat(3, 1fr); } }

.extra {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  border-radius: 20px;
  background: var(--cream);
  color: var(--ink);
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.3);
}
.extra svg { width: 40px; height: 40px; flex: none; }
.extra strong { display: block; font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; line-height: 1.2; }
.extra span { display: block; color: var(--ink-muted); font-size: 0.95rem; line-height: 1.45; margin-top: 2px; }

/* ---------- FAQ (accordéons crème) ---------- */

.faq { max-width: 780px; margin: 0 auto; }
.faq__title {
  margin: 48px 0 20px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.7rem;
  line-height: 1.2;
  text-align: center;
  color: var(--violet-dark);
}
.faq-group + .faq-group { margin-top: 40px; }
.faq-group__title {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--violet-dark);
}

.qa {
  margin: 0 0 12px;
  border-radius: 18px;
  background: var(--white);
  border: 3px solid var(--cream-border);
  box-shadow: 0 4px 0 var(--cream-border);
}
.qa summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  min-height: 56px;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.12rem;
  line-height: 1.3;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after {
  content: "";
  flex: none;
  width: 28px; height: 28px;
  margin-left: auto;
  border-radius: 9px;
  background: var(--violet) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 5v14M5 12h14' stroke='white' stroke-width='3.2' stroke-linecap='round'/%3E%3C/svg%3E") center / 18px no-repeat;
  box-shadow: 0 3px 0 var(--violet-dark);
  transition: transform 0.2s ease;
}
.qa[open] summary::after { transform: rotate(45deg); }
.qa summary:hover { color: var(--violet-dark); }
.qa__a { padding: 0 18px 18px; }
.qa__a p:last-child, .qa__a ul:last-child, .qa__a ol:last-child { margin-bottom: 0; }
.qa__a ul, .qa__a ol { padding-left: 1.2em; margin: 0 0 1em; }
.qa__a li + li { margin-top: 4px; }

.faq-more { margin-top: 28px; text-align: center; }

/* Chemins de menus du jeu (Réglages → Données). */
.path {
  display: inline;
  padding: 1px 7px 2px;
  border-radius: 7px;
  background: #EDE6FF;
  color: var(--violet-dark);
  font-weight: 800;
  white-space: nowrap;
}

/* ---------- Appel final ---------- */

.finale { text-align: center; overflow: hidden; }
.finale .h-section { max-width: 15em; margin: 0 auto; }
.finale .lead { margin: 18px auto 30px; color: #F1ECFF; }
.finale .hero__actions { align-items: center; }
.finale .stores { justify-content: center; }
.finale .avail { margin: 20px auto 0; max-width: 34em; font-size: 0.95rem; color: #E4DDFF; }

/* ---------- Pied de page ---------- */

.site-footer {
  padding: 56px 0 40px;
  background: #1C1233;
  color: #D9D1EE;
  font-size: 0.98rem;
}
.footer__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 20px; }
.footer__about { grid-column: 1 / -1; }
@media (min-width: 820px) {
  .footer__grid { grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
  .footer__about { grid-column: auto; }
}
.footer__about p { max-width: 30em; margin-top: 14px; color: #BFB4DB; }
.footer__col h2 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--white);
}
.footer__col ul { margin: 0; padding: 0; list-style: none; }
.footer__col li + li { margin-top: 2px; }
.footer__col a {
  display: inline-block;
  padding: 6px 0;
  color: #D9D1EE;
  text-decoration: none;
}
.footer__col a:hover { color: var(--gold-light); text-decoration: underline; }
.footer__legal {
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: #A99DC8;
  font-size: 0.9rem;
}
.footer__legal p { margin: 0; }

/* ---------- Pages document (légal, assistance) : popup « carte + ruban » ---------- */

.doc-sky { padding-bottom: 120px; }
.doc-sky__intro { padding: 28px 0 0; text-align: center; }
.doc-sky__intro p { margin: 10px auto 0; max-width: 34em; color: #F1ECFF; }

.sheet-wrap { margin-top: -84px; padding-bottom: 88px; }
@media (max-width: 520px) { .sheet-wrap > .wrap { padding: 0 10px; } }

.sheet {
  position: relative;
  max-width: 860px;
  margin: 0 auto;
  padding: 60px 18px 36px;
  border-radius: 28px;
  background: var(--cream);
  border: 4px solid var(--cream-border);
  box-shadow: 0 8px 0 var(--cream-border), 0 26px 50px rgba(36, 20, 102, 0.18);
}
@media (min-width: 760px) { .sheet { padding: 76px 64px 56px; } }

.ribbon {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 8px);
  margin: 0;
  padding: 12px 30px 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, #957BFF, var(--violet) 70%);
  box-shadow: 0 6px 0 var(--violet-dark), 0 12px 20px rgba(36, 20, 102, 0.25);
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.3rem, 1rem + 1.6vw, 2rem);
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
  text-shadow: var(--outline-m);
}
.ribbon::before, .ribbon::after {
  content: "";
  position: absolute;
  top: 14px;
  width: 26px;
  height: 100%;
  background: var(--violet-dark);
  z-index: -1;
}
.ribbon::before { left: -16px; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 38% 50%); }
.ribbon::after { right: -16px; clip-path: polygon(0 0, 100% 0, 62% 50%, 100% 100%, 0 100%); }

.doc-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  margin: 0 0 28px;
  color: var(--ink-muted);
  font-size: 0.95rem;
  text-align: center;
}

.tldr {
  margin: 0 0 36px;
  padding: 20px 22px;
  border-radius: 20px;
  background: #FFF0C2;
  border: 3px solid var(--gold);
  box-shadow: 0 5px 0 var(--gold-dark);
}
.tldr h2 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--ink);
}
.tldr ul { margin: 0; padding: 0; list-style: none; }
.tldr li { position: relative; padding-left: 30px; }
.tldr li + li { margin-top: 6px; }
.tldr li::before {
  content: "";
  position: absolute;
  left: 0; top: 4px;
  width: 20px; height: 20px;
  border-radius: 6px;
  background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 15px no-repeat;
  box-shadow: 0 2px 0 var(--green-dark);
}

.toc {
  margin: 0 0 40px;
  padding: 18px 22px;
  border-radius: 18px;
  background: var(--cream-inset);
}
.toc h2 { margin: 0 0 8px; font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; }
.prose .tldr h2, .prose .toc h2 { margin-top: 0; }
.prose .toc h2 { font-size: 1.2rem; color: var(--ink); }
.toc ol { margin: 0; padding-left: 1.4em; columns: 1; }
@media (min-width: 760px) { .toc ol { columns: 2; column-gap: 36px; } }
.toc li { break-inside: avoid; padding: 2px 0; }
.toc a { text-decoration: none; font-weight: 700; }
.toc a:hover { text-decoration: underline; }

.prose { max-width: 70ch; margin: 0 auto; }
.prose h2 {
  margin: 44px 0 12px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.55rem;
  line-height: 1.2;
  color: var(--violet-dark);
  scroll-margin-top: 20px;
}
.prose h3 {
  margin: 26px 0 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--ink);
}
.prose ul, .prose ol { margin: 0 0 1em; padding-left: 1.25em; }
.prose li + li { margin-top: 6px; }
.prose strong { font-weight: 800; }
.prose .note {
  padding: 16px 18px;
  border-radius: 16px;
  background: #EDE6FF;
  border-left: 6px solid var(--violet);
}
.prose .note p:last-child { margin-bottom: 0; }

.table-wrap { overflow-x: auto; margin: 0 0 1.2em; }
.prose table {
  width: 100%;
  min-width: 520px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.97rem;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid var(--cream-border);
}
.prose th, .prose td { padding: 10px 12px; text-align: left; vertical-align: top; }
.prose th { background: var(--violet); color: var(--white); font-family: var(--font-display); font-weight: 600; }
.prose td { background: var(--white); border-top: 2px solid var(--cream-inset); }

.doc-foot {
  margin-top: 44px;
  padding-top: 22px;
  border-top: 2px dashed var(--cream-border);
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

/* ---------- Assistance ---------- */

.contact {
  margin: 0 0 40px;
  padding: 22px;
  border-radius: 22px;
  background: var(--white);
  border: 3px solid var(--cream-border);
  box-shadow: 0 5px 0 var(--cream-border);
  text-align: center;
}
.contact h2 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.45rem;
  color: var(--violet-dark);
}
.contact > p { color: var(--ink-muted); margin: 0 auto 20px; max-width: 34em; }
.contact__actions { display: grid; gap: 16px; }
.contact__actions .btn { font-size: 1.12rem; padding: 0 0.9em; }
@media (min-width: 760px) { .contact__actions { grid-template-columns: repeat(3, 1fr); gap: 12px; } }
.contact__email { margin: 18px 0 0 !important; font-size: 0.98rem; }

.checklist { margin: 0 0 1em; padding: 0; list-style: none; counter-reset: item; }
.checklist li { position: relative; padding-left: 40px; min-height: 28px; }
.checklist li + li { margin-top: 10px; }
.checklist li::before {
  counter-increment: item;
  content: counter(item);
  position: absolute;
  left: 0; top: 0;
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: 9px;
  background: var(--gold);
  box-shadow: 0 3px 0 var(--gold-dark);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
}

/* ---------- 404 ---------- */

.lost {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.lost__main {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 24px 0 64px;
  text-align: center;
}
.lost__code {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(5rem, 3rem + 12vw, 9rem);
  line-height: 1;
  color: var(--gold);
  text-shadow: var(--outline-l);
}
.lost h1 { margin: 18px 0 18px; }
.lost .lead { margin: 0 auto; color: #F1ECFF; }
.lost .lead + .lead { margin-top: 6px; font-size: 1rem; opacity: 0.9; }
.lost__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 32px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
