/* Page unique : en-tête, navigation des sections, sections plein écran avec défilement par section (l'accueil : css/accueil.css).
   Direction artistique du jeu : noir, rouge sang, titres qui dégoulinent (Rubik Wet Paint), libellés grunge (Rubik Dirt). */

.page-principale { overflow: hidden; }

/* ---------- En-tête ---------- */
.entete {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--marge);
  height: calc(var(--entete-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) max(var(--marge), env(safe-area-inset-right)) 0 max(var(--marge), env(safe-area-inset-left));
  background: linear-gradient(180deg, rgb(5 5 5 / 94%), rgb(5 5 5 / 0%));
  pointer-events: none;
}
.entete > * { pointer-events: auto; }
.entete-marques { display: flex; align-items: center; gap: 12px; min-width: 0; }
.entete-logo { font-size: 1.6rem; padding-bottom: 0.2em; }
/* Logo du studio à gauche du logo du jeu : à partir de 600 px (trop serré sur téléphone). */
.entete-studio, .entete-separateur { display: none; }
@media (min-width: 600px) {
  .entete-studio { display: block; height: 44px; }
  .entete-separateur { display: block; width: 1px; height: 36px; background: var(--color-border); opacity: 0.6; }
}

/* À droite : « Bientôt disponible », le bouton de son et le globe de langue. */
.entete-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.langue-entete .langue-bouton { min-height: 40px; min-width: 40px; padding: 0 9px; }
.entete-actions .son-bouton { width: 40px; height: 40px; }

/* « Bientôt disponible » : pas cliquable, aspect atténué. */
.bouton-bientot {
  min-height: 40px;
  padding: 0 0.9em;
  border: 1px dashed var(--color-action);
  background: rgb(216 20 20 / 10%);
  color: var(--color-action-text);
  font-family: var(--font-label);
  font-weight: 400;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  cursor: default;
  user-select: none;
}

/* Téléphone : logo, « Bientôt disponible » et globe tiennent sur une ligne (globe sans le code de langue). */
@media (max-width: 599px) {
  .entete { gap: 8px; }
  .entete-logo { font-size: 1.4rem; }
  .entete-actions { gap: 6px; }
  .bouton-bientot { min-height: 38px; padding: 0 0.55em; font-size: 0.68rem; letter-spacing: 0.02em; }
  .langue-entete .langue-bouton { min-height: 38px; min-width: 38px; padding: 0; justify-content: center; }
  .langue-entete .langue-code { display: none; }
  .entete-actions .son-bouton { width: 38px; height: 38px; }
  .entete-actions .son-icone { width: 20px; height: 20px; }
}
/* Téléphones jusqu'à 420 px : le bouton de son prend place dans l'en-tête, on resserre un peu. */
@media (max-width: 420px) {
  .entete-logo { font-size: 1.25rem; }
  .entete-actions { gap: 5px; }
  .bouton-bientot { padding: 0 0.45em; font-size: 0.62rem; }
}

/* ---------- Navigation des sections ---------- */
/* Téléphone : barre d'onglets en bas de l'écran. */
.nav-sections {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 20;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgb(5 5 5 / 95%);
  border-top: 1px solid rgb(216 20 20 / 45%);
  backdrop-filter: blur(8px);
}
.nav-sections ol { display: flex; height: 100%; padding: 0 4px; }
.nav-sections li { flex: 1 1 auto; min-width: 0; }
.nav-sections a {
  position: relative;
  z-index: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 2px;
  color: var(--color-text-muted);
  text-decoration: none;
  font-family: var(--font-label);
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 200ms;
}
.nav-num { font-family: var(--font-sans); font-weight: 700; font-size: 0.65rem; opacity: 0.7; }
.nav-sections a::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 20%;
  right: 20%;
  height: 3px;
  background: var(--color-action);
  box-shadow: 0 0 10px var(--color-action-glow);
  transform: scaleX(0);
  transition: transform 300ms var(--courbe);
}
.nav-sections a[aria-current="true"] { color: var(--color-text); }
.nav-sections a[aria-current="true"]::before { transform: scaleX(1); }
.nav-sections .brush { display: none; }

