/* =========================================================
   BASE GENERAL
========================================================= */

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
}

body {
  position: relative;
}

/* =========================================================
   IMAGEN DE FONDO
========================================================= */

.bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  object-position: center center;
  display: block;
  z-index: 0;
}

/* =========================================================
   CAPAS DE NUBES
   Cada capa contiene grupos de nubes generados por JS.
========================================================= */

.cloud-layer {
  position: fixed;
  top: -20vh;
  left: -35vw;
  width: 170vw;
  height: 96vh;
  pointer-events: none;
  overflow: visible;
}

/* Profundidad visual: fondo a delante */
#cloud-layer-4 { z-index: 1; }
#cloud-layer-3 { z-index: 2; }
#cloud-layer-2 { z-index: 3; }
#cloud-layer-1 { z-index: 4; }

/* =========================================================
   GRUPOS DE NUBES
   Cada .cloud-group es una nube completa formada por muchas partes.
========================================================= */

.cloud-group {
  position: absolute;
  inset: auto;
  will-change: transform, opacity;
  transform-origin: center center;
}

/* =========================================================
   PARTES DE LAS NUBES
   Cada .cloud-part es una burbuja individual.
========================================================= */

.cloud-part {
  position: absolute;
  border-radius: 50%;
  will-change: transform, opacity, filter;
}

/* =========================================================
   TIPOS DE NUBE
   Puedes tocar aquí color y modo de mezcla.
========================================================= */

/* Nubes delanteras brillantes */
.cloud-light {
  background: rgba(255, 255, 255, 0.82);
  mix-blend-mode: screen;
}

/* Nubes intermedias */
.cloud-mid {
  background: rgba(240, 245, 255, 0.58);
  mix-blend-mode: screen;
}

/* Nubes del fondo, más gris-azuladas */
.cloud-dark {
  background: rgba(165, 175, 190, 0.24);
  mix-blend-mode: multiply;
}

/* Brillo cálido para integrar con el sol */
.cloud-glow {
  background: rgba(255, 244, 180, 0.14);
  mix-blend-mode: screen;
}

/* =========================================================
   TEXTO SUPERPUESTO
========================================================= */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  text-align: center;
  padding: 0 5vw 14vh;
  box-sizing: border-box;
}

.text {
  font-family: "Bangers", cursive;
  color: white;
  text-shadow:
    2px 2px 0 #000,
    -2px 2px 0 #000,
    2px -2px 0 #000,
    -2px -2px 0 #000,
    0 4px 12px rgba(0, 0, 0, 0.9);
  line-height: 1.1;
  letter-spacing: 0.04em;
  max-width: 90vw;
}

.line1 {
  font-size: clamp(2rem, 4vw, 4rem);
  margin-bottom: 0.2em;
}

.line2 {
  font-size: clamp(2rem, 3.8vw, 3.8rem);
  margin-bottom: 0.7em;
}

.line3 a {
  font-size: clamp(1.6rem, 3vw, 3rem);
  color: #ffd700;
  text-decoration: none;
  transition: transform 0.2s ease, text-shadow 0.2s ease;
  display: inline-block;
}

