/* ============================================================================
   SPRUCE - the Dugout look, carried across the whole site.

   Loaded after main.css on every page. Visual only: colour, light, glow and
   motion. It never changes layout, so nothing moves out of place; hover
   lifts use transform. Everything keys off var(--primary), so the NBA
   (orange) and NFL (gold) themes get their own colour of floodlight for free.

   1  Floodlit backdrop      5  Cards and tiles
   2  Headlines (kept sharp) 6  Board and player cards
   3  Buttons                7  Nav, tags, tables, inputs
   4  The "come and play" wobble  8  Motion safety
   ========================================================================== */

:root { --sp-blue: #4fd8ff; --sp-glow: color-mix(in srgb, var(--primary) 45%, transparent); }

/* ── 1. Floodlit backdrop ─────────────────────────────────────────────
   Two floodlights above the page, angled in, swaying slowly. Stronger at
   night (dark theme), a soft wash by day. */
body,
body.sport-nba {
  background:
    radial-gradient(55% 40% at 6% -6%, color-mix(in srgb, var(--primary) 10%, transparent), transparent 72%),
    radial-gradient(55% 40% at 94% -6%, color-mix(in srgb, var(--sp-blue) 9%, transparent), transparent 72%),
    linear-gradient(115deg, transparent 0 58%, rgba(255, 255, 255, 0.02) 58% 76%, transparent 76%),
    var(--bg);
}
html[data-theme="dark"] body,
html[data-theme="dark"] body.sport-nba {
  background:
    radial-gradient(60% 45% at 6% -8%, color-mix(in srgb, var(--primary) 16%, transparent), transparent 70%),
    radial-gradient(60% 45% at 94% -8%, color-mix(in srgb, var(--sp-blue) 13%, transparent), transparent 70%),
    radial-gradient(1px 1px at 12% 14%, rgba(255, 255, 255, 0.5), transparent 60%),
    radial-gradient(1px 1px at 72% 9%, rgba(255, 255, 255, 0.4), transparent 60%),
    radial-gradient(1.5px 1.5px at 41% 6%, rgba(255, 255, 255, 0.45), transparent 60%),
    linear-gradient(180deg, #0c1424 0, var(--bg) 520px),
    var(--bg);
}
.page-shell::before {
  content: "";
  position: fixed;
  z-index: -1;
  top: -10vh;
  left: 50%;
  width: 150vw;
  height: 110vh;
  transform: translateX(-50%);
  pointer-events: none;
  background:
    linear-gradient(162deg, color-mix(in srgb, var(--primary) 9%, transparent) 0 6%, transparent 32%),
    linear-gradient(198deg, color-mix(in srgb, var(--sp-blue) 8%, transparent) 0 6%, transparent 32%);
  mix-blend-mode: screen;
  opacity: 0.55;
  animation: sp-sway 12s ease-in-out infinite alternate;
}
html[data-theme="dark"] .page-shell::before { opacity: 1; }
@keyframes sp-sway {
  from { transform: translateX(-51%) skewX(-2deg); }
  to { transform: translateX(-49%) skewX(2deg); }
}

/* ── 2. Headlines ───────────────────────────────────────────────────────
   Kept razor sharp: no colour split or glow on headings (it read as blur on
   "Find the missing link" and "Find the connector"). The accent is on the
   full stop and the stat numbers only. */
.fp-hero-title,
.hero-title,
.section-title { text-shadow: none; }
.fp-hero-dot { text-shadow: 0 0 18px var(--sp-glow); }
.fp-stat-num { text-shadow: none; }

/* ── 3. Buttons ──────────────────────────────────────────────────────── */
.btn-primary {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 60%, transparent), 0 8px 26px color-mix(in srgb, var(--primary) 35%, transparent);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 30%, transparent), 0 12px 40px color-mix(in srgb, var(--primary) 55%, transparent);
}
.btn-outline:hover,
.btn-ghost:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}
/* The sheen also passes by itself every few seconds on the big CTAs. */
.fp-btn-kickoff::after,
.featured-mode-cta::after,
.header-cta-stack .btn-primary::after {
  animation: fpSheen 0.9s ease 2.4s infinite;
}

/* ── 4. The wobble ────────────────────────────────────────────────────
   Same move as Dugout's big start button: a little shimmy every few
   seconds on the one button we most want pressed. Stops on hover. */
.fp-btn-kickoff,
.header-cta-stack > .btn-primary {
  animation: sp-bobble 4.2s ease-in-out infinite;
}
.header-cta-stack > .btn-primary { animation-delay: 1.4s; }
.fp-btn-kickoff:hover,
.fp-btn-kickoff:focus-visible,
.header-cta-stack > .btn-primary:hover { animation-play-state: paused; }
@keyframes sp-bobble {
  0%, 70%, 100% { transform: rotate(0) translateX(0); }
  75% { transform: rotate(-2.2deg) translateX(-5px); }
  80% { transform: rotate(2deg) translateX(5px); }
  85% { transform: rotate(-1.2deg) translateX(-3px); }
  90% { transform: rotate(0.6deg) translateX(2px); }
}

