/* Origin — accueil « la cabine » (29/11), par-dessus commun.css.
   Modèle choisi par le user : la page Blue Archive « Pandemonium Upon the Waves ». La cabine peinte plein écran,
   animée en vidéo calme, le logo Origin sculpté dans le panneau du fond ; en haut seulement le logo, les liens et
   « Télécharger le jeu ». Un seul écran, pas de défilement. */

html,
body {
  height: 100%;
}
body {
  min-height: 100svh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

/* ---------- La scène ---------- */
.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--night);
}
.scene__room {
  position: absolute;
  inset: 0;
  animation: room-in 1.2s ease backwards;
}
.scene__room img,
.scene__room video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: 50% 56%;
}
.scene__video {
  opacity: 0;
  transition: opacity 0.8s ease;
}
.scene.is-playing .scene__video {
  opacity: 1;
}
/* Assombrit le haut (logo) et le bas (pied) sans éteindre la pièce */
.scene__shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 85% 75% at 50% 45%, rgba(18, 13, 10, 0) 40%, rgba(18, 13, 10, 0.5) 100%),
    linear-gradient(180deg, rgba(18, 13, 10, 0.5) 0%, rgba(18, 13, 10, 0.12) 24%, rgba(18, 13, 10, 0) 45%, rgba(18, 13, 10, 0) 78%, rgba(18, 13, 10, 0.6) 100%);
  pointer-events: none;
}
@keyframes room-in {
  from {
    opacity: 0;
  }
}

/* ---------- Le centre : vide, la cabine et le logo gravé font tout ---------- */
.stage {
  position: relative;
  z-index: 5;
}
@media (max-width: 760px) {
  .scene__room img,
  .scene__room video {
    object-position: 50% 50%;
  }
}

/* ================================================================ La cabine en 3D (30/11)
   cabine3d.js pose un canvas WebGL sur la peinture et la vidéo, qui restent dessous (cachées) pour nourrir la
   texture. Les objets se visent sur la scène : le reste de la page laisse passer la souris. */
