* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100vh;
  width: 100vw;
  font-family: 'Open Sans', sans-serif;
  overflow-x: hidden;
}

body {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: backgroundShift 10s ease-in-out infinite alternate;
}

@keyframes backgroundShift {
  0% { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
  100% { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
}

.container {
  perspective: 1000px;
  width: 100%;
  max-width: 450px;
  margin: 0 auto;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(50px); }
  to { opacity: 1; transform: translateY(0); }
}

.birthday-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  padding: 25px;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
  text-align: center;
  width: 100%;
  backdrop-filter: blur(10px);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: cardFloat 4s ease-in-out infinite;
  opacity: 0;
  transform: scale(0);
  pointer-events: none;
}

@keyframes cardFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.birthday-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

.main-title {
  font-family: 'Pacifico', cursive;
  font-size: 2.5rem;
  color: #e74c3c;
  margin-bottom: 15px;
  animation: titleBounce 1s ease-out 0.5s both;
  text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.1);
}

@keyframes titleBounce {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.1); opacity: 0.8; }
  100% { transform: scale(1); opacity: 1; }
}

.balloons {
  margin: 20px 0;
  height: 60px;
  position: relative;
}

.balloon {
  font-size: 2rem;
  display: inline-block;
  margin: 0 8px;
  animation: balloonFloat 3s ease-in-out infinite;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.balloon:hover {
  transform: scale(1.2);
}

@keyframes balloonFloat {
  0%, 100% { transform: translateY(0px) rotate(-2deg); }
  25% { transform: translateY(-15px) rotate(2deg); }
  50% { transform: translateY(-25px) rotate(-1deg); }
  75% { transform: translateY(-10px) rotate(1deg); }
}

.balloon-1 { animation-delay: 0s; }
.balloon-2 { animation-delay: 0.5s; }
.balloon-3 { animation-delay: 1s; }
.balloon-4 { animation-delay: 1.5s; }
.balloon-5 { animation-delay: 2s; }

.wish-text {
  font-size: 1rem;
  color: #2c3e50;
  line-height: 1.5;
  margin: 20px 0;
  animation: textSlide 1.5s ease-out 1.5s both;
  font-weight: 400;
}

@keyframes textSlide {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

.cake {
  font-size: 2.5rem;
  margin: 20px 0;
  animation: cakeBounce 2s ease-in-out 2s both, cakeGlow 2s ease-in-out infinite 4s;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.cake:hover {
  transform: scale(1.1);
}

@keyframes cakeBounce {
  0% { opacity: 0; transform: translateY(50px) rotate(0deg); }
  60% { opacity: 1; transform: translateY(-20px) rotate(5deg); }
  80% { transform: translateY(-10px) rotate(-5deg); }
  100% { opacity: 1; transform: translateY(0px) rotate(0deg); }
}

@keyframes cakeGlow {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.6)); }
  50% { filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.9)); }
}

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

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #f9ca24);
  animation: confettiFall 3s linear infinite;
}

@keyframes confettiFall {
  0% {
    transform: translateY(-100vh) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0;
  }
}

