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

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

.cb__scene {
  display: grid;
  place-items: center;
  width: clamp(104px, 27vw, 132px);
  height: clamp(104px, 27vw, 132px);
  perspective: 560px;
  cursor: grab;
  touch-action: none;
}

.cb__scene:active {
  cursor: grabbing;
}

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

.cb__cube {
  --s: clamp(72px, 19vw, 92px);
  position: relative;
  width: var(--s);
  height: var(--s);
  transform-style: preserve-3d;
  transform: rotateX(-12deg) rotateY(0deg);
}

.cb__face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  border: 2px solid rgba(255, 247, 230, 0.42);
  border-radius: 8px;
  background: rgb(3.9360260233%, 31.0508719617%, 90.965934761%);
  color: #fff7e6;
  font-weight: 800;
  font-size: clamp(11px, 2.8vw, 13px);
}

.cb__face--f {
  transform: translateZ(calc(var(--s) / 2));
}

.cb__face--r {
  transform: rotateY(90deg) translateZ(calc(var(--s) / 2));
  background: #fff7e6;
  color: #17141a;
}

.cb__face--b {
  transform: rotateY(180deg) translateZ(calc(var(--s) / 2));
}

.cb__face--l {
  transform: rotateY(-90deg) translateZ(calc(var(--s) / 2));
  background: #fff7e6;
  color: #17141a;
}

.cb__face--u {
  transform: rotateX(90deg) translateZ(calc(var(--s) / 2));
  background: rgb(3.6042287883%, 28.433360441%, 83.297731996%);
}

.cb__face--d {
  transform: rotateX(-90deg) translateZ(calc(var(--s) / 2));
  background: #17141a;
}

.cb__hint {
  margin: 0;
  max-width: 280px;
  text-align: center;
  color: rgba(255, 247, 230, 0.78);
  font-weight: 700;
  font-size: clamp(9px, 2.4vw, 11px);
  line-height: 1.4;
}

.cb.is-demo .cb__cube {
  animation-name: cbSpin;
  animation-duration: 2s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@keyframes cbSpin {
  0%, 8% {
    transform: rotateX(-12deg) rotateY(0deg);
  }
  30% {
    transform: rotateX(-12deg) rotateY(-96deg);
  }
  38%, 58% {
    transform: rotateX(-12deg) rotateY(-90deg);
  }
  80% {
    transform: rotateX(-12deg) rotateY(6deg);
  }
  88%, 100% {
    transform: rotateX(-12deg) rotateY(0deg);
  }
}
@media (max-width: 340px) {
  .cb {
    gap: 12px;
  }
  .cb__hint {
    max-width: 200px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cb.is-demo .cb__cube {
    animation: none !important;
    transform: rotateX(-12deg) rotateY(-38deg) !important;
  }
}
