/* Saiyan Online — la charte du jeu (Void, Ki, Or ; Saira Condensed penchée + Chakra Petch ; coins biseautés). */

@font-face {
  font-family: 'Saira Condensed';
  src: url('/medias/polices/SairaCondensed-ExtraBold.ttf') format('truetype');
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: 'Chakra Petch';
  src: url('/medias/polices/ChakraPetch-Medium.ttf') format('truetype');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Chakra Petch';
  src: url('/medias/polices/ChakraPetch-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}

:root {
  --void: #06080e;
  --nuit: #0a0f19;
  --panneau: #0f1624;
  --panneau-2: #141d2f;
  --ligne: #33415f;
  --ligne-douce: #1e293e;
  --texte: #e8ecf5;
  --doux: #a6b1c8;
  --pale: #8a96b0;
  --ki: #ff7a1a;
  --ki-clair: #ff9a4a;
  --or: #ffd06a;
  --ciel: #5fc9e6;
  --discord: #5865f2;
  --biseau: 12px;
  --largeur: 1180px;
  --titre: 'Saira Condensed', 'Arial Narrow', sans-serif;
  --corps: 'Chakra Petch', system-ui, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--void);
  color: var(--texte);
  font: 500 16px/1.6 var(--corps);
  overflow-x: hidden;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--or); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #ffe3a3; }
:focus-visible { outline: 2px solid var(--or); outline-offset: 3px; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.2em; }

h1, h2, h3, .titre {
  font-family: var(--titre);
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1.02;
  margin: 0 0 0.45em;
}
h1 { font-size: clamp(2.3rem, 5.5vw, 3.6rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h3 { font-size: 1.45rem; }
.sur-titre {
  display: inline-block;
  font: 600 0.78rem/1 var(--corps);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ki);
  margin-bottom: 0.9em;
}
.sur-titre::before { content: '◆ '; color: var(--or); }

.saut {
  position: absolute; left: -999px; top: 8px; z-index: 50;
  background: var(--or); color: var(--void); padding: 8px 14px; font-weight: 600;
}
.saut:focus { left: 8px; }

.biseau {
  clip-path: polygon(var(--biseau) 0, 100% 0, 100% calc(100% - var(--biseau)), calc(100% - var(--biseau)) 100%, 0 100%, 0 var(--biseau));
}
.conteneur { width: min(var(--largeur), 100% - 32px); margin-inline: auto; }

/* ---------- Boutons ---------- */
.bouton {
  --b: 10px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 24px;
  font: 800 italic 1.2rem/1 var(--titre); text-transform: uppercase; letter-spacing: 0.03em;
  text-decoration: none; cursor: pointer; border: 0;
  clip-path: polygon(var(--b) 0, 100% 0, 100% calc(100% - var(--b)), calc(100% - var(--b)) 100%, 0 100%, 0 var(--b));
  transition: filter 0.15s, transform 0.15s, background-color 0.15s;
}
.bouton:hover { filter: brightness(1.12); transform: translateY(-1px); }
.bouton:active { transform: translateY(0); }
.bouton svg { width: 20px; height: 20px; flex: none; }
.bouton-ki { background: linear-gradient(180deg, var(--ki-clair), var(--ki)); color: #1a0b00; }
.bouton-ki:hover { color: #1a0b00; }
.bouton-discord { background: var(--discord); color: #fff; }
.bouton-discord:hover { color: #fff; }
.bouton-contour { background: rgba(6, 8, 14, 0.55); color: var(--texte); box-shadow: inset 0 0 0 2px var(--ligne); }
.bouton-contour:hover { color: var(--texte); box-shadow: inset 0 0 0 2px var(--or); }
.bouton[aria-disabled='true'] { background: var(--panneau-2); color: var(--pale); cursor: not-allowed; filter: none; transform: none; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- En-tête ---------- */
.entete {
  position: sticky; top: 0; z-index: 30;
  background: rgba(6, 8, 14, 0.82);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ligne-douce);
}
.entete-in { display: flex; align-items: center; gap: 16px; min-height: 68px; }
.marque img { width: 112px; height: auto; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.nav a:not(.bouton) {
  color: var(--doux); text-decoration: none; padding: 10px 14px;
  font: 800 italic 1.15rem/1 var(--titre); text-transform: uppercase; letter-spacing: 0.03em;
}
.nav a:not(.bouton):hover, .nav a[aria-current='page'] { color: var(--or); }
.nav .bouton { min-height: 40px; padding: 0 16px; font-size: 1.05rem; margin-left: 6px; }
.menu-bouton {
  display: none; margin-left: auto; background: none; border: 1px solid var(--ligne); color: var(--texte);
  min-height: 42px; padding: 0 14px; font: 600 0.95rem var(--corps); cursor: pointer; align-items: center; gap: 8px;
}
.menu-bouton svg { width: 18px; height: 18px; }

/* Sélecteur de langue : un menu déroulant sans script (details), refermé au clic dehors par site.js. */
.langues { position: relative; }
.langues summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 10px; color: var(--doux); border: 1px solid transparent;
  font: 800 italic 1.05rem/1 var(--titre); letter-spacing: 0.04em;
}
.langues summary::-webkit-details-marker { display: none; }
.langues summary svg { width: 18px; height: 18px; }
.langues summary:hover, .langues[open] summary { color: var(--or); border-color: var(--ligne); }
.langues ul {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 170px;
  list-style: none; margin: 0; padding: 6px; background: var(--nuit); border: 1px solid var(--ligne);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
}
.nav .langues a {
  display: flex; align-items: center; gap: 10px; padding: 10px 10px; text-decoration: none; color: var(--texte);
  font: 600 0.95rem/1.2 var(--corps); text-transform: none; letter-spacing: 0;
}
.nav .langues a b { font: 800 italic 0.95rem/1 var(--titre); color: var(--pale); width: 22px; }
.nav .langues a:hover { background: var(--panneau-2); color: var(--or); }
.nav .langues a[aria-current='true'] { color: var(--or); }
.nav .langues a[aria-current='true'] b { color: var(--or); }

/* Proposition de la langue du visiteur, en bas de l'écran, une seule fois. */
.invite-langue {
  position: fixed; left: 16px; bottom: 16px; z-index: 60; max-width: min(420px, calc(100% - 32px));
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 44px 14px 16px; background: var(--nuit); border: 1px solid var(--or);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}
.invite-langue p { margin: 0; flex: 1 1 180px; color: var(--texte); }
.invite-langue .bouton { min-height: 40px; padding: 0 16px; font-size: 1.02rem; }
.invite-fermer {
  position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; cursor: pointer;
  background: none; border: 0; color: var(--pale); font-size: 1.4rem; line-height: 1;
}
.invite-fermer:hover { color: var(--texte); }

@media (max-width: 760px) {
  .menu-bouton { display: inline-flex; }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--nuit); border-bottom: 1px solid var(--ligne);
    padding: 8px 16px 16px; display: none;
  }
  .nav.ouvert { display: flex; }
  .nav a:not(.bouton) { padding: 14px 4px; border-bottom: 1px solid var(--ligne-douce); }
  .nav .bouton { margin: 14px 0 0; }
  .langues { border-bottom: 1px solid var(--ligne-douce); }
  .langues summary { width: 100%; padding: 14px 4px; min-height: 0; border: 0; }
  .langues ul { position: static; box-shadow: none; border: 0; padding: 0 0 8px; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .nav .langues a { border-bottom: 0; padding: 10px 4px; }
}

/* ---------- Héros ---------- */
.heros { position: relative; min-height: min(92svh, 860px); display: flex; align-items: flex-end; overflow: hidden; isolation: isolate; }
.heros-fond, .heros-fond img { position: absolute; inset: 0; width: 100%; height: 100%; }
.heros-fond img { object-fit: cover; object-position: 60% 50%; }
.heros-fond { z-index: -2; }
.heros::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(6, 8, 14, 0.82) 0%, rgba(6, 8, 14, 0.5) 38%, rgba(6, 8, 14, 0) 68%),
    linear-gradient(180deg, rgba(6, 8, 14, 0) 45%, rgba(6, 8, 14, 0.75) 82%, var(--void) 100%);
}
.heros-in { padding: 64px 0 72px; }
.heros-logo { width: min(560px, 92%); height: auto; margin: 0 0 18px -12px; filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.55)); }
.heros h1 { margin: 0; }
.heros-accroche { font: 800 italic clamp(1.45rem, 3.2vw, 2.1rem)/1.1 var(--titre); text-transform: uppercase; max-width: 26ch; margin-bottom: 0.4em; text-shadow: 0 2px 14px rgba(0, 0, 0, 0.6); }
.heros-sous { color: var(--doux); max-width: 46ch; font-size: 1.08rem; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.7); }
.pastilles { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pastilles li {
  font: 600 0.8rem/1 var(--corps); letter-spacing: 0.08em; text-transform: uppercase;
  padding: 8px 12px; background: rgba(6, 8, 14, 0.6); border: 1px solid var(--ligne); color: var(--doux);
}
.pastilles li::before { content: '●'; color: var(--ki); margin-right: 7px; font-size: 0.7em; vertical-align: 1px; }
@media (max-width: 760px) {
  .heros { min-height: 0; }
  .heros-fond img { object-position: 72% 50%; }
  .heros::before { background: linear-gradient(180deg, rgba(6, 8, 14, 0.15) 0%, rgba(6, 8, 14, 0.55) 45%, rgba(6, 8, 14, 0.92) 78%, var(--void) 100%); }
  .heros-in { padding: 120px 0 40px; }
  .heros-logo { margin-left: -6px; }
  .actions .bouton { flex: 1 1 100%; }
}

/* ---------- Sections ---------- */
.section { padding: 88px 0; position: relative; }
.section + .section { border-top: 1px solid var(--ligne-douce); }
.section-sombre { background: linear-gradient(180deg, var(--nuit), var(--void)); }
.entete-section { max-width: 720px; margin-bottom: 40px; }
.entete-section p { color: var(--doux); font-size: 1.06rem; }
@media (max-width: 760px) { .section { padding: 60px 0; } }

/* ---------- Créateur de Saiyan ---------- */
.createur { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 40px; align-items: center; }
.createur-scene {
  position: relative; aspect-ratio: 1 / 1; max-width: 520px; width: 100%; justify-self: center;
  container-type: inline-size;
  background:
    radial-gradient(circle at 50% 78%, rgba(255, 122, 26, 0.22), transparent 42%),
    radial-gradient(circle at 50% 40%, #16213a, var(--nuit) 70%);
  border: 1px solid var(--ligne);
  display: grid; place-items: center; overflow: hidden;
}
.socle { position: relative; margin-top: -2%; }
.socle::after {
  content: ''; position: absolute; left: 50%; bottom: -4%; width: 150%; height: 13%;
  transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255, 208, 106, 0.28), rgba(255, 122, 26, 0.08) 55%, transparent 70%);
  border: 1px solid rgba(255, 208, 106, 0.25);
}
.createur-scene.ssj { background: radial-gradient(circle at 50% 60%, rgba(255, 208, 106, 0.3), transparent 48%), radial-gradient(circle at 50% 40%, #1c2034, var(--nuit) 70%); }
.createur-scene.ssj .sprite { filter: drop-shadow(0 0 10px rgba(255, 220, 90, 0.85)) drop-shadow(0 0 24px rgba(255, 170, 40, 0.5)); }
.sprite {
  --e: 6; --rang: 0;
  width: calc(32px * var(--e)); height: calc(48px * var(--e));
  background-repeat: no-repeat;
  background-size: calc(128px * var(--e)) calc(192px * var(--e));
  background-position: 0 calc(-48px * var(--e) * var(--rang));
  image-rendering: pixelated;
  position: relative; z-index: 1;
  animation: marche 0.72s steps(4) infinite;
}
@container (max-width: 440px) { .sprite { --e: 5; } }
@container (max-width: 360px) { .sprite { --e: 4; } }
@keyframes marche {
  from { background-position-x: 0; }
  to { background-position-x: calc(-128px * var(--e)); }
}
@media (prefers-reduced-motion: reduce) { .sprite { animation: none; } }
.createur-tourner { position: absolute; bottom: 14px; left: 0; right: 0; display: flex; justify-content: center; gap: 10px; z-index: 2; }
.rond {
  width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer;
  background: rgba(6, 8, 14, 0.7); color: var(--texte); border: 1px solid var(--ligne);
}
.rond:hover { border-color: var(--or); color: var(--or); }
.rond svg { width: 20px; height: 20px; }
.createur-nom { position: absolute; top: 16px; left: 0; right: 0; text-align: center; z-index: 2; font: 800 italic 1.35rem/1 var(--titre); text-transform: uppercase; color: var(--or); }
.createur-nom small { display: block; font: 600 0.78rem/1.4 var(--corps); letter-spacing: 0.12em; color: var(--pale); font-style: normal; margin-top: 4px; }

.options { display: grid; gap: 22px; }
.option-titre { font: 600 0.8rem/1 var(--corps); letter-spacing: 0.14em; text-transform: uppercase; color: var(--pale); margin-bottom: 10px; display: flex; justify-content: space-between; gap: 12px; }
.option-titre b { color: var(--texte); font-weight: 600; letter-spacing: 0.06em; }
.coiffures { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 6px; }
.choix-coiffure {
  aspect-ratio: 1; padding: 0; cursor: pointer; border: 1px solid var(--ligne-douce); background: var(--panneau);
  display: block; overflow: hidden; max-width: 84px;
}
/* La pose d'attente de face (32 x 48), remontée pour cadrer la coiffure et le buste. */
.choix-coiffure span, .portrait span {
  display: block; width: 100%; aspect-ratio: 32 / 48; transform: translateY(-22%);
  background-size: 100% auto; background-repeat: no-repeat; background-position: 0 0;
  image-rendering: pixelated;
}
.portrait { display: block; width: 64px; height: 64px; flex: none; overflow: hidden; background: var(--nuit); border: 1px solid var(--ligne-douce); }
.choix-coiffure:hover { border-color: var(--ligne); background: var(--panneau-2); }
.choix-coiffure[aria-pressed='true'] { border-color: var(--or); background: #1d1a14; box-shadow: inset 0 0 0 1px var(--or); }
.pastilles-couleur { display: flex; flex-wrap: wrap; gap: 10px; }
.choix-teinte {
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  min-height: 44px; padding: 0 14px 0 8px; border: 1px solid var(--ligne-douce); background: var(--panneau); color: var(--texte);
  font: 600 0.95rem var(--corps);
}
.choix-teinte i { width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.18); }
.choix-teinte:hover { border-color: var(--ligne); }
.choix-teinte[aria-pressed='true'] { border-color: var(--or); box-shadow: inset 0 0 0 1px var(--or); }
.choix-teinte:disabled { opacity: 0.4; cursor: not-allowed; }
.forme { display: inline-flex; border: 1px solid var(--ligne); }
.forme button {
  min-height: 44px; padding: 0 18px; border: 0; background: var(--panneau); color: var(--doux); cursor: pointer;
  font: 800 italic 1.05rem/1 var(--titre); text-transform: uppercase;
}
.forme button[aria-pressed='true'] { background: var(--or); color: var(--void); }
.createur-texte p { color: var(--doux); }
.createur-texte .citation { border-left: 3px solid var(--ki); padding: 4px 0 4px 14px; color: var(--texte); font-style: italic; }
.createur-empile { grid-template-columns: 1fr; }
.createur-empile .createur-scene { order: -1; max-width: 460px; justify-self: start; }
@media (max-width: 980px) {
  .createur { grid-template-columns: 1fr; }
  .createur-scene { order: -1; max-width: 420px; }
}
@media (max-width: 560px) {
  .coiffures { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* ---------- Transformations (échelle) ---------- */
.echelle { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; counter-reset: palier; }
.palier {
  position: relative; padding: 22px 18px 20px; background: var(--panneau); border: 1px solid var(--ligne-douce);
  display: flex; flex-direction: column; gap: 10px;
}
.palier::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--teinte, var(--ki)); }
.palier img, .icone-technique { width: 48px; height: 48px; image-rendering: pixelated; }
.palier h3 { margin: 0; font-size: 1.35rem; }
.niveau { font: 600 0.78rem/1 var(--corps); letter-spacing: 0.12em; text-transform: uppercase; color: var(--pale); }
.niveau b { color: var(--or); font: 800 italic 1.5rem/1 var(--titre); letter-spacing: 0; margin-left: 4px; }
@media (max-width: 980px) { .echelle { grid-template-columns: repeat(2, minmax(0, 1fr)); } .echelle .palier:last-child { grid-column: 1 / -1; } }

/* ---------- Monde et images ---------- */
.galerie { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.vue { margin: 0; position: relative; overflow: hidden; border: 1px solid var(--ligne-douce); background: var(--nuit); }
.vue img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; image-rendering: auto; transition: transform 0.5s; }
.vue:hover img { transform: scale(1.04); }
.vue figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 14px 12px;
  background: linear-gradient(180deg, transparent, rgba(6, 8, 14, 0.9));
  font: 800 italic 1.2rem/1 var(--titre); text-transform: uppercase;
}
@media (max-width: 860px) { .galerie { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .galerie { grid-template-columns: 1fr; } }

.chiffres { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 28px; }
.chiffre { padding: 18px 16px; background: var(--panneau); border: 1px solid var(--ligne-douce); }
.chiffre b { display: block; font: 800 italic 2.4rem/1 var(--titre); color: var(--or); }
.chiffre span { color: var(--doux); font-size: 0.92rem; }
@media (max-width: 860px) { .chiffres { grid-template-columns: repeat(2, minmax(0, 1fr)); } .chiffre:last-child { grid-column: 1 / -1; } }

.atouts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.atout { padding: 24px 22px; background: var(--panneau); border: 1px solid var(--ligne-douce); }
.atout h3 { font-size: 1.3rem; color: var(--texte); }
.atout p { color: var(--doux); margin: 0; }
.atout .touche { margin: 0 2px; }
@media (max-width: 900px) { .atouts { grid-template-columns: 1fr; } }

.videos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.video { margin: 0; background: var(--panneau); border: 1px solid var(--ligne-douce); }
.video video { width: 100%; aspect-ratio: 16 / 9; background: #000; }
.video figcaption { padding: 12px 16px 14px; font: 800 italic 1.2rem/1 var(--titre); text-transform: uppercase; }
@media (max-width: 760px) { .videos { grid-template-columns: 1fr; } }

.bandeau {
  padding: 48px 40px; background:
    radial-gradient(circle at 85% 20%, rgba(88, 101, 242, 0.28), transparent 45%),
    radial-gradient(circle at 10% 90%, rgba(255, 122, 26, 0.2), transparent 45%), var(--panneau);
  border: 1px solid var(--ligne);
  display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap;
}
.bandeau h2 { margin-bottom: 0.3em; }
.bandeau p { color: var(--doux); margin: 0; max-width: 52ch; }
@media (max-width: 600px) { .bandeau { padding: 32px 20px; } .bandeau .actions { width: 100%; } .bandeau .bouton { flex: 1 1 100%; } }

/* ---------- Pied de page ---------- */
.pied { border-top: 1px solid var(--ligne-douce); background: var(--nuit); padding: 44px 0 36px; margin-top: 40px; }
.pied-in { display: grid; grid-template-columns: auto 1fr; gap: 20px 40px; align-items: start; }
.pied img { width: 130px; height: auto; }
.pied nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.pied nav a { color: var(--doux); text-decoration: none; font-weight: 600; }
.pied nav a:hover { color: var(--or); }
.avertissement { grid-column: 2; color: var(--pale); font-size: 0.85rem; margin: 0; max-width: 78ch; }
@media (max-width: 640px) { .pied-in { grid-template-columns: 1fr; } .avertissement { grid-column: 1; } }

/* ---------- Wiki ---------- */
.page-titre { padding: 56px 0 8px; }
.page-titre p { color: var(--doux); max-width: 70ch; font-size: 1.06rem; }
.fil { font-size: 0.9rem; color: var(--pale); margin-bottom: 12px; }
.fil a { color: var(--doux); }
.wiki { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 44px; padding: 32px 0 40px; align-items: start; }
.wiki-menu { position: sticky; top: 92px; }
.wiki-menu ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.wiki-menu a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; text-decoration: none; color: var(--doux);
  border-left: 2px solid transparent; font-weight: 600;
}
.wiki-menu a:hover { color: var(--texte); background: var(--panneau); }
.wiki-menu a[aria-current='page'] { color: var(--or); border-left-color: var(--or); background: var(--panneau); }
.wiki-menu .menu-titre { font: 600 0.75rem/1 var(--corps); letter-spacing: 0.16em; text-transform: uppercase; color: var(--pale); margin: 0 0 12px 12px; }
.wiki-page > section + section { margin-top: 52px; }
.wiki-page h2 { font-size: clamp(1.6rem, 3.4vw, 2.1rem); }
.chapeau { color: var(--doux); font-size: 1.08rem; max-width: 70ch; }
@media (max-width: 900px) {
  .wiki { grid-template-columns: minmax(0, 1fr); gap: 20px; padding-top: 12px; }
  .wiki-menu { position: static; margin-inline: -16px; overflow-x: auto; scrollbar-width: none; }
  .wiki-menu::-webkit-scrollbar { display: none; }
  .wiki-menu .menu-titre { display: none; }
  .wiki-menu ul { display: flex; gap: 8px; padding: 0 16px; width: max-content; }
  .wiki-menu a { border: 1px solid var(--ligne-douce); border-left-width: 1px; white-space: nowrap; padding: 9px 14px; }
  .wiki-menu a[aria-current='page'] { border-color: var(--or); }
}

.cartes-wiki { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 14px; }
.carte-wiki {
  display: flex; gap: 16px; align-items: flex-start; padding: 22px 20px; text-decoration: none; color: var(--texte);
  background: var(--panneau); border: 1px solid var(--ligne-douce); transition: border-color 0.15s, background-color 0.15s;
}
.carte-wiki:hover { border-color: var(--or); background: var(--panneau-2); color: var(--texte); }
.carte-wiki img { width: 48px; height: 48px; flex: none; image-rendering: pixelated; object-fit: contain; }
.carte-wiki h2 { font-size: 1.4rem; margin-bottom: 0.25em; overflow-wrap: anywhere; }
.carte-wiki p { color: var(--doux); margin: 0; font-size: 0.95rem; }

.liste-techniques { display: grid; gap: 12px; }
.technique {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 18px; align-items: start;
  padding: 18px 20px; background: var(--panneau); border: 1px solid var(--ligne-douce);
}
.technique img { width: 64px; height: 64px; image-rendering: pixelated; background: var(--nuit); border: 1px solid var(--ligne-douce); }
.technique h3 { margin: 2px 0 6px; font-size: 1.4rem; }
.technique p { margin: 0; color: var(--doux); }
.technique .niveau { white-space: nowrap; text-align: right; }
@media (max-width: 560px) {
  .technique { grid-template-columns: 48px minmax(0, 1fr); gap: 14px; padding: 16px; }
  .technique img { width: 48px; height: 48px; }
  .technique .niveau { grid-column: 2; grid-row: 1; text-align: left; }
  .technique > div { grid-column: 1 / -1; }
}
.note {
  padding: 16px 18px; background: rgba(255, 122, 26, 0.07); border: 1px solid rgba(255, 122, 26, 0.35); color: var(--texte);
  margin: 0 0 24px;
}
.note b { color: var(--ki-clair); }

.rangee-saiyans { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 8px; }
.saiyan-fixe { margin: 0; text-align: center; }
.saiyan-fixe span {
  --e: 2; display: block; margin: 0 auto; width: calc(32px * var(--e)); height: calc(48px * var(--e));
  background-size: 100% 100%; background-position: 0 0; background-repeat: no-repeat;
  image-rendering: pixelated;
}
.saiyan-fixe figcaption { font-size: 0.82rem; color: var(--doux); margin-top: 6px; line-height: 1.2; }
.saiyan-fixe.ssj span, .saiyan-fixe span.ssj { filter: drop-shadow(0 0 6px rgba(255, 214, 90, 0.7)); }
.paires { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.paires .saiyan-fixe { padding: 14px 8px 12px; background: var(--panneau); border: 1px solid var(--ligne-douce); }
.paires .saiyan-fixe > div { display: flex; justify-content: center; gap: 4px; }
.paires .saiyan-fixe span { --e: 3; margin: 0; }
.paires figcaption { font: 800 italic 1.1rem/1 var(--titre); text-transform: uppercase; color: var(--texte); margin-top: 10px; }
@media (max-width: 760px) { .rangee-saiyans { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 18px; } .paires { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Carte du monde */
.carte-monde { position: relative; margin: 0 0 18px; border: 1px solid var(--ligne); background: #1a4f8f; overflow: hidden; }
.carte-monde img { width: 100%; height: auto; }
.repere-zone {
  position: absolute; transform: translate(-50%, -50%); text-align: center; pointer-events: none;
  font: 800 italic clamp(0.72rem, 1.6vw, 1.15rem)/1 var(--titre); text-transform: uppercase; color: #fff;
  text-shadow: 0 0 4px #000, 0 1px 3px #000, 0 0 10px rgba(0, 0, 0, 0.8); white-space: nowrap;
}
.repere-zone small {
  display: table; margin: 4px auto 0; padding: 3px 6px; background: var(--c); color: #06080e;
  font: 600 clamp(0.6rem, 1.2vw, 0.78rem)/1 var(--corps); text-shadow: none; font-style: normal; letter-spacing: 0.04em;
}
.repere-lieu { position: absolute; width: 10px; height: 10px; transform: translate(-50%, -50%) rotate(45deg); background: var(--or); border: 2px solid #3a2400; }
@media (max-width: 560px) { .repere-zone small { display: none; } }
.legende { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--doux); font-size: 0.9rem; margin-bottom: 8px; }
.legende span { display: inline-flex; align-items: center; gap: 8px; }
.legende i { width: 10px; height: 10px; background: var(--or); transform: rotate(45deg); border: 2px solid #3a2400; }

.zones { display: grid; gap: 14px; }
.zone { padding: 22px 22px 18px; background: var(--panneau); border: 1px solid var(--ligne-douce); border-left: 4px solid var(--c); }
.zone-tete { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.zone h3 { margin: 0; font-size: 1.6rem; }
.zone .niveau b { color: var(--c); }
.zone dl { margin: 0; display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px 14px; }
.zone dt { color: var(--pale); font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; padding-top: 4px; }
.zone dd { margin: 0; }
@media (max-width: 560px) { .zone dl { grid-template-columns: 1fr; gap: 4px; } .zone dd { margin-bottom: 10px; } }
.puces { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; }
.puces li, .puces a {
  font-size: 0.88rem; padding: 4px 10px; background: var(--nuit); border: 1px solid var(--ligne-douce); color: var(--doux); text-decoration: none;
}
.puces a:hover { border-color: var(--or); color: var(--or); }
.puces .jcj { border-color: rgba(255, 110, 90, 0.5); color: #ffc2b8; }
.puces .jcj small { font-size: 0.78em; color: #ff8f7e; letter-spacing: 0.04em; }

/* Bestiaire */
.filtres { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.filtre {
  min-height: 40px; padding: 0 14px; cursor: pointer; background: var(--panneau); color: var(--doux);
  border: 1px solid var(--ligne-douce); font: 600 0.9rem var(--corps);
}
.filtre:hover { border-color: var(--ligne); color: var(--texte); }
.filtre[aria-pressed='true'] { border-color: var(--or); color: var(--or); background: #1d1a14; }
.groupe-monstres + .groupe-monstres { margin-top: 40px; }
.groupe-monstres h2 { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.groupe-monstres h2 small { font: 600 0.85rem var(--corps); color: var(--pale); font-style: normal; text-transform: none; letter-spacing: 0.02em; }
.monstres { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.monstre { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 14px; padding: 16px; background: var(--panneau); border: 1px solid var(--ligne-douce); scroll-margin-top: 90px; }
.monstre:target { border-color: var(--or); }
.monstre-image { width: 76px; height: 92px; display: grid; place-items: center; background: radial-gradient(circle at 50% 70%, #18233a, var(--nuit)); border: 1px solid var(--ligne-douce); }
.monstre-image img { image-rendering: pixelated; max-width: 70px; max-height: 86px; object-fit: contain; }
.monstre h3 { font-size: 1.25rem; margin: 0 0 6px; }
.etiquettes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.etiquette { font: 600 0.72rem/1 var(--corps); letter-spacing: 0.08em; text-transform: uppercase; padding: 5px 7px; border: 1px solid var(--ligne); color: var(--doux); }
.etiquette.niv { color: var(--or); border-color: rgba(255, 208, 106, 0.45); }
.etiquette.agressif { color: #ff9a8a; border-color: rgba(255, 110, 90, 0.45); }
.etiquette.paisible { color: #9be3b0; border-color: rgba(110, 220, 150, 0.4); }
.etiquette.boss { color: var(--void); background: var(--ki); border-color: var(--ki); }
.monstre p { margin: 0 0 6px; font-size: 0.88rem; color: var(--doux); }
.monstre p b { color: var(--pale); font-weight: 600; }
.butin { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 4px; }
.butin li { display: flex; align-items: center; gap: 8px; font-size: 0.86rem; color: var(--texte); }
.butin img { width: 24px; height: 24px; image-rendering: pixelated; }
.butin span { color: var(--pale); margin-left: auto; font-variant-numeric: tabular-nums; }

/* Tableaux */
.tableau { width: 100%; border-collapse: collapse; background: var(--panneau); border: 1px solid var(--ligne-douce); }
.tableau th, .tableau td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--ligne-douce); vertical-align: middle; }
.tableau th { font: 600 0.78rem/1.2 var(--corps); letter-spacing: 0.1em; text-transform: uppercase; color: var(--pale); background: var(--nuit); }
.tableau tr:last-child td { border-bottom: 0; }
.tableau .objet { display: inline-flex; align-items: center; gap: 8px; margin-right: 12px; }
.tableau .objet img { width: 24px; height: 24px; image-rendering: pixelated; }
.defile { overflow-x: auto; }
.touche {
  display: inline-block; min-width: 30px; padding: 3px 8px; text-align: center;
  font: 600 0.88rem/1.3 var(--corps); color: var(--texte);
  background: linear-gradient(180deg, #1b2538, #121a2a); border: 1px solid var(--ligne); border-bottom-width: 3px;
}
.grille-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 760px) { .grille-2 { grid-template-columns: 1fr; } }
.carte-texte { padding: 22px 22px 18px; background: var(--panneau); border: 1px solid var(--ligne-douce); }
.carte-texte h3 { font-size: 1.35rem; }
.carte-texte p:last-child, .carte-texte ul:last-child { margin-bottom: 0; }
.carte-texte p { color: var(--doux); }

/* Télécharger */
.statut {
  padding: 34px 32px; background:
    radial-gradient(circle at 100% 0%, rgba(255, 122, 26, 0.18), transparent 50%), var(--panneau);
  border: 1px solid var(--ligne); max-width: 760px;
}
.statut .etat {
  display: inline-block; font: 800 italic 1rem/1 var(--titre); text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--void); background: var(--or); padding: 6px 10px; margin-bottom: 16px;
}
.statut p { color: var(--doux); }
.etapes { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; counter-reset: etape; }
.etapes li { padding: 22px 20px; background: var(--panneau); border: 1px solid var(--ligne-douce); counter-increment: etape; }
.etapes li::before { content: counter(etape); display: block; font: 800 italic 2.4rem/1 var(--titre); color: var(--ki); margin-bottom: 8px; }
.etapes li p { margin: 0; color: var(--doux); }
@media (max-width: 760px) { .etapes { grid-template-columns: 1fr; } }
.questions { display: grid; gap: 10px; max-width: 820px; }
.questions details { background: var(--panneau); border: 1px solid var(--ligne-douce); }
.questions summary { cursor: pointer; padding: 16px 18px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.questions summary::-webkit-details-marker { display: none; }
.questions summary::after { content: '+'; color: var(--or); font-size: 1.3rem; line-height: 1; }
.questions details[open] summary::after { content: '–'; }
.questions details p { padding: 0 18px 16px; margin: 0; color: var(--doux); }

.introuvable { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: 60px 0; }
.introuvable p { color: var(--doux); }
.pile { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.tableau .objet { white-space: nowrap; }
.sous-titre { color: var(--pale); font-size: 0.88rem; letter-spacing: 0.02em; margin: -4px 0 12px; }
.atout .sous-titre { margin: -2px 0 8px; }

/* ---------- Accueil vivant ---------- */
/* Le fond du menu respire lentement. */
.heros-fond img { transform-origin: 62% 40%; animation: respire 30s ease-in-out infinite alternate; }
@keyframes respire { from { transform: scale(1); } to { transform: scale(1.07) translate(-1%, 0.6%); } }

/* Étincelles de ki (canvas posé par site.js) et Saiyans qui traversent le ciel. */
.etincelles, .ciel { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: -1; }
.ciel { overflow: hidden; }
.volant {
  --e: 3;
  position: absolute; left: 0;
  width: calc(32px * var(--e)); height: calc(48px * var(--e));
  background-repeat: no-repeat; background-size: calc(128px * var(--e)) calc(96px * var(--e));
  image-rendering: pixelated;
  animation: var(--traverse) var(--duree, 6s) linear forwards, battement 0.42s steps(4) infinite, flotte 1.7s ease-in-out infinite;
}
.volant.droite { --traverse: traverse-droite; background-position-y: calc(-48px * var(--e)); }
.volant.gauche { --traverse: traverse-gauche; background-position-y: 0; }
.volant.ssj { filter: drop-shadow(0 0 6px rgba(255, 214, 90, 0.95)) drop-shadow(0 0 16px rgba(255, 160, 40, 0.6)); }
/* La traînée derrière le Saiyan, à la hauteur de son corps couché (bas de la case). */
.volant::after {
  content: ''; position: absolute; top: 66%; height: 12%; width: 150%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55));
  filter: blur(2px); opacity: 0.7;
}
.volant.droite::after { right: 70%; }
.volant.gauche::after { left: 70%; transform: scaleX(-1); }
.volant.ssj::after { background: linear-gradient(90deg, transparent, rgba(255, 210, 90, 0.85)); }
/* Départ et arrivée hors de l'écran, traînée comprise (elle fait 1,5 fois la case). */
@keyframes traverse-droite { from { translate: calc(-80px * var(--e)) 0; } to { translate: calc(100vw + 80px * var(--e)) 0; } }
@keyframes traverse-gauche { from { translate: calc(100vw + 10px * var(--e)) 0; } to { translate: calc(-80px * var(--e)) 0; } }
@keyframes battement { from { background-position-x: 0; } to { background-position-x: calc(-128px * var(--e)); } }
@keyframes flotte { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@media (max-width: 760px) { .volant { --e: 2; } }

/* Le logo arrive, puis s'allume doucement par-derrière. */
.heros h1 { position: relative; z-index: 0; }
.heros h1::before {
  content: ''; position: absolute; left: 6%; top: 8%; width: min(520px, 86%); height: 80%; z-index: -1;
  background: radial-gradient(ellipse at center, rgba(255, 170, 60, 0.55), rgba(255, 120, 30, 0.18) 45%, transparent 70%);
  animation: lueur 4.5s ease-in-out 1s infinite;
  opacity: 0;
}
.heros-logo { animation: logo-arrivee 0.9s cubic-bezier(0.2, 0.9, 0.3, 1.25) both; }
@keyframes logo-arrivee { from { opacity: 0; transform: translateY(-18px) scale(0.92); } to { opacity: 1; transform: none; } }
@keyframes lueur { 0%, 100% { opacity: 0.25; transform: scale(0.96); } 50% { opacity: 0.9; transform: scale(1.04); } }
.heros-accroche, .heros-sous, .heros .actions, .heros .pastilles { animation: monte 0.8s ease-out both; }
.heros-accroche { animation-delay: 0.25s; }
.heros-sous { animation-delay: 0.4s; }
.heros .actions { animation-delay: 0.55s; }
.heros .pastilles { animation-delay: 0.7s; }
@keyframes monte { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* Un reflet passe sur le bouton Télécharger. */
.heros .bouton-ki { position: relative; overflow: hidden; }
.heros .bouton-ki::after {
  content: ''; position: absolute; top: -20%; bottom: -20%; width: 40%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  animation: reflet 5s ease-in-out 2s infinite;
}
@keyframes reflet { 0%, 70% { left: -60%; } 100% { left: 130%; } }

/* Joueurs en ligne sur le Discord : pastille verte qui bat. */
.pastilles .en-ligne { color: #c9f5d7; border-color: rgba(67, 209, 122, 0.45); }
.pastilles .en-ligne::before { color: #43d17a; animation: bat 1.8s ease-in-out infinite; display: inline-block; }
@keyframes bat { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.75); } }
.compteur-discord { margin-top: 12px !important; color: #c9f5d7 !important; font-weight: 600; }
.compteur-discord::before { content: '● '; color: #43d17a; }

/* La flèche qui invite à descendre. */
.defiler {
  position: absolute; left: 50%; bottom: 14px; translate: -50% 0; z-index: 1;
  width: 44px; height: 44px; display: grid; place-items: center; color: var(--or);
  animation: rebond 2.2s ease-in-out infinite;
}
.defiler svg { width: 30px; height: 30px; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.8)); }
@keyframes rebond { 0%, 100% { transform: translateY(0); opacity: 0.7; } 50% { transform: translateY(8px); opacity: 1; } }
@media (max-width: 760px) { .defiler { display: none; } }

/* Les blocs apparaissent quand on y arrive (classes posées par site.js). */
.revele { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease-out, transform 0.7s ease-out; transition-delay: var(--retard, 0ms); }
.revele.visible { opacity: 1; transform: none; }
/* Les paliers de transformation s'allument l'un après l'autre, dans leur couleur. */
.palier.revele.visible { animation: allumage 1s ease-out both; animation-delay: var(--retard, 0ms); }
@keyframes allumage {
  0% { box-shadow: 0 0 0 0 transparent; }
  35% { box-shadow: 0 0 34px 2px var(--teinte); border-color: var(--teinte); }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.palier img { transition: transform 0.25s, filter 0.25s; }
.palier:hover img { transform: translateY(-3px) scale(1.08); filter: drop-shadow(0 0 10px var(--teinte)); }
.palier:hover { border-color: var(--teinte); }

/* Le créateur : l'éclair du passage en Super Saiyan, puis l'aura qui palpite. */
.createur-scene.eclair::before {
  content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: radial-gradient(circle at 50% 62%, rgba(255, 250, 220, 0.95), rgba(255, 210, 90, 0.55) 26%, transparent 62%);
  animation: eclair 0.75s ease-out forwards;
}
@keyframes eclair { 0% { opacity: 0; transform: scale(0.6); } 18% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.25); } }
.createur-scene.ssj .sprite { animation: marche 0.72s steps(4) infinite, aura-ssj 1.3s ease-in-out infinite; }
@keyframes aura-ssj {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(255, 220, 90, 0.8)) drop-shadow(0 0 20px rgba(255, 170, 40, 0.45)); }
  50% { filter: drop-shadow(0 0 14px rgba(255, 230, 120, 1)) drop-shadow(0 0 34px rgba(255, 170, 40, 0.7)); }
}

@media (prefers-reduced-motion: reduce) {
  .heros-fond img, .heros h1::before, .heros-logo, .heros-accroche, .heros-sous, .heros .actions, .heros .pastilles,
  .heros .bouton-ki::after, .pastilles .en-ligne::before, .defiler, .palier.revele.visible, .createur-scene.ssj .sprite { animation: none; }
  .heros h1::before { opacity: 0.5; }
  .etincelles, .ciel { display: none; }
}
