/* ── Reset ── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
}

/* ── Fallback gradient ── */
.bg-fallback {
  position: fixed;
  inset: 0;
  background: linear-gradient(145deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  z-index: -2;
}

/* ── Splash background image ── */
.bg-splash {
  position: fixed;
  inset: 0;
  background: url('../assets/image/fond-splash.jpg') center / cover no-repeat;
  z-index: -1;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.bg-splash.visible {
  opacity: 1;
}

/* ── Fullscreen videos (stacked) ── */
.bg-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  z-index: -1;
  opacity: 0;
  transition: opacity 1.2s ease;
  pointer-events: none;
}

.bg-video.visible {
  opacity: 1;
}


/* ── Screens (shared) ── */
.screen {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease;
}

.screen.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Layout helpers */
.screen-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}

.screen-bottom {
  padding-bottom: 2rem;
}

/* ── Shared image button ── */
.img-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: transform 0.15s ease;
  text-decoration: none;
}

.img-btn img {
  max-width: min(50vw, 480px);
  max-height: 28vh;
  width: auto;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.img-btn:hover {
  transform: scale(1.05);
}

.img-btn:active {
  transform: scale(0.97);
}

/* ── Splash ── */
#splash .logo {
  max-width: min(80vw, 1080px);
  max-height: 30vh;
  width: auto;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

/* ── Portal ── */
#portal {
  justify-content: center;
  gap: 26rem;
  padding: 2rem 1rem;
}

.portal-logo {
  max-width: min(60vw, 1050px);
  max-height: 25vh;
  width: auto;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.portal-nav {
  display: flex;
  gap: 13rem;
  align-items: flex-start;
}

/* ── Island ── */
#island .img-btn img {
  max-width: min(40vw, 500px);
  max-height: 35vh;
}

#island .screen-center {
  flex-direction: row;
  gap: 7rem;
  padding-top: 15rem;
}

#island #btn-retour img {
  max-width: min(20vw, 315px);
  min-width: 80px;
  max-height: 13vh;
}

/* ── Skip button ── */
.btn-skip {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 10;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.btn-skip img {
  height: 3rem;
  width: auto;
  display: block;
}

.btn-skip.visible {
  opacity: 1;
  pointer-events: auto;
}

.btn-skip:hover {
  opacity: 0.8;
}

/* ── Responsive ── */

/* Tablette portrait */
@media (max-width: 768px) {
  .img-btn img {
    max-width: min(60vw, 400px);
    max-height: 15vh;
  }

  #splash .logo {
    max-width: min(90vw, 600px);
    max-height: 25vh;
  }

  .portal-logo {
    max-width: min(80vw, 500px);
    max-height: 20vh;
  }

  .portal-nav {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
  }

  #island .screen-center {
    flex-direction: column;
    gap: 1.5rem;
  }

  #island .img-btn img {
    max-width: min(70vw, 400px);
    max-height: 20vh;
  }

  #island #btn-retour img {
    max-width: min(30vw, 120px);
    min-width: 70px;
    max-height: 5vh;
  }

  .screen-bottom {
    padding-bottom: 1.5rem;
  }
}

/* Mobile landscape */
@media (max-height: 500px) and (orientation: landscape) {
  .btn-skip {
    bottom: 0.5rem;
    right: 0.5rem;
  }

  .btn-skip img {
    height: 1.8rem;
  }

  #splash .logo {
    max-height: 30vh;
  }

  .screen-center {
    gap: 1rem;
  }

  #portal {
    gap: 7rem;
    padding: 1rem;
  }

  .portal-logo {
    max-height: 26vh;
  }

  .portal-nav {
    flex-direction: row;
    gap: 2rem;
  }

  .img-btn img {
    max-height: 30vh;
  }

  #island .screen-center {
    flex-direction: row;
    gap: 3rem;
    padding-top: 5rem;
  }

  #island .img-btn img {
    max-height: 40vh;
  }

  #island #btn-retour img {
    max-width: min(15vw, 110px);
    min-width: 60px;
    max-height: 15vh;
  }

  .screen-bottom {
    padding-bottom: 0.5rem;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .btn-skip {
    bottom: 1rem;
    right: 1rem;
  }

  .btn-skip img {
    height: 2.5rem;
  }

  .screen-center {
    gap: 1rem;
  }

  .screen-bottom {
    padding-bottom: 1rem;
  }

  #portal {
    padding: 1rem 0.5rem;
  }

  .img-btn img {
    max-width: min(80vw, 320px);
    max-height: 12vh;
  }

  #splash .logo {
    max-width: 95vw;
    max-height: 20vh;
  }

  .portal-logo {
    max-width: 90vw;
    max-height: 15vh;
  }

  .portal-nav {
    gap: 1rem;
  }

  #island .img-btn img {
    max-width: min(85vw, 320px);
    max-height: 18vh;
  }

  #island #btn-retour img {
    max-width: min(25vw, 80px);
    min-width: 50px;
    max-height: 3.5vh;
  }
}

