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

.sp {
  position: relative;
  box-sizing: border-box;
  width: min(300px, 92vw);
  padding: 12px;
  border-radius: 16px;
  background: #fff7e6;
  color: #17141a;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
}

.sp * {
  box-sizing: border-box;
}

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

.sp__ic {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: #17141a;
}

.sp__ic--sm {
  width: 14px;
  height: 14px;
}

.sp__ic svg {
  width: 100%;
  height: 100%;
}

.sp__title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.sp__opts {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 0;
  border-radius: 999px;
  background: rgba(23, 20, 26, 0.08);
}

.sp__thumb {
  position: absolute;
  top: 0;
  left: 0;
  width: 33.3333333333%;
  height: 100%;
  border: 2px solid #17141a;
  border-radius: 999px;
  background: #fff7e6;
  transform: translateX(calc(var(--i, 0) * 100%));
  transition: transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.sp__opt {
  position: relative;
  z-index: 1;
  display: block;
  cursor: pointer;
}

.sp__radio {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}

.sp__pill {
  display: block;
  padding: 4px 0;
  border-radius: 999px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}

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

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

.sp__eta {
  padding: 4px 8px;
  border-radius: 12px;
  background-color: rgba(23, 20, 26, 0.06);
  transition: background-color 220ms steps(1, end);
}

.sp:has(.sp__opt:nth-child(3) .sp__radio:checked) .sp__eta {
  background-color: rgba(47, 109, 246, 0.14);
}

.sp:has(.sp__opt:nth-child(4) .sp__radio:checked) .sp__eta {
  background-color: rgba(47, 109, 246, 0.24);
}

.sp__line--fee {
  margin-top: 8px;
}

.sp__label {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  color: rgba(23, 20, 26, 0.62);
}

.sp__win {
  margin-left: auto;
  height: 16px;
  overflow: hidden;
}

.sp__roll {
  display: block;
  transform: translateY(calc(var(--i, 0) * -33.3333%));
  transition: transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.sp__cell {
  display: block;
  height: 16px;
  font-size: 13px;
  font-weight: 700;
  line-height: 16px;
  text-align: right;
  white-space: nowrap;
}

.sp__cell--fee {
  font-size: 12px;
  color: rgba(23, 20, 26, 0.72);
}

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

@keyframes spRoll {
  0%, 20% {
    transform: translateY(0);
  }
  32%, 48% {
    transform: translateY(-33.3333%);
  }
  60%, 76% {
    transform: translateY(-66.6666%);
  }
  88%, 100% {
    transform: translateY(0);
  }
}
@keyframes spThumb {
  0%, 20% {
    transform: translateX(0);
  }
  32%, 48% {
    transform: translateX(100%);
  }
  60%, 76% {
    transform: translateX(200%);
  }
  88%, 100% {
    transform: translateX(0);
  }
}
@keyframes spTint {
  0%, 20% {
    background-color: rgba(23, 20, 26, 0.06);
  }
  32%, 48% {
    background-color: rgba(47, 109, 246, 0.14);
  }
  60%, 76% {
    background-color: rgba(47, 109, 246, 0.24);
  }
  88%, 100% {
    background-color: rgba(23, 20, 26, 0.06);
  }
}
.sp.is-demo .sp__eta {
  animation-name: spTint;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}
.sp.is-demo .sp__roll {
  animation-name: spRoll;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}
.sp.is-demo .sp__thumb {
  animation-name: spThumb;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}

@media (max-width: 340px) {
  .sp {
    padding: 8px;
  }
  .sp__head {
    margin-bottom: 8px;
  }
  .sp__line {
    margin-top: 8px;
  }
  .sp__title {
    font-size: 12px;
  }
  .sp__cell {
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sp__roll,
  .sp__thumb,
  .sp__eta {
    transition: none !important;
  }
  .sp.is-demo .sp__roll,
  .sp.is-demo .sp__thumb,
  .sp.is-demo .sp__eta {
    animation: none !important;
  }
}