.confetti-piece:nth-child(1) { left: 10%; animation-delay: 0s; background: #ff6b6b; }
.confetti-piece:nth-child(2) { left: 20%; animation-delay: 0.5s; background: #4ecdc4; }
.confetti-piece:nth-child(3) { left: 30%; animation-delay: 1s; background: #45b7d1; }
.confetti-piece:nth-child(4) { left: 40%; animation-delay: 1.5s; background: #f9ca24; }
.confetti-piece:nth-child(5) { left: 50%; animation-delay: 2s; background: #ff9ff3; }
.confetti-piece:nth-child(6) { left: 60%; animation-delay: 2.5s; background: #54a0ff; }
.confetti-piece:nth-child(7) { left: 70%; animation-delay: 3s; background: #5f27cd; }
.confetti-piece:nth-child(8) { left: 80%; animation-delay: 3.5s; background: #00d2d3; }

/* Memories Section Styling */
.memories-section {
  margin: 25px 0;
  animation: memoriesSlideIn 2s ease-out 2.5s both;
}

.memories-title {
  font-family: 'Pacifico', cursive;
  font-size: 1.3rem;
  color: #8e44ad;
  margin-bottom: 15px;
  animation: titleGlow 2s ease-in-out infinite;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

@keyframes titleGlow {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(142, 68, 173, 0.6)); }
  50% { filter: drop-shadow(0 0 16px rgba(142, 68, 173, 0.9)); }
}

.memory-frame {
  position: relative;
  display: inline-block;
  background: linear-gradient(145deg, #ffffff, #f5f5f5);
  padding: 10px;
  border-radius: 15px;
  box-shadow: 
    0 8px 20px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1);
  animation: frameFloat 4s ease-in-out infinite;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.memory-frame:hover {
  transform: scale(1.05);
  box-shadow: 
    0 12px 25px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(0, 0, 0, 0.15);
}

@keyframes frameFloat {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  25% { transform: translateY(-5px) rotate(1deg); }
  50% { transform: translateY(-8px) rotate(0deg); }
  75% { transform: translateY(-3px) rotate(-1deg); }
}

.memory-photo {
  max-width: 200px;
  max-height: 150px;
  width: 100%;
  height: auto;
  border-radius: 10px;
  object-fit: cover;
  animation: photoReveal 1.5s ease-out 3s both;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  transition: filter 0.3s ease;
}

.memory-photo:hover {
  filter: brightness(1.1) contrast(1.05);
}

@keyframes photoReveal {
  0% {
    opacity: 0;
    transform: scale(0.8) rotate(-5deg);
    filter: blur(5px);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    filter: blur(0px);
  }
}

.memory-caption {
  margin-top: 8px;
  font-size: 0.9rem;
  color: #34495e;
  font-style: italic;
  animation: captionFadeIn 1s ease-out 3.5s both;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

@keyframes captionFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.memory-hearts {
  position: absolute;
  top: -8px;
  right: -8px;
  animation: heartsAppear 1s ease-out 4s both;
}

.heart {
  font-size: 1.2rem;
  display: inline-block;
  animation: heartBeat 2s ease-in-out infinite;
  margin: 0 1px;
}

@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.2); }
  28% { transform: scale(1); }
  42% { transform: scale(1.2); }
  56% { transform: scale(1); }
}

@keyframes heartsAppear {
  0% {
    opacity: 0;
    transform: scale(0) rotate(-180deg);
  }
  50% {
    opacity: 1;
    transform: scale(1.3) rotate(0deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

.heart-1 { animation-delay: 0s; }
.heart-2 { animation-delay: 0.3s; }
.heart-3 { animation-delay: 0.6s; }

@keyframes memoriesSlideIn {
  0% {
    opacity: 0;
    transform: translateX(-50px) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

/* Name styling for KHUSHI PRIYA */
.name-title {
  font-family: 'Pacifico', cursive;
  font-size: 1.8rem;
  background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #f9ca24);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px;
  animation: nameGlow 2s ease-in-out infinite, gradientShift 3s ease-in-out infinite;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
  letter-spacing: 2px;
}

@keyframes nameGlow {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8)); }
  50% { filter: drop-shadow(0 0 20px rgba(255, 215, 0, 1)); }
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Gift Box Styles */
.gift-box-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: giftBoxEntrance 2s ease-out;
}

.gift-box-container.exploded {
  opacity: 0;
  pointer-events: none;
  animation: giftBoxExit 0.8s ease-out;
}

@keyframes giftBoxEntrance {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) translateY(50px) scale(0.5);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) translateY(0) scale(1);
  }
}

@keyframes giftBoxExit {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.5);
  }
}

.gift-box {
  position: relative;
  width: 150px;
  height: 150px;
  cursor: pointer;
  transition: transform 0.3s ease;
  animation: giftFloat 3s ease-in-out infinite;
}

.gift-box:hover {
  transform: scale(1.05);
}

@keyframes giftFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.gift-box-bottom {
  width: 150px;
  height: 105px;
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  border-radius: 8px;
  position: absolute;
  bottom: 0;
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
}

.gift-box-top {
  width: 165px;
  height: 60px;
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  border-radius: 12px 12px 8px 8px;
  position: absolute;
  top: 0;
  left: -7.5px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  animation: lidBounce 2s ease-in-out infinite;
}

@keyframes lidBounce {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-3px); }
}

.gift-ribbon-h {
  width: 22px;
  height: 150px;
  background: linear-gradient(90deg, #f1c40f, #f39c12);
  position: absolute;
  left: 64px;
  top: 0;
  box-shadow: inset -3px 0 8px rgba(0, 0, 0, 0.2);
}

.gift-ribbon-v {
  width: 165px;
  height: 22px;
  background: linear-gradient(180deg, #f1c40f, #f39c12);
  position: absolute;
  left: -7.5px;
  top: 26px;
  box-shadow: inset 0 -3px 8px rgba(0, 0, 0, 0.2);
}

.gift-bow {
  position: absolute;
  top: -8px;
  left: 67px;
  font-size: 3rem;
  animation: bowBounce 2s ease-in-out infinite;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

@keyframes bowBounce {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
}

.gift-sparkles {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.sparkle {
  position: absolute;
  font-size: 1.2rem;
  animation: sparkleMove 2s ease-in-out infinite;
}

@keyframes sparkleMove {
  0%, 100% { transform: scale(0.8) rotate(0deg); opacity: 0.7; }
  50% { transform: scale(1.2) rotate(180deg); opacity: 1; }
}

.sparkle-1 { top: -15px; left: -15px; animation-delay: 0s; }
.sparkle-2 { top: -15px; right: -15px; animation-delay: 0.5s; }
.sparkle-3 { bottom: -8px; left: -15px; animation-delay: 1s; }
.sparkle-4 { bottom: -8px; right: -15px; animation-delay: 1.5s; }

.click-instruction {
  margin-top: 20px;
  font-size: 1rem;
  color: white;
  background: rgba(255, 255, 255, 0.2);
  padding: 12px 20px;
  border-radius: 20px;
  backdrop-filter: blur(10px);
  animation: instructionPulse 2s ease-in-out infinite;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

@keyframes instructionPulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.05); opacity: 1; }
}

/* Birthday card reveal animations */
.birthday-card.revealed {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
  animation: cardReveal 1s ease-out;
}

@keyframes cardReveal {
  0% {
    opacity: 0;
    transform: scale(0) rotate(180deg);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.1) rotate(90deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

/* Explosion effect */
@keyframes explode {
  0% { transform: scale(1) rotate(0deg); opacity: 1; }
  50% { transform: scale(2) rotate(180deg); opacity: 0.5; }
  100% { transform: scale(4) rotate(360deg); opacity: 0; }
}

.gift-box.exploding .gift-box-top {
  animation: topExplode 0.8s ease-out forwards;
}

.gift-box.exploding .gift-box-bottom {
  animation: bottomShake 0.8s ease-out forwards;
}

@keyframes topExplode {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(-200px) rotate(720deg) scale(0.5); opacity: 0; }
}

@keyframes bottomShake {
  0%, 100% { transform: translateX(0); }
  10% { transform: translateX(-10px); }
  20% { transform: translateX(10px); }
  30% { transform: translateX(-10px); }
  40% { transform: translateX(10px); }
  50% { transform: translateX(0); }
}

@media (max-width: 768px) {
  
  .container {
    max-width: 350px;
  }
  
  .birthday-card {
    padding: 20px 15px;
  }
  
  .main-title {
    font-size: 2rem;
  }
  
  .name-title {
    font-size: 1.5rem;
    letter-spacing: 1px;
  }
  
  .balloon {
    font-size: 1.5rem;
    margin: 0 6px;
  }
  
  .wish-text {
    font-size: 0.9rem;
  }
  
  .cake {
    font-size: 2rem;
  }
  
  .memories-title {
    font-size: 1.1rem;
  }
  
  .memory-photo {
    max-width: 180px;
    max-height: 130px;
  }
  
  .memory-frame {
    padding: 8px;
  }
  
  .memory-caption {
    font-size: 0.8rem;
  }
  
  .heart {
    font-size: 1rem;
  }
  
  .gift-box {
    width: 120px;
    height: 120px;
  }
  
  .gift-box-bottom {
    width: 120px;
    height: 84px;
  }
  
  .gift-box-top {
    width: 132px;
    height: 48px;
    left: -6px;
  }
  
  .gift-ribbon-h {
    width: 18px;
    height: 120px;
    left: 51px;
  }
  
  .gift-ribbon-v {
    width: 132px;
    height: 18px;
    left: -6px;
    top: 21px;
  }
  
  .gift-bow {
    top: -6px;
    left: 54px;
    font-size: 2.5rem;
  }
  
  .click-instruction {
    font-size: 0.9rem;
    padding: 10px 16px;
  }
}

@media (max-width: 480px) {
  .container {
    max-width: 300px;
  }
  
  .birthday-card {
    padding: 18px 12px;
  }
  
  .main-title {
    font-size: 1.8rem;
  }
  
  .name-title {
    font-size: 1.3rem;
  }
  
  .balloon {
    font-size: 1.3rem;
    margin: 0 4px;
  }
  
  .memories-section {
    margin: 15px 0;
  }
  
  .memory-photo {
    max-width: 160px;
    max-height: 120px;
  }
}