/*
 * Everclear Northwest — party effects styling
 * Companion to js/party.js. Only touches elements this file introduces,
 * plus the single documented exception: .vibe-line inside the footer.
 */

.ecnw-confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 99999;
}

.ecnw-confetti-reduced {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  pointer-events: none;
  z-index: 99999;
  animation: ecnw-fade-in-out 0.9s ease both;
}

@keyframes ecnw-fade-in-out {
  0% {
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.ecnw-pony-rain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 99999;
}

.ecnw-pony-drop {
  position: absolute;
  top: -10vh;
  line-height: 1;
  animation-name: ecnw-pony-fall;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
  will-change: transform, opacity;
}

@keyframes ecnw-pony-fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(115vh) rotate(45deg);
    opacity: 0;
  }
}

.ecnw-tap-sparkle {
  position: fixed;
  transform: translate(-50%, -50%);
  pointer-events: none;
  font-size: 1.1rem;
  z-index: 99999;
  animation: ecnw-sparkle-pop 0.7s ease-out forwards;
}

@keyframes ecnw-sparkle-pop {
  0% {
    transform: translate(-50%, -50%) scale(0.4);
    opacity: 1;
  }
  60% {
    transform: translate(-50%, -50%) scale(1.15);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -60%) scale(0.8);
    opacity: 0;
  }
}

.vibe-line {
  margin-top: 0.5em;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--ecnw-green, #39ff8f);
}

/* =========================================================================
   Pastel theme — true pastels + dark ink
   Toggled via window.ecnwParty.setTheme("pastel" | "night"), which adds
   or removes html.ecnw-pastel. Every rule below is scoped under that
   class, so the default night theme in css/styles.css stays byte-identical
   when the class is absent.

   Engineering approach: the required accents, pastel blue #A7C7E7 and
   pastel pink #FFC5D3, are both far too light to work as text (≈1.4–1.6:1
   on the cream background) and unreadable under cream-colored text on top
   of them. So this is NOT "dark accents, light text on accents" like the
   previous (Sylveon) pass — it's "pastel surfaces, dark ink on everything":
     - --ecnw-green/--ecnw-pink stay literally #A7C7E7 / #FFC5D3 and are
       used only as flat, unlabeled BACKGROUND fills (buttons, active-nav
       pill, table header, bingo marked/free cells, bingo banner) — every
       place css/styles.css (and the bingo.html / wheel.html page-specific
       <style> blocks, which this file cannot edit but can override via
       matching class selectors) sets `color: var(--ecnw-bg)` on top of
       one of these is overridden below to `color: var(--ecnw-cream)`
       (navy ink), which clears 8.7:1+.
     - Every place --ecnw-green/--ecnw-pink is used AS TEXT (links, logo
       accent, hero/section accents, card/result titles, tagline, badge
       text, footer hover, focus outline, instruction headings, this
       file's own .vibe-line) is overridden to a muted DEEP-pastel "ink"
       derived from the same hue — dusty blue #3f6489 (5.78:1 on bg) and
       dusty rose #a34d68 (5.14:1 on bg) — soft/desaturated rather than
       neon, but readable.
   Full computed contrast ratios are in the verification report.
   ========================================================================= */

html.ecnw-pastel {
  --ecnw-bg: #fdf6f1;
  --ecnw-bg-alt: #fdedf3;
  --ecnw-bg-raised: #eaf4fb;
  --ecnw-bg-raised-hover: #dbe9f7b3;
  --ecnw-border: #eec9de;
  --ecnw-border-soft: #f8e4ee;

  --ecnw-green: #a7c7e7;
  --ecnw-green-dim: #8fb5dd;
  --ecnw-green-glow: rgba(167, 199, 231, 0.35);

  --ecnw-pink: #ffc5d3;
  --ecnw-pink-dim: #f3a9bd;
  --ecnw-pink-glow: rgba(255, 197, 211, 0.35);

  --ecnw-cream: #1b2340;
  --ecnw-cream-dim: #35406b;
  --ecnw-cream-faint: #5b6690;

  --ecnw-warn-bg: #fde3ea;
  --ecnw-warn-border: #f0a8bb;
  --ecnw-warn-text: #7a1330;

  --ecnw-shadow: 0 10px 30px rgba(150, 130, 180, 0.16);
}

