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

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

.rc {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(100%, 300px);
}

.rc__label {
  margin: 0;
  font-weight: 800;
  font-size: clamp(11px, 3vw, 12px);
  color: #17141a;
}

.rc__field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  box-sizing: border-box;
  min-height: 44px;
  padding: 8px 12px;
  background: #ffffff;
  border: 2px solid rgba(23, 20, 26, 0.18);
  border-radius: 12px;
  transition: border-color 140ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

.rc.is-conflict .rc__field {
  border-color: #c2361a;
}

.rc__slot {
  display: grid;
  align-items: center;
  justify-items: start;
  min-width: 0;
}

.rc__slot > * {
  grid-area: 1/1;
}

.rc__hint {
  font-weight: 600;
  font-size: clamp(10px, 2.8vw, 11px);
  color: rgba(23, 20, 26, 0.72);
}

.rc__combo {
  display: flex;
  align-items: center;
  gap: 4px;
  visibility: hidden;
}

.rc.has-combo .rc__hint {
  visibility: hidden;
}

.rc.has-combo .rc__combo {
  visibility: visible;
}

.rc__key {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  height: 22px;
  min-width: 22px;
  border-radius: 4px;
  border: 1px solid rgba(23, 20, 26, 0.24);
  background: rgba(23, 20, 26, 0.06);
  color: #17141a;
  font-family: inherit;
  font-weight: 800;
  font-size: 11px;
  line-height: 1;
  padding: 0 4px;
}

.rc__rec {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c2361a;
  transform-origin: 50% 50%;
}

.rc__warn {
  margin: 0;
  font-weight: 700;
  font-size: clamp(10px, 2.8vw, 11px);
  color: #905347;
  visibility: hidden;
}

.rc.is-conflict .rc__warn {
  visibility: visible;
}

.rc.is-demo .rc__hint {
  animation-name: rcHint;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

@keyframes rcHint {
  0%, 15% {
    visibility: visible;
  }
  16%, 100% {
    visibility: hidden;
  }
}
.rc.is-demo .rc__combo {
  visibility: visible;
}

.rc.is-demo .rc__key {
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

.rc.is-demo .rc__key:nth-child(1) {
  animation-name: rcKey1;
}

.rc.is-demo .rc__key:nth-child(2) {
  animation-name: rcKey2;
}

.rc.is-demo .rc__key:nth-child(3) {
  animation-name: rcKey3;
}

@keyframes rcKey1 {
  0%, 15% {
    visibility: hidden;
    transform: scale(0.6);
  }
  16% {
    visibility: visible;
    transform: scale(0.6);
  }
  22%, 100% {
    visibility: visible;
    transform: scale(1);
  }
}
@keyframes rcKey2 {
  0%, 33% {
    visibility: hidden;
    transform: scale(0.6);
  }
  34% {
    visibility: visible;
    transform: scale(0.6);
  }
  40%, 100% {
    visibility: visible;
    transform: scale(1);
  }
}
@keyframes rcKey3 {
  0%, 51% {
    visibility: hidden;
    transform: scale(0.6);
  }
  52% {
    visibility: visible;
    transform: scale(0.6);
  }
  58%, 100% {
    visibility: visible;
    transform: scale(1);
  }
}
.rc.is-demo .rc__rec {
  animation-name: rcBlink;
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

@keyframes rcBlink {
  0%, 44% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.75);
  }
  56%, 100% {
    transform: scale(1);
  }
}
.rc.is-demo .rc__warn {
  animation-name: rcWarn;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

@keyframes rcWarn {
  0%, 63% {
    visibility: hidden;
  }
  64%, 100% {
    visibility: visible;
  }
}
.rc.is-demo .rc__field {
  animation-name: rcBorder;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

@keyframes rcBorder {
  0%, 63% {
    border-color: rgba(23, 20, 26, 0.18);
  }
  64%, 100% {
    border-color: #c2361a;
  }
}
@media (max-width: 340px) {
  .rc__field {
    min-height: 40px;
    padding: 4px 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .rc.is-demo .rc__hint,
  .rc.is-demo .rc__key,
  .rc.is-demo .rc__rec,
  .rc.is-demo .rc__warn,
  .rc.is-demo .rc__field {
    animation: none !important;
  }
  .rc.is-demo .rc__combo {
    visibility: hidden !important;
  }
  .rc__field {
    transition: none !important;
  }
}
