/* FF L themed loading animations. Every "please wait" spot in the app uses the same little block, made by
   window.fflLoading() in index.html:
     <div class="ldr-box"><div class="ldr"><i class="ldr-ball"></i><i class="ldr-fx"></i><svg class="ldr-chalk">…</svg></div><div class="ldr-t">Loading…</div></div>
   What it does depends on <html data-theme / data-season>. CSS and tiny SVG only (the footballs are the same files the
   header already loads), so nothing here slows the page. Quick loads never see it: it fades in after 0.15 s.
   People who ask their phone for less motion get a gentle fade instead of movement. */
.ldr-box { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 30px 12px; color: var(--muted);
  text-align: center; animation: ldr-in .3s .15s both; }
.ldr-box.boot { min-height: 55vh; }
.ldr-box.sm { flex-direction: row; gap: 8px; padding: 8px 10px; }
.ldr-box.sm .ldr { width: 34px; height: 34px; }
.ldr-box.sm .ldr > * { scale: .48; }
.ldr { position: relative; width: 76px; height: 76px; flex: none; }
.ldr > * { position: absolute; inset: 0; margin: auto; }
.ldr-ball { width: 42px; height: 42px; z-index: 2; background: var(--ball, url('/balls/classic.svg')) center / contain no-repeat; }
.ldr-fx { z-index: 1; pointer-events: none; }
.ldr-chalk { display: none; width: 76px; height: 52px; }
.ldr-t { font: 600 13px/1.3 var(--font-display, Inter), Inter, system-ui, sans-serif; letter-spacing: .03em; }
@keyframes ldr-in { from { opacity: 0; } }

/* Football field (default; also Dark/Light unless overridden): kicked end over end through the uprights. */
.ldr-fx { width: 46px; height: 58px; top: 0; bottom: auto; }
.ldr-fx::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 26px; border: 3px solid var(--gold); border-top: 0; border-radius: 0 0 2px 2px; }
.ldr-fx::after { content: ''; position: absolute; left: 50%; top: 26px; width: 3px; margin-left: -1.5px; bottom: 0; background: var(--gold); }
.ldr-ball { animation: ldr-kick 1.3s cubic-bezier(.2,.7,.4,1) infinite; }
@keyframes ldr-kick { 0% { transform: translateY(30px) scale(1) rotate(0); opacity: 0; } 12% { opacity: 1; }
  80% { opacity: 1; } 100% { transform: translateY(-14px) scale(.42) rotate(-720deg); opacity: 0; } }

/* Dark and Light: a tight spiral, bobbing over its shadow. */
:is([data-theme="dark"], [data-theme="light"]) .ldr-ball { animation: ldr-spiral 1.1s ease-in-out infinite; }
:is([data-theme="dark"], [data-theme="light"]) .ldr-fx { width: 34px; height: 8px; top: auto; bottom: 8px; border-radius: 50%; background: rgba(0,0,0,.35); animation: ldr-shadow 1.1s ease-in-out infinite; }
:is([data-theme="dark"], [data-theme="light"]) .ldr-fx::before, :is([data-theme="dark"], [data-theme="light"]) .ldr-fx::after { content: none; }
[data-theme="light"] .ldr-fx { background: rgba(20,40,30,.18); }
@keyframes ldr-spiral { 0%, 100% { transform: translateY(4px) rotate(0) scaleX(1); } 25% { transform: translateY(-6px) rotate(0) scaleX(.82); }
  50% { transform: translateY(-12px) rotate(0) scaleX(1); } 75% { transform: translateY(-6px) rotate(0) scaleX(.82); } }
@keyframes ldr-shadow { 50% { transform: scaleX(.6); opacity: .5; } }

