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

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

.wh {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.wh__rig {
  position: relative;
  width: clamp(168px, 48vw, 204px);
  aspect-ratio: 1;
}

.wh__pointer {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 16px solid #ffffff;
  z-index: 2;
  filter: drop-shadow(0 2px 2px rgba(23, 20, 26, 0.3));
}

.wh__disc {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(#fff7e6 0deg 45deg, #5066a2 45deg 90deg, #fff7e6 90deg 135deg, #5066a2 135deg 180deg, #fff7e6 180deg 225deg, #5066a2 225deg 270deg, #fff7e6 270deg 315deg, #5066a2 315deg 360deg);
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
  transition: transform 1.8s cubic-bezier(0.12, 0.8, 0.08, 1);
}

.wh__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 4px solid rgba(255, 247, 230, 0.85);
}

.wh__lbl {
  position: absolute;
  left: calc(50% - 22px);
  top: calc(50% - 10px);
  width: 44px;
  height: 20px;
  pointer-events: none;
  transform: rotate(calc(var(--k) * 45deg + 22.5deg)) translateY(var(--label-r, -84px));
}

.wh__lbl b {
  display: block;
  text-align: center;
  line-height: 20px;
  font-weight: 800;
  font-size: clamp(10px, 3vw, 13px);
  color: #17141a;
  transform: rotate(calc(var(--k) * -45deg - 22.5deg));
}

.wh__lbl--b b {
  color: #fff7e6;
}

.wh__hub {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 34%;
  aspect-ratio: 1;
  border: 0;
  cursor: pointer;
  border-radius: 50%;
  background: #ffffff;
  color: #17141a;
  font-family: inherit;
  font-weight: 800;
  font-size: clamp(12px, 3.6vw, 15px);
  line-height: 1;
  box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
  z-index: 1;
  transition: transform 140ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.wh__hub:active {
  transform: translate(-50%, -50%) scale(0.92);
}

.wh__hub:focus-visible {
  outline: 3px solid #ffd23f;
  outline-offset: 3px;
}

.wh__result {
  position: relative;
  margin: 0;
  min-height: 1.9em;
  width: min(100%, 300px);
  text-align: center;
}

.wh__msg {
  display: inline-block;
  font-weight: 700;
  font-size: clamp(11px, 3.2vw, 13px);
  color: #fff7e6;
  background: #17141a;
  border-radius: 999px;
  padding: 0 12px;
  line-height: 1.7;
}

.wh__msg--spin, .wh__msg--win {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  visibility: hidden;
}

.wh__msg--win {
  color: #ffd23f;
}

.wh.is-spinning .wh__msg--idle {
  visibility: hidden;
}

.wh.is-spinning .wh__msg--spin {
  visibility: visible;
}

.wh.is-won .wh__msg--idle {
  visibility: hidden;
}

.wh.is-won .wh__msg--win {
  visibility: visible;
}

.wh.is-demo .wh__disc {
  animation: whSpin 2s cubic-bezier(0.12, 0.8, 0.08, 1) infinite;
  transition: none;
}

@keyframes whSpin {
  0% {
    transform: rotate(0deg);
  }
  82%, 100% {
    transform: rotate(1800deg);
  }
}
.wh.is-demo .wh__msg--idle {
  animation: whCutIdle 2s steps(1, end) infinite;
}

@keyframes whCutIdle {
  0%, 8% {
    visibility: visible;
  }
  8.5%, 94% {
    visibility: hidden;
  }
  94.5%, 100% {
    visibility: visible;
  }
}
.wh.is-demo .wh__msg--spin {
  animation: whCutSpin 2s steps(1, end) infinite;
}

@keyframes whCutSpin {
  0%, 8% {
    visibility: hidden;
  }
  8.5%, 81% {
    visibility: visible;
  }
  81.5%, 100% {
    visibility: hidden;
  }
}
.wh.is-demo .wh__msg--win {
  animation: whCutWin 2s steps(1, end) infinite;
}

@keyframes whCutWin {
  0%, 81% {
    visibility: hidden;
  }
  81.5%, 94% {
    visibility: visible;
  }
  94.5%, 100% {
    visibility: hidden;
  }
}
@media (max-width: 340px) {
  .wh__rig {
    width: 132px;
  }
  .wh {
    gap: 4px;
    --label-r: -48px;
  }
  .wh__msg {
    font-size: 10px;
    padding: 0 8px;
  }
  .wh__lbl b {
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .wh.is-demo .wh__disc,
  .wh.is-demo .wh__msg--idle,
  .wh.is-demo .wh__msg--spin,
  .wh.is-demo .wh__msg--win {
    animation: none !important;
  }
  .wh__disc, .wh__hub {
    transition: none !important;
  }
  .wh.is-demo .wh__msg--idle {
    visibility: hidden;
  }
  .wh.is-demo .wh__msg--win {
    visibility: visible;
  }
}
