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

:root {
  --white: #ffffff;
  --text-main: #fff8fb;
  --text-soft: rgba(255, 245, 249, 0.92);
  --text-muted: rgba(255, 239, 246, 0.78);

  --pink-light: #ff9bc5;
  --pink-main: #ff5fa2;
  --pink-strong: #ff2f87;
  --rose: #ff6f91;
  --purple: #8d63ff;
  --violet: #6e44ff;
  --gold: #ffd978;

  --glass-1: rgba(255, 255, 255, 0.16);
  --glass-2: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.24);

  --shadow-deep: 0 24px 70px rgba(0, 0, 0, 0.45);
  --shadow-card: 0 16px 40px rgba(0, 0, 0, 0.28);
  --shadow-pink: 0 0 35px rgba(255, 95, 162, 0.24);
  --shadow-violet: 0 0 45px rgba(141, 99, 255, 0.18);

  --btn-gradient: linear-gradient(135deg, #ff7db8 0%, #ff3d8f 45%, #8d63ff 100%);
  --card-gradient: linear-gradient(145deg, rgba(255,255,255,0.18), rgba(255,255,255,0.08));
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "Be Vietnam Pro", "Segoe UI", Arial, sans-serif;
  color: var(--text-main);
  background: #05030a;
}

body {
  position: relative;
  letter-spacing: 0.1px;
}

/* ===== BACKGROUND ===== */
.background-slider {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.hidden {
  display: none !important;
}
.bg-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1.12);
  filter: brightness(0.62) saturate(1.15) contrast(1.05);
  transition: opacity 1.8s ease, transform 7s ease, filter 1.8s ease;
}

.bg-slide.active {
  opacity: 1;
  transform: scale(1);
  filter: brightness(0.8) saturate(1.25) contrast(1.05);
}

.overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 111, 145, 0.26), transparent 24%),
    radial-gradient(circle at 85% 18%, rgba(141, 99, 255, 0.22), transparent 26%),
    radial-gradient(circle at 50% 100%, rgba(255, 217, 120, 0.12), transparent 24%),
    linear-gradient(135deg, rgba(9, 6, 18, 0.48), rgba(0, 0, 0, 0.7)),
    rgba(0, 0, 0, 0.18);
}

body::before,
body::after {
  content: "";
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
}

body::before {
  left: -80px;
  top: -60px;
  background: rgba(255, 80, 140, 0.16);
}

body::after {
  right: -100px;
  bottom: -80px;
  background: rgba(109, 76, 255, 0.14);
}

/* ===== PAGE ===== */
.page {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.page.active-page {
  display: flex;
  animation: pageReveal 0.8s cubic-bezier(.2,.8,.2,1);
}

.page-scroll {
  align-items: flex-start;
  overflow-y: auto;
  padding-top: 48px;
  padding-bottom: 70px;
}

.page-scroll::-webkit-scrollbar {
  width: 8px;
}

.page-scroll::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.04);
}

.page-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, rgba(255,255,255,0.18), rgba(255,95,162,0.65), rgba(141,99,255,0.65));
  border-radius: 999px;
}

@keyframes pageReveal {
  from {
    opacity: 0;
    transform: translateY(20px) scale(1.015);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ===== SHELL ===== */
.page-shell {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
}

/* ===== PREMIUM CARD ===== */
.glass-card,
.hero-card,
.final-card {
  position: relative;
  width: 100%;
  max-width: 580px;
  padding: 36px 30px;
  border-radius: 30px;
  background: var(--card-gradient);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    var(--shadow-deep),
    var(--shadow-pink),
    inset 0 1px 0 rgba(255,255,255,0.14);
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}

.hero-card {
  max-width: 780px;
}

.final-card {
  max-width: 840px;
  margin: 0 auto;
}

.glass-card::before,
.hero-card::before,
.final-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.08), transparent 26%, transparent 70%, rgba(255,255,255,0.04));
  pointer-events: none;
  z-index: -1;
}

