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

@property --percent {
  syntax: "<number>";
  inherits: false;
  initial-value: 100;
}
.battery {
  display: flex;
  align-items: center;
}

.battery__cell {
  width: 70px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.4);
  border-radius: 6px;
  padding: 3px;
  box-sizing: border-box;
  overflow: hidden;
}

.battery__nub {
  width: 4px;
  height: 14px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 0 3px 3px 0;
}

.battery__fill {
  --percent: 100;
  height: 100%;
  border-radius: 2px;
  background: #fff7e6;
  transform-origin: left center;
  transform: scaleX(calc(var(--percent) / 100));
  animation: drain 2s linear infinite;
}

@keyframes drain {
  0% {
    --percent: 100;
    background: #fff7e6;
  }
  55% {
    --percent: 35;
    background: #ffd23f;
  }
  100% {
    --percent: 8;
    background: #c2361a;
  }
}
.battery__cell.is-demo {
  animation: pulse 0.6s ease-in-out infinite;
  animation-delay: 1.4s;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}
.cap {
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.75);
  font: 600 clamp(12px, 3.2vw, 14px)/1 -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
}

@media (prefers-reduced-motion: reduce) {
  .battery__fill {
    animation: none;
    --percent: 18;
    background: #c2361a;
  }
  .battery__cell.is-demo {
    animation: none;
  }
}
