/* =========================================================
   EASTER — PASTEL SPRING WATERCOLOR THEME VARIABLES
   ========================================================= */
:root {
  --bg-cream: #fffcf5;
  --pastel-pink: #fce0ec;
  --pastel-sky: #dff2fc;
  --pastel-butter: #fef3c7;
  --pastel-lavender: #ebe1fb;
  --pastel-mint: #d8f2db;

  --ink-plum: #3e2d4c;
  --ink-soft: rgba(62, 45, 76, 0.7);
  --accent-berry: #c25587;
  --accent-sage: #4a8c5c;

  --font-display: "Fredoka", system-ui, sans-serif;
  --font-ui: "Quicksand", system-ui, sans-serif;
}

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

html, body {
  height: 100%;
  width: 100%;
  overflow-x: hidden;
  background: var(--bg-cream);
  color: var(--ink-plum);
  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;
}

/* Watercolor Washes & Spring Meadow */
.meadow-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.wash {
  position: absolute;
  border-radius: 50%;
  filter: blur(75px);
  opacity: 0.72;
}
.wash-sky { width: 55vw; height: 42vw; top: -12%; left: -8%; background: #cfeefb; }
.wash-blush { width: 48vw; height: 42vw; top: -8%; right: -6%; background: #fbd5e5; }
.wash-mint { width: 58vw; height: 34vw; bottom: 8%; left: 22%; background: #fbf0b8; opacity: 0.6; }

.meadow-svg {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: clamp(120px, 24vh, 250px);
}

/* 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: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(194, 85, 135, 0.28);
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink-plum);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(62, 45, 76, 0.08);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.ctrl-btn svg { width: 18px; height: 18px; }
.ctrl-btn:hover, .ctrl-btn:focus-visible {
  transform: translateY(-2px) scale(1.04);
  border-color: var(--accent-berry);
  outline: none;
}
.ctrl-btn[aria-pressed="true"] {
  background: var(--accent-berry);
  color: #fff;
  border-color: var(--accent-berry);
}

#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, 24px);
  z-index: 30;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--ink-plum);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  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(880px, 92vw);
  padding: clamp(28px, 4.5vh, 52px) 0 clamp(68px, 10vh, 100px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(18px, 2.8vh, 30px);
}

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

.eyebrow {
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-sage);
}

.title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8.6vw, 5.8rem);
  font-weight: 700;
  line-height: 1.02;
  background: linear-gradient(135deg, #c25587 0%, #8663c7 52%, #4a967a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.milestone-badge {
  margin-top: 4px;
  padding: 7px 18px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid #e79cc2;
  color: var(--accent-berry);
  font-size: 0.84rem;
  font-weight: 700;
}

/* Egg-Shaped Digit Cards */
.countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(12px, 2.4vw, 24px);
  width: 100%;
  max-width: 780px;
}

.egg-card {
  padding: clamp(26px, 4vw, 42px) 10px clamp(18px, 2.8vw, 28px);
  border-radius: 50% 50% 44% 44% / 58% 58% 42% 42%;
  border: 2.5px solid rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  box-shadow:
    0 18px 34px rgba(105, 80, 130, 0.14),
    inset 0 -8px 18px rgba(255, 255, 255, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.egg-pink { background: linear-gradient(170deg, rgba(255, 240, 246, 0.92), rgba(248, 206, 226, 0.88)); }
.egg-sky { background: linear-gradient(170deg, rgba(240, 250, 255, 0.92), rgba(196, 232, 249, 0.88)); }
.egg-butter { background: linear-gradient(170deg, rgba(255, 252, 235, 0.92), rgba(251, 234, 168, 0.88)); }
.egg-lavender { background: linear-gradient(170deg, rgba(248, 242, 255, 0.92), rgba(221, 205, 248, 0.88)); }

.egg-card:hover { transform: translateY(-6px) rotate(-1.5deg); }
body.final-ten .egg-card[data-unit="seconds"] {
  transform: scale(1.1);
  border-color: var(--accent-berry);
  box-shadow: 0 0 38px rgba(194, 85, 135, 0.42);
}

.digits {
  display: inline-flex;
  justify-content: center;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 5.8vw, 4.3rem);
  font-weight: 700;
  line-height: 1.08;
  color: var(--ink-plum);
}

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

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

.digit-char.enter { transform: translateY(80%) scale(0.8); opacity: 0; }
.digit-char.active {
  transform: translateY(0) scale(1);
  opacity: 1;
  transition: transform 0.38s cubic-bezier(0.34, 1.45, 0.64, 1), opacity 0.28s ease;
}
.digit-char.exit {
  transform: translateY(-80%) scale(0.8);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.24s ease;
}

.unit-label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.final-pulse {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: clamp(9rem, 28vw, 23rem);
  font-weight: 700;
  color: rgba(194, 85, 135, 0.16);
  pointer-events: none;
  z-index: 4;
  opacity: 0;
}
.final-pulse.pop { animation: springBounce 0.9s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes springBounce {
  0% { opacity: 0; transform: scale(0.6); }
  30% { opacity: 1; transform: scale(1.06); }
  100% { opacity: 0; transform: scale(1.24); }
}

/* 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.85rem;
  font-weight: 600;
  color: var(--ink-soft);
}

#progress-percent { color: var(--accent-berry); }

.progress-track {
  height: 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  border: 1.5px solid rgba(134, 99, 199, 0.24);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f39cc2, #a88ce6, #7ccfa4);
  transition: width 0.8s ease;
}

.fact-line {
  max-width: 58ch;
  min-height: 2.8em;
  font-size: clamp(0.96rem, 1.7vw, 1.15rem);
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink-plum);
  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, 252, 245, 0.78);
  backdrop-filter: blur(10px);
}
.celebration[hidden] { display: none; }

.celebration-card {
  max-width: 640px;
  padding: clamp(32px, 6vw, 56px) clamp(24px, 5vw, 48px);
  border-radius: 42px;
  background: linear-gradient(155deg, #fff, #fdf0f7 52%, #eef9f2);
  border: 3px solid #fff;
  box-shadow: 0 24px 70px rgba(134, 99, 199, 0.22);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.celebration-title {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  background: linear-gradient(135deg, #c25587, #8663c7, #4a967a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.celebration-sub {
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  font-weight: 600;
  color: var(--ink-soft);
  max-width: 38ch;
}

.celebration-hint {
  margin-top: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-berry);
}

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

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