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

.chat-wrap {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #17141a;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
  font-family: inherit;
  flex: none;
}

.bubble {
  position: relative;
  margin: 0;
  max-width: clamp(160px, 46vw, 240px);
  background: #2f6df6;
  color: #fff;
  padding: 12px 16px;
  border-radius: 18px 18px 18px 4px;
  font-size: clamp(12px, 3.4vw, 14px);
  opacity: 0;
  transform-origin: bottom left;
  transform: scale(0.85);
}
.bubble::after {
  content: "";
  position: absolute;
  left: -6px;
  bottom: 0;
  width: 12px;
  height: 12px;
  background: #2f6df6;
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

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

@keyframes bubble-loop {
  0% {
    opacity: 0;
    transform: scale(0.85) rotate(0deg);
  }
  12% {
    opacity: 1;
    transform: scale(1.14) rotate(3deg);
  }
  22% {
    opacity: 1;
    transform: scale(0.93) rotate(-1.7deg);
  }
  30% {
    opacity: 1;
    transform: scale(1.02) rotate(0.7deg);
  }
  36%, 55% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
  80% {
    opacity: 0;
    transform: scale(0.85) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: scale(0.85) rotate(0deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .bubble.is-demo {
    animation: none;
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}
