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

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

.avg {
  --pct: calc(var(--rating) / 5 * 100%);
  display: inline-flex;
  align-items: baseline;
  gap: clamp(8px, 2.6vw, 12px);
  font-family: inherit;
}
.avg__stars {
  position: relative;
  display: inline-block;
  font-size: clamp(26px, 7.4vw, 34px);
  line-height: 1;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.avg__base {
  display: block;
  color: rgba(255, 247, 230, 0.72);
}
.avg__fill {
  position: absolute;
  inset: 0;
  display: block;
  width: 0%;
  overflow: hidden;
  color: #fff7e6;
  white-space: nowrap;
}
.avg__fill-text {
  display: block;
}
.avg__num {
  font-weight: 700;
  font-size: clamp(16px, 4.6vw, 20px);
  line-height: 1;
  font-family: inherit;
  color: #fff7e6;
}
.avg__fx {
  position: absolute;
  top: 50%;
  left: var(--pct);
  pointer-events: none;
}
.avg__spark {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  background: #fff7e6;
  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;
}

@keyframes reveal-fill {
  0% {
    width: 0%;
  }
  55%, 80% {
    width: var(--pct);
  }
  100% {
    width: var(--pct);
  }
}
.avg__fill {
  animation: reveal-fill 2s ease-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .avg__fill {
    animation: none !important;
    width: var(--pct);
  }
  .avg__spark {
    display: none;
  }
}
