/* Liga dos Pets and the shared Meu Pet Social navigation. */
.league-page[hidden]{display:none!important}.league-page{position:fixed;inset:0;z-index:24000;display:grid;grid-template-rows:76px auto minmax(0,1fr) auto;background:var(--surface-page,#fff);color:var(--text-primary,#0f172a);font-family:Inter,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif}.league-page *{box-sizing:border-box}.league-icon-button{width:44px;height:44px;border:0;background:transparent;color:inherit;border-radius:50%;font-size:30px;cursor:pointer;display:grid;place-items:center}.league-icon-button svg{width:24px;height:24px}.league-content{overflow-y:auto;overscroll-behavior:contain;padding:32px 24px 40px;scrollbar-width:thin}.league-content>*{max-width:900px;margin-left:auto;margin-right:auto}.league-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.25rem;
    width: min(100%, 36rem);
    margin-inline: auto;
    padding: 0.45rem 0.6rem;
}
.league-nav button {
    min-width: 0;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.25rem;
    border: 0;
    border-radius: 0.55rem;
    background: transparent;
    color: var(--text-secondary, #475569);
    cursor: pointer;
}
.league-nav svg { width: 16px; height: 16px; flex: none; }
.league-nav span { font-size: 0.75rem; font-weight: 650; }
.league-nav button.active {
    background: var(--surface-secondary, #f1f5f9);
    color: var(--secondary, #3038ff);
}
.league-page .league-nav button:focus-visible { outline-offset: -2px; }
@media (max-width: 480px) {
    .league-nav button { flex-direction: column; gap: 0.18rem; }
    .league-nav span { font-size: 0.68rem; }
}
.league-button{display:inline-flex;align-items:center;justify-content:center;min-height:46px;padding:12px 20px;border:1px solid transparent;border-radius:999px;cursor:pointer;font:inherit;font-size:14px;font-weight:750;gap:8px;white-space:normal}.league-button.primary{background:var(--secondary,#3038ff);color:white}.league-button.secondary{background:var(--surface-secondary,#f8fafc);color:inherit;border-color:var(--border-default,#cbd5e1)}.league-button.text{background:transparent;color:var(--secondary,#3038ff);padding-left:0;padding-right:0}.league-button.light{background:white;color:#3038ff}.league-button:disabled{opacity:.55;cursor:wait}.league-page button:focus-visible,.league-page summary:focus-visible,.league-page input:focus-visible{outline:3px solid #7594ff;outline-offset:3px}.league-page h2{font-size:27px;line-height:1.2;margin:0 0 12px;letter-spacing:-.5px}.league-page h3{font-size:17px;margin:0 0 10px}.league-page p{font-size:14px;line-height:1.65;margin:10px 0;color:var(--text-secondary,#475569)}.league-page small{font-size:11px;line-height:1.45}.league-page-intro{padding:4px 0 24px}.league-page-intro>small{display:block;letter-spacing:1.1px;font-weight:700;margin-bottom:14px;color:var(--secondary,#3038ff)}.league-page-intro h2{font-size:34px}.league-pet-card{display:flex;align-items:center;gap:22px;padding:12px 0 28px}.league-pet-card small{letter-spacing:1.5px;color:var(--text-muted,#64748b)}.league-pet-card h2{font-size:40px;margin:6px 0}.league-pet-card p{font-size:17px;margin:0}.league-division-art{width:110px;height:110px;object-fit:contain;flex:none}.league-legend-art{width:110px;height:110px;border:2px solid #7851d1;border-radius:28px;color:#7851d1;display:grid;place-items:center;background:rgba(120,81,209,.1)}.league-legend-art svg{width:56px;height:56px}.league-competitive{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;padding:22px 0;border-top:1px solid var(--border-subtle,#e2e8f0);border-bottom:1px solid var(--border-subtle,#e2e8f0)}.league-competitive>div{display:flex;flex-direction:column;gap:7px}.league-competitive small{color:var(--text-muted,#64748b)}.league-competitive strong{font-size:28px;letter-spacing:-.5px}.league-competitive strong span{font-size:13px;font-weight:500;letter-spacing:0}.league-competitive>div>span{font-size:11px;color:var(--text-muted,#64748b)}.league-qualification{padding:6px 0 16px}.league-qualification strong{font-weight:600}.league-section{margin-top:28px;margin-bottom:26px}.league-section-head{display:flex;justify-content:space-between;gap:14px;align-items:center;margin-bottom:12px}.league-section-head h2{font-size:21px;margin:0}.league-section-head>span{font-size:12px;color:var(--text-muted,#64748b)}.league-rank-row{width:100%;display:flex;align-items:center;gap:14px;padding:14px 16px;margin:0;border:0;border-bottom:1px solid var(--border-subtle,#e2e8f0);background:transparent;color:inherit;text-align:left;cursor:pointer;font:inherit;border-radius:14px}.league-rank-row.own{background:rgba(48,56,255,.075);border-color:transparent;color:var(--secondary,#3038ff)}.league-rank-place{width:26px;font-size:13px;font-weight:700;flex:none}.league-avatar{width:40px;height:40px;border-radius:50%;object-fit:cover;background:var(--surface-secondary,#f8fafc);border:1px solid var(--border-subtle,#e2e8f0);display:grid;place-items:center;font-weight:800;flex:none}.league-rank-name{flex:1;min-width:0;overflow-wrap:anywhere;font-weight:700;font-size:14px}.league-rank-name small{display:block;font-weight:500;margin-top:3px}.league-rank-row>strong{font-size:16px;flex:none}.league-rank-row>strong small{font-weight:400}.league-own-rank{position:sticky;top:-16px;z-index:2;background:var(--surface-primary,#fff);padding:5px 0 10px}.league-rules{margin-top:24px;padding:20px;border:1px solid var(--border-subtle,#e2e8f0);border-radius:22px;background:var(--surface-primary,#fff)}.league-rules summary{display:flex;justify-content:space-between;align-items:center;font-size:14px;font-weight:750;cursor:pointer;list-style:none;gap:10px}.league-rules summary svg{width:20px;height:20px}.league-rules[open] summary{margin-bottom:18px}.league-division-list{display:grid;gap:8px}.league-division-list>div{display:flex;align-items:center;gap:12px;padding:10px;border:1px solid var(--border-subtle,#e2e8f0);border-radius:14px}.league-division-list .league-division-art,.league-division-list .league-legend-art{width:50px;height:50px;border-radius:16px}.league-division-list .league-legend-art svg{width:28px;height:28px}.league-division-list span{display:flex;flex-direction:column;gap:4px;font-size:14px;min-width:0}.league-division-list span:last-child{margin-left:auto;text-align:right;flex:none}.league-division-list small{font-size:10px}.league-empty{text-align:center;padding:40px 24px;background:var(--surface-secondary,#f8fafc);border-radius:24px;margin-top:12px;margin-bottom:24px}.league-empty>svg{width:48px;height:48px;margin-bottom:18px;color:var(--secondary,#3038ff)}.league-empty p{max-width:520px;margin:12px auto 20px}.league-empty .league-button{margin:5px}.league-fine{font-size:12px!important}.league-neutral,.league-sync{padding:16px 18px;border-radius:18px;background:var(--surface-secondary,#f8fafc);border:1px solid var(--border-subtle,#e2e8f0);margin-bottom:20px;font-size:13px;line-height:1.6}.league-sync span{display:block;font-size:12px;margin-top:5px}.league-error{color:#c03942!important}.league-promotion{text-align:center;color:white;background:#3038ff;border-radius:26px;padding:28px;margin-bottom:26px}.league-promotion>svg{width:34px;height:34px;display:block;margin:0 auto 14px}.league-promotion small{display:block;margin-bottom:12px}.league-promotion h2{font-size:26px}.league-promotion p{color:white;margin:10px 0 20px}.league-mission-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.league-mission{border:1px solid var(--border-subtle,#e2e8f0);border-radius:24px;padding:22px;background:var(--surface-primary,#fff)}.league-mission-head{display:flex;justify-content:space-between;gap:12px;color:var(--secondary,#3038ff);align-items:center;margin-bottom:22px}.league-mission-head svg{width:24px;height:24px}.league-mission-head span{font-size:12px;font-weight:700}.league-mission p{font-size:12px}.league-mission-progress{display:flex;justify-content:space-between;gap:12px;font-size:11px;margin:18px 0 8px}.league-mission progress{width:100%;height:5px;accent-color:var(--secondary,#3038ff)}.league-mission.done .league-mission-head{color:#158063}.league-inline-actions{display:flex;gap:12px;flex-wrap:wrap;margin-top:22px}.league-trophy-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.league-trophy{display:flex;flex-direction:column;align-items:center;gap:12px;padding:22px 12px;background:var(--surface-primary,#fff);border:1px solid var(--border-subtle,#e2e8f0);border-radius:22px;color:inherit;cursor:pointer;text-align:center}.league-trophy strong{font-size:13px;line-height:1.4}.league-trophy small{font-size:10px;color:var(--text-muted,#64748b)}.league-trophy-art{width:92px;height:92px;flex:none}.league-trophy.locked .league-trophy-art{filter:grayscale(1);opacity:.4}.league-trophy.locked strong{color:var(--text-muted,#64748b)}.league-trophy-detail{max-width:600px;text-align:center;padding:4px 16px 32px}.league-trophy-detail .league-button.text{display:block}.league-trophy-art.large{width:200px;height:200px;display:block;margin:36px auto 24px}.league-trophy-detail>small{display:block;margin-bottom:14px;font-weight:700;letter-spacing:1px}.league-career-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;padding:24px 0;border-block:1px solid var(--border-subtle,#e2e8f0)}.league-career-stats>div{display:flex;flex-direction:column;gap:9px}.league-career-stats strong{font-size:32px}.league-career-stats span{font-size:11px;color:var(--text-muted,#64748b)}.league-next-division{display:flex;align-items:center;gap:20px}.league-next-division p{font-size:12px}.league-history{padding:0;list-style:none}.league-history li{display:flex;align-items:flex-start;gap:24px;padding:20px 0;border-bottom:1px solid var(--border-subtle,#e2e8f0)}.league-history li>span{font-size:11px;color:var(--text-muted,#64748b);flex:none}.league-history strong{display:block;font-size:14px;margin-bottom:5px}.league-history small{color:var(--text-muted,#64748b)}.league-hall-hero{text-align:center;border-radius:26px;background:#191e3a;color:white;padding:32px 24px}.league-hall-hero .league-division-art{width:140px;height:140px}.league-hall-hero>small{display:block;color:#f3ca65;font-weight:700;letter-spacing:1.1px;margin:16px 0}.league-hall-hero h2{font-size:34px}.league-hall-hero p{color:#e1e6fb}.league-hall-seats{display:flex;justify-content:center;gap:28px;margin:26px 0}.league-hall-seats>div{display:flex;flex-direction:column;align-items:center;gap:8px}.league-hall-seats svg{width:44px;height:44px;padding:10px;border-radius:50%;background:#303a62}.league-hall-seats>div:first-child svg{background:#f3ca65;color:#584013}.league-legend-row{display:flex;align-items:center;gap:15px;padding:16px 0;border-bottom:1px solid var(--border-subtle,#e2e8f0);font-size:12px}.league-legend-row strong{flex:1;overflow-wrap:anywhere}.league-settings{max-width:640px;display:grid;gap:20px}.league-settings>label:not(.league-checkbox){display:grid;gap:8px;font-size:13px;font-weight:700}.league-settings input:not([type=checkbox]){min-height:46px;width:100%;padding:10px 14px;border:1px solid var(--border-default,#cbd5e1);border-radius:14px;background:var(--surface-primary,#fff);color:inherit;font:inherit;min-width:0}.league-checkbox{display:flex;align-items:flex-start;gap:10px;font-size:12px;line-height:1.6}.league-checkbox input,.league-meal-choice input[type=checkbox]{accent-color:var(--secondary,#3038ff);width:18px;height:18px;flex:none}.league-settings fieldset{padding:20px;border:1px solid var(--border-subtle,#e2e8f0);border-radius:22px;min-width:0}.league-settings legend{font-size:14px;font-weight:700;padding:0 5px}.league-settings fieldset p{font-size:12px;margin-bottom:18px}.league-meal-choice{display:grid;grid-template-columns:minmax(0,1fr) 100px;gap:12px;align-items:center;font-size:13px;margin:10px 0}.league-meal-choice>span{display:flex;align-items:center;gap:8px;overflow-wrap:anywhere}.league-settings input[type=time]{font-size:12px;padding:10px}.league-announcement{position:absolute;bottom:96px;left:50%;transform:translateX(-50%);max-width:calc(100% - 32px);pointer-events:none;font-size:12px;border-radius:20px;background:var(--surface-primary,#fff);box-shadow:0 6px 30px rgba(0,0,0,.13);padding:10px 16px;z-index:5}.league-announcement:empty{display:none}.league-page svg{flex:none}.league-page [aria-disabled=true]{cursor:default}.league-entry-icon{width:22px;height:22px}.league-page .league-button{box-shadow:none}
@media(max-width:640px){.league-page{grid-template-rows:64px auto minmax(0,1fr) auto}.league-content{padding:22px 18px 32px}.league-pet-card{gap:16px}.league-pet-card h2{font-size:32px}.league-division-art,.league-legend-art{width:90px;height:90px}.league-competitive{grid-template-columns:repeat(2,minmax(0,1fr));gap:22px}.league-competitive strong{font-size:27px}.league-mission-grid{grid-template-columns:1fr}.league-mission{padding:20px}.league-mission-head{margin-bottom:14px}.league-trophy-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.league-trophy{padding:18px 10px}.league-trophy-art{width:86px;height:86px}.league-page-intro h2{font-size:30px}.league-hall-seats{gap:20px}.league-rank-row{gap:10px;padding:13px 10px}.league-rank-row>strong{font-size:14px}.league-section-head{align-items:flex-start}.league-section-head h2{font-size:20px}.league-career-stats strong{font-size:27px}.league-history li{gap:15px}.league-rules{padding:16px}.league-announcement{bottom:calc(86px + env(safe-area-inset-bottom))}}
@media(prefers-reduced-motion:reduce){.league-content{scroll-behavior:auto}}
/* The existing social/profile navigation receives only the extra requested entry. */
#minhaSocialNav {
    width: min(560px, calc(100% - 16px));
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin: 0 auto max(8px, env(safe-area-inset-bottom));
    padding: 6px;
    border-color: var(--border-subtle, #e2e8f0);
    background: transparent !important;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    opacity: 1;
    pointer-events: auto;
    transform: none;
}
#minhaSocialNav button { min-height: 44px; }
#minhaSocialNav svg { width: 23px; height: 23px; }
.league-page > #minhaSocialNav { position: static; }

#minhaAmlealtOverlay .minha-panel:not(.minha-menu-mode, .minha-hide-social-nav) {
    padding: 0;
}
#minhaAmlealtOverlay .minha-panel:not(.minha-menu-mode, .minha-hide-social-nav) .minha-profile-page {
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
}
#minhaAmlealtOverlay #minhaSocialNav {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
}

.league-header,
#minhaAmlealtOverlay .minha-panel:not(.minha-menu-mode, .minha-hide-social-nav) .minha-profile-topline {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
    height: 76px;
    min-height: 76px;
    flex-shrink: 0;
    margin: 0;
    padding: 12px max(20px, calc((100vw - 980px) / 2));
    border: 0;
    border-bottom: 1px solid var(--border-subtle, #e2e8f0);
    border-radius: 0;
    background: var(--surface-primary, #fff);
    color: var(--text-primary, #0f172a);
    box-shadow: none;
    transform: none;
    transition: none;
}
#minhaAmlealtOverlay .minha-panel:not(.minha-menu-mode, .minha-hide-social-nav) .minha-profile-topline { top: 0; }
.league-header h1,
#minhaAmlealtOverlay .minha-panel:not(.minha-menu-mode, .minha-hide-social-nav) .minha-profile-topline .panel-title {
    margin: 0;
    color: inherit;
    font-size: 19px;
    font-weight: 800;
    text-align: center;
}
#minhaAmlealtOverlay .minha-panel:not(.minha-menu-mode, .minha-hide-social-nav) .minha-profile-topline :is(.panel-close, .minha-top-settings) {
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
    color: inherit;
    box-shadow: none;
}
#minhaAmlealtOverlay .minha-panel:not(.minha-menu-mode, .minha-hide-social-nav) .minha-profile-topline .panel-close { font-size: 30px; }
#minhaAmlealtOverlay .minha-panel:not(.minha-menu-mode, .minha-hide-social-nav) .minha-profile-topline .minha-top-settings svg { width: 24px; height: 24px; }

@media (max-width: 640px) {
    .league-header,
    #minhaAmlealtOverlay .minha-panel:not(.minha-menu-mode, .minha-hide-social-nav) .minha-profile-topline {
        height: calc(64px + env(safe-area-inset-top));
        min-height: calc(64px + env(safe-area-inset-top));
        padding: max(10px, env(safe-area-inset-top)) 16px 10px;
    }
}
#minhaAmlealtOverlay .minha-profile-tabs{grid-template-columns:repeat(3,minmax(0,1fr))}
@media(max-width:640px){.league-page{grid-template-rows:calc(64px + env(safe-area-inset-top)) auto minmax(0,1fr) auto}}
.league-page .league-content>p{margin-left:auto;margin-right:auto}
/* Standalone legacy dark styling; Escuro inherits the shared neutral palette from body. */
body.app-dark-theme:not(.app-theme-dark) .league-page{--surface-page:#101827;--surface-primary:#172033;--surface-secondary:#1d2940;--text-primary:#f6f8ff;--text-secondary:#c3ccdc;--text-muted:#97a7c0;--border-subtle:#2c3c56;--border-default:#42536f}

.league-legend-row{width:100%;border:0;border-bottom:1px solid var(--border-subtle,#e2e8f0);background:transparent;color:inherit;text-align:left;cursor:pointer;font:inherit;font-size:12px}
.league-identity{display:grid;gap:6px;padding:20px 0 26px}.league-identity strong{font-size:24px}.league-identity small{color:var(--text-muted,#64748b)}.league-care-slot{display:flex;align-items:center;gap:14px;padding:18px 0;border-bottom:1px solid var(--border-subtle,#e2e8f0)}.league-care-slot svg{width:24px;height:24px;color:var(--text-muted,#64748b)}.league-care-slot.done svg{color:#208568}.league-care-slot>div{flex:1;min-width:0}.league-care-slot strong{font-size:14px;display:block;overflow-wrap:anywhere}.league-care-slot small{font-size:12px;display:block;margin-top:5px;color:var(--text-muted,#64748b)}.league-care-slot>span{font-weight:700;font-size:14px}.league-daily-total{display:flex;justify-content:space-between;align-items:center;padding:24px 0}.league-daily-total strong{font-size:34px}.league-daily-total strong small{font-size:18px;color:var(--text-muted,#64748b)}.league-daily-total>span{font-size:13px}.league-goal{display:flex;align-items:center;text-align:left;gap:14px;width:100%;padding:14px 0;color:inherit;background:none;border:0;border-bottom:1px solid var(--border-subtle,#e2e8f0);cursor:pointer}.league-goal>.league-trophy-art{width:60px;height:60px}.league-goal>span{flex:1;min-width:0}.league-goal strong,.league-goal small{display:block;font-size:13px;line-height:1.5}.league-goal small{font-size:11px;color:var(--text-muted,#64748b)}.league-mission-grid{margin-top:20px}.league-page .league-rank-name small{overflow-wrap:anywhere}@media(max-width:640px){.league-goal>small{max-width:70px}.league-care-slot{gap:12px}.league-daily-total strong{font-size:30px}}

/* League header follows Minha Amlealt / Meu Pet Social:
   clean at the top, three separate frosted controls on content scroll. */
.league-page .league-header {
    width: min(780px, 100%);
    margin-inline: auto;
    padding: max(.45rem, env(safe-area-inset-top)) clamp(.65rem, 2vw, 1.15rem) .45rem;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: clamp(.45rem, 2vw, .8rem);
    background: transparent;
    border: 0;
    box-shadow: none;
}
.league-page .league-header h1 {
    min-width: 0;
    max-width: 100%;
    justify-self: center;
    padding: .4rem .8rem;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.league-page .league-header .league-icon-button {
    width: 44px;
    height: 44px;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 50%;
}
.league-page .league-header h1,
.league-page .league-header .league-icon-button {
    transition: background-color .28s ease, border-color .28s ease, box-shadow .28s ease, color .28s ease;
}
.league-page.league-scrolled .league-header h1,
.league-page.league-scrolled .league-header .league-icon-button {
    background: rgba(255,255,255,.82);
    border-color: rgba(148,163,184,.3);
    color: #15223a;
    box-shadow: 0 9px 30px rgba(15,23,42,.13);
    backdrop-filter: blur(18px) saturate(1.3);
    -webkit-backdrop-filter: blur(18px) saturate(1.3);
}
.league-page.league-scrolled .league-header .league-icon-button:is(:hover,:focus-visible) {
    background: rgba(255,255,255,.92);
}
body:is(.app-dark-theme, .app-theme-dark) .league-page.league-scrolled .league-header h1,
body:is(.app-dark-theme, .app-theme-dark) .league-page.league-scrolled .league-header .league-icon-button {
    background: rgba(20,26,39,.83);
    border-color: rgba(255,255,255,.17);
    color: #f8fafc;
    box-shadow: 0 10px 30px rgba(0,0,0,.27);
}
body:is(.app-dark-theme, .app-theme-dark) .league-page.league-scrolled .league-header .league-icon-button:is(:hover,:focus-visible) {
    background: rgba(37,47,66,.94);
}
.league-page .league-pet-card { gap: 18px; padding: 12px 0 24px; }
.league-page .league-division-heading { min-width: 0; }
.league-page .league-division-heading h2 { margin: 6px 0 0; }
@media(max-width:640px) {
    .league-page .league-header { padding: max(10px, env(safe-area-inset-top)) 16px 10px; }
    .league-page .league-pet-card { gap: 14px; padding-bottom: 20px; }
}
@media(prefers-reduced-motion:reduce) {
    .league-page .league-header h1,
    .league-page .league-header .league-icon-button { transition: none; }
}

/* League start: division summary, progress, then the server-ranked list. */
.league-page { grid-template-rows:76px minmax(0,1fr) auto; }
.league-page .league-content { min-width:0; padding-top:18px; }
.league-content > .league-division-heading { padding:6px 0 20px; }
.league-content > .league-division-heading p { margin:0 0 5px; }
.league-content > .league-division-heading h2 { font-size:clamp(32px,6vw,48px); margin:0 0 7px; letter-spacing:-.035em; }
.league-division-picker { min-width:0; }
.league-division-picker .league-section-head { gap:8px; margin-bottom:5px; }
.league-division-picker .league-section-head h3 { margin:0; }
.league-division-rail {
 display:flex; overflow-x:auto; overscroll-behavior-inline:contain; scrollbar-width:thin; gap:9px; padding:6px 5px 12px;
 scroll-margin-inline:8px; user-select:none;
}
.league-division-rail button {
 flex:0 0 clamp(105px,17vw,130px); min-height:106px; padding:8px 5px;
 display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px;
 background:transparent; color:inherit; border:1px solid var(--border-subtle,#e2e8f0); border-radius:15px; font:inherit; font-size:12px; font-weight:700;
}
.league-division-rail button[aria-pressed=true] {
 background:var(--surface-secondary,#f1f5f9); border-color:color-mix(in srgb,currentColor 40%,transparent);
}
.league-division-rail [aria-current=true] small { color:var(--text-secondary,#475569); font-weight:600; }
.league-division-rail .league-division-art { width:49px; height:49px; pointer-events:none; }
.league-division-details { padding:12px 0; border-bottom:1px solid var(--border-subtle,#e2e8f0); }
.league-division-details h3 { margin:0; }
.league-page .league-division-details p { margin:5px 0; }
.league-page .league-division-progress { color:var(--text-primary,#0f172a); font-weight:650; }
.league-page .league-result { display:flex; align-items:center; gap:8px; padding-block:8px; }
.league-result svg { width:19px; height:19px; }
.league-rank-section { margin-top:24px; }
.league-rank-section .league-section-head > div > small,.league-end { color:var(--text-secondary,#475569); }
.league-end { text-align:right; white-space:nowrap; }
.league-end strong { display:block; color:var(--text-primary,#0f172a); }
ol.league-ranking { list-style:none; padding:0; margin:0; }
.league-ranking .league-rank-row { border-radius:0; }
.league-ranking button.league-rank-row:hover { background:var(--surface-secondary,#f1f5f9); }
.league-ranking .league-rank-row.own {
 color:inherit; border-bottom-color:var(--border-subtle,#e2e8f0);
 background:color-mix(in srgb,var(--secondary,#3038ff) 12%,var(--surface-page,#fff));
 box-shadow:inset 3px 0 0 var(--secondary,#3038ff);
}
.league-ranking .own .league-self-label { font-weight:750; }
.league-ranking div.league-rank-row { cursor:default; }
@media (max-width:640px) {
 .league-page { grid-template-rows:calc(64px + env(safe-area-inset-top)) minmax(0,1fr) auto; }
 .league-page .league-content { padding:10px 16px 26px; }
 .league-ranking .league-rank-row { gap:9px; padding-inline:9px; }
}
.league-hall-detail h3 { margin-top:12px; }
.league-hall-detail .league-ranking { margin-bottom:12px; }
.league-hall-detail .league-legends { padding-inline-start:22px; color:var(--text-secondary,#475569); }
.league-hall-detail .league-legend-row { display:flex; gap:12px; flex-wrap:wrap; align-items:center; justify-content:space-between; min-height:44px; padding:8px 4px; }
#achievementDetail .league-achievement-actions { display:flex; flex-wrap:wrap; justify-content:center; gap:8px; margin-top:12px; }

/* The league is an ordinary social subview; the app owns scrolling and navigation. */
#petLeaguePage.league-page {
 position:static;
 inset:auto;
 z-index:auto;
 display:block;
 min-width:0;
 background:transparent;
}
#petLeaguePage.league-page[hidden] { display:none !important; }
#petLeaguePage .league-content {
 overflow:visible;
 padding:0;
 overscroll-behavior:auto;
}
#petLeaguePage .league-announcement { position:fixed; z-index:105; }
#petLeaguePage .league-settings-link {
 display:flex;
 align-items:center;
 justify-content:space-between;
 gap:10px;
 width:100%;
 min-height:48px;
 margin:8px 0 14px;
 padding:10px 14px;
 color:inherit;
 font:inherit;
 font-weight:700;
 text-align:start;
 background:transparent;
 border:1px solid var(--border-subtle,#e2e8f0);
 border-radius:14px;
}
#petLeaguePage .league-settings-link:hover { background:var(--surface-secondary,#f1f5f9); }
#petLeaguePage .league-settings-link svg { width:20px; height:20px; }

/* Discreet division rail: keep scrolling and keyboard controls, hide browser chrome. */
#petLeaguePage .league-division-rail { scrollbar-width:none; }
#petLeaguePage .league-division-rail::-webkit-scrollbar { display:none; }
#petLeaguePage .league-division-details:empty { padding:0; border:0; }
#petLeaguePage .league-division-heading .league-round-note {
 margin:7px 0 0;
 color:var(--text-secondary,#475569);
 font-size:13px;
}

/* Permanent progression is the primary metric; the Hall remains a division detail. */
#petLeaguePage .league-permanent-progress { display:grid; gap:7px; max-width:360px; margin:12px 0 10px; }
#petLeaguePage .league-permanent-progress label { font-size:.96rem; }
#petLeaguePage .league-permanent-progress p,
#petLeaguePage .league-season-note { color:var(--text-secondary,#475569); font-size:.82rem; }
#petLeaguePage .league-permanent-progress progress { display:block; height:8px; width:100%; overflow:hidden; border:0; border-radius:999px; accent-color:var(--accent,#2d63df); background:var(--border,rgba(120,128,145,.24)); }
#petLeaguePage .league-permanent-progress progress::-webkit-progress-bar { background:var(--border,rgba(120,128,145,.24)); border-radius:999px; }
#petLeaguePage .league-permanent-progress progress::-webkit-progress-value { background:var(--accent,#2d63df); border-radius:999px; }
#petLeaguePage .league-division-details .league-rank-section { padding:14px 0 0; margin:0; }

/* Match the initial progress view without implying a real tier or score. */
#petLeaguePage .league-skeleton { min-width:0; }
#petLeaguePage .league-skeleton-status {
 position:absolute; width:1px; height:1px; padding:0; margin:-1px;
 overflow:hidden; clip-path:inset(50%); white-space:nowrap;
}
#petLeaguePage .league-skeleton-layout {
 --league-skeleton-fill:color-mix(in srgb,var(--text-primary,#0f172a) 10%,var(--surface-page,#fff));
 display:grid; min-width:0; gap:12px;
}
#petLeaguePage .league-skeleton-hero { display:grid; gap:10px; padding:6px 0 13px; }
#petLeaguePage .league-skeleton-line,
#petLeaguePage .league-skeleton-medal {
 display:block; height:.7rem; width:100%; border-radius:999px; background:var(--league-skeleton-fill);
}
#petLeaguePage .league-skeleton-title { width:min(76%,250px); height:clamp(32px,6vw,48px); border-radius:12px; margin-bottom:4px; }
#petLeaguePage .league-skeleton-score { width:min(45%,122px); height:.84rem; }
#petLeaguePage .league-skeleton-progress { width:min(100%,360px); height:8px; }
#petLeaguePage .league-skeleton-season { width:min(57%,172px); margin-top:2px; }
#petLeaguePage .league-skeleton-subtitle { width:84px; height:.96rem; }
#petLeaguePage .league-skeleton-rail {
 display:flex; gap:9px; overflow:hidden; overflow:clip; padding:2px 5px 8px; min-width:0;
}
#petLeaguePage .league-skeleton-card {
 display:grid; align-content:center; justify-items:center; gap:10px;
 flex:0 0 clamp(105px,17vw,130px); min-height:106px;
 border:1px solid var(--border-subtle,#e2e8f0); border-radius:15px;
}
#petLeaguePage .league-skeleton-medal { width:43px; height:43px; border-radius:15px; }
#petLeaguePage .league-skeleton-card .league-skeleton-line { width:55%; }
#petLeaguePage .league-skeleton-details { display:grid; gap:8px; padding-block:6px 16px; border-bottom:1px solid var(--border-subtle,#e2e8f0); }
#petLeaguePage .league-skeleton-details .league-skeleton-line:last-child { width:min(62%,188px); }
#petLeaguePage .league-skeleton-footer {
 display:flex; justify-content:space-between; align-items:center;
 min-height:48px; padding-inline:14px; border:1px solid var(--border-subtle,#e2e8f0); border-radius:14px;
}
#petLeaguePage .league-skeleton-footer .league-skeleton-line:first-child { width:min(60%,138px); }
#petLeaguePage .league-skeleton-footer .league-skeleton-line:last-child { width:15px; height:15px; }
@media (prefers-reduced-motion:no-preference) {
 body:not(.custom-motion-reduced):not([data-premium-animations="reduced"]):not([data-premium-animations="none"]) #petLeaguePage .league-skeleton-layout {
  animation:league-skeleton-breathe 1.85s ease-in-out infinite;
 }
}
@keyframes league-skeleton-breathe {
 0%,100% { opacity:1; }
 50% { opacity:.68; }
}

/* Public pet identifier forms share the account and League controls. */
.pet-username-dialog{position:fixed;inset:0;margin:0;width:100%;height:100dvh;max-width:none;max-height:none;box-sizing:border-box;padding:calc(env(safe-area-inset-top) + 20px) max(18px,env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 24px) max(18px,env(safe-area-inset-left));border:0;border-radius:0;background:var(--surface-page,#fff);color:var(--text-primary,#172033);overflow:auto;overscroll-behavior:contain;color-scheme:light}
.pet-username-dialog::backdrop{background:var(--surface-page,#fff)}
.pet-username-dialog form{max-width:560px;margin:0 auto}
.pet-username-top{display:grid;gap:8px;justify-items:start}
.pet-username-top h2{margin:0;font-size:clamp(1.5rem,4vw,2rem);line-height:1.2}
.pet-username-retry{justify-self:start}
.pet-username-retry[hidden]{display:none!important}
.pet-username-status[data-state=available]{color:#166534}
.pet-username-status:is([data-state=taken],[data-state=error]){color:#991b1b}
body:is(.app-dark-theme,.app-theme-dark) .pet-username-status[data-state=available]{color:#86efac}
body:is(.app-dark-theme,.app-theme-dark) .pet-username-status:is([data-state=taken],[data-state=error]){color:#fca5a5}
body:is(.app-dark-theme,.app-theme-dark) .pet-username-dialog{color-scheme:dark}
body:is(.app-dark-theme,.app-theme-dark) .pet-username-dialog::backdrop{background:#000}
.pet-username-dialog form,.league-username{display:grid;gap:10px;min-width:0}
.pet-username-dialog h3,.pet-username-dialog p,.league-username p{margin:0}
.pet-username-dialog label,.league-username label{font-weight:700}
.pet-username-dialog p,.pet-username-status{font-size:.875rem;color:var(--text-muted,#526175)}
.pet-username-status{min-height:2.5em}
.pet-username-input{display:flex;align-items:center;gap:4px;padding-inline:14px;min-height:46px;border-radius:12px;border:1px solid var(--border-default,#cbd5e1);background:var(--surface-secondary,#f8fafc);color:inherit}
.pet-username-input input{min-width:0;width:100%;min-height:46px;padding:0;border:0;background:transparent;color:inherit;font:inherit;font-size:max(16px,1em)}
.pet-username-input input:focus{outline:none}
.pet-username-input:focus-within{outline:2px solid var(--secondary,#3038ff);outline-offset:2px}
.pet-username-actions{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.league-username{margin-block:0 16px}
.league-username button{justify-self:start}
body:is(.app-dark-theme,.app-theme-dark) .pet-username-dialog{background:#000;color:#f5f5f5}
body:is(.app-dark-theme,.app-theme-dark) .pet-username-input{background:#303030;color:#f5f5f5}

.league-settings .pet-username-input input{border:0;padding:0;border-radius:0;background:transparent;font-size:max(16px,1em);outline:none}
