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

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

.cl {
  display: flex;
  justify-content: center;
  width: 100%;
  padding-bottom: 8px;
}

.cl__card {
  width: min(100%, 340px);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
  padding: 12px;
  display: grid;
  gap: 8px;
}

.cl__doc {
  display: grid;
  gap: 4px;
  padding: 8px;
  background: #fff7e6;
  border-radius: 8px;
}

.cl__docTitle {
  margin: 0;
  font-weight: 800;
  font-size: clamp(10px, 2.8vw, 12px);
  line-height: 1.3;
  color: #17141a;
}

.cl__docLine {
  margin: 0;
  font-weight: 600;
  font-size: clamp(9px, 2.4vw, 11px);
  line-height: 1.5;
  color: rgba(23, 20, 26, 0.78);
}

.cl__docNote {
  margin: 0;
  font-weight: 600;
  font-size: clamp(9px, 2.4vw, 10px);
  line-height: 1.5;
  color: rgba(23, 20, 26, 0.72);
}

.cl__pad {
  position: relative;
  background: #fff7e6;
  border-radius: 8px;
  aspect-ratio: 300/56;
  touch-action: none;
}

.cl.is-locked .cl__pad {
  pointer-events: none;
}

.cl__hint {
  position: absolute;
  left: 8px;
  top: 4px;
  margin: 0;
  font-weight: 700;
  font-size: clamp(9px, 2.4vw, 10px);
  line-height: 1.3;
  color: rgba(23, 20, 26, 0.42);
}

