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

.of {
  box-sizing: border-box;
  display: grid;
  gap: 8px;
  width: min(300px, 92vw);
  color: #fff7e6;
}

.of * {
  box-sizing: border-box;
}

.of__bar {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff7e6;
  color: #17141a;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
  transition: background-color 220ms cubic-bezier(0.2, 0.8, 0.2, 1), color 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.of.is-off .of__bar {
  background: #c2361a;
  color: #fff7e6;
}

.of.is-back .of__bar {
  background: #4cd4a6;
  color: #17141a;
}

.of__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.of__ic {
  display: inline-grid;
  font-size: 18px;
  line-height: 1;
}

.of__ic-on,
.of__ic-off {
  grid-area: 1/1;
  display: inline-flex;
}

.of__ic-off {
  opacity: 0;
}

.of.is-off .of__ic-on {
  opacity: 0;
}

.of.is-off .of__ic-off {
  opacity: 1;
}

.of__msg {
  display: inline-grid;
}

.of__m {
  grid-area: 1/1;
  justify-self: start;
  white-space: nowrap;
}

.of__m--off,
.of__m--back {
  opacity: 0;
}

.of.is-off .of__m--on {
  opacity: 0;
}

.of.is-off .of__m--off {
  opacity: 1;
}

.of.is-back .of__m--on {
  opacity: 0;
}

.of.is-back .of__m--back {
  opacity: 1;
}

.of__side {
  display: inline-grid;
}

.of__pill {
  grid-area: 1/1;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(23, 20, 26, 0.16);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.of__pill--wait {
  opacity: 0;
}

.of.is-off .of__pill--wait {
  opacity: 1;
}

.of.is-off .of__pill--ok {
  opacity: 0;
}

.of__num {
  display: inline-grid;
}

.of__n {
  grid-area: 1/1;
  justify-self: center;
  opacity: 0;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.of__n.is-now {
  opacity: 1;
}

.of__track {
  display: grid;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
}

.of__rail,
.of__fill {
  grid-area: 1/1;
  width: 100%;
  height: 100%;
  border-radius: 999px;
}

.of__rail {
  background: rgba(255, 247, 230, 0.18);
}

.of__fill {
  background: #c2361a;
  transform: scaleX(1);
  transform-origin: left center;
  opacity: 0;
  transition: transform 1s linear, opacity 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.of.is-off .of__fill {
  opacity: 1;
}

.of__btn {
  justify-self: start;
  margin: 0;
  padding: 4px 12px;
  border: 1px solid rgba(255, 247, 230, 0.18);
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 247, 230, 0.62);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
}

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

@keyframes of-bar {
  0% {
    background-color: #fff7e6;
    color: #17141a;
  }
  18% {
    background-color: #c2361a;
    color: #fff7e6;
  }
  72% {
    background-color: #4cd4a6;
    color: #17141a;
  }
  88%, 100% {
    background-color: #fff7e6;
    color: #17141a;
  }
}
@keyframes of-m-on {
  0% {
    opacity: 1;
  }
  18% {
    opacity: 0;
  }
  88%, 100% {
    opacity: 1;
  }
}
@keyframes of-m-off {
  0% {
    opacity: 0;
  }
  18% {
    opacity: 1;
  }
  72%, 100% {
    opacity: 0;
  }
}
@keyframes of-m-back {
  0% {
    opacity: 0;
  }
  72% {
    opacity: 1;
  }
  88%, 100% {
    opacity: 0;
  }
}
@keyframes of-ic-on {
  0% {
    opacity: 1;
  }
  18% {
    opacity: 0;
  }
  72%, 100% {
    opacity: 1;
  }
}
@keyframes of-ic-off {
  0% {
    opacity: 0;
  }
  18% {
    opacity: 1;
  }
  72%, 100% {
    opacity: 0;
  }
}
@keyframes of-pill-wait {
  0% {
    opacity: 0;
  }
  18% {
    opacity: 1;
  }
  72%, 100% {
    opacity: 0;
  }
}
@keyframes of-pill-ok {
  0% {
    opacity: 1;
  }
  18% {
    opacity: 0;
  }
  72%, 100% {
    opacity: 1;
  }
}
@keyframes of-n-3 {
  0% {
    opacity: 0;
  }
  18% {
    opacity: 1;
  }
  40%, 100% {
    opacity: 0;
  }
}
@keyframes of-n-2 {
  0% {
    opacity: 0;
  }
  40% {
    opacity: 1;
  }
  56%, 100% {
    opacity: 0;
  }
}
@keyframes of-n-1 {
  0% {
    opacity: 0;
  }
  56% {
    opacity: 1;
  }
  72%, 100% {
    opacity: 0;
  }
}
@keyframes of-fill {
  0%, 17.99% {
    transform: scaleX(1);
    opacity: 0;
  }
  18% {
    transform: scaleX(1);
    opacity: 1;
  }
  72% {
    transform: scaleX(0);
    opacity: 1;
  }
  72.01%, 100% {
    transform: scaleX(1);
    opacity: 0;
  }
}
@keyframes of-dot {
  0%, 100% {
    transform: translateY(0);
  }
  25% {
    transform: translateY(-3px);
  }
  50% {
    transform: translateY(0);
  }
  75% {
    transform: translateY(3px);
  }
}
.of.is-demo .of__bar {
  animation-name: of-bar;
}
.of.is-demo .of__m--on {
  animation-name: of-m-on;
}
.of.is-demo .of__m--off {
  animation-name: of-m-off;
}
.of.is-demo .of__m--back {
  animation-name: of-m-back;
}
.of.is-demo .of__ic-on {
  animation-name: of-ic-on;
}
.of.is-demo .of__ic-off {
  animation-name: of-ic-off;
}
.of.is-demo .of__pill--wait {
  animation-name: of-pill-wait;
}
.of.is-demo .of__pill--ok {
  animation-name: of-pill-ok;
}
.of.is-demo .of__n[data-sec="3"] {
  animation-name: of-n-3;
}
.of.is-demo .of__n[data-sec="2"] {
  animation-name: of-n-2;
}
.of.is-demo .of__n[data-sec="1"] {
  animation-name: of-n-1;
}
.of.is-demo .of__bar,
.of.is-demo .of__m--on,
.of.is-demo .of__m--off,
.of.is-demo .of__m--back,
.of.is-demo .of__ic-on,
.of.is-demo .of__ic-off,
.of.is-demo .of__pill,
.of.is-demo .of__n {
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}
.of.is-demo .of__fill {
  animation-name: of-fill;
  animation-duration: 2s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}
.of.is-demo .of__dot {
  animation-name: of-dot;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

@media (max-width: 340px) {
  .of {
    gap: 4px;
    width: min(292px, 96vw);
  }
  .of__bar {
    gap: 4px;
    padding: 4px 8px;
    font-size: 10px;
  }
  .of__ic {
    font-size: 14px;
  }
  .of__dot {
    width: 6px;
    height: 6px;
  }
  .of__pill {
    padding: 0 4px;
    font-size: 9px;
  }
  .of__n {
    font-size: 11px;
  }
  .of__btn {
    padding: 0 8px;
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .of.is-demo .of__bar,
  .of.is-demo .of__m--on,
  .of.is-demo .of__m--off,
  .of.is-demo .of__m--back,
  .of.is-demo .of__ic-on,
  .of.is-demo .of__ic-off,
  .of.is-demo .of__pill,
  .of.is-demo .of__n,
  .of.is-demo .of__fill,
  .of.is-demo .of__dot {
    animation: none !important;
    transition: none !important;
  }
  .of.is-demo .of__bar {
    background-color: #c2361a !important;
    color: #fff7e6 !important;
  }
  .of.is-demo .of__m--on {
    opacity: 0 !important;
  }
  .of.is-demo .of__m--off {
    opacity: 1 !important;
  }
  .of.is-demo .of__ic-on {
    opacity: 0 !important;
  }
  .of.is-demo .of__ic-off {
    opacity: 1 !important;
  }
  .of.is-demo .of__pill--wait {
    opacity: 1 !important;
  }
  .of.is-demo .of__pill--ok {
    opacity: 0 !important;
  }
  .of.is-demo .of__n[data-sec="3"] {
    opacity: 1 !important;
  }
  .of.is-demo .of__fill {
    transform: scaleX(1) !important;
    opacity: 1 !important;
  }
  .of.is-demo .of__dot {
    transform: none !important;
  }
}
