/* === oXni — Multigalaxies complètes === */



/* -------- Base -------- */
body {
  margin: 0;
  background: #000;
  font-family: "Orbitron", sans-serif;
  color: white;
  height: 100vh;
  overflow: hidden;
  cursor: none;
}

/* -------- Galaxies -------- */
.galaxy {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  z-index: 20;
}

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

.orbit {
  fill: none;
  stroke: rgba(255,255,255,0.25);
  stroke-width: 2;
}

/* -------- Texte des galaxies -------- */
text.title {
  fill: #0f0;
  font-size: 64px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: auto;
  cursor: pointer;
  font-family: "Orbitron";
  filter: drop-shadow(0 0 10px #0f0);
}

/* -------- Panneau latéral -------- */
#sidePanel {
  position: fixed;
  top: 0;
  right: -420px;
  width: 420px;
  height: 100%;
  /* couleur du fond */
  /* couleur du fond */
  /* couleur du fond */
  /* couleur du fond */

  background: #030;
  /* couleur du fond */
  /* couleur du fond */
  /* couleur du fond */

  border-left: 2px solid #0f0;
  color: #0f0;
  padding: 20px;
  box-sizing: border-box;
  transition: right 0.5s ease;
  overflow-y: auto;
  font-family: "Orbitron";
  z-index: 500 !important;
}
#sidePanel.open { right: 0; }

#panelButtons {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}
#panelButtons button {
  background: #0f0;
  color: #000;
  border: none;
  padding: 6px 10px;
  cursor: pointer;
  font-weight: 700;
  font-family: "Orbitron";
}
#panelButtons button:hover { background: #5f5; }

#panelOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 400 !important;
}
#panelOverlay.visible {
  opacity: 1;
  pointer-events: auto;
}

/* -------- Effet de voyage -------- */
#travelEffect {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0) 60%);
  opacity: 0;
  z-index: 200;
  pointer-events: none;
  transform: scale(1);
  transition: opacity 1s ease, transform 1.5s ease;
}
#travelEffect.active {
  opacity: 1;
  transform: scale(3);
  animation: shake 0.3s linear 4;
}
@keyframes shake {
  0% { transform: translate(0,0) scale(3); }
  25% { transform: translate(10px,-5px) scale(3); }
  50% { transform: translate(-10px,5px) scale(3); }
  75% { transform: translate(5px,10px) scale(3); }
  100% { transform: translate(0,0) scale(3); }
}

/* -------- Curseur fusée -------- */
#cursorShip {
  position: fixed;
  pointer-events: none;
  width: 60px;
  height: 60px;
  transition: transform 0.1s ease, filter 0.1s ease;
  z-index: 99999;
}

