/* === SFONDO NERO CON STELLE UNIFORMI === */
body {
  margin: 0;
  background: #000000;
  font-family: sans-serif;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  position: relative;
}

/* Container per le stelle generate da JS */
.stars-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  animation: starsMove 150s linear infinite;
}

.star {
  position: absolute;
  background: white;
  border-radius: 50%;
  opacity: 0.8;
  animation: twinkle 3s ease-in-out infinite;
}

.star.tiny {
  width: 1px;
  height: 1px;
}

.star.small {
  width: 2px;
  height: 2px;
}

.star.medium {
  width: 3px;
  height: 3px;
  opacity: 0.6;
}

/* Animazione scintillio */
@keyframes twinkle {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* Animazione movimento lento stelle */
@keyframes starsMove {
  from { transform: translateX(0); }
  to { transform: translateX(-50px); }
}

#app {
  width: 100%;
  max-width: 420px;
  background: transparent;
  position: relative;
  z-index: 1;
}

/* Container wallpaper - Animazione magnetica ULTRA FLUIDA */
.wallpaper-container {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: start;
  scroll-stop: always;
  position: relative;
  background: transparent;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Effetto "magnetico": wallpaper attivo leggermente più grande */
.wallpaper-container.active {
  transform: scale(1.03);
}

/* Immagine wallpaper - Effetto in rilievo */
.wallpaper {
  width: 100%;
  height: 80vh;
  object-fit: cover;
  border-radius: 22px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.7);
  transition: transform 0.35s ease, opacity 0.35s ease, box-shadow 0.3s ease;
  transform: scale(0.95);
  opacity: 0.7;
  cursor: zoom-in;
  will-change: transform, opacity;
}

.wallpaper.show {
  transform: scale(1);
  opacity: 1;
}

/* Glassmorphism Download button */
.download {
  position: absolute;
  bottom: 70px;
  right: 20px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 12px 18px;
  border-radius: 20px;
  color: white;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  font-family: 'Space Grotesk', sans-serif;
}

.download:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

/* Back to top button - DESTRA in basso */
#back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  /* ✅ RIMUOVE il quadrato blu al click */
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

#back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

#back-to-top:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-3px);
}

/* Pulsante Reload - SOPRA il back-to-top (stessa colonna) */
#reload-btn {
  position: fixed;
  bottom: 90px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  font-size: 22px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  /* ✅ RIMUOVE il quadrato blu al click */
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

#reload-btn.visible {
  opacity: 1;
  visibility: visible;
}

#reload-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: rotate(180deg);
}

/* Pulsante musica flottante - A SINISTRA */
#music-toggle {
  position: fixed;
  bottom: 30px;
  left: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  font-size: 20px;
  cursor: pointer;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  font-family: 'Space Grotesk', sans-serif;
  /* ✅ RIMUOVE il quadrato blu al click */
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

#music-toggle:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.1);
}

#music-toggle.muted {
  opacity: 0.6;
}

/* Fullscreen modal */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.98);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  padding: 20px;
}

.modal img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 16px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.8);
  object-fit: contain;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
}
