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

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

.cp__row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.cp__code {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  padding: 0 12px;
  height: 44px;
  border-radius: 8px;
  background-color: #fff7e6;
  color: #17141a;
  font-family: "Space Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 13px;
  line-height: 20px;
  font-weight: 700;
  white-space: nowrap;
}

.cp__btn {
  position: relative;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  width: 92px;
  height: 44px;
  overflow: visible;
  border: 0;
  border-radius: 12px;
  background-color: #fff7e6;
  color: #17141a;
  cursor: pointer;
}

.cp__btn:focus-visible {
  outline: 3px solid #4cd4a6;
  outline-offset: 3px;
}

.cp__ring {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  border: 3px solid #4cd4a6;
  border-radius: 12px;
  opacity: 0;
}

.cp__face {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0;
}

.cp__ic {
  display: inline-flex;
  flex: 0 0 auto;
}

.cp__ic svg {
  display: block;
}

.cp__t {
  font-size: 13px;
  line-height: 20px;
  font-weight: 700;
  white-space: nowrap;
}

.cp:not(.is-demo) .cp__face[data-face=idle] {
  opacity: 1;
}

.cp:not(.is-demo)[data-copied="1"] .cp__face[data-face=idle] {
  opacity: 0;
}

.cp:not(.is-demo)[data-copied="1"] .cp__face[data-face=done] {
  opacity: 1;
}

.cp:not(.is-demo)[data-copied="1"] .cp__btn {
  background-color: #4cd4a6;
}

.cp__live {
  margin: 0;
  height: 18px;
}

.cp__word {
  display: block;
  font-size: 12px;
  line-height: 18px;
  font-weight: 500;
  color: #fff7e6;
  opacity: 0;
}

.cp:not(.is-demo)[data-copied="1"] .cp__word {
  opacity: 1;
}

.cp.is-demo .cp__face {
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

.cp.is-demo .cp__face[data-face=idle] {
  animation-name: cp-idle;
}

.cp.is-demo .cp__face[data-face=done] {
  animation-name: cp-done;
}

@keyframes cp-idle {
  0% {
    opacity: 1;
  }
  35% {
    opacity: 0;
  }
  76% {
    opacity: 1;
  }
  100% {
    opacity: 1;
  }
}
@keyframes cp-done {
  0% {
    opacity: 0;
  }
  35% {
    opacity: 1;
  }
  76% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
.cp.is-demo .cp__btn {
  animation-name: cp-skin, cp-tap;
  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 cp-skin {
  0% {
    background-color: #fff7e6;
  }
  35% {
    background-color: #4cd4a6;
  }
  84% {
    background-color: #fff7e6;
  }
  100% {
    background-color: #fff7e6;
  }
}
@keyframes cp-tap {
  0% {
    transform: scale(1);
  }
  30% {
    transform: scale(1);
  }
  35% {
    transform: scale(0.92);
  }
  44% {
    transform: scale(1.04);
  }
  54% {
    transform: scale(1);
  }
  100% {
    transform: scale(1);
  }
}
.cp.is-demo .cp__ring {
  animation-name: cp-ring;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite;
}

@keyframes cp-ring {
  0% {
    opacity: 0;
    transform: scale(1);
  }
  35% {
    opacity: 1;
    transform: scale(1);
  }
  52% {
    opacity: 0;
    transform: scale(1.4);
  }
  100% {
    opacity: 0;
    transform: scale(1.4);
  }
}
.cp.is-demo .cp__word {
  animation-name: cp-say;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

@keyframes cp-say {
  0% {
    opacity: 0;
  }
  35% {
    opacity: 1;
  }
  84% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
@media (max-width: 340px) {
  .cp {
    gap: 8px;
  }
  .cp__row {
    gap: 4px;
  }
  .cp__code {
    font-size: 11px;
    line-height: 16px;
    padding: 0 8px;
  }
  .cp__btn {
    width: 76px;
  }
  .cp__t {
    font-size: 11px;
    line-height: 16px;
  }
  .cp__word {
    font-size: 11px;
    line-height: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cp.is-demo .cp__face,
  .cp.is-demo .cp__btn,
  .cp.is-demo .cp__ring,
  .cp.is-demo .cp__word {
    animation: none !important;
  }
  .cp.is-demo .cp__face[data-face=idle] {
    opacity: 1;
  }
}