#cursorShip.cursorPlanet {
  animation: pulseCursor 0.35s infinite alternate;
  transform: scale(1.45) rotate(var(--angle, 0deg));
  filter:
    drop-shadow(0 0 18px #00ff88)
    drop-shadow(0 0 28px #ffff66)
    brightness(2.2);
}

@keyframes pulseCursor {
  from {
    transform: scale(1.35) rotate(var(--angle, 0deg));
    filter:
      drop-shadow(0 0 14px #00ff66)
      drop-shadow(0 0 24px #ffff55)
      brightness(1.8);
  }
  to {
    transform: scale(1.55) rotate(var(--angle, 0deg));
    filter:
      drop-shadow(0 0 26px #00ff00)
      drop-shadow(0 0 40px #ffffaa)
      brightness(2.6);
  }
}

/* --- Menu galaxies --- */
/* #galaxyMenu {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 150;
}
.galaxyItem {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: auto;
}
.galaxyButton {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  cursor: none;
  transition: transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.galaxyButton:hover {
  animation: galaxyPulse 1.8s infinite ease-in-out;
}
.galaxyLabel {
  font-family: "Orbitron";
  font-size: 13px;
  color: #0f0;
  margin-top: 4px;
  text-align: center;
} */
@keyframes galaxyPulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.7); }
  100% { transform: scale(1); }
}

/* === Positions étendues === */
/* .galaxyItem.haut-gauche   { top: 3%;  left: 4%; }
.galaxyItem.haut-centre   { top: 3%;  left: 50%; transform: translate(-50%, 0); }
.galaxyItem.haut-droit    { top: 3%;  right: 4%; }
.galaxyItem.droite-haut   { top: 20%; right: 3%; transform: translate(0, -50%); }
.galaxyItem.droite-milieu { top: 50%; right: 3%; transform: translate(0, -50%); }
.galaxyItem.droite-bas    { bottom: 20%; right: 3%; transform: translate(0, 50%); }
.galaxyItem.bas-droit     { bottom: 3%; right: 4%; }
.galaxyItem.bas-centre    { bottom: 3%; left: 50%; transform: translate(-50%, 0); }
.galaxyItem.bas-gauche    { bottom: 3%; left: 4%; }
.galaxyItem.gauche-bas    { bottom: 20%; left: 3%; transform: translate(0, 50%); }
.galaxyItem.gauche-milieu { top: 50%; left: 3%; transform: translate(0, -50%); }
.galaxyItem.gauche-haut   { top: 20%; left: 3%; transform: translate(0, -50%); } */

/* === Responsive === */
@media (max-width: 800px) {
  .galaxyItem { transform: none !important; }
  .galaxyItem.haut-gauche,
  .galaxyItem.haut-centre,
  .galaxyItem.haut-droit { top: 5%; }
  .galaxyItem.bas-gauche,
  .galaxyItem.bas-centre,
  .galaxyItem.bas-droit { bottom: 5%; }
  .galaxyItem.gauche-haut,
  .galaxyItem.gauche-milieu,
  .galaxyItem.gauche-bas { left: 2%; }
  .galaxyItem.droite-haut,
  .galaxyItem.droite-milieu,
  .galaxyItem.droite-bas { right: 2%; }
}

/* === Modale Soleil === */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 300;
  justify-content: center;
  align-items: center;
}
.modal-content {
  background: #020;
  border: 2px solid #0f0;
  color: #0f0;
  padding: 20px;
  width: 60%;
  max-width: 600px;
  border-radius: 8px;
  box-shadow: 0 0 20px #0f0;
  font-family: "Orbitron";
}
#closeSunModal { float: right; font-size: 22px; cursor: pointer; color: #0f0; }
#closeSunModal:hover { color: #fff; }


#testButtons button {
  background: rgba(0,0,0,0.6);
  color: #0f0;
  border: 1px solid #0f0;
  border-radius: 4px;
  font-size: 12px;
  padding: 4px 6px;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
}
#testButtons button:hover { opacity: 1; }

/* --- Correction centrage du Soleil (à garder en dernier) --- */
svg image[id^="sun"] {
  transform-origin: center center !important;
  transform-box: fill-box !important;
  will-change: transform;
}

/* --- Correction recentrage animation OVNI --- */
#ovniTransition {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -150%); /* Départ hors écran, en haut */
  opacity: 0; /* invisible au démarrage */
  pointer-events: none;
  z-index: 9998;
  filter: drop-shadow(0 0 25px #0f0);
  width: clamp(120px, 50vw, 600px);
  transition: transform 1s ease, opacity 0.5s ease;
}

/* === Contrôles musique === */
/* === Contrôles musique === */

#musicControls button {
  background: rgba(0,0,0,0.6);
  color: #0f0;
  border: 1px solid #0f0;
  border-radius: 4px;
  font-size: 12px;
  padding: 4px 8px;
  cursor: pointer;
  font-family: monospace;
  opacity: 0.8;
  transition: opacity 0.2s;
}
#musicControls button:hover { opacity: 1; }

#musicProgress {
  width: 120px;
  accent-color: #0f0;
  background: transparent;
  cursor: pointer;
}

#musicTitle {
  color: #0f0;
  font-size: 12px;
  font-family: monospace;
  opacity: 0.8;
  min-width: 120px;
  text-align: left;
}
/* Curseur système au-dessus du lecteur */
#musicControls, #musicControls * {
  cursor: default !important;  /* flèche normale, pas la main */
}



/* === Bouton newsletter (même style que Fond1, etc.) === */
#openNewsletter {
  background: rgba(0,0,0,0.6);
  color: #00ff88;
  border: 1px solid #0f0;
  border-radius: 4px;
  font-size: 12px;
  padding: 4px 6px;
  cursor: pointer;
  font-family: monospace;
  opacity: 0.5;
  transition: opacity 0.2s;
}
#openNewsletter:hover { opacity: 1; }

/* === Fenêtre modale Newsletter === */
#newsletterModal .modal-content {
  background: #020;
  border: 2px solid #0f0;
  color: #0f0;
  padding: 20px;
  width: 300px;
  max-width: 90%;
  border-radius: 8px;
  box-shadow: 0 0 20px #0f0;
  text-align: center;
}

