body {
  margin: 0;
  overflow: hidden;
  background: radial-gradient(circle at 50% 50%, #0a0013, #000);
  height: 100vh;
  font-family: 'Poppins', sans-serif;
  color: white;
  opacity: 0;
  animation: fadeInBody 3s ease forwards;
}

@keyframes fadeInBody {
  from { opacity: 0; }
  to { opacity: 1; }
}

canvas {
  position: absolute;
  top: 0;
  left: 0;
}

.heart {
  position: absolute;
  font-size: 12px;
  color: #ff66cc;
  text-shadow: 0 0 8px #ff66cc, 0 0 16px #ff33aa, 0 0 25px #ff00ff;
  opacity: 0;
  animation: fadeHeart 3s ease-in-out forwards, heartbeat 1.5s infinite ease-in-out;
}

@keyframes fadeHeart {
  0% { opacity: 0; transform: scale(0.5); }
  25% { opacity: 1; transform: scale(1.1); }
  75% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.8); }
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25); }
}

.phrase {
  position: absolute;
  font-size: 1.6em;
  color: #ffccff;
  text-shadow: 0 0 15px #ff66ff, 0 0 40px #cc33ff;
  opacity: 0;
  animation: fadeInOut 7s ease-in-out forwards, twinkle 1.5s infinite alternate, colorShift 5s infinite linear;
}

@keyframes fadeInOut {
  0% { opacity: 0; transform: scale(0.9); }
  20% { opacity: 1; transform: scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.1); }
}

@keyframes twinkle {
  0% { filter: brightness(1); }
  100% { filter: brightness(1.4); }
}

@keyframes colorShift {
  0% { color: #ff99ff; text-shadow: 0 0 15px #ff66ff, 0 0 40px #cc33ff; }
  25% { color: #99ccff; text-shadow: 0 0 15px #66ccff, 0 0 40px #3399ff; }
  50% { color: #b3ffcc; text-shadow: 0 0 15px #66ffcc, 0 0 40px #00ffaa; }
  75% { color: #ffd6a5; text-shadow: 0 0 15px #ff9966, 0 0 40px #ff6600; }
  100% { color: #ff99ff; text-shadow: 0 0 15px #ff66ff, 0 0 40px #cc33ff; }
}

#playMusic {
  position: fixed;
  top: 15px;
  left: 15px;
  background: rgba(255, 102, 204, 0.2);
  border: 1px solid #ff99ff;
  color: #fff;
  font-size: 16px;
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.3s;
  z-index: 1000;
}

#playMusic:hover {
  background: rgba(255, 102, 204, 0.4);
  transform: scale(1.05);
}

.aurora {
  position: absolute;
  width: 120%;
  height: 200px;
  top: -100px;
  left: -10%;
  background: linear-gradient(90deg, rgba(0,255,255,0.1), rgba(255,0,255,0.1), rgba(0,255,255,0.1));
  filter: blur(70px);
  animation: floatAurora 10s ease-in-out infinite alternate;
}

@keyframes floatAurora {
  0% { transform: translateY(0px); opacity: 0.4; }
  100% { transform: translateY(80px); opacity: 0.7; }
}

.nombre-flotante {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3em;
  color: #ff99ff;
  text-shadow: 0 0 25px #ff33ff, 0 0 50px #cc00cc, 0 0 80px #ff66ff;
  animation: aparecerDesaparecer 6s ease-in-out forwards;
  pointer-events: none;
}

@keyframes aparecerDesaparecer {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
  20% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  70% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.2); }
}

.carta {
  position: fixed;
  bottom: 20px;
  right: 30px;
  width: 70px;
  height: 50px;
  background: linear-gradient(145deg, #ffb6f9, #ff8bd1);
  border: 2px solid #ffccff;
  border-radius: 5px;
  cursor: pointer;
  box-shadow: 0 0 20px #ff66ff;
  z-index: 1001;
  transition: all 0.5s ease;
  clip-path: polygon(0 0, 100% 0, 50% 50%, 0 0);
}

.carta.abierta {
  width: 80%;
  height: 70%;
  bottom: 15%;
  right: 10%;
  border-radius: 15px;
  clip-path: none;
  background: rgba(255, 230, 255, 0.95);
  box-shadow: 0 0 40px #ff99ff;
  color: #420042;
  overflow-y: auto;
  padding: 30px;
  transition: all 0.8s ease;
}

.contenido-carta {
  display: none;
  font-size: 1.3em;
  line-height: 1.6em;
  animation: aparecerTexto 2s ease forwards;
}

.carta.abierta .contenido-carta {
  display: block;
}

@keyframes aparecerTexto {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.cerrar-carta {
  position: absolute;
  top: 10px;
  right: 20px;
  background: #ff66cc;
  border: none;
  color: white;
  font-size: 20px;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  cursor: pointer;
  display: none;
}

.carta.abierta .cerrar-carta {
  display: block;
}
