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

.bb {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 340px;
}

.bb__hint {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  font-weight: 700;
  font-size: clamp(10px, 2.8vw, 12px);
  color: #fff7e6;
}

.bb__ico {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: #5b8cf8;
}

.bb__scene {
  display: flex;
  justify-content: center;
}

.bb__panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border-radius: 16px;
  padding: 8px 16px 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 30%), #fff7e6;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.8), inset 0 -3px 0 rgba(23, 20, 26, 0.16);
}

.bb__lampWrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.bb__lamp {
  position: relative;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffe0d8;
  box-shadow: inset 0 2px 3px rgba(23, 20, 26, 0.4), inset 0 -1px 0 rgba(255, 255, 255, 0.7);
  transition: background 220ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.bb__lampGlow {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(194, 54, 26, 0.85), rgba(194, 54, 26, 0) 70%);
  opacity: 0;
}

.bb__lampText {
  font-weight: 800;
  font-size: clamp(9px, 2.4vw, 11px);
  line-height: 1.6;
  color: #17141a;
}

.bb.is-on .bb__lamp {
  background: #c2361a;
  box-shadow: 0 0 0 2px rgba(194, 54, 26, 0.28), 0 0 14px 2px rgba(194, 54, 26, 0.65), inset 0 2px 3px rgba(23, 20, 26, 0.35);
}

.bb__well {
  position: relative;
  display: flex;
  justify-content: center;
  perspective: 600px;
}

.bb__shadow {
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 92%;
  height: 14px;
  transform: translateX(-50%) scaleX(1);
  border-radius: 50%;
  background: rgba(23, 20, 26, 0.34);
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.bb__btn {
  position: relative;
  display: block;
  width: clamp(88px, 24vw, 108px);
  height: clamp(64px, 17vw, 80px);
  border: 0;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
  background: radial-gradient(120% 90% at 32% 22%, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 46%), radial-gradient(140% 120% at 50% 118%, rgba(23, 20, 26, 0.5), rgba(23, 20, 26, 0) 52%), #c2361a;
  box-shadow: 0 10px 0 rgba(23, 20, 26, 0.3), 0 14px 18px rgba(23, 20, 26, 0.35), inset 0 2px 3px rgba(255, 255, 255, 0.55), inset 0 -4px 6px rgba(23, 20, 26, 0.45);
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.bb__btn:focus-visible {
  outline: 2px solid #5b8cf8;
  outline-offset: 3px;
}

.bb__dome {
  position: absolute;
  left: 50%;
  top: 14%;
  width: 58%;
  height: 58%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(100% 100% at 34% 26%, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0) 55%);
}

.bb__btn[aria-pressed=true] {
  transform: translateZ(-120px);
}

.bb.is-on .bb__shadow {
  transform: translateX(-50%) scaleX(0.55);
  opacity: 0.55;
}

.bb__state {
  margin: 8px 0 0;
  font-weight: 800;
  font-size: clamp(11px, 3vw, 13px);
  line-height: 1.6;
}

.bb__stateIdle {
  color: #17141a;
}

.bb__stateHit {
  color: #c2361a;
}

.bb:not(.is-on) .bb__stateHit {
  display: none;
}

.bb.is-on .bb__stateIdle {
  display: none;
}

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

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

.bb.is-demo .bb__lampGlow {
  animation-name: bbBlink;
  animation-duration: 2s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.bb.is-demo .bb__stateIdle, .bb.is-demo .bb__stateHit {
  display: inline;
}

.bb.is-demo .bb__stateIdle {
  animation-name: bbIdleCut;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

.bb.is-demo .bb__stateHit {
  animation-name: bbHitCut;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

@keyframes bbSink {
  0%, 6% {
    transform: translateZ(0);
  }
  14%, 46% {
    transform: translateZ(-120px);
  }
  54%, 100% {
    transform: translateZ(0);
  }
}
@keyframes bbShadow {
  0%, 6% {
    transform: translateX(-50%) scaleX(1);
    opacity: 1;
  }
  14%, 46% {
    transform: translateX(-50%) scaleX(0.55);
    opacity: 0.55;
  }
  54%, 100% {
    transform: translateX(-50%) scaleX(1);
    opacity: 1;
  }
}
@keyframes bbBlink {
  0%, 9% {
    opacity: 0;
  }
  12% {
    opacity: 0.45;
  }
  18% {
    opacity: 1;
  }
  24% {
    opacity: 0.5;
  }
  30% {
    opacity: 1;
  }
  36% {
    opacity: 0.5;
  }
  42% {
    opacity: 1;
  }
  47%, 100% {
    opacity: 0;
  }
}
@keyframes bbIdleCut {
  0%, 13% {
    opacity: 1;
  }
  14%, 46% {
    opacity: 0;
  }
  47%, 100% {
    opacity: 1;
  }
}
@keyframes bbHitCut {
  0%, 13% {
    opacity: 0;
  }
  14%, 46% {
    opacity: 1;
  }
  47%, 100% {
    opacity: 0;
  }
}
@media (max-width: 340px) {
  .bb {
    gap: 8px;
  }
  .bb__panel {
    padding: 8px 12px;
    gap: 0;
  }
  .bb__shadow {
    bottom: -4px;
    height: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .bb.is-demo .bb__btn {
    animation: none !important;
  }
  .bb.is-demo .bb__shadow {
    animation: none !important;
  }
  .bb.is-demo .bb__lampGlow {
    animation: none !important;
    opacity: 0 !important;
  }
  .bb.is-demo .bb__stateIdle {
    animation: none !important;
  }
  .bb.is-demo .bb__stateHit {
    animation: none !important;
  }
  .bb__btn {
    transition: none !important;
  }
  .bb__shadow {
    transition: none !important;
  }
}
