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

.pu {
  box-sizing: border-box;
  width: min(408px, 88vw);
  display: flex;
  flex-direction: column;
  gap: 8px;
  --slot: 44px;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  color: #fff7e6;
}

.pu__stack {
  position: relative;
  overflow: hidden;
  height: 140px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
}

.pu__list {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-start;
  gap: 8px;
}

.pu__item {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 12px;
  border-radius: 12px;
  background: #fff7e6;
  color: #17141a;
  box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
  transition: transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.pu__ic {
  display: inline-flex;
  flex: 0 0 auto;
  color: #2f6df6;
}

.pu__ic svg {
  display: block;
}

.pu__msg {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
  line-height: 18px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pu__go {
  box-sizing: border-box;
  margin: 0;
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  background: #0a4fe8;
  color: #fff7e6;
  font-family: inherit;
  font-size: 12px;
  line-height: 18px;
  font-weight: 700;
  cursor: pointer;
}

.pu__go:focus-visible {
  outline: 2px solid #fff7e6;
  outline-offset: 2px;
}

.pu__item.is-in {
  animation-name: pu-in;
  animation-duration: 300ms;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: 1;
}

@keyframes pu-in {
  0% {
    opacity: 0;
    transform: translateY(40px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
.pu.is-demo .pu__item {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  transition: none;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}

.pu.is-demo .pu__item:nth-child(1) {
  animation-name: pu-a;
}

.pu.is-demo .pu__item:nth-child(2) {
  animation-name: pu-b;
}

.pu.is-demo .pu__item:nth-child(3) {
  animation-name: pu-c;
}

@keyframes pu-a {
  0%, 4% {
    opacity: 0;
    transform: translateY(48px);
  }
  12% {
    opacity: 1;
    transform: translateY(0);
  }
  34% {
    opacity: 1;
    transform: translateY(0);
  }
  42% {
    opacity: 1;
    transform: translateY(calc(var(--slot) * -1));
  }
  62% {
    opacity: 1;
    transform: translateY(calc(var(--slot) * -1));
  }
  70% {
    opacity: 1;
    transform: translateY(calc(var(--slot) * -2));
  }
  76% {
    opacity: 1;
    transform: translateY(calc(var(--slot) * -2));
  }
  78% {
    opacity: 0;
    transform: translateY(calc(var(--slot) * -2));
  }
  90%, 100% {
    opacity: 0;
    transform: translateY(48px);
  }
}
@keyframes pu-b {
  0%, 30% {
    opacity: 0;
    transform: translateY(48px);
  }
  40% {
    opacity: 1;
    transform: translateY(0);
  }
  62% {
    opacity: 1;
    transform: translateY(0);
  }
  70% {
    opacity: 1;
    transform: translateY(calc(var(--slot) * -1));
  }
  80% {
    opacity: 1;
    transform: translateY(calc(var(--slot) * -1));
  }
  82% {
    opacity: 0;
    transform: translateY(calc(var(--slot) * -1));
  }
  90%, 100% {
    opacity: 0;
    transform: translateY(48px);
  }
}
@keyframes pu-c {
  0%, 58% {
    opacity: 0;
    transform: translateY(48px);
  }
  68% {
    opacity: 1;
    transform: translateY(0);
  }
  84% {
    opacity: 1;
    transform: translateY(0);
  }
  86% {
    opacity: 0;
    transform: translateY(0);
  }
  90%, 100% {
    opacity: 0;
    transform: translateY(48px);
  }
}
@media (max-width: 340px) {
  .pu {
    --slot: 34px;
  }
  .pu__stack {
    height: 104px;
  }
  .pu__item {
    padding: 4px 8px;
  }
  .pu__msg {
    font-size: 11px;
    line-height: 16px;
  }
  .pu__go {
    padding: 4px 12px;
    font-size: 11px;
    line-height: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .pu.is-demo .pu__item,
  .pu__item.is-in {
    animation: none !important;
    opacity: 1;
  }
  .pu.is-demo .pu__item:nth-child(1) {
    transform: translateY(calc(var(--slot) * -2));
  }
  .pu.is-demo .pu__item:nth-child(2) {
    transform: translateY(calc(var(--slot) * -1));
  }
  .pu.is-demo .pu__item:nth-child(3) {
    transform: translateY(0);
  }
  .pu__item {
    transition: none;
  }
}
