/* Base Styles */
body {
  margin: 0;
  font-family: 'Quicksand', sans-serif;
  background: #fff0f6;
  overflow-x: hidden;
  scroll-behavior: smooth;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
}

h1, h2 {
  font-family: 'Dancing Script', cursive;
  font-weight: 700;
  margin: 0;
}

/* Hero Section */
.hero {
  background: linear-gradient(to right, #8F439B, #F271A0);
  color: white;
  padding: 80px 20px;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 3.2em;
  margin-bottom: 20px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.hero p {
  font-size: 1.2em;
  line-height: 1.6;
  margin-bottom: 15px;
}

.hero button {
  padding: 12px 28px;
  margin: 10px 8px;
  background: white;
  color: #8F439B;
  border: none;
  border-radius: 30px;
  font-weight: bold;
  font-family: 'Quicksand', sans-serif;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.hero button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Cake Photo */
.cake-photo img {
  width: 80%;
  max-width: 300px;
  border-radius: 15px;
  margin: 20px 0;
  box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

/* Gallery */
.gallery {
  padding: 60px 20px;
  text-align: center;
  background: #fff;
  width: 100%;
  box-sizing: border-box;
}

.gallery h2 {
  font-size: 2.4em;
  margin-bottom: 30px;
  color: #8F439B;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 20px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 10px;
}

.grid img,
.grid video {
  width: 100%;
  border-radius: 12px;
  object-fit: cover;
  height: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Messages Section */
.messages {
  padding: 60px 20px;
  background: #fce4ec;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}

.messages h2 {
  font-size: 2.2em;
  color: #8F439B;
  margin-bottom: 30px;
}

.cards {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 600px;
  margin: auto;
  padding: 0 15px;
}

.card {
  background: white;
  padding: 22px;
  border-radius: 16px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
  font-size: 1.1em;
  line-height: 1.6;
  font-family: 'Quicksand', sans-serif;
}

/* Wish Form */
.wish-form {
  background: #fff5fa;
  padding: 60px 20px;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}

.wish-form h2 {
  font-size: 2.2em;
  color: #8F439B;
  margin-bottom: 30px;
}

.wish-form form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 500px;
  margin: auto;
  width: 100%;
}

.wish-form input,
.wish-form textarea {
  padding: 14px;
  border: 1px solid #e0b3c8;
  border-radius: 12px;
  resize: vertical;
  width: 100%;
  font-family: 'Quicksand', sans-serif;
  font-size: 1em;
  box-sizing: border-box;
}

.wish-form textarea {
  min-height: 120px;
}

.wish-form button {
  background: #8F439B;
  color: white;
  padding: 14px;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1.1em;
  font-family: 'Quicksand', sans-serif;
  transition: background 0.3s;
}

.wish-form button:hover {
  background: #7a3a85;
}

/* Footer */
footer {
  background: #8F439B;
  color: white;
  text-align: center;
  padding: 25px 20px;
  font-family: 'Quicksand', sans-serif;
  font-size: 1.1em;
}

/* Floating Heart Animation */
.floating-heart {
  position: fixed;
  bottom: -40px;
  width: 20px;
  height: 20px;
  background: #ff69b4;
  transform: rotate(45deg);
  animation: float 4s linear forwards;
  opacity: 0.8;
  z-index: 1000;
}

.floating-heart::before,
.floating-heart::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: #ff69b4;
  border-radius: 50%;
}

.floating-heart::before {
  top: -10px;
  left: 0;
}

.floating-heart::after {
  top: 0;
  left: -10px;
}

@keyframes float {
  0% {
    bottom: -40px;
    opacity: 0;
  }
  20% {
    opacity: 0.8;
  }
  80% {
    opacity: 0.8;
  }
  100% {
    bottom: 100vh;
    opacity: 0;
  }
}


@keyframes float {
  0% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateY(-100vh) scale(1.8);
    opacity: 0;
  }
}

/* LED Banner */
.led-banner {
  font-family: 'Dancing Script', cursive;
  font-size: 2.4em;
  font-weight: 700;
  text-align: center;
  background: #111;
  color: #ffe0f0;
  padding: 22px 15px;
  box-shadow: 0 0 25px #f271a0;
  overflow: hidden;
  white-space: nowrap;
  width: 100%;
  box-sizing: border-box;
}

/* Age Display */
.age-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 22px;
  margin: 30px auto;
  padding: 0 15px;
  max-width: 100%;
}

.age-box {
  width: 110px;
  height: 110px;
  background: rgba(255, 105, 180, 0.12);
  color: #8F439B;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.1em;
  font-weight: bold;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  font-family: 'Quicksand', sans-serif;
}

/* Photo Gallery */
.photo-gallery {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin: 30px 15px;
  max-width: 100%;
  padding: 0 10px;
}

.photo-gallery img {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.6em;
  }

  .led-banner {
    font-size: 2em;
    white-space: normal;
    padding: 18px 12px;
  }

  .photo-gallery img {
    width: calc(50% - 12px);
    height: auto;
  }

  .age-box {
    width: 90px;
    height: 90px;
    font-size: 0.95em;
  }

  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 50px 15px;
  }

  .hero h1 {
    font-size: 2.2em;
  }

  .hero p {
    font-size: 1.1em;
  }

  .led-banner {
    font-size: 1.7em;
  }

  .photo-gallery img {
    width: 100%;
    max-width: 250px;
  }

  .age-box {
    width: 80px;
    height: 80px;
    font-size: 0.85em;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .hero button {
    display: block;
    width: 90%;
    margin: 12px auto;
  }

  .cake-photo img {
    width: 90%;
  }
}

/* === Sharp-Edged Wooden Frame Gallery === */
.sharp-wooden-frame {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 32px;
  margin: 50px auto;
  padding: 0 15px;
  max-width: 1200px;
}

.sharp-wooden-frame img {
  width: 240px;
  height: 240px;
  object-fit: cover;
  display: block;
  position: relative;
  
  /* Outer wooden frame */
  padding: 16px;
  background: 
    linear-gradient(
      120deg,
      #654321 0%,
      #8B5E3C 15%,
      #704214 30%,
      #8B5E3C 70%,
      #654321 100%
    );
  border: 2px solid #3E2723; /* Dark edge for sharpness */
  border-radius: 0; /* Sharp corners! */
  
  /* 3D effect with precise shadow */
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.3);
  
  /* Inner matte border (simulates photo mount) */
  background-clip: padding-box;
}

