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

body {
  overflow: hidden;
  font-family: 'Playfair Display', serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

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

canvas {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

/* Birthday Overlay */
.birthday-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  backdrop-filter: blur(3px);
}

.birthday-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 30px;
  padding: 3rem 2.5rem;
  max-width: 600px;
  width: 100%;
  text-align: center;
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.3),
    0 0 100px rgba(255, 255, 255, 0.2);
  animation: cardEntrance 1s ease-out;
  position: relative;
  overflow: hidden;
}

@keyframes cardEntrance {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(50px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.birthday-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
  100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

/* Cake Animation */
.cake-animation {
  margin-bottom: 2rem;
  animation: bounce 2s ease-in-out infinite;
}

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

.cake {
  position: relative;
  width: 120px;
  height: 100px;
  margin: 0 auto;
  background: linear-gradient(135deg, #ff6b9d 0%, #c06c84 100%);
  border-radius: 10px 10px 0 0;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.cake::before {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 0;
  right: 0;
  height: 20px;
  background: linear-gradient(135deg, #ffa07a 0%, #ff6b9d 100%);
  border-radius: 0 0 10px 10px;
}

.cake::after {
  content: '🎂';
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2rem;
}

.candle {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 30px;
  background: linear-gradient(to bottom, #fff 0%, #f0e68c 100%);
  border-radius: 4px 4px 0 0;
}

.flame {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 15px;
  height: 20px;
  background: radial-gradient(circle, #ffff00 0%, #ff6600 70%, transparent 100%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  animation: flicker 0.3s ease-in-out infinite alternate;
  box-shadow: 0 0 20px #ff6600, 0 0 40px #ff6600;
}

.flame.blown {
  animation: blowOut 0.5s ease-out forwards;
}

@keyframes flicker {
  0% { transform: translateX(-50%) scale(1) translateY(0); }
  100% { transform: translateX(-50%) scale(1.1) translateY(-2px); }
}

@keyframes blowOut {
  0% {
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }
  50% {
    opacity: 0.5;
    transform: translateX(-50%) scale(1.5) translateX(20px);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) scale(0) translateX(40px);
  }
}

/* Typography */
.birthday-title {
  font-family: 'Dancing Script', cursive;
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
  animation: titleGlow 2s ease-in-out infinite;
}

@keyframes titleGlow {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(102, 126, 234, 0.5)); }
  50% { filter: drop-shadow(0 0 20px rgba(118, 75, 162, 0.8)); }
}

.birthday-name {
  font-family: 'Dancing Script', cursive;
  font-size: clamp(2rem, 5vw, 3rem);
  color: #ff6b9d;
  margin-bottom: 1.5rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.birthday-message {
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.8;
  color: #555;
  margin-bottom: 2rem;
  font-style: italic;
}

.birthday-wish {
  margin-bottom: 2rem;
  color: #666;
  font-size: clamp(0.9rem, 1.8vw, 1.1rem);
}

.signature {
  font-family: 'Dancing Script', cursive;
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  color: #764ba2;
  margin-top: 0.5rem;
  font-weight: 700;
}

/* Blow Candle Button */
.blow-candle-btn {
  background: linear-gradient(135deg, #ff6b9d 0%, #c06c84 100%);
  color: white;
  border: none;
  padding: 1rem 2.5rem;
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 5px 20px rgba(255, 107, 157, 0.4);
  transition: all 0.3s ease;
  animation: buttonPulse 2s ease-in-out infinite;
}

@keyframes buttonPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 5px 20px rgba(255, 107, 157, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(255, 107, 157, 0.6);
  }
}

.blow-candle-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 35px rgba(255, 107, 157, 0.7);
  animation: none;
}

.blow-candle-btn:active {
  transform: scale(0.98);
}

.blow-candle-btn.clicked {
  animation: celebrate 0.6s ease-out;
}

@keyframes celebrate {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.2) rotate(5deg); }
  50% { transform: scale(1.2) rotate(-5deg); }
  75% { transform: scale(1.2) rotate(5deg); }
}

/* Floating Balloons */
.floating-elements {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

.balloon {
  position: absolute;
  font-size: 3rem;
  animation: floatUp 8s ease-in infinite;
  opacity: 0.8;
}

.balloon-1 { left: 10%; animation-delay: 0s; }
.balloon-2 { left: 25%; animation-delay: 1.5s; }
.balloon-3 { left: 40%; animation-delay: 3s; }
.balloon-4 { left: 60%; animation-delay: 0.5s; }
.balloon-5 { left: 75%; animation-delay: 2s; }
.balloon-6 { left: 90%; animation-delay: 2.5s; }

@keyframes floatUp {
  0% {
    bottom: -10%;
    transform: translateX(0) rotate(0deg);
    opacity: 0.8;
  }
  50% {
    transform: translateX(20px) rotate(10deg);
  }
  100% {
    bottom: 110%;
    transform: translateX(-20px) rotate(-10deg);
    opacity: 0;
  }
}

/* Confetti Effect */
.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  background: #f0f;
  position: absolute;
  animation: confettiFall 3s linear;
  z-index: 15;
}

@keyframes confettiFall {
  0% {
    top: -10%;
    opacity: 1;
  }
  100% {
    top: 110%;
    opacity: 0;
    transform: rotate(720deg);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .birthday-card {
    padding: 2rem 1.5rem;
    border-radius: 20px;
  }
  
  .cake {
    width: 100px;
    height: 80px;
  }
  
  .cake::after {
    font-size: 1.5rem;
  }
  
  .balloon {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .birthday-overlay {
    padding: 1rem;
  }
  
  .birthday-card {
    padding: 1.5rem 1rem;
  }
  
  .cake {
    width: 80px;
    height: 70px;
  }
  
  .blow-candle-btn {
    padding: 0.8rem 1.8rem;
    font-size: 0.9rem;
  }
}


/* Active Users Counter */
.active-users-badge {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 9999;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(8px);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  color: #555;
  transition: all 0.3s ease;
  border: 1px solid rgba(102, 126, 234, 0.2);
  opacity: 0.7;
}

.active-users-badge:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
}

.users-icon {
  font-size: 0.9rem;
  opacity: 0.8;
}

.users-text {
  color: #555;
  font-size: 0.75rem;
}

#user-count {
  color: #667eea;
  font-weight: 600;
  font-size: 1em;
}

@media (max-width: 768px) {
  .active-users-badge {
    top: 0.6rem;
    left: 0.6rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.6rem;
    border-radius: 12px;
    gap: 0.3rem;
  }
  
  .users-icon {
    font-size: 0.7rem;
  }
  
  .users-text {
    font-size: 0.6rem;
  }
}

@media (max-width: 480px) {
  .active-users-badge {
    top: 0.5rem;
    left: 0.5rem;
    padding: 0.2rem 0.4rem;
    font-size: 0.55rem;
    border-radius: 10px;
    gap: 0.25rem;
  }
  
  .users-icon {
    font-size: 0.65rem;
  }
  
  .users-text {
    font-size: 0.55rem;
  }
}
