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

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

.qp {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: clamp(232px, 72vw, 288px);
  padding: 12px;
  border-radius: 16px;
  background: #26232e;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
}

.qp__open {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: #c8dce4;
  color: #15131a;
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
  font-family: inherit;
}

.qp__open:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.qp__ic {
  display: grid;
  place-items: center;
}

.qp__ic svg {
  display: block;
}

.qp__pop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: scale(1);
  opacity: 1;
  transition: transform 300ms cubic-bezier(0.2, 1.4, 0.4, 1), opacity 220ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

.qp.is-closed .qp__pop {
  transform: scale(0.8);
  opacity: 0;
  pointer-events: none;
}

.qp__code {
  position: relative;
  box-sizing: border-box;
  padding: 8px;
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
}

.qp__grid {
  display: grid;
  grid-template-columns: repeat(var(--cells, 29), 1fr);
  width: 112px;
  height: 112px;
}

.qp__cell {
  background: #ffffff;
}

.qp__cell.is-on {
  background: #15131a;
}

.qp__scan {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 18px;
  background: linear-gradient(180deg, rgba(127, 212, 245, 0), rgba(127, 212, 245, 0.72));
  transform: translateY(0);
  opacity: 0;
}

.is-demo .qp__scan {
  opacity: 1;
}

.qp__hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #bdb7c6;
  font-weight: 600;
  font-size: 11px;
  line-height: 1.2;
  font-family: inherit;
}

.qp__hintIc {
  display: grid;
  place-items: center;
  color: #c8dce4;
}

.qp__hintIc svg {
  display: block;
}

.is-demo .qp__pop {
  animation-name: qpRise;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite;
}

.is-demo .qp__scan {
  animation-name: qpScan;
  animation-duration: 2s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@keyframes qpRise {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  18% {
    transform: scale(1.04);
    opacity: 1;
  }
  26%, 100% {
    transform: scale(1);
    opacity: 1;
  }
}
@keyframes qpScan {
  0%, 26% {
    transform: translateY(0);
  }
  62% {
    transform: translateY(110px);
  }
  90%, 100% {
    transform: translateY(0);
  }
}
@media (max-width: 340px), (max-height: 220px) {
  .qp {
    gap: 8px;
    padding: 8px;
  }
  .qp__open {
    height: 32px;
    padding: 0 8px;
    font-size: 11px;
  }
  .qp__ic svg {
    width: 18px;
    height: 18px;
  }
  .qp__code {
    padding: 4px;
  }
  .qp__grid {
    width: 84px;
    height: 84px;
  }
  .qp__hint {
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .is-demo .qp__pop, .is-demo .qp__scan {
    animation: none !important;
  }
  .qp__pop {
    transition: none !important;
  }
  .qp__scan {
    opacity: 0;
  }
}
