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

.cs {
  width: min(170px, 38vw);
}

.cs__deck {
  display: grid;
  aspect-ratio: 3/4;
}

.cs__card {
  grid-area: 1/1;
  border-radius: 16px;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
  animation: cs-cycle 2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

.cs__card--1 {
  background: linear-gradient(160deg, #2f6df6, #d6ddeb);
  animation-delay: -0s;
}

.cs__card--2 {
  background: linear-gradient(160deg, #ffd23f, #ebe7d6);
  animation-delay: -0.667s;
}

.cs__card--3 {
  background: linear-gradient(160deg, #17141a, #4a3f5c);
  animation-delay: -1.333s;
}

@keyframes cs-cycle {
  0%, 4% {
    transform: translate(0, 0) scale(1) rotate(0deg);
    opacity: 1;
    z-index: 3;
  }
  29% {
    transform: translate(42%, 6%) scale(1) rotate(12deg);
    opacity: 0;
    z-index: 3;
  }
  29.1% {
    transform: translate(-6%, 6%) scale(0.9) rotate(-4deg);
    opacity: 0;
    z-index: 1;
  }
  33%, 62% {
    transform: translate(-6%, 6%) scale(0.9) rotate(-4deg);
    opacity: 0.85;
    z-index: 1;
  }
  66%, 96% {
    transform: translate(6%, 4%) scale(0.95) rotate(3deg);
    opacity: 0.92;
    z-index: 2;
  }
  100% {
    transform: translate(0, 0) scale(1) rotate(0deg);
    opacity: 1;
    z-index: 3;
  }
}
.cs:hover .cs__card {
  animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
  .cs__card {
    animation: none !important;
  }
  .cs__card--1 {
    opacity: 1;
    z-index: 3;
    transform: none;
  }
  .cs__card--2, .cs__card--3 {
    opacity: 0;
  }
}