/* Sur l'accueil (vidéo plein écran), l'en-tête et la navigation s'effacent ; ils reviennent dès News. */
.entete, .nav-sections { transition: opacity 300ms ease, visibility 0s; }
.js body[data-section="accueil"] .entete,
.js body[data-section="accueil"] .nav-sections {
  opacity: 0;
  visibility: hidden;
  transition: opacity 300ms ease, visibility 0s 300ms;
}

/* ---------- Conteneur des sections : défilement qui s'arrête sur chaque section ---------- */
.sections {
  position: fixed;
  inset: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.sections::-webkit-scrollbar { display: none; }

.section {
  position: relative;
  display: flex;
  min-height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  padding:
    calc(var(--entete-h) + env(safe-area-inset-top) + 8px)
    max(var(--marge), env(safe-area-inset-right))
    calc(var(--nav-h) + env(safe-area-inset-bottom) + var(--marge))
    max(var(--marge), env(safe-area-inset-left));
  overflow: hidden;
  isolation: isolate;
}
/* Grand numéro décoratif en fond de section. */
.section::after {
  content: attr(data-num);
  position: absolute;
  z-index: -1;
  right: -0.05em;
  bottom: -0.15em;
  font-family: var(--font-display);
  font-size: clamp(10rem, 55vw, 28rem);
  line-height: 1;
  color: rgb(216 20 20 / 6%);
  pointer-events: none;
}
.section-news { background: radial-gradient(90% 60% at 0% 0%, rgb(216 20 20 / 10%), transparent 60%), var(--color-bg); }
.section-characters { background: radial-gradient(90% 60% at 100% 30%, rgb(216 20 20 / 12%), transparent 60%), #0a0a0b; }
.section-about { background: radial-gradient(90% 60% at 100% 100%, rgb(216 20 20 / 10%), transparent 60%), #0a0a0b; }
.section-weapons { background: radial-gradient(90% 60% at 0% 100%, rgb(216 20 20 / 10%), transparent 60%), var(--color-bg); }

.section-interieur {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  flex: 1;
  min-height: 0;
}

.section-entete { display: flex; align-items: baseline; gap: 0.6rem; }
.section-num { color: var(--color-action-text); font-family: var(--font-label); font-size: 1rem; letter-spacing: 0.06em; }
.section-titre {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.2rem, 10.8vw, 5.5rem);
  line-height: 1.05;
  color: var(--color-action);
  text-shadow: 0 0 18px var(--color-action-glow);
}
.section-intro { align-self: flex-start; }

/* ---------- Apparition à l'entrée de chaque section ---------- */
.js .revele {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity var(--duree) var(--courbe),
    transform var(--duree) var(--courbe);
  transition-delay: calc(var(--i, 0) * 90ms);
}
.js .section-entete.revele { transform: translateX(-32px); }
.js .est-visible .revele { opacity: 1; transform: none; }

/* ---------- News : css/actualites.css (lot 3b) ---------- */

/* ---------- Characters ---------- */
.perso-scene { flex: 1; min-height: 200px; }
.perso-miniatures { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.perso-miniature {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  aspect-ratio: 1;
  max-height: 96px;
  padding: 6px;
  border: 1px solid var(--color-surface-raised);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  text-align: left;
  cursor: pointer;
  transition: border-color 200ms, background-color 200ms, box-shadow 200ms;
}
.perso-miniature-num { font-family: var(--font-label); font-size: 0.75rem; color: var(--color-action-text); }
.perso-miniature-nom { font-size: 0.72rem; font-weight: 700; line-height: 1.2; color: var(--color-text-muted); }
.perso-miniature[aria-pressed="true"] { border-color: var(--color-action); background: #1d0b0b; box-shadow: 0 0 12px var(--color-action-glow); }
.perso-miniature[aria-pressed="true"] .perso-miniature-nom { color: var(--color-text); }

/* ---------- Weapons ---------- */
.arme-choix { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.arme-bouton {
  flex: 1 1 auto;
  min-height: 40px;
  padding: 0 8px;
  white-space: nowrap;
  border: 1px solid var(--color-surface-raised);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  font-family: var(--font-label);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 200ms, background-color 200ms, color 200ms;
}
.arme-bouton[aria-pressed="true"] { border-color: var(--color-action); background: var(--color-action); color: var(--color-on-action); }

.arme-corps { display: flex; flex-direction: column; gap: 12px; flex: 1; min-height: 0; }
.arme-scene { flex: 1; min-height: 140px; }
.arme-stats { display: grid; gap: 8px; margin: 0; }
.arme-stat { display: grid; grid-template-columns: 6.5rem 1fr; align-items: center; gap: 10px; }
.arme-stat-nom { font-family: var(--font-label); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-text-muted); }
.arme-stat dd { display: flex; align-items: center; gap: 10px; margin: 0; }
.arme-stat-barre { position: relative; flex: 1; height: 6px; border-radius: 3px; background: var(--color-surface-raised); overflow: hidden; }
.arme-stat-remplissage {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--color-action-deep), var(--color-action));
  transform-origin: left;
  transform: scaleX(var(--valeur, 0));
  transition: transform 700ms var(--courbe) 200ms;
}
.js .section:not(.est-visible) .arme-stat-remplissage { transform: scaleX(0); }
.arme-stat-valeur { width: 2.2em; text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 0.9rem; }

/* ---------- Sections à venir (Personnages, Armes) : contenu provisoire atténué + encart « Prochainement » / « Coming soon » ---------- */
.est-a-venir .section-interieur { position: relative; }
.a-venir-contenu {
  display: flex;
  flex-direction: column;
  gap: inherit;
  flex: 1;
  min-height: 0;
  opacity: 0.22;
  filter: grayscale(0.6) blur(1.5px);
  user-select: none;
}
.a-venir-encart {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 55%;
  padding: 0.3em 1.1em 0.4em;
  border-radius: var(--radius-sm);
  background: var(--color-action);
  color: var(--color-on-action);
  font-family: var(--font-label);
  font-size: clamp(1.6rem, 7.5vw, 4rem);
  letter-spacing: 0.06em;
  line-height: 1.1;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: inset 0 0 0 3px rgb(0 0 0 / 30%), 0 0 32px var(--color-action-glow), 0 14px 34px rgb(0 0 0 / 65%);
  transform: translate(-50%, -50%) rotate(-4deg);
}
/* Bandes de chantier au-dessus et en dessous de l'encart. */
.a-venir-encart::before,
.a-venir-encart::after {
  content: "";
  position: absolute;
  left: 6%;
  right: 6%;
  height: 8px;
  background: repeating-linear-gradient(-45deg, var(--color-action-deep) 0 10px, #050505 10px 20px);
}
.a-venir-encart::before { top: -12px; }
.a-venir-encart::after { bottom: -12px; }
/* Apparition « tampon » à l'entrée de la section (coupée en mouvement réduit). */
.js .est-a-venir .a-venir-encart {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(-4deg) scale(1.35);
  transition: opacity 350ms ease 250ms, transform 450ms cubic-bezier(0.2, 1.4, 0.4, 1) 250ms;
}
.js .est-a-venir.est-visible .a-venir-encart { opacity: 1; transform: translate(-50%, -50%) rotate(-4deg); }

/* ---------- About us ---------- */
.about-corps { display: flex; flex-direction: column; gap: 16px; }
.about-studio { align-self: center; }
.about-logo { width: min(48vw, 190px); filter: drop-shadow(0 6px 24px rgb(0 0 0 / 70%)); }
.about-texte { display: flex; flex-direction: column; gap: 10px; }
.about-signature { font-family: var(--font-label); font-size: 1.05rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--color-action-text); }
.about-paragraphe { color: var(--color-text); }
.about-credits { display: grid; gap: 4px; margin: 0; }
.about-credit { display: flex; gap: 10px; align-items: baseline; }
.about-credit-titre { font-family: var(--font-label); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-text-muted); }
.about-credit-noms { margin: 0; font-weight: 700; }

/* Pied de page (dernière section), comme le bas de page des sites de jeux : logo du studio + mentions. */
.pied {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--color-surface-raised);
}
.pied-studio { width: 52px; flex: none; }
.pied-texte { display: flex; flex-direction: column; gap: 2px; font-size: 0.78rem; color: var(--color-text-muted); }
.pied-copyright { color: var(--color-text); font-weight: 700; }

