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

.cs {
  --pop: -46px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-top: 32px;
  width: 100%;
  max-width: 360px;
  box-sizing: border-box;
}

.cs__deck {
  width: clamp(252px, 64vw, 292px);
  box-sizing: border-box;
  padding-bottom: 8px;
  background: linear-gradient(180deg, rgba(255, 247, 230, 0.1), rgba(255, 247, 230, 0.02) 46%, rgba(23, 20, 26, 0.35)), #17141a;
  border: 1px solid rgba(255, 247, 230, 0.12);
  border-radius: 16px;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32), inset 0 1px 0 rgba(255, 247, 230, 0.16);
}

.cs__bay {
  position: relative;
  height: clamp(92px, 26vw, 112px);
  margin: 12px 12px 0;
  background: rgba(23, 20, 26, 0.85);
  border-radius: 8px;
  box-shadow: inset 0 4px 10px rgba(23, 20, 26, 0.9), inset 0 -1px 0 rgba(255, 247, 230, 0.08);
}

.cs__tape {
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: clamp(150px, 42vw, 174px);
  height: clamp(84px, 23vw, 96px);
  box-sizing: border-box;
  background: linear-gradient(180deg, rgba(255, 247, 230, 0.35), rgba(255, 247, 230, 0) 30%, rgba(23, 20, 26, 0.2)), #ffffff;
  border: 1px solid rgba(23, 20, 26, 0.35);
  border-radius: 8px;
  box-shadow: 0 10px 16px rgba(23, 20, 26, 0.5), inset 0 1px 0 rgba(255, 247, 230, 0.9);
  transform: translateX(-50%);
  transition: transform 220ms cubic-bezier(0.2, 1.8, 0.3, 1);
}

.cs[data-out=true] .cs__tape {
  transform: translateX(-50%) translateY(var(--pop));
}

.cs__label {
  margin: 8px auto 0;
  width: 62%;
  text-align: center;
  background: rgba(255, 247, 230, 0.55);
  border-radius: 4px;
  padding: 4px 0;
  color: #17141a;
  box-shadow: inset 0 -1px 2px rgba(23, 20, 26, 0.18);
}

.cs__label b {
  display: block;
  font-weight: 800;
  font-size: clamp(11px, 3.2vw, 13px);
  line-height: 1.2;
}

.cs__label span {
  display: block;
  font-weight: 700;
  font-size: clamp(8px, 2.4vw, 9px);
  line-height: 1.3;
  color: rgba(23, 20, 26, 0.72);
}

.cs__reel {
  position: absolute;
  top: 44%;
  width: clamp(24px, 7vw, 28px);
  height: clamp(24px, 7vw, 28px);
  border-radius: 50%;
  background: rgba(255, 247, 230, 0.5);
  box-shadow: inset 0 0 0 4px rgba(23, 20, 26, 0.8), inset 0 2px 3px rgba(23, 20, 26, 0.5);
}

.cs__reel::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #17141a;
}

.cs__reel--l {
  left: 16%;
}

.cs__reel--r {
  right: 16%;
}

.cs__mouth {
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 56%;
  height: 8px;
  transform: translateX(-50%);
  border-radius: 4px;
  background: rgba(23, 20, 26, 0.85);
  box-shadow: inset 0 2px 3px rgba(23, 20, 26, 0.9);
}

.cs__panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 8px 12px 0;
}

.cs__vents {
  width: clamp(56px, 16vw, 68px);
  height: 14px;
  border-radius: 999px;
  background: repeating-linear-gradient(90deg, rgba(255, 247, 230, 0.22) 0 4px, rgba(255, 247, 230, 0) 4px 10px);
  box-shadow: inset 0 1px 2px rgba(23, 20, 26, 0.8);
}

.cs__key {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 4px 12px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 247, 230, 0.7), rgba(255, 247, 230, 0) 46%, rgba(23, 20, 26, 0.16)), #ffffff;
  border: 1px solid rgba(23, 20, 26, 0.4);
  box-shadow: 0 6px 10px rgba(23, 20, 26, 0.55), inset 0 1px 0 rgba(255, 247, 230, 0.9);
  font-family: inherit;
  font-weight: 800;
  font-size: clamp(10px, 2.8vw, 11px);
  line-height: 1.4;
  color: #17141a;
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cs__ejectIco {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

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

.cs__key:active {
  transform: translateY(2px);
  box-shadow: 0 2px 4px rgba(23, 20, 26, 0.5), inset 0 2px 6px rgba(23, 20, 26, 0.3);
}

.cs[data-out=true] .cs__key {
  transform: translateY(2px);
  box-shadow: 0 2px 4px rgba(23, 20, 26, 0.5), inset 0 2px 6px rgba(23, 20, 26, 0.3);
}

.cs__status {
  position: relative;
  margin: 0;
  width: 220px;
  height: 20px;
  font-weight: 700;
  font-size: clamp(11px, 3vw, 13px);
  line-height: 20px;
  color: #fff7e6;
}

.cs__state {
  position: absolute;
  inset: 0;
  text-align: center;
}

.cs__state--out {
  visibility: hidden;
}

.cs[data-out=true] .cs__state--out {
  visibility: visible;
}

.cs[data-out=true] .cs__state--in {
  visibility: hidden;
}

.cs.is-demo .cs__tape {
  animation-name: csPop;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}

.cs.is-demo .cs__key {
  animation-name: csKey;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}

.cs.is-demo .cs__state--in {
  animation-name: csShowIn;
  animation-duration: 2s;
  animation-iteration-count: infinite;
}

.cs.is-demo .cs__state--out {
  animation-name: csShowOut;
  animation-duration: 2s;
  animation-iteration-count: infinite;
}

@keyframes csPop {
  0%, 6% {
    transform: translateX(-50%) translateY(0);
  }
  20% {
    transform: translateX(-50%) translateY(calc(var(--pop) - 12px));
  }
  28% {
    transform: translateX(-50%) translateY(calc(var(--pop) + 6px));
  }
  36% {
    transform: translateX(-50%) translateY(calc(var(--pop) - 4px));
  }
  42%, 72% {
    transform: translateX(-50%) translateY(var(--pop));
  }
  86%, 100% {
    transform: translateX(-50%) translateY(0);
  }
}
@keyframes csKey {
  0%, 4% {
    transform: translateY(0);
  }
  8%, 16% {
    transform: translateY(2px);
  }
  24%, 68% {
    transform: translateY(0);
  }
  72%, 80% {
    transform: translateY(2px);
  }
  86%, 100% {
    transform: translateY(0);
  }
}
@keyframes csShowIn {
  0%, 9% {
    visibility: visible;
  }
  11%, 77% {
    visibility: hidden;
  }
  79%, 100% {
    visibility: visible;
  }
}
@keyframes csShowOut {
  0%, 9% {
    visibility: hidden;
  }
  11%, 77% {
    visibility: visible;
  }
  79%, 100% {
    visibility: hidden;
  }
}
@media (max-width: 340px) {
  .cs {
    --pop: -26px;
    padding-top: 16px;
    gap: 4px;
  }
  .cs__bay {
    height: 84px;
    margin-top: 8px;
  }
  .cs__tape {
    height: 74px;
  }
  .cs__panel {
    margin-top: 4px;
  }
  .cs__status {
    height: 16px;
    line-height: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cs.is-demo .cs__tape,
  .cs.is-demo .cs__key,
  .cs.is-demo .cs__state--in,
  .cs.is-demo .cs__state--out {
    animation: none !important;
  }
  .cs__tape, .cs__key {
    transition: none !important;
  }
}
