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

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

.stage {
  position: relative;
}

.trigger {
  anchor-name: --tip03;
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  border: 0;
  border-radius: 12px;
  padding: 12px 22px;
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  font-family: inherit;
  color: #c93000;
  background: #fff7e6;
  cursor: pointer;
}

.tooltip {
  position: absolute;
  top: calc(22px + 100% + 10px);
  left: 50%;
  transform-origin: top center;
  transform: translateX(-50%) translateY(-4px);
  opacity: 0;
  background: #17141a;
  color: #fff7e6;
  padding: 8px 14px;
  border-radius: 12px;
  font-size: clamp(12px, 3.4vw, 14px);
  white-space: nowrap;
  pointer-events: none;
}

@supports (position-anchor: --tip03) {
  .tooltip {
    position: fixed;
    position-anchor: --tip03;
    top: auto;
    inset: unset;
    position-area: top;
    position-try-fallbacks: flip-block;
    margin-block: 10px;
    transform: translateY(0);
  }
  .tooltip.is-demo {
    animation-name: tip-loop-anchor;
  }
}
.tooltip.is-demo {
  animation: tip-loop 2s ease-out infinite;
}

@keyframes tip-loop {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(-4px) scale(0.85) rotate(0deg);
  }
  12% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1.1) rotate(2.2deg);
  }
  22% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(0.95) rotate(-1.3deg);
  }
  30% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1.02) rotate(0.5deg);
  }
  36%, 55% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1) rotate(0deg);
  }
  80% {
    opacity: 0;
    transform: translateX(-50%) translateY(-4px) scale(0.85) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-4px) scale(0.85) rotate(0deg);
  }
}
@keyframes tip-loop-anchor {
  0% {
    opacity: 0;
    transform: scale(0.85) rotate(0deg);
  }
  12% {
    opacity: 1;
    transform: scale(1.1) rotate(2.2deg);
  }
  22% {
    opacity: 1;
    transform: scale(0.95) rotate(-1.3deg);
  }
  30% {
    opacity: 1;
    transform: scale(1.02) rotate(0.5deg);
  }
  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) {
  .tooltip.is-demo {
    animation: none;
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}
