@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600&family=Space+Mono&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background-image: url('img/BugsReaper.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  font-family: 'Playfair Display', serif;
  color: white;
}

.mensaje {
  position: relative;
  z-index: 1000;
  text-align: center;
  padding: 2rem 5vw;
  background-color: rgba(0,0,0,0.4);
  backdrop-filter: blur(6px);
  border-radius: 12px;
  box-shadow: 0 0 30px rgba(0,0,0,0.6);
  margin: 2rem auto;
  max-width: 600px;
  width: 90vw;
}

.mensaje h1 {
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 700;
  letter-spacing: 3px;
  background: linear-gradient(90deg, #ff00cc, #00ffff, #ff00cc);
  background-size: 200% 200%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: neonGlow 3s ease-in-out infinite;
  text-shadow:
    0 0 5px #ff00cc,
    0 0 10px #ff00cc,
    0 0 20px #ff00cc,
    0 0 40px #00ffff,
    0 0 80px #00ffff,
    0 0 90px #00ffff,
    0 0 100px #00ffff;
}

@keyframes neonGlow {
  0%, 100% {
    background-position: 0% 50%;
    text-shadow:
      0 0 5px #ff00cc,
      0 0 10px #ff00cc,
      0 0 20px #ff00cc,
      0 0 40px #00ffff,
      0 0 80px #00ffff,
      0 0 90px #00ffff,
      0 0 100px #00ffff;
  }
  50% {
    background-position: 100% 50%;
    text-shadow:
      0 0 10px #00ffff,
      0 0 20px #00ffff,
      0 0 30px #00ffff,
      0 0 50px #ff00cc,
      0 0 90px #ff00cc,
      0 0 100px #ff00cc,
      0 0 110px #ff00cc;
  }
}

.mensaje p:first-of-type {
  font-family: 'Space Mono', monospace;
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  color: #00ffea;
  text-shadow:
    0 0 8px #00ffea,
    0 0 15px #00ffea;
  animation: flicker 3s infinite;
  letter-spacing: 1.2px;
  margin-top: 1.2rem;
}

@keyframes flicker {
  0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
    opacity: 1;
  }
  20%, 22%, 24%, 55% {
    opacity: 0.6;
  }
}

#animated-code {
  font-family: 'Space Mono', monospace;
  font-size: clamp(0.9rem, 2vw, 1.2rem);
  color: #ff00cc;
  text-shadow:
    0 0 5px #ff00cc,
    0 0 15px #ff00cc;
  white-space: normal;
  overflow-wrap: break-word;
  border-right: 2px solid #ff00cc;
  padding-right: 5px;
  display: inline-block;
  max-width: 90vw;
  animation:
    glowPulse 3s ease-in-out infinite,
    blinkCursor 1s step-start infinite;
}

@keyframes glowPulse {
  0%, 100% {
    text-shadow:
      0 0 5px #ff00cc,
      0 0 15px #ff00cc,
      0 0 30px #ff00cc;
  }
  50% {
    text-shadow:
      0 0 10px #ff66dd,
      0 0 25px #ff66dd,
      0 0 40px #ff66dd;
  }
}

@keyframes blinkCursor {
  0%, 50% {
    border-color: #ff00cc;
  }
  51%, 100% {
    border-color: transparent;
  }
}

#bug-container {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 500;
}

.bug {
  position: absolute;
  font-size: clamp(0.8rem, 1.5vw, 1rem);
  width: 40px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  cursor: pointer;
  pointer-events: auto;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.5s ease, opacity 0.5s ease;
}

.bug.dead {
  transform: scale(0.2) rotate(90deg);
  opacity: 0;
  /* pointer-events: none; */ /* quitado */
  /* no repetir transition */
}

#bug-stats-container {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: rgba(0,0,0,0.6);
  padding: 10px 15px;
  border-radius: 10px;
  font-family: 'Space Mono', monospace;
  font-size: clamp(0.9rem, 1.2vw, 1rem);
  color: #ff00cc;
  text-shadow:
    0 0 5px #ff00cc,
    0 0 10px #ff00cc,
    0 0 20px #ff66dd;
  z-index: 1100;
  user-select: none;
  pointer-events: none;
  box-shadow: 0 0 15px #ff00cc;

  display: flex;
  gap: 15px;
  align-items: center;
  flex-wrap: wrap;
  min-width: max-content;
  max-width: 90vw;
}

/* Media query para móviles */
@media (max-width: 600px) {
  .mensaje {
    padding: 1.5rem 3vw;
    max-width: 95vw;
  }
  
  .mensaje h1 {
    font-size: clamp(1.5rem, 7vw, 2.5rem);
    letter-spacing: 2px;
  }

  .mensaje p:first-of-type {
    font-size: clamp(1rem, 3vw, 1.2rem);
  }

  #bug-stats-container {
    top: 10px;
    right: 10px;
    font-size: 0.85rem;
    gap: 10px;
    padding: 8px 12px;
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Estilos globales para sangre verde 3D */
.blood-splatter {
  position: fixed;
  width: 8px;
  height: 8px;
  background: radial-gradient(circle, #00ff00 0%, #006400 70%);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.9;
  filter: drop-shadow(0 0 2px #00ff00);
  transform-style: preserve-3d;
  animation: bloodSplatterMove 0.7s ease forwards, bloodSplatterFade 0.7s ease forwards;
  will-change: transform, opacity;
  left: 0;
  top: 0;
}

@keyframes bloodSplatterMove {
  to {
    transform:
      translate3d(var(--x), var(--y), 30px)
      rotateX(25deg)
      rotateY(45deg);
  }
}

@keyframes bloodSplatterFade {
  to {
    opacity: 0;
  }
}

body {
  perspective: 800px;
  perspective-origin: center center;
}
