/* Bubble container fix */
.bubbles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
}

.section.patterned .container {
  position: relative;
  z-index: 1;
}

/* Base bubble style */
.bubbles span {
  position: absolute;
  bottom: -150px;
  display: block;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  animation: rise linear infinite;
  opacity: 0.6;
}

/* Keyframes for rising bubbles */
@keyframes rise {
  0% {
    transform: translateY(0) scale(1);
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translateY(-120vh) scale(1.2);
    opacity: 0;
  }
}

/* Assign randomized sizes, speeds, and positions (40 bubbles) */
.bubbles span:nth-child(1) {
  left: 5%;
  width: 12px;
  height: 12px;
  animation-duration: 10s;
}
.bubbles span:nth-child(2) {
  left: 10%;
  width: 18px;
  height: 18px;
  animation-duration: 14s;
}
.bubbles span:nth-child(3) {
  left: 15%;
  width: 25px;
  height: 25px;
  animation-duration: 18s;
}
.bubbles span:nth-child(4) {
  left: 20%;
  width: 10px;
  height: 10px;
  animation-duration: 12s;
}
.bubbles span:nth-child(5) {
  left: 25%;
  width: 30px;
  height: 30px;
  animation-duration: 22s;
}
.bubbles span:nth-child(6) {
  left: 30%;
  width: 16px;
  height: 16px;
  animation-duration: 15s;
}
.bubbles span:nth-child(7) {
  left: 35%;
  width: 22px;
  height: 22px;
  animation-duration: 17s;
}
.bubbles span:nth-child(8) {
  left: 40%;
  width: 28px;
  height: 28px;
  animation-duration: 20s;
}
.bubbles span:nth-child(9) {
  left: 45%;
  width: 14px;
  height: 14px;
  animation-duration: 13s;
}
.bubbles span:nth-child(10) {
  left: 50%;
  width: 26px;
  height: 26px;
  animation-duration: 21s;
}
.bubbles span:nth-child(11) {
  left: 55%;
  width: 18px;
  height: 18px;
  animation-duration: 16s;
}
.bubbles span:nth-child(12) {
  left: 60%;
  width: 20px;
  height: 20px;
  animation-duration: 19s;
}
.bubbles span:nth-child(13) {
  left: 65%;
  width: 12px;
  height: 12px;
  animation-duration: 11s;
}
.bubbles span:nth-child(14) {
  left: 70%;
  width: 28px;
  height: 28px;
  animation-duration: 23s;
}
.bubbles span:nth-child(15) {
  left: 75%;
  width: 15px;
  height: 15px;
  animation-duration: 12s;
}
.bubbles span:nth-child(16) {
  left: 80%;
  width: 32px;
  height: 32px;
  animation-duration: 25s;
}
.bubbles span:nth-child(17) {
  left: 85%;
  width: 18px;
  height: 18px;
  animation-duration: 15s;
}
.bubbles span:nth-child(18) {
  left: 90%;
  width: 24px;
  height: 24px;
  animation-duration: 20s;
}
.bubbles span:nth-child(19) {
  left: 95%;
  width: 10px;
  height: 10px;
  animation-duration: 13s;
}
.bubbles span:nth-child(20) {
  left: 8%;
  width: 20px;
  height: 20px;
  animation-duration: 18s;
}
.bubbles span:nth-child(21) {
  left: 12%;
  width: 22px;
  height: 22px;
  animation-duration: 19s;
}
.bubbles span:nth-child(22) {
  left: 18%;
  width: 14px;
  height: 14px;
  animation-duration: 14s;
}
.bubbles span:nth-child(23) {
  left: 28%;
  width: 16px;
  height: 16px;
  animation-duration: 17s;
}
.bubbles span:nth-child(24) {
  left: 38%;
  width: 12px;
  height: 12px;
  animation-duration: 12s;
}
.bubbles span:nth-child(25) {
  left: 48%;
  width: 28px;
  height: 28px;
  animation-duration: 24s;
}
.bubbles span:nth-child(26) {
  left: 58%;
  width: 18px;
  height: 18px;
  animation-duration: 15s;
}
.bubbles span:nth-child(27) {
  left: 68%;
  width: 20px;
  height: 20px;
  animation-duration: 19s;
}
.bubbles span:nth-child(28) {
  left: 78%;
  width: 30px;
  height: 30px;
  animation-duration: 22s;
}
.bubbles span:nth-child(29) {
  left: 88%;
  width: 14px;
  height: 14px;
  animation-duration: 13s;
}
.bubbles span:nth-child(30) {
  left: 98%;
  width: 26px;
  height: 26px;
  animation-duration: 20s;
}
.bubbles span:nth-child(31) {
  left: 6%;
  width: 22px;
  height: 22px;
  animation-duration: 17s;
}
.bubbles span:nth-child(32) {
  left: 16%;
  width: 18px;
  height: 18px;
  animation-duration: 14s;
}
.bubbles span:nth-child(33) {
  left: 26%;
  width: 28px;
  height: 28px;
  animation-duration: 21s;
}
.bubbles span:nth-child(34) {
  left: 36%;
  width: 12px;
  height: 12px;
  animation-duration: 12s;
}
.bubbles span:nth-child(35) {
  left: 46%;
  width: 20px;
  height: 20px;
  animation-duration: 18s;
}
.bubbles span:nth-child(36) {
  left: 56%;
  width: 24px;
  height: 24px;
  animation-duration: 19s;
}
.bubbles span:nth-child(37) {
  left: 66%;
  width: 16px;
  height: 16px;
  animation-duration: 15s;
}
.bubbles span:nth-child(38) {
  left: 76%;
  width: 22px;
  height: 22px;
  animation-duration: 17s;
}
.bubbles span:nth-child(39) {
  left: 86%;
  width: 30px;
  height: 30px;
  animation-duration: 23s;
}
.bubbles span:nth-child(40) {
  left: 96%;
  width: 14px;
  height: 14px;
  animation-duration: 14s;
}

.confetti {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.confetti span {
  position: absolute;
  top: -20px;
  width: 8px;
  height: 14px;
  background: red;
  opacity: 0.9;
  border-radius: 2px;
  animation: fall linear infinite;
}

/* Falling animation */
@keyframes fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(110vh) rotate(360deg);
    opacity: 0.7;
  }
}

/* Different colors, positions, and speeds */
.confetti span:nth-child(1) {
  left: 5%;
  background: #ff4d4d;
  animation-duration: 6s;
}
.confetti span:nth-child(2) {
  left: 15%;
  background: #ffd11a;
  animation-duration: 8s;
}
.confetti span:nth-child(3) {
  left: 25%;
  background: #33cc33;
  animation-duration: 7s;
}
.confetti span:nth-child(4) {
  left: 35%;
  background: #3399ff;
  animation-duration: 9s;
}
.confetti span:nth-child(5) {
  left: 45%;
  background: #ff66cc;
  animation-duration: 6.5s;
}
.confetti span:nth-child(6) {
  left: 55%;
  background: #ff9933;
  animation-duration: 8.5s;
}
.confetti span:nth-child(7) {
  left: 65%;
  background: #66ffff;
  animation-duration: 7.5s;
}
.confetti span:nth-child(8) {
  left: 75%;
  background: #cc66ff;
  animation-duration: 10s;
}
.confetti span:nth-child(9) {
  left: 85%;
  background: #99ff33;
  animation-duration: 9s;
}
.confetti span:nth-child(10) {
  left: 95%;
  background: #ff3300;
  animation-duration: 8s;
}
