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

.cd {
  width: min(180px, 60vw);
  text-align: center;
}

.cd__svg {
  width: 100%;
  height: auto;
  transform: rotate(-90deg);
}

.cd__track {
  fill: none;
  stroke: rgba(255, 247, 230, 0.14);
  stroke-width: 12;
}

.cd__spin {
  fill: none;
  stroke: rgba(255, 247, 230, 0.55);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 10 16;
  transform-origin: 60px 60px;
  animation: cdSpin 1.4s linear infinite, cdSpinFade 2s ease-out infinite;
}

.cd__seg {
  fill: none;
  stroke-width: 12;
  stroke-linecap: butt;
  transform-origin: 60px 60px;
  opacity: 0;
  transform: scale(0.9);
  animation: cdSegCycle 2s ease-out infinite;
}

#cdSeg0 {
  stroke: #2f6df6;
  animation-delay: 0ms;
}

#cdSeg1 {
  stroke: #c2361a;
  animation-delay: 130ms;
}

#cdSeg2 {
  stroke: #2b9d74;
  animation-delay: 230ms;
}

#cdSeg3 {
  stroke: #8a5cd6;
  animation-delay: 310ms;
}

.cd__reload {
  display: block;
  margin: 16px auto 0;
  appearance: none;
  border: none;
  cursor: pointer;
  background: rgba(255, 247, 230, 0.12);
  color: #fff7e6;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 999px;
}

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

@keyframes cdSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
@keyframes cdSpinFade {
  0% {
    opacity: 1;
  }
  14% {
    opacity: 1;
  }
  26% {
    opacity: 0;
  }
  88% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}
@keyframes cdSegCycle {
  0% {
    opacity: 0;
    transform: scale(0.9);
  }
  26% {
    opacity: 0;
    transform: scale(0.9);
  }
  52% {
    opacity: 1;
    transform: scale(1);
  }
  88% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.9);
  }
}
@media (max-width: 340px) {
  .cd {
    width: min(112px, 48vw);
  }
  .cd__reload {
    margin-top: 8px;
    font-size: 11px;
    padding: 4px 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cd__spin {
    animation: none;
    opacity: 0;
  }
  .cd__seg {
    animation: none;
    opacity: 1;
    transform: scale(1);
  }
}
