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

.hc {
  box-sizing: border-box;
  display: grid;
  justify-items: center;
  gap: clamp(8px, 2.4vw, 12px);
  width: clamp(272px, 94vw, 432px);
  text-align: center;
}

.hc__title {
  margin: 0;
  color: #17141a;
  font-weight: 800;
  font-size: clamp(13px, 3.4vw, 20px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  word-break: keep-all;
}

.hc__row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(8px, 3vw, 16px);
  width: 100%;
}

.hc__cell {
  --d: 0s;
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 0;
}

.hc__cell--2 {
  --d: .16s;
}

.hc__cell--3 {
  --d: .32s;
}

.hc__value {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0;
  margin: 0;
  color: #17141a;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: clamp(20px, 6vw, 32px);
  line-height: 1;
  letter-spacing: -0.02em;
}

.hc__win {
  display: block;
  overflow: hidden;
  height: 1.15em;
}

.hc__strip {
  display: block;
  transform: translateY(-6.9em);
}

.hc__digit {
  display: block;
  height: 1.15em;
  line-height: 1.15em;
}

.hc__unit {
  font-weight: 700;
  font-size: 0.56em;
  line-height: 1.6;
}

.hc__rule {
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: #17141a;
  transform: scaleX(1);
  transform-origin: left center;
}

.hc__label {
  margin: 0;
  color: #17141a;
  font-weight: 600;
  font-size: clamp(9px, 2.2vw, 12px);
  line-height: 1.2;
}

.hc__again {
  padding: 4px 12px;
  border: 0;
  border-radius: 999px;
  background: #17141a;
  color: #ffffff;
  font-weight: 700;
  font-size: clamp(10px, 2.4vw, 12px);
  line-height: 1.2;
  cursor: pointer;
}

.hc__again:focus-visible {
  outline: 2px solid #17141a;
  outline-offset: 2px;
}

.hc.is-demo .hc__strip {
  animation-name: hcRoll;
  animation-duration: 2s;
  animation-timing-function: steps(6, end);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
  animation-delay: var(--d);
}

.hc.is-demo .hc__win:nth-child(2) .hc__strip {
  animation-delay: calc(var(--d) + 0.08s);
}

.hc.is-demo .hc__rule {
  animation-name: hcRule;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
  animation-delay: var(--d);
}

@keyframes hcRoll {
  0% {
    transform: translateY(0);
  }
  60% {
    transform: translateY(-6.9em);
  }
  100% {
    transform: translateY(-6.9em);
  }
}
@keyframes hcRule {
  0%, 58% {
    transform: scaleX(0);
  }
  72%, 86% {
    transform: scaleX(1);
  }
  90%, 100% {
    transform: scaleX(0);
  }
}
@media (max-width: 340px), (max-height: 220px) {
  .hc {
    gap: 8px;
    width: 100%;
  }
  .hc__row {
    gap: 4px;
  }
  .hc__cell {
    gap: 0;
  }
  .hc__rule {
    height: 2px;
  }
  .hc__again {
    padding: 0 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .hc__strip, .hc__rule {
    animation: none !important;
  }
}