.line3 a:hover {
  transform: scale(1.05);
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

.line4 {
  margin-top: 60px;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  transform: translateY(40px);
}

/* =========================================================
   AJUSTES MÓVIL
========================================================= */

@media (orientation: portrait) {
  .overlay {
    padding: 0 8vw 18vh;
  }

  .line1 {
    font-size: clamp(1.8rem, 7vw, 3.2rem);
  }

  .line2 {
    font-size: clamp(1.8rem, 6.5vw, 3rem);
  }

  .line3 a {
    font-size: clamp(1.4rem, 5.5vw, 2.5rem);
  }
  .line4 {
    margin-top: 72px;
    transform: translateY(40px);
  }
}

/* =========================================================
   CASCADA
   Efecto ligero: flujo + niebla
========================================================= */

.waterfall-flow,
.waterfall-mist {
  position: fixed;
  pointer-events: none;
}

/* Flujo principal de la cascada */
.waterfall-flow {
  left: 30.8vw;
  top: 64vh;
  width: 38.2vw;
  height: 39.5vh;
  z-index: 0;
  opacity: 0.22;
  mix-blend-mode: screen;
  filter: blur(0.8px);
  overflow: hidden;
  clip-path: polygon(
    14% 0%, 92% 0%,
    96% 18%, 95% 38%, 92% 58%, 88% 78%, 82% 100%,
    22% 100%, 16% 78%, 12% 58%, 9% 38%, 8% 18%
  );
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255,255,255,0.00) 0px,
      rgba(255,255,255,0.18) 12px,
      rgba(190,235,255,0.32) 28px,
      rgba(255,255,255,0.06) 42px,
      rgba(255,255,255,0.00) 58px
    );
  background-size: 100% 140px;
  animation: waterfallFlow 1.35s linear infinite;
}

.waterfall-flow::before,
.waterfall-flow::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.waterfall-flow::before {
  opacity: 0.22;
  mix-blend-mode: screen;
  background:
    linear-gradient(
      180deg,
      rgba(255,255,255,0.18) 0%,
      rgba(255,255,255,0.05) 30%,
      rgba(255,255,255,0.00) 100%
    ),
    repeating-linear-gradient(
      180deg,
      rgba(220,245,255,0.00) 0px,
      rgba(220,245,255,0.18) 10px,
      rgba(255,255,255,0.00) 24px
    );
  background-size: 100% 100%, 100% 90px;
  animation: waterfallFlow 0.95s linear infinite reverse;
}

.waterfall-flow::after {
  opacity: 0.14;
  filter: blur(2px);
  mix-blend-mode: screen;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255,255,255,0.00) 0px,
      rgba(255,255,255,0.20) 18px,
      rgba(255,255,255,0.00) 36px
    );
  background-size: 100% 110px;
  animation: waterfallFlow 1.9s linear infinite;
}

/* Niebla / espuma inferior */
.waterfall-mist {
  left: 35.2vw;
  top: 71.2vh;
  width: 29vw;
  height: 12vh;
  z-index: 0;
  opacity: 0.22;
  mix-blend-mode: screen;
  filter: blur(6px);
  background:
    radial-gradient(ellipse at 50% 50%, rgba(255,255,255,0.34) 0%, rgba(255,255,255,0.00) 62%),
    radial-gradient(ellipse at 28% 60%, rgba(220,245,255,0.22) 0%, rgba(220,245,255,0.00) 54%),
    radial-gradient(ellipse at 72% 58%, rgba(220,245,255,0.20) 0%, rgba(220,245,255,0.00) 54%);
  animation: waterfallMist 2.4s ease-in-out infinite;
}

@keyframes waterfallFlow {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 0 140px;
  }
}

@keyframes waterfallMist {
  0%, 100% {
    transform: scale(1) translateY(0);
    opacity: 0.16;
  }
  50% {
    transform: scale(1.05) translateY(-2px);
    opacity: 0.26;
  }
}

/* =========================================================
   AJUSTE MÓVIL
========================================================= */

@media (orientation: portrait) {
  .waterfall-flow {
    left: 22.6vw;
    top: 40.5vh;
    width: 54.8vw;
    height: 36.5vh;
    opacity: 0.20;
  }

  .waterfall-mist {
    left: 28vw;
    top: 69.5vh;
    width: 42vw;
    height: 10vh;
    opacity: 0.18;
  }
}

/* =========================================================
   BOTÓN MÚSICA
========================================================= */

#music-toggle {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 999;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: white;
  font-size: 20px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

#music-toggle:hover {
  background: rgba(0, 0, 0, 0.65);
}

/* =========================================================
   MODO NOCHE - NUBES
========================================================= */

/* Nubes principales más frías */
body.night .cloud-light {
  background: rgba(200, 220, 255, 0.55);
}

body.night .cloud-mid {
  background: rgba(180, 200, 230, 0.40);
}

