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

.kc {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.kc__hint {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  font-weight: 700;
  font-size: clamp(11px, 3vw, 12px);
  color: #fff7e6;
}

.kc__ico {
  width: 16px;
  height: 16px;
  color: #ffd23f;
}

.kc__row {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 20px;
}

.kc__cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.kc__tag {
  font-weight: 700;
  font-size: clamp(10px, 2.6vw, 11px);
  color: rgba(255, 247, 230, 0.78);
}

.kc__cap {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 800;
  font-size: 20px;
  line-height: 1;
  transition: transform 140ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 140ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.kc__cap--flat {
  background: #fff7e6;
  color: #17141a;
}

.kc__cap--raised {
  background: #ffd23f;
  color: #17141a;
  box-shadow: 0 6px 0 #a89153;
}

.kc__cap--outline {
  background: transparent;
  color: #fff7e6;
  border: 2px solid #fff7e6;
}

.kc__cap.is-down {
  transform: translateY(4px);
}

.kc__cap--raised.is-down {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #a89153;
}

.kc__read {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.kc__readLabel {
  font-weight: 700;
  font-size: clamp(10px, 2.6vw, 11px);
  color: rgba(255, 247, 230, 0.78);
}

.kc__readKey {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 20px;
  border-radius: 4px;
  padding: 0 4px;
  background: rgba(255, 247, 230, 0.16);
  color: #fff7e6;
  font-weight: 800;
  font-size: clamp(11px, 3vw, 12px);
  line-height: 1;
}

.kc__loop {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  visibility: hidden;
}

.kc__loop i {
  grid-area: 1/1;
  font-style: normal;
  visibility: hidden;
}

.kc.is-demo .kc__cap {
  animation-name: kcPress;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

.kc.is-demo .kc__cap--flat {
  animation-delay: 0ms;
}

.kc.is-demo .kc__cap--raised {
  animation-name: kcPressRaised;
  animation-delay: 600ms;
}

.kc.is-demo .kc__cap--outline {
  animation-delay: 1200ms;
}

@keyframes kcPress {
  0%, 4% {
    transform: translateY(0);
  }
  9%, 22% {
    transform: translateY(4px);
  }
  28%, 100% {
    transform: translateY(0);
  }
}
@keyframes kcPressRaised {
  0%, 4% {
    transform: translateY(0);
    box-shadow: 0 6px 0 #a89153;
  }
  9%, 22% {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #a89153;
  }
  28%, 100% {
    transform: translateY(0);
    box-shadow: 0 6px 0 #a89153;
  }
}
.kc.is-demo .kc__readText {
  color: transparent;
}

.kc.is-demo .kc__loop {
  visibility: visible;
}

.kc.is-demo .kc__loop i {
  animation-name: kcLetter;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

.kc.is-demo .kc__loop i:nth-child(1) {
  animation-delay: 0ms;
}

.kc.is-demo .kc__loop i:nth-child(2) {
  animation-delay: 600ms;
}

.kc.is-demo .kc__loop i:nth-child(3) {
  animation-delay: 1200ms;
}

@keyframes kcLetter {
  0%, 27% {
    visibility: visible;
  }
  28%, 100% {
    visibility: hidden;
  }
}
@media (max-width: 340px) {
  .kc {
    gap: 8px;
  }
  .kc__row {
    gap: 12px;
  }
  .kc__cap {
    width: 40px;
    height: 40px;
    font-size: 17px;
  }
  .kc__cell {
    gap: 4px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .kc.is-demo .kc__cap,
  .kc.is-demo .kc__loop i {
    animation: none !important;
  }
  .kc.is-demo .kc__readText {
    color: #fff7e6 !important;
  }
  .kc.is-demo .kc__loop {
    visibility: hidden !important;
  }
  .kc__cap {
    transition: none !important;
  }
}
