/* =========================================================
   INTERNATIONAL WOMEN'S DAY — PURPLE, GREEN & WHITE THEME
   ========================================================= */
:root {
  --bg-purple: #280a4a;
  --purple-vibrant: #6b21a8;
  --emerald: #10b981;
  --emerald-bright: #34d399;
  --white: #ffffff;
  --lavender-soft: #ead9ff;

  --card-surface: rgba(255, 255, 255, 0.96);
  --card-ink: #240842;

  --font-display: "Syne", system-ui, sans-serif;
  --font-ui: "DM 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, #21073d 0%, #4c1580 54%, #0d6e54 100%);
  color: var(--white);
  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;
}

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

.ribbon {
  position: absolute;
  border-radius: 999px;
  filter: blur(60px);
  opacity: 0.45;
  animation: ribbonFlow 14s ease-in-out infinite alternate;
}
.r1 { width: 65vw; height: 22vw; top: -6%; left: -12%; background: #9333ea; transform: rotate(-12deg); }
.r2 { width: 58vw; height: 20vw; bottom: -8%; right: -10%; background: var(--emerald); transform: rotate(-14deg); animation-delay: 2.5s; }

@keyframes ribbonFlow {
  0% { transform: rotate(-12deg) translateY(0); }
  100% { transform: rotate(-8deg) translateY(-20px); }
}

/* 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: 12px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: rgba(36, 8, 66, 0.72);
  backdrop-filter: blur(10px);
  color: var(--white);
  display: grid;
  place-items: center;
  cursor: pointer;
  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);
  background: var(--emerald);
  border-color: var(--white);
  color: #120424;
  outline: none;
}
.ctrl-btn[aria-pressed="true"] { background: var(--white); color: var(--card-ink); border-color: var(--white); }

#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: 12px;
  background: var(--white);
  color: var(--card-ink);
  font-size: 0.84rem;
  font-weight: 700;
  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(940px, 92vw);
  padding: clamp(28px, 5vh, 54px) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(18px, 3vh, 30px);
}

.tri-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot.purple { background: #c084fc; }
.dot.green { background: var(--emerald-bright); }
.dot.white { background: #fff; }

.title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6.8vw, 4.9rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--white);
  text-shadow: 0 10px 34px rgba(18, 4, 36, 0.45);
}

.milestone-badge {
  margin-top: 6px;
  padding: 7px 20px;
  border-radius: 999px;
  background: var(--emerald);
  color: #062119;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

.bold-card {
  position: relative;
  padding: clamp(22px, 3.4vw, 36px) 10px clamp(16px, 2.4vw, 24px);
  border-radius: 20px;
  background: var(--card-surface);
  color: var(--card-ink);
  border-bottom: 6px solid var(--emerald);
  box-shadow: 0 22px 44px rgba(16, 4, 32, 0.42);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.bold-card:nth-child(even) {
  border-bottom-color: var(--purple-vibrant);
}

.bold-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 28px 54px rgba(16, 4, 32, 0.54);
}

body.final-ten .bold-card[data-unit="seconds"] {
  transform: scale(1.09);
  background: var(--emerald-bright);
  color: #091d16;
  box-shadow: 0 0 46px rgba(52, 211, 153, 0.72);
}

.digits {
  display: inline-flex;
  justify-content: center;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 4.6rem);
  font-weight: 800;
  line-height: 1.05;
}

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

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

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

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

.final-pulse {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: clamp(10rem, 32vw, 26rem);
  font-weight: 800;
  color: rgba(255, 255, 255, 0.14);
  pointer-events: none;
  z-index: 4;
  opacity: 0;
}
.final-pulse.pop { animation: boldPop 0.9s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes boldPop {
  0% { opacity: 0; transform: scale(0.65); }
  25% { opacity: 1; transform: scale(1.06); }
  100% { opacity: 0; transform: scale(1.24); }
}

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

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

#progress-percent { color: var(--emerald-bright); font-weight: 700; }

.progress-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #c084fc, var(--white), var(--emerald-bright));
  transition: width 0.8s ease;
}

.fact-line {
  max-width: 60ch;
  min-height: 3.1em;
  font-style: italic;
  font-size: clamp(1rem, 1.8vw, 1.22rem);
  font-weight: 500;
  line-height: 1.5;
  color: #fff;
  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(33, 7, 61, 0.86);
  backdrop-filter: blur(10px);
}
.celebration[hidden] { display: none; }

.celebration-card {
  max-width: 680px;
  padding: clamp(32px, 6vw, 56px) clamp(24px, 5vw, 48px);
  border-radius: 26px;
  background: var(--white);
  color: var(--card-ink);
  border-bottom: 8px solid var(--emerald);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.5);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.celebration-title {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 6vw, 3.9rem);
  font-weight: 800;
  line-height: 1.06;
  color: var(--purple-vibrant);
}

.celebration-sub {
  font-size: clamp(1rem, 1.8vw, 1.18rem);
  color: #3d2160;
  max-width: 40ch;
}

.celebration-hint {
  margin-top: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--emerald);
}

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

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