/* Animations */
@keyframes pulse {
  0% {
    box-shadow: 0 0 15px rgba(160, 233, 255, 0.5);
  }
  100% {
    box-shadow: 0 0 25px rgba(160, 233, 255, 0.8);
  }
}

@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
  100% {
    transform: translateY(0px);
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes sparkle {
  0% {
    opacity: 0;
    transform: scale(0);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0);
  }
}

@keyframes glow {
  0% {
    text-shadow: 0 0 10px rgba(160, 233, 255, 0.7),
                 0 0 20px rgba(160, 233, 255, 0.5),
                 0 0 30px rgba(160, 233, 255, 0.3);
  }
  100% {
    text-shadow: 0 0 15px rgba(160, 233, 255, 0.9),
                 0 0 30px rgba(160, 233, 255, 0.7),
                 0 0 40px rgba(160, 233, 255, 0.5);
  }
}

/* Animation Elements */
.floating-clouds {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
}

.floating-clouds::before,
.floating-clouds::after {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(160, 233, 255, 0.2) 0%, rgba(160, 233, 255, 0) 70%);
}

.floating-clouds::before {
  top: 20%;
  left: 25%;
  animation: float 15s ease-in-out infinite;
}

.floating-clouds::after {
  top: 40%;
  right: 20%;
  width: 250px;
  height: 250px;
  animation: float 20s ease-in-out infinite reverse;
}

.constellation-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(1px 1px at 50px 50px, rgba(160, 233, 255, 0.3), rgba(160, 233, 255, 0)),
    radial-gradient(1px 1px at 100px 150px, rgba(160, 233, 255, 0.3), rgba(160, 233, 255, 0)),
    radial-gradient(1px 1px at 200px 250px, rgba(160, 233, 255, 0.3), rgba(160, 233, 255, 0)),
    radial-gradient(1px 1px at 300px 350px, rgba(160, 233, 255, 0.3), rgba(160, 233, 255, 0));
  background-size: 400px 400px;
  z-index: 1;
}

.cloud-layers {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.cloud-layers::before,
.cloud-layers::after {
  content: '';
  position: absolute;
  background: linear-gradient(to bottom, rgba(16, 27, 45, 0) 0%, rgba(16, 27, 45, 0.5) 50%, rgba(16, 27, 45, 0) 100%);
}

.cloud-layers::before {
  top: 20%;
  left: 0;
  width: 100%;
  height: 30%;
  transform: rotate(-5deg);
}

.cloud-layers::after {
  bottom: 20%;
  left: 0;
  width: 100%;
  height: 20%;
  transform: rotate(5deg);
}

/* Game Loading Animations */
.spinning-reel {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 5px dotted var(--celestial-gold);
  border-top-color: var(--sky-glow-blue);
  border-bottom-color: var(--sky-glow-blue);
  animation: spin 3s linear infinite;
  margin: 0 auto var(--space-3);
}

.floating-clouds-mini {
  width: 100px;
  height: 100px;
  position: relative;
  margin: 0 auto var(--space-3);
}

.floating-clouds-mini::before,
.floating-clouds-mini::after {
  content: '';
  position: absolute;
  background: radial-gradient(circle at center, rgba(160, 233, 255, 0.5) 0%, rgba(160, 233, 255, 0) 70%);
  border-radius: 50%;
}

.floating-clouds-mini::before {
  width: 50px;
  height: 50px;
  top: 10px;
  left: 10px;
  animation: float 3s ease-in-out infinite;
}

.floating-clouds-mini::after {
  width: 40px;
  height: 40px;
  top: 40px;
  left: 50px;
  animation: float 4s ease-in-out infinite reverse;
}

.glowing-runes {
  width: 100px;
  height: 100px;
  position: relative;
  margin: 0 auto var(--space-3);
}

.glowing-runes::before,
.glowing-runes::after {
  content: '';
  position: absolute;
  width: 40px;
  height: 40px;
}

.glowing-runes::before {
  top: 10px;
  left: 30px;
  background: url('../images/rune1.png') center no-repeat;
  background-size: contain;
  animation: glow 2s ease-in-out infinite alternate;
}

.glowing-runes::after {
  top: 40px;
  left: 30px;
  background: url('../images/rune2.png') center no-repeat;
  background-size: contain;
  animation: glow 3s ease-in-out infinite alternate;
}

.spinning-wheel {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: conic-gradient(var(--celestial-gold), var(--sky-glow-blue), var(--cosmic-violet), var(--nebula-pink), var(--celestial-gold));
  animation: spin 4s linear infinite;
  margin: 0 auto var(--space-3);
  position: relative;
}

.spinning-wheel::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--deep-space);
}

.battle-particles {
  width: 100px;
  height: 100px;
  position: relative;
  margin: 0 auto var(--space-3);
  overflow: hidden;
}

.battle-particles::before,
.battle-particles::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cosmic-violet);
}

.battle-particles::before {
  top: 20px;
  left: 30px;
  animation: sparkle 2s ease-in-out infinite;
}

.battle-particles::after {
  top: 60px;
  left: 50px;
  background: var(--nebula-pink);
  animation: sparkle 2s ease-in-out infinite 1s;
}

.rolling-dice {
  width: 60px;
  height: 60px;
  background: var(--celestial-gold);
  border-radius: 8px;
  position: relative;
  margin: 0 auto var(--space-3);
  animation: float 2s ease-in-out infinite;
}

.rolling-dice::before,
.rolling-dice::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--deep-space);
}

.rolling-dice::before {
  top: 10px;
  left: 10px;
}

.rolling-dice::after {
  bottom: 10px;
  right: 10px;
}

/* Star Animation for Modal */
.star-animation {
  width: 100px;
  height: 100px;
  position: relative;
  margin: 0 auto var(--space-3);
}

.star-animation::before,
.star-animation::after {
  content: '';
  position: absolute;
  background: var(--celestial-gold);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.star-animation::before {
  width: 50px;
  height: 50px;
  top: 10px;
  left: 25px;
  animation: float 3s ease-in-out infinite;
}

.star-animation::after {
  width: 30px;
  height: 30px;
  top: 50px;
  left: 60px;
  animation: float 2s ease-in-out infinite reverse;
}