.celebrate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  display: grid;
  place-items: center;
  transition: opacity 400ms ease;
}

.celebrate--out { opacity: 0; }

.celebrate__confetti {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.celebrate__banner {
  position: relative;
  text-align: center;
  /* Leave room for the pulse animation (up to 5% larger) inside a 16px gutter */
  max-width: calc((100vw - 2 * var(--sp-4)) / 1.05);
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--radius-lg);
  background: rgba(13, 59, 44, 0.88);
  box-shadow: 0 0 0 3px var(--c-primary), 0 20px 50px rgba(0, 0, 0, 0.5);
  animation: celebrate-pop 650ms cubic-bezier(0.2, 1.6, 0.4, 1) both;
  /* Sit a little above centre so it doesn't cover the dice */
  margin-bottom: 18vh;
}

.celebrate__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 11vw, 4rem);
  font-weight: 700;
  line-height: 1;
  color: var(--c-primary);
  text-shadow: 0 3px 0 #9a6c00, 0 6px 18px rgba(0, 0, 0, 0.45);
  letter-spacing: 0.02em;
}

.celebrate__sub {
  margin-top: var(--sp-2);
  color: var(--c-on-bg);
  font-weight: 600;
}

/* Eagle and better: gold shimmer sweeping across the title */
.celebrate--lvl2 .celebrate__title,
.celebrate--lvl3 .celebrate__title {
  background: linear-gradient(100deg, #ffcf3f 30%, #fff6c8 45%, #ffcf3f 60%) 0 0 / 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 3px 0 #9a6c00) drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45));
  animation: celebrate-shine 1.4s linear 0.4s infinite;
}

.celebrate--lvl3 .celebrate__banner {
  box-shadow: 0 0 0 3px var(--c-primary), 0 0 40px 8px rgba(255, 207, 63, 0.55), 0 20px 50px rgba(0, 0, 0, 0.5);
  animation: celebrate-pop 650ms cubic-bezier(0.2, 1.6, 0.4, 1) both, celebrate-pulse 900ms ease-in-out 650ms infinite;
}

@keyframes celebrate-pop {
  0% { transform: scale(0.3) rotate(-8deg); opacity: 0; }
  60% { opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

@keyframes celebrate-shine {
  from { background-position: 100% 0; }
  to { background-position: -150% 0; }
}

@keyframes celebrate-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
