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

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

.bubble {
  position: relative;
  padding: 14px 20px;
  border-radius: 16px;
  background: #17141a;
  color: #fff;
  font-weight: 600;
  font-size: clamp(14px, 4.5vw, 17px);
  line-height: 1.4;
  font-family: inherit;
}
.bubble.is-demo {
  animation: tail-shift-loop 2s ease-out infinite;
}

.tail {
  position: absolute;
  bottom: 10px;
  width: 14px;
  height: 14px;
  background: #17141a;
}

.tail--left {
  left: -6px;
  clip-path: polygon(100% 0, 100% 100%, 0 50%);
  animation: tail-left-loop 2s ease-out infinite;
}

.tail--right {
  right: -6px;
  clip-path: polygon(0 0, 0 100%, 100% 50%);
  animation: tail-right-loop 2s ease-out infinite;
}

@keyframes tail-shift-loop {
  0% {
    transform: translateX(-70px);
  }
  32% {
    transform: translateX(-70px);
  }
  68% {
    transform: translateX(70px);
  }
  100% {
    transform: translateX(70px);
  }
}
@keyframes tail-left-loop {
  0% {
    opacity: 1;
  }
  32% {
    opacity: 1;
  }
  68% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
@keyframes tail-right-loop {
  0% {
    opacity: 0;
  }
  32% {
    opacity: 0;
  }
  68% {
    opacity: 1;
  }
  100% {
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .bubble.is-demo, .tail--left, .tail--right {
    animation: none !important;
  }
  .bubble.is-demo {
    transform: translateX(-70px);
  }
  .tail--left {
    opacity: 1;
  }
  .tail--right {
    opacity: 0;
  }
}
