/* League up (rpg/ui-league.js leagueUpWindow; owner, 2026-10-15: "when people go up league, have nice congrats and
   animation, and explain what they qualify fo rnow"). Level 20 or 40: your old league's medal on a lit stage spins up
   (.spinning, the turn itself is JS: scaleX), glows white-hot (.charged), then flashes and lands as the new league's
   medal (.landed): the window jolts (.modal.lgu-boom), rays turn in the league's metal, its name drops in on a ribbon;
   the particles are on .lgu-fx over the whole window. Then what you race for now pops in ([data-pop].on). Each league
   has its metal (--m, --m-hi, --m-glow; the League window's .lg-head has the same three). */
.lgu-book { --m: #a0643a; --m-hi: #f4b276; --m-glow: #e08a4a; position: relative; text-align: center; }
.lgu-book.lgu-silver { --m: #6c788c; --m-hi: #e2e9f4; --m-glow: #a9c4ff; }
.lgu-book.lgu-gold { --m: #b57a00; --m-hi: #ffe27a; --m-glow: #ffd23f; }
.lgu-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }
.lgu-kick { margin: 0 0 2px; font-size: 13px; font-weight: 700; line-height: 1.3; letter-spacing: 0.14em; text-transform: uppercase; color: var(--m-glow); }
.modal .lgu-h { margin: 0 0 8px; font-size: 26px; line-height: 1.15; color: #fff; text-shadow: 0 2px 0 #000; }
.lgu-h span { color: var(--m-hi); }
.lgu-book.landed .lgu-h { animation: lgu-title 0.55s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes lgu-title { from { scale: 0.7; } }

/* The stage: the medal on its lit spot, rays and a glow behind it, the flash over it, a caption under it. */
.lgu-stage { position: relative; height: 236px; margin: 0 0 14px; border-radius: 14px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--m-glow) 55%, #2e3d74); background: radial-gradient(circle at 50% 46%, color-mix(in srgb, var(--m-glow) 34%, #1d2a6c) 0, #131c4e 46%, #070c2a 100%); box-shadow: inset 0 3px 12px rgba(0, 0, 0, 0.6); }
.lgu-rays { position: absolute; left: 50%; top: 44%; width: 560px; height: 560px; margin: -280px 0 0 -280px; border-radius: 50%; background: repeating-conic-gradient(color-mix(in srgb, var(--m-hi) 48%, transparent) 0 9deg, transparent 9deg 22.5deg); -webkit-mask: radial-gradient(circle, #000 14%, transparent 60%); mask: radial-gradient(circle, #000 14%, transparent 60%); opacity: 0; scale: 0.4; transition: opacity 0.5s, scale 0.8s cubic-bezier(0.2, 1.4, 0.4, 1); animation: lgu-spin 16s linear infinite; }
.lgu-book.charged .lgu-rays { opacity: 0.35; scale: 0.7; }
.lgu-book.landed .lgu-rays { opacity: 1; scale: 1; }
@keyframes lgu-spin { to { rotate: 360deg; } }
.lgu-glow { position: absolute; left: 50%; top: 44%; width: 220px; height: 220px; margin: -110px 0 0 -110px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, 0.85), color-mix(in srgb, var(--m-glow) 40%, transparent) 42%, transparent 70%); opacity: 0.15; transition: opacity 0.4s, scale 0.4s; }
.lgu-book.spinning .lgu-glow { opacity: 0.45; }
.lgu-book.charged .lgu-glow { opacity: 1; scale: 1.35; animation: lgu-throb 0.16s ease-in-out infinite alternate; }
.lgu-book.landed .lgu-glow { opacity: 0.6; scale: 1.2; animation: none; }
@keyframes lgu-throb { to { scale: 1.5; } }
.lgu-tap { position: absolute; left: 50%; top: 44%; translate: -50% -50%; z-index: 1; padding: 0; border: 0; background: none; cursor: pointer; }
.lgu-medal { display: block; width: 120px; height: 156px; image-rendering: pixelated; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.35)); animation: lgu-idle 1.6s ease-in-out infinite; }
.lgu-book.spinning .lgu-medal { animation: none; }
.lgu-book.charged .lgu-medal { filter: brightness(1.35) drop-shadow(0 0 16px #fff); }
.lgu-book.landed .lgu-tap { animation: lgu-land 0.7s cubic-bezier(0.2, 1.5, 0.4, 1); }
.lgu-book.landed .lgu-medal { filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.35)) drop-shadow(0 0 14px color-mix(in srgb, var(--m-glow) 80%, transparent)); animation: lgu-bob 1.8s ease-in-out 0.8s infinite; }
@keyframes lgu-idle { 0%, 100% { rotate: 0deg; } 25% { rotate: -3deg; } 75% { rotate: 3deg; } }
@keyframes lgu-land { 0% { scale: 0.55; } 100% { scale: 1; } }
@keyframes lgu-bob { 50% { translate: 0 -5px; } }
.lgu-flash { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; background: radial-gradient(circle at 50% 44%, #fff, rgba(255, 255, 255, 0.85) 35%, color-mix(in srgb, var(--m-hi) 40%, transparent) 75%); }
.lgu-book.landed .lgu-flash { animation: lgu-flash 0.6s ease-out; }
@keyframes lgu-flash { 0% { opacity: 0; } 12% { opacity: 1; } 100% { opacity: 0; } }
/* The caption: your old league while it spins, the new one's name on a ribbon once it lands. */
.lgu-was, .lgu-name { position: absolute; left: 50%; bottom: 12px; translate: -50% 0; z-index: 2; white-space: nowrap; font-family: var(--display); line-height: 1.2; }
.lgu-was { font-size: 16px; color: #fff; text-shadow: 0 2px 0 #000; transition: opacity 0.2s; }
.lgu-book.landed .lgu-was { opacity: 0; }
.lgu-name { padding: 4px 22px; border-radius: 6px; border: 2px solid rgba(20, 12, 2, 0.7); background: linear-gradient(180deg, var(--m-hi), var(--m)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 3px 0 rgba(0, 0, 0, 0.45); color: #1e1406; font-size: 20px; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0; scale: 0.4; }
.lgu-book.landed .lgu-name { animation: lgu-name 0.55s cubic-bezier(0.2, 1.6, 0.4, 1) 0.25s forwards; }
@keyframes lgu-name { to { opacity: 1; scale: 1; } }
.modal.lgu-boom { animation: lgu-boom 0.45s ease-out; }
@keyframes lgu-boom { 0%, 100% { translate: 0 0; } 15% { translate: -7px 3px; } 30% { translate: 6px -4px; } 45% { translate: -4px 2px; } 60% { translate: 3px -1px; } 80% { translate: -1px 0; } }

/* What you race for now: three website tiles, then when it starts. */
.modal .lgu-q { margin: 0 0 8px; font-family: var(--display); font-weight: 400; font-size: 17px; letter-spacing: 0.02em; color: var(--m-hi); }
.lgu-tiles { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; text-align: left; }
.lgu-tile { display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; border: 1px solid #34468a; background: linear-gradient(180deg, #1a2663, #141e52); box-shadow: 0 3px 0 #000a2e; }
.lgu-tile:first-child { border-color: color-mix(in srgb, var(--m-glow) 70%, #34468a); box-shadow: 0 3px 0 #000a2e, 0 0 12px color-mix(in srgb, var(--m-glow) 30%, transparent); }
.lgu-art { display: grid; place-items: center; width: 44px; height: 44px; font-size: 28px; line-height: 1; }
.lgu-key { color: var(--m-glow); }
.lgu-key .lg-keyart { width: 22px; height: 44px; filter: drop-shadow(1.5px 0 0 #120c2e) drop-shadow(-1.5px 0 0 #120c2e) drop-shadow(0 1.5px 0 #120c2e) drop-shadow(0 -1.5px 0 #120c2e) drop-shadow(0 0 7px color-mix(in srgb, var(--m-glow) 60%, transparent)); }
.lgu-tile b { display: block; font-family: var(--display); font-weight: 400; font-size: 18px; line-height: 1.2; color: #fff; }
.lgu-tile small { display: block; margin-top: 2px; font-size: 14px; line-height: 1.35; color: #bcc5ea; }
.lgu-tile small b { display: inline; font-family: inherit; font-weight: 700; font-size: inherit; color: #fff; }
.modal .lgu-when { margin: 0; padding: 8px 12px; border-radius: 10px; border: 1px dashed color-mix(in srgb, var(--m-glow) 55%, transparent); background: rgba(255, 255, 255, 0.04); font-size: 15px; line-height: 1.4; color: #dfe5fa; text-align: left; }
.lgu-when b { color: #fff; }
.lgu-book .actions { justify-content: center; }
.lgu-book [data-pop] { opacity: 0; visibility: hidden; }
.lgu-book [data-pop].on { visibility: visible; animation: lgu-pop 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) forwards; }
@keyframes lgu-pop { 0% { opacity: 0; scale: 0.7; translate: 0 10px; } 100% { opacity: 1; scale: 1; translate: 0 0; } }
@media (max-width: 420px) {
  .modal .lgu-h { font-size: 22px; }
  .lgu-stage { height: 212px; }
  .lgu-medal { width: 100px; height: 130px; }
  .lgu-name { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .lgu-rays, .lgu-medal, .lgu-book.landed .lgu-medal, .lgu-book.landed .lgu-tap, .lgu-book.landed .lgu-h, .modal.lgu-boom { animation: none !important; }
  .lgu-book.landed .lgu-flash { animation: none; }
  .lgu-book.landed .lgu-name { animation: none; opacity: 1; scale: 1; }
  .lgu-book [data-pop].on { animation: none; opacity: 1; }
}

/* The League window's four tabs (rpg/ui-league.js TABS: Standings, Last week, Prize, How it works): four across, and up to
   a wide phone each icon sits over its word (a long word may take two lines). */
.rk-tabs.lgw-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 640px) {
  .lgw-tabs button { flex-direction: column; gap: 3px; min-height: 52px; padding-top: 5px; padding-bottom: 5px; font-size: 15px; }
  .lgw-tabs button span { white-space: normal; text-align: center; line-height: 1.05; }
}
/* Last week (pastTab; owner, 2026-10-16: "allow to see previous week key winners and the totals of everyone"): its dates,
   who got the keys (a numbered key in the league's metal, their place and points), then the board. */
.lg-dates { margin: -4px 0 10px; text-align: center; font-size: 14.5px; color: var(--ink-2); }
.lg-held-list { display: grid; gap: 4px; max-width: 420px; margin: 0 auto; padding: 0; list-style: none; }
.lg-held-list li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 3px 10px 3px 6px; border-radius: 7px; background: rgba(255, 252, 238, 0.6); border: 1px solid rgba(92, 62, 24, 0.25); font-size: 15.5px; text-align: left; }
.lg-held-key { position: relative; display: grid; place-items: center; height: 30px; color: var(--lg-glow); }
.lg-held-key .lg-keyart { width: 13px; height: 26px; filter: drop-shadow(1px 0 0 #2e1e08) drop-shadow(-1px 0 0 #2e1e08) drop-shadow(0 1px 0 #2e1e08) drop-shadow(0 -1px 0 #2e1e08); }
.lg-held-key b { position: absolute; right: -3px; bottom: -1px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 999px; background: #5a3d18; color: #f6e7bd; font-size: 10.5px; font-weight: 900; line-height: 15px; text-align: center; }
.lg-held-nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-held-list em { font-style: normal; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.lg-held .lg-pack { margin-top: 8px; }
/* A high rank with no key must explain the pass-down directly on the podium/table; otherwise an empty key spot looks like
   a reward bug. Kept compact enough for the three-column phone podium. */
.rk-step .lg-no-key, .rk-table .lg-no-key { display: block; max-width: 150px; margin: 2px auto 0; color: #8b3d2c; font-size: 11px; font-weight: 800; line-height: 1.12; text-align: center; text-wrap: balance; white-space: normal; }
.rk-table .lg-no-key { max-width: 190px; margin-left: 0; text-align: left; }
@media (max-width: 420px) { .rk-step .lg-no-key { max-width: 106px; font-size: 9.5px; } }
/* The Prize tab's last week: a way to all of it. */
.lg-go { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; }
.lg-go .ri { width: 20px; height: 20px; image-rendering: pixelated; }
@media (max-width: 480px) { .lg-held-list li { font-size: 14.5px; } }
