.celebration,
.practice-retry {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}
.celebration-position {
  position: absolute;
  left: 50%;
  top: clamp(145px, var(--celebration-y, 45%), calc(100% - 135px));
  transform: translate(-50%, -50%);
  width: min(320px, calc(100vw - 32px));
}
.celebration-bubble {
  display: flex;
  align-items: center;
  flex-direction: column;
  padding: 8px 18px 18px;
  border: 2px solid #e2cca0;
  border-radius: 36px;
  background: #fffcf2;
  box-shadow:
    0 12px 40px #64533d30,
    0 3px 0 #e4d6b7;
  animation: celebration-arrive var(--celebration-duration, 3200ms) both;
  text-align: center;
}
.celebration-art {
  width: 180px;
  height: 150px;
  flex: none;
  overflow: visible;
}
.celebration-bubble strong {
  font-family: var(--book);
  color: var(--green-dark);
  font-size: 23px;
  line-height: 1.5;
}
.celebration-bubble > span {
  color: #6b725d;
  font-size: 13px;
  margin-top: 5px;
}
.celebration .celebration-position {
  top: clamp(155px, var(--celebration-y, 45%), calc(100% - 155px));
}
.celebration .celebration-result {
  font-weight: 750;
  margin-top: 4px;
  font-size: 23px;
}
.celebration .celebration-theme {
  font-size: 20px;
  font-weight: 600;
}
.celebration-star {
  transform-origin: center;
  animation: celebration-star 1.2s ease-in-out 2;
}
.celebration-orbit {
  transform-origin: 90px 77px;
  animation: celebration-orbit 2.4s ease-in-out both;
}
.celebration-sparks {
  animation: celebration-spark 1.4s ease-in-out 2;
}
.celebration-grow {
  transform-origin: 90px 125px;
  animation: celebration-grow 1.7s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}
