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

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

.bc {
  box-sizing: border-box;
  width: min(320px, 88vw);
  padding: 12px;
  border-radius: 16px;
  background-color: #fff7e6;
  color: #17141a;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
}

.bc__title {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 18px;
  font-weight: 700;
}

.bc__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.bc__code {
  position: relative;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  border-radius: 8px;
  background-color: rgba(23, 20, 26, 0.08);
  font-size: 13px;
  line-height: 18px;
  font-weight: 700;
  letter-spacing: 1px;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
}

.bc__code--used {
  color: rgba(23, 20, 26, 0.72);
  text-decoration: line-through 2px rgba(23, 20, 26, 0.72);
}

.bc__strike {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  border-radius: 999px;
  background-color: #c2361a;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.bc__copy {
  position: relative;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  height: 34px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background-color: #4cd4a6;
  color: #17141a;
  font-size: 13px;
  line-height: 18px;
  font-weight: 700;
  cursor: pointer;
}

.bc__copy:focus-visible {
  outline: 3px solid #fff7e6;
  outline-offset: 2px;
}

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

.bc__ic svg {
  display: block;
}

.bc__labels {
  display: grid;
}

.bc__label {
  grid-area: 1/1;
  opacity: 0;
}

.bc:not(.is-demo)[data-copied="1"] .bc__label[data-label=done],
.bc:not(.is-demo)[data-copied="0"] .bc__label[data-label=copy] {
  opacity: 1;
}

.bc:not(.is-demo)[data-copied="1"] .bc__copy {
  background-color: #2f6df6;
  color: #fff7e6;
}

.bc__live {
  margin: 8px 0 0;
  height: 15px;
  font-size: 10px;
  line-height: 15px;
  font-weight: 500;
  color: rgba(23, 20, 26, 0.64);
  white-space: nowrap;
  opacity: 0;
}

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

.bc.is-demo .bc__strike[data-strike="3"] {
  animation-name: bc-grow3;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}

@keyframes bc-grow3 {
  0% {
    transform: scaleX(0);
  }
  4% {
    transform: scaleX(0);
  }
  14% {
    transform: scaleX(1);
  }
  86% {
    transform: scaleX(1);
  }
  92% {
    transform: scaleX(1);
  }
  100% {
    transform: scaleX(1);
  }
}
.bc.is-demo .bc__strike[data-strike="6"] {
  animation-name: bc-grow6;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}

@keyframes bc-grow6 {
  0% {
    transform: scaleX(0);
  }
  16% {
    transform: scaleX(0);
  }
  26% {
    transform: scaleX(1);
  }
  86% {
    transform: scaleX(1);
  }
  92% {
    transform: scaleX(1);
  }
  100% {
    transform: scaleX(1);
  }
}
.bc.is-demo .bc__strike[data-strike="1"] {
  animation-name: bc-grow1;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
  animation-delay: 0s;
}

@keyframes bc-grow1 {
  0% {
    transform: scaleX(0);
  }
  28% {
    transform: scaleX(0);
  }
  38% {
    transform: scaleX(1);
  }
  86% {
    transform: scaleX(1);
  }
  92% {
    transform: scaleX(1);
  }
  100% {
    transform: scaleX(1);
  }
}
.bc.is-demo .bc__strike[data-strike="4"] {
  animation-name: bc-grow4;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}

@keyframes bc-grow4 {
  0% {
    transform: scaleX(0);
  }
  40% {
    transform: scaleX(0);
  }
  46% {
    transform: scaleX(1);
  }
  86% {
    transform: scaleX(1);
  }
  92% {
    transform: scaleX(1);
  }
  100% {
    transform: scaleX(1);
  }
}
.bc.is-demo .bc__label,
.bc.is-demo .bc__live,
.bc.is-demo .bc__copy {
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

.bc.is-demo .bc__label[data-label=copy] {
  animation-name: bc-label-copy;
}

.bc.is-demo .bc__label[data-label=done] {
  animation-name: bc-label-done;
}

@keyframes bc-label-copy {
  0% {
    opacity: 1;
  }
  52% {
    opacity: 0;
  }
  86% {
    opacity: 1;
  }
  100% {
    opacity: 1;
  }
}
@keyframes bc-label-done {
  0% {
    opacity: 0;
  }
  52% {
    opacity: 1;
  }
  86% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
.bc.is-demo .bc__live {
  animation-name: bc-say;
}

@keyframes bc-say {
  0% {
    opacity: 0;
  }
  52% {
    opacity: 1;
  }
  86% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
.bc.is-demo .bc__copy {
  animation-name: bc-skin;
}

@keyframes bc-skin {
  0% {
    background-color: #4cd4a6;
    color: #17141a;
  }
  52% {
    background-color: #2f6df6;
    color: #fff7e6;
  }
  86% {
    background-color: #2f6df6;
    color: #fff7e6;
  }
  100% {
    background-color: #4cd4a6;
    color: #17141a;
  }
}
@media (max-width: 340px) {
  .bc {
    padding: 8px;
  }
  .bc__title {
    margin: 0 0 4px;
    font-size: 12px;
    line-height: 16px;
  }
  .bc__grid {
    gap: 4px;
    margin: 0 0 8px;
  }
  .bc__code {
    height: 22px;
    font-size: 11px;
    line-height: 16px;
    letter-spacing: 0;
  }
  .bc__copy {
    height: 28px;
    font-size: 12px;
    line-height: 16px;
  }
  .bc__live {
    margin: 4px 0 0;
    height: 14px;
    font-size: 9px;
    line-height: 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .bc.is-demo .bc__strike,
  .bc.is-demo .bc__label,
  .bc.is-demo .bc__live,
  .bc.is-demo .bc__copy {
    animation: none !important;
  }
  .bc__strike {
    transition: none !important;
  }
  .bc.is-demo .bc__label[data-label=copy] {
    opacity: 1 !important;
  }
  .bc.is-demo .bc__strike[data-strike="3"],
  .bc.is-demo .bc__strike[data-strike="6"] {
    transform: scaleX(1) !important;
  }
}
