/* Base styles */
:root {
  --bg: #0b0b12;
  --panel: #131320;
  --text: #f5f7fb;
  --muted: #aab0c0;
  --accent: #ff4d6d;
  --accent-2: #6c5ce7;
  --birthday-pink: #ff1f7a;
  --birthday-blue: #000000;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, 'Helvetica Neue', Arial, 'Noto Sans', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
  color: var(--text);
  background: radial-gradient(1200px 600px at 20% 0%, rgba(255,77,109,0.12), transparent 60%),
              radial-gradient(1000px 600px at 100% 0%, rgba(108,92,231,0.12), transparent 60%),
              var(--bg);
}

.container {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.2px;
  margin-bottom: 10px;
}

.hero {
  text-align: center;
  padding: 56px 0 24px;
}
.title {
  margin: 8px 0 8px;
  font-size: clamp(32px, 6vw, 60px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.subtitle {
  margin: 0 auto;
  max-width: 720px;
  color: var(--muted);
  font-size: 16px;
}

.cta-row { margin-top: 24px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.btn {
  appearance: none;
  border: 1px solid transparent;
  padding: 16px 24px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
  color: #000;
  background: #ffffff;
  transition: transform 0.06s ease, background 0.2s ease, border-color 0.2s ease;
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: rgba(255,255,255,0.2); }
.btn.ghost { border-color: rgba(255,255,255,0.15); }

.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 20px;
  margin: 16px 0;
  backdrop-filter: blur(6px);
}

.card h2 { margin: 8px 0 10px; font-size: 20px; }
.card p { color: var(--muted); line-height: 1.7; }
.signature { margin-top: 8px; font-weight: 600; color: var(--text); }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.placeholder .ph { height: 110px; border-radius: 12px; background: rgba(255,255,255,0.06); border: 1px dashed rgba(255,255,255,0.12); }

@media (max-width: 720px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}

.footer {
  margin-top: 24px;
  display: flex;
  justify-content: center;
  color: var(--muted);
}

/* Simple floating hearts background (perf-friendly) */
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Subtle pulse on the title */
.title { animation: pulse 5s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { text-shadow: 0 0 0 rgba(255,77,109,0.0); }
  50% { text-shadow: 0 6px 24px rgba(255,77,109,0.25); }
}

/* Birthday full-screen section */
.birthday {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--birthday-pink);
  overflow: hidden;
}

.birthday-title {
  margin: 0;
  text-align: center;
  color: var(--birthday-blue);
  font-weight: 900;
  letter-spacing: -0.02em;
  font-size: clamp(32px, 9vw, 88px);
  line-height: 0.95;
  transform: perspective(600px) translateZ(0);
  animation: popOut 1200ms cubic-bezier(.2,1.05,.2,1) 1 both;
  text-shadow: 0 4px 0 rgba(0,0,0,0.08), 0 18px 40px rgba(0,0,0,0.25);
}

@keyframes popOut {
  0% {
    transform: perspective(600px) translateZ(-200px) scale(0.8) rotateX(12deg);
    opacity: 0;
  }
  60% {
    transform: perspective(600px) translateZ(60px) scale(1.08) rotateX(0deg);
    opacity: 1;
  }
  100% {
    transform: perspective(600px) translateZ(0) scale(1);
  }
}

.btn.replay {
  position: absolute;
  bottom: 24px;
  right: 24px;
  background: #ffffff;
  color: #101014;
  padding: 16px 24px;
  font-size: 16px;
}

.birthday .btn.next {
  margin-left: 8px;
  position: absolute;
  bottom: 24px;
  right: 140px;
  padding: 16px 24px;
  font-size: 16px;
}

/* --- Splash Screen --- */
.splash {
  position: fixed;
  inset: 0;
  background: #000;
  display: grid;
  place-items: center;
  z-index: 3000;
}
.splash-btn {
  appearance: none;
  background: #fff;
  color: #000;
  border: none;
  padding: 20px 32px;
  border-radius: 14px;
  font-weight: 900;
  font-size: clamp(20px, 4vw, 32px);
  cursor: pointer;
  animation: throb 1.2s ease-in-out infinite;
}
@keyframes throb {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,255,255,0.5); }
  50% { transform: scale(1.06); box-shadow: 0 0 0 18px rgba(255,255,255,0.0); }
}

