/* =========================================================
   MOTHER'S DAY — BLUSH & LAVENDER FLORAL THEME VARIABLES
   ========================================================= */
:root {
  --bg-ivory: #fff8fa;
  --bg-blush: #fde7ef;
  --bg-lavender: #ede2fa;

  --plum-ink: #462a42;
  --plum-soft: rgba(70, 42, 66, 0.68);
  --rose-accent: #c85c84;
  --lavender-accent: #8c63bf;
  --gold-line: #cfa86e;

  --card-surface: rgba(255, 255, 255, 0.78);

  --font-script: "Sacramento", cursive;
  --font-serif: "Playfair Display", Georgia, serif;
  --font-ui: "Plus Jakarta Sans", system-ui, sans-serif;
}

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

html, body {
  height: 100%;
  width: 100%;
  overflow-x: hidden;
  background: linear-gradient(135deg, var(--bg-ivory) 0%, var(--bg-blush) 48%, var(--bg-lavender) 100%);
  color: var(--plum-ink);
  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;
}

.floral-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.corner-floral {
  position: absolute;
  width: clamp(160px, 28vw, 310px);
  height: auto;
}
.top-left { top: -10px; left: -10px; }
.bottom-right { bottom: -10px; right: -10px; }

.bloom-sway {
  transform-origin: center;
  animation: gentleSway 7s ease-in-out infinite alternate;
}
@keyframes gentleSway {
  0% { transform: rotate(-1.5deg) scale(1); }
  100% { transform: rotate(2deg) scale(1.03); }
}

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

.ctrl-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(207, 168, 110, 0.55);
  background: rgba(255, 255, 255, 0.86);
  color: var(--plum-ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(140, 99, 191, 0.12);
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.ctrl-btn svg { width: 18px; height: 18px; }
.ctrl-btn:hover, .ctrl-btn:focus-visible {
  transform: translateY(-2px);
  border-color: var(--rose-accent);
  outline: none;
}
.ctrl-btn[aria-pressed="true"] { background: var(--rose-accent); color: #fff; border-color: var(--rose-accent); }

#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: 70px;
  right: clamp(14px, 2.5vw, 24px);
  z-index: 30;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--plum-ink);
  color: #fff;
  font-size: 0.82rem;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }

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

.eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--lavender-accent);
}

.title {
  font-family: var(--font-script);
  font-size: clamp(3.6rem, 10.2vw, 7.2rem);
  font-weight: 400;
  line-height: 1.02;
  color: var(--plum-ink);
  text-shadow: 0 4px 20px rgba(200, 92, 132, 0.18);
}

.milestone-badge {
  margin-top: 4px;
  padding: 6px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--gold-line);
  color: var(--rose-accent);
  font-size: 0.82rem;
  font-weight: 600;
}

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

.petal-card {
  position: relative;
  padding: clamp(22px, 3.4vw, 36px) 10px clamp(16px, 2.4vw, 24px);
  border-radius: 24px 6px 24px 6px;
  background: var(--card-surface);
  border: 1px solid rgba(207, 168, 110, 0.55);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 36px rgba(140, 99, 191, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

.petal-card::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 18px 3px 18px 3px;
  border: 1px solid rgba(200, 92, 132, 0.2);
  pointer-events: none;
}

.petal-card:hover {
  transform: translateY(-4px);
  border-color: var(--rose-accent);
  box-shadow: 0 22px 44px rgba(200, 92, 132, 0.18);
}

body.final-ten .petal-card[data-unit="seconds"] {
  transform: scale(1.08);
  border-color: var(--rose-accent);
  box-shadow: 0 0 40px rgba(200, 92, 132, 0.35);
}

.digits {
  display: inline-flex;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 6.2vw, 4.7rem);
  font-weight: 700;
  line-height: 1.06;
  color: var(--plum-ink);
}

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

.digit-char {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.digit-char.enter { transform: translateY(72%); opacity: 0; }
.digit-char.active {
  transform: translateY(0%);
  opacity: 1;
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
}
.digit-char.exit {
  transform: translateY(-72%);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.24s ease;
}

.unit-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--rose-accent);
}

.final-pulse {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-size: clamp(10rem, 30vw, 24rem);
  color: rgba(200, 92, 132, 0.14);
  pointer-events: none;
  z-index: 4;
  opacity: 0;
}
.final-pulse.pop { animation: bloomPop 0.9s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes bloomPop {
  0% { opacity: 0; transform: scale(0.7); }
  25% { opacity: 1; transform: scale(1.04); }
  100% { opacity: 0; transform: scale(1.22); }
}

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

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

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

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(207, 168, 110, 0.45);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #e59ab6, #b794e6, var(--gold-line));
  transition: width 0.8s ease;
}

.fact-line {
  max-width: 58ch;
  min-height: 2.8em;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.02rem, 1.85vw, 1.26rem);
  line-height: 1.5;
  color: var(--plum-soft);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.fact-line.fading { opacity: 0; transform: translateY(5px); }

/* Celebration */
.celebration {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(255, 248, 250, 0.82);
  backdrop-filter: blur(10px);
}
.celebration[hidden] { display: none; }

.celebration-card {
  max-width: 660px;
  padding: clamp(32px, 6vw, 56px) clamp(24px, 5vw, 48px);
  border-radius: 36px 10px 36px 10px;
  background: rgba(255, 255, 255, 0.94);
  border: 1.5px solid var(--gold-line);
  box-shadow: 0 24px 70px rgba(200, 92, 132, 0.2);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.celebration-title {
  font-family: var(--font-script);
  font-size: clamp(3.4rem, 9vw, 5.8rem);
  font-weight: 400;
  color: var(--rose-accent);
}

.celebration-sub {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.06rem, 1.9vw, 1.28rem);
  color: var(--plum-soft);
  max-width: 38ch;
}

.celebration-hint {
  margin-top: 6px;
  font-size: 0.76rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--lavender-accent);
}

@media (max-width: 680px) {
  .countdown { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 370px; }
}

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