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

.es {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  height: 100%;
  min-height: 164px;
  justify-content: center;
}

.es:focus-visible {
  outline: 2px solid #17141a;
  outline-offset: 3px;
  border-radius: 12px;
}

.es__row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.es__label {
  position: relative;
  flex: 1;
  height: 14px;
  font-weight: 600;
  font-size: 11px;
  line-height: 1.3;
}

.es__label b {
  position: absolute;
  inset: 0;
  font-weight: 600;
  color: rgba(23, 20, 26, 0.82);
  opacity: 0;
}

.es__label-run {
  opacity: 1 !important;
}

.es.is-error .es__label-run {
  opacity: 0 !important;
}

.es.is-error .es__label-err {
  opacity: 1 !important;
  color: #c2361a !important;
}

.es__warn {
  display: flex;
  color: #c2361a;
  opacity: 0;
  transform: scale(0.6);
}

.es.is-error .es__warn {
  opacity: 1;
  transform: scale(1);
  transition: opacity 220ms ease-out, transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.es__retry {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: rgba(23, 20, 26, 0.12);
  color: #17141a;
  opacity: 0;
  transform: scale(0.6);
  cursor: pointer;
  padding: 0;
}

.es.is-error .es__retry {
  opacity: 1;
  transform: scale(1);
  transition: opacity 220ms ease-out, transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.es__track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(23, 20, 26, 0.14);
  overflow: hidden;
}

.es__fill {
  position: absolute;
  inset: 0;
  transform-origin: left center;
  transform: scaleX(0);
  border-radius: 999px;
  background: #17141a;
}

.es.is-error .es__track {
  animation: esShake 600ms ease-out 1;
}

.es__bar {
  display: flex;
  justify-content: flex-end;
}

.es__meta {
  font-weight: 500;
  font-size: 10px;
  color: rgba(23, 20, 26, 0.6);
}

@keyframes esShake {
  0%, 100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-6px);
  }
  40% {
    transform: translateX(5px);
  }
  60% {
    transform: translateX(-3px);
  }
  80% {
    transform: translateX(2px);
  }
}
@keyframes esFillLoop {
  0% {
    transform: scaleX(0);
  }
  30% {
    transform: scaleX(0.58);
  }
  46% {
    transform: scaleX(0.58);
  }
  74% {
    transform: scaleX(1);
  }
  86% {
    transform: scaleX(1);
  }
  92%, 100% {
    transform: scaleX(0);
  }
}
@keyframes esTrackShake {
  0%, 30% {
    transform: translateX(0);
  }
  34% {
    transform: translateX(-6px);
  }
  38% {
    transform: translateX(5px);
  }
  41% {
    transform: translateX(-3px);
  }
  44%, 100% {
    transform: translateX(0);
  }
}
@keyframes esWarnLoop {
  0%, 31% {
    opacity: 0;
    transform: scale(0.6);
  }
  36% {
    opacity: 1;
    transform: scale(1);
    animation-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  46% {
    opacity: 1;
    transform: scale(1);
  }
  50%, 100% {
    opacity: 0;
    transform: scale(0.6);
  }
}
@keyframes esLabelSwap {
  0%, 30% {
    opacity: 1;
  }
  31%, 49% {
    opacity: 0;
  }
  50%, 100% {
    opacity: 1;
  }
}
@keyframes esLabelErrSwap {
  0%, 30% {
    opacity: 0;
  }
  31%, 49% {
    opacity: 1;
  }
  50%, 100% {
    opacity: 0;
  }
}
.is-demo .es__fill {
  animation: esFillLoop 2s ease-out infinite;
}

.is-demo .es__track {
  animation: esTrackShake 2s linear infinite;
}

.is-demo .es__warn, .is-demo .es__retry {
  animation: esWarnLoop 2s linear infinite;
}

.is-demo .es__label-run {
  animation: esLabelSwap 2s linear infinite;
}

.is-demo .es__label-err {
  animation: esLabelErrSwap 2s linear infinite;
  color: #c2361a;
}

@media (max-width: 340px) {
  .es__retry {
    width: 20px;
    height: 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .is-demo .es__fill, .is-demo .es__track, .is-demo .es__warn, .is-demo .es__retry,
  .is-demo .es__label-run, .is-demo .es__label-err {
    animation: none !important;
  }
  .is-demo .es__fill {
    transform: scaleX(0.58) !important;
  }
}
