/* ===== ROOT & GLOBAL STYLES ===== */
:root {
  --pastel-pink: #ffc0cb;
  --soft-purple: #e6e6fa;
  --white: #ffffff;
  --dark-gray: #333333;
  --light-gray: #f5f5f5;
  --accent-coral: #ff8a80;
  --accent-gold: #ffd700;
  --border-radius: 15px;
  --transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

html {
  scroll-behavior: smooth;
}

/* Royal Blue & Gold Theme */
body {
  background: linear-gradient(
    135deg,
    #0f2027,
    #203a43,
    #2c5364
  ); /* Midnight Blue */
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
  color: white; /* Ensure all default text is white */
  min-height: 100vh;
}

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

h1,
h2,
.section-title,
.logo,
.gold-text {
  background: linear-gradient(
    to right,
    #bf953f,
    #fcf6ba,
    #b38728,
    #fbf5b7,
    #aa771c
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important; /* Makes the gradient visible */
  text-shadow: 0 2px 10px rgba(255, 215, 0, 0.2); /* Soft gold glow */
  animation: shine 5s infinite linear; /* Moving shine effect */
  background-size: 200%;
}

@keyframes shine {
  to {
    background-position: 200% center;
  }
}

p {
  color: #f0f0f0; /* Soft white for readability */
}

button,
.btn-celebration,
.btn-large,
.btn-small,
.btn-hint,
.btn-restart,
.btn-modal,
.toggle-btn.active {
  background: linear-gradient(
    45deg,
    #ff8008,
    #ffc837
  ) !important; /* Orange-Gold */
  color: #000 !important; /* Black text for contrast */
  box-shadow: 0 5px 15px rgba(255, 165, 0, 0.4);
  border: none;
}

.message-card,
.game-card,
.music-player,
.gallery,
.puzzle-game {
  background: rgba(
    255,
    255,
    255,
    0.1
  ) !important; /* Darker transparent glass */
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.puzzle-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  width: 300px; /* Fixed width for stability */
  height: 300px;
  margin: 0 auto;
  border: 5px solid white;
  border-radius: 10px;
  background: #fff;
}

.puzzle-tile {
  width: 100%;
  height: 100%;
  /* background-image is set dynamically from the preview image in JS */
  background-size: 300% 300%;
  background-repeat: no-repeat;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.puzzle-tile.empty {
  background: none !important;
  border: 1px dashed rgba(0, 0, 0, 0.1);
}

/* ===== NAVBAR STYLES ===== */
.navbar {
  background: rgba(15, 32, 39, 0.95);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.navbar-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.navbar-logo {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--dark-gray);
  letter-spacing: 1px;
}

/* Premium Logo Styles */
.logo {
  font-family: "Fredoka", "Pacifico", cursive;
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--dark-gray);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.3s ease;
}

.logo i {
  color: #ffd700;
  font-size: 2rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

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

.logo:hover i {
  animation: logoBounce 0.6s infinite alternate;
}

@keyframes logoBounce {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-5px);
  }
}

.navbar-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-links a {
  text-decoration: none;
  color: #f0f0f0;
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  padding: 8px 15px;
  border-radius: 20px;
  position: relative;
}

.nav-links a:hover {
  background: rgba(255, 215, 0, 0.2);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
  transform: translateY(-2px);
  color: #ffd700;
}

.nav-links a i {
  color: #ffd700;
  font-size: 1.2rem;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-coral);
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

/* ===== HERO SECTION ===== */
.hero {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: linear-gradient(
    135deg,
    rgba(15, 32, 39, 0.8) 0%,
    rgba(44, 83, 100, 0.8) 100%
  );
}

.hero-content {
  text-align: center;
  animation: fadeInDown 0.8s ease;
}

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

.hero-title {
  font-size: 4rem;
  font-weight: 700;
  color: #ffd700 !important; /* Gold */
  margin-bottom: 1rem;
  text-shadow:
    0 0 30px rgba(255, 215, 0, 0.8),
    0 0 60px rgba(255, 193, 7, 0.6),
    2px 2px 4px rgba(0, 0, 0, 0.3);
  animation: fadeInDown 0.8s ease 0.2s both;
}

.hero-subtitle {
  font-size: 1.5rem;
  color: #f0f0f0; /* Soft white */
  margin-bottom: 3rem;
  font-weight: 400;
  animation: fadeInDown 0.8s ease 0.4s both;
}

.cake-animation {
  margin: 3rem 0;
  animation: bounce 2s infinite;
}

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

.cake-svg {
  width: 150px;
  height: 180px;
  margin: 0 auto;
  display: block;
  animation: fadeInDown 0.8s ease 0.6s both;
}

.btn-celebration {
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--border-radius);
  background: linear-gradient(135deg, var(--accent-coral) 0%, #ff6b6b 100%);
  color: white;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
  animation: fadeInDown 0.8s ease 0.8s both;
}

.btn-celebration:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(255, 107, 107, 0.6);
}

