/* Ten competitive leagues, using the app's night palette. */
#screenLeague .league-neon-page { --current-league-color:#dc9658; width:100%; max-width:940px; box-sizing:border-box; padding:22px; border:0!important; background:radial-gradient(ellipse at 85% 3%,#17336888,transparent 28%),linear-gradient(160deg,#030d28,#010b20)!important; color:#eef3ff!important; box-shadow:none; border-radius:18px; }
#screenLeague .league-heading { display:flex; align-items:center; justify-content:space-between; gap:10px; }
#screenLeague .league-heading h1 { margin:0; font-size:31px; font-weight:850; color:#fff; }
#screenLeague .league-heading button { padding:8px 10px; border:1px solid #1368ba; border-radius:11px; background:#08255280; color:#c7d6f8; font:inherit; font-size:12px; cursor:pointer; }
#screenLeague .league-hero { position:relative; display:grid; grid-template-columns:155px minmax(0,1fr) 195px; align-items:center; gap:22px; min-height:245px; overflow:hidden; margin-top:6px; }
#screenLeague .league-emblem { position:relative; display:block; width:90px; aspect-ratio:1; flex:none; background-image:url('../assets/league-badges-atlas-v1.webp'); background-size:500% 200%; background-position:calc(var(--league-col,0) * 25%) calc(var(--league-row,0) * 100%); background-repeat:no-repeat; filter:drop-shadow(0 0 8px #0b7aff55); }
#screenLeague .league-emblem > span { position:absolute; left:50%; bottom:18%; transform:translateX(-50%); color:#fff; font-size:11px; font-weight:900; padding:1px 6px; line-height:1.2; border:1px solid #9bbee477; background:#081a39da; border-radius:5px; }
#screenLeague .league-emblem-hero { width:165px; filter:drop-shadow(0 0 17px var(--current-league-color)); }
#screenLeague .league-emblem-hero > span { font-size:20px; bottom:18%; }
#screenLeague .league-hero-copy { position:relative; z-index:2; }
#screenLeague .league-hero h2 { font-size:30px; line-height:1.15; margin:0 0 10px; color:#e4f1ff; }
#screenLeague .league-hero p { font-size:14px; line-height:1.5; color:#c2d7fc; margin:0 0 15px; }
#screenLeague .league-aimi { width:240px; max-width:none; height:240px; object-fit:contain; position:relative; align-self:end; margin-left:-22px;  pointer-events:none; }
#screenLeague .league-countdown { display:flex; align-items:center; gap:12px; width:max-content; padding:10px 17px; border:1px solid #1a6dbe; background:#021128b8; border-radius:11px; }
#screenLeague .league-countdown > span { font-size:30px; color:#bacbff; }.league-countdown small { display:block; color:#b9c9ea; font-size:11px; }.league-countdown strong { font-size:19px; color:#fff; }
#screenLeague .league-tier-track { display:flex; align-items:stretch; gap:12px; width:100%; box-sizing:border-box; overflow-x:auto; padding:13px 12px; border:1px solid #236dcc; border-radius:17px; background:linear-gradient(130deg,#0b163ab3,#020f2a); scrollbar-width:thin; scrollbar-color:#2872b9 #030f28; }
#screenLeague .league-tier { position:relative; border:0; padding:0; background:none; color:#9ca9d2; width:105px; flex:0 0 105px; font:inherit; cursor:pointer; text-align:center; }
#screenLeague .league-tier:not(:last-child)::after { content:'»'; position:absolute; right:-15px; top:30px; font-size:28px; color:#3268aa; }
#screenLeague .league-tier .league-emblem { margin:auto; }.league-tier b { display:block; font-size:12px; line-height:1.2; font-weight:500; }.league-tier b small { display:block; font-size:inherit; }
#screenLeague .league-tier.current { color:#28eff2; }.league-tier.current b { font-weight:850; }.league-tier.current .league-emblem { filter:drop-shadow(0 0 10px var(--current-league-color)); }
#screenLeague .league-tier.locked .league-emblem { filter:brightness(.42) saturate(.45); }.league-tier .league-emblem i { position:absolute; font-size:18px; inset:0; display:grid; place-items:center; font-style:normal; }
#screenLeague .league-stats { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin:16px 0 13px; }
#screenLeague .league-stats > div { position:relative; padding:17px 12px 17px 54px; border:1px solid #266cbb; border-radius:13px; background:linear-gradient(135deg,#091b40,#020e28); min-width:0; }
#screenLeague .league-stat-icon { position:absolute; top:24px; left:12px; font-size:29px; color:#21efd1; filter:drop-shadow(0 0 8px #12cfc0); }.league-stats > div:nth-child(2) .league-stat-icon { color:#ffd054; filter:drop-shadow(0 0 8px #dc8b37); }
#screenLeague .league-kicker { display:block; font-size:11px; line-height:1.4; color:#aebee7; }.league-stats strong { display:block; font-size:24px; line-height:1.5; color:#fff; font-weight:850; white-space:nowrap; }.league-stats > div:first-child strong,.league-stats > div:last-child strong { color:#29f1da; }
#screenLeague .league-group-heading { display:flex; justify-content:space-between; gap:8px; font-size:10px; color:#9eafd2; padding:3px 2px 11px; }
#screenLeague .league-standings { padding:8px; border:1px solid #266ac9; border-radius:17px; background:linear-gradient(150deg,#061632,#020d25); }
#screenLeague .league-table-head,#screenLeague .league-player-row { display:grid; grid-template-columns:50px minmax(0,1fr) 105px 166px; gap:8px; align-items:center; padding:10px 13px; }
#screenLeague .league-table-head { color:#bbcff3; font-size:12px; padding-bottom:15px; }
#screenLeague .league-player-row { border:1px solid #103567; border-radius:13px; min-height:49px; box-sizing:border-box; color:#e6eeff; font-size:15px; margin-bottom:3px; background:linear-gradient(90deg,#051931cc,#021028); }
#screenLeague .league-place { text-align:center; font-size:18px; }.league-player-row.podium .league-place { font-size:28px; }
#screenLeague .league-player-name { min-width:0; display:flex; align-items:center; gap:13px; }.league-player-name > span:last-child { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#screenLeague .league-avatar { width:34px; height:34px; border-radius:50%; border:1px solid #7edfff; object-fit:cover; background:radial-gradient(circle,#136699,#051632); display:grid; place-items:center; font-size:22px; flex:none; }
#screenLeague .league-player-xp { white-space:nowrap; font-size:14px; font-weight:600; }.league-player-xp small { font:inherit; }
#screenLeague .league-player-status { display:flex; align-items:center; gap:9px; color:#a9bae5; }.league-player-status b { font-size:25px; }.league-player-status small { font-size:11px; }
#screenLeague .up { color:#27f5d1; }#screenLeague .down { color:#ff527e; }
#screenLeague .league-player-row.podium-1 { border-color:#bb9841; background:linear-gradient(90deg,#68512033,#10323977,#041328); }.league-player-row.podium-2 { border-color:#7186b1; background:linear-gradient(90deg,#37456044,#041328); }.league-player-row.podium-3 { border-color:#aa7852; background:linear-gradient(90deg,#62402544,#041328); }
#screenLeague .league-player-row.me { border:2px solid #0bf2e3; box-shadow:inset 0 0 16px #15eddf24,0 0 8px #0fbeb033; font-weight:850; background:linear-gradient(120deg,#063740,#04203a); }
#screenLeague .league-zone { border-radius:13px; margin-bottom:7px; }.league-zone summary { cursor:pointer; list-style:none; display:flex; justify-content:space-between; align-items:center; padding:10px 13px; border-radius:12px; font-size:14px; font-weight:850; }.league-zone summary::-webkit-details-marker { display:none; }.league-zone[open] summary b { transform:rotate(180deg); }
#screenLeague .league-zone-up > summary { color:#22f5d2; border:1px solid #09cfa7; background:linear-gradient(90deg,#074a3d,#05364188); }.league-zone-down > summary { color:#ff597f; border:1px solid #fa315f; background:linear-gradient(90deg,#481b35,#280e26); }.league-zone-down { margin-top:12px; }
#screenLeague .league-week-result { padding:10px; font-size:12px; border:1px solid #3bc6a0; border-radius:10px; background:#05333b; color:#befdf2; }
#screenLeague .league-info-dialog { color:#dce9ff; background:linear-gradient(140deg,#10204a,#020f26); border:1px solid #4696ef; border-radius:18px; width:min(460px,calc(100vw - 40px)); max-height:80dvh; box-sizing:border-box; padding:20px; box-shadow:0 0 32px #0768aa55; }
#screenLeague .league-info-dialog::backdrop { background:#000b; backdrop-filter:blur(4px); }.league-dialog-head { display:flex; align-items:center; gap:12px; justify-content:space-between; }.league-dialog-head h2 { font-size:20px; margin:0; }.league-dialog-head button { border:0; background:none; color:#bce0ff; font-size:28px; cursor:pointer; }
#screenLeague .league-info-dialog p { font-size:13px; line-height:1.55; }#screenLeague .league-dialog-close { width:100%; padding:10px; border:1px solid #5e99ed; border-radius:11px; background:linear-gradient(110deg,#2349bd,#237db4); color:#fff; cursor:pointer; }
#screenLeague .league-dialog-emblem .league-emblem { width:155px; margin:10px auto; }
@media(max-width:600px) {
 #screenLeague .league-neon-page { padding:12px!important; border-radius:0; }
 #screenLeague .league-heading h1 { font-size:26px; }#screenLeague .league-heading button { font-size:10px; padding:7px 9px; }
 #screenLeague .league-hero { grid-template-columns:85px minmax(0,1fr) 95px; gap:8px; min-height:180px; margin-top:7px; }
 #screenLeague .league-emblem-hero { width:97px; }.league-emblem-hero > span { font-size:14px!important; }
 #screenLeague .league-hero h2 { font-size:21px; margin-bottom:8px; }#screenLeague .league-hero p { font-size:10px; line-height:1.45; margin-bottom:9px; }
 #screenLeague .league-aimi { width:115px; height:185px; margin-left:-15px; object-position:center bottom; }
 #screenLeague .league-countdown { padding:6px 8px; gap:7px; }#screenLeague .league-countdown > span { font-size:23px; }.league-countdown small { font-size:9px; }.league-countdown strong { font-size:14px; }
 #screenLeague .league-tier-track { padding:9px 5px; gap:9px; border-radius:13px; }#screenLeague .league-tier { width:81px; flex-basis:81px; }#screenLeague .league-tier .league-emblem { width:73px; }.league-tier b { font-size:10px; }.league-tier:not(:last-child)::after { right:-12px!important; top:23px!important; font-size:22px!important; }
 #screenLeague .league-stats { gap:7px; margin:12px 0; }#screenLeague .league-stats > div { padding:8px 5px; text-align:center; border-radius:10px; }#screenLeague .league-stat-icon { position:static; display:block; font-size:22px; height:25px; }#screenLeague .league-kicker { font-size:9px; min-height:24px; }#screenLeague .league-stats strong { font-size:18px; }#screenLeague .league-stats > div:last-child strong { font-size:15px; line-height:27px; }
 #screenLeague .league-table-head,#screenLeague .league-player-row { grid-template-columns:24px minmax(0,1fr) 63px 34px; gap:5px; padding:7px 5px; }.league-player-row { font-size:12px!important; }.league-player-name { gap:6px!important; }.league-avatar { width:27px!important; height:27px!important; font-size:18px!important; }.league-player-xp { font-size:11px!important; }.league-player-xp small { font-size:9px; }.league-player-status { justify-content:center; }.league-player-status small { display:none; }.league-player-status b { font-size:23px!important; }.league-place { font-size:14px!important; }.podium .league-place { font-size:23px!important; }
 #screenLeague .league-standings { padding:5px; border-radius:13px; }.league-zone summary { font-size:11px!important; padding:9px 7px!important; }.league-table-head { font-size:10px!important; }
 #screenLeague .league-table-head > :last-child { font-size:0; }#screenLeague .league-table-head > :last-child::after { content:'↕'; font-size:13px; }
}
html[data-mobile] .m-host-wrap[data-host="league"] #screenLeague .league-neon-page { padding-top:7px!important; margin:0; background:radial-gradient(ellipse at 85% 3%,#17336888,transparent 28%),linear-gradient(160deg,#030d28,#010b20)!important; }

