body {
  margin: 0;
  height: 100vh;
  background: black;
  color: white;
  font-family: Arial, sans-serif;
  position: relative;
}

body::before {
  content: "";
  display: none;
}

body.warp-enabled::before {
  display: none;
}

#cosmos-bg {
  position: fixed;
  inset: -6vh -6vw;
  background: url("assets/fondmap2Dnebuleuse.png") center/cover no-repeat;
  z-index: 0;
  pointer-events: none;
  transform: translate3d(0, 0, 0) scale(1.08);
  will-change: transform;
}

#cosmos-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 40%, rgba(0,0,0,0.15), rgba(0,0,0,0.55));
}

#backgroundWarp {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  will-change: transform;
}

#warpFallback {
  position: fixed;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255,255,255,0.12), rgba(255,255,255,0) 65%);
  mix-blend-mode: screen;
  filter: blur(8px);
  pointer-events: none;
  z-index: 1;
}

#bgCam {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  display: none;
}

body.space-void #bgCam {
  display: block;
}

.splash {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 40%, rgba(0,255,255,0.1), rgba(0,0,0,0.98) 65%);
  z-index: 10;
  transition: opacity 300ms ease, transform 300ms ease;
}

.splash.is-hidden {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

.splash__btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  padding: 14px 18px;
  border-radius: 999px;
  font-size: 18px;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.splash__btn:hover {
  background: rgba(255,255,255,0.08);
}

.home {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: radial-gradient(circle at 50% 40%, rgba(0,255,255,0.08), rgba(0,0,0,0.95) 60%);
  z-index: 8;
  transition: opacity 300ms ease, transform 300ms ease;
}

.home.is-hidden {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

.home__title {
  background: transparent;
  border: 0;
  color: white;
  font-size: 56px;
  letter-spacing: 0.4em;
  cursor: pointer;
}

.home__search {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 250ms ease, transform 250ms ease;
}

.home.is-expanded .home__search {
  opacity: 1;
  transform: translateY(0);
}

.home__search input {
  width: min(420px, 80vw);
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: white;
  font-size: 16px;
  outline: none;
}

.home__search button {
  margin-left: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: white;
  font-size: 14px;
  cursor: pointer;
}

.home__search button:hover {
  background: rgba(255,255,255,0.12);
}

.home__hint {
  opacity: 0.5;
  font-size: 13px;
}

.panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px 16px;
  background: rgba(17, 17, 17, 0.92);
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 5;
  backdrop-filter: blur(6px);
  transition: transform 400ms ease, opacity 300ms ease;
}

.panel.is-hidden {
  opacity: 0;
  transform: translateY(100%);
  pointer-events: none;
}

.panel h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.08em;
}

.panel p {
  margin: 0;
  opacity: 0.8;
  font-size: 14px;
}

.stage {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  cursor: grab;
  user-select: none;
  z-index: 2;
  touch-action: none;
  background: transparent;
}

#world {
  position: relative;
  z-index: 1;
  transform-origin: 0 0;
}

.region-layer {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.region-cloud {
  position: absolute;
  border-radius: 32% 38% 42% 36%;
  background: var(--region-color, rgba(120, 200, 255, 0.2));
  box-shadow:
    0 0 80px 20px var(--region-glow, rgba(120, 200, 255, 0.4)),
    inset 0 0 60px rgba(255, 255, 255, 0.12);
  filter: blur(6px);
  opacity: 1;
  pointer-events: none;
}

.region-label {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-family: "Space Grotesk", sans-serif;
  font-size: 22px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  text-shadow: 0 0 16px rgba(255, 255, 255, 0.28);
  pointer-events: none;
  filter: none;
}

#moodOverlay {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -52%) scale(0.98);
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(36px, 6vw, 110px);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  background: linear-gradient(110deg, rgba(255, 255, 255, 0.92) 0%, rgba(200, 230, 255, 0.6) 45%, rgba(255, 230, 200, 0.75) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow:
    0 0 32px rgba(255, 255, 255, 0.28),
    0 0 90px rgba(255, 255, 255, 0.18);
  mix-blend-mode: normal;
  pointer-events: none;
  opacity: 0;
  transition: opacity 260ms ease, transform 260ms ease;
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  width: auto;
  max-width: 100vw;
  overflow: visible;
  text-align: center;
  padding: 0 5vw;
  box-sizing: border-box;
}

#moodOverlay.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  animation: moodGlow 3.6s ease-in-out infinite;
}

@keyframes moodGlow {
  0% {
    filter: drop-shadow(0 0 18px rgba(255, 255, 255, 0.15));
  }
  50% {
    filter: drop-shadow(0 0 42px rgba(255, 255, 255, 0.3));
  }
  100% {
    filter: drop-shadow(0 0 18px rgba(255, 255, 255, 0.15));
  }
}

.debug-cursor {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 0, 120, 0.9);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 5;
}

.debug-readout {
  position: fixed;
  left: 16px;
  bottom: 16px;
  padding: 6px 10px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  pointer-events: none;
  z-index: 6;
}

