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

.bu {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 424px;
}

.bu__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.bu__title {
  margin: 0;
  font-weight: 800;
  font-size: clamp(13px, 3.4vw, 15px);
  color: #fff7e6;
}

.bu__say {
  margin: 0;
  font-weight: 700;
  font-size: clamp(9px, 2.4vw, 11px);
  color: rgba(255, 247, 230, 0.66);
}

.bu__row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.bu__badge {
  width: 100%;
  height: 104px;
  border: 0;
  border-radius: 16px;
  padding: 0;
  background: transparent;
  cursor: pointer;
  perspective: 600px;
}

.bu__badge:focus-visible {
  outline: 2px solid #ffd23f;
  outline-offset: 2px;
}

.bu__inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.bu__badge.is-open .bu__inner {
  transform: rotateY(180deg);
}

.bu__face {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 16px;
  backface-visibility: hidden;
  overflow: hidden;
}

.bu__face--lock {
  background: rgba(255, 247, 230, 0.08);
  color: rgba(255, 247, 230, 0.5);
  filter: grayscale(1);
}

.bu__face--win {
  background: #ffd23f;
  color: #17141a;
  transform: rotateY(180deg);
}

.bu__ico {
  width: 30px;
  height: 30px;
}

.bu__mark {
  font-weight: 800;
  font-size: clamp(15px, 4vw, 19px);
  line-height: 1;
}

.bu__lock {
  font-weight: 700;
  font-size: clamp(9px, 2.4vw, 11px);
  line-height: 1;
}

.bu__shine {
  position: absolute;
  left: -60%;
  top: 0;
  width: 50%;
  height: 100%;
  background: linear-gradient(100deg, rgba(255, 247, 230, 0), rgba(255, 247, 230, 0.85), rgba(255, 247, 230, 0));
  opacity: 0;
}

.bu__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bu__go, .bu__reset {
  border-radius: 999px;
  padding: 4px 12px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  font-size: clamp(10px, 2.6vw, 11px);
  line-height: 1.6;
}

.bu__go {
  border: 0;
  background: #ffd23f;
  color: #17141a;
}

.bu__reset {
  border: 2px solid rgba(255, 247, 230, 0.38);
  background: transparent;
  color: #fff7e6;
}

.bu__go:focus-visible, .bu__reset:focus-visible {
  outline: 2px solid #fff7e6;
  outline-offset: 2px;
}

.bu.is-demo .bu__inner {
  animation-name: buFlip;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
  animation-delay: calc(var(--i) * 220ms);
}

@keyframes buFlip {
  0% {
    transform: rotateY(0deg);
  }
  16% {
    transform: rotateY(180deg);
  }
  78% {
    transform: rotateY(180deg);
  }
  88% {
    transform: rotateY(0deg);
  }
  100% {
    transform: rotateY(0deg);
  }
}
.bu.is-demo .bu__shine {
  animation-name: buShine;
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
  animation-delay: calc(var(--i) * 220ms);
}

@keyframes buShine {
  0%, 16% {
    transform: translateX(0);
    opacity: 0;
  }
  22% {
    transform: translateX(40px);
    opacity: 0.9;
  }
  60% {
    transform: translateX(220px);
    opacity: 0.9;
  }
  70% {
    transform: translateX(260px);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 0;
  }
}
@media (max-width: 340px) {
  .bu {
    gap: 8px;
  }
  .bu__row {
    gap: 8px;
  }
  .bu__badge {
    height: 72px;
  }
  .bu__ico {
    width: 20px;
    height: 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .bu.is-demo .bu__inner {
    animation: none !important;
  }
  .bu.is-demo .bu__shine {
    animation: none !important;
    opacity: 0 !important;
  }
  .bu__inner {
    transition: none !important;
  }
}
