@property --p {
  syntax: "<number>";
  inherits: false;
  initial-value: 0;
}
@property --n {
  syntax: "<integer>";
  inherits: false;
  initial-value: 0;
}
html, body {
  margin: 0;
  overflow: hidden;
}

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

.rp {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  height: 100%;
  min-height: 164px;
  justify-content: center;
}

.rp:focus-visible {
  outline: 2px solid #0a4fe8;
  outline-offset: 3px;
  border-radius: 12px;
}

.rp__ringwrap {
  position: relative;
  display: grid;
  place-items: center;
}

.rp__svg {
  transform: rotate(-90deg);
}

.rp__track {
  fill: none;
  stroke: rgba(23, 20, 26, 0.16);
  stroke-width: 9;
}

.rp__prog {
  fill: none;
  stroke: #0a4fe8;
  stroke-width: 9;
  stroke-linecap: round;
  --circ: 0;
  --p: 0;
  stroke-dasharray: var(--circ);
  stroke-dashoffset: calc(var(--circ) * (1 - var(--p) / 100));
}

.rp__pct {
  position: absolute;
  display: flex;
  align-items: baseline;
  gap: 0;
  font-weight: 700;
  font-size: 22px;
  line-height: 1;
  color: #17141a;
  --n: 0;
}

.rp__pct i {
  font-weight: 600;
  font-size: 12px;
  font-style: normal;
  opacity: 0.7;
}

.rp__n {
  counter-reset: rpn var(--n);
}

.rp__n::before {
  content: counter(rpn);
}

.rp__bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.rp__label {
  font-weight: 600;
  font-size: 11px;
  line-height: 1.3;
  color: rgba(23, 20, 26, 0.82);
}

.rp__meta {
  font-weight: 500;
  font-size: 10px;
  line-height: 1.3;
  color: rgba(23, 20, 26, 0.62);
}

@keyframes rpArc {
  0% {
    --p: 0;
  }
  70% {
    --p: 100;
  }
  90% {
    --p: 100;
  }
  92% {
    --p: 0;
  }
  100% {
    --p: 0;
  }
}
@keyframes rpCount {
  0% {
    --n: 0;
  }
  70% {
    --n: 100;
  }
  90% {
    --n: 100;
  }
  92% {
    --n: 0;
  }
  100% {
    --n: 0;
  }
}
@keyframes rpFade {
  0% {
    opacity: 1;
  }
  84% {
    opacity: 1;
  }
  90% {
    opacity: 0;
  }
  94% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}
.is-demo .rp__prog {
  animation-name: rpArc;
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
}

.is-demo .rp__pct {
  animation-name: rpCount;
  animation-duration: 2s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.is-demo .rp__ringwrap {
  animation-name: rpFade;
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
}

@media (max-width: 340px) {
  .rp__svg {
    width: 78px;
    height: 78px;
  }
  .rp__pct {
    font-size: 18px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .is-demo .rp__prog, .is-demo .rp__pct, .is-demo .rp__ringwrap {
    animation: none !important;
  }
  .is-demo .rp__prog {
    --p: 62 !important;
  }
  .is-demo .rp__pct {
    --n: 62 !important;
  }
}