.glass-card::after,
.hero-card::after,
.final-card::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -60px;
  top: -70px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 120, 180, 0.22), transparent 68%);
  filter: blur(12px);
  pointer-events: none;
  z-index: -1;
}

/* ===== TYPOGRAPHY ===== */
.small-title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 15px;
  border-radius: 999px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(255,255,255,0.14), rgba(255,255,255,0.08));
  border: 1px solid rgba(255,255,255,0.16);
  color: #fff3f8;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  box-shadow: 0 4px 16px rgba(255,255,255,0.05);
}

h1,
h2,
h3 {
  color: #ffffff;
  line-height: 1.22;
  text-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
}

h1 {
  font-size: 40px;
  margin-bottom: 14px;
  font-weight: 800;
}

h2 {
  font-size: 34px;
  margin-bottom: 14px;
  font-weight: 800;
}

h3 {
  font-size: 24px;
  margin-bottom: 10px;
  font-weight: 700;
}

.description,
.hero-text,
.final-text,
.section-header p,
.video-note,
.timeline-text,
.gallery-caption,
.secret-message-box {
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1.85;
}

.section-header {
  margin-bottom: 34px;
  text-align: center;
}

.section-header h2 {
  margin-bottom: 10px;
}

.section-header p {
  max-width: 760px;
  margin: 0 auto;
}

.bottom-actions,
.hero-actions {
  display: flex;
  justify-content: center;
  margin-top: 28px;
  margin-bottom: 100px;
}

/* ===== BUTTONS ===== */
.main-btn,
.secondary-btn,
.tab-btn {
  border: none;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, opacity 0.25s ease;
  font-weight: 800;
  font-size: 15px;
}

.main-btn {
  position: relative;
  padding: 15px 26px;
  border-radius: 16px;
  color: #fff;
  background: var(--btn-gradient);
  box-shadow:
    0 14px 30px rgba(255, 61, 143, 0.34),
    0 0 24px rgba(141, 99, 255, 0.2),
    inset 0 1px 0 rgba(255,255,255,0.22);
}

.main-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow:
    0 18px 34px rgba(255, 61, 143, 0.42),
    0 0 30px rgba(141, 99, 255, 0.26),
    inset 0 1px 0 rgba(255,255,255,0.24);
}

.main-btn:active {
  transform: scale(0.985);
}

.secondary-btn {
  padding: 14px 20px;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(135deg, rgba(255,255,255,0.16), rgba(255,255,255,0.08));
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: 0 10px 22px rgba(0,0,0,0.2);
}

.secondary-btn:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(255,255,255,0.22), rgba(255,255,255,0.12));
}

.secondary-btn:disabled,
.main-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ===== LOCK ===== */
.tabs {
  display: flex;
  gap: 12px;
  margin: 22px 0;
}

.tab-btn {
  flex: 1;
  padding: 13px 14px;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.06));
  border: 1px solid rgba(255,255,255,0.12);
}

.tab-btn.active,
.tab-btn:hover {
  background: linear-gradient(135deg, rgba(255, 95, 162, 0.45), rgba(141, 99, 255, 0.34));
  box-shadow: 0 10px 22px rgba(255, 95, 162, 0.16);
}

.tab-content {
  display: none;
  text-align: left;
  animation: tabFade 0.35s ease;
}

.tab-content.active {
  display: block;
}

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

label {
  display: block;
  margin-bottom: 9px;
  font-size: 14px;
  font-weight: 600;
  color: #fff2f7;
}

input {
  width: 100%;
  padding: 15px 16px;
  margin-bottom: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.95);
  color: #1b1420;
  font-size: 15px;
  outline: none;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.06);
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

input::placeholder {
  color: rgba(40, 22, 35, 0.45);
}

input:focus {
  border-color: rgba(255, 95, 162, 0.72);
  box-shadow:
    0 0 0 4px rgba(255, 95, 162, 0.14),
    inset 0 2px 8px rgba(0,0,0,0.04);
  transform: translateY(-1px);
}

