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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #f5f5fa, #e8ecff, #fdfdff);
  color: #1f2335;
  min-height: 100vh;
  overflow-x: hidden;
}

header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(12px);
  padding: 0.6rem 1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  color: #f9fafb;
}

.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.logo-cake {
  font-size: 1.5rem;
}

header h1 {
  font-size: 1.3rem;
  font-weight: 600;
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem;
}

nav button {
  border: none;
  background: #7f5af0;
  color: white;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  transition: transform 0.12s, box-shadow 0.12s, background 0.2s;
}

nav button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  background: #6240d4;
}

main {
  max-width: 960px;
  margin: 1.2rem auto 3rem;
  padding: 0 1rem 2rem;
}

.card {
  background: rgba(13, 17, 23, 0.92);
  border-radius: 1.2rem;
  padding: 1.6rem;
  margin-bottom: 1.2rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
  color: #f9fafb;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, rgba(127, 90, 240, 0.22), transparent 60%);
  opacity: 0.9;
  pointer-events: none;
}

.card > * {
  position: relative;
  z-index: 1;
}

.card h2 {
  margin-bottom: 0.8rem;
}

.highlight {
  margin-top: 0.8rem;
  font-weight: 600;
  color: #f97380;
}

p, li {
  line-height: 1.6;
  font-size: 0.98rem;
}

ol {
  padding-left: 1.3rem;
}

.note {
  margin-top: 0.8rem;
  font-size: 0.9rem;
  color: #cbd5f5;
}

/* Welcome overlay */
#welcome-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, #1b1030, #050816);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.welcome-card {
  background: rgba(13, 17, 23, 0.96);
  padding: 2.2rem 2.4rem;
  border-radius: 1.5rem;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(127, 90, 240, 0.5);
}

.cake-emoji {
  font-size: 2.5rem;
  margin-bottom: 0.6rem;
}

.welcome-card h1 {
  margin-bottom: 0.8rem;
  font-size: 1.5rem;
}

.welcome-card p {
  margin-bottom: 1.4rem;
  color: #e5e7eb;
}

.welcome-card button {
  border: none;
  background: linear-gradient(135deg, #7f5af0, #ff6fb9);
  color: white;
  padding: 0.7rem 1.3rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
}

.hidden {
  display: none;
}

/* Slideshow */
.slideshow-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.slideshow-container img {
  max-width: 100%;
  border-radius: 1rem;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}

.slideshow-controls {
  display: flex;
  gap: 0.5rem;
}

.slideshow-controls button {
  border: none;
  background: #7f5af0;
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  cursor: pointer;
}

/* Quiz */
.question {
  margin-bottom: 1rem;
}

.question p {
  margin-bottom: 0.3rem;
  font-weight: 600;
}

.question label {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.1rem;
}

#scientist-quiz button {
  border: none;
  background: #ff6fb9;
  color: white;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  margin-top: 0.2rem;
}

.quiz-result {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 1rem;
  background: rgba(127, 90, 240, 0.16);
  border: 1px solid rgba(127, 90, 240, 0.5);
}

/* Pac-Love */
#paclove-canvas {
  display: block;
  margin: 0.5rem auto 0;
  background: #050816;
  border-radius: 1rem;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7);
}

#paclove-status {
  text-align: center;
  margin-top: 0.5rem;
  font-weight: 600;
}

#paclove-restart {
  display: block;
  margin: 0.6rem auto 0;
  border: none;
  background: #7f5af0;
  color: white;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
}

/* Memory Game with images */
#memory-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(70px, 1fr));
  gap: 0.7rem;
  margin-top: 0.8rem;
}

.memory-card {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 0.7rem;
  overflow: hidden;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.3s;
}

.memory-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.4s;
}

.memory-card.flipped .memory-card-inner {
  transform: rotateY(180deg);
}

.memory-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
}

.memory-back {
  background: linear-gradient(135deg, #7f5af0, #ff6fb9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}

.memory-front {
  transform: rotateY(180deg);
}

.memory-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#memory-status {
  margin-top: 0.8rem;
  font-weight: 600;
}

/* Guess the gift */
#gift-boxes {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.2rem;
}

.gift-box {
  font-size: 3rem;
  cursor: pointer;
  transition: transform 0.15s, filter 0.15s;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
}

.gift-box:hover {
  transform: translateY(-4px) scale(1.08);
}

.gift-box.shake {
  animation: shake 0.4s;
}

.gift-box.correct {
  animation: pop 0.5s forwards;
}

#gift-result {
  margin-top: 0.7rem;
  font-weight: 600;
}

#gift-reveal {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 1rem;
  background: rgba(127, 90, 240, 0.16);
  border: 1px solid rgba(127, 90, 240, 0.5);
}

.gift-reveal-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
}

.gift-reveal-inner img {
  width: 140px;
  border-radius: 0.8rem;
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.6);
}

/* Extra love */
#reasons-btn {
  border: none;
  background: #ff6fb9;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  margin-top: 0.8rem;
}

#reason-text {
  margin-top: 0.7rem;
  font-weight: 600;
  color: #fbb6ce;
}

/* Footer */
footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.85rem;
  color: #4b5563;
}

/* Flying wishes */
#wishes-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: visible;
  z-index: 2;
}

.wish-chip {
  position: absolute;
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-size: 0.75rem;
  white-space: nowrap;
  pointer-events: auto;
  cursor: pointer;
  border: 1px solid rgba(148, 163, 184, 0.7);
  animation: floatUp 9s linear infinite;
}

/* Animations */
@keyframes floatUp {
  0% {
    transform: translateY(40vh) translateX(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  50% {
    transform: translateY(-10vh) translateX(20px);
  }
  100% {
    transform: translateY(-40vh) translateX(-20px);
    opacity: 0;
  }
}

@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-3px); }
  100% { transform: translateX(0); }
}

@keyframes pop {
  0% { transform: scale(1); }
  60% { transform: scale(1.2); }
  100% { transform: scale(1.05); }
}

/* Responsive */
@media (max-width: 720px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  header h1 {
    font-size: 1.1rem;
  }

  nav {
    justify-content: flex-start;
    overflow-x: auto;
  }

  nav button {
    white-space: nowrap;
    font-size: 0.7rem;
    padding: 0.3rem 0.7rem;
  }

  main {
    padding: 0 0.6rem 2rem;
  }

  .card {
    padding: 1.2rem;
    border-radius: 1rem;
  }

  p, li {
    font-size: 0.9rem;
  }

  #memory-grid {
    grid-template-columns: repeat(3, minmax(70px, 1fr));
  }

  .gift-reveal-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

#paclove-canvas {
  display: block;
  margin: 0.5rem auto 0;
  background: #050816;
  border-radius: 1rem;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7);
  width: 100%;
  max-width: 360px;   /* so it fits nicely on phones */
  height: auto;
}