.stage {
  pointer-events: none;
}
.scene__gl {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.scene.is-3d .scene__still,
.scene.is-3d .scene__video {
  opacity: 0 !important;
}
/* Au toucher, le glissé horizontal tourne le regard dans la cabine (cabine3d.js) */
.scene.is-3d {
  touch-action: none;
}
.toast--aide {
  bottom: calc(86 * var(--u));
  max-width: calc(100vw - 32px);
  text-align: center;
  white-space: normal;
}

/* Boutons posés sur les objets : clavier et lecteurs d'écran ; sans WebGL, ce sont eux qu'on touche */
.spots {
  position: fixed;
  inset: 0;
  z-index: 4;
  display: none;
  pointer-events: none;
}
.scene.is-3d ~ .spots {
  display: block;
}
.spot {
  position: absolute;
  width: calc(90 * var(--u));
  height: calc(90 * var(--u));
  translate: -50% -50%;
  border-radius: 50%;
  pointer-events: auto;
  opacity: 0;
}
.scene.is-3d ~ .spots .spot {
  pointer-events: none;
}
.spot:focus-visible {
  opacity: 1;
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 2px;
}

/* Bulle au-dessus de l'objet survolé : la bulle du launcher (fond --overlay flouté), sans ombre ni contour */
.spot-tip {
  position: fixed;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: calc(2 * var(--u));
  padding: calc(10 * var(--u)) calc(16 * var(--u));
  border-radius: calc(14 * var(--u));
  background: rgba(16, 17, 21, 0.62);
  -webkit-backdrop-filter: blur(30px) saturate(1.2);
  backdrop-filter: blur(30px) saturate(1.2);
  pointer-events: none;
  translate: -50% calc(-100% - 10 * var(--u));
  opacity: 0;
  transform: translateY(calc(6 * var(--u)));
  transition:
    opacity 0.18s ease,
    transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  white-space: nowrap;
}
.spot-tip.is-on {
  opacity: 1;
  transform: none;
}
.spot-tip b {
  font-weight: 600;
  font-size: calc(16 * var(--u));
  color: #fff;
}
.spot-tip span {
  font-size: calc(13 * var(--u));
  color: rgba(255, 255, 255, 0.72);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(56 * var(--u));
  z-index: 70;
  padding: calc(12 * var(--u)) calc(20 * var(--u));
  border-radius: calc(14 * var(--u));
  background: rgba(16, 17, 21, 0.62);
  -webkit-backdrop-filter: blur(30px) saturate(1.2);
  backdrop-filter: blur(30px) saturate(1.2);
  font-size: calc(15 * var(--u));
  color: #fff;
  translate: -50% 0;
  opacity: 0;
  transform: translateY(calc(8 * var(--u)));
  transition:
    opacity 0.2s,
    transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}
.toast.is-on {
  opacity: 1;
  transform: none;
}

/* ---------------- Panneau ouvert par un objet (rubriques du launcher : carte pleine #121212, rayon 25) */
.voile {
  position: fixed;
  inset: 0;
  z-index: 60;
  outline: none;
}
/* Panneau ouvert : la barre et le pied s'effacent, seul le panneau reste sur la cabine */
.top,
.foot {
  transition: opacity 0.25s ease;
}
.voile-ouvert .top,
.voile-ouvert .foot {
  opacity: 0;
  pointer-events: none;
}
.voile[hidden] {
  display: none;
}
.voile__fond {
  position: absolute;
  inset: 0;
  background: rgba(6, 6, 8, 0.55);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.voile__boite {
  position: absolute;
  inset: calc(28 * var(--u)) calc(40 * var(--u));
  border-radius: calc(25 * var(--u));
  overflow: hidden;
  background: #121212;
  opacity: 0;
  transform: scale(0.98) translateY(calc(10 * var(--u)));
  transition:
    opacity 0.25s ease,
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.voile.is-on .voile__fond,
.voile.is-on .voile__boite {
  opacity: 1;
}
.voile.is-on .voile__boite {
  transform: none;
}
.voile__retour {
  position: absolute;
  top: calc(22 * var(--u));
  left: calc(26 * var(--u));
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: calc(5 * var(--u));
  height: calc(40 * var(--u));
  padding: 0 calc(16 * var(--u)) 0 calc(10 * var(--u));
  border-radius: calc(11 * var(--u));
  background: #1a1a1a;
  font-weight: 500;
  font-size: calc(16 * var(--u));
  color: rgba(255, 255, 255, 0.6);
  transition:
    background 0.15s,
    color 0.15s;
}
.voile__retour:hover {
  background: #232323;
  color: #fff;
}
.voile__retour svg {
  width: calc(20 * var(--u));
  height: calc(20 * var(--u));
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.voile__corps,
.voile__page {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #121212;
}

/* Carte du monde */
.monde {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: calc(18 * var(--u));
  padding: calc(82 * var(--u)) calc(40 * var(--u)) calc(28 * var(--u));
}
.monde__k {
  margin: 0 0 calc(6 * var(--u));
  font-weight: 500;
  font-size: calc(15 * var(--u));
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ee1c57;
}
.monde__t {
  margin: 0;
  font-weight: 500;
  font-size: calc(40 * var(--u));
  line-height: 1.1;
  color: #fcfcfc;
}
.monde__s {
  margin: calc(6 * var(--u)) 0 0;
  font-size: calc(17 * var(--u));
  color: rgba(255, 255, 255, 0.45);
}
.monde__zone {
  container-type: size;
  min-height: 0;
  display: grid;
  place-items: center;
}
.monde__carte {
  position: relative;
  width: min(100cqw, 100cqh * 1.7917);
  aspect-ratio: 2752 / 1536;
  border-radius: calc(20 * var(--u));
  overflow: hidden;
  background: #0d0d0d;
}
.monde__carte > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}
.ile {
  position: absolute;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(8 * var(--u));
  translate: -50% -50%;
}
.ile i {
  width: calc(16 * var(--u));
  height: calc(16 * var(--u));
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 calc(5 * var(--u)) rgba(238, 28, 87, 0.45);
  animation: pouls 2.4s ease-in-out infinite;
}
@keyframes pouls {
  50% {
    box-shadow: 0 0 0 calc(9 * var(--u)) rgba(238, 28, 87, 0.15);
  }
}
.ile span {
  padding: calc(6 * var(--u)) calc(12 * var(--u));
  border-radius: calc(11 * var(--u));
  background: rgba(16, 17, 21, 0.62);
  -webkit-backdrop-filter: blur(30px) saturate(1.2);
  backdrop-filter: blur(30px) saturate(1.2);
  font-weight: 500;
  font-size: calc(15 * var(--u));
  color: #fff;
  white-space: nowrap;
  transition: background 0.15s;
}
.ile:hover span,
.ile[data-on] span {
  background: #ee1c57;
}
.monde__fiche {
  position: absolute;
  right: calc(56 * var(--u));
  bottom: calc(52 * var(--u));
  z-index: 2;
  width: calc(360 * var(--u));
  border-radius: calc(20 * var(--u));
  overflow: hidden;
  background: #121212;
}
.monde__fiche.is-on {
  animation: fiche 0.36s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes fiche {
  from {
    opacity: 0;
    transform: translateY(calc(12 * var(--u)));
  }
}
.monde__fiche img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.monde__fiche div {
  padding: calc(16 * var(--u)) calc(20 * var(--u)) calc(20 * var(--u));
}
.monde__fiche h3 {
  margin: 0;
  font-weight: 500;
  font-size: calc(24 * var(--u));
  color: #fcfcfc;
}
.monde__fiche p {
  margin: calc(4 * var(--u)) 0 0;
  font-size: calc(15 * var(--u));
  color: rgba(255, 255, 255, 0.6);
}

@media (max-width: 760px) {
  .voile__boite {
    inset: 10px;
    border-radius: 20px;
  }
  .voile__retour {
    top: 12px;
    left: 12px;
    height: 36px;
    font-size: 14px;
  }
  .monde {
    padding: 60px 14px 14px;
  }
  .monde__t {
    font-size: 28px;
  }
  .ile span {
    font-size: 11px;
    padding: 3px 7px;
  }
  .ile i {
    width: 10px;
    height: 10px;
  }
  .monde__fiche {
    left: 14px;
    right: 14px;
    bottom: 14px;
    width: auto;
  }
}
