/* ── CSS Custom Properties (set dynamically by main.js) ──────── */
:root {
  --primary: #f472b6;
  --accent: #60a5fa;
  --bg: #0f172a;
  --text: #f1f5f9;
}

/* ── Reset & Base ──────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.5s ease, color 0.5s ease;
}

/* ── Audio ──────────────────────────────────────────────────────── */
.song {
  display: none;
}

/* ── Theme Toggle ──────────────────────────────────────────────── */
#theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  background: rgba(128, 128, 128, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(128, 128, 128, 0.15);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, background 0.3s ease;
}

#theme-toggle:hover {
  transform: scale(1.1);
  background: rgba(128, 128, 128, 0.2);
}

/* ── Container ─────────────────────────────────────────────────── */
.container {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  position: relative;
  text-align: center;
  visibility: hidden;
  user-select: none;
  -webkit-user-select: none;
}

/* ── Section Base ──────────────────────────────────────────────── */
.section {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  pointer-events: none;
  overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════════
   COMPONENTS
   ═══════════════════════════════════════════════════════════════ */

/* ── Greeting ──────────────────────────────────────────────────── */
.greeting-title {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 700;
  line-height: 1.2;
  max-width: 90%;
  overflow-wrap: break-word;
  word-break: break-word;
}

.greeting-name {
  display: block;
  color: var(--primary);
}

.greeting-subtitle {
  font-size: clamp(1rem, 3vw, 1.4rem);
  font-weight: 300;
  margin-top: 0.8rem;
  opacity: 0.65;
  max-width: 80%;
}

/* ── Announcement ──────────────────────────────────────────────── */
.section-announcement p {
  font-size: clamp(1.8rem, 6vw, 3rem);
  font-weight: 600;
  padding: 0 1rem;
}

/* ── Chatbox ───────────────────────────────────────────────────── */
.text-box {
  border: 1.5px solid rgba(128, 128, 128, 0.12);
  border-radius: 18px;
  padding: 1.8rem;
  max-width: 540px;
  width: 88%;
  position: relative;
  text-align: left;
  background: rgba(128, 128, 128, 0.05);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.hbd-chatbox {
  font-size: clamp(0.85rem, 2.2vw, 1rem);
  line-height: 1.8;
  font-weight: 300;
  overflow-wrap: break-word;
  word-break: break-word;
}

.hbd-chatbox span {
  visibility: hidden;
}

.fake-btn {
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  padding: 0.5rem 1.4rem;
  position: absolute;
  right: 14px;
  bottom: -42px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

/* ── Ideas ──────────────────────────────────────────────────────── */
.section-ideas .idea-line {
  font-size: clamp(1.2rem, 4vw, 2rem);
  position: absolute;
  left: 0;
  right: 0;
  padding: 0 1.5rem;
  font-weight: 300;
  opacity: 0;
}

.idea-line strong {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-weight: 600;
}

.idea-special {
  font-size: clamp(2rem, 6vw, 3.5rem) !important;
  font-weight: 600 !important;
}

.idea-special span {
  display: inline-block;
}

.idea-big-letters {
  position: absolute;
  left: 0;
  right: 0;
  opacity: 0;
}

.idea-big-letters span {
  display: inline-block;
  font-size: clamp(7rem, 22vw, 14rem);
  font-weight: 800;
  color: var(--primary);
}

/* ── Countdown ─────────────────────────────────────────────────── */
.countdown-wrapper {
  position: relative;
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.countdown-num {
  position: absolute;
  font-size: clamp(5rem, 18vw, 10rem);
  font-weight: 800;
  color: var(--accent);
  opacity: 0;
}

.countdown-go {
  position: absolute;
  font-size: clamp(4rem, 15vw, 8rem);
  opacity: 0;
}

/* ── Quote ──────────────────────────────────────────────────────── */
.quote-card {
  max-width: 520px;
  width: 88%;
  padding: 2.5rem;
  border-radius: 20px;
  background: rgba(128, 128, 128, 0.05);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid rgba(128, 128, 128, 0.1);
}

.quote-mark {
  font-size: clamp(2.5rem, 7vw, 4rem);
  font-weight: 800;
  line-height: 1;
  color: var(--primary);
  opacity: 0.6;
  display: block;
  margin-bottom: -0.3rem;
}

.quote-text {
  font-size: clamp(1rem, 3vw, 1.4rem);
  font-weight: 300;
  line-height: 1.7;
  font-style: italic;
  overflow-wrap: break-word;
}

.quote-author {
  font-size: clamp(0.85rem, 2vw, 1rem);
  margin-top: 1rem;
  opacity: 0.5;
}

/* ── Stars ──────────────────────────────────────────────────────── */
.section-stars {
  position: fixed !important;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.star {
  position: absolute;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.4;
  animation: twinkle 2.5s ease-in-out infinite alternate;
}

@keyframes twinkle {
  0%   { opacity: 0.1; transform: scale(0.8); }
  100% { opacity: 0.8; transform: scale(1.2); }
}

/* ── Fireworks ─────────────────────────────────────────────────── */
.section-fireworks {
  position: fixed !important;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

.firework-spark {
  position: absolute;
  border-radius: 50%;
}

/* ── Balloons ──────────────────────────────────────────────────── */
.section-balloons {
  position: fixed !important;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.section-balloons img {
  position: absolute;
  width: clamp(90px, 18vw, 160px);
  height: auto;
}

.section-balloons img:nth-child(even)  { left: 5%; }
.section-balloons img:nth-child(odd)   { right: 5%; }
.section-balloons img:nth-child(3n)    { left: 22%; }
.section-balloons img:nth-child(5n)    { left: 48%; }
.section-balloons img:nth-child(7n)    { left: 68%; }
.section-balloons img:nth-child(11n)   { left: 82%; }

/* ── Profile ───────────────────────────────────────────────────── */
.section-profile {
  z-index: 1;
}

.profile-wrapper {
  position: relative;
  display: inline-block;
}

.profile-picture {
  width: clamp(150px, 35vw, 280px);
  height: clamp(150px, 35vw, 280px);
  object-fit: cover;
  border-radius: 50%;
  display: block;
  border: 3px solid rgba(128, 128, 128, 0.15);
}

.wish {
  margin-top: 1.2rem;
  max-width: 90%;
}

.wish-hbd {
  font-size: clamp(1.4rem, 4.5vw, 2.5rem);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
}

.wish-hbd span {
  display: inline-block;
}

.wish-text {
  font-size: clamp(0.9rem, 2.8vw, 1.4rem);
  font-weight: 300;
  margin-top: 0.5rem;
  opacity: 0.7;
  overflow-wrap: break-word;
}

/* ── Confetti ──────────────────────────────────────────────────── */
.section-confetti {
  position: fixed !important;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.confetti-dot {
  position: absolute;
  width: 20px;
  visibility: hidden;
}

/* --- Memories ------------------------------------ */
.section-memories {
  z-index: 1;
}

.memory-header {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 1.4rem;
  max-width: 620px;
  text-align: center;
}

.memory-header h2 {
  font-size: clamp(1.6rem, 4.5vw, 2.4rem);
  letter-spacing: 0.5px;
}

.memory-header p {
  font-size: clamp(0.95rem, 2.8vw, 1.2rem);
  opacity: 0.7;
}

.memory-pill {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--accent), var(--primary));
  color: #0b1220;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  width: min(920px, 95vw);
}

.memory-card {
  position: relative;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  overflow: hidden;
  padding: 12px;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.25);
  transform: perspective(800px) rotateX(var(--tiltX, 0deg)) rotateY(var(--tiltY, 0deg));
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  pointer-events: auto;
}

.memory-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.35);
}

.memory-photo {
  width: 100%;
  padding-top: 70%;
  border-radius: 12px;
  background-size: cover;
  background-position: center;
  background-color: rgba(255, 255, 255, 0.05);
}

.memory-copy {
  text-align: left;
  padding: 12px 6px 6px;
}

.memory-copy h3 {
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.memory-copy p {
  font-size: 0.95rem;
  opacity: 0.7;
  line-height: 1.5;
}

/* ── Closing ───────────────────────────────────────────────────── */
.section-closing p {
  font-size: clamp(1rem, 3.5vw, 1.8rem);
  font-weight: 300;
  line-height: 1.9;
  padding: 0 1rem;
}

.replay-btn {
  cursor: pointer;
  z-index: 3;
  pointer-events: none;
  color: var(--accent) !important;
  font-weight: 500 !important;
  transition: opacity 0.3s ease;
}

.replay-btn:hover {
  opacity: 0.7;
}

.last-smile {
  font-size: clamp(2rem, 5vw, 3rem) !important;
  display: inline-block;
  margin-top: 1rem;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

/* ── Small mobile ──────────────────────────────────────────────── */
@media screen and (max-width: 600px) {
  .section {
    padding: 1.2rem 1rem;
  }

  .text-box {
    width: 94%;
    padding: 1.2rem;
  }

  .fake-btn {
    bottom: -36px;
    right: 8px;
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
  }

  .quote-card {
    width: 92%;
    padding: 1.5rem;
  }

  #theme-toggle {
    width: 38px;
    height: 38px;
    font-size: 1rem;
    top: 0.75rem;
    right: 0.75rem;
  }

  .wish-hbd {
    letter-spacing: 1px;
  }
}

/* ── Landscape mobile ─────────────────────────────────────────── */
@media screen and (max-height: 500px) {
  .section {
    padding: 0.5rem 1rem;
  }

  .greeting-title {
    font-size: clamp(1.8rem, 6vw, 3rem);
  }

  .profile-picture {
    width: clamp(100px, 25vw, 180px);
    height: clamp(100px, 25vw, 180px);
  }

  .wish-hbd {
    font-size: clamp(1.2rem, 3.5vw, 2rem);
  }

  .wish-text {
    font-size: clamp(0.8rem, 2vw, 1.1rem);
  }

  .countdown-num {
    font-size: clamp(4rem, 14vw, 7rem);
  }

  .quote-card {
    padding: 1.2rem;
  }

  .section-announcement p {
    font-size: clamp(1.4rem, 5vw, 2.2rem);
  }
}

/* ── SweetAlert2 ───────────────────────────────────────────────── */
.swal2-popup {
  border-radius: 16px !important;
}