#newsletterModal input[type="email"] {
  width: 100%;
  padding: 8px;
  border: 1px solid #0f0;
  background: #000;
  color: #0f0;
  margin-bottom: 10px;
  font-family: monospace;
}

#newsletterModal button[type="submit"] {
  background: #0f0;
  color: #000;
  border: none;
  padding: 6px 12px;
  cursor: pointer;
  font-weight: bold;
}

/* === Effet halo planètes et soleils === */
.planet-hover:hover,
svg image[id^="sun"]:hover,
.galaxyButton:hover {
  filter: drop-shadow(0 0 12px #0f0) drop-shadow(0 0 25px #0f0);
}


.galaxyIcon {
  width: 140px;
  height: 140px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}


/* Debug Soleil visible */
svg image[id^="sun"] {
  transform-origin: center center;
  transform-box: fill-box;
}

.youtubePreview {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 10px auto;
}
.youtubePreview img {
  width: 100%;
  display: block;
  border: 2px solid #0f0;
  border-radius: 8px;
}
.youtubePreview .playButton {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 48px;
  color: #0f0;
  text-shadow: 0 0 10px #0f0;
  pointer-events: none;
}
.youtubePreview:hover img {
  filter: brightness(1.2);
}


#speedRange {
  width: 200px;
  accent-color: #0f0;
}



/* === Menu galaxies aligné à droite === */
#galaxyMenu {
  position: fixed;
  top: 50%;
  left: 2%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  z-index: 150;
  pointer-events: auto;
}

.galaxyItem {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.galaxyIcon {
  width: 100px;
  height: 100px;
  object-fit: contain;
  /* border: 2px solid #0f0; */
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.galaxyIcon:hover {
  transform: scale(1.2);
  filter: drop-shadow(0 0 12px #0f0);
}

.galaxyLabel {
  font-family: "Orbitron";
  font-size: 13px;
  color: #0f0;
  margin-top: 5px;
  text-align: center;
}


#fond-container {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

#fond-container section {
  position: absolute;
  inset: 0;
  display: none;
  background: black;
}

#fond-container section svg {
  width: 100%;
  height: 100%;
}

/* === Barre inférieure regroupant les contrôles — version responsive === */
#bottomBar {
  position: fixed;
  bottom: 20px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 16px;
  box-sizing: border-box;
  z-index: 600;
}

/* --- Boutons de fond (gauche) --- */
#testButtons {
  display: flex;
  gap: 8px;
  background: rgba(0, 0, 0, 0.4);
  padding: 6px 10px;
  border: 1px solid #0f0;
  border-radius: 6px;
  align-items: center;
  flex-wrap: wrap;
}

#testButtons button {
  background: rgba(0, 0, 0, 0.6);
  color: #0f0;
  border: 1px solid #0f0;
  border-radius: 4px;
  font-size: 12px;
  padding: 4px 8px;
  cursor: pointer;
  font-family: monospace;
  opacity: 0.8;
  transition: opacity 0.2s, background 0.2s;
}
#testButtons button:hover {
  opacity: 1;
  background: rgba(0, 255, 0, 0.2);
}

/* --- Contrôle central --- */
#speedControl {
  text-align: center;
  flex: 1;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* --- Player (droite) --- */
#musicControls {
  display: flex;
  gap: 10px;
  align-items: center;
  background: rgba(0, 0, 0, 0.4);
  padding: 6px 10px;
  border: 1px solid #0f0;
  border-radius: 6px;
  flex-wrap: wrap;
}

#musicControls button {
  background: rgba(0,0,0,0.6);
  color: #0f0;
  border: 1px solid #0f0;
  border-radius: 4px;
  font-size: 12px;
  padding: 4px 8px;
  cursor: pointer;
  font-family: monospace;
  opacity: 0.8;
  transition: opacity 0.2s;
}
#musicControls button:hover { opacity: 1; }

/* --- Responsive pour petits écrans --- */
@media (max-width: 800px) {
  #bottomBar {
    flex-direction: column;
    align-items: center;
    gap: 12px;
    bottom: 6px;
  }

  #testButtons,
  #musicControls {
    justify-content: center;
    width: 100%;
  }

  #speedControl {
    order: -1; /* met la vitesse orbitale en haut au centre */
  }

  #musicTitle {
    display: none; /* cache le titre sur mobile pour gagner de la place */
  }
}
