* {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    body {
      display: flex;
      align-items: center;
      justify-content: center;
      height: 100vh;
      background-color: #1e1e2f;
    }

    .battery {
      border: 3px solid #555;
      width: 150px;
      height: 70px;
      display: flex;
      padding: 4px;
      border-radius: 8px;
      position: relative;
      background: #111;
    }

    .battery:after {
      content: "";
      position: absolute;
      top: 20px;
      left: 150px;
      width: 8px;
      height: 30px;
      background: #555;
      border-top-right-radius: 4px;
      border-bottom-right-radius: 4px;
    }

    .cell {
      background-color: #4caf50;
      height: 100%;
      opacity: 0;
      flex: 1;
      border-radius: 3px;
    }

    .cell:nth-child(1) {
      animation: charge-1 4s infinite;
    }

    .cell:nth-child(2) {
      margin: 0 4px;
      animation: charge-2 4s infinite;
    }

    .cell:nth-child(3) {
      animation: charge-3 4s infinite;
    }

    .cell:nth-child(4) {
      margin: 0 0 0 4px;
      animation: charge-4 4s infinite;
    }

    .cell:nth-child(5) {
      margin: 0 0 0 4px;
      animation: charge-5 4s infinite;
    }

    .flash {
      color: #ffeb3b;
      position: absolute;
      top: 15px;
      left: 60px;
      font-size: 200%;
      animation: blink 0.8s infinite alternate;
    }

    @keyframes charge-1 {

      20%,
      100% {
        opacity: 1;
      }
    }

    @keyframes charge-2 {

      0%,
      20% {
        opacity: 0;
      }

      40%,
      100% {
        opacity: 1;
      }
    }

    @keyframes charge-3 {

      0%,
      40% {
        opacity: 0;
      }

      60%,
      100% {
        opacity: 1;
      }
    }

    @keyframes charge-4 {

      0%,
      60% {
        opacity: 0;
      }

      80%,
      100% {
        opacity: 1;
      }
    }

    @keyframes charge-5 {

      0%,
      80% {
        opacity: 0;
      }

      100% {
        opacity: 1;
      }
    }

    @keyframes blink {
      from {
        opacity: 0;
      }

      to {
        opacity: 1;
      }
    }