/* Inner photo area with crisp white matte */
.sharp-wooden-frame img::before {
  content: "";
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  bottom: 16px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
  pointer-events: none;
}

/* Optional: Add a tiny highlight on top edge for realism */
.sharp-wooden-frame img::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.15), transparent);
  pointer-events: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  .sharp-wooden-frame {
    gap: 24px;
  }
  
  .sharp-wooden-frame img {
    width: calc(50% - 24px);
    height: auto;
    aspect-ratio: 1 / 1;
    max-width: 260px;
  }
}

@media (max-width: 480px) {
  .sharp-wooden-frame {
    gap: 20px;
    padding: 0 10px;
  }
  
  .sharp-wooden-frame img {
    width: 100%;
    max-width: 280px;
    height: auto;
    aspect-ratio: 1 / 1;
  }
}

/* 🎵 Birthday Playlist Section */
.music-player {
  margin: 40px auto;
  max-width: 700px;
  background: linear-gradient(135deg, #ff69b4, #ffb6c1);
  border-radius: 20px;
  padding: 20px;
  color: #fff;
  font-family: 'Quicksand', sans-serif;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  text-align: center;
}

/* Playlist Header */
.music-player h2 {
  font-size: 1.3rem;
  margin-bottom: 15px;
  font-family: 'Dancing Script', cursive;
}

/* Controls */
.audio-controls {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 20px;
}

.control-btn {
  background: #fff;
  color: #ff69b4;
  border: none;
  padding: 10px 18px;
  border-radius: 14px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
}

.control-btn:hover {
  background: #ffe4f3;
}

/* Playlist items */
.playlist {
  display: grid;
  gap: 8px;
}

.song-item {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.song-item:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateX(3px);
}

/* Highlight active song */
.song-item.active {
  background: #fff;
  color: #ff69b4;
  font-weight: bold;
  animation: glow 1.5s infinite alternate;
}

/* Glow animation for playing song */
@keyframes glow {
  from { box-shadow: 0 0 5px #fff; }
  to { box-shadow: 0 0 20px #fff; }
}

/* === UNIVERSAL MOBILE FIXES === */
* {
  box-sizing: border-box;
}
body, html {
  overflow-x: hidden;
  width: 100%;
  margin: 0;
  padding: 0;
}

/* Fix LED banner overflow */
.led-banner {
  white-space: normal !important;
  padding: 16px 12px;
  font-size: 1.8em;
}
@media (max-width: 360px) {
  .led-banner {
    font-size: 1.5em;
  }
}

/* Make age boxes fully responsive */
.age-container {
  padding: 0 10px;
}
.age-box {
  width: 70px;
  height: 70px;
  font-size: 0.8em;
}
@media (min-width: 360px) {
  .age-box {
    width: 80px;
    height: 80px;
    font-size: 0.9em;
  }
}

/* Ensure photo gallery never overflows */
.photo-gallery img {
  max-width: 100%;
  height: auto;
}
.sharp-wooden-frame img {
  max-width: 100%;
  width: 240px; /* fallback */
}
@media (max-width: 500px) {
  .sharp-wooden-frame img {
    width: 100%;
    max-width: 260px;
  }
}

/* Spin wheel: scale down on mobile */
@media (max-width: 480px) {
  .wheel-container,
  #wheelCanvas {
    width: 300px !important;
    height: 300px !important;
  }
}
@media (max-width: 360px) {
  .wheel-container,
  #wheelCanvas {
    width: 280px !important;
    height: 280px !important;
  }
}

/* Ensure gift boxes wrap and scale */
.gift-boxes {
  justify-content: center;
  padding: 0 10px;
  max-width: 100%;
}
.gift-box {
  flex: 0 0 auto;
}

/* Prevent horizontal scroll from any absolute/fixed elements */
.floating-heart {
  left: auto !important;
  right: auto !important;
  max-width: 100vw;
}

/* Ensure play overlay covers exactly the viewport */
.play-overlay {
  width: 100vw;
  height: 100vh;
  max-width: 100%;
  overflow: hidden;
}


@media (max-width: 600px) {
  .gift-boxes {
    flex-direction: column;
    align-items: center;
  }
  .gift-box {
    width: 100px;
    height: 100px;
  }
  .gift-box.revealed {
    height: auto !important;
    min-height: 130px;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background: none !important;
  }
  .gift-box img {
    width: 80px;
    height: auto;
    margin-bottom: 10px;
  }
  .gift-text {
    font-size: 0.85rem;
    max-width: 120px;
    padding: 6px 10px;
    margin-top: 4px;
    background: rgba(255,255,255,0.9);
    border-radius: 8px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
  }
}