.cl__ink, .cl__ghost {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.cl__ghost {
  display: none;
  fill: none;
}

.cl__stroke {
  stroke: #17141a;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
}

.cl__stroke--c {
  stroke-width: 7;
}

.cl__rule {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 16%;
  height: 0;
  border-bottom: 1px dashed rgba(23, 20, 26, 0.34);
}

.cl__cover {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(23, 20, 26, 0.16);
  border-radius: 8px;
  opacity: 0;
  visibility: hidden;
}

.cl.is-locked .cl__cover {
  opacity: 1;
  visibility: visible;
}

.cl__lock {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: rgba(23, 20, 26, 0.66);
}

.cl__stamp {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 2px solid #c2361a;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: #c2361a;
  font-weight: 800;
  font-size: clamp(9px, 2.4vw, 10px);
  line-height: 1.2;
  padding: 4px 8px;
  transform: rotate(-6deg) scale(1);
}

.cl__stampDemo {
  display: none;
}

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

.cl__live {
  position: relative;
  margin: 0;
  flex: 1 1 auto;
  font-weight: 700;
  font-size: clamp(9px, 2.4vw, 11px);
  line-height: 1.4;
  color: rgba(23, 20, 26, 0.66);
  white-space: nowrap;
}

.cl__liveDemo {
  display: none;
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
}

.cl__acts {
  display: grid;
  flex: 0 0 auto;
}

.cl__btn {
  grid-area: 1/1;
  justify-self: end;
  cursor: pointer;
  border: 0;
  background: #17141a;
  color: #ffffff;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 800;
  font-size: clamp(9px, 2.4vw, 11px);
  line-height: 1.2;
  padding: 8px 12px;
}

.cl__btn--again {
  background: #2f6df6;
  opacity: 0;
  pointer-events: none;
}

.cl.is-locked .cl__btn--confirm {
  opacity: 0;
  pointer-events: none;
}

.cl.is-locked .cl__btn--again {
  opacity: 1;
  pointer-events: auto;
}

.cl__btn:focus-visible {
  outline: 3px solid #2f6df6;
  outline-offset: 2px;
}

.cl.is-demo .cl__ink {
  visibility: hidden;
}

.cl.is-demo .cl__ghost {
  display: block;
}

.cl.is-demo .cl__stampDemo {
  display: inline;
}

.cl.is-demo .cl__stroke {
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
}

.cl.is-demo .cl__stroke--a {
  animation-name: clDrawA;
}

.cl.is-demo .cl__stroke--b {
  animation-name: clDrawB;
}

.cl.is-demo .cl__stroke--c {
  animation-name: clDrawC;
}

@keyframes clDrawA {
  0% {
    stroke-dashoffset: 100;
  }
  20%, 92% {
    stroke-dashoffset: 0;
  }
  98%, 100% {
    stroke-dashoffset: 100;
  }
}
@keyframes clDrawB {
  0%, 20% {
    stroke-dashoffset: 100;
  }
  30%, 90% {
    stroke-dashoffset: 0;
  }
  96%, 100% {
    stroke-dashoffset: 100;
  }
}
@keyframes clDrawC {
  0%, 32% {
    stroke-dashoffset: 100;
  }
  40%, 88% {
    stroke-dashoffset: 0;
  }
  94%, 100% {
    stroke-dashoffset: 100;
  }
}
.cl.is-demo .cl__cover {
  visibility: visible;
  animation-name: clCoverCut, clCoverWipe;
  animation-duration: 2s, 2s;
  animation-timing-function: steps(1, end), ease-out;
  animation-iteration-count: infinite, infinite;
}

@keyframes clCoverCut {
  0%, 49% {
    opacity: 0;
  }
  50%, 87% {
    opacity: 1;
  }
  88%, 100% {
    opacity: 0;
  }
}
@keyframes clCoverWipe {
  0%, 76% {
    clip-path: inset(0 0 0 0);
  }
  87%, 100% {
    clip-path: inset(0 0 0 100%);
  }
}
.cl.is-demo .cl__stamp {
  animation-name: clStamp;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite;
}

@keyframes clStamp {
  0%, 49% {
    opacity: 0;
    transform: rotate(-6deg) scale(1.5);
  }
  50% {
    opacity: 1;
    transform: rotate(-6deg) scale(1.5);
  }
  60%, 100% {
    opacity: 1;
    transform: rotate(-6deg) scale(1);
  }
}
.cl.is-demo .cl__btn--confirm {
  animation-name: clConfirmShow, clConfirmPress;
  animation-duration: 2s, 2s;
  animation-timing-function: steps(1, end), cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite, infinite;
}

@keyframes clConfirmShow {
  0%, 53% {
    opacity: 1;
  }
  54%, 87% {
    opacity: 0;
  }
  88%, 100% {
    opacity: 1;
  }
}
@keyframes clConfirmPress {
  0%, 42% {
    transform: scale(1);
  }
  45% {
    transform: scale(0.88);
  }
  50%, 100% {
    transform: scale(1);
  }
}
.cl.is-demo .cl__btn--again {
  animation-name: clAgainShow, clAgainPress;
  animation-duration: 2s, 2s;
  animation-timing-function: steps(1, end), cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite, infinite;
}

@keyframes clAgainShow {
  0%, 53% {
    opacity: 0;
  }
  54%, 87% {
    opacity: 1;
  }
  88%, 100% {
    opacity: 0;
  }
}
@keyframes clAgainPress {
  0%, 72% {
    transform: scale(1);
  }
  75% {
    transform: scale(0.88);
  }
  80%, 100% {
    transform: scale(1);
  }
}
.cl.is-demo .cl__liveReal {
  color: transparent;
}

.cl.is-demo .cl__liveDemo {
  display: block;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

.cl.is-demo .cl__liveDemo--ask {
  animation-name: clSayAsk;
}

.cl.is-demo .cl__liveDemo--done {
  animation-name: clSayDone;
}

@keyframes clSayAsk {
  0%, 49% {
    opacity: 1;
  }
  50%, 87% {
    opacity: 0;
  }
  88%, 100% {
    opacity: 1;
  }
}
@keyframes clSayDone {
  0%, 49% {
    opacity: 0;
  }
  50%, 87% {
    opacity: 1;
  }
  88%, 100% {
    opacity: 0;
  }
}
@media (max-width: 340px) {
  .cl__card {
    padding: 8px;
  }
  .cl__doc {
    padding: 4px;
  }
  .cl__btn {
    padding: 4px 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cl.is-demo .cl__stroke,
  .cl.is-demo .cl__cover,
  .cl.is-demo .cl__stamp,
  .cl.is-demo .cl__btn--confirm,
  .cl.is-demo .cl__btn--again,
  .cl.is-demo .cl__liveDemo {
    animation: none !important;
  }
  .cl.is-demo .cl__stroke {
    stroke-dashoffset: 0 !important;
  }
  .cl.is-demo .cl__cover {
    opacity: 1 !important;
    visibility: visible !important;
    clip-path: inset(0 0 0 0) !important;
  }
  .cl.is-demo .cl__stamp {
    opacity: 1 !important;
    transform: rotate(-6deg) scale(1) !important;
  }
  .cl.is-demo .cl__btn--confirm {
    opacity: 0 !important;
  }
  .cl.is-demo .cl__btn--again {
    opacity: 1 !important;
  }
  .cl.is-demo .cl__liveDemo--ask {
    opacity: 0 !important;
  }
  .cl.is-demo .cl__liveDemo--done {
    opacity: 1 !important;
  }
}
