body {
  background-color: #333;
  overflow: hidden;
}

/* Birthday Modal Styles */
.modal {
  display: flex;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 40px 60px;
  border-radius: 20px;
  text-align: center;
  animation: modalFadeIn 0.5s ease-in;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.modal-content h1 {
  color: #fff;
  font-size: 48px;
  margin: 0;
  font-family: 'Arial', sans-serif;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  animation: textGlow 1s ease-in-out infinite alternate;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes textGlow {
  from {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  }
  to {
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.8), 2px 2px 4px rgba(0, 0, 0, 0.3);
  }
}

/* Background Images */
#backgroundImages {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.bg-image {
  position: absolute;
  width: 300px;
  height: 300px;
  object-fit: cover;
  border-radius: 10px;
  opacity: 0.8;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Fireworks */
#fireworksContainer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 500;
  pointer-events: none;
}

.firework {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  animation: fireworkExplode 1s ease-out forwards;
}

@keyframes fireworkExplode {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--tx), var(--ty)) scale(0);
  }
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
  body {
    font-size: 14px;
  }

  .modal-content {
    padding: 30px 40px;
  }

  .modal-content h1 {
    font-size: 36px;
  }

  .cake {
    width: 180px;
    height: 150px;
    margin-top: -60px;
    margin-left: -90px;
  }

  .plate {
    width: 200px;
    height: 80px;
    bottom: -5px;
    left: -10px;
  }

  .layer {
    width: 180px;
    height: 75px;
  }

  .icing {
    width: 170px;
    height: 65px;
  }

  .drip {
    width: 40px;
    height: 45px;
  }

  .drip1 {
    width: 30px;
    height: 40px;
  }

  .drip3 {
    width: 60px;
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
  }

  .candle {
    width: 10px;
    height: 28px;
    margin-left: -6px;
  }

  .candle:before {
    width: 10px;
    height: 5px;
  }

  .flame {
    width: 8px;
    height: 20px;
    margin-left: -6px;
    top: -26px;
  }

  .candle-count-display {
    margin-top: 50px;
    font-size: 16px;
    padding: 8px;
  }

  .bg-image {
    width: 100px;
    height: 100px;
  }

  .slideshow-content img {
    max-width: 100%;
    max-height: 70vh;
  }

  .slideshow-counter {
    font-size: 18px;
    margin-top: 10px;
  }
}

@media (max-width: 480px) {
  .modal-content {
    padding: 20px 30px;
  }

  .modal-content h1 {
    font-size: 28px;
  }

  .cake {
    width: 150px;
    height: 120px;
    margin-top: -50px;
    margin-left: -75px;
  }

  .plate {
    width: 170px;
    height: 70px;
    bottom: -3px;
    left: -10px;
  }

  .layer {
    width: 150px;
    height: 60px;
  }

  .icing {
    width: 140px;
    height: 55px;
  }

  .candle {
    width: 8px;
    height: 25px;
    margin-left: -5px;
  }

  .flame {
    width: 6px;
    height: 18px;
    margin-left: -5px;
    top: -23px;
  }

  .candle-count-display {
    margin-top: 30px;
    font-size: 14px;
  }

  .bg-image {
    width: 80px;
    height: 80px;
  }
}

/* Slideshow Modal */
.slideshow-modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  justify-content: center;
  align-items: center;
}

.slideshow-content {
  text-align: center;
  max-width: 90%;
  max-height: 90%;
}

.slideshow-content img {
  max-width: 800px;
  max-height: 600px;
  width: auto;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 10px 50px rgba(255, 255, 255, 0.2);
}

.slideshow-counter {
  color: #fff;
  font-size: 24px;
  margin-top: 20px;
  font-family: 'Arial', sans-serif;
}

.candle-count-display {
  text-align: center;
  margin-top: 150px;
  margin-bottom: 20px;
  font-family: 'Arial', sans-serif;
  font-size: 20px;
  color: #6A4B18;
  background-color: #F0E4D0;
  padding: 10px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  border: 2px solid #553C13;
}

.candle-count-display span {
  font-weight: bold;
  color: #AD030F;
}

.cake {
  position: absolute;
  width: 250px;
  height: 200px;
  top: 50%;
  left: 50%;
  margin-top: -70px;
  margin-left: -125px;
  z-index: 100;
}

.plate {
  width: 270px;
  height: 110px;
  position: absolute;
  bottom: -10px;
  left: -10px;
  background-color: #ccc;
  border-radius: 50%;
  box-shadow: 0 2px 0 #b3b3b3, 0 4px 0 #b3b3b3, 0 5px 40px rgba(0, 0, 0, 0.5);
}

