/* ============================================================
   VFL v5.25 — Polish & Excitement
   Cinematic goal moments, momentum, hype FX, virtual stake.
   Everything is overlay-only — never touches the canvas pipeline.
   ============================================================ */

/* ---------- Variables ---------- */
:root {
  --v525-gold:    #ffd84a;
  --v525-fire:    #ff6b1f;
  --v525-ice:     #29d1ff;
  --v525-bg-deep: rgba(6, 10, 18, 0.86);
  --v525-shadow:  0 22px 70px -10px rgba(0, 0, 0, 0.65);
}

/* ============================================================
   1. CINEMATIC GOAL OVERLAY
   Triggered alongside existing #goalOverlay. Adds:
   - radial flash from centre
   - vignette + crowd-light god-rays
   - score-bump amplifier
   ============================================================ */
.v525-flash {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 999990;
  background:
    radial-gradient(circle at 50% 45%,
      rgba(255, 240, 200, 0.75) 0%,
      rgba(255, 200, 80, 0.35) 18%,
      rgba(40, 20, 0, 0.0)     45%);
  opacity: 0;
  mix-blend-mode: screen;
  animation: v525-flash 1.2s cubic-bezier(.2,.7,.3,1);
}
@keyframes v525-flash {
  0%   { opacity: 0; transform: scale(1.2); }
  8%   { opacity: 1; transform: scale(1); }
  35%  { opacity: 0.55; }
  100% { opacity: 0; }
}

.v525-godrays {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 999989;
  background:
    repeating-conic-gradient(from 0deg at 50% 0%,
      rgba(255, 215, 100, 0.18) 0deg 6deg,
      transparent 6deg 12deg);
  opacity: 0;
  mix-blend-mode: screen;
  filter: blur(1px);
  animation: v525-godrays 1.6s ease-out;
  transform-origin: 50% 0%;
}
@keyframes v525-godrays {
  0%   { opacity: 0; transform: rotate(-8deg) scale(0.8); }
  20%  { opacity: 0.75; }
  100% { opacity: 0; transform: rotate(6deg) scale(1.4); }
}

/* Screen-wide ripple at goal moment */
.v525-ripple {
  position: fixed;
  left: 50%; top: 45%;
  width: 0; height: 0;
  border-radius: 50%;
  border: 4px solid rgba(255, 232, 140, 0.85);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 999988;
  animation: v525-ripple 1.1s cubic-bezier(.15,.7,.3,1);
}
@keyframes v525-ripple {
  0%   { width: 0; height: 0; opacity: 1; border-width: 6px; }
  100% { width: 180vmax; height: 180vmax; opacity: 0; border-width: 1px; }
}

/* Make the existing scoreboard pulse and glow when score changes */
.v525-score-pulse {
  animation: v525-score-pulse 1.4s cubic-bezier(.2,.7,.3,1) !important;
}
@keyframes v525-score-pulse {
  0%   { transform: scale(1);   text-shadow: 0 0 0 transparent; }
  20%  { transform: scale(1.55); text-shadow: 0 0 28px var(--v525-gold), 0 0 60px var(--v525-fire); color: var(--v525-gold); }
  60%  { transform: scale(1.1); }
  100% { transform: scale(1);   text-shadow: 0 0 0 transparent; }
}

/* Cinematic letterbox bars on big moments */
.v525-letterbox::before,
.v525-letterbox::after {
  content: "";
  position: fixed; left: 0; right: 0;
  height: 0;
  background: #000;
  z-index: 999985;
  pointer-events: none;
  transition: height 220ms cubic-bezier(.4,.0,.2,1);
}
.v525-letterbox::before { top: 0; }
.v525-letterbox::after  { bottom: 0; }
.v525-letterbox.active::before,
.v525-letterbox.active::after { height: 8vh; }

/* ============================================================
   2. MOMENTUM BAR — live shifting tug-of-war
   Slim bar pinned just under the scoreboard.
   ============================================================ */