.btn-celebration:active {
  transform: translateY(-1px);
}

/* ===== SECTION STYLES ===== */
section {
  padding: 5rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 3rem;
  color: #ffd700 !important; /* Gold */
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  font-weight: bold;
}

/* ===== GALLERY SECTION ===== */
.gallery {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 20px;
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
  padding: 3rem 2rem;
  margin: 3rem auto;
  max-width: 1200px;
  width: 100%;
}

.gallery-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2.5rem;
}

/* Toggle Buttons */
.toggle-buttons {
  display: flex;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 0.5rem;
  border-radius: 50px;
  border: 2px solid rgba(255, 215, 0, 0.3);
}

.toggle-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  background: rgba(255, 255, 255, 0.1) !important;
  color: #f0f0f0 !important;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border-radius: 40px;
  transition: all 0.3s ease;
}

.toggle-btn.active {
  background: linear-gradient(135deg, var(--soft-purple), var(--accent-coral));
  color: white;
  box-shadow: 0 4px 15px rgba(230, 230, 250, 0.4);
}

.toggle-btn:hover {
  transform: translateY(-2px);
}

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  opacity: 1;
  transition: opacity 0.3s ease;
  justify-items: center;
  width: 100%;
}

.gallery-grid.active-view {
  display: grid;
}

.gallery-grid:not(.active-view) {
  display: none;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 15px;
  aspect-ratio: 1 / 1;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  width: 100%;
  max-width: 280px;
  transition: transform 0.3s ease;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.5s ease;
  background: rgba(0, 0, 0, 0.1);
}

/* The Hidden Caption Box */
.gallery-item .overlay {
  position: absolute;
  bottom: -100%; /* Hidden below the image */
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 32, 39, 0.85); /* Dark Blue Glass */
  backdrop-filter: blur(5px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  transition: bottom 0.4s ease;
}

.gallery-item .overlay p {
  color: #ffd700; /* Gold Text */
  font-size: 1.2rem;
  text-align: center;
  font-weight: bold;
  transform: translateY(20px);
  transition: transform 0.4s ease;
}

/* Hover Effects */
.gallery-item:hover .overlay {
  bottom: 0; /* Slide up to cover image */
}

.gallery-item:hover img {
  transform: scale(1.1); /* Zoom image slightly */
}

.gallery-item:hover .overlay p {
  transform: translateY(0);
}

/* Slideshow */
.slideshow-container {
  position: relative;
  width: 100%;
  height: 500px; /* Adjust height as needed */
  overflow: hidden;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  background: #000;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.slideshow-container:not(.active-view) {
  display: none;
}

.slideshow-container.active-view {
  display: block;
}

/* The Images */
.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;

  /* CRITICAL FIX: Ensure the WHOLE photo fits inside the box */
  background-size: contain !important;
  background-position: center center !important;
  background-repeat: no-repeat;

  transition: opacity 1s ease-in-out;
}

/* Active Slide (Visible) */
.slide.active {
  opacity: 1;
  animation: gentleFlow 6s infinite alternate;
}

/* Very subtle movement so nothing gets cropped */
@keyframes gentleFlow {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.03); /* Only 3% zoom, very safe */
  }
}

/* Responsive */
@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
  }

  .slide-arrow {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }

  .prev-arrow {
    left: 5px;
  }

  .next-arrow {
    right: 5px;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .toggle-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
  }

  .slide-arrow {
    width: 35px;
    height: 35px;
    font-size: 1.2rem;
  }
}

/* ===== MUSIC PLAYER SECTION ===== */
.music-player {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 20px;
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
  padding: 3rem 2rem;
  margin: 3rem auto;
  max-width: 1200px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.player-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--border-radius);
  padding: 3rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  text-align: center;
}

