/* ============================================================
   HYPERION — curves, light and particles
   ============================================================ */
@property --spin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

:root {
  --blue: var(--v-blueColor, #1f8fff);
  --orange: var(--v-orangeColor, #ff8a15);
  --accent: var(--v-accentColor, #7df9ff);
  --accent2: var(--v-accent2Color, #b388ff);
  --fx: calc(var(--v-fxIntensity, 70) / 100);
  --ink: #f2f6ff;
  --dim: #8f9bbd;
  --glass: rgba(8, 12, 26, .82);
  --display: "Exo 2", "Segoe UI", sans-serif;
  --text: "Inter", "Segoe UI", sans-serif;
}
html, body { margin: 0; width: 1920px; height: 1080px; overflow: hidden; background: transparent; }
body { font-family: var(--text); color: var(--ink); position: relative; }

/* svg gradient stops driven by CSS variables */
.s-blue { stop-color: var(--blue); }
.s-orange { stop-color: var(--orange); }
.s-accent { stop-color: var(--accent); }
.s-team { stop-color: var(--team, var(--blue)); }
.s-team-light { stop-color: color-mix(in srgb, var(--team, var(--blue)) 45%, #fff); }

/* ============ AURORA ============ */
.aurora { position: absolute; left: 50%; top: -120px; width: 1300px; height: 380px; transform: translateX(-50%);
  filter: blur(60px); opacity: calc(.55 * var(--fx)); pointer-events: none; }
.aurora i { position: absolute; border-radius: 50%; mix-blend-mode: screen; }
.aurora i:nth-child(1) { width: 560px; height: 300px; left: 40px; top: 40px; background: var(--blue); animation: drift1 11s ease-in-out infinite alternate; }
.aurora i:nth-child(2) { width: 560px; height: 300px; right: 40px; top: 40px; background: var(--orange); animation: drift2 13s ease-in-out infinite alternate; }
.aurora i:nth-child(3) { width: 520px; height: 240px; left: 390px; top: 10px; background: var(--accent2); opacity: .8; animation: drift3 9s ease-in-out infinite alternate; }

/* ============ SCOREBUG ============ */
.sb { position: absolute; left: 50%; top: 0; width: 1000px; height: 190px; transform: translateX(-50%); animation: sbIn .8s cubic-bezier(.2,.9,.2,1) both; }
.sb-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.sb-body { fill: url(#sbGlass); }
.sb-tint { fill: url(#sbTint); opacity: .55; mix-blend-mode: screen; }
.sb-edge { fill: none; stroke: url(#edgeGrad); stroke-width: 2.5; }
.sb-edge-glow { fill: none; stroke: url(#edgeGrad); stroke-width: 10; opacity: calc(.9 * var(--fx)); }
.sb-comet { fill: none; stroke: #fff; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 90 1910; filter: drop-shadow(0 0 8px var(--accent)) drop-shadow(0 0 18px var(--accent));
  animation: comet 4.5s linear infinite; opacity: var(--fx); }
.sb-name { font: italic 800 30px var(--display); fill: var(--ink); letter-spacing: .04em; text-transform: uppercase; paint-order: stroke; stroke: rgba(0,0,0,.35); stroke-width: 3px; }
.sb-series { font: 700 13px var(--text); fill: var(--dim); letter-spacing: .26em; text-transform: uppercase; }
.sb-series tspan:first-child { fill: var(--accent); }

.clock-ticks { fill: none; stroke: rgba(255,255,255,.18); stroke-width: 5; stroke-dasharray: .35 .65; }
.clock-track { fill: none; stroke: rgba(255,255,255,.08); stroke-width: 5; }
.clock-fill { fill: none; stroke: url(#edgeGrad); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 100 100;
  stroke-dashoffset: calc((100 - var(--sec, 300) / 3) * 1px); transition: stroke-dashoffset .9s linear;
  filter: drop-shadow(0 0 6px var(--accent)); }
.sb.ot .clock-fill { stroke-dashoffset: 0; stroke: var(--accent); animation: otPulse 1.1s ease-in-out infinite; }
.clock-core { stroke: rgba(255,255,255,.08); stroke-width: 1; }

.sb-clock { position: absolute; left: 440px; top: 40px; width: 120px; height: 60px; display: grid; place-content: center; text-align: center;
  font: 800 36px var(--display); font-variant-numeric: tabular-nums; letter-spacing: .02em; text-shadow: 0 0 calc(18px * var(--fx)) var(--accent); }
.sb-clock small { font: 700 9px var(--text); letter-spacing: .3em; color: var(--accent); margin-top: -2px; }
.sb.ot .sb-clock { color: var(--accent); }

.sb-score { position: absolute; top: 18px; width: 90px; text-align: center; font: italic 900 66px/1 var(--display); }
.sb-score.l { left: 336px; text-shadow: 0 0 calc(26px * var(--fx)) var(--blue), 0 0 2px #fff; }
.sb-score.r { left: 574px; text-shadow: 0 0 calc(26px * var(--fx)) var(--orange), 0 0 2px #fff; }
.sb-logo { position: absolute; top: 8px; width: 46px; height: 46px; object-fit: contain; filter: drop-shadow(0 0 10px rgba(0,0,0,.6)); }
.sb-logo.l { left: 38px; }
.sb-logo.r { right: 38px; }

.pips { position: absolute; top: 104px; display: flex; gap: 7px; }
.pips.l { left: 250px; transform: rotate(14deg); }
.pips.r { right: 250px; transform: rotate(-14deg); flex-direction: row-reverse; }
.pips i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(255,255,255,.28); transition: .4s; }
.pips.l i.won { background: var(--blue); border-color: #fff; box-shadow: 0 0 calc(14px * var(--fx)) var(--blue); }
.pips.r i.won { background: var(--orange); border-color: #fff; box-shadow: 0 0 calc(14px * var(--fx)) var(--orange); }

.sb-event { position: absolute; left: 50%; top: 178px; transform: translateX(-50%); padding: 5px 22px; border-radius: 999px;
  background: var(--glass); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  font: 800 13px var(--display); letter-spacing: .32em; text-transform: uppercase; color: var(--accent); white-space: nowrap;
  box-shadow: 0 0 calc(22px * var(--fx)) color-mix(in srgb, var(--accent) 35%, transparent); }

/* ============ CURVED ROSTERS ============ */
.roster { position: absolute; top: 300px; width: 330px; display: grid; gap: 16px; }
.roster.l { left: 26px; }
.roster.r { right: 26px; }
.pl { --c: var(--blue); position: relative; height: 66px; transition: transform .45s cubic-bezier(.2,.9,.2,1), opacity .3s, filter .3s; }
.roster.r .pl { --c: var(--orange); }
/* rows bow towards the centre of the screen, tracing a curve */
.roster.l .pl:nth-of-type(2) { transform: translateX(30px); }
.roster.r .pl:nth-of-type(2) { transform: translateX(-30px); }
.roster.l .pl:nth-of-type(4) { transform: translateX(-10px); }
.roster.r .pl:nth-of-type(4) { transform: translateX(10px); }
.pl-top { position: absolute; top: 0; left: 6px; right: 70px; display: flex; gap: 8px; align-items: center; }
.roster.r .pl-top { left: 70px; right: 6px; justify-content: flex-end; }
.pl-name { font: italic 800 21px var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 2px 6px rgba(0,0,0,.8); }
.pl-demo { display: none; font: 800 9px var(--text); font-style: normal; letter-spacing: .2em; padding: 2px 7px; border-radius: 999px; background: #ff3d6e; color: #fff; }
.pl.demo .pl-demo { display: inline-block; }
.pl-arc { position: absolute; left: 0; bottom: 0; width: 262px; height: 34px; overflow: visible; }
.roster.r .pl-arc { left: auto; right: 0; transform: scaleX(-1); }
.roster.r .pl-orb { left: 0; right: auto; }
.arc-track { fill: none; stroke: rgba(205, 220, 255, .16); stroke-width: 11; stroke-linecap: round; filter: drop-shadow(0 2px 3px rgba(0,0,0,.7)); }
.arc-fill, .arc-glow { fill: none; stroke: var(--c); stroke-width: 7; stroke-linecap: round; stroke-dasharray: 100 100;
  stroke-dashoffset: calc((100 - var(--b, 0)) * 1px); transition: stroke-dashoffset .35s cubic-bezier(.25, .8, .3, 1); }
.arc-glow { stroke-width: 16; opacity: calc(.45 * var(--fx)); filter: blur(5px); }
.pl.boosting .arc-fill { stroke: color-mix(in srgb, var(--c) 55%, #fff); }
.pl.ss .arc-fill { stroke: url(#edgeGrad); }
.pl-orb { position: absolute; right: 0; bottom: -4px; width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 40%, #1a2342), #05070f 70%);
  border: 2px solid color-mix(in srgb, var(--c) 70%, transparent);
  box-shadow: 0 0 calc(18px * var(--fx)) color-mix(in srgb, var(--c) 60%, transparent), inset 0 0 12px rgba(0,0,0,.6);
  font: 900 24px var(--display); font-variant-numeric: tabular-nums; }
.pl.target .pl-orb { border-color: #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 50%, transparent), 0 0 calc(30px * var(--fx)) var(--accent); }
.roster.l .pl.target { transform: translateX(46px) !important; }
.roster.r .pl.target { transform: translateX(-46px) !important; }
.pl.demo { opacity: .45; filter: grayscale(.8); }
.pl.rl-enter { opacity: 0; transform: translateY(16px) !important; }

/* ============ SPECTATED PLAYER ============ */
.tc { --team: var(--blue); position: absolute; left: 50%; bottom: 36px; transform: translateX(-50%); height: 128px; min-width: 640px;
  display: flex; align-items: center; padding: 0 44px 0 168px; border-radius: 999px; background: var(--glass);
  border: 1px solid color-mix(in srgb, var(--team) 40%, transparent);
  box-shadow: 0 20px 60px rgba(0,0,0,.45), 0 0 calc(40px * var(--fx)) color-mix(in srgb, var(--team) 30%, transparent);
  animation: tcIn .5s cubic-bezier(.2,.9,.2,1) both; }
.tc.orange { --team: var(--orange); }
.tc::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: conic-gradient(from var(--spin), transparent 0 70%, var(--accent) 85%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spin 5s linear infinite; opacity: var(--fx); }
.gauge { position: absolute; left: -26px; top: 50%; width: 200px; height: 200px; transform: translateY(-50%); overflow: visible; }
.g-speed-track { fill: none; stroke: rgba(255,255,255,.07); stroke-width: 5; stroke-dasharray: 75 100; stroke-linecap: round; }
.g-speed { fill: none; stroke: var(--accent2); stroke-width: 5; stroke-linecap: round; transition: stroke-dasharray .2s linear;
  stroke-dasharray: min(calc(var(--s, 0) * .9px), 75px) 100px; filter: drop-shadow(0 0 6px var(--accent2)); }
.tc.ss .g-speed { stroke: #fff; filter: drop-shadow(0 0 10px var(--accent)); }
.g-ticks { fill: none; stroke: rgba(255,255,255,.22); stroke-width: 6; stroke-dasharray: .25 .75; }
.g-track { fill: rgba(4,6,14,.92); stroke: rgba(255,255,255,.07); stroke-width: 12; }
.g-fill, .g-glow { fill: none; stroke: url(#boostGrad); stroke-width: 12; stroke-linecap: round; stroke-dasharray: 100 100;
  stroke-dashoffset: calc((100 - var(--b, 0)) * 1px); transition: stroke-dashoffset .35s cubic-bezier(.25, .8, .3, 1); }
.g-glow { stroke-width: 22; opacity: calc(.6 * var(--fx)); filter: blur(7px); }
.g-label { font: 800 10px var(--text); letter-spacing: .5em; fill: var(--dim); }
.g-num { position: absolute; left: -26px; top: 50%; width: 200px; transform: translateY(-58%); text-align: center; pointer-events: none;
  font: 900 58px/1 var(--display); font-variant-numeric: tabular-nums; text-shadow: 0 0 calc(20px * var(--fx)) var(--team); }
.tc-info { display: grid; gap: 6px; }
.tc-name { font: italic 900 40px/1 var(--display); letter-spacing: .01em; }
.tc-team { display: flex; align-items: center; gap: 10px; font: 700 13px var(--text); letter-spacing: .22em; text-transform: uppercase; color: var(--team); }
.tc-team i { width: 22px; height: 3px; border-radius: 3px; background: var(--team); box-shadow: 0 0 10px var(--team); }
.tc-speed { margin-left: 10px; color: var(--accent2); letter-spacing: .1em; }
.tc-stats { display: flex; gap: 8px; margin-top: 4px; }
.tc-stats span { display: grid; justify-items: center; min-width: 62px; padding: 5px 10px; border-radius: 14px; background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06); font: 700 10px var(--text); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.tc-stats b { font: 800 22px var(--display); color: var(--ink); letter-spacing: 0; }

/* ============ STAT FEED ============ */
.feed { position: absolute; right: 40px; top: 640px; display: grid; gap: 10px; justify-items: end; }
.fi { --c: var(--blue); position: relative; overflow: hidden; display: flex; align-items: center; gap: 10px; padding: 9px 20px 9px 14px;
  border-radius: 999px 18px 18px 999px; background: var(--glass); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
  font: 600 17px var(--text); transition: transform .45s cubic-bezier(.2,.9,.2,1), opacity .3s; }
.fi.orange { --c: var(--orange); }
.fi::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.22) 50%, transparent 70%);
  transform: translateX(-120%); animation: shimmer 1.2s .15s ease-out forwards; }
.fi-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 12px var(--c); }
.fi > span { color: var(--accent); font: 800 13px var(--display); letter-spacing: .14em; text-transform: uppercase; }
.fi-sec { color: var(--dim); }
.fi.rl-enter { transform: translateX(60px) scale(.9); opacity: 0; }

/* ============ REPLAY BADGE ============ */
.replay { position: absolute; top: 36px; right: 52px; width: 160px; height: 160px; animation: pop .5s cubic-bezier(.2,1.4,.4,1) both; }
.replay svg { width: 100%; height: 100%; overflow: visible; }
.rp-ring { fill: var(--glass); stroke: color-mix(in srgb, var(--accent) 50%, transparent); stroke-width: 1.5; }
.rp-spin { animation: rot 9s linear infinite; transform-origin: 0 0; }
.rp-text { font: 800 15px var(--display); letter-spacing: .36em; fill: var(--accent); }
.rp-core { fill: rgba(255, 61, 110, .12); stroke: rgba(255, 61, 110, .5); stroke-width: 1.5; }
.rp-dot { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px; border-radius: 50%; background: #ff3d6e;
  box-shadow: 0 0 22px #ff3d6e; animation: blink 1.1s ease-in-out infinite; }

/* ============ GOAL ============ */
.goal { --team: var(--blue); position: absolute; inset: 0; pointer-events: none; }
.goal.orange { --team: var(--orange); }
.goal:not(.on) { animation: fadeOut .5s ease-in forwards; }
.g-flash { position: absolute; inset: 0; opacity: 0;
  background: radial-gradient(ellipse 60% 45% at 50% 52%, color-mix(in srgb, var(--team) 55%, transparent), transparent 70%); }
.goal.on .g-flash { animation: flash 1.6s ease-out forwards; }
.shock { position: absolute; left: 50%; top: 52%; }
.shock i { position: absolute; left: 0; top: 0; width: 200px; height: 200px; margin: -100px; border-radius: 50%;
  border: 6px solid var(--team); box-shadow: 0 0 40px var(--team), inset 0 0 40px var(--team); opacity: 0; }
.goal.on .shock i { animation: shock 1.6s cubic-bezier(.1,.8,.3,1) forwards; }
.goal.on .shock i:nth-child(2) { animation-delay: .18s; border-color: var(--accent); }
.goal.on .shock i:nth-child(3) { animation-delay: .36s; border-width: 2px; }
.g-streak { position: absolute; top: 330px; left: -40%; width: 40%; height: 420px; opacity: 0; transform: skewX(-22deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent); filter: blur(6px); }
.goal.on .g-streak { animation: streak 1.1s .35s ease-in-out forwards; }
.goal-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.g-word, .g-word-glow { font: italic 900 250px var(--display); letter-spacing: .12em; }
.g-word { fill: url(#goalFill); stroke: #fff; stroke-width: 2px; paint-order: stroke; opacity: 0; }
.g-word-glow { fill: var(--team); filter: blur(28px); opacity: 0; }
.goal.on .g-word { animation: wordIn .9s .12s cubic-bezier(.2,1.3,.4,1) forwards, breathe 2.4s 1.1s ease-in-out infinite alternate; }
.goal.on .g-word-glow { animation: glowIn 1.2s .12s ease-out forwards; }
.g-word, .g-word-glow { transform-box: fill-box; transform-origin: 50% 70%; }
.g-scorer { font: italic 800 74px var(--display); fill: #fff; letter-spacing: .04em; text-transform: uppercase; opacity: 0;
  filter: drop-shadow(0 0 18px var(--team)); }
.goal.on .g-scorer { animation: riseIn .7s .55s cubic-bezier(.2,.9,.2,1) forwards; }
.g-meta { position: absolute; left: 50%; top: 718px; transform: translateX(-50%); display: flex; gap: 14px; align-items: center; opacity: 0; white-space: nowrap; }
.goal.on .g-meta { animation: riseIn .7s .8s cubic-bezier(.2,.9,.2,1) forwards; }
.g-meta > span { padding: 8px 20px; border-radius: 999px; background: var(--glass); border: 1px solid color-mix(in srgb, var(--team) 45%, transparent);
  font: 600 19px var(--text); letter-spacing: .06em; color: var(--dim); }
.g-meta b { color: var(--ink); font-weight: 800; }
.g-meta .g-team { color: #fff; background: var(--team); border-color: transparent; font: italic 800 19px var(--display); letter-spacing: .12em; text-transform: uppercase; }

/* ============ WINNER ============ */
.win { --team: var(--blue); position: absolute; left: 50%; top: 50%; width: 1200px; height: 620px; transform: translate(-50%, -50%); text-align: center; }
.win.orange { --team: var(--orange); }
.win-aurora { position: absolute; inset: 60px 100px; filter: blur(70px); opacity: calc(.8 * var(--fx)); }
.win-aurora i { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from var(--spin), var(--team), var(--accent), var(--accent2), var(--team)); animation: spin 6s linear infinite; }
.win-aurora i + i { inset: 80px 200px; background: var(--team); animation: breathe 3s ease-in-out infinite alternate; }
.win-svg { position: relative; width: 100%; height: 420px; overflow: visible; }
.win-name { font: italic 900 150px var(--display); fill: #fff; letter-spacing: .06em; text-transform: uppercase; filter: drop-shadow(0 0 30px var(--team));
  animation: wordIn 1s cubic-bezier(.2,1.3,.4,1) both; transform-box: fill-box; transform-origin: 50% 70%; }
.win-sub { position: relative; margin-top: -120px; font: 800 30px var(--display); letter-spacing: .7em; color: var(--accent); text-shadow: 0 0 20px var(--accent);
  animation: riseIn .8s .5s both; }
.win-score { position: relative; display: inline-flex; gap: 24px; align-items: center; margin-top: 18px; padding: 10px 36px; border-radius: 999px;
  background: var(--glass); font: 900 54px var(--display); animation: riseIn .8s .7s both; }
.win-score i { width: 18px; height: 3px; background: var(--dim); }

/* the goal owns the screen: step the HUD back while it plays */
.roster, .tc, .feed { transition: opacity .4s ease, filter .4s ease; }
body.rl-goal .roster, body.rl-goal .tc, body.rl-goal .feed { opacity: 0; filter: blur(6px); }

/* ============ PARTICLES CANVAS ============ */
#fx { position: absolute; inset: 0; width: 1920px; height: 1080px; pointer-events: none; }

/* ============ KEYFRAMES ============ */
@keyframes comet { from { stroke-dashoffset: 0; } to { stroke-dashoffset: -2000; } }
@keyframes sbIn { from { opacity: 0; transform: translate(-50%, -60px); } }
@keyframes tcIn { from { opacity: 0; transform: translate(-50%, 40px) scale(.94); } }
@keyframes spin { to { --spin: 360deg; } }
@keyframes rot { to { transform: rotate(360deg); } }
@keyframes otPulse { 50% { opacity: .35; } }
@keyframes blink { 50% { transform: scale(.7); opacity: .55; } }
@keyframes pop { from { transform: scale(.4) rotate(-40deg); opacity: 0; } }
@keyframes shimmer { to { transform: translateX(120%); } }
@keyframes drift1 { to { transform: translate(120px, 30px) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-120px, 20px) scale(1.1); } }
@keyframes drift3 { from { transform: translateX(-80px) scale(.9); } to { transform: translateX(80px) scale(1.15); } }
@keyframes flash { 0% { opacity: 0; } 12% { opacity: calc(1 * var(--fx) + .2); } 100% { opacity: .35; } }
@keyframes shock { 0% { opacity: 1; transform: scale(.2); } 100% { opacity: 0; transform: scale(9); } }
@keyframes streak { 0% { opacity: 0; left: -40%; } 30% { opacity: 1; } 100% { opacity: 0; left: 110%; } }
@keyframes wordIn { 0% { opacity: 0; transform: scale(2.2); letter-spacing: .6em; } 100% { opacity: 1; transform: scale(1); } }
@keyframes glowIn { 0% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: .75; } }
@keyframes breathe { from { transform: scale(1); } to { transform: scale(1.035); } }
@keyframes riseIn { from { opacity: 0; transform: translate(0, 30px); } to { opacity: 1; } }
.g-meta { --tx: -50%; }
.goal.on .g-meta { animation-name: metaIn; }
@keyframes metaIn { from { opacity: 0; transform: translate(-50%, 30px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }

/* ============ AUTO-FIT (long names) ============ */
.tc-name { white-space: nowrap; max-width: 400px; overflow: hidden; text-overflow: ellipsis; }

/* ============ EVENT LOGO (Controller: Branding → Event logo) ============ */
.sb-event { display: flex; align-items: center; gap: 10px; }
.sb-event .ev-logo { height: 18px; width: auto; max-width: 60px; object-fit: contain; margin-left: -8px; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 60%, transparent)); }
