/* Flash Cup cold-start loader. Markup + script live inline in index.html.
   Kept as a static file (not inline) so Vite leaves it alone. */
body.fl-loading { overflow: hidden; background: #050505; }
#fl-loader {
  --amber: #F2A93B; --amber-deep: #D98F1F; --gold-hi: #FFE08A; --chalk: #F5F7F2; --mist: #8FA097; --ink: #0B1420; --p: 0;
  position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; overflow: hidden;
  background: #050505; color: var(--chalk);
  font-family: 'Oswald', 'Arial Narrow', Arial, sans-serif; -webkit-font-smoothing: antialiased;
  transition: opacity .6s ease, visibility .6s ease;
}
#fl-loader *, #fl-loader *::before, #fl-loader *::after { box-sizing: border-box; margin: 0; padding: 0; }
#fl-loader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
/* Same-tab reload: no intro, just the essentials */
#fl-loader.quick *, #fl-loader.quick *::before, #fl-loader.quick *::after { animation-delay: 0s !important; }
#fl-loader.quick .fl-bg { animation: none; filter: brightness(.38) saturate(1.1); }

/* Stadium backdrop, floodlights switching on */
#fl-loader .fl-bg {
  position: absolute; inset: -4%;
  background: url("/loader/stadion_cover.webp") center 60% / cover no-repeat;
  filter: brightness(.38) saturate(1.1);
  animation: fl-bg-push 14s ease-out forwards, fl-bg-on 2.2s ease-out forwards;
}
@keyframes fl-bg-push { from { transform: scale(1.12); } to { transform: scale(1); } }
@keyframes fl-bg-on {
  0% { filter: brightness(.05) saturate(.6); } 30% { filter: brightness(.22) saturate(.9); }
  34% { filter: brightness(.10) saturate(.8); } 60% { filter: brightness(.34) saturate(1.05); }
  100% { filter: brightness(.38) saturate(1.1); }
}
#fl-loader .fl-vignette {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 60% at 50% 42%, transparent 0%, rgba(0,0,0,.55) 70%, rgba(0,0,0,.92) 100%),
    linear-gradient(180deg, rgba(0,0,0,.55) 0%, transparent 25%, transparent 60%, rgba(0,0,0,.85) 100%);
}
#fl-loader .fl-flood {
  position: absolute; top: -12vmin; width: 60vmin; height: 60vmin; pointer-events: none;
  background: radial-gradient(circle, rgba(255,236,170,.55) 0%, rgba(242,169,59,.22) 22%, transparent 60%);
  mix-blend-mode: screen; opacity: 0;
  animation: fl-flood-on .9s ease-out forwards, fl-flood-breathe 4s ease-in-out 1.6s infinite;
}
#fl-loader .fl-flood::after {
  content: ""; position: absolute; inset: 20%; border-radius: 50%; filter: blur(2px);
  background: repeating-conic-gradient(from 0deg, rgba(255,230,160,.16) 0deg 3deg, transparent 3deg 18deg);
  -webkit-mask: radial-gradient(circle, #000 0 20%, transparent 62%); mask: radial-gradient(circle, #000 0 20%, transparent 62%);
  animation: fl-rays 30s linear infinite;
}
#fl-loader .fl-flood.l { left: -14vmin; animation-delay: .35s, 1.6s; }
#fl-loader .fl-flood.r { right: -14vmin; animation-delay: .75s, 2.1s; }
@keyframes fl-flood-on { 0% { opacity: 0; } 40% { opacity: .9; } 55% { opacity: .25; } 100% { opacity: .8; } }
@keyframes fl-flood-breathe { 0%,100% { opacity: .8; } 50% { opacity: .6; } }
@keyframes fl-rays { to { transform: rotate(360deg); } }
#fl-loader .fl-streak {
  position: absolute; left: -20%; right: -20%; top: 50%; height: 34vmin; pointer-events: none;
  transform: translateY(-50%) rotate(-28deg); filter: blur(6px); mix-blend-mode: screen;
  background: linear-gradient(90deg, transparent 0%, rgba(242,169,59,0) 20%, rgba(242,169,59,.16) 45%, rgba(255,224,138,.22) 52%, rgba(242,169,59,.10) 62%, transparent 85%);
  animation: fl-streak-in 1.4s cubic-bezier(.2,.8,.2,1) .4s both;
}
@keyframes fl-streak-in { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
#fl-loader .fl-flashes { position: absolute; left: 0; right: 0; top: 46%; height: 22%; pointer-events: none; }
#fl-loader .fl-camflash {
  position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #fff; opacity: 0;
  box-shadow: 0 0 8px 3px rgba(255,255,255,.8), 0 0 22px 8px rgba(255,220,150,.35);
  animation: fl-camflash .35s ease-out forwards;
}
@keyframes fl-camflash { 0% { opacity: 0; transform: scale(.4); } 20% { opacity: 1; transform: scale(1.3); } 100% { opacity: 0; transform: scale(.6); } }
#fl-loader canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* Center stage */
#fl-loader .fl-stage { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; width: min(560px, 90vw); padding-bottom: 2vh; }
#fl-loader .fl-logo-wrap { position: relative; width: clamp(130px, 26vmin, 210px); aspect-ratio: 1; animation: fl-logo-in 1s cubic-bezier(.34,1.56,.64,1) .9s both; }
#fl-loader .fl-logo-wrap::before {
  content: ""; position: absolute; inset: -38%; border-radius: 50%; z-index: -1; filter: blur(8px);
  background: radial-gradient(circle, rgba(242,169,59,.55) 0%, rgba(46,107,198,.25) 35%, transparent 65%);
  animation: fl-halo 2.8s ease-in-out infinite;
}
#fl-loader .fl-logo { width: 100%; height: 100%; display: block; border-radius: 22%; filter: drop-shadow(0 14px 30px rgba(0,0,0,.6)); animation: fl-float 4s ease-in-out 2s infinite; }
#fl-loader .fl-shine { position: absolute; inset: 0; border-radius: 22%; overflow: hidden; pointer-events: none; animation: fl-float 4s ease-in-out 2s infinite; }
#fl-loader .fl-shine::after {
  content: ""; position: absolute; inset: -50%; transform: translateX(-60%);
  background: linear-gradient(115deg, transparent 42%, rgba(255,255,255,.55) 49%, rgba(255,255,255,.12) 53%, transparent 58%);
  animation: fl-shine 3.6s ease-in-out 1.9s infinite;
}
@keyframes fl-logo-in { 0% { opacity: 0; transform: scale(.4) rotate(-12deg); filter: blur(6px); } 100% { opacity: 1; transform: none; filter: none; } }
@keyframes fl-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes fl-halo { 0%,100% { opacity: .65; transform: scale(.96); } 50% { opacity: 1; transform: scale(1.04); } }
@keyframes fl-shine { 0%, 25% { transform: translateX(-60%); } 70%, 100% { transform: translateX(60%); } }
#fl-loader .fl-word {
  margin-top: 2.2vh; display: flex; gap: .28em;
  font-family: 'Bebas Neue', 'Arial Narrow', sans-serif; font-weight: 400;
  font-size: clamp(46px, 10vmin, 84px); line-height: .9; letter-spacing: .06em;
  background: linear-gradient(180deg, #FFF3C4 0%, var(--gold-hi) 30%, var(--amber) 58%, var(--amber-deep) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 rgba(90,50,5,.9)) drop-shadow(0 10px 24px rgba(242,169,59,.35));
}
#fl-loader .fl-word span { display: inline-block; animation: fl-word-in .7s cubic-bezier(.2,.9,.3,1.3) both; }
#fl-loader .fl-word span:nth-child(1) { animation-delay: 1.35s; }
#fl-loader .fl-word span:nth-child(2) { animation-delay: 1.5s; }
@keyframes fl-word-in { from { opacity: 0; transform: translateY(26px) skewX(-10deg); } to { opacity: 1; transform: none; } }
#fl-loader .fl-tagline { margin-top: .7vh; font-size: clamp(11px, 1.7vmin, 13px); letter-spacing: .42em; text-transform: uppercase; color: rgba(245,247,242,.62); animation: fl-fade-up .6s ease 1.8s both; }
#fl-loader .fl-tagline b { color: var(--amber); font-weight: 500; }
@keyframes fl-fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Pitch progress bar */
#fl-loader .fl-pitchbar { position: relative; width: 100%; margin-top: 4.5vh; height: 74px; animation: fl-fade-up .6s ease 2s both; }
#fl-loader .fl-strip {
  position: absolute; left: 22px; right: 22px; top: 26px; height: 22px; border-radius: 4px; overflow: hidden;
  background: repeating-linear-gradient(90deg, #14533a 0 22px, #0f4530 22px 44px);
  box-shadow: inset 0 0 0 1.5px rgba(245,247,242,.55), 0 8px 22px rgba(0,0,0,.55);
}
#fl-loader .fl-strip::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1.5px; background: rgba(245,247,242,.5); }
#fl-loader .fl-strip::after { content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; border-radius: 50%; transform: translate(-50%,-50%); box-shadow: inset 0 0 0 1.5px rgba(245,247,242,.5); }
#fl-loader .fl-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--p) * 100%); overflow: hidden;
  background: linear-gradient(90deg, rgba(242,169,59,.05), rgba(242,169,59,.55) 85%, rgba(255,224,138,.95));
  box-shadow: 0 0 14px rgba(242,169,59,.6);
}
#fl-loader .fl-fill::after { content: ""; position: absolute; inset: 0; width: 40%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent); animation: fl-sheen 1.4s linear infinite; }
@keyframes fl-sheen { from { transform: translateX(-120%); } to { transform: translateX(320%); } }
#fl-loader .fl-goal {
  position: absolute; top: 20px; width: 18px; height: 34px; border: 2px solid rgba(245,247,242,.9);
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.28) 0 1px, transparent 1px 5px), repeating-linear-gradient(90deg, rgba(255,255,255,.28) 0 1px, transparent 1px 5px);
}
#fl-loader .fl-goal.l { left: 4px; border-right: none; border-radius: 3px 0 0 3px; }
#fl-loader .fl-goal.r { right: 4px; border-left: none; border-radius: 0 3px 3px 0; transform-origin: left center; }
#fl-loader .fl-goal.r.ripple { animation: fl-net .6s ease-out; }
@keyframes fl-net { 0% { transform: scaleX(1); } 30% { transform: scaleX(1.7); } 60% { transform: scaleX(.85); } 100% { transform: scaleX(1); } }
#fl-loader .fl-track { position: absolute; left: 22px; right: 22px; top: 0; height: 100%; pointer-events: none; }
#fl-loader .fl-ball { position: absolute; top: 15px; left: calc(var(--p) * 100%); width: 44px; height: 44px; margin-left: -22px; }
#fl-loader .fl-ball svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 6px 6px rgba(0,0,0,.55)); }
#fl-loader .fl-ball-shadow { position: absolute; left: 50%; bottom: -6px; width: 34px; height: 7px; margin-left: -17px; border-radius: 50%; background: rgba(0,0,0,.5); filter: blur(2px); }
#fl-loader .fl-ball.kick { animation: fl-kick .55s cubic-bezier(.3,.6,.4,1) forwards; }
@keyframes fl-kick { 0% { transform: translate(0,0); } 45% { transform: translate(14px,-16px) scale(.9); } 100% { transform: translate(26px,-2px) scale(.7); opacity: 0; } }
#fl-loader .fl-scoreline { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; margin-top: 1.2vh; padding: 0 6px; animation: fl-fade-up .6s ease 2.1s both; }
#fl-loader .fl-status { font-size: clamp(13px, 2vmin, 15px); letter-spacing: .04em; color: rgba(245,247,242,.85); min-height: 1.4em; transition: opacity .2s ease, transform .2s ease; }
#fl-loader .fl-status.swap { opacity: 0; transform: translateY(4px); }
#fl-loader .fl-clock {
  flex: none; display: flex; align-items: center; gap: 8px; padding: 4px 10px 2px; border-radius: 6px;
  font-family: 'Bebas Neue', sans-serif; font-size: 26px; letter-spacing: .06em; line-height: 1; font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #151c26, #0b1018); color: var(--amber);
  box-shadow: inset 0 0 0 1px rgba(242,169,59,.35), 0 4px 14px rgba(0,0,0,.5);
}
#fl-loader .fl-live { width: 7px; height: 7px; border-radius: 50%; background: #e04b3c; box-shadow: 0 0 8px #e04b3c; margin-bottom: 2px; animation: fl-blink 1s steps(2) infinite; }
#fl-loader .fl-clock small { font-size: 13px; color: var(--mist); letter-spacing: .12em; }
@keyframes fl-blink { 50% { opacity: .15; } }
#fl-loader .fl-tip {
  margin-top: 3.2vh; width: 100%; display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 10px;
  background: linear-gradient(90deg, rgba(242,169,59,.12), rgba(11,20,32,.55)); border-left: 3px solid var(--amber);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  animation: fl-fade-up .6s ease 2.4s both;
}
#fl-loader .fl-tip .tag { flex: none; font-family: 'Bebas Neue', sans-serif; font-size: 15px; letter-spacing: .12em; color: var(--ink); background: var(--amber); padding: 3px 7px 1px; border-radius: 4px; margin-top: 1px; }
#fl-loader .fl-tip p { font-size: 13.5px; line-height: 1.45; color: rgba(245,247,242,.82); transition: opacity .35s ease; }

