/* ============================================================
   MOTION — keep the site alive. Stats are boring; movement isn't.
   ============================================================ */

@media (prefers-reduced-motion: no-preference) {

  /* Fade-in on scroll (set by JS via .in-view) */
  .reveal {
    opacity: 0; transform: translateY(24px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(.2,.7,.2,1);
  }
  .reveal.in-view { opacity: 1; transform: none; }
  .reveal-stagger > * {
    opacity: 0; transform: translateY(18px);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(.2,.7,.2,1);
  }
  .reveal-stagger.in-view > * { opacity: 1; transform: none; }
  .reveal-stagger.in-view > *:nth-child(2) { transition-delay: 80ms; }
  .reveal-stagger.in-view > *:nth-child(3) { transition-delay: 160ms; }
  .reveal-stagger.in-view > *:nth-child(4) { transition-delay: 240ms; }
  .reveal-stagger.in-view > *:nth-child(5) { transition-delay: 320ms; }
  .reveal-stagger.in-view > *:nth-child(6) { transition-delay: 400ms; }

  /* Live ticker (top of page) */
  @keyframes tickerScroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
  }
  .ticker { animation: tickerScroll 38s linear infinite; }

  /* Pitch — players drifting */
  .player-dot {
    transform-box: fill-box;
    transform-origin: center;
    animation: drift 6s ease-in-out infinite;
  }
  .player-dot.away { animation-duration: 7s; animation-delay: -1.4s; }
  @keyframes drift {
    0%, 100% { transform: translate(0, 0); }
    25%      { transform: translate(8px, -6px); }
    50%      { transform: translate(-4px, 8px); }
    75%      { transform: translate(6px, 4px); }
  }
  .ball-dot {
    transform-box: fill-box;
    transform-origin: center;
    animation: ballPath 8s ease-in-out infinite;
  }
  @keyframes ballPath {
    0%   { transform: translate(0, 0); }
    18%  { transform: translate(20px, -14px); }
    36%  { transform: translate(-18px, 12px); }
    54%  { transform: translate(28px, -22px); }
    72%  { transform: translate(-12px, -6px); }
    100% { transform: translate(0, 0); }
  }

  /* Bounding box pulse on a tracked "selected" player */
  .bbox {
    animation: bboxPulse 2.4s ease-in-out infinite;
  }
  @keyframes bboxPulse {
    0%, 100% { stroke-opacity: 1; stroke-width: 1.6; }
    50%      { stroke-opacity: 0.45; stroke-width: 2.4; }
  }

  /* Tracking-line trail */
  .track-trail {
    stroke-dasharray: 220;
    stroke-dashoffset: 220;
    animation: trailDraw 3s ease-out forwards infinite;
  }
  @keyframes trailDraw {
    0%   { stroke-dashoffset: 220; opacity: 0; }
    20%  { opacity: 1; }
    100% { stroke-dashoffset: 0; opacity: 0; }
  }

  /* Shot-map: dots draw in one by one when section is in view */
  .shot-dot {
    opacity: 0;
    transform-box: fill-box;
    transform-origin: center;
    transform: scale(0);
  }
  .live-shotmap.armed .shot-dot {
    animation: shotPop 0.55s cubic-bezier(.2, 1.6, .3, 1) forwards;
  }
  @keyframes shotPop {
    0%   { opacity: 0; transform: scale(0); }
    60%  { opacity: 1; transform: scale(1.25); }
    100% { opacity: 1; transform: scale(1); }
  }
  /* Stagger via inline animation-delay on each circle */

  /* Counters (drive value via JS data-target, animate transition via CSS) */
  .stat-num {
    font-variant-numeric: tabular-nums;
    transition: color 0.3s;
  }

  /* Hero-ambient: gentle parallax accent that breathes */
  .hero-glow {
    animation: heroGlow 9s ease-in-out infinite;
  }
  @keyframes heroGlow {
    0%, 100% { opacity: 0.55; transform: scale(1); }
    50%      { opacity: 0.85; transform: scale(1.06); }
  }

  /* Step icon "play" pulse */
  .step-icon-pulse {
    animation: stepPulse 2.6s ease-in-out infinite;
  }
  @keyframes stepPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(242,179,61,0.45); }
    50%      { box-shadow: 0 0 0 14px rgba(242,179,61,0); }
  }

  /* Tier card hover lift extra */
  .tier { will-change: transform; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
  .reveal, .reveal-stagger > * { opacity: 1 !important; transform: none !important; }
}

