/* ---------- result overlays sit on top of the board ---------- */
.screen[data-screen='level-clear'],
.screen[data-screen='game-over'],
.screen[data-screen='win'] {
  position: fixed;
  inset: 0;
  z-index: 60;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 28px);
  overflow-y: auto;
  background: radial-gradient(circle at 50% 40%, rgba(40, 18, 10, 0.72), rgba(8, 5, 3, 0.92));
  backdrop-filter: blur(5px);
}

.screen[data-screen='level-clear'] > *,
.screen[data-screen='game-over'] > *,
.screen[data-screen='win'] > * {
  margin-block: auto;
}

/* the three reward stars */
.star {
  display: inline-block;
  font-size: clamp(1.7rem, 5.5vw, 2.5rem);
  line-height: 1;
  color: rgba(255, 255, 255, 0.2);
  transition: color 200ms ease, transform 200ms ease;
}

.star.is-on {
  color: #ffd76a;
  filter: drop-shadow(0 0 12px rgba(255, 215, 106, 0.75));
  animation: starPop 420ms cubic-bezier(0.3, 1.6, 0.5, 1) both;
}

.star.is-on:nth-child(2) {
  animation-delay: 120ms;
}

.star.is-on:nth-child(3) {
  animation-delay: 240ms;
}

@keyframes starPop {
  0% {
    transform: scale(0.2) rotate(-30deg);
    opacity: 0;
  }
  100% {
    transform: scale(1) rotate(0);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .star.is-on {
    animation: none;
  }
}
