@property --p {
  syntax: "<number>";
  initial-value: 1;
  inherits: true;
}
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);
}

.us {
  --p: 1;
  box-sizing: border-box;
  width: min(360px, 88vw);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border: 2px solid #17141a;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  color: #17141a;
}

.us__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.us__lab {
  font-size: 12px;
  line-height: 18px;
  font-weight: 700;
  opacity: 0.6;
}

.us__slot {
  position: relative;
  display: flex;
  justify-content: flex-end;
  transform-origin: right center;
}

.us__live,
.us__f {
  display: flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
}

.us__f {
  position: absolute;
  right: 0;
  top: 0;
  opacity: 0;
}

.us__n {
  font-size: 16px;
  line-height: 20px;
  font-weight: 800;
}

.us__u {
  font-size: 11px;
  line-height: 16px;
  font-weight: 700;
  opacity: 0.6;
}

.us__slot--fee .us__n {
  color: #2f6df6;
  font-size: 26px;
  line-height: 32px;
}

.us__track {
  position: relative;
  height: 24px;
}

.us__rail {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 8px;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(23, 20, 26, 0.12);
}

.us__fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(calc(var(--p) * 0.2));
  background: #2f6df6;
}

.us__range {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  accent-color: #2f6df6;
}

.us__knobrail {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 0;
  bottom: 0;
}

.us__knob {
  position: absolute;
  top: 50%;
  left: calc(100% * (var(--p) - 0.5) * 0.2);
  width: 20px;
  height: 20px;
  box-sizing: border-box;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: #17141a;
  box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
  transform: translate(-50%, -50%);
}

.us__range:focus-visible ~ .us__knobrail .us__knob {
  outline: 2px solid #2f6df6;
  outline-offset: 2px;
}

.us__ticks {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 0 12px;
}

.us__tick {
  justify-self: center;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(23, 20, 26, 0.3);
}

.us:not(.is-demo) .us__fill,
.us:not(.is-demo) .us__knob {
  transition-property: transform, left;
  transition-duration: 220ms;
  transition-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

@keyframes us-p {
  0%, 6% {
    --p: 1;
  }
  22% {
    --p: 2;
  }
  38% {
    --p: 3;
  }
  54% {
    --p: 4;
  }
  70% {
    --p: 5;
  }
  74% {
    --p: 5;
    animation-timing-function: linear;
  }
  86%, 100% {
    --p: 1;
  }
}
.us.is-demo .us__live {
  opacity: 0;
}

.us.is-demo .us__f {
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

.us.is-demo .us__f[data-step="1"] {
  animation-name: us-f1;
}

.us.is-demo .us__f[data-step="2"] {
  animation-name: us-f2;
}

.us.is-demo .us__f[data-step="3"] {
  animation-name: us-f3;
}

.us.is-demo .us__f[data-step="4"] {
  animation-name: us-f4;
}

.us.is-demo .us__f[data-step="5"] {
  animation-name: us-f5;
}

@keyframes us-f1 {
  0% {
    opacity: 1;
  }
  14% {
    opacity: 0;
  }
  84.5% {
    opacity: 1;
  }
  100% {
    opacity: 1;
  }
}
@keyframes us-f2 {
  0% {
    opacity: 0;
  }
  14% {
    opacity: 1;
  }
  30% {
    opacity: 0;
  }
  81.5% {
    opacity: 1;
  }
  84.5% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
@keyframes us-f3 {
  0% {
    opacity: 0;
  }
  30% {
    opacity: 1;
  }
  46% {
    opacity: 0;
  }
  78.5% {
    opacity: 1;
  }
  81.5% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
@keyframes us-f4 {
  0% {
    opacity: 0;
  }
  46% {
    opacity: 1;
  }
  62% {
    opacity: 0;
  }
  75.5% {
    opacity: 1;
  }
  78.5% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
@keyframes us-f5 {
  0% {
    opacity: 0;
  }
  62% {
    opacity: 1;
  }
  75.5% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
.us.is-demo .us__slot--fee {
  animation-name: us-pop;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite;
}

@keyframes us-pop {
  0%, 10% {
    transform: scale(1);
  }
  16% {
    transform: scale(1.07);
  }
  22%, 26% {
    transform: scale(1);
  }
  32% {
    transform: scale(1.07);
  }
  38%, 42% {
    transform: scale(1);
  }
  48% {
    transform: scale(1.07);
  }
  54%, 58% {
    transform: scale(1);
  }
  64% {
    transform: scale(1.07);
  }
  70%, 82% {
    transform: scale(1);
  }
  86% {
    transform: scale(1.05);
  }
  92%, 100% {
    transform: scale(1);
  }
}
@media (max-width: 340px) {
  .us {
    width: min(280px, 90vw);
    gap: 4px;
    padding: 12px;
  }
  .us__lab {
    font-size: 11px;
    line-height: 16px;
  }
  .us__n {
    font-size: 14px;
    line-height: 18px;
  }
  .us__slot--fee .us__n {
    font-size: 21px;
    line-height: 26px;
  }
  .us__track {
    height: 20px;
  }
  .us__rail {
    top: 6px;
  }
  .us__knob {
    width: 16px;
    height: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .us.is-demo,
  .us.is-demo .us__f,
  .us.is-demo .us__slot--fee {
    animation: none !important;
  }
  .us:not(.is-demo) .us__fill,
  .us:not(.is-demo) .us__knob {
    transition: none !important;
  }
  .us.is-demo .us__f[data-step="1"] {
    opacity: 1;
  }
}