.message {
  min-height: 24px;
  margin-top: 14px;
  color: #ffe997;
  text-align: center;
  font-weight: 800;
  font-size: 14px;
  text-shadow: 0 0 14px rgba(255, 217, 120, 0.35);
}

/* ===== OPENING HERO ===== */
.cinematic {
  animation: cinematicCardGlow 3.5s ease-in-out infinite alternate;
}

@keyframes cinematicCardGlow {
  from {
    box-shadow:
      var(--shadow-deep),
      0 0 24px rgba(255,95,162,0.14),
      inset 0 1px 0 rgba(255,255,255,0.12);
  }
  to {
    box-shadow:
      var(--shadow-deep),
      0 0 36px rgba(255,95,162,0.26),
      0 0 46px rgba(141,99,255,0.18),
      inset 0 1px 0 rgba(255,255,255,0.16);
  }
}

/* ===== TIMELINE ===== */
.timeline-list {
  position: relative;
  padding-left: 30px;
}

.timeline-list::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 12px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.14), var(--pink-main), var(--purple));
  box-shadow: 0 0 20px rgba(255, 95, 162, 0.22);
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 20px;
  margin-bottom: 30px;
  padding: 18px;
  border-radius: 26px;
  background: linear-gradient(145deg, rgba(255,255,255,0.16), rgba(255,255,255,0.08));
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: var(--shadow-card);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
  overflow: hidden;
}

.timeline-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.05), transparent);
  transform: translateX(-100%);
  transition: transform 0.8s ease;
  pointer-events: none;
}

.timeline-item:hover {
  transform: translateY(-5px);
  box-shadow:
    var(--shadow-card),
    0 0 28px rgba(255,95,162,0.12);
}

.timeline-item:hover::after {
  transform: translateX(100%);
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -24px;
  top: 24px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 12%, var(--pink-light) 45%, var(--pink-strong) 100%);
  box-shadow:
    0 0 0 6px rgba(255,255,255,0.08),
    0 0 20px rgba(255,95,162,0.46);
}

.timeline-item img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 12px 24px rgba(0,0,0,0.28);
}

.timeline-date {
  display: inline-block;
  margin-bottom: 10px;
  padding: 7px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255,255,255,0.14), rgba(255,255,255,0.06));
  color: #fff1f6;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.4px;
}

.timeline-title {
  margin-bottom: 8px;
  font-size: 24px;
  font-weight: 800;
  color: #fff;
}

.timeline-text {
  font-size: 15px;
  line-height: 1.85;
}

/* ===== GALLERY ===== */
.gallery-box {
  width: 100%;
  max-width: 820px;
  margin: 0 auto 34px;
}

.gallery-main {
  position: relative;
  padding: 18px;
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(255,255,255,0.16), rgba(255,255,255,0.08));
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: var(--shadow-card), var(--shadow-violet);
  overflow: hidden;
}

.gallery-main::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.05), transparent 30%, transparent 75%, rgba(255,255,255,0.03));
  pointer-events: none;
}

.gallery-main img {
  width: 100%;
  height: 470px;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: 0 14px 28px rgba(0,0,0,0.3);
  animation: imageFade 0.55s ease;
}

@keyframes imageFade {
  from {
    opacity: 0.45;
    transform: scale(1.04);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
}

.gallery-caption {
  margin-top: 14px;
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  color: #fff4f8;
}

.gallery-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

/* ===== VIDEO ===== */
.video-section {
  max-width: 820px;
  margin: 0 auto;
  padding: 22px;
  text-align: center;
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(255,255,255,0.16), rgba(255,255,255,0.08));
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: var(--shadow-card);
}

.video-note {
  color: var(--text-muted);
}

.media-player {
  width: 100%;
  margin-top: 16px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 14px 28px rgba(0,0,0,0.28);
}

.audio-player {
  height: 56px;
}

/* ===== MINI GAME ===== */
.heart-game {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin: 28px 0;
  flex-wrap: wrap;
}