body.night .cloud-dark {
  background: rgba(120, 140, 170, 0.25);
}

/* Glow lunar (frío en vez de cálido) */
body.night .cloud-glow {
  background: rgba(180, 210, 255, 0.12);
}

/* Suavizar contraste general */
body.night .cloud-part {
  filter: brightness(0.85) contrast(1.05);
}

/* =========================================================
   ESTRELLAS ANIMADAS
========================================================= */

#stars-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
}

body.night #stars-layer {
  opacity: 1;
}

.star {
  position: absolute;
  border-radius: 50%;
  background: white;
  pointer-events: none;
  will-change: opacity, transform;
  animation: starTwinkle linear infinite;
}

.star.soft {
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.35);
}

.star.bright {
  box-shadow:
    0 0 6px rgba(255, 255, 255, 0.55),
    0 0 12px rgba(180, 220, 255, 0.25);
}

@keyframes starTwinkle {
  0%, 100% {
    opacity: 0.12;
    transform: scale(0.7);
  }
  50% {
    opacity: 1;
    transform: scale(1.9);
  }
}

/* =========================================================
   ESTRELLAS FUGAZ
========================================================= */

.shooting-star {
  position: absolute;
  width: 8px;
  height: 8px;
  pointer-events: none;
  z-index: 1;
  animation: shootingStarFly linear forwards;
}

.shooting-star::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,1) 0%, rgba(220,240,255,0.9) 55%, rgba(255,255,255,0) 100%);
  box-shadow:
    0 0 8px rgba(255,255,255,0.95),
    0 0 16px rgba(180,220,255,0.45);
}

.shooting-star::after {
  content: "";
  position: absolute;
  left: -110px;
  top: 3px;
  width: 120px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0) 0%,
    rgba(190,220,255,0.10) 35%,
    rgba(210,235,255,0.45) 65%,
    rgba(255,255,255,0.95) 100%
  );
  filter: blur(1px);
  transform: rotate(0deg);
  transform-origin: right center;
}

@keyframes shootingStarFly {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(32deg) scale(0.85);
  }
  10% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--travelX), var(--travelY), 0) rotate(32deg) scale(1.05);
  }
}

/* =========================================================
   BOTÓN DE DONACIÓN
========================================================= */

.line4 .donate-btn,
.line4 .donate-btn:link,
.line4 .donate-btn:visited,
.line4 .donate-btn:hover,
.line4 .donate-btn:active {
  display: inline-block;
  padding: 6px 14px;
  text-decoration: none !important;
  background: transparent !important;
  border: none !important;
  color: #50c878 !important; /* verde esmeralda */
  -webkit-text-stroke: 1.5px #cc0000; /* reborde rojo */
  text-shadow:
    1px 1px 0 #cc0000,
    -1px 1px 0 #cc0000,
    1px -1px 0 #cc0000,
    -1px -1px 0 #cc0000;
  transition: color 0.2s ease, text-shadow 0.2s ease, transform 0.2s ease;
}

.line4 .donate-btn:hover {
  color: #ffd700 !important; /* dorado */
  text-shadow:
    0 0 8px rgba(255, 215, 0, 0.95),
    0 0 14px rgba(255, 215, 0, 0.75),
    1px 1px 0 #cc0000,
    -1px 1px 0 #cc0000,
    1px -1px 0 #cc0000,
    -1px -1px 0 #cc0000;
  transform: scale(1.04);
}

.line4 a {
  color: #50c878 !important; /* verde esmeralda */
}

.line4 a:hover {
  color: #ffd700 !important;
}

/* =========================================================
   PRIVACIDAD
========================================================= */

.privacy-link {
  position: absolute;
  bottom: 20px;
  left: 0;
  width: 100%;
  text-align: center;
  font-size: 1.2rem;
  opacity: 0.8;
}

.privacy-link a {
  color: #ccc;
  text-decoration: none;
}

.privacy-link a:hover {
  color: #ffd700;
}