/* --- Gallery Screen Styles --- */
.gallery-screen {
  background: var(--birthday-pink);
  min-height: 100vh;
  width: 100vw;
  border-radius: 0;
  box-shadow: none;
  border: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
}
.gallery-header {
  width: 100vw;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  margin: 24px 0 0 0;
  flex-shrink: 0;
}
.gallery-header h1 {
  color: #fff;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: bold;
  letter-spacing: -1px;
  margin: 0;
  text-align: center;
  padding: 0 16px;
}
.gallery-items {
  width: 100vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  flex: 1;
  justify-content: flex-start;
  padding-bottom: 16px;
}
.gallery-row {
  width: 95vw;
  max-width: 1200px;
  background: rgba(255,255,255,0.08);
  border-radius: 22px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 28px;
  box-shadow: 0 0 18px 3px rgba(0,0,0,0.06);
  flex-shrink: 0;
}
.gallery-row.reverse { flex-direction: row-reverse; }
.gallery-img {
  width: 320px;
  height: 320px;
  min-width: 320px;
  object-fit: cover;
  border-radius: 20px;
  border: 2.5px solid white;
  background: #fff;
  flex-shrink: 0;
}
.gallery-text {
  flex: 1;
  color: #fff;
  font-size: 1.1rem;
  text-align: left;
  line-height: 1.6;
}
.gallery-text h3 {
  font-size: 1.3rem;
  margin: 0 0 8px 0;
  color: #fff;
  font-weight: bold;
}
@media (max-width: 950px) {
  .gallery-row {
    width: 92vw;
    gap: 20px;
    padding: 16px;
  }
  .gallery-img {
    width: 240px;
    height: 240px;
    min-width: 240px;
  }
  .gallery-header {
    margin-top: 16px;
  }
  .gallery-items {
    gap: 10px;
    margin-top: 16px;
  }
}
@media (max-width: 700px) {
  .gallery-row {
    flex-direction: column !important;
    gap: 12px;
    width: 96vw;
    padding: 14px;
  }
  .gallery-img {
    width: 85vw;
    max-width: 280px;
    height: 85vw;
    max-height: 280px;
    min-width: unset;
  }
  .gallery-header {
    margin-top: 12px;
  }
  .gallery-header h1 {
    font-size: 1.6rem;
  }
  .gallery-items {
    gap: 8px;
    margin-top: 12px;
  }
}

/* --- Memory Game Screen Styles --- */
.memory-game-screen {
  background: var(--birthday-pink);
  min-height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 24px 0;
  overflow: hidden;
}

.memory-header {
  width: 100vw;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 24px;
}

.memory-header h1 {
  color: #fff;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: bold;
  letter-spacing: -1px;
  margin: 0;
  text-align: center;
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 12px;
  width: min(90vw, 600px);
  max-width: 600px;
  margin: 0 auto;
}

.memory-card {
  aspect-ratio: 1;
  position: relative;
  cursor: pointer;
  perspective: 1000px;
}

.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.card-front {
  background: linear-gradient(135deg, #ff6b9d, #ff8fab);
  border: 2px solid rgba(255,255,255,0.3);
  transform: rotateY(0deg);
}

.card-back {
  background: rgba(255,255,255,0.95);
  border: 2px solid rgba(255,255,255,0.5);
  transform: rotateY(180deg);
  padding: 4px;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

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

.memory-card.flipped .card-back {
  transform: rotateY(0deg);
}

.memory-card.matched .card-front,
.memory-card.matched .card-back {
  opacity: 0.7;
  cursor: default;
}

.heart-icon {
  font-size: 2.5rem;
  color: rgba(255,255,255,0.9);
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

@media (max-width: 700px) {
  .memory-grid {
    width: 95vw;
    gap: 10px;
  }
  .heart-icon {
    font-size: 2rem;
  }
  .memory-header {
    margin-bottom: 16px;
  }
}

@media (max-width: 480px) {
  .memory-grid {
    gap: 8px;
  }
  .heart-icon {
    font-size: 1.5rem;
  }
}