/* Larger companion in both themes; existing league order and controls stay intact. */
#screenLeague .league-hero{grid-template-columns:155px minmax(0,1fr) 235px;min-height:300px}
#screenLeague .league-aimi{width:295px;height:295px;margin-left:-25px}
@media(max-width:600px){#screenLeague .league-hero{grid-template-columns:85px minmax(0,1fr) 115px;gap:8px;min-height:225px}#screenLeague .league-aimi{width:150px;height:225px;margin-left:-18px}}
html[data-mobile][data-mtheme="light"] #mRoot[data-mpage="league"]{background:linear-gradient(145deg,#eefff5,#cff5dd)!important;color:#174d37}
html[data-mobile][data-mtheme="light"] #mRoot[data-mpage="league"] #mBody{background:transparent!important;scrollbar-color:#8cd2aa #e7fff0}
html[data-mobile][data-mtheme="light"] #mRoot[data-mpage="league"] :is(.m-header,.m-tabbar){background:#e8fff0f2!important;border-color:#9ddcba!important;box-shadow:0 3px 12px #35a76c18!important}
html[data-mobile][data-mtheme="light"] #mRoot[data-mpage="league"] :is(.m-title,.m-tab){color:#245e40!important;text-shadow:none!important}
html[data-mobile][data-mtheme="light"] #mRoot[data-mpage="league"] .m-tab.active{background:#c7f1d9!important;border-color:#6fc699!important;color:#0f7046!important;box-shadow:none!important}
html[data-mobile][data-mtheme="light"] #mRoot[data-mpage="league"] :is(#mBack,#mThemeQuick,#mLivesChip,#mLivesPlus){background:linear-gradient(135deg,#f5fff8,#cbf1da)!important;border-color:#91d5ac!important;color:#176443!important;box-shadow:none!important}
html:is([data-theme="light"],[data-mtheme="light"]) #screenLeague .league-neon-page{background:radial-gradient(ellipse at 85% 0%,#c7f5dc,transparent 45%),linear-gradient(145deg,#effff6,#d7f8e4)!important;color:#194c36!important}
html:is([data-theme="light"],[data-mtheme="light"]) #screenLeague :is(.league-heading h1,.league-hero h2,.league-stats strong,.league-countdown strong){color:#174b35!important;text-shadow:none}
html:is([data-theme="light"],[data-mtheme="light"]) #screenLeague :is(.league-hero p,.league-kicker,.league-countdown small,.league-group-heading,.league-table-head,.league-player-status){color:#4c785e!important}
html:is([data-theme="light"],[data-mtheme="light"]) #screenLeague .league-heading button{background:#ecfff3;color:#176d47;border-color:#8bd3aa}
html:is([data-theme="light"],[data-mtheme="light"]) #screenLeague .league-aimi{content:url('../assets/mobile/aimi-peace-mint-v2.webp');object-fit:cover;object-position:center 35%;border-radius:28px;mask-image:radial-gradient(ellipse at 50% 45%,#000 43%,transparent 73%)}
html:is([data-theme="light"],[data-mtheme="light"]) #screenLeague .league-countdown{background:#e9fff2;border-color:#8cd7ac}
html:is([data-theme="light"],[data-mtheme="light"]) #screenLeague .league-countdown>span{color:#17976a}
html:is([data-theme="light"],[data-mtheme="light"]) #screenLeague .league-tier-track{background:linear-gradient(130deg,#f6fff9,#d6f5e2);border-color:#8ed4ac;scrollbar-color:#63bf91 #dcf7e7}
html:is([data-theme="light"],[data-mtheme="light"]) #screenLeague .league-tier{color:#577762}
html:is([data-theme="light"],[data-mtheme="light"]) #screenLeague .league-tier.current{color:#078d55}
html:is([data-theme="light"],[data-mtheme="light"]) #screenLeague .league-tier:not(:last-child)::after{color:#60b98b}
html:is([data-theme="light"],[data-mtheme="light"]) #screenLeague .league-tier.locked .league-emblem{filter:brightness(.7) saturate(.6)}
html:is([data-theme="light"],[data-mtheme="light"]) #screenLeague .league-emblem{filter:drop-shadow(0 2px 6px #59a98133)}
html:is([data-theme="light"],[data-mtheme="light"]) #screenLeague .league-stats>div{background:linear-gradient(145deg,#f6fff9,#d6f5e1);border-color:#99d7b2;box-shadow:0 2px 8px #3da86d15}
html:is([data-theme="light"],[data-mtheme="light"]) #screenLeague .league-stat-icon{color:#11a568!important;filter:none!important}
html:is([data-theme="light"],[data-mtheme="light"]) #screenLeague .league-stats>div:is(:first-child,:last-child) strong{color:#078c58!important}
html:is([data-theme="light"],[data-mtheme="light"]) #screenLeague .league-standings{background:#effff6;border-color:#94d7b0}
html:is([data-theme="light"],[data-mtheme="light"]) #screenLeague .league-player-row{background:linear-gradient(90deg,#f8fffa,#e4f9ec);border-color:#b2e3c6;color:#24553a}
html:is([data-theme="light"],[data-mtheme="light"]) #screenLeague .league-player-row.podium-1{background:linear-gradient(90deg,#fff4d4,#edfae6);border-color:#dec27e}
html:is([data-theme="light"],[data-mtheme="light"]) #screenLeague .league-player-row.podium-2{background:linear-gradient(90deg,#eef4f1,#e4f8ec);border-color:#b7cfc1}
html:is([data-theme="light"],[data-mtheme="light"]) #screenLeague .league-player-row.podium-3{background:linear-gradient(90deg,#fff0e1,#e7f9ec);border-color:#d7b499}
html:is([data-theme="light"],[data-mtheme="light"]) #screenLeague .league-player-row.me{background:linear-gradient(90deg,#c5f3d6,#eafff1);border-color:#32b979;box-shadow:0 2px 8px #46ac7522}
html:is([data-theme="light"],[data-mtheme="light"]) #screenLeague .league-avatar{background:#c4edda;border-color:#83cca5}
html:is([data-theme="light"],[data-mtheme="light"]) #screenLeague .up{color:#079c5e}html:is([data-theme="light"],[data-mtheme="light"]) #screenLeague .down{color:#d84c70}
html:is([data-theme="light"],[data-mtheme="light"]) #screenLeague .league-zone-up>summary{color:#087b4c;background:linear-gradient(90deg,#d4f8e1,#e9fff2);border-color:#75cda0}
html:is([data-theme="light"],[data-mtheme="light"]) #screenLeague .league-zone-down>summary{color:#b74964;background:linear-gradient(90deg,#fff0f3,#ffe7ec);border-color:#e5a4b4}
html:is([data-theme="light"],[data-mtheme="light"]) #screenLeague .league-week-result{color:#236745;background:#d7f6e2;border-color:#93d5ad}
html:is([data-theme="light"],[data-mtheme="light"]) #screenLeague .league-info-dialog{color:#225a3b;background:linear-gradient(140deg,#f3fff7,#d5f4e1);border-color:#7ccb9b;box-shadow:0 10px 35px #26784d33}
html:is([data-theme="light"],[data-mtheme="light"]) #screenLeague .league-dialog-head button{color:#1d7950}
html:is([data-theme="light"],[data-mtheme="light"]) #screenLeague .league-dialog-close{background:linear-gradient(110deg,#36c487,#15a869);border-color:#72c99e;color:white}

/* Override the embedded host's explicit night background in light mode. */
html[data-mobile][data-mtheme="light"] #mRoot[data-mpage="league"] .m-host-wrap[data-host="league"],html[data-mobile][data-mtheme="light"] #mRoot[data-mpage="league"] #screenLeague{background:#e4f9ec!important;color:#194c36!important}
html[data-mobile][data-mtheme="light"] #mRoot[data-mpage="league"] .m-host-wrap[data-host="league"] #screenLeague .league-neon-page{background:radial-gradient(ellipse at 85% 0%,#c7f5dc,transparent 45%),linear-gradient(145deg,#effff6,#d7f8e4)!important;color:#194c36!important}
@media(max-width:380px){#screenLeague .league-hero{grid-template-columns:70px minmax(0,1fr) 100px;gap:6px}#screenLeague .league-emblem-hero{width:84px}#screenLeague .league-hero h2{font-size:18px}#screenLeague .league-aimi{width:140px;height:215px;margin-left:-15px}#screenLeague .league-countdown{width:auto;padding:6px;gap:4px}#screenLeague .league-countdown strong{font-size:13px}}

/* Clearly green surfaces throughout the light league. */
html[data-mobile][data-mtheme="light"] #mRoot[data-mpage="league"]{background:linear-gradient(145deg,#cbf3da,#b9e9ca)!important}
html[data-mobile][data-mtheme="light"] #mRoot[data-mpage="league"] :is(.m-header,.m-tabbar){background:#c9f0d8f5!important;border-color:#85cfa2!important}
html[data-mobile][data-mtheme="light"] #mRoot[data-mpage="league"] .m-host-wrap[data-host="league"],html[data-mobile][data-mtheme="light"] #mRoot[data-mpage="league"] #screenLeague{background:#c4efd5!important}
html[data-mobile][data-mtheme="light"] #mRoot[data-mpage="league"] .m-host-wrap[data-host="league"] #screenLeague .league-neon-page{background:radial-gradient(ellipse at 85% 0%,#a8e7c3,transparent 55%),linear-gradient(145deg,#cef3dc,#bde9ce)!important}
html:is([data-theme="light"],[data-mtheme="light"]) #screenLeague :is(.league-countdown,.league-tier-track,.league-stats>div,.league-standings,.league-heading button){background:linear-gradient(130deg,#d8f6e2,#c4ecd3)!important;border-color:#83cfa0!important}
html:is([data-theme="light"],[data-mtheme="light"]) #screenLeague .league-player-row{background:linear-gradient(90deg,#dcf7e5,#ccefda)!important;border-color:#a0d9b6!important}
html:is([data-theme="light"],[data-mtheme="light"]) #screenLeague .league-player-row.me{background:linear-gradient(90deg,#a9e6c2,#c1f0d2)!important;border-color:#2bad6e!important}
html:is([data-theme="light"],[data-mtheme="light"]) #screenLeague .league-info-dialog{background:linear-gradient(140deg,#d3f4df,#b9e8ca)!important}