/* ── 5. Cards and tiles ──────────────────────────────────────────────── */
.card,
.fp-show-card,
.today-tile,
.other-game-card {
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 220ms ease, border-color 220ms ease;
}
.card:hover,
.fp-show-card:hover,
.today-tile:hover {
  border-color: color-mix(in srgb, var(--primary) 55%, var(--line));
  box-shadow: inset 0 3px 0 var(--primary), 0 18px 44px rgba(0, 0, 0, 0.22), 0 0 0 1px color-mix(in srgb, var(--primary) 25%, transparent), 0 0 34px color-mix(in srgb, var(--primary) 16%, transparent);
}
.card::after {
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--primary), var(--sp-blue), transparent);
}
html[data-theme="dark"] .card {
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 92%, #ffffff 3%), var(--surface));
}
.fp-show-chip { box-shadow: 0 0 16px color-mix(in srgb, currentColor 20%, transparent); }
.fp-show-chip--rowz { box-shadow: 0 0 16px rgba(107, 255, 97, 0.6); }
.fp-show-card:hover .fp-show-name { text-shadow: -1px 0 color-mix(in srgb, var(--sp-blue) 70%, transparent), 1px 0 color-mix(in srgb, var(--primary) 70%, transparent); }

/* ── 6. Board and player cards ──────────────────────────────────────── */
.fp-board {
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18), 0 0 0 1px color-mix(in srgb, var(--primary) 14%, transparent);
}
html[data-theme="dark"] .fp-board {
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55), 0 0 0 1px color-mix(in srgb, var(--primary) 22%, transparent), 0 0 60px color-mix(in srgb, var(--primary) 10%, transparent);
}
.fp-board-card,
.fp-player-card {
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 220ms ease, filter 220ms ease;
}
.fp-board-card:hover,
.fp-player-card:hover {
  transform: translateY(-4px) rotate(-0.4deg);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.3), 0 0 0 2px color-mix(in srgb, var(--primary) 60%, transparent), 0 0 28px color-mix(in srgb, var(--primary) 30%, transparent);
}
.fp-board-card:nth-child(even):hover,
.fp-player-card[data-slot="2"]:hover,
.fp-player-card[data-slot="4"]:hover { transform: translateY(-4px) rotate(0.4deg); }
.fp-web-center {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 40%, transparent), 0 0 46px color-mix(in srgb, var(--primary) 28%, transparent);
  animation: sp-connector 3.2s ease-in-out infinite;
}
@keyframes sp-connector {
  0%, 100% { box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 40%, transparent), 0 0 30px color-mix(in srgb, var(--primary) 20%, transparent); }
  50% { box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 70%, transparent), 0 0 60px color-mix(in srgb, var(--primary) 40%, transparent); }
}

/* ── 7. Nav, tags, tables, inputs ───────────────────────────────────── */
.top-nav-link { position: relative; }
.top-nav-link::before {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 4px;
  height: 2px;
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary);
  transform: scaleX(0);
  transition: transform 200ms ease;
}
.top-nav-link:hover::before,
.top-nav-link.is-active::before { transform: scaleX(1); }

.fp-tag--green,
.kicker,
.card-tag { text-shadow: none; }
.fp-tag--green { box-shadow: 0 0 18px var(--sp-glow); }

.fp-ticker { box-shadow: 0 4px 22px color-mix(in srgb, var(--primary) 25%, transparent); }

.leaderboard-table tbody tr { transition: background 160ms ease, box-shadow 160ms ease; }
.leaderboard-table tbody tr:hover { background: color-mix(in srgb, var(--primary) 8%, transparent); box-shadow: inset 3px 0 0 var(--primary); }
.leaderboard-table tbody tr:nth-child(1) td:first-child { text-shadow: 0 0 14px rgba(255, 209, 102, 0.8); }

input[type="text"]:focus,
input[type="email"]:focus,
input[type="search"]:focus,
input[type="password"]:focus {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent), 0 0 24px color-mix(in srgb, var(--primary) 18%, transparent);
}

.pill--lime,
.hud-chip strong { text-shadow: 0 0 14px color-mix(in srgb, var(--primary) 35%, transparent); }

/* ── 8. Motion safety ────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .page-shell::before,
  .fp-btn-kickoff,
  .header-cta-stack > .btn-primary,
  .fp-btn-kickoff::after,
  .featured-mode-cta::after,
  .header-cta-stack .btn-primary::after,
  .fp-web-center { animation: none !important; }
  .card:hover,
  .fp-board-card:hover,
  .fp-player-card:hover { transform: none; }
}