.vinyl-record {
  width: 200px;
  height: 200px;
  margin: 0 auto 2rem;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #333, #000);
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.4),
    inset 0 2px 10px rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  animation: none;
}

.vinyl-record.playing {
  animation: spin 3s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.vinyl-center {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffd700, #ffa500);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.3);
}

.player-controls {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.2rem;
  border: none;
  border-radius: 10px;
  background: linear-gradient(
    135deg,
    var(--pastel-pink) 0%,
    var(--soft-purple) 100%
  );
  color: var(--dark-gray);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.btn-large:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.btn-small {
  padding: 0.7rem 1.2rem;
  font-size: 0.95rem;
  border: none;
  border-radius: 8px;
  background: var(--light-gray);
  color: var(--dark-gray);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-small:hover {
  background: var(--soft-purple);
  transform: translateY(-2px);
}

.now-playing {
  margin: 1.5rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffd700;
}

.playlist {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid var(--light-gray);
  text-align: left;
  width: 100%;
}

.song-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1rem;
  margin: 0.6rem 0;
  background: rgba(255, 255, 255, 0.1);
  color: #f0f0f0;
  border-radius: 8px;
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
}

.song-item:hover {
  background: rgba(255, 215, 0, 0.2);
  transform: translateX(4px);
}

.song-item.active {
  background: linear-gradient(45deg, #ff8008, #ffc837) !important;
  font-weight: 600;
  color: #000 !important;
  border: 1px solid #ffd700;
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

.song-item span {
  display: block;
}

.song-item .duration {
  font-size: 0.85rem;
  opacity: 0.8;
  margin-left: 1rem;
}

/* ===== PUZZLE GAME SECTION ===== */
.puzzle-game {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 20px;
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
  padding: 4rem 2rem;
  margin: 3rem auto;
  max-width: 1400px;
  width: 100%;
}

/* Glass Card Design */
.game-card {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  padding: 3rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.game-wrapper {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 50px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Puzzle Section (Left) */
.puzzle-section {
  position: relative;
  flex-shrink: 0;
}

/* Initial Image Preview */
.puzzle-image-preview {
  position: relative;
  width: 400px;
  height: 400px;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.puzzle-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* show full faces without cropping */
  display: block;
}

.btn-start-game {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: auto;
  max-width: 180px;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-coral) 0%, #ff6b6b 100%);
  color: white;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: 0 10px 30px rgba(255, 107, 107, 0.4);
  z-index: 9999; /* ensure on top */
}

.btn-start-game:hover {
  transform: translate(-50%, -50%) scale(1.05);
  box-shadow: 0 15px 40px rgba(255, 107, 107, 0.6);
}

.btn-start-game span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Puzzle Board Wrapper */
.puzzle-board-wrapper {
  opacity: 1;
  transition: opacity 0.3s ease;
}

.puzzle-board-wrapper.hidden {
  display: none;
  opacity: 0;
}

.puzzle-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 400px;
  height: 400px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  padding: 0;
  border-radius: 15px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
  aspect-ratio: 1 / 1;
}

.puzzle-tile {
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.puzzle-tile img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* show full faces */
  display: block;
}

.puzzle-tile:hover:not(.empty) {
  transform: scale(0.98);
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.puzzle-tile.empty {
  background: linear-gradient(45deg, #ff8008, #ffc837);
  cursor: default;
  opacity: 0.5;
}

/* Control Panel (Right) */
.control-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 280px;
  flex-shrink: 0;
}

/* Scoreboard */
.scoreboard {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 15px;
  padding: 1.5rem;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.score-item {
  background: linear-gradient(45deg, #ff8008, #ffc837);
  border-radius: 12px;
  padding: 1.2rem;
  text-align: center;
  color: #000;
  font-weight: 600;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.score-label {
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0.95;
  margin-bottom: 0.5rem;
}

.score-value {
  font-size: 1.8rem;
  font-weight: 700;
  font-family: "Courier New", monospace;
}

/* Hint Button */
.btn-hint {
  padding: 1rem 1.5rem;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #ffb6c1 0%, #dda0dd 100%);
  color: white;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.btn-hint:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Solution Hint */
.solution-hint {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 15px;
  padding: 1.2rem;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  opacity: 1;
  transition: all 0.3s ease;
}

.solution-hint.hidden {
  display: none;
  opacity: 0;
}

.solution-hint img {
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

/* Restart Button */
.btn-restart {
  padding: 1rem 1.5rem;
  border: none;
  border-radius: 12px;
  background: linear-gradient(
    135deg,
    var(--soft-purple) 0%,
    var(--accent-coral) 100%
  );
  color: white;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.btn-restart:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Modal */

/* ===== MODAL ===== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.modal.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-content {
  background: rgba(15, 32, 39, 0.95);
  backdrop-filter: blur(15px);
  border: 2px solid #ffd700;
  padding: 3rem;
  border-radius: var(--border-radius);
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.4s ease;
  max-width: 400px;
}

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

.modal-content h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: #ffd700 !important;
}

.modal-content p {
  font-size: 1.1rem;
  margin: 0.5rem 0;
  color: #f0f0f0;
}

.btn-modal {
  margin-top: 2rem;
  padding: 1rem 2rem;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-coral) 0%, #ff6b6b 100%);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1rem;
}

.btn-modal:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(255, 107, 107, 0.4);
}

/* ===== UTILITY CLASSES ===== */
.hidden {
  display: none !important;
}

.active {
  display: block;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }

  .hero-subtitle {
    font-size: 1.2rem;
  }

  .navbar-menu {
    gap: 1rem;
    font-size: 0.9rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .player-card {
    padding: 2rem;
  }

  .puzzle-board {
    max-width: 100%;
  }

  .solution-preview {
    margin-top: 2rem;
  }
}

@media (max-width: 480px) {
  .navbar-logo {
    font-size: 1.3rem;
  }

  .navbar-menu {
    flex-direction: column;
    gap: 0.5rem;
  }

  .hero-title {
    font-size: 1.8rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .btn-celebration {
    padding: 0.8rem 1.5rem;
    font-size: 0.95rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

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

  .player-controls {
    gap: 0.5rem;
  }

  .btn-large,
  .btn-small {
    font-size: 0.85rem;
    padding: 0.6rem 1rem;
  }

  /* Responsive Puzzle Game */
  .game-wrapper {
    flex-direction: column;
    align-items: center;
    gap: 2rem;
  }

  .puzzle-image-preview,
  .puzzle-board {
    width: 320px;
    height: 320px;
  }

  .puzzle-tile {
    transition: all 0.2s ease;
  }

  .control-panel {
    width: 100%;
    min-width: auto;
  }

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

  .modal-content {
    padding: 2rem;
    margin: 1rem;
  }
}

/* ===== SPECIAL MESSAGE SECTION ===== */
.message-section {
  position: relative;
  padding: 80px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 500px;
  overflow: hidden;
}

.floating-bg {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: -1;
  top: 0;
  left: 0;
}

.floating-bg span {
  position: absolute;
  bottom: -50px;
  font-size: 30px;
  color: rgba(255, 255, 255, 0.3);
  animation: floatUp 10s linear infinite;
  animation-delay: calc(var(--i) * -1s);
  left: calc(var(--i) * 5%);
}

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

.message-card {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  padding: 60px 40px;
  max-width: 600px;
  text-align: center;
  box-shadow: 0 15px 35px rgba(255, 192, 203, 0.2);
  animation: cardPulse 4s ease-in-out infinite;
}

@keyframes cardPulse {
  0% {
    box-shadow: 0 15px 35px rgba(255, 192, 203, 0.2);
  }
  50% {
    box-shadow: 0 15px 50px rgba(255, 192, 203, 0.6);
    transform: scale(1.02);
  }
  100% {
    box-shadow: 0 15px 35px rgba(255, 192, 203, 0.2);
  }
}

.message-text {
  font-size: 1.2rem;
  line-height: 1.8;
  color: #f0f0f0; /* Soft white */
  font-weight: 500;
  margin-bottom: 30px;
}

.signature {
  margin-top: 40px;
  font-size: 2rem;
  font-weight: 800;
  text-align: right;
  font-family: "Dancing Script", cursive;
  /* Gold Gradient Text */
  background: linear-gradient(
    to right,
    #bf953f,
    #fcf6ba,
    #b38728,
    #fbf5b7,
    #aa771c
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shine 3s infinite linear;
  background-size: 200%;
}

@keyframes shine {
  to {
    background-position: 200% center;
  }
}

/* =========================================
   MOBILE RESPONSIVENESS (Max-Width: 768px)
   ========================================= */
@media screen and (max-width: 768px) {
  /* 1. Fix Horizontal Overflow (Prevent side-scrolling) */
  body,
  html {
    width: 100%;
    overflow-x: hidden;
  }

  /* 2. Fix Navigation Bar */
  header {
    flex-direction: column;
    padding: 15px;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
  }

  /* --- MOBILE GAME FIXES (Stack & Center) --- */

  /* Force game wrapper to stack vertically */
  .game-wrapper {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 auto !important;
    gap: 2rem !important;
  }

  /* Resize & center puzzle section */
  .puzzle-section {
    width: 100% !important;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  /* Resize puzzle image preview */
  .puzzle-image-preview {
    width: 300px !important;
    height: 300px !important;
    margin: 0 auto !important;
  }

  /* Resize & center the puzzle board */
  .puzzle-board {
    width: 300px !important;
    height: 300px !important;
    margin: 0 auto !important;
  }

  /* Resize tiles to match */
  .puzzle-tile {
    background-size: 300px 300px !important;
  }

  /* Center control panel on mobile */
  .control-panel {
    width: 100% !important;
    max-width: 300px !important;
    margin: 0 auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }

  /* Center scoreboard */
  .scoreboard {
    width: 100% !important;
    max-width: 300px !important;
    margin: 0 auto !important;
  }

  /* Fix start game button */
  .btn-start-game {
    max-width: 160px !important;
    padding: 8px 14px !important;
    font-size: 0.85rem !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
  }

  /* 6. General Section Padding */
  section {
    padding: 40px 10px !important;
  }

  h1 {
    font-size: 2rem;
  }
  h2 {
    font-size: 1.5rem;
  }

  /* 7. FORCE GAME TO STACK (Puzzle Top, Timer Bottom) */
  .game-container {
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    padding-top: 20px;
  }

  /* 8. Resize Puzzle for Phone Screen */
  .puzzle-grid {
    width: 300px !important;
    height: 300px !important;
    margin-bottom: 20px !important; /* Space between puzzle and timer */
  }
  .puzzle-tile {
    background-size: 300px 300px !important;
  }

  /* 9. Center the Start Button Overlay */
  .game-overlay {
    width: 80% !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
  }

  /* 10. Fix Special Message Section for Mobile */
  .message-section {
    padding: 40px 15px !important;
  }
  .message-card {
    padding: 20px !important;
  }
  .message-card h2 {
    font-size: 1.8rem !important; /* Smaller title for phone */
  }
  .signature {
    font-size: 1.5rem !important;
    margin-top: 20px !important;
  }
}

/* ===== FRIENDSHIP QUIZ SECTION ===== */
.quiz-section {
  padding: 60px 20px;
  text-align: center;
}

.quiz-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
  margin-top: 30px;
}

.quiz-card {
  /* Glass Style reused */
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 215, 0, 0.3);
  padding: 30px;
  border-radius: 20px;
  width: 100%;
  max-width: 350px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.quiz-card h3 {
  color: #fff;
  font-size: 1.2rem;
  margin-bottom: 20px;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.options button {
  /* Default Button Style */
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: white !important;
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
}

.options button:hover {
  background: rgba(255, 215, 0, 0.2) !important;
  border-color: #ffd700 !important;
}

/* Feedback Classes */
.correct-ans {
  background: #2ecc71 !important; /* Green */
  border-color: #2ecc71 !important;
  transform: scale(1.05);
}
.wrong-ans {
  background: #e74c3c !important; /* Red */
  border-color: #e74c3c !important;
  animation: shake 0.5s;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

/* ===== FOOTER SECTION ===== */
.footer {
  text-align: center;
  padding: 40px 20px;
  background: rgba(15, 32, 39, 0.8);
  border-top: 2px solid rgba(255, 215, 0, 0.3);
  color: #f0f0f0;
}

.footer p {
  margin: 10px 0;
  font-size: 1.1rem;
}

.footer .heart {
  display: inline-block;
  color: #ff4757;
  animation: heartbeat 1.5s infinite;
}

@keyframes heartbeat {
  0%,
  100% {
    transform: scale(1);
  }
  10%,
  30% {
    transform: scale(1.2);
  }
  20%,
  40% {
    transform: scale(1);
  }
}

.footer .copyright {
  font-size: 0.9rem;
  opacity: 0.7;
  margin-top: 5px;
}

/* ===== MYSTERY GIFT BOX SECTION ===== */
.gift-section {
  perspective: 1000px;
  padding: 80px 20px;
  text-align: center;
  overflow: hidden;
}

.gift-hint {
  color: #aaa;
  margin-bottom: 40px;
}

.gift-container {
  width: 200px;
  height: 200px;
  margin: 0 auto;
  position: relative;
  cursor: pointer;
}

.gift-box {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(-20deg) rotateY(45deg);
  transition: transform 0.5s ease;
}

/* Hover Shake Effect */
.gift-box:hover {
  animation: shakeBox 0.5s infinite;
}
@keyframes shakeBox {
  0% {
    transform: rotateX(-20deg) rotateY(45deg) rotateZ(0deg);
  }
  25% {
    transform: rotateX(-20deg) rotateY(45deg) rotateZ(2deg);
  }
  75% {
    transform: rotateX(-20deg) rotateY(45deg) rotateZ(-2deg);
  }
}

/* Box Styles (Gold & Blue) */
.gift-body .side,
.gift-lid .lid-side,
.gift-lid .lid-top {
  position: absolute;
  border: 2px solid #b38728;
  background: linear-gradient(135deg, #ffd700, #fdb931); /* Gold */
}

.gift-body .side {
  width: 200px;
  height: 150px;
}

.gift-body .front {
  transform: translateZ(100px);
}
.gift-body .back {
  transform: rotateY(180deg) translateZ(100px);
}
.gift-body .left {
  transform: rotateY(-90deg) translateZ(100px);
}
.gift-body .right {
  transform: rotateY(90deg) translateZ(100px);
}
.gift-body .bottom {
  width: 200px;
  height: 200px;
  transform: rotateX(-90deg) translateZ(50px);
  background: #b38728;
}

/* Lid Styling */
.gift-lid {
  position: absolute;
  width: 210px;
  height: 50px;
  top: -50px;
  left: -5px;
  transform-style: preserve-3d;
  transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: top back;
}

.gift-lid .lid-top {
  width: 210px;
  height: 210px;
  transform: rotateX(90deg) translateZ(105px);
  background: #ffd700;
}
.gift-lid .lid-side {
  width: 210px;
  height: 50px;
}
.gift-lid .front {
  transform: translateZ(105px);
}
.gift-lid .back {
  transform: rotateY(180deg) translateZ(105px);
}
.gift-lid .left {
  transform: rotateY(-90deg) translateZ(105px);
}
.gift-lid .right {
  transform: rotateY(90deg) translateZ(105px);
}

/* The Voucher Card inside */
.voucher {
  position: absolute;
  width: 180px;
  height: 120px;
  background: white;
  top: 20px;
  left: 10px;
  transform: rotateX(-90deg) translateZ(0px); /* Hidden flat inside */
  transition: all 1s ease 0.5s;
  border-radius: 10px;
  text-align: center;
  padding: 15px 10px;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
  opacity: 0;
  backface-visibility: hidden; /* Fixes glitch */
}

.voucher-content h2 {
  color: #ff4757 !important;
  font-size: 1.2rem;
  margin: 10px 0;
  font-weight: 900;
  text-transform: uppercase;
}
.voucher-content p {
  color: #333;
  font-size: 0.7rem;
  margin: 0;
}
.voucher-content h3 {
  color: #b38728;
  font-size: 0.8rem;
  margin: 0;
}

/* --- OPEN STATE CLASSES --- */
.gift-box.open .gift-lid {
  transform: rotateX(120deg) translateY(-100px); /* Lid flies open */
}

.gift-box.open .voucher {
  transform: rotateX(0deg) translateY(-220px) scale(1.3); /* Floats Up high */
  opacity: 1;
  z-index: 10;
}

/* ===== MOBILE VIEW FIX ===== */
@media (max-width: 768px) {
  /* Target your main header/navbar container */
  header,
  .navbar {
    flex-direction: column; /* Stacks logo on top, buttons below */
    height: auto; /* Allows it to grow taller */
    padding: 10px;
  }

  /* Target the container holding the buttons */
  .nav-links,
  ul {
    margin-top: 15px; /* Adds space between logo and buttons */
    justify-content: center; /* Centers the buttons */
    flex-wrap: wrap; /* Allows buttons to drop to next line if needed */
    width: 100%;
    gap: 10px; /* Space between buttons */
  }

  /* Make the buttons a bit smaller/easier to tap if needed */
  .nav-links a,
  li {
    font-size: 14px;
    padding: 5px 10px;
  }
}
