/* =====================================
   RESET ET BASES
===================================== */

:root {
  --footer-h: 60px; /* valeur par défaut pour le footer */
}

html, body {
  overflow-x: hidden;       /* interdit le scroll horizontal */
  width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Rockwell Condensed", "Courier New", monospace;
  background: #000;
  color: #fff;
  text-align: center;
  padding-top: calc(100px + env(safe-area-inset-top)); /* espace pour header fixe */
  padding-bottom: 60px; /* espace pour footer fixe */
}

*, *::before, *::after {
  box-sizing: border-box;
  max-width: 100%;           /* empÃªche tout dÃ©passement */
}

/* =====================================
   CURSEUR NEON ET LECTEUR IMMERSIF
===================================== */

/* Masquer le curseur système partout sauf modale et lecteur */
body, body * {
  cursor: none !important;
}

/* Autoriser le curseur système uniquement dans la modale SoundCloud et le lecteur immersif */
#soundcloudModal, #soundcloudModal *,
#player, #player * {
  cursor: auto !important;
}

/* Curseur néon (sera désactivé sur mobile via JS) */
#cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: transform 0.1s ease, opacity 0.2s ease;
  z-index: 10000;
  background: rgba(138, 43, 226, 0.8);
  box-shadow: 0 0 10px rgba(138, 43, 226, 0.8),
              0 0 20px rgba(138, 43, 226, 0.6);
  opacity: 0; /* invisible au chargement */
}

/* =====================================
   HEADER NEON FIXE
===================================== */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

header h1 {
  font-size: 3rem;
  margin: 0;
  text-shadow: 0 0 10px #ff00ff,0 0 20px #ff00ff,0 0 30px #00ffff;
  animation: pulseTitle 2s infinite alternate;
}

header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #ff00ff, #00ffff, #ff00ff);
  background-size: 200% 100%;
  animation: neonMove 2s linear infinite;
}

@keyframes neonMove {
  0% {background-position:0 0;}
  100% {background-position:200% 0;}
}

@keyframes pulseTitle {
  0% {text-shadow:0 0 10px #ff00ff,0 0 20px #ff00ff,0 0 30px #00ffff;}
  50% {text-shadow:0 0 20px #ff00ff,0 0 40px #ff00ff,0 0 60px #00ffff;}
  100% {text-shadow:0 0 10px #ff00ff,0 0 20px #ff00ff,0 0 30px #00ffff;}
}

/* =====================================
   LECTEUR AUDIO
===================================== */
.player {
  position: relative;
  margin: 2rem auto;
  width: 95%;
  max-width: 500px;
  background: rgba(0,0,0,0.7);
  border-radius: 16px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: box-shadow 0.1s linear;
}

audio { 
  width: 100%; 
  max-width: 480px; 
  outline: none; 
}

.player canvas {
  width: 100%;
  height: 200px;
  display: block;
  margin: 0 auto;
  border-radius: 5px;
}

#pulseBar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, #ff00ff, #00ffff);
  opacity: 0.2;
  transition: opacity 0.05s linear, box-shadow 0.05s linear;
  box-shadow: 0 0 5px #ff00ff, 0 0 10px #00ffff;
}

/* =====================================
   LISTE DES TITRES
===================================== */
ul {
  list-style: none;
  margin: 2rem auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  max-width: 700px;
  padding: 0;
}

li {
  font-size: 1.1rem;
  background: rgba(255,255,255,0.05);
  color: #fff;
  padding: 1rem 1.5rem;
  border-radius: 16px;
  box-shadow: 0 0 10px #ff00ff,0 0 20px #00ffff;
  transition: all 0.3s;
  cursor: pointer;
  overflow: hidden;
}

li.active-track { 
  box-shadow:0 0 30px #ff00ff,0 0 60px #00ffff; 
  transform:scale(1.05); 
}

li:hover { 
  transform:scale(1.03); 
  box-shadow:0 0 20px #ff00ff,0 0 40px #00ffff; 
}

a { 
  color:#fff; 
  text-decoration:none; 
  display:block; 
}

a:hover { 
  color:#00ffff; 
  text-shadow:0 0 10px #00ffff; 
}

/* BOUTON "BOWL ART" CENTRÃ ET LARGE */
li.centered {
  grid-column: 1 / -1;
  justify-self: stretch;
}
li.centered a {
  display: block;
  width: 100%;
  text-align: center;
}

/* =====================================
   BOUTON SOUNDCLOUD
===================================== */
#openSoundcloud {
  background: linear-gradient(90deg, #ff00ff, #00ffff);
  border: none;
  color: #fff;
  padding: 1rem 2rem;
  border-radius: 30px;
  font-size: 1.2rem;
  font-family: "Rockwell Condensed", monospace;
  cursor: pointer;
  box-shadow: 0 0 15px #ff00ff, 0 0 25px #00ffff;
  margin-top: 2rem;
  transition: transform 0.2s;
  width: 100%;       /* largeur pleine */
  max-width: 500px;
}

#openSoundcloud:hover { 
  transform: scale(1.05); 
}

/* ============================
   MODALE SOUNDCLOUD
============================ */
#soundcloudModal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.95);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  padding-top: env(safe-area-inset-top);
}