.secret-heart {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.16);
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.24), rgba(255,255,255,0.06));
  color: #fff;
  font-size: 35px;
  cursor: pointer;
  box-shadow:
    0 14px 28px rgba(0,0,0,0.26),
    0 0 18px rgba(255,95,162,0.12);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.secret-heart::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: conic-gradient(from 180deg, rgba(255,95,162,0.14), rgba(141,99,255,0.12), rgba(255,95,162,0.14));
  z-index: -1;
  filter: blur(8px);
}

.secret-heart:hover {
  transform: scale(1.1) rotate(-5deg);
  box-shadow:
    0 18px 32px rgba(0,0,0,0.32),
    0 0 26px rgba(255,95,162,0.24);
}

.secret-heart.opened {
  background: linear-gradient(135deg, #ff8fc2, #ff3d8f, #8d63ff);
  box-shadow:
    0 16px 32px rgba(255,61,143,0.34),
    0 0 26px rgba(141,99,255,0.24);
}

.secret-message-box {
  min-height: 126px;
  padding: 20px;
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(255,255,255,0.14), rgba(255,255,255,0.08));
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
  font-size: 15px;
  line-height: 1.9;
}

/* ===== FINAL ===== */
.final-photo {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 24px;
  margin-bottom: 22px;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 16px 30px rgba(0,0,0,0.3);
}

.countdown-box {
  margin-top: 28px;
  padding: 20px;
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(255,255,255,0.12), rgba(255,255,255,0.07));
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.countdown-label {
  margin-bottom: 10px;
  color: #fff0f6;
  font-weight: 600;
}


.final-reveal {
  margin-top: 24px;
  font-size: 50px;
  font-weight: 900;
  color: #fff;
  text-shadow:
    0 0 12px rgba(255,255,255,0.2),
    0 0 24px rgba(255,95,162,0.7),
    0 0 34px rgba(141,99,255,0.25);
  animation: pulseLove 1.15s ease-in-out infinite alternate;
}

@keyframes pulseLove {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.075);
  }
}

/* ===== EFFECT LAYERS ===== */
#hearts-container,
#snow-container {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.heart {
  position: absolute;
  bottom: -40px;
  font-size: 18px;
  opacity: 0.9;
  filter: drop-shadow(0 0 10px rgba(255, 95, 162, 0.5));
  animation: floatHeart linear forwards;
}

@keyframes floatHeart {
  0% {
    transform: translateY(0) translateX(0) scale(0.85);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  100% {
    transform: translateY(-120vh) translateX(55px) scale(1.35);
    opacity: 0;
  }
}

.snowflake {
  position: absolute;
  top: -20px;
  color: white;
  opacity: 0.72;
  text-shadow: 0 0 10px rgba(255,255,255,0.4);
  animation: snowfall linear forwards;
}

@keyframes snowfall {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.8;
  }
  100% {
    transform: translateY(110vh) translateX(40px) rotate(180deg);
    opacity: 0;
  }
}

#fireworks-canvas {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

/* ===== SUBTLE FLOAT ===== */
.glass-card,
.final-card,
.timeline-item,
.gallery-main,
.video-section {
  animation: softFloat 5.5s ease-in-out infinite;
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .timeline-item {
    grid-template-columns: 1fr;
  }

  .timeline-item img {
    height: 220px;
  }
}

@media (max-width: 768px) {
  .page {
    padding: 18px;
  }

  .glass-card,
  .hero-card,
  .final-card {
    padding: 28px 20px;
    border-radius: 24px;
  }

  h1 {
    font-size: 31px;
  }

  h2 {
    font-size: 28px;
  }

  h3 {
    font-size: 22px;
  }

  .description,
  .hero-text,
  .final-text,
  .section-header p,
  .video-note,
  .timeline-text,
  .gallery-caption,
  .secret-message-box {
    font-size: 15px;
    line-height: 1.8;
  }

  .gallery-main img {
    height: 300px;
  }

  .countdown {
    font-size: 52px;
  }

 

  .secret-heart {
    width: 84px;
    height: 84px;
    font-size: 30px;
  }

  .tabs {
    flex-direction: column;
  }
}


