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

.sp {
  display: flex;
  justify-content: center;
  width: 100%;
}

.sp__card {
  width: min(100%, 340px);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
  overflow: hidden;
}

.sp__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #17141a;
  padding: 8px 12px;
}

.sp__label {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  font-weight: 800;
  font-size: clamp(10px, 2.8vw, 12px);
  color: #ffffff;
}

.sp__ico {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.sp__acts {
  display: flex;
  gap: 4px;
}

.sp__btn {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: transparent;
  color: #ffffff;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 700;
  font-size: clamp(9px, 2.4vw, 10px);
  padding: 4px 8px;
  line-height: 1.3;
}

.sp__btn--wipe {
  background: #2f6df6;
  border-color: #2f6df6;
}

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

.sp__pad {
  position: relative;
  background: #fff7e6;
  aspect-ratio: 300/96;
  touch-action: none;
}

.sp__ink, .sp__ghost {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.sp__rule {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 12%;
  height: 0;
  border-bottom: 1px dashed rgba(23, 20, 26, 0.42);
}

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

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

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

.sp__live {
  position: relative;
  margin: 0;
  padding: 4px 12px 8px;
  font-weight: 700;
  font-size: clamp(9px, 2.4vw, 11px);
  color: rgba(23, 20, 26, 0.72);
}

.sp__liveDemo {
  display: none;
  position: absolute;
  left: 12px;
  top: 4px;
}

.sp.is-demo .sp__ink {
  visibility: hidden;
}

.sp.is-demo .sp__ghost {
  display: block;
}

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

.sp.is-demo .sp__stroke--a {
  animation-name: spDrawA;
}

.sp.is-demo .sp__stroke--b {
  animation-name: spDrawB;
}

.sp.is-demo .sp__stroke--c {
  animation-name: spDrawC;
}

@keyframes spDrawA {
  0%, 4% {
    stroke-dashoffset: 100;
  }
  28%, 80% {
    stroke-dashoffset: 0;
  }
  98%, 100% {
    stroke-dashoffset: 100;
  }
}
@keyframes spDrawB {
  0%, 30% {
    stroke-dashoffset: 100;
  }
  42%, 70% {
    stroke-dashoffset: 0;
  }
  82%, 100% {
    stroke-dashoffset: 100;
  }
}
@keyframes spDrawC {
  0%, 44% {
    stroke-dashoffset: 100;
  }
  54%, 62% {
    stroke-dashoffset: 0;
  }
  70%, 100% {
    stroke-dashoffset: 100;
  }
}
.sp.is-demo .sp__liveReal {
  color: transparent;
}

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

.sp.is-demo .sp__liveDemo--zero {
  animation-name: spCountZero;
}

.sp.is-demo .sp__liveDemo--one {
  animation-name: spCountOne;
}

.sp.is-demo .sp__liveDemo--two {
  animation-name: spCountTwo;
}

.sp.is-demo .sp__liveDemo--three {
  animation-name: spCountThree;
}

@keyframes spCountZero {
  0%, 27% {
    opacity: 1;
  }
  28%, 97% {
    opacity: 0;
  }
  98%, 100% {
    opacity: 1;
  }
}
@keyframes spCountOne {
  0%, 27% {
    opacity: 0;
  }
  28%, 41% {
    opacity: 1;
  }
  42%, 81% {
    opacity: 0;
  }
  82%, 97% {
    opacity: 1;
  }
  98%, 100% {
    opacity: 0;
  }
}
@keyframes spCountTwo {
  0%, 41% {
    opacity: 0;
  }
  42%, 53% {
    opacity: 1;
  }
  54%, 69% {
    opacity: 0;
  }
  70%, 81% {
    opacity: 1;
  }
  82%, 100% {
    opacity: 0;
  }
}
@keyframes spCountThree {
  0%, 53% {
    opacity: 0;
  }
  54%, 69% {
    opacity: 1;
  }
  70%, 100% {
    opacity: 0;
  }
}
.sp.is-demo .sp__btn:first-child {
  animation-name: spPress;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite;
}

@keyframes spPress {
  0%, 60% {
    transform: scale(1);
  }
  64% {
    transform: scale(0.88);
  }
  70%, 100% {
    transform: scale(1);
  }
}
@media (max-width: 340px) {
  .sp__bar {
    padding: 4px 8px;
  }
  .sp__live {
    padding: 4px 8px;
  }
  .sp__liveDemo {
    left: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sp.is-demo .sp__stroke,
  .sp.is-demo .sp__liveDemo,
  .sp.is-demo .sp__btn:first-child {
    animation: none !important;
  }
  .sp.is-demo .sp__stroke {
    stroke-dashoffset: 0 !important;
  }
  .sp.is-demo .sp__liveDemo--zero,
  .sp.is-demo .sp__liveDemo--one,
  .sp.is-demo .sp__liveDemo--two {
    opacity: 0 !important;
  }
  .sp.is-demo .sp__liveDemo--three {
    opacity: 1 !important;
  }
}
