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

.onx {
  display: grid;
  place-items: center;
  width: 100%;
}

.onx__col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.onx__track {
  --travel: 94px;
  position: relative;
  display: block;
  overflow: hidden;
  width: 190px;
  height: 96px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(255, 247, 230, 0.1), rgba(255, 247, 230, 0) 46%, rgba(255, 247, 230, 0.12) 62%, rgba(255, 247, 230, 0.03)), #17141a;
  box-shadow: inset 0 2px 0 rgba(255, 247, 230, 0.4), inset -2px -2px 0 rgba(255, 247, 230, 0.16), 0 18px 34px rgba(23, 20, 26, 0.35);
  transition: box-shadow 300ms ease-out;
}

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

.onx__light {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(120% 150% at 32% 50%, rgba(47, 109, 246, 0.96), rgba(10, 79, 232, 0.92) 62%, rgba(10, 79, 232, 0.8));
  opacity: 0;
  transition: opacity 600ms ease-out;
}

.onx__sweep {
  position: absolute;
  left: 44%;
  top: 12%;
  width: 52%;
  height: 76%;
  border-radius: 50%;
  pointer-events: none;
  background: linear-gradient(52deg, rgba(255, 255, 255, 0) 34%, rgba(255, 255, 255, 0.46) 56%, rgba(255, 255, 255, 0) 78%);
  transform: translateX(0) rotate(0deg);
  transition: transform 600ms ease-out;
}

.onx__star {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background-color: rgba(255, 247, 230, 0.22);
  transition: background-color 220ms ease-out, box-shadow 220ms ease-out;
}

.onx__star--1 {
  left: 34px;
  top: 7px;
  width: 3px;
  height: 3px;
}

.onx__star--2 {
  left: 66px;
  top: 5px;
  width: 2px;
  height: 2px;
}

.onx__star--3 {
  left: 98px;
  top: 8px;
  width: 4px;
  height: 4px;
}

.onx__star--4 {
  left: 126px;
  top: 6px;
  width: 2px;
  height: 2px;
}

.onx__star--5 {
  left: 152px;
  top: 9px;
  width: 3px;
  height: 3px;
}

.onx__knob {
  position: absolute;
  left: 12px;
  top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.05) 42%, rgba(23, 20, 26, 0.16)), #fff7e6;
  box-shadow: 0 10px 18px rgba(23, 20, 26, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transform: translateX(0);
  transition: transform 300ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

.onx__grip {
  width: 18px;
  height: 22px;
  background-image: linear-gradient(90deg, rgba(23, 20, 26, 0.38) 0 2px, transparent 2px 8px, rgba(23, 20, 26, 0.38) 8px 10px, transparent 10px 16px, rgba(23, 20, 26, 0.38) 16px 18px);
}

.onx.is-on .onx__track {
  box-shadow: inset 0 2px 0 rgba(255, 247, 230, 0.4), inset -2px -2px 0 rgba(255, 247, 230, 0.16), 0 18px 34px rgba(23, 20, 26, 0.35), 0 0 34px rgba(47, 109, 246, 0.55);
}

.onx.is-on .onx__knob {
  transform: translateX(var(--travel));
}

.onx.is-on .onx__light {
  opacity: 1;
}

.onx.is-on .onx__sweep {
  transform: translateX(-76%) rotate(-9deg);
}

.onx.is-on .onx__star {
  background-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.75);
}

.onx__state {
  position: relative;
  margin: 0;
  width: 60px;
  height: 16px;
}

.onx__wordOn, .onx__wordOff {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: clamp(12px, 3vw, 14px);
  line-height: 1;
  color: rgba(23, 20, 26, 0.72);
}

.onx__wordOn {
  display: none;
  color: #17141a;
}

.onx.is-on .onx__wordOn {
  display: flex;
}

.onx.is-on .onx__wordOff {
  display: none;
}

.onx.is-demo .onx__knob {
  animation-name: onxKnobLoop;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite;
}

@keyframes onxKnobLoop {
  0%, 6% {
    transform: translateX(0);
  }
  19% {
    transform: translateX(calc(var(--travel) + 4px));
  }
  25%, 56% {
    transform: translateX(var(--travel));
  }
  69% {
    transform: translateX(-4px);
  }
  75%, 100% {
    transform: translateX(0);
  }
}
.onx.is-demo .onx__light {
  animation-name: onxLightLoop;
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
}

@keyframes onxLightLoop {
  0%, 8% {
    opacity: 0;
  }
  46%, 58% {
    opacity: 1;
  }
  88%, 100% {
    opacity: 0;
  }
}
.onx.is-demo .onx__sweep {
  animation-name: onxSweepLoop;
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
}

@keyframes onxSweepLoop {
  0%, 10% {
    transform: translateX(0) rotate(0deg);
  }
  48%, 58% {
    transform: translateX(-76%) rotate(-9deg);
  }
  86%, 100% {
    transform: translateX(0) rotate(0deg);
  }
}
.onx.is-demo .onx__star {
  animation-name: onxStarLoop;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

@keyframes onxStarLoop {
  0%, 28% {
    background-color: rgba(255, 247, 230, 0.22);
    box-shadow: 0 0 0 rgba(255, 255, 255, 0);
  }
  32%, 58% {
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.75);
  }
  62%, 100% {
    background-color: rgba(255, 247, 230, 0.22);
    box-shadow: 0 0 0 rgba(255, 255, 255, 0);
  }
}
.onx.is-demo .onx__wordOn {
  display: flex;
  opacity: 0;
}

.onx.is-demo .onx__wordOff {
  opacity: 1;
}

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

@keyframes onxWordOnLoop {
  0%, 8% {
    opacity: 0;
  }
  12%, 58% {
    opacity: 1;
  }
  62%, 100% {
    opacity: 0;
  }
}
.onx.is-demo .onx__wordOff {
  animation-name: onxWordOffLoop;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

@keyframes onxWordOffLoop {
  0%, 8% {
    opacity: 1;
  }
  12%, 58% {
    opacity: 0;
  }
  62%, 100% {
    opacity: 1;
  }
}
@media (max-width: 340px) {
  .onx__col {
    gap: 8px;
  }
  .onx__track {
    --travel: 74px;
    width: 150px;
    height: 76px;
  }
  .onx__knob {
    left: 10px;
    top: 10px;
    width: 56px;
    height: 56px;
  }
  .onx__grip {
    width: 14px;
    height: 18px;
  }
  .onx__star--1 {
    left: 26px;
    top: 5px;
  }
  .onx__star--2 {
    left: 48px;
    top: 4px;
  }
  .onx__star--3 {
    left: 72px;
    top: 6px;
  }
  .onx__star--4 {
    left: 94px;
    top: 4px;
  }
  .onx__star--5 {
    left: 114px;
    top: 6px;
  }
  .onx__state {
    width: 48px;
    height: 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .onx .onx__track {
    transition: none !important;
  }
  .onx .onx__knob {
    transition: none !important;
  }
  .onx .onx__light {
    transition: none !important;
  }
  .onx .onx__sweep {
    transition: none !important;
  }
  .onx .onx__star {
    transition: none !important;
  }
  .onx.is-demo .onx__knob {
    animation: none !important;
  }
  .onx.is-demo .onx__light {
    animation: none !important;
  }
  .onx.is-demo .onx__sweep {
    animation: none !important;
  }
  .onx.is-demo .onx__star {
    animation: none !important;
  }
  .onx.is-demo .onx__wordOn {
    animation: none !important;
    opacity: 0 !important;
  }
  .onx.is-demo .onx__wordOff {
    animation: none !important;
    opacity: 1 !important;
  }
}
