html, body {
  margin: 0;
  overflow: hidden;
}

.stage {
  box-sizing: border-box;
  min-height: 100vh;
  display: grid;
  place-items: center;
  margin: 0;
  background: #ffffff;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  padding: clamp(8px, 4vw, 24px);
}

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

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

.mb__ico {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: #17141a;
}

.mb__floor {
  position: relative;
  width: 100%;
  height: 150px;
  display: grid;
  place-items: end center;
}

.mb__char {
  position: relative;
  display: block;
  width: 136px;
  height: 132px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  touch-action: none;
}

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

.mb__body {
  position: absolute;
  left: 50%;
  bottom: 8px;
  display: block;
  width: 88px;
  height: 96px;
  margin-left: -44px;
  border-radius: 50% 50% 46% 46%;
  background: #17141a;
  transform-origin: 50% 100%;
  transition: transform 520ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

.mb.is-press .mb__body {
  transform: scale(1.22, 0.84);
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.mb__eye {
  position: absolute;
  top: 40px;
  width: 10px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  transform-origin: 50% 50%;
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.mb__eye--l {
  left: 22px;
}

.mb__eye--r {
  right: 22px;
}

.mb.is-press .mb__eye {
  transform: scaleY(0.45);
}

.mb__cheek {
  position: absolute;
  top: 56px;
  width: 12px;
  height: 6px;
  border-radius: 999px;
  background: #ff9ebb;
  opacity: 0.9;
}

.mb__cheek--l {
  left: 14px;
}

.mb__cheek--r {
  right: 14px;
}

.mb__mouth {
  position: absolute;
  top: 60px;
  left: 50%;
  width: 16px;
  height: 8px;
  margin-left: -8px;
  border-bottom: 3px solid #ffffff;
  border-radius: 0 0 999px 999px;
}

.mb__shadow {
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 72px;
  height: 10px;
  margin-left: -36px;
  border-radius: 50%;
  background: rgba(23, 20, 26, 0.18);
  transition: transform 520ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

.mb.is-press .mb__shadow {
  transform: scaleX(1.24);
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.mb__hearts {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.mb__heart {
  position: absolute;
  bottom: 96px;
  left: calc(var(--x, 50%) - 10px);
  width: 20px;
  height: 20px;
  color: #ff4d1f;
  opacity: 0;
  transform-origin: 50% 50%;
}

.mb__heart svg {
  display: block;
  width: 100%;
  height: 100%;
}

.mb__heart--once {
  animation-name: mbHeartOnce;
  animation-duration: 1.5s;
  animation-timing-function: ease-out;
  animation-fill-mode: forwards;
}

.mb.is-demo .mb__heart--loop {
  animation-name: mbHeartLoop;
  animation-duration: 2s;
  animation-delay: calc(var(--i) * 360ms);
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

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

.mb__tallyIco {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  color: #ff4d1f;
}

@keyframes mbSquashLoop {
  0% {
    transform: scale(1, 1);
  }
  26% {
    transform: scale(1.22, 0.84);
  }
  32% {
    transform: scale(1.16, 0.88);
  }
  40% {
    transform: scale(1.22, 0.84);
  }
  48% {
    transform: scale(1.14, 0.9);
  }
  54% {
    transform: scale(0.93, 1.06);
  }
  62% {
    transform: scale(1.02, 0.99);
  }
  68%, 100% {
    transform: scale(1, 1);
  }
}
@keyframes mbShadowLoop {
  0% {
    transform: scaleX(1);
  }
  26%, 40% {
    transform: scaleX(1.22);
  }
  32% {
    transform: scaleX(1.16);
  }
  54% {
    transform: scaleX(0.95);
  }
  68%, 100% {
    transform: scaleX(1);
  }
}
@keyframes mbHeartOnce {
  0% {
    transform: translateY(0) scale(0.4);
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  72% {
    opacity: 1;
  }
  100% {
    transform: translateY(-76px) scale(1);
    opacity: 0;
  }
}
@keyframes mbHeartLoop {
  0% {
    transform: translateY(10px) scale(0.3);
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  80% {
    transform: translateY(-50px) scale(1);
  }
  100% {
    transform: translateY(-56px) scale(1);
    opacity: 1;
  }
}
.mb.is-demo .mb__body {
  animation-name: mbSquashLoop;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}

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

@media (max-width: 340px) {
  .mb {
    gap: 8px;
  }
  .mb__floor {
    height: 118px;
  }
  .mb__char {
    width: 120px;
    height: 112px;
  }
  .mb__body {
    width: 80px;
    height: 84px;
    margin-left: -40px;
  }
  .mb__eye {
    top: 36px;
    width: 9px;
    height: 11px;
  }
  .mb__eye--l {
    left: 20px;
  }
  .mb__eye--r {
    right: 20px;
  }
  .mb__cheek {
    top: 50px;
  }
  .mb__mouth {
    top: 54px;
  }
  .mb__shadow {
    width: 64px;
    margin-left: -32px;
  }
  .mb__heart {
    bottom: 84px;
    width: 16px;
    height: 16px;
    left: calc(var(--x, 50%) - 8px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .mb.is-demo .mb__body,
  .mb.is-demo .mb__shadow,
  .mb.is-demo .mb__heart--loop {
    animation: none !important;
  }
  .mb.is-demo .mb__body {
    transform: scale(1.2, 0.85) !important;
  }
  .mb.is-demo .mb__shadow {
    transform: scaleX(1.2) !important;
  }
  .mb.is-demo .mb__heart--loop {
    opacity: 1 !important;
    transform: translateY(-40px) scale(1) !important;
  }
}
