html, body {
  margin: 0;
  overflow: hidden;
}

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

.sl {
  --row: clamp(24px, 9vw, 44px);
  --rows: 8;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 400px;
  max-height: 100%;
}

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

.sl__title {
  margin: 0;
  font-weight: 800;
  font-size: clamp(11px, 2.8vw, 15px);
  color: #fff7e6;
}

.sl__count {
  margin: 0;
  font-weight: 700;
  font-size: clamp(9px, 2.4vw, 12px);
  color: #fff7e6;
}

.sl__countNum {
  font-weight: 800;
  font-size: clamp(11px, 2.8vw, 14px);
  color: #fff7e6;
}

.sl__countLabel {
  font-weight: 700;
}

.sl__body {
  display: flex;
  align-items: center;
  gap: clamp(8px, 3vw, 16px);
}

.sl__window {
  position: relative;
  flex: 0 0 auto;
  width: clamp(104px, 34vw, 160px);
  height: calc(var(--row) * 3);
  overflow: hidden;
  border-radius: 16px;
  background-color: #fff7e6;
}

.sl__window::before,
.sl__window::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  z-index: 1;
  height: 14%;
  pointer-events: none;
}

.sl__window::before {
  top: 0;
  background-image: linear-gradient(#fff7e6, rgba(255, 247, 230, 0));
}

.sl__window::after {
  bottom: 0;
  background-image: linear-gradient(rgba(255, 247, 230, 0), #fff7e6);
}

.sl__track {
  display: flex;
  flex-direction: column;
  transition-property: transform;
  transition-duration: 2200ms;
  transition-timing-function: cubic-bezier(0.1, 0.7, 0.1, 1);
}

.sl__item {
  display: grid;
  place-items: center;
  height: var(--row);
  font-weight: 800;
  font-size: clamp(12px, 3.4vw, 18px);
  line-height: 1;
  color: #17141a;
}

.sl__frame {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--row);
  height: var(--row);
  z-index: 2;
  box-sizing: border-box;
  border-radius: 8px;
  background-color: rgba(10, 79, 232, 0.14);
  box-shadow: inset 0 0 0 2px #0a4fe8;
  pointer-events: none;
}

.sl__side {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sl__btn {
  padding: clamp(8px, 2vw, 12px) 12px;
  border: 2px solid #fff7e6;
  border-radius: 999px;
  background: none;
  color: #fff7e6;
  font-weight: 700;
  font-size: clamp(10px, 2.6vw, 13px);
  line-height: 1;
  cursor: pointer;
  transition: transform 220ms ease-out;
}

.sl__btn:focus-visible {
  outline: 2px solid #fff7e6;
  outline-offset: 2px;
}

.sl__btn:active {
  transform: scale(0.97);
}

.sl__btn--go {
  border-color: #0a4fe8;
  background-color: #0a4fe8;
  color: #fff7e6;
  font-weight: 800;
  font-size: clamp(11px, 3vw, 15px);
}

.sl__btn[disabled] {
  cursor: default;
  opacity: 0.82;
}

.sl__out {
  display: grid;
}

.sl__banner, .sl__ghost {
  grid-area: 1/1;
  justify-self: start;
  margin: 0;
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: clamp(10px, 2.6vw, 13px);
  line-height: 1.3;
  color: #fff7e6;
}

.sl__banner.is-win {
  background-color: #ffd23f;
  color: #17141a;
}

.sl__ghost {
  opacity: 0;
}

.sl__ghost--b {
  background-color: #ffd23f;
  color: #17141a;
}

.sl.is-demo .sl__track {
  animation-name: slRoll;
  animation-duration: 2s;
  animation-timing-function: steps(var(--rows), end);
  animation-iteration-count: infinite;
}

.sl.is-demo .sl__banner {
  animation-name: slBannerOff;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

.sl.is-demo .sl__ghost--a {
  animation-name: slGhostA;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

.sl.is-demo .sl__ghost--b {
  animation-name: slGhostB;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

@keyframes slRoll {
  0% {
    transform: translateY(0);
  }
  62% {
    transform: translateY(calc(var(--row) * var(--rows) * -1));
  }
  100% {
    transform: translateY(calc(var(--row) * var(--rows) * -1));
  }
}
@keyframes slBannerOff {
  0% {
    opacity: 0;
  }
  88% {
    opacity: 1;
  }
  100% {
    opacity: 1;
  }
}
@keyframes slGhostA {
  0% {
    opacity: 1;
  }
  62% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
@keyframes slGhostB {
  0% {
    opacity: 0;
  }
  62% {
    opacity: 1;
  }
  88% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
@media (max-width: 340px) {
  .sl {
    gap: 4px;
  }
  .sl__side {
    gap: 4px;
  }
  .sl__btn {
    padding: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sl__track {
    transition: none !important;
  }
  .sl__btn {
    transition: none !important;
  }
  .sl.is-demo .sl__track,
  .sl.is-demo .sl__banner,
  .sl.is-demo .sl__ghost {
    animation: none !important;
  }
  .sl.is-demo .sl__ghost {
    opacity: 0 !important;
  }
  .sl.is-demo .sl__banner {
    opacity: 1 !important;
  }
}
