/* MIT License: see LICENSE at project root. */
/* Overwinningsanimatie met confetti en applaus. Hoort bij `celebration.js`. */

.celebration {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  pointer-events: none;
  overflow: hidden;
}

.celebration.is-leaving {
  animation: celebration-fade-out 0.45s ease forwards;
}

.celebration__panel {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 0.25rem;
  min-width: min(88vw, 360px);
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background: var(--card);
  box-shadow: 0 18px 54px rgba(15, 23, 42, 0.24);
  text-align: center;
}

.celebration__panel strong {
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1.1;
}

.celebration__panel span {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 800;
}

.celebration__confetti {
  position: absolute;
  inset: 0;
}

.celebration__confetti i {
  position: absolute;
  top: -18px;
  left: var(--left);
  width: 9px;
  height: 16px;
  border-radius: 2px;
  background: var(--color);
  animation: confetti-fall var(--duration) linear var(--delay) forwards;
}

.celebration__applause {
  position: absolute;
  width: min(58vw, 300px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--card) 72%, transparent);
}

.celebration__applause span {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.celebration__applause i {
  position: absolute;
  width: 8px;
  height: 34px;
  border-radius: 999px;
  background: var(--accent);
  transform: rotate(var(--angle)) translateY(-112px);
  transform-origin: center 122px;
  animation: applause-pulse 0.9s ease-in-out var(--delay) infinite alternate;
}

@keyframes confetti-fall {
  0% {
    transform: translate3d(0, -24px, 0) rotate(0deg);
    opacity: 1;
  }

  100% {
    transform: translate3d(var(--drift), calc(100vh + 42px), 0) rotate(720deg);
    opacity: 0.95;
  }
}

@keyframes applause-pulse {
  from {
    opacity: 0.25;
    transform: rotate(var(--angle)) translateY(-92px) scaleY(0.72);
  }

  to {
    opacity: 0.9;
    transform: rotate(var(--angle)) translateY(-122px) scaleY(1);
  }
}

@keyframes celebration-fade-out {
  to {
    opacity: 0;
  }
}
