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

.pc {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 164px;
}

.pc:focus-visible {
  outline: 2px solid #fff7e6;
  outline-offset: 3px;
  border-radius: 12px;
}

.pc__idle {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: rgba(255, 247, 230, 0.78);
  opacity: 1;
}

.pc__idle-label {
  font-weight: 500;
  font-size: 11px;
}

.pc__idle-label b {
  font-weight: 700;
  color: #fff7e6;
}

.pc__spin {
  position: absolute;
  inset: 0;
  margin: auto;
  opacity: 0;
}

.pc__spin-track {
  fill: none;
  stroke: rgba(255, 247, 230, 0.16);
  stroke-width: 8;
}

.pc__spin-arc {
  fill: none;
  stroke: #6ec8ff;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 60 242;
  transform-origin: 60px 60px;
}

.pc__thumb {
  position: absolute;
  inset: 22% 30%;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(110, 200, 255, 0.38), rgba(110, 200, 255, 0.14));
  opacity: 0;
  transform: scale(0.7);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 8px;
}

.pc__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pc__done-label {
  position: relative;
  font-weight: 600;
  font-size: 10px;
  color: #fff7e6;
  background: rgba(23, 20, 26, 0.5);
  padding: 4px 8px;
  border-radius: 999px;
}

.pc.is-idle .pc__idle {
  opacity: 1;
}

.pc.is-idle .pc__spin, .pc.is-idle .pc__thumb {
  opacity: 0;
}

.pc.is-spin .pc__idle {
  opacity: 0;
  transition: opacity 220ms linear;
}

.pc.is-spin .pc__spin {
  opacity: 1;
  transition: opacity 220ms linear;
  animation: pcRotate 0.9s linear infinite;
}

.pc.is-done .pc__spin {
  opacity: 0;
  transition: opacity 140ms linear;
}

.pc.is-done .pc__thumb {
  opacity: 1;
  transform: scale(1);
  transition: opacity 220ms linear, transform 600ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pcRotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
@keyframes pcIdleFade {
  0%, 6% {
    opacity: 1;
  }
  8% {
    opacity: 0;
    animation-timing-function: steps(1, end);
  }
  90% {
    opacity: 0;
  }
  92% {
    opacity: 1;
    animation-timing-function: steps(1, end);
  }
  100% {
    opacity: 1;
  }
}
@keyframes pcSpinFade {
  0%, 6% {
    opacity: 0;
  }
  8% {
    opacity: 1;
    animation-timing-function: steps(1, end);
  }
  44% {
    opacity: 1;
  }
  46% {
    opacity: 0;
    animation-timing-function: steps(1, end);
  }
  100% {
    opacity: 0;
  }
}
@keyframes pcSpinTurn {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(1080deg);
  }
}
@keyframes pcThumbPop {
  0%, 45% {
    opacity: 0;
    transform: scale(0.7);
  }
  46% {
    opacity: 1;
    transform: scale(0.7);
    animation-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  58% {
    opacity: 1;
    transform: scale(1);
  }
  88% {
    opacity: 1;
    transform: scale(1);
  }
  90% {
    opacity: 0;
    transform: scale(0.7);
    animation-timing-function: steps(1, end);
  }
  100% {
    opacity: 0;
    transform: scale(0.7);
  }
}
.is-demo .pc__idle {
  animation: pcIdleFade 2s linear infinite;
}

.is-demo .pc__spin {
  animation: pcSpinFade 2s linear infinite;
}

.is-demo .pc__spin-arc {
  animation: pcSpinTurn 2s linear infinite;
}

.is-demo .pc__thumb {
  animation: pcThumbPop 2s linear infinite;
}

@media (max-width: 340px) {
  .pc__spin {
    width: 44px;
    height: 44px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .is-demo .pc__idle, .is-demo .pc__spin, .is-demo .pc__spin-arc, .is-demo .pc__thumb {
    animation: none !important;
  }
  .is-demo .pc__idle {
    opacity: 0 !important;
  }
  .is-demo .pc__thumb {
    opacity: 1 !important;
    transform: scale(1) !important;
  }
}
