@property --s {
  syntax: "<integer>";
  initial-value: 4;
  inherits: true;
}
@property --e {
  syntax: "<integer>";
  initial-value: 8;
  inherits: true;
}
@property --n {
  syntax: "<integer>";
  initial-value: 67;
  inherits: true;
}
@property --d {
  syntax: "<integer>";
  initial-value: 5;
  inherits: true;
}
html, body {
  margin: 0;
  overflow: hidden;
}

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

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

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

.br__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 0 4px;
}

.br__title {
  font-size: 13px;
  line-height: 18px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.br__lab {
  font-size: 12px;
  line-height: 18px;
  color: rgba(23, 20, 26, 0.62);
}

.br__val {
  font-size: 13px;
  line-height: 18px;
  font-weight: 800;
  color: #2f6df6;
  font-variant-numeric: tabular-nums;
}

.br__n {
  font-style: normal;
  counter-reset: n var(--n);
}

.br__n::after {
  content: counter(n);
}

.br__d {
  font-style: normal;
  counter-reset: d var(--d);
}

.br__d::after {
  content: counter(d);
}

.br__u {
  font-style: normal;
}

.br__plot {
  display: grid;
  height: 116px;
}

.br__track,
.br__band,
.br__hot {
  grid-area: 1/1;
}

.br__track {
  display: grid;
  grid-template-columns: repeat(14, 1fr);
  grid-template-rows: 1fr;
}

.br__bar {
  align-self: end;
  justify-self: center;
  width: 62%;
  height: var(--b);
  border-radius: 4px 4px 0 0;
  background: #2f6df6;
}

.br__bar[data-in="0"] {
  opacity: 0.3;
}

.br__band {
  display: block;
  height: 100%;
  width: 7.1428571429%;
  border-radius: 4px;
  background: rgba(47, 109, 246, 0.16);
  transform-origin: left center;
  transform: translateX(calc(var(--s) * 100%)) scaleX(calc(var(--e) - var(--s) + 1));
}

.br__hot {
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: col-resize;
}

.br__hot:focus-visible {
  outline: 2px solid #2f6df6;
  outline-offset: -2px;
}

.br__hint {
  margin: 0;
  padding: 0 4px;
  font-size: 11px;
  line-height: 16px;
  color: rgba(23, 20, 26, 0.62);
}

.br:not(.is-demo) .br__band {
  transition-property: transform;
  transition-duration: 220ms;
  transition-timing-function: ease-out;
}

.br:not(.is-demo) .br__bar {
  transition-property: opacity;
  transition-duration: 140ms;
  transition-timing-function: ease-out;
}

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

@keyframes br-band {
  0%, 15% {
    transform: translateX(400%) scaleX(5);
  }
  40%, 70% {
    transform: translateX(0) scaleX(14);
  }
  88%, 100% {
    transform: translateX(400%) scaleX(5);
  }
}
.br.is-demo .br__bar[data-far="1"] {
  animation-name: br-far;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

@keyframes br-far {
  0%, 39.99% {
    opacity: 0.3;
  }
  40%, 87.99% {
    opacity: 1;
  }
  88%, 100% {
    opacity: 0.3;
  }
}
.br.is-demo {
  animation-name: br-nums;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

@keyframes br-nums {
  0%, 39.99% {
    --n: 67;
    --d: 5;
  }
  40%, 87.99% {
    --n: 165;
    --d: 14;
  }
  88%, 100% {
    --n: 67;
    --d: 5;
  }
}
@media (max-width: 340px) {
  .br {
    padding: 8px;
    gap: 4px;
  }
  .br__plot {
    height: 88px;
  }
  .br__title, .br__val {
    font-size: 12px;
    line-height: 16px;
  }
  .br__lab {
    font-size: 11px;
    line-height: 16px;
  }
  .br__hint {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .br.is-demo,
  .br.is-demo .br__band,
  .br.is-demo .br__bar[data-far="1"] {
    animation: none !important;
  }
  .br:not(.is-demo) .br__band,
  .br:not(.is-demo) .br__bar {
    transition: none !important;
  }
}
