/* Infinite Fusion Online : site vitrine. Thème du lanceur : la galaxie et la
   grille néon du fond, l'arc-en-ciel du bandeau « ONLINE » réservé au bouton
   de téléchargement et au nom de la fusion. */
:root {
  --nuit: #0a0c55;
  --abysse: #060736;
  --indigo: #2210b8;
  --neon: #21aefa;
  --cyan: #3be7ff;
  --rose: #ff6ad5;
  --etoile: #f3f6ff;
  --brume: #b8c2f2;
  --panneau: rgba(9, 12, 70, 0.74);
  --bord: rgba(80, 140, 255, 0.45);
  --arc: linear-gradient(90deg, #ff7fb2, #ff9a5e 18%, #ffe46b 36%, #9df07f 52%, #4fe6dc 68%, #3fa9ff 84%, #8a7cff);
  --pixel: "Pixelify Sans", ui-rounded, system-ui, sans-serif;
  --texte: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
/* « hidden » l'emporte toujours, même sur un élément mis en grille ou en flex */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--abysse);
  color: var(--etoile);
  font: 400 1.0625rem/1.55 var(--texte);
  overflow-x: hidden;
}
body::before {
  /* le fond reste immobile sur un calque fixe (« background-attachment: fixed »
     est ignoré sur iPhone et étirerait l'image sur toute la page) */
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--abysse) url("images/fond.webp") center top / cover no-repeat;
  pointer-events: none;
}
/* après l'accueil, les sections passent sur une nuit plus dense : le cœur
   lumineux de la galaxie ne passe plus sous le texte */