/* ============================================================
   LIVE PITCH (hero) — sized container + shadow
   ============================================================ */
.live-pitch-wrap {
  position: relative;
  background: linear-gradient(135deg, #0E2745 0%, #07172E 100%);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.45), 0 0 0 1px rgba(242,179,61,0.18) inset;
  overflow: hidden;
}
.live-pitch-wrap::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(242,179,61,0.10), transparent 50%);
  pointer-events: none;
}
.live-pitch-wrap .telemetry {
  display: flex; gap: 1rem; justify-content: space-between;
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 11px; color: rgba(255,255,255,0.6);
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0 4px 12px;
}
.live-pitch-wrap .telemetry strong { color: var(--gold); font-weight: 700; }
.live-pitch-wrap .telemetry .live-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #FF3B30; margin-right: 6px;
  animation: liveBlink 1.4s ease-in-out infinite;
  vertical-align: middle;
}
@keyframes liveBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.live-pitch { width: 100%; height: auto; display: block; border-radius: 10px; }

/* Hero layout uses pitch on the right at desktop */
.hero-grid {
  display: grid; gap: 3rem;
  grid-template-columns: 1fr;
  align-items: center;
}
@media (min-width: 980px) {
  .hero-grid { grid-template-columns: 1.05fr 1fr; gap: 5rem; }
}

/* Live ticker bar */
.ticker-bar {
  background: var(--navy);
  border-bottom: 1px solid rgba(242,179,61,0.18);
  overflow: hidden;
  position: relative;
}
.ticker-bar::before, .ticker-bar::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 80px; z-index: 2; pointer-events: none;
}
.ticker-bar::before { left: 0; background: linear-gradient(90deg, var(--navy), transparent); }
.ticker-bar::after  { right: 0; background: linear-gradient(-90deg, var(--navy), transparent); }
.ticker {
  display: inline-flex; gap: 3rem; white-space: nowrap; padding: 0.7rem 0;
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 0.78rem; color: rgba(255,255,255,0.62);
  letter-spacing: 0.06em;
}
.ticker span { display: inline-flex; gap: 0.5rem; align-items: center; }
.ticker strong { color: var(--gold); font-weight: 700; }
.ticker .pulse-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold);
  animation: liveBlink 2s ease-in-out infinite;
}

/* Live shot map (sample section) */
.live-shotmap {
  background: var(--off-white);
  border: 1px solid var(--grey-light);
  border-radius: 14px;
  padding: 1rem 1rem 0.6rem;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.live-shotmap-meta {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 0.78rem; color: var(--grey);
  letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600;
  margin-bottom: 0.5rem;
}
.live-shotmap-meta b { color: var(--navy); font-weight: 700; }
.live-shotmap svg { width: 100%; height: auto; display: block; }

/* Big stat block (counters) */
.metric-row {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem 2rem;
  margin: 1.5rem 0;
}
@media (min-width: 720px) { .metric-row { grid-template-columns: repeat(4, 1fr); } }
.metric .stat-num {
  font-size: 2.2rem; font-weight: 900; color: var(--navy); letter-spacing: -0.02em;
  line-height: 1;
}
.metric .stat-label {
  font-size: 0.8rem; color: var(--grey); letter-spacing: 0.08em;
  text-transform: uppercase; font-weight: 600; margin-top: 0.4rem;
}

/* Video placeholder (drop real club footage in later) */
.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 14px; overflow: hidden;
  background: linear-gradient(135deg, #0E2745, #07172E);
  border: 1px solid rgba(242,179,61,0.22);
}
.video-frame::after {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 50% 50%, transparent 0 36px,
      rgba(242,179,61,0.08) 36px 38px,
      transparent 38px 100%);
}
.video-frame .play-btn {
  position: absolute; inset: 0; margin: auto;
  width: 72px; height: 72px;
  background: var(--gold); color: var(--navy);
  border: none; border-radius: 50%;
  cursor: pointer; font-size: 1.6rem;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
  animation: stepPulse 2.6s ease-in-out infinite;
}
.video-frame .video-label {
  position: absolute; bottom: 12px; left: 14px;
  color: rgba(255,255,255,0.6);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
}
.video-frame video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
