/* ── 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: 'Dancing Script', cursive;
  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 + Music (fixed, all sections) ──────────────────────── */
.floating-controls {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 0.5rem;
}

.floating-controls button {
  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;
}

.floating-controls button: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;
}

/* ── Ready prompt (before countdown) ───────────────────────────── */
.section-ready-prompt {
  z-index: 9000;
  pointer-events: none;
  justify-content: center;
  perspective: 1000px;
}

.ready-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at 50% 40%,
    rgba(244, 114, 182, 0.18) 0%,
    rgba(15, 23, 42, 0.75) 55%,
    rgba(15, 23, 42, 0.92) 100%
  );
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.ready-card {
  position: relative;
  z-index: 2;
  max-width: min(440px, 92vw);
  border-radius: 24px;
  transform-style: preserve-3d;
  overflow: visible;
}

.ready-card-inner {
  position: relative;
  z-index: 2;
  padding: 2rem 2rem 1.75rem;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.ready-card-glow {
  position: absolute;
  inset: -30%;
  z-index: 0;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    var(--primary) 0%,
    transparent 68%
  );
  opacity: 0.55;
  filter: blur(28px);
  pointer-events: none;
}

.ready-emoji {
  font-size: clamp(2.2rem, 8vw, 3rem);
  margin: 0 0 0.5rem;
  line-height: 1;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
}

.ready-heading {
  margin: 0 0 1.35rem;
  font-size: clamp(1.25rem, 4.2vw, 1.55rem);
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
}

.ready-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.ready-btn {
  pointer-events: auto;
  min-width: 110px;
  padding: 0.65rem 1.4rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ready-btn:active {
  transform: scale(0.97);
}

.ready-btn-yes {
  background: linear-gradient(145deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 6px 24px rgba(244, 114, 182, 0.45);
}

.ready-btn-yes:hover {
  transform: scale(1.04);
  box-shadow: 0 8px 28px rgba(244, 114, 182, 0.55);
}

.ready-btn-no {
  background: rgba(148, 163, 184, 0.2);
  color: var(--text);
  border: 1.5px solid rgba(148, 163, 184, 0.35);
}

.ready-btn-no:hover {
  transform: scale(1.03);
  background: rgba(148, 163, 184, 0.28);
}

/* ═══════════════════════════════════════════════════════════════
   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 {
  justify-content: center;
}

.announcement-fireworks {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Hidden until GSAP runs this section — announcement stacks above earlier sections */
.section-announcement .announcement-spark,
.section-announcement .announcement-text {
  opacity: 0;
}

.announcement-spark {
  position: absolute;
  border-radius: 50%;
  box-shadow: 0 0 10px 2px currentColor;
  will-change: transform, opacity;
}

.announcement-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: min(640px, 94vw);
}

.section-announcement .announcement-text {
  font-size: clamp(1.8rem, 6vw, 3rem);
  font-weight: 600;
  padding: 0.85rem 1.35rem;
  line-height: 1.2;
  border-radius: 20px;
  background: rgba(128, 128, 128, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

/* ── Chatbox ───────────────────────────────────────────────────── */
.section-chatbox {
  pointer-events: auto;
}

.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;
}

.chatbox-send-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0.5rem 1.4rem;
  position: absolute;
  right: 14px;
  bottom: -42px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chatbox-send-btn:hover:not(:disabled) {
  transform: scale(1.03);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.chatbox-send-btn:disabled {
  cursor: wait;
}

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

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

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

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

  .ready-card-inner {
    padding: 1.5rem 1.35rem 1.35rem;
  }

  .ready-heading {
    font-size: 1.15rem;
  }

  .floating-controls {
    top: 0.75rem;
    right: 0.75rem;
    gap: 0.35rem;
  }

  .floating-controls button {
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }

  .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 .announcement-text {
    font-size: clamp(1.4rem, 5vw, 2.2rem);
    padding: 0.65rem 1rem;
  }
}

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