/* Candy Chaos: a halo of candy stars orbiting above the caster's head, announced by
   a shockwave ring when the powerup lands. */

.cc-aura {
  position: absolute;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 88;
}

.cc-star {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 26px;
  height: 26px;
  pointer-events: none;
  will-change: transform, opacity;
  border-radius: 50%;
  /* Each star takes its own hue from its index, so the halo reads as candy rather
     than as six identical dots. */
  background: radial-gradient(circle at 35% 30%,
    #fff 0%,
    hsl(calc(var(--cc-i, 0) * 58deg + 20deg) 95% 68%) 42%,
    hsl(calc(var(--cc-i, 0) * 58deg + 20deg) 90% 48%) 72%,
    transparent 78%);
  filter:
    drop-shadow(0 0 8px hsl(calc(var(--cc-i, 0) * 58deg + 20deg) 95% 62%))
    drop-shadow(0 0 18px rgba(255, 255, 255, .55));
}

/* Shockwave on cast. */
.cc-ring {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  transform: translate(-50%, 50%) scale(0);
  opacity: 0;
  pointer-events: none;
  border: 3px solid rgba(255, 240, 160, .9);
  box-shadow: 0 0 34px 10px rgba(255, 200, 90, .55), inset 0 0 20px rgba(255, 255, 255, .6);
}
.cc-ring.is-bursting {
  animation: cc-ring-pop 900ms cubic-bezier(.16, .8, .3, 1) forwards;
}
@keyframes cc-ring-pop {
  0%   { transform: translate(-50%, 50%) scale(.2)  ; opacity: 0; }
  22%  { transform: translate(-50%, 50%) scale(3.4) ; opacity: .95; }
  100% { transform: translate(-50%, 50%) scale(8.5) ; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .cc-ring.is-bursting { animation-duration: 1ms; }
}