/* ---------- Ordinateur ---------- */
@media (min-width: 900px) {
  :root { --marge: 32px; --entete-h: 84px; --nav-h: 0px; }
  .entete-marques { gap: 16px; }
  .entete-studio { height: 60px; }
  .entete-separateur { height: 44px; }

  .entete-logo { font-size: 2.1rem; }
  .bouton-bientot { min-height: 44px; font-size: 0.9rem; }

  /* Navigation verticale à droite, coup de pinceau sur l'entrée affichée (comme les menus du jeu). */
  .nav-sections {
    inset: 50% max(var(--marge), env(safe-area-inset-right)) auto auto;
    height: auto;
    padding: 0;
    background: none;
    border: 0;
    backdrop-filter: none;
    transform: translateY(-50%);
  }
  .nav-sections ol { flex-direction: column; align-items: flex-end; gap: 8px; padding: 0; }
  .nav-sections a {
    flex-direction: row;
    justify-content: flex-end;
    gap: 10px;
    height: 40px;
    padding: 0 12px 0 16px;
    font-size: 1rem;
  }
  .nav-sections a::before { display: none; }
  .nav-sections .brush { display: block; }
  .nav-sections a[aria-current="true"],
  .nav-sections a:hover,
  .nav-sections a:focus-visible { color: var(--color-action); }
  .nav-sections a[aria-current="true"] .brush,
  .nav-sections a:hover .brush,
  .nav-sections a:focus-visible .brush { opacity: 1; }

  .section { padding-right: calc(var(--marge) + 170px); padding-bottom: var(--marge); }
  .section-interieur { gap: 20px; }
  .section-news .section-interieur { justify-content: center; }
  .section-num { font-size: 1.25rem; }

  .perso-miniatures { grid-template-columns: repeat(4, 120px); }

  .arme-choix { overflow: visible; }
  .arme-bouton { flex: 0 0 auto; padding: 0 16px; }
  .arme-corps { flex-direction: row; align-items: stretch; }
  .arme-scene { flex: 1.4; }
  .arme-stats { flex: 1; align-content: center; gap: 18px; }

  .section-about .section-interieur { justify-content: center; }
  .about-corps { flex-direction: row; align-items: center; gap: 56px; margin-block: auto; }
  .about-logo { width: clamp(240px, 26vw, 380px); }
  .about-texte { max-width: 34rem; gap: 14px; }
  .about-signature { font-size: 1.4rem; }
  .about-paragraphe { font-size: 1.1rem; }
  .pied { margin-top: 0; }
  .pied-studio { width: 64px; }
  .pied-texte { font-size: 0.85rem; }
}

