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

.sw {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 300px;
}

.sw__time {
  margin: 0;
  font-weight: 800;
  font-size: clamp(28px, 9vw, 44px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: #17141a;
  letter-spacing: -0.02em;
}

.sw__sep {
  color: rgba(23, 20, 26, 0.72);
}

.sw__cs {
  position: relative;
  display: inline-block;
}

.sw__reels {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  color: #17141a;
}

.sw__reel {
  flex: 1 1 0;
  overflow: hidden;
  height: 1em;
  line-height: 1;
  text-align: center;
}

.sw__reelInner {
  display: block;
  line-height: 1;
}

.sw__acts {
  display: flex;
  gap: 8px;
}

.sw__btn {
  padding: 8px 12px;
  border: 2px solid #0a4fe8;
  border-radius: 999px;
  background-color: #0a4fe8;
  color: #fff7e6;
  font-weight: 700;
  font-size: clamp(10px, 2.6vw, 12px);
  cursor: pointer;
}

.sw__btn--ghost {
  border-color: #17141a;
  background-color: #ffffff;
  color: #17141a;
}

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

.sw__lapBox {
  position: relative;
  min-height: clamp(56px, 22vw, 92px);
}

.sw__laps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sw__lap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 8px;
  background-color: #ffffff;
}

.sw__lapNo {
  font-weight: 800;
  font-size: clamp(8px, 2.2vw, 10px);
  color: rgba(23, 20, 26, 0.72);
}

.sw__lapAt {
  font-weight: 800;
  font-size: clamp(10px, 2.6vw, 12px);
  font-variant-numeric: tabular-nums;
  color: #17141a;
}

.sw__lap.is-new {
  animation-name: swLapIn;
  animation-duration: 600ms;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: 1;
}

@keyframes swLapIn {
  from {
    opacity: 0;
    translate: 0 -70%;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}
.sw__laps--ghost {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
}

.sw.is-demo .sw__laps--ghost {
  display: flex;
}

.sw.is-demo .sw__laps:not(.sw__laps--ghost) {
  visibility: hidden;
}

.sw.is-demo .sw__cs {
  color: transparent;
}

.sw.is-demo .sw__reels {
  display: flex;
}

.sw.is-demo .sw__reelInner {
  animation-duration: 2s;
  animation-iteration-count: infinite;
  animation-fill-mode: both;
}

.sw.is-demo .sw__reel .sw__reelInner {
  animation-name: swReelSlow;
  animation-timing-function: steps(10, end);
}

.sw.is-demo .sw__reel--fast .sw__reelInner {
  animation-name: swReelFast;
  animation-timing-function: steps(20, end);
}

@keyframes swReelSlow {
  from {
    translate: 0 0;
  }
  to {
    translate: 0 -10em;
  }
}
@keyframes swReelFast {
  from {
    translate: 0 0;
  }
  to {
    translate: 0 -20em;
  }
}
.sw__lap--g1 {
  animation-delay: 0ms;
}

.sw__lap--g2 {
  animation-delay: 200ms;
}

.sw__lap--g3 {
  animation-delay: 400ms;
}

.sw.is-demo .sw__laps--ghost .sw__lap {
  animation-name: swGhostSlide, swGhostShow;
  animation-duration: 2s, 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1), steps(1, end);
  animation-iteration-count: infinite, infinite;
  animation-fill-mode: both, both;
}

@keyframes swGhostSlide {
  0% {
    translate: 0 -70%;
  }
  16%, 86% {
    translate: 0 0;
  }
  87%, 100% {
    translate: 0 -70%;
  }
}
@keyframes swGhostShow {
  0% {
    opacity: 0;
  }
  3%, 86% {
    opacity: 1;
  }
  87%, 100% {
    opacity: 0;
  }
}
@media (max-width: 340px) {
  .sw {
    gap: 8px;
  }
  .sw__acts {
    gap: 4px;
  }
  .sw__btn {
    padding: 4px 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sw__lap.is-new {
    animation: none !important;
  }
  .sw.is-demo .sw__reelInner,
  .sw.is-demo .sw__laps--ghost .sw__lap {
    animation: none !important;
  }
}