#inputDebug {
  position: fixed;
  left: 16px;
  top: 16px;
  padding: 6px 10px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  pointer-events: none;
  z-index: 1000;
}

#triangleGesture {
  position: fixed;
  width: 140px;
  height: 140px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
  z-index: 7;
}

#triangleGesture svg {
  width: 100%;
  height: 100%;
}

#triangleGesture path {
  fill: none;
  stroke: rgba(255, 255, 255, 0.7);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#focusSeek {
  position: fixed;
  left: 0;
  top: 0;
  width: 280px;
  height: 16px;
  opacity: 0;
  pointer-events: none;
  z-index: 7;
  transform: translate(-50%, -50%);
  transition: opacity 180ms ease;
}

#focusSeek.is-visible {
  opacity: 1;
}

#focusSeek .focus-seek__bar {
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  height: 4px;
  background: rgba(255, 214, 0, 0.4);
  border-radius: 999px;
  transform: translateY(-50%);
  box-shadow: 0 0 10px rgba(255, 214, 0, 0.25);
}

#focusSeek .focus-seek__dot {
  position: absolute;
  left: 0;
  top: 50%;
  width: 12px;
  height: 12px;
  background: rgba(255, 214, 0, 0.9);
  border-radius: 999px;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px rgba(255, 214, 0, 0.45);
}

#listenerCursor.play {
  border-color: rgba(0, 255, 255, 0.9);
  box-shadow: 0 0 16px rgba(0, 255, 255, 0.75);
}

#listenerCursor.play::before,
#listenerCursor.play::after {
  opacity: 1;
  background: transparent;
}

#listenerCursor.play::after {
  width: 0;
  height: 0;
  border: 0;
}

#listenerCursor.play::before {
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 14px solid rgba(0, 255, 255, 0.9);
  transform: translate(-40%, -50%);
}

#listenerCursor.play {
  background: rgba(0, 255, 255, 0.08);
}

#triangleGesture.is-visible {
  opacity: 0.9;
}

#triangleGesture.is-complete {
  opacity: 1;
}

#triangleGesture.is-complete path {
  stroke: rgba(0, 255, 255, 0.95);
}

.constellation-line {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: visible;
}

.constellation-line__path {
  fill: none;
  stroke: rgba(214, 160, 64, 0.45);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px rgba(214, 160, 64, 0.35));
}

.space-void-line {
  position: fixed;
  height: 2px;
  background: linear-gradient(90deg, rgba(0,255,255,0.1), rgba(0,255,255,0.9));
  box-shadow: 0 0 12px rgba(0,255,255,0.45);
  transform-origin: 0 50%;
  opacity: 0;
  pointer-events: none;
  z-index: 4;
  transition: opacity 120ms ease;
}

.volume-slider {
  position: fixed;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.6;
  z-index: 4;
  pointer-events: auto;
  padding: 6px 8px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255,255,255,0.15);
}

.volume-slider input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 200px;
  background: rgba(255,255,255,0.35);
  border-radius: 999px;
  outline: none;
  writing-mode: bt-lr;
  display: block;
}

.volume-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0,255,255,0.9);
  box-shadow: 0 0 10px rgba(0,255,255,0.6);
  cursor: pointer;
}

.volume-slider input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0,255,255,0.9);
  border: 0;
  box-shadow: 0 0 10px rgba(0,255,255,0.6);
  cursor: pointer;
}

#listenerCursor.wifi {
  border-color: rgba(0,255,255,0.25);
  box-shadow: 0 0 10px rgba(0,255,255,0.35);
}

#listenerCursor.wifi::before,
#listenerCursor.wifi::after {
  background: rgba(0,255,255,0.4);
}

#listenerCursor.wifi {
  background:
    radial-gradient(circle at 50% 70%, rgba(0,255,255,0.8) 0 2px, transparent 3px),
    radial-gradient(circle at 50% 80%, rgba(0,255,255,0.35) 0 6px, transparent 7px),
    radial-gradient(circle at 50% 90%, rgba(0,255,255,0.25) 0 10px, transparent 11px);
}

.stage:active {
  cursor: grabbing;
}

#world {
  width: 2000px;
  height: 2000px;
  position: relative;
}

#listenerCursor {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 24px;
  height: 24px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(0, 255, 255, 0.6);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(0, 255, 255, 0.6);
  pointer-events: none;
}

#listenerCursor::before,
#listenerCursor::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: rgba(0, 255, 255, 0.8);
  transform: translate(-50%, -50%);
}

#listenerCursor::before {
  width: 1px;
  height: 32px;
}

#listenerCursor::after {
  width: 32px;
  height: 1px;
}

#astroWatermark {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  font-size: 36px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 178, 84, 0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 600ms ease;
  z-index: 1;
  white-space: nowrap;
  display: none;
}

body.space-void #homeOverlay,
body.space-void #introPanel,
body.space-void #astroWatermark,
body.space-void #audioLoad {
  display: none !important;
}

body.space-void {
  background: black;
}

body {
  background: url("assets/fondmap2Dnebuleuse.png") center/cover no-repeat fixed;
}

