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

.cs {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: 100%;
}

.cs__scene {
  --px: 0;
  position: relative;
  width: clamp(160px, 42vw, 212px);
  height: clamp(96px, 26vw, 124px);
  perspective: 700px;
  transform-style: preserve-3d;
}

.cs__scene:focus-visible {
  outline: 3px solid #2f6df6;
  outline-offset: 8px;
  border-radius: 8px;
}

.cs__card {
  position: absolute;
  left: 50%;
  top: 50%;
  box-sizing: border-box;
  display: flex;
  align-items: flex-start;
  gap: 4px;
  width: clamp(104px, 27vw, 132px);
  height: clamp(64px, 17vw, 84px);
  padding: 8px;
  border-radius: 16px;
  overflow: hidden;
  transform: translate3d(calc(-50% + var(--px) * var(--shift)), calc(-50% + var(--y)), var(--z)) rotateY(calc(var(--px) * var(--tilt)));
}

.cs__card--back {
  --shift: 8px;
  --z: -56px;
  --tilt: 3deg;
  --y: -28px;
  background: #17141a;
  color: #fff7e6;
}

.cs__card--mid {
  --shift: 16px;
  --z: -28px;
  --tilt: 5deg;
  --y: -18px;
  background: #2f6df6;
  color: #ffffff;
}

.cs__card--front {
  --shift: 26px;
  --z: 0px;
  --tilt: 7deg;
  --y: 0px;
  background: #ffffff;
  color: #17141a;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
}

.cs__tag {
  font-weight: 800;
  font-size: clamp(10px, 2.6vw, 12px);
}

.cs__card--back, .cs__card--mid {
  padding-top: 4px;
}

.cs__tag--lead {
  font-size: clamp(12px, 3.2vw, 14px);
}

.cs__ico {
  width: clamp(16px, 4.4vw, 20px);
  height: clamp(16px, 4.4vw, 20px);
  color: #2f6df6;
}

.cs__gloss {
  position: absolute;
  inset: 0;
  background: linear-gradient(104deg, rgba(255, 255, 255, 0) 38%, rgba(255, 255, 255, 0.62) 50%, rgba(255, 255, 255, 0) 62%);
  transform: translateX(calc(var(--px) * 64px));
}

.cs__card--back .cs__gloss {
  opacity: 0.5;
}

.cs__hint {
  margin: 0;
  color: #17141a;
  font-weight: 700;
  font-size: clamp(9px, 2.4vw, 11px);
}

.cs.is-demo .cs__card,
.cs.is-demo .cs__gloss {
  animation-duration: 2s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.cs.is-demo .cs__card--back {
  animation-name: csBack;
}

.cs.is-demo .cs__card--mid {
  animation-name: csMid;
}

.cs.is-demo .cs__card--front {
  animation-name: csFront;
}

.cs.is-demo .cs__gloss {
  animation-name: csGloss;
}

@keyframes csBack {
  0%, 6% {
    transform: translate3d(calc(-50% - 8px), calc(-50% - 28px), -56px) rotateY(-3deg);
  }
  44%, 56% {
    transform: translate3d(calc(-50% + 8px), calc(-50% - 28px), -56px) rotateY(3deg);
  }
  94%, 100% {
    transform: translate3d(calc(-50% - 8px), calc(-50% - 28px), -56px) rotateY(-3deg);
  }
}
@keyframes csMid {
  0%, 6% {
    transform: translate3d(calc(-50% - 16px), calc(-50% - 18px), -28px) rotateY(-5deg);
  }
  44%, 56% {
    transform: translate3d(calc(-50% + 16px), calc(-50% - 18px), -28px) rotateY(5deg);
  }
  94%, 100% {
    transform: translate3d(calc(-50% - 16px), calc(-50% - 18px), -28px) rotateY(-5deg);
  }
}
@keyframes csFront {
  0%, 6% {
    transform: translate3d(calc(-50% - 26px), -50%, 0) rotateY(-7deg);
  }
  44%, 56% {
    transform: translate3d(calc(-50% + 26px), -50%, 0) rotateY(7deg);
  }
  94%, 100% {
    transform: translate3d(calc(-50% - 26px), -50%, 0) rotateY(-7deg);
  }
}
@keyframes csGloss {
  0%, 6% {
    transform: translateX(-64px);
  }
  44%, 56% {
    transform: translateX(64px);
  }
  94%, 100% {
    transform: translateX(-64px);
  }
}
@media (max-width: 340px) {
  .cs {
    gap: 8px;
  }
  .cs__card {
    padding: 4px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cs.is-demo .cs__card,
  .cs.is-demo .cs__gloss {
    animation: none !important;
  }
  .cs.is-demo .cs__card--back {
    transform: translate3d(calc(-50% + 8px), calc(-50% - 28px), -56px) rotateY(3deg) !important;
  }
  .cs.is-demo .cs__card--mid {
    transform: translate3d(calc(-50% + 16px), calc(-50% - 18px), -28px) rotateY(5deg) !important;
  }
  .cs.is-demo .cs__card--front {
    transform: translate3d(calc(-50% + 26px), -50%, 0) rotateY(7deg) !important;
  }
  .cs.is-demo .cs__gloss {
    transform: translateX(32px) !important;
  }
}
