.unicorn {
  position: fixed;
  width: 80px;
  height: 80px;
  z-index: 9999;
  pointer-events: none;
  transition: none;
}

.unicorn-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Leg animations handled by JS */
.unicorn-leg {
  transition: transform 0.05s linear;
}

/* Mane flow */
.unicorn-mane {
  transition: transform 0.1s ease;
}

/* Tail wag */
.unicorn-tail {
  transition: transform 0.1s ease;
}

/* Horn sparkle */
.unicorn-horn {
  animation: hornSparkle 0.5s ease-in-out infinite;
}

@keyframes hornSparkle {
  0%, 100% {
    filter: drop-shadow(0 0 2px #FFD700);
  }
  50% {
    filter: drop-shadow(0 0 8px #FFD700) drop-shadow(0 0 12px #FFF8DC);
  }
}

/* Rainbow trail container */
.unicorn-rainbow-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9998;
  overflow: hidden;
}

/* Individual rainbow segment */
.unicorn-rainbow-segment {
  position: absolute;
  width: 12px;
  height: 4px;
  border-radius: 2px;
  transition: opacity 0.3s ease, transform 0.1s ease;
  box-shadow: 0 0 4px currentColor;
}

/* Wobble animation for the whole unicorn */
.unicorn.wobbling {
  animation: unicornWobble 0.3s ease-in-out infinite;
}

@keyframes unicornWobble {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-3px) rotate(2deg);
  }
  75% {
    transform: translateY(-3px) rotate(-2deg);
  }
}

/* Sparkle effect around unicorn */
.unicorn::before,
.unicorn::after {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  background: #FFD700;
  border-radius: 50%;
  animation: sparkle 0.8s ease-in-out infinite;
  pointer-events: none;
}

.unicorn::before {
  top: 10%;
  right: 20%;
  animation-delay: 0s;
}

.unicorn::after {
  top: 30%;
  right: 5%;
  animation-delay: 0.4s;
}

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

/* Extra sparkles using box-shadow on body */
.unicorn-body {
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.8));
}

/* Eye twinkle */
.unicorn-svg circle[fill="#2a1a4a"] {
  animation: eyeTwinkle 3s ease-in-out infinite;
}

@keyframes eyeTwinkle {
  0%, 90%, 100% {
    transform: scaleY(1);
  }
  95% {
    transform: scaleY(0.1);
  }
}

/* Unicorn Poop */
.unicorn-poop {
  position: fixed;
  width: 40px;
  height: 40px;
  z-index: 9997;
  pointer-events: none;
  animation: poopLand 0.3s ease-out;
}

.poop-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

@keyframes poopLand {
  0% {
    transform: scale(0) translateY(-20px);
    opacity: 0;
  }
  50% {
    transform: scale(1.2) translateY(0);
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* Sparkle animation on poop */
.poop-sparkle {
  animation: poopSparkle 1s ease-in-out infinite;
}

.poop-sparkle:nth-child(1) { animation-delay: 0s; }
.poop-sparkle:nth-child(2) { animation-delay: 0.25s; }
.poop-sparkle:nth-child(3) { animation-delay: 0.5s; }
.poop-sparkle:nth-child(4) { animation-delay: 0.75s; }

@keyframes poopSparkle {
  0%, 100% {
    opacity: 0.3;
    transform: scale(0.5);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

/* Poop fading out */
.unicorn-poop.poop-fading {
  animation: poopFade 3s ease-out forwards;
}

@keyframes poopFade {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.5);
  }
}

/* Poop eaten animation */
.unicorn-poop.poop-eaten {
  animation: poopEaten 0.5s ease-out forwards;
}

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

/* Poop glow to attract flies */
.unicorn-poop::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60px;
  height: 60px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 215, 0, 0.3) 0%, transparent 70%);
  border-radius: 50%;
  animation: poopGlow 2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes poopGlow {
  0%, 100% {
    opacity: 0.5;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
  }
}