/* =========================
   BIRTHDAY OVERLAY - CINEMATIC
========================= */
/* =========================
   PAGE / ROUTER BASE
========================= */
.page {
  display: none;
  min-height: 100vh;
  width: 100%;
  position: relative;
}

.page.active-page {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Bắt buộc phải có */
.hidden {
  display: none !important;
}

/* =========================
   OPENING PAGE
========================= */
#opening-page {
  position: relative;
  overflow: hidden;
  padding: 24px;
  background:
    radial-gradient(circle at top, rgba(255, 130, 180, 0.18), transparent 30%),
    linear-gradient(135deg, #1c1028 0%, #271437 40%, #120b1f 100%);
}

.hero-card.cinematic {
  width: min(680px, 92vw);
  padding: 40px 30px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(14px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  text-align: center;
  z-index: 2;
}

.small-title {
  font-size: 14px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255, 236, 244, 0.8);
  margin-bottom: 12px;
}

#openingTitle {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.2;
  color: #fff7fb;
  margin-bottom: 18px;
}

.hero-text {
  font-size: 17px;
  line-height: 1.8;
  color: rgba(255, 244, 248, 0.92);
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  justify-content: center;
  align-items: center;
}

.main-btn {
  border: none;
  outline: none;
  cursor: pointer;
  padding: 14px 26px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, #ff5fa2, #8d63ff);
  box-shadow: 0 10px 30px rgba(255, 95, 162, 0.35);
  transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
}

.main-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 14px 36px rgba(255, 95, 162, 0.45);
}

.main-btn:active {
  transform: scale(0.98);
}

/* =========================
   BIRTHDAY OVERLAY
============================================================ */
/* =========================
   BIRTHDAY OVERLAY
========================= */
.birthday-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  background: rgba(10, 6, 20, 0.78);
  overflow: hidden;
}

.birthday-overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.birthday-backdrop-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 150, 210, 0.22), transparent 25%),
    radial-gradient(circle at 50% 50%, rgba(141, 99, 255, 0.18), transparent 35%);
  filter: blur(18px);
}

.floating-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.floating-particles::before,
.floating-particles::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.9) 1.2px, transparent 1.2px),
    radial-gradient(circle, rgba(255,170,210,0.8) 1.4px, transparent 1.4px),
    radial-gradient(circle, rgba(255,217,120,0.8) 1.6px, transparent 1.6px);
  background-size: 120px 120px, 180px 180px, 220px 220px;
  animation: floatSparkle 12s linear infinite;
  opacity: 0.6;
}

.floating-particles::after {
  animation-duration: 18s;
  opacity: 0.35;
  transform: scale(1.08);
}

@keyframes floatSparkle {
  from {
    transform: translateY(30px);
  }
  to {
    transform: translateY(-30px);
  }
}

#opening-page .birthday-scene {
  position: relative;
  z-index: 3;
  width: min(760px, 100%);
  min-height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px 20px 32px;
}

.birthday-scene-title {
  font-size: clamp(24px, 4vw, 38px);
  font-weight: 800;
  color: #fff7fc;
  margin-bottom: 26px;
  text-shadow: 0 0 18px rgba(255, 170, 220, 0.22);
}

.birthday-wish-text {
  max-width: 720px;
  font-size: 17px;
  line-height: 1.8;
  color: rgba(255, 245, 248, 0.95);
  margin-top: 24px;
}

.birthday-action-area {
  margin-top: 24px;
}

/* =========================
   CAKE
========================= */
#opening-page .cake-wrap {
  position: relative;
  width: min(520px, 92vw);
  height: 360px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.cake-shadow {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 210px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.28);
  filter: blur(10px);
}

.cake-candle-area {
  position: absolute;
  top: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
}

.candle-btn {
  position: relative;
  width: 36px;
  height: 96px;
  background: transparent;
  border: none;
  cursor: pointer;
}

.candle-body {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 62px;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffd1e6 0%, #ff84b5 100%);
  box-shadow: inset -2px 0 0 rgba(255,255,255,0.3);
}

.candle-thread {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 10px;
  border-radius: 999px;
  background: #3b2f2f;
}

