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

.stage * {
  box-sizing: border-box;
}

.page {
  width: min(360px, 94vw);
  background: #fff7e6;
  color: #17141a;
  border-radius: 16px;
  padding: 20px 16px;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
}

.page__title {
  margin: 0 0 8px;
  font-weight: 800;
  font-size: 20px;
  line-height: 1.2;
  font-family: inherit;
}

.page__body {
  margin: 0 0 16px;
  font-size: 12px;
  line-height: 1.7;
  color: rgba(23, 20, 26, 0.72);
  font-family: inherit;
}

.page__cta {
  border: 0;
  background: #17141a;
  color: #fff7e6;
  border-radius: 12px;
  padding: 8px 12px;
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
  font-family: inherit;
  cursor: pointer;
}

.page__hint {
  display: inline-block;
  margin: 12px 0 0;
  padding: 0 8px;
  border: 1.5px dashed rgba(23, 20, 26, 0.4);
  border-radius: 4px;
  font-size: 10px;
  line-height: 1.8;
  color: rgba(23, 20, 26, 0.6);
  font-family: inherit;
}

.page__msg {
  margin: 8px 0 0;
  min-height: 13px;
  font-size: 11px;
  line-height: 1.3;
  color: rgba(23, 20, 26, 0.6);
  font-family: inherit;
}

.page__cta:focus-visible, .xp__close:focus-visible, .xp__copy:focus-visible {
  outline: 2px solid #2f6df6;
  outline-offset: 2px;
}

.xp-wrap {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  pointer-events: none;
}

.xp {
  display: none;
  position: relative;
  pointer-events: auto;
  width: min(320px, 92vw);
  background: #fff7e6;
  color: #17141a;
  border-radius: 16px;
  padding: 20px 16px 16px;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
  text-align: center;
}

.xp.is-open {
  display: block;
  animation: xp-enter 600ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

@keyframes xp-enter {
  from {
    transform: translateY(28px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
.xp__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(23, 20, 26, 0.08);
  color: #17141a;
  cursor: pointer;
}

.xp__ic {
  display: grid;
  place-items: center;
  margin: 0 auto 8px;
  color: #2f6df6;
}

.xp__title {
  margin: 0 0 12px;
  font-weight: 800;
  font-size: 14px;
  line-height: 1.4;
  font-family: inherit;
}

.xp__code {
  position: relative;
  display: inline-block;
  margin: 0 0 12px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(47, 109, 246, 0.12);
  color: #2f6df6;
  font-weight: 800;
  font-size: 15px;
  line-height: 1.2;
  letter-spacing: 0.08em;
  font-family: inherit;
}

.xp__sweep {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 4px;
  height: 3px;
  border-radius: 4px;
  background: #ffd23f;
  transform: scaleX(0);
  transform-origin: left center;
}

.xp__copy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 8px 12px;
  border: 0;
  border-radius: 12px;
  background: #2f6df6;
  color: #ffffff;
  font-weight: 800;
  font-size: 12px;
  line-height: 1;
  font-family: inherit;
  cursor: pointer;
}

.xp__check {
  stroke-dasharray: 28;
  stroke-dashoffset: 28;
  transition: stroke-dashoffset 300ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

.xp__copy.is-copied .xp__check {
  stroke-dashoffset: 0;
}

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

@keyframes xp-loop {
  0% {
    transform: translateY(28px) scale(0.94);
    opacity: 0;
  }
  6% {
    transform: translateY(10px) scale(0.98);
    opacity: 0.7;
  }
  12% {
    transform: translateY(-4px) scale(1.02);
    opacity: 1;
  }
  18% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}
.is-demo .xp__sweep {
  animation: xp-sweep 2s ease-out infinite;
}

@keyframes xp-sweep {
  0%, 24% {
    transform: scaleX(0);
  }
  46%, 100% {
    transform: scaleX(1);
  }
}
.is-demo .xp__ic {
  animation: xp-bob 2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

@keyframes xp-bob {
  0%, 46%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  54% {
    transform: translateY(-5px) rotate(-7deg);
  }
  62% {
    transform: translateY(0) rotate(0deg);
  }
}
.is-demo .xp__copy {
  animation: xp-pop 2s cubic-bezier(0.2, 1.4, 0.4, 1) infinite;
}

@keyframes xp-pop {
  0%, 70%, 100% {
    transform: scale(1);
  }
  78% {
    transform: scale(1.08);
  }
  86% {
    transform: scale(1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .xp, .is-demo .xp, .is-demo .xp__sweep, .is-demo .xp__ic, .is-demo .xp__copy, .xp__check {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
  .is-demo .xp__sweep {
    transform: scaleX(1) !important;
  }
}
@media (max-width: 340px), (max-height: 220px) {
  .xp-wrap {
    padding: 8px;
  }
  .page {
    width: min(288px, 92vw);
    padding: 12px 12px 16px;
  }
  .page__title {
    margin: 0 0 4px;
    font-size: 15px;
  }
  .page__body {
    margin: 0 0 8px;
    font-size: 10px;
    line-height: 1.5;
  }
  .page__cta {
    padding: 4px 8px;
    font-size: 10px;
  }
  .page__hint {
    margin: 8px 0 0;
    font-size: 9px;
    line-height: 1.6;
  }
  .page__msg {
    margin: 4px 0 0;
    min-height: 0;
    font-size: 9px;
  }
  .xp {
    width: min(268px, 92vw);
    padding: 12px 12px;
  }
  .xp__ic {
    margin: 0 auto 4px;
  }
  .xp__ic svg {
    width: 18px;
    height: 18px;
  }
  .xp__title {
    margin: 0 0 8px;
    font-size: 11px;
    line-height: 1.3;
  }
  .xp__code {
    margin: 0 0 8px;
    padding: 4px 12px;
    font-size: 12px;
  }
  .xp__sweep {
    left: 12px;
    right: 12px;
    bottom: 4px;
    height: 2px;
  }
  .xp__copy {
    padding: 4px 8px;
    font-size: 10px;
  }
}
