html, body {
  margin: 0;
  overflow: hidden;
}

.stage {
  box-sizing: border-box;
  min-height: 100vh;
  display: grid;
  place-items: center;
  margin: 0;
  background: #ffffff;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  padding: clamp(8px, 4vw, 24px);
}

.rating {
  border: 0;
  padding: 0;
  margin: 0;
}
.rating__legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.rating__stars {
  display: flex;
  flex-direction: row-reverse;
  gap: clamp(4px, 1.6vw, 8px);
}
.rating__input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.rating__star {
  position: relative;
  font-size: clamp(28px, 8vw, 36px);
  line-height: 1;
  color: rgba(23, 20, 26, 0.72);
  cursor: pointer;
  transition: color 300ms cubic-bezier(0.2, 1.4, 0.4, 1);
}
.rating__spark {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  background: #2f6df6;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}
.rating__input:checked ~ .rating__star {
  color: #2f6df6;
}
.rating__input:checked + .rating__star {
  animation: star-pick 300ms cubic-bezier(0.2, 1.4, 0.4, 1);
}
.rating.is-demo .rating__star {
  animation: star-wave 2s cubic-bezier(0.2, 1.4, 0.4, 1) infinite;
  animation-delay: calc(var(--i) * 0.12s);
}

@keyframes star-pick {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.35);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes star-wave {
  0%, 100% {
    color: rgba(23, 20, 26, 0.72);
    transform: scale(1);
  }
  40% {
    color: #2f6df6;
    transform: scale(1.2);
  }
}
@media (prefers-reduced-motion: reduce) {
  .rating__star {
    transition: color 1ms;
  }
  .rating__input:checked + .rating__star {
    animation: none !important;
  }
  .rating.is-demo .rating__star {
    animation: none !important;
  }
  .rating__spark {
    display: none;
  }
}