#astroWatermark.is-visible {
  opacity: 1;
}

#trackCard {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 98vw;
  max-width: 98vw;
  padding: 0;
  text-align: center;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: rgba(255, 200, 140, 0.28);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  line-height: 1;
  white-space: nowrap;
  transition: opacity 300ms ease;
  mix-blend-mode: screen;
}

#trackCard.is-visible {
  opacity: 1;
}

.node {
  position: absolute;
  cursor: pointer;
  transform: translate(-50%, -50%);
}

.label {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  opacity: 0;
  transition: opacity 220ms ease, transform 220ms ease;
  pointer-events: none;
  z-index: 2;
  white-space: nowrap;
}

.label.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) translateY(-8px);
}

.node__dot {
  width: 12px;
  height: 12px;
  background: cyan;
  border-radius: 50%;
  box-shadow: 0 0 15px cyan;
  transition: transform 220ms ease, box-shadow 220ms ease, opacity 220ms ease;
}

.node.is-snap-target .node__dot {
  transform: scale(1.35);
  box-shadow: 0 0 22px rgba(0, 255, 255, 0.9);
}

.label.is-snap-target {
  opacity: 1;
  transform: translate(-50%, -50%) translateY(-10px);
}

.constellation {
  position: absolute;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 250ms ease, transform 250ms ease;
  pointer-events: none;
}

.constellation.is-animating {
  pointer-events: none;
}

.constellation .satellite {
  transform: rotate(var(--angle)) translate(var(--radius));
}

.constellation.is-animating .satellite {
  animation: orbitReveal 1400ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
  opacity: 0;
}

.constellation.is-animating-out {
  pointer-events: none;
}

.constellation.is-animating-out .satellite {
  animation: orbitHide 1200ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.constellation__loading {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 300px;
  height: 300px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.ripple {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  background: radial-gradient(circle, rgba(255,255,255,0.12), transparent 60%);
  border-radius: 999px;
  mix-blend-mode: screen;
}

.ripple::before,
.ripple::after,
.ripple span {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background:
    radial-gradient(circle,
      transparent 58%,
      rgba(255,255,255,0.35) 60%,
      transparent 63%);
  filter: drop-shadow(0 0 6px rgba(255,255,255,0.12));
  transform: scale(0.3);
  opacity: 0;
  animation: ripple2 1400ms ease-out infinite;
}

.ripple::after {
  animation-delay: 0.45s;
  opacity: 0.85;
}

.ripple::before {
  animation-delay: 0.9s;
  opacity: 0.65;
}

@keyframes ripple2 {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }
  12% {
    opacity: 0.9;
  }
  65% {
    opacity: 0.35;
  }
  100% {
    transform: scale(30);
    opacity: 0;
  }
}

@keyframes orbitReveal {
  0% {
    opacity: 0;
    transform: rotate(var(--angle)) translate(0px) scale(0.6);
  }
  70% {
    opacity: 1;
    transform: rotate(var(--angle)) translate(var(--radius)) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: rotate(var(--angle)) translate(var(--radius)) scale(1);
  }
}

@keyframes orbitHide {
  0% {
    opacity: 1;
    transform: rotate(var(--angle)) translate(var(--radius)) scale(1);
  }
  60% {
    opacity: 1;
    transform: rotate(var(--angle)) translate(calc(var(--radius) * 0.4)) scale(0.85);
  }
  100% {
    opacity: 0;
    transform: rotate(var(--angle)) translate(0px) scale(0.6);
  }
}

.satellite {
  position: absolute;
  left: 0;
  top: 0;
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.85);
  box-shadow: 0 0 10px rgba(255,255,255,0.6);
  cursor: pointer;
}

.satellite:hover {
  box-shadow: 0 0 16px rgba(255,255,255,0.9);
}

#audioLoad {
#audioLoad {
  width: 200px;
  height: 8px;
  margin-top: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  overflow: hidden;
  opacity: 0;
  transform: scaleY(0.6);
  transition: opacity 200ms ease, transform 200ms ease;
}

#audioLoad.is-visible {
  opacity: 1;
  transform: scaleY(1);
}

#audioLoadBar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, rgba(0,255,255,0.2), rgba(0,255,255,0.9));
  transition: width 180ms ease;
}

#zGestureGuide {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
  z-index: 999;
}

#zGestureGuide.is-visible {
  opacity: 0;
}

#zGestureSvg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#zGesturePath {
  fill: none;
  stroke: rgba(180, 220, 255, 0.0);
  stroke-width: 1.2;
  stroke-dasharray: 6 10;
}

#zGestureGuide.is-active #zGesturePath {
  stroke: rgba(120, 255, 210, 0.0);
}

.z-dot {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(255,0,0,0);
  border: 2px solid rgba(255,0,0,0);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 12px rgba(255,0,0,0);
}

#zGestureGuide.is-active .z-dot {
  background: rgba(255,0,0,0);
  border-color: rgba(255,0,0,0);
  box-shadow: 0 0 16px rgba(255,0,0,0);
}
