/* =========================================================
   VALENTINE'S DAY — BLUSH, ROSE RED & ROSE GOLD VARIABLES
   ========================================================= */
:root {
  --bg-deep: #240914;
  --bg-plum: #441024;
  --bg-blush: #6f1d3a;

  --rose-red: #e63960;
  --blush: #ffd1dc;
  --rose-gold: #f0b7a4;
  --rose-gold-bright: #ffe0d4;
  --ivory: #fff6f8;
  --muted: rgba(255, 224, 232, 0.76);

  --pill-bg: linear-gradient(155deg, rgba(255, 198, 214, 0.16), rgba(92, 18, 44, 0.56));
  --pill-border: rgba(240, 183, 164, 0.42);

  --font-script: "Great Vibes", cursive;
  --font-serif: "Cormorant Garamond", Georgia, serif;
  --font-ui: "Nunito", system-ui, sans-serif;
}

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

html, body {
  height: 100%;
  width: 100%;
  overflow-x: hidden;
  background: radial-gradient(circle at 50% 25%, var(--bg-blush) 0%, var(--bg-plum) 46%, var(--bg-deep) 100%);
  color: var(--ivory);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

body {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  position: relative;
  cursor: pointer;
}

#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* Soft Romantic Bokeh Orbs */
.bokeh-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(55px);
  opacity: 0.42;
  animation: orbFloat 14s ease-in-out infinite alternate;
}

