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 {
  position: relative;
  box-sizing: border-box;
  width: min(180px, 84vw);
  padding-bottom: 96px;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  color: #17141a;
}

.cs__label {
  display: block;
  font-size: 10px;
  line-height: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #17141a;
  margin: 0 0 4px;
}

.cs__btn {
  box-sizing: border-box;
  width: 100%;
  height: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 0;
  background: #fff;
  border-radius: 12px;
  color: #17141a;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
}

.cs__preview, .cs__name {
  display: inline-grid;
}

.cs__slot {
  grid-area: 1/1;
}

.cs__slot--b {
  opacity: 0;
}

.cs__dot {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(23, 20, 26, 0.16);
}

.cs__caret {
  margin-left: auto;
  display: inline-flex;
  color: rgba(23, 20, 26, 0.4);
}

.cs__panel {
  position: absolute;
  top: 52px;
  left: 0;
  box-sizing: border-box;
  padding: 8px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
  transform-origin: top left;
  transform: scale(0.9);
  opacity: 0;
  pointer-events: none;
  transition: transform 220ms cubic-bezier(0.2, 1.4, 0.4, 1), opacity 220ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

.cs.is-open .cs__panel {
  transform: scale(1);
  opacity: 1;
  pointer-events: auto;
}

.cs__grid {
  display: grid;
  grid-template-columns: repeat(4, 32px);
  gap: 12px;
}

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

.cs__sw {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(23, 20, 26, 0.12);
  transition: transform 220ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

.cs__sw:hover {
  transform: scale(1.12);
}

.cs__ring {
  position: absolute;
  top: 17px;
  left: 17px;
  z-index: 1;
  display: inline-flex;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(23, 20, 26, 0.45));
  transform: translate(0, 0);
  transition: transform 220ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

.cs.is-demo .cs__ring {
  animation: cs-hop 2s cubic-bezier(0.2, 1.4, 0.4, 1) infinite;
}

.cs.is-demo .cs__slot--a {
  animation: cs-swap-a 2s steps(1, end) infinite;
}

.cs.is-demo .cs__slot--b {
  animation: cs-swap-b 2s steps(1, end) infinite;
}

@keyframes cs-hop {
  0%, 100% {
    transform: translate(0, 0);
  }
  30%, 70% {
    transform: translate(88px, 44px);
  }
}
@keyframes cs-swap-a {
  0%, 29% {
    opacity: 1;
  }
  30%, 69% {
    opacity: 0;
  }
  70%, 100% {
    opacity: 1;
  }
}
@keyframes cs-swap-b {
  0%, 29% {
    opacity: 0;
  }
  30%, 69% {
    opacity: 1;
  }
  70%, 100% {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cs.is-demo .cs__ring, .cs.is-demo .cs__slot--a, .cs.is-demo .cs__slot--b {
    animation: none !important;
  }
  .cs__slot--b {
    opacity: 0;
  }
  .cs__panel, .cs__ring, .cs__sw {
    transition: none;
  }
}
