/* Starry background */
body {
  margin: 0;
  padding: 0;
  font-family: sans-serif;
  height: 100vh;
  overflow: hidden;
  background: radial-gradient(ellipse at top, #1a1a2e, #0f0f1a);
  color: #f0f0ff;
}

/* Stars */
.star-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle, rgba(255,255,255,0.8) 2px, transparent 2px) 20px 30px,
    radial-gradient(circle, rgba(255,255,255,0.6) 1.5px, transparent 1.5px) 80px 120px,
    radial-gradient(circle, rgba(255,255,255,0.7) 1px, transparent 1px) 200px 200px,
    radial-gradient(circle, rgba(255,255,255,0.5) 2px, transparent 2px) 300px 50px,
    radial-gradient(circle, rgba(255,255,255,0.4) 1px, transparent 1px) 500px 300px;
  background-size: 600px 600px;
  animation: twinkle 6s infinite alternate;
  pointer-events: none;
}

@keyframes twinkle {
  from { opacity: 0.7; }
  to { opacity: 1; }
}

/* Game box */
.game-box {
  position: relative;
  z-index: 2;
  max-width: 420px;
  margin: 80px auto;
  padding: 30px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  backdrop-filter: blur(6px);
  text-align: center;
  box-shadow: 0 0 20px rgba(255,255,255,0.2);
}

/* Inputs and buttons */
input {
  padding: 8px;
  width: 130px;
  margin: 8px 5px;
  border-radius: 6px;
  border: none;
  outline: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
}

button {
  padding: 8px 14px;
  cursor: pointer;
  border-radius: 6px;
  border: none;
  background: #a78bfa;
  color: #fff;
  font-weight: bold;
  transition: 0.3s;
  margin: 5px;
}

button:hover {
  background: #c4b5fd;
  box-shadow: 0 0 10px #c4b5fd;
}

/* Text */
#result {
  margin-top: 16px;
  font-weight: bold;
  color: #e0e0ff;
  text-shadow: 0 0 8px rgba(255,255,255,0.4);
}

#agentStatus {
  margin-top: 10px;
  font-size: 0.95rem;
  color: #d9d9ff;
}

/* Sparkle layer */
#sparkleLayer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

/* Swirling upward sparkles */
.sparkle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: white;
  border-radius: 50%;
  opacity: 0;
  animation: swirlUp 1.4s ease-out forwards;
}

@keyframes swirlUp {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  50% {
    opacity: 0.9;
    transform: translate(-10px, -40px) scale(1.8);
  }
  100% {
    opacity: 0;
    transform: translate(20px, -80px) scale(2.5);
  }
}
