.learning-celebration-target {
  position: relative;
  z-index: 2;
  border-color: var(--learning-correct) !important;
  background: var(--learning-correct-bg) !important;
  animation: learning-correct-celebration 3s ease-out both !important;
}

.learning-celebration-layer {
  position: fixed;
  inset: 0;
  z-index: 10000;
  overflow: hidden;
  pointer-events: none;
}

.learning-celebration-layer.is-full-page::before {
  content: "";
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--learning-correct) 46%, transparent);
  animation: learning-page-success-wash 3s ease-out both;
}

.learning-celebration-star {
  position: fixed;
  left: var(--star-left);
  top: var(--star-top);
  color: #f4c542;
  font-size: var(--star-size);
  line-height: 1;
  opacity: 0;
  text-shadow:
    0 0 7px rgba(255, 231, 137, .95),
    0 3px 9px rgba(111, 70, 0, .28);
  transform: translate(-50%, -50%) scale(.2) rotate(0deg);
  animation: learning-gold-star-flight 3s cubic-bezier(.16, .8, .24, 1) forwards;
  animation-delay: var(--star-delay);
  will-change: transform, opacity;
}

@keyframes learning-correct-celebration {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--learning-correct) 0%, transparent);
    transform: scale(.99);
  }
  12% {
    box-shadow:
      0 0 0 8px color-mix(in srgb, var(--learning-correct) 18%, transparent),
      0 24px 58px color-mix(in srgb, var(--learning-correct) 34%, transparent);
    transform: scale(1.018);
  }
  74% {
    box-shadow:
      0 0 0 5px color-mix(in srgb, var(--learning-correct) 13%, transparent),
      0 20px 46px color-mix(in srgb, var(--learning-correct) 27%, transparent);
    transform: scale(1.008);
  }
  100% {
    box-shadow: 0 12px 30px color-mix(in srgb, var(--learning-correct) 20%, transparent);
    transform: scale(1);
  }
}

@keyframes learning-gold-star-flight {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(.2) rotate(0deg);
  }
  8% { opacity: 1; }
  38% { opacity: 1; }
  100% {
    opacity: 0;
    transform:
      translate(calc(-50% + var(--star-x)), calc(-50% + var(--star-y)))
      scale(.82)
      rotate(var(--star-rotate));
  }
}

@keyframes learning-page-success-wash {
  0% { opacity: 0; }
  10% { opacity: .88; }
  42% { opacity: .68; }
  100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .learning-celebration-target {
    animation: none !important;
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--learning-correct) 18%, transparent) !important;
  }

  .learning-celebration-star { display: none; }

  .learning-celebration-layer.is-full-page::before {
    animation: none;
    background: color-mix(in srgb, var(--learning-correct) 20%, transparent);
  }
}