.candle-flame {
  position: absolute;
  top: 0;
  left: 50%;
  width: 18px;
  height: 26px;
  transform: translateX(-50%);
  border-radius: 50% 50% 50% 50% / 65% 65% 35% 35%;
  background: radial-gradient(circle at 50% 35%, #fff6b0 0%, #ffd978 35%, #ff8a00 100%);
  box-shadow:
    0 0 18px rgba(255, 208, 90, 0.95),
    0 0 36px rgba(255, 160, 70, 0.55);
  animation: flameFlicker 1s infinite ease-in-out;
}

.flame-glow {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 200, 90, 0.35);
  filter: blur(10px);
  animation: glowPulse 1.2s infinite ease-in-out;
}

@keyframes flameFlicker {
  0%, 100% {
    transform: translateX(-50%) scale(1) rotate(-2deg);
  }
  50% {
    transform: translateX(-50%) scale(1.06) rotate(2deg);
  }
}

@keyframes glowPulse {
  0%, 100% {
    opacity: 0.65;
    transform: translateX(-50%) scale(1);
  }
  50% {
    opacity: 1;
    transform: translateX(-50%) scale(1.08);
  }
}

.candle-flame.blown-out,
.flame-glow.blown-out {
  opacity: 0;
  transform: translateX(-50%) scale(0.4);
  transition: all 0.5s ease;
}

.candle-btn.smoke::after,
.candle-btn.smoke::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(220, 220, 220, 0.55);
  filter: blur(4px);
  animation: smokeUp 1.4s ease-out forwards;
}

.candle-btn.smoke::before {
  margin-left: -10px;
  animation-delay: 0.15s;
}

.candle-btn.smoke::after {
  margin-left: 2px;
}

@keyframes smokeUp {
  0% {
    opacity: 0.65;
    transform: translate(-50%, 0) scale(0.8);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -36px) scale(1.8);
  }
}

#opening-page .cake {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  width: 260px;
  height: 250px;
  z-index: 3;
}

.cake-top,
.cake-middle,
.cake-bottom {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 18px;
}

.cake-top {
  top: 24px;
  width: 160px;
  height: 48px;
  background: linear-gradient(180deg, #ffd8ea, #ffb7d2);
}

.cake-middle {
  top: 76px;
  width: 205px;
  height: 58px;
  background: linear-gradient(180deg, #ffb4d0, #ff90bb);
}

.cake-bottom {
  top: 136px;
  width: 250px;
  height: 76px;
  background: linear-gradient(180deg, #ff8fbc, #ff6fa8);
}

.cake-cream-line {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 245, 250, 0.95);
}

.line-1 {
  top: 70px;
  width: 170px;
}

.line-2 {
  top: 130px;
  width: 214px;
}

.cake-drip {
  position: absolute;
  top: 18px;
  background: #fff2f7;
  border-radius: 0 0 16px 16px;
  z-index: 4;
}

.drip-1 {
  left: 78px;
  width: 14px;
  height: 28px;
}

.drip-2 {
  left: 118px;
  width: 18px;
  height: 38px;
}

.drip-3 {
  left: 158px;
  width: 13px;
  height: 24px;
}

.cake-decor {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff4a8;
  box-shadow: 0 0 12px rgba(255, 240, 170, 0.4);
}

.decor-1 {
  top: 92px;
  left: 30px;
}

.decor-2 {
  top: 92px;
  right: 30px;
}

.decor-3 {
  top: 156px;
  left: 22px;
}

.decor-4 {
  top: 156px;
  right: 22px;
}

.decor-5 {
  top: 172px;
  left: 50%;
  transform: translateX(-50%);
}

.cake-plate {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 272px;
  height: 20px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ebe4ff, #cfc3ff);
}

/*=============================================================*/
/* ===== LOVE COUNTER ===== */
.love-counter-card {
  margin-top: 26px;
  margin-bottom: 28px;
  padding: 24px 20px;
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.15), rgba(255,255,255,0.08));
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow:
    0 16px 34px rgba(0,0,0,0.24),
    0 0 24px rgba(255,95,162,0.12);
  position: relative;
  overflow: hidden;
}

