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

.ac {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: min(280px, 84vw);
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
}

.ac__btn {
  position: relative;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  width: 100%;
  height: 48px;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background-color: #fff7e6;
  color: #17141a;
  cursor: pointer;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
}

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

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

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

.ac__ic svg {
  display: block;
}

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

.ac:not(.is-demo) .ac__btn[data-state=idle] .ac__face[data-face=idle],
.ac:not(.is-demo) .ac__btn[data-state=busy] .ac__face[data-face=busy],
.ac:not(.is-demo) .ac__btn[data-state=done] .ac__face[data-face=done] {
  opacity: 1;
}

.ac:not(.is-demo) .ac__btn[data-state=busy] {
  background-color: #2f6df6;
  color: #fff7e6;
}

.ac:not(.is-demo) .ac__btn[data-state=done] {
  background-color: #4cd4a6;
  color: #17141a;
}

.ac__log {
  position: relative;
  margin: 0;
  width: 100%;
  height: 18px;
}

.ac__word {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  text-align: center;
  font-size: 12px;
  line-height: 18px;
  font-weight: 500;
  color: #fff7e6;
  opacity: 0;
}

.ac:not(.is-demo) .ac__btn[data-state=idle] ~ .ac__log .ac__word[data-word=idle],
.ac:not(.is-demo) .ac__btn[data-state=busy] ~ .ac__log .ac__word[data-word=busy],
.ac:not(.is-demo) .ac__btn[data-state=done] ~ .ac__log .ac__word[data-word=done] {
  opacity: 1;
}

.ac__ic--spin svg {
  animation-name: ac-spin;
  animation-duration: 800ms;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@keyframes ac-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
.ac.is-demo .ac__face,
.ac.is-demo .ac__word {
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

.ac.is-demo .ac__face[data-face=idle],
.ac.is-demo .ac__word[data-word=idle] {
  animation-name: ac-idle;
}

.ac.is-demo .ac__face[data-face=busy],
.ac.is-demo .ac__word[data-word=busy] {
  animation-name: ac-busy;
}

.ac.is-demo .ac__face[data-face=done],
.ac.is-demo .ac__word[data-word=done] {
  animation-name: ac-done;
}

@keyframes ac-idle {
  0% {
    opacity: 1;
  }
  20% {
    opacity: 0;
  }
  88% {
    opacity: 1;
  }
  100% {
    opacity: 1;
  }
}
@keyframes ac-busy {
  0% {
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  60% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
@keyframes ac-done {
  0% {
    opacity: 0;
  }
  60% {
    opacity: 1;
  }
  88% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
.ac.is-demo .ac__btn {
  animation-name: ac-skin, ac-pop;
  animation-duration: 2s, 2s;
  animation-timing-function: steps(1, end), cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite, infinite;
}

@keyframes ac-skin {
  0% {
    background-color: #fff7e6;
    color: #17141a;
  }
  20% {
    background-color: #2f6df6;
    color: #fff7e6;
  }
  60% {
    background-color: #4cd4a6;
    color: #17141a;
  }
  88% {
    background-color: #fff7e6;
    color: #17141a;
  }
  100% {
    background-color: #fff7e6;
    color: #17141a;
  }
}
@keyframes ac-pop {
  0% {
    transform: scale(1);
  }
  18% {
    transform: scale(1);
  }
  22% {
    transform: scale(0.96);
  }
  30% {
    transform: scale(1);
  }
  58% {
    transform: scale(1);
  }
  63% {
    transform: scale(1.04);
  }
  72% {
    transform: scale(1);
  }
  100% {
    transform: scale(1);
  }
}
@media (max-width: 340px) {
  .ac {
    gap: 8px;
  }
  .ac__btn {
    height: 44px;
  }
  .ac__t {
    font-size: 13px;
    line-height: 18px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ac.is-demo .ac__face,
  .ac.is-demo .ac__word,
  .ac.is-demo .ac__btn,
  .ac__ic--spin svg {
    animation: none !important;
  }
  .ac.is-demo .ac__face[data-face=idle],
  .ac.is-demo .ac__word[data-word=idle] {
    opacity: 1;
  }
}
