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

.sc {
  box-sizing: border-box;
  width: min(304px, 92vw);
  padding: 12px;
  border: 1px solid rgba(255, 247, 230, 0.35);
  border-radius: 16px;
  background: rgba(23, 20, 26, 0.08);
  color: #17141a;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  font-size: 12px;
  line-height: 1.3;
}

.sc__h {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 0 8px;
}

.sc__ic {
  display: inline-flex;
  width: 14px;
  height: 14px;
  color: #ffd23f;
}

.sc__t {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
}

.sc__re {
  margin-left: auto;
  padding: 0 8px;
  border: 1px solid rgba(255, 247, 230, 0.5);
  border-radius: 999px;
  background: transparent;
  color: #17141a;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.7;
  cursor: pointer;
}

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

.sc__re:active {
  transform: scale(0.94);
}

.sc__cap {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin: 0 0 8px;
}

.sc__n {
  position: relative;
  display: inline-block;
  min-width: 2ch;
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  text-align: right;
  color: #fff7e6;
}

.sc__d {
  position: absolute;
  inset: 0;
  visibility: hidden;
  font-style: normal;
}

.sc__d--c {
  visibility: visible;
}

.sc__unit {
  color: #17141a;
  font-size: 11px;
  font-weight: 700;
}

.sc__chart {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  align-items: end;
}

.sc__col {
  display: grid;
  justify-items: center;
  gap: 4px;
}

.sc__barw {
  display: block;
  width: 100%;
  height: 56px;
}

.sc__bar {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 4px 4px 0 0;
  background: #fff7e6;
  transform-origin: bottom;
  transform: scaleY(var(--f));
  transition: transform 400ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.sc__barw.is-up .sc__bar {
  background: #ffd23f;
}

@keyframes sc-cycle {
  0% {
    transform: scaleY(0);
  }
  55% {
    transform: scaleY(var(--f));
  }
  90% {
    transform: scaleY(var(--f));
  }
  100% {
    transform: scaleY(0);
  }
}
@keyframes sc-d-a {
  0%, 24% {
    visibility: visible;
  }
  25%, 100% {
    visibility: hidden;
  }
}
@keyframes sc-d-b {
  0%, 24% {
    visibility: hidden;
  }
  25%, 54% {
    visibility: visible;
  }
  55%, 100% {
    visibility: hidden;
  }
}
@keyframes sc-d-c {
  0%, 54% {
    visibility: hidden;
  }
  55%, 86% {
    visibility: visible;
  }
  87%, 100% {
    visibility: hidden;
  }
}
@keyframes sc-re-press {
  0%, 82% {
    transform: translateY(0);
  }
  85% {
    transform: translateY(2px) scale(0.95);
  }
  89%, 100% {
    transform: translateY(0) scale(1);
  }
}
@keyframes sc-unit-pop {
  0%, 54% {
    transform: translateY(0);
  }
  58% {
    transform: translateY(-2px);
  }
  62%, 86% {
    transform: translateY(0);
  }
  87%, 100% {
    transform: translateY(0);
  }
}
.sc.is-demo .sc__bar {
  animation-name: sc-cycle;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}
.sc.is-demo .sc__chart .sc__col:nth-child(1) .sc__bar {
  animation-delay: 0s;
}
.sc.is-demo .sc__chart .sc__col:nth-child(2) .sc__bar {
  animation-delay: 80ms;
}
.sc.is-demo .sc__chart .sc__col:nth-child(3) .sc__bar {
  animation-delay: 160ms;
}
.sc.is-demo .sc__chart .sc__col:nth-child(4) .sc__bar {
  animation-delay: 240ms;
}
.sc.is-demo .sc__chart .sc__col:nth-child(5) .sc__bar {
  animation-delay: 320ms;
}
.sc.is-demo .sc__chart .sc__col:nth-child(6) .sc__bar {
  animation-delay: 400ms;
}
.sc.is-demo .sc__d--a {
  animation-name: sc-d-a;
}
.sc.is-demo .sc__d--b {
  animation-name: sc-d-b;
}
.sc.is-demo .sc__d--c {
  animation-name: sc-d-c;
}
.sc.is-demo .sc__d {
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}
.sc.is-demo .sc__re {
  animation-name: sc-re-press;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}
.sc.is-demo .sc__unit {
  animation-name: sc-unit-pop;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}

@media (max-width: 340px) {
  .sc {
    padding: 8px;
    font-size: 11px;
  }
  .sc__h {
    margin-bottom: 4px;
  }
  .sc__n {
    font-size: 24px;
  }
  .sc__cap {
    margin-bottom: 4px;
  }
  .sc__chart {
    gap: 4px;
  }
  .sc__barw {
    height: 44px;
  }
  .sc__hr {
    font-size: 9px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sc__bar {
    transition: none;
  }
  .sc__re:active {
    transform: none;
  }
  .sc.is-demo .sc__bar,
  .sc.is-demo .sc__re,
  .sc.is-demo .sc__unit,
  .sc.is-demo .sc__d {
    animation: none !important;
    transform: none !important;
  }
  .sc.is-demo .sc__bar {
    transform: scaleY(var(--f)) !important;
  }
  .sc.is-demo .sc__d--a, .sc.is-demo .sc__d--b {
    visibility: hidden !important;
  }
  .sc.is-demo .sc__d--c {
    visibility: visible !important;
  }
}