.love-counter-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top left, rgba(255, 105, 160, 0.12), transparent 30%),
    radial-gradient(circle at bottom right, rgba(141, 99, 255, 0.1), transparent 28%);
  pointer-events: none;
}

.love-counter-label {
  font-size: 15px;
  font-weight: 600;
  color: #fff0f6;
  margin-bottom: 14px;
  text-align: center;
}

.love-counter-main {
  text-align: center;
  margin-bottom: 18px;
}

.love-number {
  font-size: 72px;
  line-height: 1;
  font-weight: 900;
  color: #fff;
  text-shadow:
    0 0 12px rgba(255,255,255,0.16),
    0 0 24px rgba(255,95,162,0.45),
    0 0 34px rgba(141,99,255,0.22);
  animation: loveNumberPulse 1.8s ease-in-out infinite alternate;
}

.love-text {
  margin-top: 10px;
  font-size: 20px;
  font-weight: 700;
  color: #fff5f8;
}

.love-counter-detail {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.love-unit {
  padding: 14px 10px;
  border-radius: 18px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.love-unit span {
  display: block;
  font-size: 28px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 4px;
}

.love-unit small {
  font-size: 13px;
  color: rgba(255,245,249,0.86);
}

.love-since {
  margin-top: 16px;
  text-align: center;
  font-size: 14px;
  color: rgba(255,245,249,0.82);
}

.love-since span {
  font-weight: 700;
  color: #fff7fb;
}

@keyframes loveNumberPulse {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.04);
  }
}

@media (max-width: 768px) {
  .love-number {
    font-size: 52px;
  }

  .love-text {
    font-size: 17px;
  }

  .love-counter-detail {
    grid-template-columns: 1fr;
  }

  .love-unit span {
    font-size: 24px;
  }
}
.countdown {
  font-size: 70px;
  font-weight: 900;
  line-height: 1;
  color: #fff;
  text-shadow:
    0 0 16px rgba(255,255,255,0.16),
    0 0 28px rgba(255,95,162,0.5),
    0 0 36px rgba(141,99,255,0.26);
  animation: countdownPulse 1s ease-in-out infinite;
}

@keyframes countdownPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}
.page.active-page#opening-page {
  display: flex;
  align-items: center;
  justify-content: center;
}
html,
body {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

#opening-page.page {
  inset: 0;
  padding: 0;
}

#opening-page {
  position: relative;
  min-height: 100dvh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  overflow: hidden;
}

#opening-page.page.active-page {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: none;
}

#opening-page .birthday-scene {
  margin-top: 100px;
  width: min(760px, 100%);
  min-height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  padding: 28px 20px 32px 100px;
}

#opening-page .cake-wrap {
  position: relative;
  width: min(520px, 92vw);
  height: 360px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

#opening-page .cake {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  width: 260px;
  height: 250px;
  z-index: 3;
}

#opening-page .candles-row {
  position: absolute;
  left: 50%;
  top: 34px;
  transform: translateX(-50%);
  width: 190px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  z-index: 5;
}

@media (max-width: 768px) {
  #opening-page {
    padding: 20px 14px;
  }

  #opening-page .birthday-scene {
    padding: 16px 10px 24px;
  }

  #opening-page .cake-wrap {
    width: min(430px, 96vw);
    height: 320px;
  }

  #opening-page .cake {
    transform: translateX(-50%) scale(0.82);
    transform-origin: bottom center;
  }

  #opening-page .candles-row {
    top: 42px;
    width: 170px;
  }
}
.timeline-slider {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
}

.timeline-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* đổi thành contain nếu muốn hiện toàn bộ ảnh */
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 0.8s ease, transform 1s ease;
}

.timeline-slide.active {
  opacity: 1;
  transform: scale(1);
}
.video-wrapper {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
}

.video-wrapper iframe {
  width: 100%;
  height: 100%;
  border-radius: 12px;
}
