/* A compact site map and visible routes back to Explore. */
[hidden]{display:none!important}
body.source-loading #explore-league-dialog,body.source-loading #explore-league-dialog *{visibility:visible!important}
body.source-loading #main>:is(#welcome,#explore){opacity:1;pointer-events:auto}
.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
html[data-current-page=welcome] .page-navigation,html[data-current-page=welcome] #menu-swipe-tip{display:none!important}
html[data-current-page=welcome] #welcome{margin-top:0}
html[data-current-page=explore] .page-navigation{display:none!important}
.explore-heading{padding:8px 0 24px}
.explore-heading h1{font-family:var(--font-ui,Inter,sans-serif);font-size:clamp(27px,3vw,38px);line-height:1.18;margin:8px 0 10px;letter-spacing:-.035em;color:var(--ink)}
.explore-heading>p:last-child{max-width:66ch;font-size:15px;line-height:1.55;color:var(--muted);margin:0}
.explore-map{--explore-connector:var(--line);--explore-connector:color-mix(in srgb,var(--green) 25%,var(--line));--explore-gap:16px;display:block!important;position:relative;margin:0 0 24px;padding:0;gap:0;background:none;border:0}
.explore-branches{position:relative;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--explore-gap);padding-top:25px}
.explore-branches::before{content:"";position:absolute;top:0;left:calc((100% - 2 * var(--explore-gap))/6);right:calc((100% - 2 * var(--explore-gap))/6);border-top:1px solid var(--explore-connector)}
.explore-branch{position:relative;min-width:0;padding:18px 16px 16px;border:1px solid var(--line);border-radius:13px;background:var(--panel)}
.explore-branch::before{content:"";position:absolute;left:50%;bottom:100%;height:26px;border-left:1px solid var(--explore-connector)}
body[data-palette] .explore-branch h2{margin:0 0 7px;color:var(--ink);font-family:var(--font-ui,Inter,sans-serif);font-size:19px;line-height:1.25;letter-spacing:-.02em;font-weight:750}
.explore-branch .branch-description{min-height:3em;margin:0 0 16px;font-size:13px;line-height:1.5;color:var(--muted)}
.explore-actions{display:grid;gap:8px}
body[data-palette] .explore-action{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;min-width:0;min-height:72px;margin:0;padding:12px;border:1px solid var(--line);border-radius:9px;background:var(--bg);color:var(--ink);text-align:left;text-decoration:none;font-family:var(--font-ui,Inter,sans-serif);transition:background .15s,border-color .15s}
.explore-action>span:first-child{display:block;min-width:0}
.explore-map .explore-action,.explore-map .explore-action span{white-space:normal}
body[data-palette] .explore-action strong{display:block;font-size:14px;line-height:1.35;font-weight:700;color:var(--ink);overflow-wrap:break-word}
.explore-action small{display:block;margin-top:4px;font-size:12px;line-height:1.45;font-weight:400;color:var(--muted)}
.explore-action>span[aria-hidden]{flex:0 0 auto;font-size:20px;line-height:1;color:var(--green)}
body[data-palette] .explore-action:hover,body[data-palette] .explore-action:focus-visible{border-color:var(--green);background:var(--soft)}
.explore-action:active{background:var(--selected,var(--soft))}
.explore-help{margin:22px 0;font-size:13px;line-height:1.6;color:var(--muted)}
.explore-help a{color:var(--green);text-decoration:underline;text-underline-offset:3px}
/* This link sits immediately below the logo, outside the drawer navigation. */
body[data-palette] #site-navigation>.explore-nav-link{display:flex;flex:0 0 auto;align-items:center;justify-content:flex-start;gap:8px;min-height:44px;margin:14px 10px 2px;padding:10px 12px;border:1px solid #94c3ff55;border-radius:8px;background:#94c3ff12;color:#edf4ff;font:650 13px/1.3 var(--font-ui,Inter,sans-serif);text-decoration:none;white-space:nowrap}
#site-navigation>.explore-nav-link .icon,#site-navigation>.explore-nav-link>svg{flex:0 0 17px;width:17px;height:17px;color:#94c3ff}
body[data-palette] #site-navigation>.explore-nav-link:hover,body[data-palette] #site-navigation>.explore-nav-link[aria-current=page]{border-color:#94c3ff;background:#244873;color:#fff}
#site-navigation>.explore-nav-link~#primary-nav{margin-top:14px}
/* Native dialog: the heading stays visible while long league lists scroll. */
body[data-palette] #explore-league-dialog.explore-picker{width:min(820px,calc(100vw - 32px));max-width:none;max-height:88vh;max-height:88dvh;margin:auto;padding:0;overflow:hidden;border:1px solid var(--control-edge,var(--line));border-radius:16px;background:var(--panel);color:var(--ink);box-shadow:0 20px 70px #0b162633}
#explore-league-dialog[open]{display:flex;flex-direction:column}
#explore-league-dialog .explore-picker-heading{display:flex;flex:0 0 auto;align-items:flex-start;justify-content:space-between;gap:18px;height:auto;min-height:0;margin:0;padding:20px 22px 17px;border-bottom:1px solid var(--line);background:var(--panel);color:var(--ink);letter-spacing:normal}
.explore-picker-heading>div{min-width:0}
#explore-league-dialog .explore-picker-heading .eyebrow{margin:0 0 6px}
body[data-palette] #explore-picker-title{margin:0;color:var(--ink);font:750 23px/1.25 var(--font-ui,Inter,sans-serif);letter-spacing:-.025em}
#explore-picker-description{margin:7px 0 0;font-size:13px;line-height:1.5;color:var(--muted)}
#explore-league-dialog .explore-picker-close{display:flex;flex:0 0 auto;align-items:center;justify-content:center;gap:8px;height:44px;min-width:44px;min-height:44px;margin:-4px -5px 0 0;padding:8px 12px;border:1px solid var(--line);border-radius:9px;background:var(--bg);color:var(--ink);font-size:13px;line-height:1}
.explore-picker-close>span{font-size:24px}
#explore-league-dialog::backdrop{background:#0b162677;backdrop-filter:blur(2px)}
.explore-picker-close>svg{width:20px;height:20px}
#explore-league-dialog .explore-picker-close:hover{border-color:var(--green);background:var(--soft)}
.explore-picker-body{min-height:0;padding:19px 22px 22px;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
.explore-league-group+.explore-league-group{margin-top:24px}
body[data-palette] .explore-league-group h3{margin:0 0 10px;font:700 14px/1.4 var(--font-ui,Inter,sans-serif);color:var(--ink)}
.explore-league-options{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,210px),1fr));gap:9px}
body[data-palette] a.explore-league{display:flex;flex-direction:column;justify-content:center;gap:4px;min-width:0;min-height:64px;padding:11px 13px;border:1px solid var(--line);border-radius:9px;background:var(--bg);color:var(--ink);text-decoration:none;transition:background .15s,border-color .15s}
.explore-league>span{font-size:13px;line-height:1.35;font-weight:650;overflow-wrap:break-word}
.explore-league>small{font-size:12px;line-height:1.35;color:var(--muted)}
body[data-palette] a.explore-league:hover,body[data-palette] a.explore-league:focus-visible{border-color:var(--green);background:var(--soft)}
#entry-pending{padding:25vh 20px;text-align:center}
.entry-progress{display:block;visibility:visible!important;width:160px;height:4px;margin:0 auto;border-radius:4px;background:linear-gradient(90deg,#94c3ff22,#94c3ff,#94c3ff22);background-size:200% 100%;animation:entry-pulse 1.4s ease-in-out infinite}
@keyframes entry-pulse{to{background-position:200% 0}}
@media(max-width:1000px){
 .explore-branches{grid-template-columns:1fr;gap:14px;margin-left:19px;padding:0 0 0 18px}
 .explore-branches::before{top:0;bottom:0;left:0;right:auto;border-top:0;border-left:1px solid var(--explore-connector)}
 .explore-branch{padding:17px}
 .explore-branch::before{left:-19px;top:28px;bottom:auto;width:18px;height:0;border-left:0;border-top:1px solid var(--explore-connector)}
 .explore-branch:last-child::after{content:"";position:absolute;left:-20px;top:29px;bottom:-1px;width:2px;background:var(--bg)}
 .explore-branch .branch-description{min-height:0;margin-bottom:13px}
 .explore-actions{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:760px){
 .explore-heading{padding:5px 0 20px}
 .explore-heading>p:last-child{font-size:14px}
 .explore-branch{padding:15px 12px 12px}
 body[data-palette] .explore-branch h2{font-size:18px}
 .explore-actions{grid-template-columns:1fr}
 body[data-palette] .explore-action{min-height:68px;padding:11px}
 body[data-palette] #site-navigation{display:grid;grid-template-columns:minmax(92px,1fr) auto;grid-template-rows:24px 44px;gap:6px 10px;align-items:center;min-height:82px;padding:4px 12px}
 #site-navigation>a.brand{grid-column:1;grid-row:1;align-self:end;width:104px;max-width:104px;padding:0}
 #site-navigation>a.brand .brand-logo{width:102px;height:23px}
 body[data-palette] #site-navigation>.explore-nav-link{grid-column:1;grid-row:2;justify-self:start;align-self:center;min-width:94px;min-height:44px;margin:0;padding:8px 7px;border-color:transparent;background:transparent;font-size:12px;gap:7px}
 #site-navigation>.explore-nav-link .icon,#site-navigation>.explore-nav-link>svg{width:15px;height:15px;flex-basis:15px}
 #site-navigation>.mobile-actions{grid-column:2;grid-row:1/3;align-self:center;margin:0}
 #site-navigation>.explore-nav-link~#primary-nav{margin-top:0}
 #explore-league-dialog .explore-picker-heading{padding:16px 16px 14px;gap:12px}
 body[data-palette] #explore-picker-title{font-size:21px}
 .explore-picker-body{padding:15px 16px calc(18px + env(safe-area-inset-bottom))}
 .explore-league-options{grid-template-columns:repeat(auto-fit,minmax(min(100%,140px),1fr));gap:8px}
 body[data-palette] a.explore-league{padding:11px;min-height:66px}
 aside#site-navigation #primary-nav{width:min(360px,92vw)}
 #menu-swipe-tip{display:none!important}
 html[data-current-page=explore] .page-navigation{margin-bottom:8px}
}
@media(max-width:360px){
 #site-navigation>a.brand{width:90px;max-width:90px}
 #site-navigation>a.brand .brand-logo{width:88px;height:20px}
 #site-navigation>.mobile-actions{gap:5px}
 #site-navigation>.mobile-actions #page-back{font-size:0;padding:8px;min-width:36px}
 #site-navigation>.mobile-actions #page-back span{font-size:16px}
}
@media(prefers-reduced-motion:reduce){.entry-progress{animation:none}.explore-action,.explore-league{transition:none!important}}

/* The document owns page scrolling; the drawer and modal own theirs only
   while open. Do not inherit the old generic nav overflow on the site map. */
.explore-map,.explore-branches,.explore-branch,.competition-grid{overflow:visible;max-height:none}
:is(#explore,#competitions){height:auto;max-height:none;overflow:visible}
:is(#ratings,#global) .table-scroll{height:auto;max-height:none}
#welcome .welcome-backdrop{pointer-events:none}
#welcome .welcome-stage{z-index:1}
#welcome-enter{position:relative;z-index:2;touch-action:manipulation}
body[data-palette] .explore-heading h1,
body[data-palette] .explore-branch h2,
body[data-palette] #explore-picker-title,
body[data-palette] .competition-card h3{font-family:var(--font-heading,Inter,sans-serif);font-weight:600;letter-spacing:-.025em}
.explore-heading{border-bottom:1px solid var(--line);margin-bottom:22px}
.explore-heading .eyebrow{color:var(--green);font-weight:600;letter-spacing:.12em}
.explore-map{--explore-connector:#94c3ff}
.explore-branch{border-radius:10px}
body[data-palette] .explore-action{background:transparent;border-radius:7px}
html[data-theme=dark] .explore-branch{background:#2e3e4d;border-color:#596b7c}
html[data-theme=dark] body[data-palette] .explore-action{border-color:#607487}
html[data-theme=dark] body[data-palette] .explore-action:hover{background:#3a5066;border-color:#94c3ff}
.competition-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.competition-card{min-width:0;padding:20px 16px;border:1px solid var(--line);border-radius:10px;background:var(--panel)}
body[data-palette] .competition-card h3{display:flex;align-items:center;gap:12px;margin:0 0 18px;font-size:19px;line-height:1.35;color:var(--ink)}
.competition-card h3 .league-badge{flex:0 0 44px;width:44px;height:44px}
.competition-views{display:grid;gap:8px}
body[data-palette] .competition-grid .competition-views a{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:44px;margin:0;padding:11px;border:1px solid var(--line);border-radius:7px;background:var(--bg);font:600 14px/1.4 var(--font-ui);color:var(--ink);text-decoration:none}
body[data-palette] .competition-grid .competition-views a:hover{border-color:var(--green);background:var(--soft)}
.competition-views a>span{color:var(--green)}
@media(min-width:761px){
 body{display:flow-root}
 body[data-palette] aside#site-navigation{position:sticky;float:left;inset:auto;top:min(0px,calc(100dvh - var(--desktop-nav-height,800px)));height:auto;min-height:100dvh;overflow:visible;padding-block:22px}
}
@media(max-width:1000px){.competition-grid{grid-template-columns:1fr}.competition-views{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:760px){
 .competition-views{grid-template-columns:1fr}
 #ratings .tabs .mobile-view-picker{align-self:end}
 #ratings .tabs .view-back{display:none}
 #ratings .tabs.app-view-pinned .mobile-view-picker{grid-template-columns:64px minmax(0,1fr)}
 body[data-palette] #ratings .tabs.app-view-pinned .view-back{display:flex;align-items:center;justify-content:center;gap:5px;min-height:44px;margin:0;padding:8px 6px;border:1px solid var(--line);border-radius:7px;background:var(--panel);color:var(--ink);font:600 13px/1.3 var(--font-ui)}
 #ratings .tabs.app-view-pinned .view-back:hover{border-color:var(--green)}
}

#primary-nav>.nav-divider{display:none!important}

/* Keep each menu's view shortcuts, with direct destinations. */
#primary-nav .nav-subpages{display:grid;gap:0;padding:0 0 0 10px;margin:0 0 12px 22px;border-left:1px solid #a6c3e344}
body[data-palette] #primary-nav .nav-subpages a{display:flex;align-items:center;min-height:36px;padding:7px 10px;border-radius:5px;color:#c5d6ec;font:500 13px/1.4 var(--font-ui,Inter,sans-serif);text-decoration:none}
body[data-palette] #primary-nav .nav-subpages a:hover,body[data-palette] #primary-nav .nav-subpages a[aria-current=page]{color:#fff;background:#94c3ff20;box-shadow:inset 2px 0 #94c3ff}
@media(max-width:760px){body[data-palette] #primary-nav .nav-subpages a{min-height:44px}}