/* Écrans bas (téléphone en paysage) : on resserre. */
@media (max-height: 520px) and (max-width: 899px) {
  :root { --entete-h: 50px; --nav-h: 48px; }
  .entete-logo { font-size: 1.35rem; }
  .section-titre { font-size: 2.1rem; }
  .section-interieur { gap: 8px; }
  .perso-scene, .arme-scene { min-height: 120px; }
  .perso-miniature { aspect-ratio: auto; height: 56px; }
  .arme-corps { flex-direction: row; }
  .arme-scene { flex: 1; }
  .arme-stats { flex: 1; align-content: center; }
  .about-corps { flex-direction: row; align-items: center; }
  .about-logo { width: 140px; }
}

@media (prefers-reduced-motion: reduce) {
  .js .revele, .js .section-entete.revele { opacity: 1; transform: none; }
  .js .est-a-venir .a-venir-encart { opacity: 1; transform: translate(-50%, -50%) rotate(-4deg); }
  .js .section:not(.est-visible) .arme-stat-remplissage { transform: scaleX(var(--valeur, 0)); }
  .sections { scroll-behavior: auto; }
}

/* Très petits téléphones (320 px) : les trois armes tiennent sur une ligne. */
@media (max-width: 360px) {
  .arme-bouton { font-size: 0.72rem; padding: 0 5px; letter-spacing: 0; }
  .arme-choix { gap: 6px; }
  /* En-tête et navigation à cinq entrées : on resserre encore. */
  .entete-logo { font-size: 1.2rem; }
  .bouton-bientot { padding: 0 0.4em; font-size: 0.6rem; letter-spacing: 0; }
  /* Avec le bouton de son, « Bientôt disponible » passe sur deux lignes. */
  .bouton-bientot { max-width: 6.4em; white-space: normal; line-height: 1.1; text-align: center; }
  .nav-sections a { font-size: 0.62rem; letter-spacing: 0; }
}
