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

.ex {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.ex__card {
  position: relative;
  width: min(100%, 268px);
  background: #fff7e6;
  border-radius: 16px;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
  padding: 12px 16px 8px;
  overflow: hidden;
}

.ex__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ex__title {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  font-weight: 800;
  font-size: clamp(11px, 3.2vw, 13px);
  color: #17141a;
}

.ex__ico {
  width: 15px;
  height: 15px;
  color: #2f6df6;
}

.ex__code {
  background: rgba(23, 20, 26, 0.08);
  border-radius: 999px;
  color: #17141a;
  font-weight: 800;
  font-size: clamp(9px, 2.6vw, 10px);
  letter-spacing: 0.12em;
  padding: 0 8px;
  line-height: 1.6;
}

.ex.is-expired .ex__code {
  text-decoration: line-through;
  color: rgba(23, 20, 26, 0.4);
}

.ex__timer {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0;
  margin-top: 8px;
  font-weight: 800;
  color: #17141a;
}

.ex__digit {
  display: inline-block;
  height: 1em;
  overflow: hidden;
  line-height: 1;
  font-size: clamp(34px, 10vw, 44px);
}

.ex__reel {
  display: flex;
  flex-direction: column;
}

.ex__reel b {
  display: block;
  height: 1em;
  line-height: 1;
}

.ex__unit {
  margin-left: 4px;
  font-weight: 800;
  font-size: clamp(12px, 3.6vw, 16px);
  color: rgba(23, 20, 26, 0.68);
}

.ex.is-urgent .ex__timer {
  color: #c2361a;
}

.ex__warn {
  margin: 4px 0 0;
  text-align: center;
  font-weight: 700;
  font-size: clamp(10px, 2.8vw, 11px);
  color: rgba(23, 20, 26, 0.68);
  min-height: 1.2em;
}

.ex.is-urgent .ex__warn {
  color: #c2361a;
}

.ex.is-expired .ex__warn {
  visibility: hidden;
}

.ex.is-expired .ex__card {
  filter: grayscale(1);
}

.ex__stampWrap {
  position: absolute;
  inset: auto 0 8px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  visibility: hidden;
}

.ex.is-expired .ex__stampWrap {
  visibility: visible;
}

.ex__stamp {
  background: #c2361a;
  color: #fff7e6;
  border-radius: 999px;
  font-weight: 800;
  font-size: clamp(14px, 4.4vw, 18px);
  padding: 4px 20px;
  transform: rotate(-8deg);
  box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
}

.ex__again {
  border: 0;
  cursor: pointer;
  background: rgba(255, 247, 230, 0.16);
  color: #fff7e6;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 700;
  font-size: clamp(10px, 2.8vw, 11px);
  padding: 4px 12px;
  line-height: 1.3;
  transition: transform 140ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 300ms ease-out;
}

.ex:not(.is-expired) .ex__again {
  opacity: 0.4;
}

.ex__again:active {
  transform: scale(0.94);
}

.ex__again:focus-visible {
  outline: 3px solid #ffd23f;
  outline-offset: 2px;
}

.ex.is-demo .ex__reel--one {
  animation: exOnes 2s infinite;
}

@keyframes exOnes {
  0%, 5% {
    transform: translateY(0);
    animation-timing-function: steps(13, end);
  }
  80%, 94% {
    transform: translateY(-12em);
    animation-timing-function: steps(1, end);
  }
  94.5%, 100% {
    transform: translateY(0);
  }
}
.ex.is-demo .ex__reel--ten {
  animation: exTens 2s steps(1, end) infinite;
}

@keyframes exTens {
  0%, 21% {
    transform: translateY(0);
  }
  21.5%, 94% {
    transform: translateY(-1em);
  }
  94.5%, 100% {
    transform: translateY(0);
  }
}
.ex.is-demo .ex__card {
  animation: exCard 2s steps(1, end) infinite;
}

@keyframes exCard {
  0%, 79% {
    filter: grayscale(0);
  }
  79.5%, 93% {
    filter: grayscale(1);
  }
  93.5%, 100% {
    filter: grayscale(0);
  }
}
.ex.is-demo .ex__stampWrap {
  visibility: visible;
}

.ex.is-demo .ex__stampWrap {
  animation: exStamp 2s ease-out infinite;
}

@keyframes exStamp {
  0%, 79% {
    transform: scale(0);
    opacity: 0;
  }
  84%, 92% {
    transform: scale(1);
    opacity: 1;
  }
  94%, 100% {
    transform: scale(0);
    opacity: 0;
  }
}
.ex.is-demo .ex__code {
  animation: exCode 2s steps(1, end) infinite;
}

@keyframes exCode {
  0%, 79% {
    text-decoration-line: none;
    color: #17141a;
  }
  79.5%, 93% {
    text-decoration-line: line-through;
    color: rgba(23, 20, 26, 0.4);
  }
  93.5%, 100% {
    text-decoration-line: none;
    color: #17141a;
  }
}
@media (max-width: 340px) {
  .ex__card {
    padding: 8px 12px 4px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ex.is-demo .ex__reel--one,
  .ex.is-demo .ex__reel--ten,
  .ex.is-demo .ex__card,
  .ex.is-demo .ex__stampWrap,
  .ex.is-demo .ex__code {
    animation: none !important;
  }
  .ex__again {
    transition: none !important;
  }
  .ex.is-demo .ex__reel--ten {
    transform: translateY(0);
  }
  .ex.is-demo .ex__reel--one {
    transform: translateY(0);
  }
  .ex.is-demo .ex__card {
    filter: grayscale(0);
  }
  .ex.is-demo .ex__stampWrap {
    visibility: hidden;
  }
}
