body {
  font-family: Arial, sans-serif;
  text-align: center;
  background-color: #f9f3e3;
  margin: 0;
  padding: 0;
}

.container {
  margin-top: 50px;
}

.cake {
  position: relative;
  width: 400px; /* Increase the width */
  height: 250px; /* Increase the height */
  background-color: #ffb0fb;
  border-radius: 20px;
  margin: 0 auto;
}

.candles {
  position: absolute;
  top: -70px; /* Adjust positioning */
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: space-around;
  width: 200px; /* Increase the spacing */
}

.candle {
  position: relative;
  width: 20px; /* Increase candle size */
  height: 80px; /* Increase candle height */
  background-color: #ffb6b9;
  border-radius: 10px;
}

.flame {
  position: absolute;
  top: -40px; /* Adjust for larger size */
  left: 50%;
  transform: translateX(-50%);
  width: 25px; /* Increase flame size */
  height: 50px; /* Increase flame height */
  background: radial-gradient(circle at 50% 25%, rgba(255, 213, 79, 1) 25%, rgba(255, 85, 0, 0.9) 50%, rgba(255, 0, 0, 0.6) 75%);
  border-radius: 40% 40% 35% 35%; /* Make flame more irregular */
  animation: flicker 0.2s infinite alternate ease-in-out, rise 3s infinite;
  filter: blur(1px); /* Add a slight blur for softness */
}

.cake-body {
  width: 100%;
  height: 150px;
  background-color: #9affbd;
  border-radius: 10px;
}

@keyframes flicker {
  0% {
    transform: translateX(-50%) scale(1.05) rotate(0deg);
    filter: brightness(1.2);
  }
  25% {
    transform: translateX(-50%) scale(0.95) rotate(-2deg);
    filter: brightness(1);
  }
  50% {
    transform: translateX(-50%) scale(1.1) rotate(1deg);
    filter: brightness(1.3);
  }
  75% {
    transform: translateX(-50%) scale(0.9) rotate(-1deg);
    filter: brightness(0.9);
  }
  100% {
    transform: translateX(-50%) scale(1.05) rotate(2deg);
    filter: brightness(1.1);
  }
}

@keyframes rise {
  0% {
    top: -40px;
  }
  50% {
    top: -42px;
  }
  100% {
    top: -40px;
  }
}

.blown-out {
  animation: blowOut 0.6s forwards;
}

@keyframes blowOut {
  0% { opacity: 1; }
  50% { opacity: 0.5; transform: scale(0.6); }
  100% { opacity: 0; transform: scale(0); }
}

h1 {
  color: #ff6f61;
  font-size: 3em;
}



#birthday-text {
  margin-top: 50px;
  font-size: 3em;
  color: #eeff00;
  animation: textGlow 2s infinite;
}

.hidden {
  display: none;
}

@keyframes flicker {
  0% {
    transform: translateX(-50%) scale(1.05) rotate(0deg);
  }
  25% {
    transform: translateX(-50%) scale(0.95) rotate(-2deg);
  }
  50% {
    transform: translateX(-50%) scale(1.1) rotate(1deg);
  }
  75% {
    transform: translateX(-50%) scale(0.9) rotate(-1deg);
  }
  100% {
    transform: translateX(-50%) scale(1.05) rotate(2deg);
  }
}

@keyframes rise {
  0% {
    top: -40px;
  }
  50% {
    top: -42px;
  }
  100% {
    top: -40px;
  }
}

/* Balloons */
.balloon-container {
  position: absolute;
  top: 80%;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-around;
  pointer-events: none;
}

.balloon {
  width: 60px;
  height: 80px;
  background-color: #f00;
  border-radius: 50%;
  animation: floatUp 5s infinite ease-in-out;
  position: relative;
  transform: translateY(100vh);
}

@keyframes floatUp {
  0% {
    transform: translateY(100vh);
  }
  100% {
    transform: translateY(-200px);
  }
}

/* Confetti */
#confetti-container {
  position: absolute;
  width: 100%;
  height: 0;
  overflow: hidden;
  z-index: 10;
  pointer-events: none;
}

.confetti {
  width: 10px;
  height: 10px;
  background-color: red;
  position: absolute;
  animation: fall 4s linear infinite;
}

@keyframes fall {
  0% {
    transform: translateY(-100vh);
  }
  100% {
    transform: translateY(100vh);
  }
}

/* Styling the 29 on the cake */
.cake-number {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, 30%);
  font-size: 5em;
  font-weight: bold;
  color: #17e18d; /* Same as the cake border color to match the icing */
  text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2); /* Give some depth to the number */
}

@keyframes textGlow {
  0% {
    text-shadow: 0 0 10px #fff;
  }
  50% {
    text-shadow: 0 0 20px #ffcc66;
  }
  100% {
    text-shadow: 0 0 10px #fff;
  }
}

h1 {
  color: #ff7676;
  font-size: 3em;
}

/* Confetti Color Variations */
.confetti:nth-child(odd) {
  background-color: blue;
}

.confetti:nth-child(even) {
  background-color: yellow;
}

/* Floating the birthday text from bottom to center */
#birthday-text {
  position: absolute;
  bottom: -100px; /* Start off the screen */
  left: 50%;
  transform: translateX(-50%);
  font-size: 2em;
  color: #ff4e4e;
  animation: floatUpToCenter 3s ease-out forwards;
  z-index: 10;
}

@keyframes floatUpToCenter {
  0% {
    bottom: -100px; /* Start below the viewport */
    opacity: 0;
  }
  50% {
    bottom: 50%; /* Float halfway up */
    opacity: 1;
  }
  100% {
    bottom: 50%; /* End at center */
    transform: translate(-50%, 40%); /* Center the text vertically and horizontally */
  }
}

/* Disappear animation for the cake */
@keyframes disappearCake {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.8);
  }
  100% {
    opacity: 0;
    transform: scale(0);
  }
}

.disappearing-cake {
  animation: disappearCake 2s ease-in-out forwards;
}

.hidden {
  display: none;
}

@keyframes textGlow {
  0% {
    text-shadow: 0 0 10px #fff;
  }
  50% {
    text-shadow: 0 0 20px #ffcc66;
  }
  100% {
    text-shadow: 0 0 10px #fff;
  }
}