#soundcloudModal.open {
  display: flex;
}

#soundcloudModal iframe {
  width: 95%;
  max-width: 500px;
  height: 80vh;
  max-height: 600px;
  border: none;
  border-radius: 16px;
}

#closeModal {
  margin-top: 1rem;
  background: none;
  border: 2px solid #00ffff;
  color: #00ffff;
  padding: 0.5rem 1.5rem;
  border-radius: 25px;
  cursor: pointer;
  font-family: 'Rockwell Condensed', monospace;
}

/* =====================================
   MODE COLONNE SUR FENÊTRE RÉDUITE AVEC ANIMATION FADE + SLIDE
===================================== */

/* Transition de base pour tous les titres */
ul {
  transition: all 0.5s ease;
}

li {
  transition: all 0.5s ease, opacity 0.5s ease, transform 0.5s ease;
}

/* Animation d’entrée (pour le slide/fade) */
@keyframes fadeSlideIn {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 900px) {
  ul {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 1rem;
  }

  li {
    width: 90%;
    max-width: 400px;
    justify-self: center;
    animation: fadeSlideIn 0.6s ease both;
  }

  /* ✅ Correction centrage du bouton Bowl Art */
  li.centered {
    grid-column: auto;
    width: 90%;
    max-width: 400px;
    justify-self: center;          /* recentre l'élément */
    margin-left: auto;
    margin-right: auto;            /* assure le centrage horizontal parfait */
  }

  #openSoundcloud {
    width: 90%;
    max-width: 400px;
    animation: fadeSlideIn 0.8s ease both;
    margin-left: auto;
    margin-right: auto;            /* garde aussi le centrage du bouton SoundCloud */
  }
}

/* MOBILE */
@media (max-width:480px){
  ul {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 0.8rem;
  }
  li {
    width: 90%;
    max-width: 360px;
    padding: 0.8rem 1rem;
    justify-self: center;
  }
  li.centered {
    width: 90%;
    max-width: 360px;
    justify-self: center;
  }
  .player { width:90%; margin-left:auto; margin-right:auto; }
  canvas { height:150px; }
  #openSoundcloud {
    width: 90%;
    max-width: 360px;
    padding: 0.8rem 1rem;
    font-size: 1rem;
  }
  #soundcloudModal iframe {
    width: 100%;
    height: 90vh;
    border-radius: 0;
  }
  #closeModal {
    width: 90%;
    max-width: 360px;
    font-size: 1rem;
  }
}

/* =====================================
   FOOTER FIXE AVEC NEON PULSE
===================================== */
.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: var(--header-bg, #111);
  color: #fff;
  text-align: center;
  padding: 15px 10px;
  font-size: 14px;
  box-shadow: 0 -2px 20px rgba(138, 43, 226, 0.5);
  animation: footerGlow 3s infinite alternate;
}

.site-footer p {
  margin: 0;
  font-weight: 500;
  text-shadow: 
    0 0 5px var(--neon, #8a2be2),
    0 0 10px var(--neon, #8a2be2),
    0 0 20px var(--neon-light, #8e2de2);
}

@keyframes footerGlow {
  0% {
    background-color: #111;
    box-shadow: 0 -2px 20px rgba(138, 43, 226, 0.3);
  }
  50% {
    background-color: #1a0a3f;
    box-shadow: 0 -4px 30px rgba(138, 43, 226, 0.7);
  }
  100% {
    background-color: #111;
    box-shadow: 0 -2px 20px rgba(138, 43, 226, 0.3);
  }
}

/* =====================================
   MODE PWA / APPLICATION
===================================== */
@media all and (display-mode: standalone) {
  body { background: #000; color: #fff; }
  .player, ul, #openSoundcloud { margin-top: 1rem; }
  .player { box-shadow: 0 0 40px #ff00ff, 0 0 80px #00ffff; }
}