/* Two muted "ink" shades used only where --ecnw-green/--ecnw-pink would
   otherwise be read as text — see the block comment above. */
html.ecnw-pastel {
  --ecnw-ink-blue: #3f6489;
  --ecnw-ink-rose: #a34d68;
}

/* -------------------------------------------------------------------------
   Hardcoded (non-token) colors from css/styles.css that need a pastel-
   appropriate equivalent so nothing reads as broken.
   ------------------------------------------------------------------------- */

html.ecnw-pastel body {
  background-image:
    radial-gradient(circle at 15% 0%, rgba(255, 197, 211, 0.12), transparent 45%),
    radial-gradient(circle at 85% 20%, rgba(167, 199, 231, 0.12), transparent 45%);
}

html.ecnw-pastel .site-header {
  background: rgba(253, 246, 241, 0.85);
}

html.ecnw-pastel .badge-strong {
  box-shadow: 0 0 14px rgba(240, 168, 187, 0.25);
}

html.ecnw-pastel .table tbody tr:hover {
  background: rgba(255, 197, 211, 0.14);
}

html.ecnw-pastel .age-gate-panel {
  box-shadow: 0 20px 60px rgba(120, 100, 140, 0.2), 0 0 0 1px rgba(167, 199, 231, 0.2);
}

/* -------------------------------------------------------------------------
   Accent-as-TEXT overrides (dusty-blue / dusty-rose ink, ≥4.5:1 on bg).
   Covers css/styles.css plus the page-specific <style> blocks in
   bingo.html and wheel.html, reached here by their class names since
   this file cannot edit those pages directly.
   ------------------------------------------------------------------------- */

html.ecnw-pastel a,
html.ecnw-pastel .logo:hover,
html.ecnw-pastel .logo .logo-accent,
html.ecnw-pastel .hero-title .accent,
html.ecnw-pastel .card-title,
html.ecnw-pastel .badge,
html.ecnw-pastel .site-footer a:hover,
html.ecnw-pastel .result-title,
html.ecnw-pastel .bingo-instructions h2,
html.ecnw-pastel .vibe-line {
  color: var(--ecnw-ink-blue);
}

html.ecnw-pastel :focus-visible,
html.ecnw-pastel .wheel-disc:focus-visible {
  outline-color: var(--ecnw-ink-blue);
}

html.ecnw-pastel a:hover,
html.ecnw-pastel .tagline,
html.ecnw-pastel .section-title .accent,
html.ecnw-pastel .btn-ghost:hover {
  color: var(--ecnw-ink-rose);
}

html.ecnw-pastel .btn-ghost:hover {
  border-color: var(--ecnw-ink-rose);
}

/* -------------------------------------------------------------------------
   Accent-as-BACKGROUND overrides: keep the pastel fill, swap the
   `color: var(--ecnw-bg)` text on top for navy ink (--ecnw-cream) so it
   stays readable against the now-light background fill.
   ------------------------------------------------------------------------- */

html.ecnw-pastel .site-nav a:hover,
html.ecnw-pastel .site-nav a[aria-current="page"],
html.ecnw-pastel .btn-primary,
html.ecnw-pastel .table thead th,
html.ecnw-pastel .bingo-cell.is-marked,
html.ecnw-pastel .bingo-cell.is-free,
html.ecnw-pastel .bingo-banner {
  color: var(--ecnw-cream);
}

html.ecnw-pastel ::selection {
  color: var(--ecnw-cream);
}

@media (prefers-reduced-motion: reduce) {
  .ecnw-confetti-canvas {
    display: none;
  }

  .ecnw-pony-drop {
    animation: none;
    display: none;
  }

  .ecnw-tap-sparkle {
    animation: none;
    display: none;
  }
}
