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

.cc {
  box-sizing: border-box;
  width: min(300px, 86vw);
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
}

.cc__field {
  position: relative;
}

.cc__input {
  box-sizing: border-box;
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: 2px solid rgba(23, 20, 26, 0.22);
  border-radius: 16px;
  background: #ffffff;
  color: #17141a;
  font-family: inherit;
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
  resize: none;
}

.cc__input::placeholder {
  color: rgba(23, 20, 26, 0.38);
}

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

.cc[data-level=near] .cc__input {
  border-color: #96734a;
}

.cc[data-level=full] .cc__input {
  border-color: #c2361a;
}

.cc.is-demo .cc__input::placeholder {
  color: transparent;
}

.cc__ghost {
  position: absolute;
  left: 14px;
  top: 10px;
  width: 268px;
  color: #17141a;
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
  pointer-events: none;
  opacity: 0;
}

.cc__bar {
  position: relative;
  height: 6px;
  margin-top: 8px;
  border-radius: 999px;
  background: rgba(23, 20, 26, 0.16);
  overflow: hidden;
}

.cc__fill {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #17141a;
  transform: scaleX(0.27);
  transform-origin: left center;
  transition: transform 220ms ease-out, background 220ms ease-out;
}

.cc[data-level=near] .cc__fill {
  background: #96734a;
}

.cc[data-level=full] .cc__fill {
  background: #c2361a;
}

.cc__out {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 16px;
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 16px;
  font-weight: 700;
}

.cc__nums, .cc__notes {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  height: 16px;
}

.cc__nums {
  width: 56px;
}

.cc__notes {
  width: 88px;
}

.cc__n, .cc__note {
  position: absolute;
  left: 0;
  top: 0;
  white-space: nowrap;
  opacity: 0;
}

.cc__n {
  color: rgba(23, 20, 26, 0.72);
}

.cc__note[data-note=near] {
  color: #96734a;
}

.cc__note[data-note=full] {
  color: #c2361a;
}

.cc[data-level=near] .cc__note[data-note=near],
.cc[data-level=full] .cc__note[data-note=full] {
  opacity: 1;
}

.cc__live {
  display: none;
  flex: 0 0 auto;
  width: 56px;
  color: rgba(23, 20, 26, 0.72);
}

.cc[data-level=near] .cc__live {
  color: #96734a;
}

.cc[data-level=full] .cc__live {
  color: #c2361a;
}

.cc:not(.is-demo) .cc__live {
  display: inline-block;
}

.cc:not(.is-demo) .cc__nums {
  display: none;
}

.cc__say {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.cc.is-demo .cc__ghost {
  opacity: 1;
  animation-name: cc-type;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

.cc.is-demo .cc__fill {
  transition: none;
  animation-name: cc-fill;
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
}

.cc.is-demo .cc__input {
  animation-name: cc-input;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

.cc.is-demo .cc__n,
.cc.is-demo .cc__note {
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

.cc.is-demo .cc__n[data-n="0"] {
  animation-name: cc-n0;
}

.cc.is-demo .cc__n[data-n="1"] {
  animation-name: cc-n1;
}

.cc.is-demo .cc__n[data-n="2"] {
  animation-name: cc-n2;
}

.cc.is-demo .cc__n[data-n="3"] {
  animation-name: cc-n3;
}

.cc.is-demo .cc__note[data-note=near] {
  animation-name: cc-near;
}

.cc.is-demo .cc__note[data-note=full] {
  animation-name: cc-full;
}

@keyframes cc-type {
  0% {
    clip-path: inset(0 74% 0 0);
  }
  26% {
    clip-path: inset(0 46% 0 0);
  }
  46% {
    clip-path: inset(0 18% 0 0);
  }
  62% {
    clip-path: inset(0 0 0 0);
  }
  86% {
    clip-path: inset(0 74% 0 0);
  }
  100% {
    clip-path: inset(0 74% 0 0);
  }
}
@keyframes cc-fill {
  0% {
    transform: scaleX(0.27);
    background: #17141a;
  }
  26% {
    transform: scaleX(0.57);
    background: #17141a;
  }
  45.4% {
    transform: scaleX(0.86);
    background: #17141a;
  }
  46% {
    transform: scaleX(0.86);
    background: #96734a;
  }
  61.4% {
    transform: scaleX(1);
    background: #96734a;
  }
  62% {
    transform: scaleX(1);
    background: #c2361a;
  }
  81% {
    transform: scaleX(1);
    background: #c2361a;
  }
  82% {
    transform: scaleX(0.27);
    background: #17141a;
  }
  100% {
    transform: scaleX(0.27);
    background: #17141a;
  }
}
@keyframes cc-input {
  0% {
    border-color: rgba(23, 20, 26, 0.22);
  }
  46% {
    border-color: #96734a;
  }
  62% {
    border-color: #c2361a;
  }
  82% {
    border-color: rgba(23, 20, 26, 0.22);
  }
  100% {
    border-color: rgba(23, 20, 26, 0.22);
  }
}
@keyframes cc-n0 {
  0% {
    opacity: 1;
    color: rgba(23, 20, 26, 0.72);
  }
  26% {
    opacity: 0;
    color: rgba(23, 20, 26, 0.72);
  }
  82% {
    opacity: 1;
    color: rgba(23, 20, 26, 0.72);
  }
  100% {
    opacity: 1;
    color: rgba(23, 20, 26, 0.72);
  }
}
@keyframes cc-n1 {
  0% {
    opacity: 0;
  }
  26% {
    opacity: 1;
  }
  46% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
@keyframes cc-n2 {
  0% {
    opacity: 0;
    color: #96734a;
  }
  46% {
    opacity: 1;
    color: #96734a;
  }
  62% {
    opacity: 0;
    color: #96734a;
  }
  100% {
    opacity: 0;
    color: #96734a;
  }
}
@keyframes cc-n3 {
  0% {
    opacity: 0;
    color: #c2361a;
  }
  62% {
    opacity: 1;
    color: #c2361a;
  }
  82% {
    opacity: 0;
    color: #c2361a;
  }
  100% {
    opacity: 0;
    color: #c2361a;
  }
}
@keyframes cc-near {
  0% {
    opacity: 0;
  }
  46% {
    opacity: 1;
  }
  62% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
@keyframes cc-full {
  0% {
    opacity: 0;
  }
  62% {
    opacity: 1;
  }
  76% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
@media (max-width: 360px) {
  .cc__ghost {
    width: 228px;
  }
  .cc__bar {
    margin-top: 4px;
  }
  .cc__out {
    margin-top: 4px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cc.is-demo .cc__ghost,
  .cc.is-demo .cc__fill,
  .cc.is-demo .cc__input,
  .cc.is-demo .cc__n,
  .cc.is-demo .cc__note {
    animation: none !important;
  }
  .cc.is-demo .cc__ghost {
    opacity: 1;
    clip-path: inset(0 0 0 0);
  }
  .cc.is-demo .cc__fill {
    transform: scaleX(1);
    background: #c2361a;
  }
  .cc.is-demo .cc__input {
    border-color: #c2361a;
  }
  .cc.is-demo .cc__n[data-n="3"] {
    opacity: 1;
    color: #c2361a;
  }
  .cc.is-demo .cc__note[data-note=full] {
    opacity: 1;
  }
  .cc__fill {
    transition: none;
  }
}
