

html:not(.boot-3d),
html:not(.boot-3d) body {
  overflow: visible !important;   
  overflow-x: hidden !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  position: static !important;
  inset: auto !important;
  touch-action: auto !important;
  overscroll-behavior: auto !important;
  -webkit-overflow-scrolling: touch;
}

html:not(.boot-3d) body {
  background: #0A0A0D;
}


#loaderLayer,
#app,
#hint,
#err,
#tunnelLayer,
#roomLayer,
#gyroBtn,
#brand,
#legalBar,
#accroche {
  display: none !important;
}

#overlayRoot {
  display: none !important;
}


html.boot-probing #loaderLayer,
html.boot-3d #loaderLayer,
html.boot-3d #app,
html.boot-3d #tunnelLayer,
html.boot-3d #overlayRoot {
  display: block !important;
}

html.boot-3d #roomLayer {
  display: block !important;
}

html.boot-3d #brand,
html.boot-3d #legalBar,
html.boot-3d #accroche {
  display: flex !important;
}

html.boot-3d #hint,
html.boot-3d #err {
  display: revert !important;
}

html.boot-3d #gyroBtn {
  display: none; 
}

html.boot-probing #accueil,
html.boot-3d #accueil {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}


* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  background: #000;
  overflow: hidden;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

#app {
  position: fixed;
  inset: 0;
  z-index: 7;
  opacity: 1;
}

canvas {
  display: block;
}

#hint {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 30px;
  z-index: 10;
  text-align: center;
  color: rgba(214, 200, 168, .55);
  font-size: 0.75rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  pointer-events: none;
  transition: opacity .6s ease;
}

#err {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  color: #e0a0a0;
  font-size: 13px;
  text-align: center;
  padding: 40px;
  z-index: 30;
}



#tunnelLayer {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: none;
}

#tunnelCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

#tunnelFade {
  position: fixed;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  z-index: 6;
}



#loaderLayer {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow: hidden;
  background:
    radial-gradient(120% 120% at 30% 45%, #17110c 0%, #0a0704 55%, #000 100%);
  display: flex;
  align-items: center;
  transition: opacity .5s ease;
  pointer-events: none;
}

#loaderLayer.is-bg-off {
  background: transparent;
}

#loaderLayer.is-hidden {
  opacity: 0;
}

.loader-inner {
  position: relative;
  z-index: 1;
  padding-left: 8vw;          
  color: #d8cbb0;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .55);
}

.loader-brand {
  font-size: clamp(24px, 4.4vw, 32px);
  font-weight: 300;
  letter-spacing: .06em;
  line-height: 1;
  color: #efe6d2;
  margin-bottom: 9px;          
  padding-left: .06em;
  text-shadow: 0 2px 22px rgba(0, 0, 0, .6);
}

.loader-brand b {
  font-weight: 500;
  color: #f6efdf;
}

.loader-brand span {
  color: #ffe6b0;
  text-shadow: 0 0 22px rgba(255, 210, 140, .45), 0 2px 22px rgba(0, 0, 0, .6);
}

.loader-tagline {
  font-size: 0.75rem;
  letter-spacing: clamp(.18em, .8vw, .34em);
  text-transform: uppercase;
  font-weight: 400;
  white-space: nowrap;
  color: rgba(216, 203, 176, .58);
  margin-bottom: 26px;
  padding-left: .3em;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .55);
}

.loader-tagline i {
  font-style: normal;
  color: rgba(255, 230, 176, .75);
  padding: 0 .55em 0 .35em;
  text-shadow: 0 0 12px rgba(255, 210, 140, .45);
}

.loader-title {
  font-size: 15px;
  letter-spacing: .55em;
  text-transform: uppercase;
  color: rgba(216, 203, 176, .55);
  margin-bottom: 6px;
  padding-left: .3em;
}

.loader-pct {
  display: flex;
  align-items: flex-start;
  line-height: .9;
  font-weight: 300;
  color: #efe6d2;
}

.loader-pct #loaderNum {
  font-size: 92px;
  letter-spacing: .01em;
  font-variant-numeric: tabular-nums;
}

.loader-pct .loader-sign {
  font-size: 34px;
  margin-top: .5em;
  margin-left: .12em;
  color: rgba(239, 230, 210, .8);
}

.loader-rule {
  width: 250px;
  max-width: 60vw;
  height: 1px;
  margin: 14px 0 12px;
  background: linear-gradient(90deg,
    rgba(216, 203, 176, .5) 0%,
    rgba(216, 203, 176, .25) 55%,
    rgba(216, 203, 176, 0) 100%);
  position: relative;
}

.loader-rule::after {
  content: "";
  position: absolute;
  right: 30%;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ffe6b0;
  box-shadow: 0 0 8px 2px rgba(255, 210, 140, .7);
  transform: translateY(-50%);
}

.loader-sub {
  font-size: 12px;
  letter-spacing: .42em;
  text-transform: uppercase;
  color: rgba(216, 203, 176, .55);
  padding-left: .3em;
}

/* Retour dans la salle par /#room (html.room-entry, posé par boot-3d.js) : ni message, ni progression,
   ni fond papier. Un fond uni, la couleur de fin de l'écran de transition, effacé d'un bloc quand la
   salle est dévoilée (overlay.js). Après 2 s sans salle (cache vide, réseau lent) : indicateur discret. */
html.room-entry #loaderLayer,
html.room-entry #loaderLayer.is-bg-off {
  background: #0A0A0D;
  transition: none;
}
html.room-entry #loaderLayer .loader-inner { display: none; }
html.room-entry #loaderLayer::after {
  content: "chargement de la salle…";
  position: absolute;
  left: 0; right: 0; bottom: 18vh;
  text-align: center;
  font-family: "Chakra Petch", system-ui, sans-serif;
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(214, 231, 233, .55);
  opacity: 0;
  animation: kf-attente-salle 0s linear 2s forwards;
}
@keyframes kf-attente-salle { to { opacity: 1; } }
