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

.pin {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
}

.pin__row {
  position: relative;
  display: flex;
  gap: 8px;
}

.pin__box {
  position: relative;
  width: 38px;
  height: 46px;
}

.pin__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 2px solid rgba(255, 247, 230, 0.28);
  border-radius: 12px;
  background: rgba(255, 247, 230, 0.08);
  color: #fff7e6;
  text-align: center;
  font-weight: 600;
  font-size: 20px;
  line-height: 1;
  outline: none;
  transition: border-color 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
}

.pin__input:focus {
  border-color: #2f6df6;
}

.pin__input.is-scrambling {
  color: rgba(255, 247, 230, 0.55);
}

.pin__input.is-settle {
  animation: pin-settle 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes pin-settle {
  0% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(1);
  }
}
.pin__ghost {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff7e6;
  font-weight: 600;
  font-size: 20px;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
}

.pin__signal {
  position: relative;
  width: 22px;
  height: 22px;
  opacity: 0;
  transform: scale(0.6);
}

.pin__signal--eye {
  border: 2px solid #2f6df6;
  border-radius: 50%/60% 60% 40% 40%;
}

.pin__signal--eye::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  background: #2f6df6;
  border-radius: 50%;
}

.pin.is-demo .pin__ghost--dot {
  animation: pin-ghost-dot 2s linear infinite;
}

.pin.is-demo .pin__ghost--digit {
  animation: pin-ghost-digit 2s linear infinite;
}

.pin.is-demo .pin__box:nth-child(1) .pin__ghost--dot,
.pin.is-demo .pin__box:nth-child(1) .pin__ghost--digit {
  animation-delay: 0ms;
}

.pin.is-demo .pin__box:nth-child(2) .pin__ghost--dot,
.pin.is-demo .pin__box:nth-child(2) .pin__ghost--digit {
  animation-delay: 40ms;
}

.pin.is-demo .pin__box:nth-child(3) .pin__ghost--dot,
.pin.is-demo .pin__box:nth-child(3) .pin__ghost--digit {
  animation-delay: 80ms;
}

.pin.is-demo .pin__box:nth-child(4) .pin__ghost--dot,
.pin.is-demo .pin__box:nth-child(4) .pin__ghost--digit {
  animation-delay: 120ms;
}

.pin.is-demo .pin__box:nth-child(5) .pin__ghost--dot,
.pin.is-demo .pin__box:nth-child(5) .pin__ghost--digit {
  animation-delay: 160ms;
}

.pin.is-demo .pin__box:nth-child(6) .pin__ghost--dot,
.pin.is-demo .pin__box:nth-child(6) .pin__ghost--digit {
  animation-delay: 200ms;
}

@keyframes pin-ghost-dot {
  0%, 100% {
    opacity: 0;
  }
  7% {
    opacity: 1;
  }
  44% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
  78% {
    opacity: 0;
  }
  84% {
    opacity: 1;
  }
  96% {
    opacity: 1;
  }
}
@keyframes pin-ghost-digit {
  0%, 50%, 100% {
    opacity: 0;
  }
  56% {
    opacity: 1;
  }
  74% {
    opacity: 1;
  }
  80% {
    opacity: 0;
  }
}
.pin.is-demo .pin__signal--eye {
  animation: pin-eye 2s linear infinite;
}

@keyframes pin-eye {
  0%, 50%, 100% {
    opacity: 0.55;
    transform: scaleY(1);
  }
  53% {
    transform: scaleY(0.15);
  }
  56%, 78% {
    opacity: 1;
    transform: scaleY(1);
  }
  81% {
    transform: scaleY(0.15);
  }
  84% {
    transform: scaleY(1);
  }
}
.pin__mask-toggle {
  border: 0;
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 12px;
  line-height: 1;
  background: rgba(255, 247, 230, 0.14);
  color: #fff7e6;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

@media (prefers-reduced-motion: reduce) {
  .pin__ghost, .pin__ghost--dot, .pin__ghost--digit, .pin__caret, .pin__signal,
  .pin__row, .pin__timer-n, .pin__resend, .pin__input {
    animation: none !important;
    transition: none !important;
  }
  .pin.is-demo .pin__ghost,
  .pin.is-demo .pin__ghost--digit {
    opacity: 1;
  }
  .pin.is-demo .pin__ghost--dot {
    opacity: 0;
  }
  .pin.is-demo .pin__caret {
    opacity: 0.9;
    transform: translateX(230px);
  }
  .pin.is-demo .pin__signal {
    opacity: 1;
    transform: scale(1);
  }
  .pin.is-demo .pin__signal--toggle::before {
    transform: translateX(16px);
  }
  .pin.is-demo .pin__resend {
    opacity: 1;
    transform: scale(1);
  }
}