.cake > * {
  position: absolute;
}

.layer {
  position: absolute;
  display: block;
  width: 250px;
  height: 100px;
  border-radius: 50%;
  background-color: #553c13;
  box-shadow: 0 2px 0px #6a4b18, 0 4px 0px #33240b, 0 6px 0px #32230b, 0 8px 0px #31230b, 0 10px 0px #30220b, 0 12px 0px #2f220b, 0 14px 0px #2f210a, 0 16px 0px #2e200a, 0 18px 0px #2d200a, 0 20px 0px #2c1f0a, 0 22px 0px #2b1f0a, 0 24px 0px #2a1e09, 0 26px 0px #2a1d09, 0 28px 0px #291d09, 0 30px 0px #281c09;
}

.layer-top {
  top: 0px;
}

.layer-middle {
  top: 33px;
}

.layer-bottom {
  top: 66px;
}

.icing {
  top: 2px;
  left: 5px;
  background-color: #f0e4d0;
  width: 240px;
  height: 90px;
  border-radius: 50%;
}
.icing:before {
  content: "";
  position: absolute;
  top: 4px;
  right: 5px;
  bottom: 6px;
  left: 5px;
  background-color: #f4ebdc;
  box-shadow: 0 0 4px #f6efe3, 0 0 4px #f6efe3, 0 0 4px #f6efe3;
  border-radius: 50%;
  z-index: 1;
}

.drip {
 display: block;
  width: 50px;
  height: 60px;
  border-bottom-left-radius: 25px;
  border-bottom-right-radius: 25px;
  background-color: #f0e4d0; 
}

.drip1 {
  top: 53px;
  left: 5px;
  transform: skewY(15deg);
  height: 48px;
  width: 40px;
}

.drip2 {
  top: 69px;
  left: 181px;
  transform: skewY(-15deg);
}

.drip3 {
  top: 54px;
  left: 90px;
  width: 80px;
  border-bottom-left-radius: 40px;
  border-bottom-right-radius: 40px;
}

.candle {
  background-color: #7B020B;
  width: 12px;
  height: 35px;
  border-radius: 6px/3px;
  top: -20px;
  left: 50%;
  margin-left: -8px;
  z-index: 10;
}
.candle:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 12px;
  height: 6px;
  border-radius: 50%;
  background-color: #ad030f;
}

.candle.out .flame {
  display: none;
}

.flame {
  position: absolute;
  background-color: orange;
  width: 10px;
  height: 25px;
  border-radius: 8px 8px 8px 8px/20px 20px 8px 8px;
  top: -34px;
  left: 50%;
  margin-left: -7.5px;
  z-index: 10;
  box-shadow: 0 0 10px rgba(255, 165, 0, 0.5), 0 0 20px rgba(255, 165, 0, 0.5), 0 0 60px rgba(255, 165, 0, 0.5), 0 0 80px rgba(255, 165, 0, 0.5);
  transform-origin: 50% 90%;
  animation: flicker 1s ease-in-out alternate infinite;
}

@keyframes flicker {
  0% {
    transform: skewX(5deg);
    box-shadow: 0 0 10px rgba(255, 165, 0, 0.2), 0 0 20px rgba(255, 165, 0, 0.2), 0 0 60px rgba(255, 165, 0, 0.2), 0 0 80px rgba(255, 165, 0, 0.2);
  }
  25% {
    transform: skewX(-5deg);
    box-shadow: 0 0 10px rgba(255, 165, 0, 0.5), 0 0 20px rgba(255, 165, 0, 0.5), 0 0 60px rgba(255, 165, 0, 0.5), 0 0 80px rgba(255, 165, 0, 0.5);
  }
  50% {
    transform: skewX(10deg);
    box-shadow: 0 0 10px rgba(255, 165, 0, 0.3), 0 0 20px rgba(255, 165, 0, 0.3), 0 0 60px rgba(255, 165, 0, 0.3), 0 0 80px rgba(255, 165, 0, 0.3);
  }
  75% {
    transform: skewX(-10deg);
    box-shadow: 0 0 10px rgba(255, 165, 0, 0.4), 0 0 20px rgba(255, 165, 0, 0.4), 0 0 60px rgba(255, 165, 0, 0.4), 0 0 80px rgba(255, 165, 0, 0.4);
  }
  100% {
    transform: skewX(5deg);
    box-shadow: 0 0 10px rgba(255, 165, 0, 0.5), 0 0 20px rgba(255, 165, 0, 0.5), 0 0 60px rgba(255, 165, 0, 0.5), 0 0 80px rgba(255, 165, 0, 0.5);
  }
}