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

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

.cf__cap {
  margin: 0;
  align-self: flex-start;
  border-radius: 999px;
  padding: 4px 12px;
  background: #17141a;
  font-weight: 800;
  font-size: clamp(11px, 3vw, 12px);
  line-height: 1.4;
  color: #fff7e6;
}

.cf__table {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cf__row {
  display: grid;
  grid-template-columns: 1fr auto 44px;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  min-height: 30px;
  padding: 0 8px;
  background: #fff7e6;
  border-radius: 8px;
  outline: 2px solid transparent;
  outline-offset: 0;
}

.cf__row.is-conflict {
  outline-color: #905347;
}

.cf__act {
  font-weight: 700;
  font-size: clamp(10px, 2.8vw, 11px);
  color: #17141a;
}

.cf__bind {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cf__key {
  position: relative;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  height: 20px;
  min-width: 20px;
  padding: 0 4px;
  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: 10px;
  line-height: 1;
}

.cf__key > span {
  grid-area: 1/1;
}

.cf__letterAlt {
  visibility: hidden;
}

.cf__state {
  display: grid;
  place-items: center;
}

.cf__state > span {
  grid-area: 1/1;
  border-radius: 999px;
  padding: 4px 8px;
  font-weight: 800;
  font-size: 10px;
  line-height: 1;
  visibility: hidden;
}

.cf__warn {
  background: #905347;
  color: #fff7e6;
}

.cf__ok {
  background: rgba(23, 20, 26, 0.1);
  color: #17141a;
}

.cf__row.is-conflict .cf__warn {
  visibility: visible;
}

.cf__row.is-ok .cf__ok {
  visibility: visible;
}

.cf__live {
  margin: 0;
  align-self: flex-start;
  border-radius: 999px;
  padding: 4px 12px;
  background: #17141a;
  font-weight: 700;
  font-size: clamp(10px, 2.8vw, 11px);
  line-height: 1.4;
  color: #fff7e6;
  visibility: hidden;
}

.cf.has-conflict .cf__live {
  visibility: visible;
}

.cf__swap {
  align-self: flex-start;
  border: 0;
  cursor: pointer;
  background: #17141a;
  color: #fff7e6;
  border-radius: 999px;
  padding: 4px 12px;
  font-family: inherit;
  font-weight: 800;
  font-size: 10px;
  line-height: 1.4;
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cf__swap:active {
  transform: translateY(2px);
}

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

.cf__swap:disabled {
  cursor: default;
  background: rgba(23, 20, 26, 0.34);
}

.cf.is-demo .cf__row,
.cf.is-demo .cf__warn,
.cf.is-demo .cf__ok,
.cf.is-demo .cf__live,
.cf.is-demo .cf__row:nth-child(3) .cf__letterText,
.cf.is-demo .cf__letterAlt {
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

.cf.is-demo .cf__row:nth-child(1),
.cf.is-demo .cf__row:nth-child(3) {
  animation-name: cfOutline;
}

@keyframes cfOutline {
  0%, 15% {
    outline-color: transparent;
  }
  16%, 63% {
    outline-color: #905347;
  }
  64%, 100% {
    outline-color: transparent;
  }
}
.cf.is-demo .cf__row:nth-child(1) .cf__warn,
.cf.is-demo .cf__row:nth-child(3) .cf__warn {
  animation-name: cfWarnBadge;
}

@keyframes cfWarnBadge {
  0%, 15% {
    visibility: hidden;
  }
  16%, 63% {
    visibility: visible;
  }
  64%, 100% {
    visibility: hidden;
  }
}
.cf.is-demo .cf__row:nth-child(1) .cf__ok,
.cf.is-demo .cf__row:nth-child(3) .cf__ok {
  animation-name: cfOkBadge;
}

@keyframes cfOkBadge {
  0%, 63% {
    visibility: hidden;
  }
  64%, 100% {
    visibility: visible;
  }
}
.cf.is-demo .cf__row:nth-child(2) .cf__ok {
  animation-name: cfOkAlways;
}

@keyframes cfOkAlways {
  0%, 100% {
    visibility: visible;
  }
}
.cf.is-demo .cf__live {
  animation-name: cfLive;
}

@keyframes cfLive {
  0%, 15% {
    visibility: hidden;
  }
  16%, 63% {
    visibility: visible;
  }
  64%, 100% {
    visibility: hidden;
  }
}
.cf.is-demo .cf__row:nth-child(3) .cf__letterText {
  animation-name: cfLetterOld;
}

.cf.is-demo .cf__letterAlt {
  animation-name: cfLetterNew;
}

@keyframes cfLetterOld {
  0%, 63% {
    visibility: visible;
  }
  64%, 100% {
    visibility: hidden;
  }
}
@keyframes cfLetterNew {
  0%, 63% {
    visibility: hidden;
  }
  64%, 100% {
    visibility: visible;
  }
}
.cf.is-demo .cf__row:nth-child(3) .cf__bind {
  animation-name: cfBindPop;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

@keyframes cfBindPop {
  0%, 10% {
    transform: translateX(0);
  }
  16% {
    transform: translateX(-4px);
  }
  24%, 58% {
    transform: translateX(0);
  }
  64% {
    transform: translateX(-4px);
  }
  72%, 100% {
    transform: translateX(0);
  }
}
.cf.is-demo .cf__swap {
  animation-name: cfSwapState;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

@keyframes cfSwapState {
  0%, 63% {
    background: #17141a;
  }
  64%, 100% {
    background: rgba(23, 20, 26, 0.34);
  }
}
@media (max-width: 340px) {
  .cf {
    gap: 4px;
  }
  .cf__row {
    grid-template-columns: 1fr auto 40px;
    gap: 4px;
    padding: 0 4px;
    min-height: 26px;
  }
  .cf__state > span {
    padding: 0 4px;
  }
  .cf__cap {
    padding: 0 8px;
  }
  .cf__live {
    padding: 0 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cf.is-demo .cf__row,
  .cf.is-demo .cf__warn,
  .cf.is-demo .cf__ok,
  .cf.is-demo .cf__live,
  .cf.is-demo .cf__letterText,
  .cf.is-demo .cf__letterAlt,
  .cf.is-demo .cf__bind,
  .cf.is-demo .cf__swap {
    animation: none !important;
  }
  .cf__swap {
    transition: none !important;
  }
}