.celebration-balloon {
  animation: celebration-balloon 2.5s var(--delay) ease-in-out both;
}
.celebration-rainbow path {
  stroke-dasharray: 210;
  stroke-dashoffset: 210;
  animation: celebration-rainbow 1.1s var(--delay, 0s) ease-out forwards;
}
.celebration-flower {
  animation: celebration-flower 2.4s ease-out both;
  transform-origin: 0 0;
}
.celebration-bear {
  transform-origin: 90px 120px;
  animation: celebration-bear 0.8s ease-in-out 3;
}
.celebration-clap-left {
  animation: celebration-clap-left 0.55s ease-in-out 4;
}
.celebration-clap-right {
  animation: celebration-clap-right 0.55s ease-in-out 4;
}
.celebration-ribbon {
  transform-origin: 90px 80px;
  animation: celebration-ribbon 1.9s var(--delay) ease-out both;
}
.celebration-plane {
  animation: celebration-plane 2.3s ease-in-out both;
  transform-origin: 110px 70px;
}
.celebration-flight-trail {
  animation: celebration-trail 2.4s ease-out both;
}
.celebration-heart {
  animation: celebration-heart 1s ease-in-out 3;
  transform-origin: 0 0;
}
.celebration-heart-small {
  animation: celebration-heart-small 2.5s ease-out both;
}
.celebration-medal {
  transform-origin: 90px 35px;
  animation: celebration-medal 1.9s ease-out both;
}
.practice-retry .celebration-position {
  width: min(430px, calc(100vw - 32px));
}
.practice-retry .celebration-bubble {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 1px 6px;
  padding: 12px 16px;
  text-align: left;
  border-radius: 24px;
  background: #fff0ed;
  border-color: #ce7276;
  box-shadow:
    0 10px 34px #9e4c4930,
    0 3px 0 #e8b9b8;
}
.practice-retry .celebration-art {
  width: 68px;
  height: 68px;
  grid-row: 1/3;
}
.practice-retry .celebration-bubble strong {
  font-size: 20px;
  color: #a32e36;
}
.practice-retry .celebration-bubble > span {
  max-width: 310px;
  line-height: 1.7;
  font-size: 12px;
  color: #793e3c;
}
.celebration-retry-arrow {
  animation: celebration-spark 1.8s ease-in-out 2;
}
.choice-retry {
  outline: 4px solid #c34b50 !important;
  outline-offset: 3px;
  animation: practice-try 0.6s ease-in-out;
}
.feedback.retry-text {
  color: #a32e36;
  font-weight: 700;
}
@keyframes practice-try {
  0%,
  100% {
    transform: translateX(0);
  }
  20%,
  60% {
    transform: translateX(-5px);
  }
  40%,
  80% {
    transform: translateX(5px);
  }
}
@keyframes celebration-arrive {
  0% {
    opacity: 0;
    transform: scale(0.85) translateY(10px);
  }
  12%,
  87% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  100% {
    opacity: 0;
    transform: scale(0.98);
  }
}
@keyframes celebration-star {
  0%,
  100% {
    transform: scale(1) rotate(-8deg);
  }
  50% {
    transform: scale(1.15) rotate(8deg);
  }
}
@keyframes celebration-orbit {
  from {
    transform: rotate(-30deg) scale(0.5);
  }
  to {
    transform: rotate(12deg) scale(1);
  }
}
@keyframes celebration-spark {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 1;
  }
}
@keyframes celebration-grow {
  0% {
    transform: scale(0.2, 0.1);
  }
  65% {
    transform: scale(1.04, 1.06);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes celebration-balloon {
  0% {
    transform: translateY(26px);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  60% {
    transform: translate(var(--shift), -8px);
  }
  100% {
    transform: translateY(-3px);
  }
}
@keyframes celebration-rainbow {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes celebration-flower {
  0% {
    transform: scale(0.15) rotate(-40deg);
  }
  65% {
    transform: scale(1.05) rotate(8deg);
  }
  100% {
    transform: scale(1) rotate(0);
  }
}
@keyframes celebration-bear {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}
@keyframes celebration-clap-left {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(16px);
  }
}
@keyframes celebration-clap-right {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(-16px);
  }
}
@keyframes celebration-ribbon {
  0% {
    transform: translate(0, 0) rotate(0);
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  60% {
    opacity: 1;
    transform: translate(var(--x), var(--y)) rotate(var(--turn));
  }
  100% {
    opacity: 0;
    transform: translate(var(--x), 18px) rotate(var(--turn));
  }
}
@keyframes celebration-plane {
  0% {
    transform: translate(-35px, 24px) rotate(-15deg);
    opacity: 0;
  }
  25% {
    opacity: 1;
  }
  65% {
    transform: translate(12px, -14px) rotate(4deg);
  }
  100% {
    transform: translate(3px, -3px) rotate(0);
  }
}
@keyframes celebration-trail {
  0% {
    opacity: 0;
    stroke-dashoffset: 80;
  }
  65%,
  100% {
    opacity: 1;
    stroke-dashoffset: 0;
  }
}
@keyframes celebration-heart {
  0%,
  100% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.13);
  }
  70% {
    transform: scale(0.98);
  }
}
@keyframes celebration-heart-small {
  0% {
    transform: translateY(18px);
    opacity: 0;
  }
  30%,
  100% {
    opacity: 1;
    transform: translateY(-4px);
  }
}
@keyframes celebration-medal {
  0% {
    transform: translateY(-20px) rotate(-18deg);
    opacity: 0;
  }
  30% {
    opacity: 1;
    transform: rotate(12deg);
  }
  60% {
    transform: rotate(-6deg);
  }
  100% {
    transform: rotate(0);
  }
}
@media (max-width: 600px) {
  .celebration-art {
    width: 156px;
    height: 130px;
  }
  .celebration-bubble strong {
    font-size: 21px;
  }
  .celebration-bubble {
    padding-bottom: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .celebration *,
  .practice-retry *,
  .choice-retry {
    animation: none !important;
  }
  .celebration-rainbow path {
    stroke-dashoffset: 0;
  }
  .celebration-ribbon {
    transform: translate(var(--x), var(--y)) rotate(var(--turn));
  }
}
