.bubbles {
  width: 100%;
  height: 100%;
  position: absolute;
  z-index: 0;
  overflow: hidden;
  top: 0;
  left: 0;
}
.bubble {
  position: absolute;
  bottom: -100px;
  background-color: #f1f1f1;
  border-radius: 50%;
  opacity: 0.5;
  animation: fly 15s ease-in-out infinite;
  z-index: 0;
}

.bubble:nth-child(1) {
  left: 1%;
  height: 40px;
  width: 40px;
  animation-duration: 8s;
}
.bubble:nth-child(2) {
  left: 10%;
  height: 20px;
  width: 20px;
  animation-duration: 10s;
  animation-delay: 1s;
}
.bubble:nth-child(3) {
  left: 15%;
  height: 30px;
  width: 30px;
  animation-duration: 6s;
  animation-delay: 2s;
}
.bubble:nth-child(4) {
  left: 30%;
  height: 60px;
  width: 60px;
  animation-duration: 12s;
  animation-delay: 5s;
}
.bubble:nth-child(5) {
  left: 40%;
  height: 30px;
  width: 30px;
  animation-duration: 9s;
  animation-delay: 0;
}
.bubble:nth-child(6) {
  left: 50%;
  height: 15px;
  width: 15px;
  animation-duration: 13s;
  animation-delay: 8s;
}
.bubble:nth-child(7) {
  left: 55%;
  height: 60px;
  width: 60px;
  animation-duration: 10s;
  animation-delay: 0;
}
.bubble:nth-child(8) {
  left: 60%;
  height: 10px;
  width: 10px;
  animation-duration: 14s;
  animation-delay: 5s;
}
.bubble:nth-child(9) {
  left: 65%;
  height: 20px;
  width: 20px;
  animation-duration: 10s;
  animation-delay: 3s;
}
.bubble:nth-child(10) {
  left: 70%;
  height: 55px;
  width: 55px;
  animation-duration: 7s;
  animation-delay: 11s;
}
.bubble:nth-child(11) {
  left: 80%;
  height: 33px;
  width: 33px;
  animation-duration: 4s;
  animation-delay: 15s;
}
.bubble:nth-child(12) {
  left: 90%;
  height: 24px;
  width: 24px;
  animation-duration: 8s;
  animation-delay: 5s;
}
.bubble:nth-child(13) {
  left: 95%;
  height: 20px;
  width: 20px;
  animation-duration: 9s;
  animation-delay: 4s;
}
.bubble:nth-child(14) {
  left: 25%;
  height: 28px;
  width: 28px;
  animation-duration: 17s;
  animation-delay: 0s;
}
.bubble:nth-child(15) {
  left: 20%;
  height: 20px;
  width: 20px;
  animation-duration: 14s;
  animation-delay: 1s;
}

.front {
  z-index: 9;
}

.f {
  animation: fly 15s ease-in-out infinite;
  animation: ftop 15s ease-in-out infinite;
  -webkit-animation: ftop 15s ease-in-out infinite;
}

.f:nth-child(1) {
  left: 5%;
  top: 10%;
  height: 40px;
  width: 40px;
  animation-duration: 8s;
}
.f:nth-child(2) {
  left: 35%;
  top: 20%;
  height: 20px;
  width: 20px;
  animation-duration: 10s;
  animation-delay: 1s;
}
.f:nth-child(3) {
  left: 20%;
  top: 15%;
  height: 30px;
  width: 30px;
  animation-duration: 6s;
  animation-delay: 2s;
}
.f:nth-child(4) {
  left: 50%;
  top: 25%;
  height: 60px;
  width: 60px;
  animation-duration: 12s;
  animation-delay: 5s;
}
.f:nth-child(5) {
  left: 70%;
  top: 30%;
  height: 30px;
  width: 30px;
  animation-duration: 9s;
  animation-delay: 0;
}
.f:nth-child(6) {
  left: 15%;
  top: 5%;
  height: 15px;
  width: 15px;
  animation-duration: 13s;
  animation-delay: 8s;
}
.f:nth-child(7) {
  left: 80%;
  top: 35%;
  height: 60px;
  width: 60px;
  animation-duration: 10s;
  animation-delay: 0;
}
.f:nth-child(8) {
  left: 25%;
  top: 40%;
  height: 10px;
  width: 10px;
  animation-duration: 14s;
  animation-delay: 5s;
}
.f:nth-child(9) {
  left: 90%;
  top: 50%;
  height: 20px;
  width: 20px;
  animation-duration: 10s;
  animation-delay: 3s;
}
.f:nth-child(10) {
  left: 45%;
  top: 60%;
  height: 55px;
  width: 55px;
  animation-duration: 7s;
  animation-delay: 11s;
}
.f:nth-child(11) {
  left: 60%;
  top: 70%;
  height: 33px;
  width: 33px;
  animation-duration: 4s;
  animation-delay: 15s;
}
.f:nth-child(12) {
  left: 75%;
  top: 80%;
  height: 24px;
  width: 24px;
  animation-duration: 8s;
  animation-delay: 5s;
}
.f:nth-child(13) {
  left: 30%;
  top: 90%;
  height: 20px;
  width: 20px;
  animation-duration: 9s;
  animation-delay: 4s;
}
.f:nth-child(14) {
  left: 10%;
  top: 95%;
  height: 28px;
  width: 28px;
  animation-duration: 17s;
  animation-delay: 0s;
}
.f:nth-child(15) {
  left: 55%;
  top: 85%;
  height: 20px;
  width: 20px;
  animation-duration: 14s;
}

@keyframes fly {
  0% {
    bottom: -200px;
    transform: translateX(0);
  }
  50% {
    transform: translateX(100px);
  }

  100% {
    bottom: 1080px;
    transform: translateX(-200px);
  }
}

@keyframes ftop {
    0% {
      top: 1080px; /* Start below the viewport */
      transform: translateX(0);
    }
    50% {
      transform: translateX(100px);
    }
    100% {
      top: -200px; /* Move above the viewport */
      transform: translateX(-200px);
    }
}
