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);
}

.gr {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 424px;
}

.gr__main {
  display: flex;
  align-items: center;
  gap: 16px;
}

.gr__ringBox {
  position: relative;
  display: grid;
  place-items: center;
  width: 128px;
  height: 128px;
  flex: 0 0 auto;
}

.gr__svg {
  width: 128px;
  height: 128px;
  transform: rotate(-90deg);
}

.gr__track {
  fill: none;
  stroke: rgba(255, 247, 230, 0.12);
  stroke-width: 10;
}

.gr__fill {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 314.16;
  stroke-dashoffset: 78;
}

.gr__fill--a {
  stroke: #ffd23f;
}

.gr__fill--b {
  stroke: #4cd4a6;
  stroke-dasharray: 238.76;
  stroke-dashoffset: 79;
}

.gr__fill--c {
  stroke: #ff9ebb;
  stroke-dasharray: 163.36;
  stroke-dashoffset: 82;
}

.gr__burst {
  position: absolute;
  width: 0;
  height: 0;
}

.gr__shard {
  position: absolute;
  left: -3px;
  top: -3px;
  width: 6px;
  height: 6px;
  border-radius: 4px;
  background: #fff7e6;
  opacity: 0;
}

.gr__legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  flex: 1 1 auto;
  min-width: 0;
}

.gr__item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gr__swatch {
  width: 10px;
  height: 10px;
  border-radius: 4px;
  flex: 0 0 auto;
}

.gr__swatch--a {
  background: #ffd23f;
}

.gr__swatch--b {
  background: #4cd4a6;
}

.gr__swatch--c {
  background: #ff9ebb;
}

.gr__name {
  flex: 1 1 auto;
  font-weight: 700;
  font-size: clamp(10px, 2.6vw, 12px);
  color: #fff7e6;
  overflow: hidden;
  white-space: nowrap;
}

.gr__pct {
  font-weight: 800;
  font-size: clamp(11px, 2.8vw, 13px);
  color: #fff7e6;
}

.gr__say {
  margin: 0;
  font-weight: 700;
  font-size: clamp(9px, 2.4vw, 11px);
  color: rgba(255, 247, 230, 0.7);
}

.gr__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.gr__go {
  border: 2px solid rgba(255, 247, 230, 0.38);
  border-radius: 999px;
  padding: 4px 12px;
  background: transparent;
  color: #fff7e6;
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  font-size: clamp(10px, 2.6vw, 11px);
  line-height: 1.6;
}

.gr__go:focus-visible {
  outline: 2px solid #ffd23f;
  outline-offset: 2px;
}

.gr.is-demo .gr__fill--a {
  animation-name: grRingA;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}

.gr.is-demo .gr__fill--b {
  animation-name: grRingB;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}

.gr.is-demo .gr__fill--c {
  animation-name: grRingC;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}

@keyframes grRingA {
  0% {
    stroke-dashoffset: 314.16;
  }
  66% {
    stroke-dashoffset: 0;
  }
  84% {
    stroke-dashoffset: 314.16;
  }
  100% {
    stroke-dashoffset: 314.16;
  }
}
@keyframes grRingB {
  0% {
    stroke-dashoffset: 238.76;
  }
  66% {
    stroke-dashoffset: 0;
  }
  84% {
    stroke-dashoffset: 238.76;
  }
  100% {
    stroke-dashoffset: 238.76;
  }
}
@keyframes grRingC {
  0% {
    stroke-dashoffset: 163.36;
  }
  66% {
    stroke-dashoffset: 0;
  }
  84% {
    stroke-dashoffset: 163.36;
  }
  100% {
    stroke-dashoffset: 163.36;
  }
}
.gr.is-demo .gr__shard,
.gr.is-done .gr__shard {
  animation-name: grBurst;
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
}

.gr.is-done .gr__shard {
  animation-duration: 600ms;
  animation-iteration-count: 1;
}

@keyframes grBurst {
  0%, 66% {
    transform: rotate(calc(var(--a) * 45deg)) translateY(0) scale(0.4);
    opacity: 0;
  }
  72% {
    transform: rotate(calc(var(--a) * 45deg)) translateY(-34px) scale(1);
    opacity: 1;
  }
  84% {
    transform: rotate(calc(var(--a) * 45deg)) translateY(-62px) scale(0.4);
    opacity: 0;
  }
  100% {
    transform: rotate(calc(var(--a) * 45deg)) translateY(0) scale(0.4);
    opacity: 0;
  }
}
@media (max-width: 340px) {
  .gr {
    gap: 8px;
  }
  .gr__main {
    gap: 8px;
  }
  .gr__ringBox {
    width: 96px;
    height: 96px;
  }
  .gr__svg {
    width: 96px;
    height: 96px;
  }
  .gr__legend {
    gap: 4px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .gr.is-demo .gr__fill--a,
  .gr.is-demo .gr__fill--b,
  .gr.is-demo .gr__fill--c {
    animation: none !important;
  }
  .gr.is-demo .gr__shard,
  .gr.is-done .gr__shard {
    animation: none !important;
    opacity: 0 !important;
  }
}