.o1 { width: 38vw; height: 38vw; top: -8%; left: -6%; background: #ff7597; }
.o2 { width: 32vw; height: 32vw; bottom: -10%; right: -4%; background: #f0b7a4; animation-delay: 2.5s; }
.o3 { width: 24vw; height: 24vw; top: 38%; right: 14%; background: #d62857; animation-delay: 5s; }
.o4 { width: 26vw; height: 26vw; bottom: 12%; left: 10%; background: #ff9bb3; animation-delay: 7s; }

@keyframes orbFloat {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(24px, -22px) scale(1.12); }
}

/* Controls */
.controls {
  position: fixed;
  top: clamp(14px, 2.5vw, 26px);
  right: clamp(14px, 2.5vw, 26px);
  z-index: 25;
  display: flex;
  gap: 10px;
}

.ctrl-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(240, 183, 164, 0.45);
  background: rgba(54, 14, 30, 0.56);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--rose-gold-bright);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.ctrl-btn svg { width: 18px; height: 18px; }
.ctrl-btn:hover, .ctrl-btn:focus-visible {
  transform: scale(1.07);
  background: rgba(230, 57, 96, 0.52);
  box-shadow: 0 0 20px rgba(255, 166, 188, 0.4);
  outline: none;
}
.ctrl-btn[aria-pressed="true"] { background: var(--rose-red); color: #fff; border-color: var(--blush); }

#sound-btn .icon-on { display: none; }
#sound-btn[aria-pressed="true"] .icon-on { display: block; }
#sound-btn[aria-pressed="true"] .icon-off { display: none; }
#fullscreen-btn .icon-compress { display: none; }
body.is-fullscreen #fullscreen-btn .icon-compress { display: block; }
body.is-fullscreen #fullscreen-btn .icon-expand { display: none; }

.toast {
  position: fixed;
  top: 72px;
  right: clamp(14px, 2.5vw, 26px);
  z-index: 30;
  padding: 9px 18px;
  border-radius: 999px;
  background: rgba(68, 16, 36, 0.92);
  border: 1px solid var(--rose-gold);
  color: var(--ivory);
  font-size: 0.85rem;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* Main Stage */
.stage {
  position: relative;
  z-index: 10;
  width: min(920px, 92vw);
  padding: clamp(32px, 5vh, 56px) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(16px, 2.8vh, 30px);
}

/* Pulsing Heart */
.heart-emblem {
  width: clamp(54px, 7.5vw, 78px);
  filter: drop-shadow(0 0 26px rgba(230, 57, 96, 0.65));
  animation: heartbeat 1.7s ease-in-out infinite;
}

body.final-ten .heart-emblem {
  animation-duration: 0.72s;
  filter: drop-shadow(0 0 42px rgba(255, 92, 132, 0.95));
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.16); }
  28% { transform: scale(1); }
  42% { transform: scale(1.1); }
  62% { transform: scale(1); }
}

.hero-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.eyebrow {
  font-size: clamp(0.76rem, 1.3vw, 0.92rem);
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--rose-gold);
}

.title {
  font-family: var(--font-script);
  font-size: clamp(3.3rem, 9.6vw, 6.8rem);
  font-weight: 400;
  line-height: 1.06;
  background: linear-gradient(180deg, #fff8fa 0%, #ffd0dc 55%, #f0b7a4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 24px rgba(158, 25, 61, 0.55));
}

.milestone-badge {
  margin-top: 6px;
  padding: 6px 18px;
  border-radius: 999px;
  background: rgba(230, 57, 96, 0.32);
  border: 1px solid rgba(255, 209, 220, 0.55);
  color: #fff;
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

/* Soft Romantic Pill Cards */
.countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(12px, 2.2vw, 22px);
  width: 100%;
}

.love-pill {
  padding: clamp(20px, 3.2vw, 34px) 10px clamp(16px, 2.4vw, 24px);
  border-radius: 42px;
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow:
    0 20px 44px rgba(24, 4, 12, 0.42),
    inset 0 1px 0 rgba(255, 232, 238, 0.32);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.love-pill:hover {
  transform: translateY(-5px);
  border-color: var(--blush);
  box-shadow: 0 24px 50px rgba(24, 4, 12, 0.5), 0 0 34px rgba(255, 166, 188, 0.32);
}

body.final-ten .love-pill[data-unit="seconds"] {
  transform: scale(1.08);
  border-color: #fff;
  box-shadow: 0 0 46px rgba(255, 102, 144, 0.65);
}

.digits {
  display: inline-flex;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 6.8vw, 5.1rem);
  font-weight: 700;
  line-height: 1.02;
  color: #fff;
  text-shadow: 0 4px 20px rgba(230, 57, 96, 0.45);
}

.digit-slot {
  position: relative;
  display: inline-block;
  width: 0.62em;
  height: 1.12em;
  overflow: hidden;
}

.digit-char {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  will-change: transform, opacity;
}

.digit-char.enter { transform: translateY(70%) scale(0.9); opacity: 0; }
.digit-char.active {
  transform: translateY(0) scale(1);
  opacity: 1;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.34s ease;
}
.digit-char.exit {
  transform: translateY(-70%) scale(0.9);
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.28s ease;
}

.unit-label {
  font-size: clamp(0.7rem, 1.1vw, 0.84rem);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--rose-gold-bright);
}

.final-pulse {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-size: clamp(9rem, 30vw, 24rem);
  font-weight: 700;
  color: rgba(255, 209, 220, 0.16);
  pointer-events: none;
  z-index: 4;
  opacity: 0;
}

.final-pulse.pop { animation: heartPop 0.9s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes heartPop {
  0% { opacity: 0; transform: scale(0.68); }
  25% { opacity: 1; transform: scale(1.04); }
  100% { opacity: 0; transform: scale(1.24); }
}

/* Progress Bar */
.progress-wrap {
  width: min(600px, 100%);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.84rem;
  color: var(--muted);
}

#progress-percent { color: var(--rose-gold-bright); font-weight: 600; }

.progress-track {
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(240, 183, 164, 0.32);
}

.progress-fill {
  position: relative;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #b81d45, #ff6289, var(--rose-gold-bright));
  box-shadow: 0 0 18px rgba(255, 114, 152, 0.55);
  transition: width 0.8s ease;
}

.progress-heart {
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.95rem;
  color: #fff;
  text-shadow: 0 0 12px #ff5c8a;
}

.fact-line {
  max-width: 58ch;
  min-height: 2.8em;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.08rem, 2vw, 1.38rem);
  line-height: 1.48;
  color: rgba(255, 240, 245, 0.92);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.fact-line.fading { opacity: 0; transform: translateY(6px); }

/* Celebration */
.celebration {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at center, rgba(230, 57, 96, 0.42), rgba(36, 9, 20, 0.82));
  backdrop-filter: blur(8px);
}
.celebration[hidden] { display: none; }

.celebration-card {
  max-width: 680px;
  padding: clamp(32px, 6vw, 58px) clamp(24px, 5vw, 50px);
  border-radius: 44px;
  background: linear-gradient(155deg, rgba(111, 29, 58, 0.82), rgba(46, 10, 24, 0.88));
  border: 1.5px solid var(--rose-gold);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5), 0 0 60px rgba(255, 132, 168, 0.35);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.celebration-heart {
  font-size: 3rem;
  color: #ff6b92;
  text-shadow: 0 0 28px #ff5c8a;
  animation: heartbeat 1.4s ease-in-out infinite;
}

.celebration-title {
  font-family: var(--font-script);
  font-size: clamp(3rem, 8.4vw, 5.4rem);
  font-weight: 400;
  color: #fff6f8;
}

.celebration-sub {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.1rem, 2.2vw, 1.4rem);
  color: var(--blush);
  max-width: 38ch;
}

.celebration-hint {
  margin-top: 8px;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rose-gold);
}

@media (max-width: 680px) {
  .countdown { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 380px; }
  .love-pill { border-radius: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  .orb, .heart-emblem, .celebration-heart, .final-pulse.pop { animation: none !important; }
  .digit-char.active, .digit-char.exit, .fact-line, .progress-fill { transition: none !important; }
}
