/* ── CSS Custom Properties (set dynamically by main.js) ──────── */
:root {
  --primary: #f472b6;
  --accent: #60a5fa;
  --bg: #0f172a;
  --text: #f1f5f9;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --album-glass: color-mix(in srgb, var(--text) 7%, transparent);
  --album-border: color-mix(in srgb, var(--text) 16%, transparent);
  --album-paper: color-mix(in srgb, var(--bg) 84%, var(--text));
  --album-shadow: color-mix(in srgb, var(--bg) 55%, transparent);
}

/* ── 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: 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;
}

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

.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.section-stars {
  position: fixed;
  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.section-fireworks {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

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

/* ── Balloons ──────────────────────────────────────────────────── */
.section.section-balloons {
  position: fixed;
  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.section-confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

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

/* ── Album ─────────────────────────────────────────────────────── */
.section-album {
  z-index: 1;
}

.album-shell {
  position: relative;
  width: min(94vw, 760px);
  padding: clamp(var(--space-5), 4vw, var(--space-8));
  border: 1.5px solid var(--album-border);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 18% 18%, color-mix(in srgb, var(--primary) 26%, transparent), transparent 30%),
    radial-gradient(circle at 82% 12%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 28%),
    linear-gradient(145deg, var(--album-glass), color-mix(in srgb, var(--bg) 82%, transparent));
  box-shadow: 0 28px 80px var(--album-shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.album-shell::before,
.album-shell::after {
  content: "";
  position: absolute;
  border: 1px solid var(--album-border);
  border-radius: 999px;
  pointer-events: none;
}

.album-shell::before {
  inset: var(--space-3);
}

.album-shell::after {
  width: clamp(76px, 16vw, 128px);
  height: clamp(76px, 16vw, 128px);
  right: clamp(var(--space-4), 4vw, var(--space-8));
  top: clamp(var(--space-4), 4vw, var(--space-8));
  background: repeating-conic-gradient(
    from 12deg,
    color-mix(in srgb, var(--primary) 36%, transparent) 0deg 18deg,
    transparent 18deg 42deg
  );
  opacity: 0.32;
}

.album-kicker {
  font-size: clamp(0.72rem, 2vw, 0.9rem);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.album-title {
  margin-top: var(--space-2);
  font-size: clamp(2rem, 7vw, 4rem);
  line-height: 1;
  font-weight: 800;
  color: var(--primary);
}

.album-subtitle {
  width: min(92%, 520px);
  margin: var(--space-3) auto 0;
  font-size: clamp(0.9rem, 2.4vw, 1.08rem);
  font-weight: 300;
  line-height: 1.7;
  opacity: 0.72;
}

.album-stage {
  position: relative;
  min-height: clamp(340px, 55vh, 470px);
  margin-top: clamp(var(--space-5), 4vw, var(--space-8));
  display: grid;
  place-items: center;
}

.album-cylinder {
  position: absolute;
  width: clamp(218px, 38vw, 330px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1.5px solid var(--album-border);
  background:
    radial-gradient(circle at center, var(--album-glass) 0 18%, transparent 19% 31%, var(--album-border) 32% 34%, transparent 35%),
    conic-gradient(from 20deg, color-mix(in srgb, var(--primary) 20%, transparent), transparent, color-mix(in srgb, var(--accent) 22%, transparent), transparent, color-mix(in srgb, var(--primary) 20%, transparent));
  box-shadow: inset 0 0 42px color-mix(in srgb, var(--bg) 70%, transparent);
  opacity: 0.58;
}

.album-cylinder::before {
  content: "";
  position: absolute;
  inset: 40%;
  border-radius: 50%;
  border: 1.5px solid var(--album-border);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
}

.album-chamber {
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(42px, 8vw, 66px);
  aspect-ratio: 1;
  padding: var(--space-1);
  border-radius: 50%;
  border: 1px solid var(--album-border);
  background: var(--album-paper);
  box-shadow: 0 8px 22px var(--album-shadow);
  transform: translate(-50%, -50%) rotate(var(--slot-angle)) translateY(clamp(-118px, -17vw, -82px)) rotate(calc(-1 * var(--slot-angle)));
  overflow: hidden;
}

.album-chamber img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  filter: saturate(0.9);
}

.album-pointer {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(12px, 2vw, 18px);
  height: clamp(72px, 13vw, 112px);
  border-radius: 999px;
  background: linear-gradient(to bottom, var(--primary), var(--accent));
  box-shadow: 0 0 24px color-mix(in srgb, var(--primary) 36%, transparent);
  transform: translate(-50%, -105%);
  transform-origin: 50% 100%;
}

.album-card-stack {
  position: relative;
  width: clamp(240px, 48vw, 380px);
  min-height: clamp(300px, 50vw, 430px);
  z-index: 1;
}

.album-card {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  filter: drop-shadow(0 24px 34px var(--album-shadow));
}

.album-photo-frame {
  position: relative;
  width: 100%;
  padding: clamp(var(--space-3), 2.4vw, var(--space-5));
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--text) 88%, var(--bg)), var(--album-paper));
  border: 1.5px solid color-mix(in srgb, var(--text) 22%, transparent);
  box-shadow: inset 0 0 0 var(--space-2) color-mix(in srgb, var(--bg) 74%, transparent);
}

.album-photo-frame::before {
  content: "";
  position: absolute;
  inset: clamp(var(--space-2), 1.8vw, var(--space-4));
  border: 1px dashed color-mix(in srgb, var(--bg) 44%, transparent);
  border-radius: var(--radius-md);
  pointer-events: none;
  z-index: 1;
}

.album-photo {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--album-border);
}

.album-frame-pin {
  position: absolute;
  width: var(--space-3);
  height: var(--space-3);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 44%, transparent);
  z-index: 2;
}

.album-frame-pin.top-left { left: var(--space-4); top: var(--space-4); }
.album-frame-pin.top-right { right: var(--space-4); top: var(--space-4); }
.album-frame-pin.bottom-left { left: var(--space-4); bottom: var(--space-4); }
.album-frame-pin.bottom-right { right: var(--space-4); bottom: var(--space-4); }

.album-caption {
  margin: var(--space-4) auto 0;
  max-width: 90%;
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--album-border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  font-size: clamp(0.82rem, 2.2vw, 1rem);
  font-weight: 300;
  line-height: 1.5;
}

.album-counter {
  margin-top: var(--space-2);
  font-size: clamp(0.82rem, 2vw, 0.95rem);
  letter-spacing: 0.24em;
  color: var(--accent);
}

.album-total {
  color: var(--text);
  opacity: 0.45;
}

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

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

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

.section-closing .last-smile {
  font-size: clamp(2rem, 5vw, 3rem);
  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;
  }

  .album-shell {
    width: min(96vw, 420px);
  }

  .album-stage {
    min-height: 360px;
  }

  .album-shell::after {
    opacity: 0.18;
  }
}

/* ── 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;
  }

  .album-shell {
    width: min(94vw, 680px);
    padding: var(--space-4);
  }

  .album-title {
    font-size: clamp(1.6rem, 5vw, 2.4rem);
  }

  .album-subtitle,
  .album-counter {
    display: none;
  }

  .album-stage {
    min-height: 250px;
    margin-top: var(--space-4);
  }

  .album-card-stack {
    width: clamp(190px, 36vw, 260px);
    min-height: 230px;
  }

  .album-cylinder {
    width: clamp(180px, 34vw, 240px);
  }

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

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