/* VS — calm motion layer (design system v2 §5, effects.js).
   Allowed: colour/background transitions, odds price-change flash, score tint fade, LIVE dot opacity pulse,
   sheet/drawer slide (200ms), toast slide-in, skeleton shimmer, short win confetti, tab underline slide.
   Nothing lifts, scales, ripples, glows or sweeps. "Reduced" keeps colour changes only. */

/* ---------- tab underline slide ------------------------------------------ */
.fx-ind-host { position: relative; }
.fx-ind-host > .fx-ind {
  position: absolute; left: 0; bottom: 0; height: 2px; width: var(--w, 0px); border-radius: 2px 2px 0 0; background: var(--primary);
  transform: translate3d(var(--l, 0px), 0, 0); opacity: 0; pointer-events: none; z-index: 1;
}
.fx-ind-host > .fx-ind.is-shown { opacity: 1; }
html.fx-on .fx-ind-host > .fx-ind.is-anim { transition: transform .2s var(--ease-out), width .2s var(--ease-out); }
/* the sliding bar replaces the static underline once it is placed */
.fx-ind-host.fx-ind-ready > .tab::after, .fx-ind-host.fx-ind-ready > .slip-tab::after { background: transparent !important; }

/* ---------- LIVE dots: opacity pulse only (keyframes `pulse` live in match.css) */

/* ---------- skeleton shimmer (until the first live poll lands) ----------- */
.fx-skel { position: relative; overflow: hidden; color: transparent !important; background: var(--hover) !important; border-radius: 4px; min-width: 2ch; }
.fx-skel::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent);
  transform: translate3d(-100%, 0, 0); animation: fx-shimmer 1.3s ease-in-out infinite;
}
[data-theme="dark"] .fx-skel::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .06), transparent); }
@media (prefers-color-scheme: dark) { html[data-theme="system"] .fx-skel::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .06), transparent); } }
@keyframes fx-shimmer { to { transform: translate3d(100%, 0, 0); } }

/* ---------- sheets, drawers, menus: 200ms slide/fade ---------------------- */
@media (max-width: 1099px) {
  html.fx-on .slip { transition: transform .2s var(--ease-out), visibility 0s linear .2s; }
  html.fx-on body.sheet-open .slip { transition: transform .2s var(--ease-out), visibility 0s; }
  html.fx-on .slip-backdrop { transition: opacity .2s var(--ease); }
}