.suite {
  display: flow-root; /* la marge de la dernière section reste dans la bande */
  padding-top: clamp(2rem, 6vw, 4rem);
  background: linear-gradient(180deg, rgba(6, 7, 54, 0) 0, rgba(6, 7, 54, 0.8) 9rem, rgba(6, 7, 54, 0.88) 100%);
}
img { max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: var(--cyan); text-underline-offset: 0.18em; }
a:hover { color: var(--etoile); }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }
.visuellement-cache {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

.ciel { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
main, .pied, .barre { position: relative; z-index: 1; }

/* ---------- ouverture : Rivelia Software présente ---------- */
.ouverture {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background: radial-gradient(ellipse at 50% 45%, #141a7a 0%, var(--nuit) 45%, var(--abysse) 100%);
  cursor: pointer;
}
.ouverture-marque { display: grid; justify-items: center; gap: 1.1rem; }
.ouverture .marque-rivelia { width: min(56vw, 300px); }
.ouverture-texte {
  margin: 0; font: 400 1.35rem/1 var(--pixel); color: var(--brume);
  letter-spacing: 0.04em;
}

/* le logo officiel, en masque : la lumière de la galaxie le colore */
.marque-rivelia {
  display: block;
  aspect-ratio: 720 / 668;
  background: linear-gradient(165deg, #ffffff 0%, #bfeaff 38%, #b9a6ff 72%, #ff9fe1 100%);
  -webkit-mask: url("images/rivelia.png") center / contain no-repeat;
  mask: url("images/rivelia.png") center / contain no-repeat;
  filter: drop-shadow(0 0 14px rgba(59, 231, 255, 0.35));
}

/* ---------- barre du haut ---------- */
.barre {
  display: flex; justify-content: flex-end; align-items: center;
  padding: 1rem clamp(1rem, 4vw, 3rem) 0;
}
.passer {
  position: absolute; left: 1rem; top: -4rem;
  padding: 0.5rem 0.9rem; border-radius: 8px;
  background: var(--panneau); color: var(--etoile);
}
.passer:focus { top: 1rem; }
.reglages { display: flex; gap: 0.5rem; }
.reglage {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.75rem; height: 2.75rem; padding: 0 0.9rem;
  border: 1px solid var(--bord); border-radius: 999px;
  background: rgba(9, 12, 70, 0.55);
  font: 400 1rem/1 var(--pixel); cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}
.reglage:hover { border-color: var(--cyan); background: rgba(20, 30, 120, 0.7); }
.icone-son { width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icone-son path:first-child { fill: currentColor; }
.icone-son .barre-son { display: none; }
#son[aria-pressed="false"] .onde { display: none; }
#son[aria-pressed="false"] .barre-son { display: inline; }

/* ---------- accueil ---------- */
.accueil {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 4rem);
  min-height: calc(100svh - 3.75rem);
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2rem) clamp(1rem, 4vw, 3rem) clamp(5rem, 14vh, 9rem);
}
.accueil-texte { display: grid; justify-items: start; gap: 1.4rem; }
h1 { margin: 0; line-height: 0; }
.logo { width: clamp(260px, 36vw, 500px); height: auto; filter: drop-shadow(0 10px 30px rgba(6, 7, 54, 0.6)); }
.accroche {
  margin: 0; max-width: 26ch;
  font-size: clamp(1.2rem, 1.1rem + 0.6vw, 1.55rem); line-height: 1.4; font-weight: 500;
  text-shadow: 0 2px 16px rgba(6, 7, 54, 0.9);
}

.telecharger { display: grid; justify-items: start; gap: 0.7rem; }
.bouton-principal {
  position: relative; overflow: hidden;
  display: inline-grid; gap: 0.2rem;
  padding: 1rem 1.6rem 1.05rem;
  border: 3px solid transparent; border-radius: 16px;
  background:
    linear-gradient(180deg, #2b2d3a 0%, #0c0d14 48%, #000 52%, #14151f 100%) padding-box,
    var(--arc) border-box;
  color: #fff; text-decoration: none;
  box-shadow: 0 0 0 2px #000, 0 12px 30px rgba(6, 7, 54, 0.7);
  transition: box-shadow 0.25s, transform 0.12s;
}
.bouton-principal::after {
  /* reflet qui passe au survol, comme le vernis des lettres du logo */
  content: ""; position: absolute; inset: -40% auto -40% -60%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transform: skewX(-18deg); transition: left 0.6s ease; pointer-events: none;
}
.bouton-principal:hover::after, .bouton-principal:focus-visible::after { left: 130%; }
.bouton-principal:hover, .bouton-principal:focus-visible {
  box-shadow: 0 0 0 2px #000, 0 0 26px rgba(59, 231, 255, 0.45), 0 0 46px rgba(255, 106, 213, 0.3), 0 12px 30px rgba(6, 7, 54, 0.7);
}
.bouton-principal:active { transform: translateY(1px) scale(0.99); }
.bouton-texte { font: 500 clamp(1.45rem, 1.2rem + 1vw, 1.9rem)/1.1 var(--pixel); }
.bouton-detail { font-size: 0.95rem; color: var(--brume); }
.autres { margin: 0; color: var(--brume); }
.autres a { margin-left: 0.15rem; }
.note {
  margin: 0; max-width: 42ch; padding: 0.6rem 0.85rem;
  border-left: 3px solid var(--rose); border-radius: 4px;
  background: rgba(9, 12, 70, 0.7); font-size: 0.95rem;
}

.etat {
  display: inline-flex; align-items: center; gap: 0.6rem;
  margin: 0; padding: 0.45rem 0.95rem 0.45rem 0.8rem;
  border: 1px solid var(--bord); border-radius: 999px;
  background: rgba(9, 12, 70, 0.6); font-size: 0.95rem;
}
.pastille { width: 0.65rem; height: 0.65rem; border-radius: 50%; background: var(--brume); }
.etat.en-ligne .pastille { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); animation: pouls 2.4s ease-in-out infinite; }
.etat.hors-ligne .pastille { background: var(--rose); }
@keyframes pouls { 50% { box-shadow: 0 0 2px var(--cyan); opacity: 0.6; } }

/* ---------- la fusion : l'élément marquant ---------- */
.fusion {
  position: relative; margin: 0;
  display: grid; justify-items: center; gap: 0.9rem;
}
.anneau {
  grid-area: 1 / 1;
  width: min(100%, 520px); height: auto; aspect-ratio: 1;
  animation: tourne 90s linear infinite;
  pointer-events: none;
}
@keyframes tourne { to { transform: rotate(1turn); } }
.scene {
  grid-area: 1 / 1; align-self: center;
  position: relative;
  width: min(62%, 312px); aspect-ratio: 1;
  border: 0; border-radius: 50%; padding: 0;
  background: radial-gradient(circle, rgba(10, 12, 85, 0.25) 0%, rgba(6, 7, 54, 0) 70%);
  cursor: pointer;
}
.scene:focus-visible { outline-offset: 10px; border-radius: 50%; }
.sprite {
  position: absolute; left: 50%; top: 50%;
  width: 100%; height: auto;
  image-rendering: pixelated;
  translate: -50% -50%; /* GSAP anime « transform » : le centrage reste à part */
  filter: drop-shadow(0 8px 14px rgba(6, 7, 54, 0.7));
}
.tete, .corps { opacity: 0; width: 46%; }
.eclat {
  position: absolute; left: 50%; top: 50%; width: 30%; aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, #bff6ff 30%, rgba(255, 106, 213, 0.5) 55%, rgba(255, 106, 213, 0) 72%);
  translate: -50% -50%; transform: scale(0); opacity: 0; pointer-events: none;
}
.fusion figcaption {
  display: grid; justify-items: center; gap: 0.15rem; text-align: center; min-height: 3.6rem;
  padding: 0.35rem 1rem 0.45rem; border-radius: 12px;
  background: rgba(6, 7, 54, 0.6); /* la grille néon passe derrière la légende */
}
.fusion-nom {
  font: 500 clamp(1.6rem, 1.3rem + 1vw, 2.1rem)/1.1 var(--pixel);
  background: var(--arc); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 #000);
}
.fusion-origine { color: var(--brume); font-size: 0.95rem; text-shadow: 0 1px 2px #000, 0 0 12px rgba(6, 7, 54, 0.95); }
.bouton-fusion {
  padding: 0.5rem 1.2rem; border: 2px solid var(--cyan); border-radius: 999px;
  background: rgba(9, 12, 70, 0.6); cursor: pointer;
  font: 500 1.05rem/1 var(--pixel);
  transition: background-color 0.2s, box-shadow 0.2s;
}
.bouton-fusion:hover { background: rgba(33, 174, 250, 0.18); box-shadow: 0 0 18px rgba(59, 231, 255, 0.4); }

/* ---------- sections ---------- */
.jeu, .installer {
  max-width: 1180px; margin: 0 auto clamp(3rem, 8vw, 6rem);
  padding: 0 clamp(1rem, 4vw, 3rem);
}
h2 {
  margin: 0 0 1.6rem;
  font: 500 clamp(1.7rem, 1.3rem + 1.4vw, 2.5rem)/1.15 var(--pixel);
  text-shadow: 0 2px 18px rgba(6, 7, 54, 0.9);
}

.jeu-corps {
  display: grid; grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.4fr);
  gap: clamp(1rem, 3vw, 2rem); align-items: start;
}
.onglets-jeu { display: grid; gap: 0.35rem; }
.onglets-jeu [role="tab"] {
  display: grid; gap: 0.2rem; text-align: left;
  padding: 0.8rem 1rem 0.85rem 1.15rem;
  border: 1px solid transparent; border-radius: 10px;
  background: transparent; cursor: pointer;
  position: relative;
  transition: background-color 0.2s, border-color 0.2s;
}
.onglets-jeu [role="tab"]::before {
  content: ""; position: absolute; left: 0; top: 0.7rem; bottom: 0.7rem; width: 4px;
  border-radius: 4px; background: var(--arc); opacity: 0; transition: opacity 0.2s;
}
.onglets-jeu [role="tab"]:hover { background: rgba(9, 12, 70, 0.55); }
.onglets-jeu [aria-selected="true"] { background: var(--panneau); border-color: var(--bord); }
.onglets-jeu [aria-selected="true"]::before { opacity: 1; }
.onglet-titre { font: 700 1.1rem/1.25 var(--texte); }
.onglet-texte { color: var(--brume); font-size: 0.97rem; max-width: 46ch; }
.onglets-jeu [aria-selected="false"] .onglet-texte { display: none; }

.ecran {
  position: relative; overflow: hidden;
  border: 2px solid var(--neon); border-radius: 12px;
  background: #000;
  box-shadow: 0 0 0 6px rgba(9, 12, 70, 0.75), 0 0 40px rgba(33, 174, 250, 0.25), 0 20px 50px rgba(6, 7, 54, 0.8);
  line-height: 0;
}
.ecran img { width: 100%; height: auto; image-rendering: pixelated; }
.balayage {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(59, 231, 255, 0) 0%, rgba(59, 231, 255, 0.35) 48%, #fff 50%, rgba(255, 106, 213, 0.35) 52%, rgba(255, 106, 213, 0) 100%);
  background-size: 100% 18%; background-repeat: no-repeat;
  background-position: 0 -20%; opacity: 0;
}

/* ---------- installer ---------- */
.onglets-systeme {
  display: inline-flex; gap: 0.3rem; padding: 0.3rem;
  border: 1px solid var(--bord); border-radius: 14px;
  background: rgba(9, 12, 70, 0.6); margin-bottom: 1.2rem;
}
.onglets-systeme [role="tab"] {
  padding: 0.6rem 1.25rem; border: 0; border-radius: 10px;
  background: transparent; cursor: pointer;
  font: 500 1.1rem/1 var(--pixel); color: var(--brume);
  transition: background-color 0.2s, color 0.2s;
}
.onglets-systeme [role="tab"]:hover { color: var(--etoile); }
.onglets-systeme [aria-selected="true"] { background: var(--indigo); color: #fff; box-shadow: inset 0 0 0 1px rgba(59, 231, 255, 0.5); }
.panneau-systeme {
  max-width: 760px; padding: clamp(1.1rem, 3vw, 1.8rem);
  border: 1px solid var(--bord); border-radius: 14px; background: var(--panneau);
}
.panneau-systeme.mis-en-avant { animation: signale 1.6s ease-out; }
@keyframes signale { 0% { box-shadow: 0 0 0 3px var(--cyan), 0 0 36px rgba(59, 231, 255, 0.5); } 100% { box-shadow: 0 0 0 0 transparent; } }
.exigences { margin: 0 0 1rem; color: var(--brume); }
.etapes { margin: 0 0 1.2rem; padding: 0; list-style: none; counter-reset: etape; display: grid; gap: 0.9rem; }
.etapes li { counter-increment: etape; position: relative; padding-left: 2.8rem; max-width: 64ch; }
.etapes li::before {
  content: counter(etape);
  position: absolute; left: 0; top: -0.1rem;
  display: grid; place-items: center; width: 2rem; height: 2rem;
  border: 2px solid transparent; border-radius: 8px;
  background: linear-gradient(#0c0d14, #0c0d14) padding-box, var(--arc) border-box;
  font: 700 1rem/1 var(--texte);
}
.commande {
  display: flex; align-items: stretch; margin-top: 0.55rem; max-width: 100%;
  border: 1px solid var(--bord); border-radius: 8px; overflow: hidden; background: #05062a;
}
.commande code {
  flex: 1; min-width: 0; padding: 0.6rem 0.8rem; overflow-wrap: anywhere;
  font: 0.9rem/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: #d9f7ff;
}
.copier {
  flex: none; padding: 0 0.95rem; border: 0; border-left: 1px solid var(--bord);
  background: rgba(33, 174, 250, 0.14); cursor: pointer; font: 600 0.92rem/1 var(--texte);
  transition: background-color 0.2s;
}
.copier:hover { background: rgba(33, 174, 250, 0.3); }
.copier.fait { background: rgba(157, 240, 127, 0.25); }
.fichier {
  display: grid; gap: 0.35rem; padding-top: 1rem; border-top: 1px solid rgba(80, 140, 255, 0.25);
  font-size: 0.93rem; color: var(--brume);
}
.fichier .lien-fichier { font-size: 1.02rem; font-weight: 600; overflow-wrap: anywhere; }
.fichier .empreinte { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.fichier code { font: 0.8rem/1.4 ui-monospace, "SF Mono", Menlo, Consolas, monospace; overflow-wrap: anywhere; color: #c9d4ff; }
.fichier .copier { border: 1px solid var(--bord); border-radius: 6px; padding: 0.3rem 0.6rem; }
.ensuite { margin: 1.4rem 0 0; max-width: 62ch; color: var(--brume); }

/* ---------- pied : Rivelia Software ---------- */
.pied {
  display: grid; justify-items: center; gap: 1.6rem;
  padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1rem, 4vw, 3rem) 2.5rem;
  background: linear-gradient(180deg, rgba(6, 7, 54, 0.88) 0%, var(--abysse) 40%);
  text-align: center;
}
.signature { display: grid; justify-items: center; gap: 0.9rem; }
.signature .marque-rivelia { width: clamp(150px, 18vw, 210px); }
.signature p { margin: 0; font-size: 1.05rem; color: var(--etoile); }
.mentions { display: grid; gap: 0.5rem; max-width: 70ch; color: var(--brume); font-size: 0.88rem; }
.mentions p { margin: 0; }

/* ---------- annonce ---------- */
.annonce {
  position: fixed; left: 50%; bottom: 1.4rem; z-index: 40;
  width: max-content; max-width: calc(100vw - 2rem);
  padding: 0.85rem 1.2rem; border: 1px solid var(--cyan); border-radius: 12px;
  background: rgba(9, 12, 70, 0.94); box-shadow: 0 0 30px rgba(59, 231, 255, 0.3);
  transform: translateX(-50%);
}
.annonce a { margin-left: 0.4rem; }

/* ---------- petits écrans ---------- */
@media (max-width: 860px) {
  /* logo, accroche, fusion, puis téléchargement : le texte s'ouvre pour s'intercaler */
  .accueil { grid-template-columns: 1fr; min-height: auto; padding-bottom: 3.5rem; gap: 1.3rem; }
  .accueil-texte { display: contents; }
  .accueil h1 { order: 1; }
  .accroche { order: 2; }
  .fusion { order: 3; }
  .telecharger { order: 4; }
  .etat { order: 5; justify-self: start; }
  .anneau { width: min(82vw, 340px); }
  .logo { width: min(78vw, 360px); }
  .jeu-corps { grid-template-columns: 1fr; }
  .onglets-jeu { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .onglets-jeu [aria-selected="true"] .onglet-texte { display: none; }
  .ecran { order: -1; }
  body::before { background-image: url("images/fond-960.webp"); background-position: 18% top; }
}
.jeu-legende { display: none; margin: 0; color: var(--brume); }
@media (max-width: 860px) {
  .jeu-legende { display: block; order: -1; }
}

@media (prefers-reduced-motion: reduce) {
  .anneau, .etat.en-ligne .pastille { animation: none; }
  .bouton-principal::after { display: none; }
  .panneau-systeme.mis-en-avant { animation: none; box-shadow: 0 0 0 3px var(--cyan); }
  * { scroll-behavior: auto !important; }
}

/* Pixelify Sans : grands éléments seulement, sans ligature (« fi » s'y lit « A »)
   et à 400-500 (plus gras, le C se ferme et le 2 ressemble au 8). En fin de
   feuille : le raccourci « font » des règles précédentes remet les ligatures. */
h2, .bouton-texte, .fusion-nom, .ouverture-texte, .reglage, .bouton-fusion, .onglets-systeme [role="tab"] {
  font-variant-ligatures: none;
}