.v525-mom {
  position: fixed;
  top: 60px; left: 50%;
  transform: translateX(-50%);
  width: min(420px, 70vw);
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  z-index: 999500;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.v525-mom__fill {
  position: absolute; top: 0; bottom: 0;
  left: 50%;
  width: 0%;
  background: linear-gradient(90deg, var(--v525-ice), #6aa3ff);
  border-radius: 999px;
  transition: width 600ms cubic-bezier(.2,.7,.3,1), left 600ms cubic-bezier(.2,.7,.3,1);
}
.v525-mom__fill.right {
  background: linear-gradient(90deg, #ff6b6b, #ff3850);
}
.v525-mom__label {
  position: absolute;
  font: 600 9px/1 'JetBrains Mono', monospace;
  color: rgba(255, 255, 255, 0.55);
  top: -14px;
  letter-spacing: 0.1em;
}
.v525-mom__label.left  { left: 0; }
.v525-mom__label.right { right: 0; }

/* ============================================================
   3. HOT-STREAK PLAYER FX — small "ON FIRE" badge that floats
   next to the close-up cam when a player has 2+ goals.
   ============================================================ */
.v525-hot {
  position: fixed;
  top: 110px;
  right: 24px;
  background: linear-gradient(135deg, var(--v525-fire), #ffb13a);
  color: #fff;
  font: 800 11px/1 'Oswald', 'Inter', sans-serif;
  letter-spacing: 0.18em;
  padding: 8px 12px 8px 30px;
  border-radius: 999px;
  z-index: 999600;
  box-shadow: 0 6px 24px rgba(255, 107, 31, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  animation: v525-hot-in 320ms cubic-bezier(.2,.8,.3,1);
}
.v525-hot::before {
  content: "🔥";
  position: absolute;
  left: 8px; top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  filter: drop-shadow(0 0 6px rgba(255, 200, 80, 0.7));
  animation: v525-flicker 600ms ease-in-out infinite alternate;
}
@keyframes v525-hot-in {
  0%   { transform: translateY(-20px) scale(.6); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes v525-flicker {
  0%   { transform: translateY(-50%) scale(1) rotate(-4deg); }
  100% { transform: translateY(-50%) scale(1.15) rotate(4deg); }
}

/* ============================================================
   4. BIG-MOMENT TOAST — "LAST MINUTE!", "EQUALISER!", "BRACE!"
   Larger than tactical-call, sits front-and-centre 1.6s.
   ============================================================ */
.v525-bigmo {
  position: fixed;
  top: 38%; left: 50%;
  transform: translate(-50%, -50%) scale(.6);
  font: 900 clamp(40px, 8vw, 96px)/0.95 'Oswald', 'Inter', sans-serif;
  letter-spacing: 0.04em;
  color: var(--v525-gold);
  text-shadow:
    0 0 26px rgba(255, 215, 80, 0.7),
    0 6px 0 rgba(0,0,0,0.55),
    0 12px 28px rgba(0,0,0,0.7);
  z-index: 999700;
  pointer-events: none;
  opacity: 0;
  white-space: nowrap;
  text-transform: uppercase;
  animation: v525-bigmo 1.7s cubic-bezier(.2,.8,.3,1);
}
.v525-bigmo.fire   { color: var(--v525-fire); text-shadow: 0 0 30px rgba(255, 107, 31, 0.75), 0 6px 0 rgba(0,0,0,0.55); }
.v525-bigmo.ice    { color: var(--v525-ice);  text-shadow: 0 0 30px rgba(41, 209, 255, 0.65), 0 6px 0 rgba(0,0,0,0.55); }
.v525-bigmo__sub {
  display: block;
  font: 600 14px/1.2 'JetBrains Mono', monospace;
  letter-spacing: 0.3em;
  color: rgba(255,255,255,0.7);
  margin-top: 8px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.7);
}
@keyframes v525-bigmo {
  0%   { transform: translate(-50%, -50%) scale(.5) rotate(-3deg); opacity: 0; filter: blur(8px); }
  18%  { transform: translate(-50%, -50%) scale(1.15) rotate(1deg); opacity: 1; filter: blur(0); }
  35%  { transform: translate(-50%, -50%) scale(1) rotate(0); }
  80%  { transform: translate(-50%, -50%) scale(1) rotate(0); opacity: 1; }
  100% { transform: translate(-52%, -58%) scale(0.9) rotate(0); opacity: 0; }
}

/* ============================================================
   5. NEAR-MISS HEART-STOP — quick screen tint + slow-mo vignette
   ============================================================ */
.v525-pulse {
  position: fixed; inset: 0;
  background: radial-gradient(circle at 50% 50%, transparent 35%, rgba(0,0,0,0.45) 90%);
  z-index: 999400;
  pointer-events: none;
  opacity: 0;
  animation: v525-pulse 800ms ease-out;
}
@keyframes v525-pulse {
  0%   { opacity: 0; }
  20%  { opacity: 1; }
  100% { opacity: 0; }
}

/* ============================================================
   6. MANAGER REACTION BADGE
   Small chip bottom-left with manager face + reaction
   ============================================================ */
.v525-mgr {
  position: fixed;
  left: 16px; bottom: 16px;
  padding: 10px 14px 10px 48px;
  background: var(--v525-bg-deep);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  box-shadow: var(--v525-shadow);
  color: #fff;
  font: 500 12px/1.3 'Inter', sans-serif;
  max-width: 240px;
  z-index: 999300;
  transform: translateX(-120%);
  opacity: 0;
  transition: transform 380ms cubic-bezier(.2,.8,.3,1), opacity 380ms;
}
.v525-mgr.show { transform: translateX(0); opacity: 1; }
.v525-mgr__head {
  position: absolute;
  left: 8px; top: 50%;
  transform: translateY(-50%);
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5b6cff, #29d1ff);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.15);
}
.v525-mgr__name {
  font: 700 10px/1 'JetBrains Mono', monospace;
  letter-spacing: 0.12em;
  color: var(--v525-gold);
  margin-bottom: 3px;
  text-transform: uppercase;
}
.v525-mgr__line { color: rgba(255,255,255,0.86); }

/* ============================================================
   7. VIRTUAL STAKE WIDGET
   Tiny chip top-right of match. User has a virtual stake going
   into each match — payout pops on win, deflates on loss.
   ============================================================ */
.v525-stake {
  position: fixed;
  top: 12px; right: 12px;
  z-index: 999200;
  background: var(--v525-bg-deep);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 215, 80, 0.35);
  border-radius: 12px;
  padding: 8px 12px;
  color: #fff;
  font: 500 11px/1.3 'JetBrains Mono', monospace;
  box-shadow: 0 8px 28px rgba(0,0,0,0.45);
  display: none;
}
.v525-stake.show { display: block; animation: v525-stake-in 320ms cubic-bezier(.2,.8,.3,1); }
@keyframes v525-stake-in {
  0%   { transform: translateY(-12px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}
.v525-stake__row {
  display: flex; gap: 10px; align-items: baseline;
}
.v525-stake__label {
  font-size: 9px;
  letter-spacing: 0.18em;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
}
.v525-stake__val {
  font: 700 16px/1 'Oswald', sans-serif;
  color: var(--v525-gold);
}
.v525-stake__pot {
  font: 700 11px/1 'JetBrains Mono', monospace;
  color: var(--v525-ice);
}
.v525-stake--win {
  border-color: rgba(80, 220, 120, 0.5);
  animation: v525-stake-win 1.6s cubic-bezier(.2,.8,.3,1);
}
@keyframes v525-stake-win {
  0%   { transform: scale(1); box-shadow: 0 0 0 0 rgba(80,220,120,0.7); }
  30%  { transform: scale(1.18); box-shadow: 0 0 0 18px rgba(80,220,120,0); }
  100% { transform: scale(1); }
}
.v525-stake--lose {
  border-color: rgba(255, 80, 80, 0.45);
  opacity: 0.6;
  filter: grayscale(0.4);
}

/* Stake selector modal */
.v525-stakemodal {
  position: fixed; inset: 0;
  background: rgba(4, 8, 14, 0.78);
  backdrop-filter: blur(8px);
  z-index: 999800;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 220ms ease;
}
.v525-stakemodal.show { opacity: 1; pointer-events: auto; }
.v525-stakemodal__card {
  width: min(420px, 92vw);
  background: linear-gradient(160deg, #161e2c 0%, #0a121f 100%);
  border: 1px solid rgba(255, 215, 80, 0.28);
  border-radius: 20px;
  padding: 28px 26px 22px;
  box-shadow: var(--v525-shadow);
  color: #fff;
}
.v525-stakemodal__title {
  font: 800 22px/1.1 'Oswald', sans-serif;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.v525-stakemodal__sub {
  font: 500 12px/1.4 'JetBrains Mono', monospace;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.08em;
  margin-bottom: 18px;
}
.v525-stakemodal__opts {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}
.v525-stakemodal__opt {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  font: 700 13px/1 'Inter', sans-serif;
  padding: 12px 0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 160ms ease;
}
.v525-stakemodal__opt:hover { background: rgba(255, 215, 80, 0.12); border-color: rgba(255, 215, 80, 0.4); }
.v525-stakemodal__opt.active {
  background: linear-gradient(135deg, #ffd84a, #ffb13a);
  color: #0a0e18;
  border-color: transparent;
}
.v525-stakemodal__market {
  font: 600 11px/1 'JetBrains Mono', monospace;
  letter-spacing: 0.14em;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  margin: 14px 0 6px;
}
.v525-stakemodal__teams {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}
.v525-stakemodal__team {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 10px 0;
  cursor: pointer;
  text-align: center;
  transition: all 160ms ease;
}
.v525-stakemodal__team:hover { background: rgba(41,209,255,0.10); border-color: rgba(41,209,255,0.4); }
.v525-stakemodal__team.active {
  background: linear-gradient(135deg, #29d1ff, #6aa3ff);
  color: #0a0e18;
  border-color: transparent;
}
.v525-stakemodal__team b { display: block; font: 800 13px/1.1 'Oswald', sans-serif; }
.v525-stakemodal__team span { font: 500 10px/1 'JetBrains Mono', monospace; opacity: 0.7; }
.v525-stakemodal__actions { display: flex; gap: 10px; }
.v525-stakemodal__btn {
  flex: 1;
  padding: 12px 0;
  border-radius: 10px;
  border: 0;
  cursor: pointer;
  font: 800 13px/1 'Oswald', sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.v525-stakemodal__btn.primary { background: linear-gradient(135deg, #ffd84a, #ffb13a); color: #0a0e18; }
.v525-stakemodal__btn.primary:disabled { opacity: 0.4; cursor: not-allowed; }
.v525-stakemodal__btn.ghost { background: rgba(255,255,255,0.06); color: #fff; }

/* Payout pop */
.v525-payout {
  position: fixed; left: 50%; top: 30%;
  transform: translate(-50%, -50%) scale(.4);
  font: 900 clamp(48px, 9vw, 110px)/0.9 'Oswald', sans-serif;
  color: var(--v525-gold);
  z-index: 999850;
  pointer-events: none;
  opacity: 0;
  text-shadow: 0 0 40px rgba(255,215,80,0.8), 0 8px 0 rgba(0,0,0,0.6);
  animation: v525-payout 2.4s cubic-bezier(.2,.8,.3,1);
}
.v525-payout__amt { font-size: 0.6em; display: block; color: #fff; margin-top: 6px; }
@keyframes v525-payout {
  0%   { transform: translate(-50%, -50%) scale(.4) rotate(-6deg); opacity: 0; }
  15%  { transform: translate(-50%, -50%) scale(1.25) rotate(2deg); opacity: 1; }
  30%  { transform: translate(-50%, -50%) scale(1) rotate(0); }
  85%  { transform: translate(-50%, -50%) scale(1) rotate(0); opacity: 1; }
  100% { transform: translate(-50%, -65%) scale(.9); opacity: 0; }
}

/* ============================================================
   8. HOMEPAGE HYPE — make the cold-load not feel dead
   ============================================================ */
.v525-hype-pulse {
  position: relative;
}
.v525-hype-pulse::after {
  content: "";
  position: absolute; inset: -6px;
  border-radius: inherit;
  border: 2px solid var(--v525-gold);
  opacity: 0;
  pointer-events: none;
  animation: v525-hype 1.8s ease-out infinite;
}
@keyframes v525-hype {
  0%   { transform: scale(.98); opacity: 1; }
  100% { transform: scale(1.15); opacity: 0; }
}

/* ============================================================
   9. EXTRA SHAKE — for big celebrations, bigger than .shake-hard
   ============================================================ */
.v525-shake-huge {
  animation: v525-shake-huge 720ms cubic-bezier(.36,.07,.19,.97);
}
@keyframes v525-shake-huge {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  10%  { transform: translate(-8px, -4px) rotate(-0.6deg); }
  20%  { transform: translate(7px,  3px) rotate(0.5deg); }
  30%  { transform: translate(-9px, 2px) rotate(-0.4deg); }
  40%  { transform: translate(6px, -3px) rotate(0.3deg); }
  50%  { transform: translate(-5px, 4px) rotate(-0.2deg); }
  60%  { transform: translate(4px,  2px) rotate(0.2deg); }
  70%  { transform: translate(-3px,-2px) rotate(-0.1deg); }
  80%  { transform: translate(2px,  2px) rotate(0); }
  90%  { transform: translate(-1px,-1px); }
}

/* ============================================================
   10. PHONE LAYOUT GUARDS — keep everything legible on mobile
   ============================================================ */
@media (max-width: 640px) {
  .v525-bigmo { font-size: clamp(34px, 12vw, 60px); }
  .v525-mom { top: 56px; width: 80vw; }
  .v525-hot { top: 96px; right: 10px; padding: 6px 10px 6px 26px; font-size: 10px; }
  .v525-stake { top: 8px; right: 8px; padding: 6px 9px; }
  .v525-stake__val { font-size: 14px; }
  .v525-mgr { left: 8px; bottom: 8px; max-width: 200px; padding: 8px 10px 8px 42px; }
  .v525-mgr__head { width: 28px; height: 28px; left: 6px; font-size: 16px; }
  .v525-payout { font-size: clamp(40px, 14vw, 68px); }
}