/* ---------- toast: slide in + auto-dismiss bar ----------------------------- */
.toast { position: relative; overflow: hidden; }
html.fx-on .toast { animation: fx-toast-in .2s var(--ease-out); }
html.fx-on .toast.is-leaving { animation: fx-toast-out .16s var(--ease) forwards; }
@keyframes fx-toast-in { from { opacity: 0; transform: translate3d(0, 8px, 0); } to { opacity: 1; transform: none; } }
@keyframes fx-toast-out { to { opacity: 0; } }
.toast-life { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--primary); transform-origin: 0 50%; animation: fx-life var(--life, 9s) linear forwards; opacity: .6; }
.toast.is-won .toast-life { background: var(--success); }
@keyframes fx-life { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ---------- confetti canvas (won bets only) -------------------------------- */
.fx-confetti { position: fixed; inset: 0; z-index: 95; pointer-events: none; }

/* ---------- theme switch: colour cross-fade -------------------------------- */
/* Theme switch: no per-element transitions while the theme flips (that restyled + animated every
   node and made large pages stutter). The smooth fade comes from one View Transition snapshot. */
html.fx-theme-instant, html.fx-theme-instant *, html.fx-theme-instant *::before, html.fx-theme-instant *::after {
  transition: none !important;
}
::view-transition-old(root), ::view-transition-new(root) {
  animation-duration: .32s;
  animation-timing-function: cubic-bezier(.4, 0, .2, 1);
  mix-blend-mode: normal;
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* ---------- reduced motion: hard off (colour changes stay) ----------------- */
html[data-motion="reduced"] .fx-ind-host > .fx-ind { transition: none !important; }
html[data-motion="reduced"] .fx-confetti { display: none !important; }
html[data-motion="reduced"] .fx-skel::after, html[data-motion="reduced"] .toast-life { display: none; }

/* ==========================================================================
   v4 motion polish (transform/opacity only; everything gated on html.fx-on so
   "Reduced" — or System + OS reduce — stays static)
   ========================================================================== */
/* ---------- VS logo ---------- */
.brand { --logo-v: #62E4BE; color: #fff; }
[data-theme="light"] .brand { color: #0e131a; }
@media (prefers-color-scheme: light) { html[data-theme="system"] .brand { color: #0e131a; } }
.vs-logo { display: block; overflow: visible; flex: none; }
.vs-logo .vs-v, .vs-logo .vs-s { transform-box: fill-box; transform-origin: 50% 50%; transition: transform .22s var(--ease-out); }
.vs-sheen { opacity: 0; }
/* first load of the session: V from the left (skewed), S from the right, 80ms stagger, then one sheen */
html.fx-on.vs-intro .vs-logo .vs-v { animation: vs-in-l .6s cubic-bezier(.16, 1, .3, 1) both; }
html.fx-on.vs-intro .vs-logo .vs-s { animation: vs-in-r .6s cubic-bezier(.16, 1, .3, 1) .08s both; }
html.fx-on.vs-intro .vs-logo .vs-sheen { animation: vs-sheen .9s ease-in-out .72s 1 both; }
@keyframes vs-in-l { from { opacity: 0; transform: translate3d(-60%, 0, 0) skewX(18deg); } to { opacity: 1; transform: none; } }
@keyframes vs-in-r { from { opacity: 0; transform: translate3d(60%, 0, 0) skewX(-18deg); } to { opacity: 1; transform: none; } }
@keyframes vs-sheen { 0% { opacity: 0; transform: translate3d(0, 0, 0) skewX(-20deg); } 15% { opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; transform: translate3d(2300px, 0, 0) skewX(-20deg); } }
/* hover: the letters nudge apart 2px and a mint glow pulses once */
html.fx-on .brand:hover .vs-v, html.fx-on .brand:focus-visible .vs-v { transform: translate3d(-2px, 0, 0); }
html.fx-on .brand:hover .vs-s, html.fx-on .brand:focus-visible .vs-s { transform: translate3d(2px, 0, 0); }
.brand { position: relative; isolation: isolate; }
.brand::after { content: ""; position: absolute; inset: 4px -6px; z-index: -1; border-radius: 14px; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 38%, transparent), transparent); opacity: 0; pointer-events: none; }
html.fx-on .brand:hover::after, html.fx-on .brand:focus-visible::after { animation: vs-glow .7s ease-out 1; }
@keyframes vs-glow { 0% { opacity: 0; transform: scale(.85); } 40% { opacity: 1; } 100% { opacity: 0; transform: scale(1.15); } }

/* ---------- page content fade-in (150ms, no rise) ---------- */
html.fx-on .main { animation: fx-fade .15s ease-out; }   /* no fill-mode: a finished animation must not leave a stacking context on .main */
@keyframes fx-fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- odds: 1px hover lift + mint border glow, selected pop ---------- */
html.fx-on .odds { transition: transform .14s var(--ease-out), background-color .12s var(--ease), border-color .12s var(--ease), box-shadow .14s var(--ease); }
html.fx-on .odds:hover:not(:disabled):not(.is-selected) { transform: translate3d(0, -1px, 0); border-color: color-mix(in srgb, var(--accent) 55%, var(--odds-border)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent), 0 6px 14px -8px color-mix(in srgb, var(--accent) 60%, transparent); }
html.fx-on .odds.is-selected { animation: fx-odds-pop .24s cubic-bezier(.34, 1.56, .64, 1) 1; }
@keyframes fx-odds-pop { 0% { transform: scale(.94); } 100% { transform: scale(1); } }

/* ---------- slip: newest selection card slides in ---------- */
html.fx-on .slip-items .bs-item:last-child { animation: fx-slip-in .22s var(--ease-out) both; }
@keyframes fx-slip-in { from { opacity: 0; transform: translate3d(14px, 0, 0); } to { opacity: 1; transform: none; } }
html.fx-on .slip-ticket { animation: fx-fade .2s ease-out both; }

/* ---------- live dots: gentle opacity pulse ---------- */
html.fx-on .mrow[data-status="live"] .mrow-dot, html.fx-on .side-inplay .side-dot, html.fx-on .fm[data-status="live"] .fm-comp::before,
html.fx-on .pulse-dot, html.fx-on .live-dot { animation: fx-live 1.6s ease-in-out infinite; }
@keyframes fx-live { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ---------- score flash: mint tint on change (the .flash class is set by match.js) ---------- */
html.fx-on .tscore.flash, html.fx-on .fm-box b.flash { animation: fx-score .9s ease-out 1; }
@keyframes fx-score { 0% { opacity: .35; transform: scale(1.12); } 100% { opacity: 1; transform: none; } }

html[data-motion="reduced"] .main, html[data-motion="reduced"] .odds, html[data-motion="reduced"] .bs-item, html[data-motion="reduced"] .vs-logo * { animation: none !important; transition: none !important; }
