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

.rn {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: min(100%, 400px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
}

.rn__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.62);
  font-weight: 700;
  font-size: clamp(10px, 2.8vw, 11px);
  line-height: 1;
}

.rn__ico {
  display: grid;
  place-items: center;
  font-size: 14px;
  color: #2b9d74;
}

.rn__out {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px;
  min-height: 96px;
}

.rn__line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #fff7e6;
  font-weight: 500;
  font-size: clamp(10px, 2.8vw, 12px);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
}

.rn__line--echo {
  color: #ffd23f;
  font-weight: 700;
}

.rn__line--bad {
  color: #ffe0d8;
}

.rn__line--sum {
  color: #2b9d74;
  font-weight: 700;
}

.rn__mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
}

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

.rn__spin {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-top-color: #2b9d74;
  transform-origin: 50% 50%;
  animation-name: rnSpin;
  animation-duration: 500ms;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@keyframes rnSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
.rn__tick {
  display: grid;
  place-items: center;
  font-size: 13px;
  color: #2b9d74;
  visibility: hidden;
}

.rn__line--work.is-done .rn__spin {
  visibility: hidden;
}

.rn__line--work.is-done .rn__tick {
  visibility: visible;
}

.rn__line--work.is-done .rn__work-text {
  color: #2b9d74;
}

.rn__form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.rn__sign {
  flex: 0 0 auto;
  color: #2b9d74;
  font-weight: 700;
  font-size: clamp(11px, 3vw, 12px);
  line-height: 1.4;
}

.rn__input {
  flex: 1 1 auto;
  min-width: 0;
  box-sizing: border-box;
  border: 0;
  background: none;
  color: #fff7e6;
  font-family: inherit;
  font-weight: 500;
  font-size: clamp(10px, 2.8vw, 12px);
  line-height: 1.4;
}

.rn__input::placeholder {
  color: rgba(255, 255, 255, 0.46);
}

.rn__input:focus-visible {
  outline: 2px solid #2f6df6;
  outline-offset: 2px;
  border-radius: 4px;
}

.rn.is-demo .rn__line {
  animation-name: rnRise;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
  animation-delay: calc(var(--i) * 80ms);
}

@keyframes rnRise {
  0% {
    opacity: 0;
  }
  6%, 100% {
    opacity: 1;
  }
}
.rn.is-demo .rn__line--sum {
  animation-name: rnSum;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
  animation-delay: 0s;
}

@keyframes rnSum {
  0%, 71% {
    opacity: 0;
  }
  72%, 100% {
    opacity: 1;
  }
}
.rn.is-demo .rn__spin {
  animation-name: rnSpin, rnSpinOff;
  animation-duration: 500ms, 2s;
  animation-timing-function: linear, steps(1, end);
  animation-iteration-count: infinite, infinite;
  animation-fill-mode: none, backwards;
}

@keyframes rnSpinOff {
  0%, 71% {
    visibility: visible;
  }
  72%, 100% {
    visibility: hidden;
  }
}
.rn.is-demo .rn__tick {
  animation-name: rnTickOn;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

@keyframes rnTickOn {
  0%, 71% {
    visibility: hidden;
  }
  72%, 100% {
    visibility: visible;
  }
}
.rn.is-demo .rn__work-text {
  animation-name: rnWorkText;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

@keyframes rnWorkText {
  0%, 71% {
    color: #fff7e6;
  }
  72%, 100% {
    color: #2b9d74;
  }
}
@media (max-width: 340px) {
  .rn__bar, .rn__out, .rn__form {
    padding-left: 8px;
    padding-right: 8px;
  }
  .rn__out {
    min-height: 76px;
    gap: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .rn__spin {
    animation: none !important;
  }
  .rn.is-demo .rn__line,
  .rn.is-demo .rn__line--sum,
  .rn.is-demo .rn__spin,
  .rn.is-demo .rn__tick,
  .rn.is-demo .rn__work-text {
    animation: none !important;
  }
}