/* GOL! finale */
#fl-loader .fl-burst { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; pointer-events: none; }
#fl-loader .fl-burst i { position: absolute; inset: 0; opacity: 0; background: radial-gradient(circle at 50% 50%, rgba(255,236,170,.7), rgba(242,169,59,.25) 40%, transparent 70%); }
#fl-loader .fl-burst b {
  font-family: 'Bebas Neue', sans-serif; font-weight: 400; font-size: clamp(90px, 22vmin, 200px); letter-spacing: .04em; line-height: 1;
  background: linear-gradient(180deg, #fff 0%, var(--gold-hi) 40%, var(--amber-deep) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 6px 0 rgba(90,50,5,.9)) drop-shadow(0 0 40px rgba(242,169,59,.7));
  opacity: 0; transform: scale(.3) rotate(-8deg);
}
#fl-loader.is-goal .fl-burst i { animation: fl-burst .9s ease-out forwards; }
#fl-loader.is-goal .fl-burst b { animation: fl-gol 1.1s cubic-bezier(.34,1.56,.64,1) forwards; }
#fl-loader.is-goal .fl-stage { animation: fl-stage-out .5s ease .15s forwards; }
@keyframes fl-burst { 0% { opacity: 0; } 15% { opacity: 1; } 100% { opacity: 0; } }
@keyframes fl-gol { 0% { opacity: 0; transform: scale(.3) rotate(-8deg); } 55% { opacity: 1; transform: scale(1.08) rotate(2deg); } 100% { opacity: 1; transform: scale(1) rotate(-3deg); } }
@keyframes fl-stage-out { to { opacity: 0; transform: scale(.96); filter: blur(3px); } }

@media (max-width: 480px) {
  #fl-loader .fl-pitchbar { height: 64px; }
  #fl-loader .fl-clock { font-size: 22px; }
  #fl-loader .fl-tip p { font-size: 12.5px; }
}
@media (prefers-reduced-motion: reduce) {
  #fl-loader *, #fl-loader *::before, #fl-loader *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