/* 80s Neon: the neon ball inside a spinning pink-and-cyan tube ring that buzzes. */
[data-theme="neon"] .ldr-ball { animation: ldr-glow 1.6s ease-in-out infinite; }
[data-theme="neon"] .ldr-fx { width: 70px; height: 70px; top: 0; bottom: 0; border-radius: 50%; border: 3px solid transparent; border-top-color: #ff2bd6; border-right-color: #22e4ff;
  filter: drop-shadow(0 0 5px #ff2bd6) drop-shadow(0 0 8px #22e4ff); animation: ldr-spin .9s linear infinite, neon-buzz 4s infinite; }
[data-theme="neon"] .ldr-fx::before, [data-theme="neon"] .ldr-fx::after { content: none; }
[data-theme="neon"] .ldr-t { color: #ff2bd6; text-shadow: 0 0 8px #ff2bd6; animation: neon-buzz 5s infinite; }
@keyframes ldr-glow { 50% { filter: drop-shadow(0 0 10px #ff2bd6) drop-shadow(0 0 4px #22e4ff); transform: rotate(-12deg) scale(1.06); } }
@keyframes ldr-spin { to { transform: rotate(360deg); } }

/* Team colors: a football in your team's two colors flipping like a coin toss, inside a two-color ring. */
[data-theme="team"] .ldr-ball { background: url('/balls/team-laces.svg') center / contain no-repeat, linear-gradient(125deg, var(--c1, #E31837) 50%, var(--c2, #FFB81C) 50%);
  -webkit-mask: url('/balls/mask.svg') center / contain no-repeat; mask: url('/balls/mask.svg') center / contain no-repeat; animation: ldr-toss 1.4s ease-in-out infinite; }
[data-theme="team"] .ldr-fx { width: 72px; height: 72px; top: 0; bottom: 0; border-radius: 50%; animation: ldr-spin 1.4s linear infinite;
  background: conic-gradient(var(--c1, #E31837) 0 25%, transparent 0 50%, var(--c2, #FFB81C) 0 75%, transparent 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px)); mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px)); }
[data-theme="team"] .ldr-fx::before, [data-theme="team"] .ldr-fx::after { content: none; }
@keyframes ldr-toss { 0% { transform: translateY(0) rotateX(0); } 50% { transform: translateY(-10px) rotateX(360deg); } 100% { transform: translateY(0) rotateX(720deg); } }

/* Chalkboard: a play drawn in chalk, X, O, then the route arrow, wiped and drawn again. */
[data-theme="chalk"] .ldr-ball, [data-theme="chalk"] .ldr-fx { display: none; }
[data-theme="chalk"] .ldr-chalk { display: block; }
.ldr-chalk path, .ldr-chalk circle { fill: none; stroke: #f4f1e6; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60;
  filter: drop-shadow(0 0 1px rgba(255,255,255,.6)); animation: ldr-draw 2.6s ease-in-out infinite; }
.ldr-chalk .c2 { animation-name: ldr-draw2; } .ldr-chalk .c3 { animation-name: ldr-draw3; stroke: #ffe28a; }
[data-theme="chalk"][data-variant="black"] .ldr-chalk .c3 { stroke: #9fe0ff; }
@keyframes ldr-draw { 0% { stroke-dashoffset: 60; opacity: 1; } 22%, 85% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes ldr-draw2 { 0%, 22% { stroke-dashoffset: 60; opacity: 1; } 44%, 85% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes ldr-draw3 { 0%, 44% { stroke-dashoffset: 60; opacity: 1; } 70%, 85% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
[data-theme="chalk"] .ldr-t { color: #f4f1e6; }

/* Stadium night: two floodlight beams sweep over a slowly turning ball. */
[data-theme="stadium"] .ldr-ball { animation: ldr-turn 2.4s ease-in-out infinite; }
[data-theme="stadium"] .ldr-fx { width: 110px; height: 76px; top: 0; bottom: 0; left: -17px; right: auto; }
[data-theme="stadium"] .ldr-fx::before, [data-theme="stadium"] .ldr-fx::after { content: ''; inset: auto; top: -10px; left: 50%; width: 46px; height: 100px; border: 0; margin-left: -23px;
  background: linear-gradient(180deg, rgba(255,248,215,.75), rgba(255,248,215,0) 85%); clip-path: polygon(44% 0, 56% 0, 100% 100%, 0 100%);
  transform-origin: 50% 0; animation: ldr-beam 2.4s ease-in-out infinite alternate; }
[data-theme="stadium"] .ldr-fx::after { animation-delay: -1.2s; animation-direction: alternate-reverse; opacity: .7; }
[data-theme="stadium"] .ldr-ball { z-index: 0; }
@keyframes ldr-beam { from { transform: rotate(-38deg); } to { transform: rotate(38deg); } }
@keyframes ldr-turn { 50% { transform: rotate(-20deg) scale(1.05); } }

/* Seasonal: the ball bounces with a seasonal friend. */
[data-theme="season"] .ldr-ball { animation: ldr-bounce .9s cubic-bezier(.3,0,.7,1) infinite alternate; }
[data-theme="season"] .ldr-fx { width: 76px; height: 76px; top: 0; bottom: 0; font-size: 18px; line-height: 1; }
[data-theme="season"] .ldr-fx::before { border: 0; height: auto; inset: auto; }
[data-theme="season"] .ldr-fx::after { content: none; }
[data-season="halloween"] .ldr-fx::before { content: '🦇'; left: 0; top: 4px; animation: ldr-bat 2.2s ease-in-out infinite; }
[data-season="halloween"] .ldr-ball { filter: drop-shadow(0 0 8px rgba(255,122,26,.7)); }
[data-season="turkey"] .ldr-fx::before { content: '🦃'; right: -6px; bottom: 0; animation: ldr-strut 1.8s ease-in-out infinite; }
[data-season="holiday"] .ldr-fx::before { content: '❄ ❄'; left: 0; right: 0; top: 0; color: #fff; font-size: 14px; letter-spacing: 26px; text-align: center; animation: ldr-snow 2s linear infinite; }
[data-season="playoffs"] .ldr-fx::before { content: '🏆'; right: -8px; top: -2px; animation: ldr-shine 1.8s ease-in-out infinite; }
[data-season="playoffs"] .ldr-ball { filter: sepia(1) saturate(3) hue-rotate(5deg) brightness(1.15) drop-shadow(0 0 6px rgba(242,193,78,.7)); }
@keyframes ldr-bounce { from { transform: translateY(14px) scaleY(.9); } to { transform: translateY(-14px) rotate(-25deg); } }
@keyframes ldr-bat { 0%, 100% { transform: translate(0, 0) scaleX(1); } 25% { transform: translate(28px, -6px) scaleX(.7); } 50% { transform: translate(56px, 2px) scaleX(1); } 75% { transform: translate(28px, 8px) scaleX(.7); } }
@keyframes ldr-strut { 50% { transform: translateX(-6px) rotate(-8deg); } }
@keyframes ldr-snow { from { transform: translateY(-6px); opacity: 0; } 20% { opacity: 1; } to { transform: translateY(70px); opacity: 0; } }
@keyframes ldr-shine { 50% { transform: scale(1.15) rotate(8deg); filter: drop-shadow(0 0 6px #ffe08a); } }

/* White and Black Marble & Gold: the gold-trimmed ball turns slowly inside a polished gold ring with a running glint. */
:is([data-theme="marble"], [data-theme="onyx"]) .ldr-ball { animation: ldr-turn 2.6s ease-in-out infinite; }
:is([data-theme="marble"], [data-theme="onyx"]) .ldr-fx { width: 72px; height: 72px; top: 0; bottom: 0; border-radius: 50%; animation: ldr-spin 2.2s linear infinite;
  background: conic-gradient(from 0deg, #8a6a1c, #f7e3a1 12%, #c9a046 25%, #8a6a1c 50%, #f7e3a1 62%, #c9a046 75%, #8a6a1c);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px)); mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px)); }
:is([data-theme="marble"], [data-theme="onyx"]) .ldr-fx::before, :is([data-theme="marble"], [data-theme="onyx"]) .ldr-fx::after { content: none; }
:is([data-theme="marble"], [data-theme="onyx"]) .ldr-t { color: #b8902e; letter-spacing: .12em; text-transform: uppercase; font-size: 11px; }

/* Retrowave: the ball floats over a sunset with the neon grid running toward you. */
[data-theme="retrowave"] .ldr-ball { width: 34px; height: 34px; top: -14px; animation: ldr-float 1.8s ease-in-out infinite; }
[data-theme="retrowave"] .ldr-fx { width: 96px; height: 76px; left: -10px; right: auto; top: 0; bottom: 0; overflow: hidden; border-radius: 6px; perspective: 60px; }
[data-theme="retrowave"] .ldr-fx::before { content: ''; inset: auto; left: 26px; top: 8px; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: linear-gradient(180deg, #ffe46b, #ff7a3d 45%, #ff2bd6); -webkit-mask: linear-gradient(#000 0 24px, transparent 0), repeating-linear-gradient(180deg, #000 0 4px, transparent 4px 6px);
  mask: linear-gradient(#000 0 24px, transparent 0), repeating-linear-gradient(180deg, #000 0 4px, transparent 4px 6px); }
[data-theme="retrowave"] .ldr-fx::after { content: ''; inset: auto; left: -30px; right: -30px; bottom: -8px; top: 42px; width: auto; margin: 0; transform: rotateX(55deg); transform-origin: 50% 0;
  background: repeating-linear-gradient(90deg, transparent 0 10px, #ff2bd6 10px 11px), repeating-linear-gradient(180deg, transparent 0 7px, #22e4ff 7px 8px);
  animation: ldr-grid .6s linear infinite; }
[data-theme="retrowave"] .ldr-t { color: #ff6bd8; text-shadow: 0 0 8px rgba(255,43,214,.8); }
@keyframes ldr-float { 50% { transform: translateY(-5px) rotate(-10deg); } }
@keyframes ldr-grid { to { background-position: 0 0, 0 8px; } }

/* Zombie Locker: the ball claws its way up out of the ground, twitching, while slime drips. */
[data-theme="zombie"] .ldr-ball { animation: ldr-rise 2.2s ease-out infinite; }
[data-theme="zombie"] .ldr-fx { width: 76px; height: 76px; top: 0; bottom: 0; overflow: hidden; }
[data-theme="zombie"] .ldr-fx::before { inset: auto; left: 0; right: 0; bottom: 0; height: 12px; border: 0; border-radius: 50% 50% 0 0; background: #2b2216; box-shadow: inset 0 3px 0 #3d3020; z-index: 3; }
[data-theme="zombie"] .ldr-fx::after { content: ''; inset: auto; left: 54px; top: -10px; width: 7px; height: 12px; margin: 0; border-radius: 50% 50% 50% 50% / 30% 30% 70% 70%; background: #8bd43a;
  box-shadow: 0 0 6px #8bd43a; animation: ldr-drip 1.6s ease-in infinite; }
[data-theme="zombie"] .ldr-fx { overflow: visible; }
[data-theme="zombie"] .ldr-t { color: #a6e05a; }
@keyframes ldr-rise { 0% { transform: translateY(36px) rotate(10deg); } 45% { transform: translateY(2px) rotate(-6deg); } 52% { transform: translateY(2px) rotate(9deg); }
  58% { transform: translateY(2px) rotate(-12deg); } 64%, 82% { transform: translateY(0) rotate(0); } 100% { transform: translateY(36px) rotate(-6deg); } }
@keyframes ldr-drip { 0% { transform: translateY(0) scaleY(.6); opacity: 0; } 15% { opacity: 1; } 70% { transform: translateY(78px) scaleY(1.2); opacity: 1; } 100% { transform: translateY(84px) scaleY(.3); opacity: 0; } }

/* Dive Bar (18+): a buzzing neon-sign ball with beer bubbles drifting up behind it. */
[data-theme="divebar"] .ldr-ball { filter: drop-shadow(0 0 6px #ffb347); animation: neon-buzz 3s infinite; }
[data-theme="divebar"] .ldr-fx { width: 46px; height: 76px; top: 0; bottom: 0; -webkit-mask: radial-gradient(closest-side, #000 40%, transparent); mask: radial-gradient(closest-side, #000 40%, transparent); }
[data-theme="divebar"] .ldr-fx::before, [data-theme="divebar"] .ldr-fx::after { content: ''; inset: 0; border: 0; width: auto; height: auto; margin: 0;
  background: radial-gradient(circle, rgba(255,214,120,.9) 0 2px, transparent 2.5px) 8px 0 / 18px 22px, radial-gradient(circle, rgba(255,240,200,.7) 0 1.5px, transparent 2px) 0 10px / 14px 26px;
  animation: ldr-bubbles 1.8s linear infinite; }
[data-theme="divebar"] .ldr-fx::after { animation-duration: 2.6s; opacity: .6; }
[data-theme="divebar"] .ldr-t { font-family: Yellowtail, cursive; font-size: 18px; color: #ffb347; text-shadow: 0 0 8px rgba(255,140,40,.8); animation: neon-buzz 6s infinite; }
@keyframes ldr-bubbles { from { background-position: 8px 22px, 0 36px; } to { background-position: 8px 0, 0 10px; } }

/* Founders Club: the leather ball drops into place like a stamp on a crest while a brass stitched ring sews itself around it. */
[data-theme="founders"] .ldr-ball { background-image: url('/balls/founders.svg'); animation: ldr-stamp 2.4s cubic-bezier(.3,.7,.3,1) infinite; }
[data-theme="founders"] .ldr-fx { width: 72px; height: 72px; top: 0; bottom: 0; border-radius: 50%; border: 2px dashed #d8b26a;
  -webkit-mask: conic-gradient(#000 var(--sew, 0deg), transparent 0); mask: conic-gradient(#000 var(--sew, 0deg), transparent 0); animation: ldr-sew 2.4s linear infinite; }
[data-theme="founders"] .ldr-fx::before { content: ''; inset: -6px; height: auto; border: 1px solid rgba(216,178,106,.35); border-radius: 50%; }
[data-theme="founders"] .ldr-fx::after { content: none; }
[data-theme="founders"] .ldr-t { font-family: Graduate, Georgia, serif; color: #d8b26a; letter-spacing: .1em; text-transform: uppercase; font-size: 11px; }
@property --sew { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes ldr-sew { 0% { --sew: 0deg; } 70%, 100% { --sew: 360deg; } }
@keyframes ldr-stamp { 0% { transform: scale(1.5) rotate(-20deg); opacity: 0; } 18% { transform: scale(.92) rotate(0); opacity: 1; } 26% { transform: scale(1.04); }
  32%, 85% { transform: scale(1); opacity: 1; } 100% { transform: scale(1); opacity: 0; } }

/* "Still loading" pill: shows under the header when a page takes more than a moment to open. */
.ldr-busy { position: fixed; left: 50%; top: 74px; transform: translateX(-50%); z-index: 40; border-radius: 99px; background: var(--panel); border: 1px solid var(--line);
  box-shadow: var(--card-shadow, 0 6px 18px rgba(0,0,0,.3)); padding: 2px 14px 2px 6px; pointer-events: none; }
.ldr-busy .ldr-box { padding: 4px 0; animation: none; }

/* Less motion: no movement at all, just a slow fade of the ball (or a fully drawn chalk play). */
@media (prefers-reduced-motion: reduce) {
  .ldr *, .ldr *::before, .ldr *::after, .ldr-t { animation: none !important; }
  .ldr-ball, .ldr-chalk { animation: ldr-breathe 2s ease-in-out infinite !important; }
  .ldr-chalk path, .ldr-chalk circle { stroke-dashoffset: 0; }
  .ldr-fx::before, .ldr-fx::after { opacity: .6; }
}
@keyframes ldr-breathe { 50% { opacity: .45; } }
