.league-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.league-hero {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.league-hero-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.league-title {
    margin: 0.2rem 0 0;
}

.league-subtitle {
    margin-top: 0.45rem;
    color: var(--text-muted);
}

.league-toolbar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.85rem;
}

.league-select-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.league-select-field span {
    color: var(--text-muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.league-select-field select {
    width: 100%;
    min-height: 42px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-color);
    padding: 0.7rem 0.85rem;
}

.league-tabs {
    margin-top: 0;
}

.league-tab-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.league-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
}

.league-panel-head h3 {
    margin-bottom: 0.2rem;
}

.league-panel-head p {
    color: var(--text-muted);
}

.league-select-field-compact {
    min-width: 220px;
}

.league-zone-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.league-zone-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
}

.league-zone-chip.promotion {
    background: rgba(38, 166, 91, 0.16);
    color: #2b7a46;
}

.league-zone-chip.relegation {
    background: rgba(255, 179, 71, 0.16);
    color: #9a5b00;
}

.league-zone-chip.danger {
    background: rgba(220, 83, 83, 0.16);
    color: #a43737;
}

.league-table-shell .app-table {
    min-width: 980px;
}

.league-team-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

.league-team-logo {
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    overflow: hidden;
    color: #ffffff;
    font-size: 0.63rem;
    font-weight: 900;
    background: linear-gradient(145deg, #21683a, #12351f);
    border: 1px solid rgba(255, 255, 255, 0.24);
}

.league-team-logo.has-logo {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.16);
}

.league-team-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

body.light-mode .league-team-logo {
    color: #ffffff;
    border-color: rgba(15, 23, 42, 0.14);
}

body.light-mode .league-team-logo.has-logo {
    border-color: rgba(15, 23, 42, 0.12);
}

.league-standings-table td:first-child,
.league-standings-table th:first-child {
    font-weight: 700;
}

.league-row.zone-promotion td:first-child {
    box-shadow: inset 4px 0 0 #26a65b;
}

.league-row.zone-relegation td:first-child {
    box-shadow: inset 4px 0 0 #ffb347;
}

.league-row.zone-danger td:first-child {
    box-shadow: inset 4px 0 0 #dc5353;
}

.league-club-link {
    padding: 0;
    margin: 0;
    border: none;
    background: none;
    box-shadow: none;
    color: inherit;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.league-club-link:hover {
    color: var(--primary-color);
}

.league-player-link {
    padding: 0;
    margin: 0;
    border: none;
    background: none;
    box-shadow: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
    text-align: left;
}

.league-player-link:hover {
    color: var(--primary-color);
}

.league-form-link {
    border: none;
    cursor: pointer;
}

.league-form-link:hover {
    filter: brightness(0.96);
}

.league-fixtures-nav {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.league-fixture-current {
    color: var(--text-muted);
    font-weight: 600;
}

.league-fixture-arrow {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0;
}

.league-fixture-arrow:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.league-fixture-arrow:disabled {
    opacity: 0.45;
    cursor: default;
}

.league-fixtures-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.league-matchday-card.is-next {
    border-color: rgba(var(--primary-color-rgb), 0.4);
}

.league-matchday-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: none;
    padding-left: 0;
    padding-right: 0;
}

body.light-mode .league-matchday-card {
    background: #fcfdff;
    border-color: rgba(15, 23, 42, 0.08);
}

.league-matchday-head {
    margin-bottom: 1rem;
    text-align: center;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    background: rgba(var(--primary-color-rgb), 0.08);
}

.league-matchday-head h4 {
    margin: 0;
    color: inherit;
}

body.light-mode .league-matchday-head {
    background: rgba(var(--primary-color-rgb), 0.1);
}

.league-match-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.league-match-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0.75rem;
    align-items: center;
    padding: 0.85rem 1rem;
    border: none;
    border-radius: 0;
    background: transparent;
}

.league-match-row:nth-child(even) {
    background: rgba(255, 255, 255, 0.025);
    border-radius: 8px;
}

.league-match-row.is-own-match {
    background: transparent;
    border-radius: 0;
}

body.light-mode .league-match-row:nth-child(even) {
    background: rgba(15, 23, 42, 0.035);
}

.league-match-team.home {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    text-align: right;
}

.league-match-team.away {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    text-align: left;
}

.league-match-team-main {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.league-match-team.home .league-match-team-main,
.league-match-team.home .league-match-team-form {
    justify-content: flex-end;
}

.league-match-team.home .league-match-team-main {
    order: 2;
}

.league-match-team.home .league-match-team-form {
    order: 1;
}

.league-match-team.away .league-match-team-main,
.league-match-team.away .league-match-team-form {
    justify-content: flex-start;
}

.league-match-team.away .league-match-team-main {
    order: 1;
}

.league-match-team.away .league-match-team-form {
    order: 2;
}

.league-team-rank {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 700;
    min-width: 1.5rem;
}

.league-match-team-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    flex-shrink: 0;
}

.league-match-score {
    min-width: 76px;
    text-align: center;
    font-weight: 700;
}

.league-match-score-btn {
    border: 1px solid transparent;
    background: rgba(var(--primary-color-rgb), 0.06);
    color: inherit;
    cursor: pointer;
    padding: 0.48rem 0.65rem;
    border-radius: 8px;
    min-height: 44px;
    display: inline-grid;
    place-items: center;
    line-height: 1.1;
}

.league-match-score-btn:hover {
    color: var(--primary-color);
    background: rgba(var(--primary-color-rgb), 0.08);
    border-color: rgba(var(--primary-color-rgb), 0.25);
}

.league-match-score-mobile {
    display: none;
}

.league-match-team.is-own-club,
.league-match-team.is-own-club .league-club-link,
.league-match-team.is-own-club strong {
    color: var(--primary-color);
    font-weight: 800;
}

.league-stats-grid,
.league-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.league-stats-summary {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1rem;
    padding: 1.25rem;
    border: 1px solid rgba(214, 162, 30, 0.18);
    border-radius: 18px;
    background: radial-gradient(circle at 18% 0%, rgba(214, 162, 30, 0.07), transparent 30%), linear-gradient(135deg, rgba(19, 24, 21, 0.9), rgba(9, 12, 11, 0.88));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.league-stat-summary-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.85rem;
    align-items: center;
    min-width: 0;
    padding: 0.95rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025));
}

.league-stat-summary-card span:not(.league-summary-icon) {
    display: block;
    color: var(--league-gold-soft);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.league-stat-summary-card strong {
    display: block;
    min-width: 0;
    overflow: hidden;
    color: #fff;
    font-size: 0.96rem;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.league-stat-card h4,
.league-info-grid h4 {
    margin-bottom: 0.85rem;
}

.league-info-block {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.league-info-line {
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.league-profile-list {
    display: grid;
    gap: 0.55rem;
}

.league-profile-row {
    display: grid;
    grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1fr);
    gap: 0.9rem;
    align-items: center;
    padding: 0.55rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.league-profile-row:last-child {
    border-bottom: none;
}

.league-profile-row span {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.league-profile-row strong {
    color: var(--text-color);
}

.league-info-wide {
    grid-column: span 2;
}

.league-tree-card {
    overflow: hidden;
}

.league-tree {
    display: grid;
    gap: 0.55rem;
    padding: 0.35rem 0;
    overflow-x: auto;
}

.league-tree-tier {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) minmax(170px, 0.75fr);
    gap: 1rem;
    align-items: center;
    min-width: min(640px, 100%);
    padding: 0.35rem 0.55rem;
    border-radius: 8px;
}

.league-tree-tier.is-selected {
    background: rgba(38, 166, 91, 0.12);
    outline: 1px solid rgba(38, 166, 91, 0.35);
}

.league-tree-boxes {
    display: grid;
    grid-template-columns: repeat(var(--groups), clamp(22px, 4.4vw, 34px));
    justify-content: center;
    gap: 0.32rem;
    align-items: center;
}

.league-tree-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(22px, 4.4vw, 34px);
    height: clamp(22px, 4vw, 30px);
    border: 2px solid var(--text-color);
    border-radius: 4px;
    color: var(--text-color);
    background: var(--card-bg);
    font-weight: 800;
    line-height: 1;
}

.league-tree-more,
.league-tree-infinity {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 30px;
    color: var(--text-muted);
    font-weight: 800;
}

.league-tree-label {
    display: flex;
    align-items: baseline;
    gap: 0.55rem;
    white-space: nowrap;
}

.league-tree-label span {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.league-tree-label strong {
    font-size: 1rem;
}

.league-tree-tier.is-selected .league-tree-box,
.league-tree-tier.is-selected .league-tree-label strong,
.league-tree-tier.is-selected .league-tree-infinity {
    color: #26a65b;
    border-color: #26a65b;
}

.league-stats-table-container .app-table {
    min-width: 420px;
}

body.light-mode .league-zone-chip.promotion {
    background: rgba(38, 166, 91, 0.12);
    color: #1f5f35;
}

body.light-mode .league-zone-chip.relegation {
    background: rgba(255, 179, 71, 0.18);
    color: #8a4d00;
}

body.light-mode .league-zone-chip.danger {
    background: rgba(220, 83, 83, 0.14);
    color: #8f2f2f;
}

@media (max-width: 1100px) {
    .league-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .league-panel-head {
        flex-direction: column;
        align-items: stretch;
    }

    .league-toolbar {
        grid-template-columns: 1fr;
    }

    .league-info-wide {
        grid-column: span 1;
    }

    .league-profile-row {
        grid-template-columns: 1fr;
        gap: 0.2rem;
    }

    .league-tree {
        overflow-x: visible;
    }

    .league-tree-tier {
        grid-template-columns: 1fr;
        min-width: 0;
        gap: 0.4rem;
        padding: 0.55rem 0.35rem;
    }

    .league-tree-boxes {
        justify-content: start;
        grid-template-columns: repeat(var(--groups), minmax(18px, 1fr));
        gap: 0.18rem;
    }

    .league-tree-box {
        width: 100%;
        min-width: 18px;
        height: 24px;
        font-size: 0.72rem;
        border-width: 1px;
    }

    .league-tree-label {
        white-space: normal;
        justify-content: space-between;
        gap: 0.45rem;
    }

    .league-stats-grid,
    .league-info-grid {
        grid-template-columns: 1fr;
    }

    .league-match-row {
        grid-template-columns: minmax(64px, 76px) minmax(0, 1fr);
        grid-template-rows: auto auto;
        align-items: stretch;
        gap: 0.2rem 0.75rem;
        text-align: left;
        padding: 0.7rem 0.85rem;
    }

    .league-match-team.home,
    .league-match-team.away {
        display: flex;
        align-items: center;
        min-width: 0;
        text-align: left;
    }

    .league-match-team.home {
        grid-column: 2;
        grid-row: 1;
    }

    .league-match-team.away {
        grid-column: 2;
        grid-row: 2;
    }

    .league-match-score {
        grid-column: 1;
        grid-row: 1 / 3;
        min-width: 64px;
        width: 100%;
        min-height: 64px;
        align-self: stretch;
    }

    .league-match-score-btn {
        padding: 0.55rem 0.45rem;
        border-color: rgba(var(--primary-color-rgb), 0.18);
    }

    .league-match-team.home .league-match-team-main,
    .league-match-team.away .league-match-team-main {
        justify-content: flex-start;
        order: initial;
        width: 100%;
        min-width: 0;
    }

    .league-match-team-form {
        display: none;
    }

    .league-team-rank {
        display: none;
    }

    .league-team-cell {
        width: 100%;
        min-width: 0;
    }

    .league-team-cell span:last-child {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .league-match-score-desktop {
        display: none;
    }

    .league-match-score-mobile {
        display: grid;
        gap: 0.55rem;
        justify-items: center;
        font-size: 1.05rem;
        font-weight: 800;
    }

    .league-match-score-mobile.is-time {
        gap: 0;
        font-size: 0.9rem;
    }
}

/* League prestige layout overrides */
:root {
    --league-bg-main: #070908;
    --league-panel-bg: rgba(15, 18, 15, 0.86);
    --league-panel-bg-soft: rgba(25, 28, 22, 0.72);
    --league-border-soft: rgba(214, 162, 30, 0.22);
    --league-gold: #d6a21e;
    --league-gold-soft: rgba(214, 162, 30, 0.65);
    --league-text-main: #f2f2ef;
    --league-text-muted: #a8aaa2;
    --league-green-highlight: rgba(35, 95, 48, 0.35);
    --league-green-accent: #2fbf71;
    --league-danger: #e34848;
    --league-draw: #d89b22;
}

.league-page {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow: hidden;
    color: var(--league-text-main);
}

.league-page::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: min(680px, 76vh);
    pointer-events: none;
    background: radial-gradient(circle at 50% 18%, rgba(214, 162, 30, 0.2), transparent 36%), linear-gradient(90deg, rgba(5, 8, 7, 0.82), rgba(7, 9, 8, 0.2) 48%, rgba(5, 8, 7, 0.82)), linear-gradient(180deg, rgba(7, 9, 8, 0), rgba(7, 9, 8, 0.72)), url("../../assets/league/bg.png") center top / cover no-repeat;
}

.league-page>* {
    position: relative;
    z-index: 1;
}

.league-stage {
    position: relative;
    display: grid;
}

.league-hero {
    position: relative;
    min-height: 280px;
    overflow: hidden;
    display: grid;
    place-items: center;
    padding: 2.25rem min(6vw, 5rem) 3.25rem;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.league-hero::before,
.league-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.league-hero::before {
    content: none;
}

.league-hero::after {
    content: none;
}

.league-hero-copy {
    position: relative;
    z-index: 2;
    max-width: 760px;
    text-align: center;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.75);
}

.league-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--league-gold);
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.league-kicker span {
    width: 54px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--league-gold));
}

.league-kicker span:last-child {
    background: linear-gradient(90deg, var(--league-gold), transparent);
}

.league-title {
    margin: 0.65rem 0 0;
    color: #fff;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.1rem, 4.2vw, 3.4rem);
    font-weight: 700;
    line-height: 1.05;
}

.league-subtitle {
    margin-top: 0.85rem;
    color: rgba(242, 242, 239, 0.86);
    font-size: 1rem;
}

.league-subtitle-soft {
    margin-top: 0.35rem;
    color: var(--league-text-muted);
}

.league-hero-pills {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1.35rem;
}

.league-hero-pills span {
    min-width: 150px;
    display: grid;
    gap: 0.25rem;
    padding: 0.7rem 1rem;
    border: 1px solid rgba(214, 162, 30, 0.2);
    border-radius: 12px;
    background: rgba(12, 15, 14, 0.72);
    color: var(--league-text-main);
    text-align: left;
}

.league-hero-pills strong {
    color: var(--league-gold-soft);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.league-hero-banner,
.league-hero-trophy {
    position: absolute;
    z-index: 1;
    pointer-events: none;
    user-select: none;
    object-fit: contain;
    filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.58));
}

.league-hero-banner {
    top: -3%;
    width: min(19vw, 245px);
    height: 88%;
    opacity: 0.86;
}

.league-hero-banner-left {
    left: 3%;
}

.league-hero-banner-right {
    right: 3%;
}

.league-hero-trophy {
    left: clamp(5.25rem, 8vw, 7.75rem);
    bottom: 1.05rem;
    width: min(16.5vw, 210px);
    max-height: 78%;
}

body.light-mode .league-page::before {
    background:
        radial-gradient(circle at 50% 18%, rgba(214, 162, 30, 0.16), transparent 38%),
        linear-gradient(180deg, rgba(247, 244, 235, 0.16), rgba(247, 244, 235, 0.96)),
        url("../../assets/league/bg.png") center top / cover no-repeat;
}

body.light-mode .league-hero {
    margin: 0 min(1vw, 0.75rem);
    border: 1px solid rgba(99, 74, 18, 0.22);
    border-radius: 20px;
    background:
        radial-gradient(circle at 50% 35%, rgba(98, 76, 24, 0.1), transparent 44%),
        linear-gradient(135deg, rgba(250, 247, 237, 0.94), rgba(226, 219, 201, 0.9));
    box-shadow: 0 18px 48px rgba(50, 42, 25, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body.light-mode .league-hero-copy {
    padding: 0.65rem 1rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.54);
    text-shadow: none;
    backdrop-filter: blur(4px);
}

body.light-mode .league-title {
    color: #1f271f;
}

body.light-mode .league-subtitle {
    color: #4d554c;
}

body.light-mode .league-subtitle-soft {
    color: #687066;
}

body.light-mode .league-hero-pills span {
    border-color: rgba(129, 94, 18, 0.22);
    background: rgba(255, 255, 255, 0.76);
    color: #253026;
}

body.light-mode .league-hero-banner,
body.light-mode .league-hero-trophy {
    filter: drop-shadow(0 14px 20px rgba(44, 36, 19, 0.24));
}

body.light-mode .league-toolbar {
    border-color: rgba(116, 91, 34, 0.22);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(241, 236, 222, 0.94));
    box-shadow: 0 18px 42px rgba(50, 42, 25, 0.12), inset 0 1px 0 #fff;
}

body.light-mode .league-select-field span {
    color: #656b62;
}

body.light-mode .league-select-field select {
    border-color: rgba(91, 75, 40, 0.24);
    background: rgba(255, 255, 255, 0.92);
    color: #202820;
    color-scheme: light;
}

body.light-mode .league-my-button {
    color: #725510;
    background: rgba(214, 162, 30, 0.12);
}

.league-toolbar {
    position: relative;
    z-index: 3;
    width: calc(100% - min(6vw, 5rem));
    margin: 1rem auto 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(140px, 0.62fr);
    gap: 1rem;
    align-items: end;
    padding: 1.25rem;
    border: 1px solid var(--league-border-soft);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(18, 22, 19, 0.92), rgba(12, 15, 14, 0.86));
    box-shadow: 0 22px 55px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(10px);
}

.league-select-field {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-width: 0;
}

.league-select-field span {
    color: rgba(242, 242, 239, 0.72);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.league-select-field select {
    width: 100%;
    min-height: 46px;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(9, 12, 11, 0.72);
    color: var(--league-text-main);
    padding: 0.7rem 0.85rem;
}

.league-select-field select:focus {
    outline: 2px solid rgba(214, 162, 30, 0.34);
    outline-offset: 2px;
}

.league-my-button {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    border: 1px solid #d6a21e8f;
    border-radius: 10px;
    background: rgba(214, 162, 30, 0.08);
    color: #f2d58b;
    font-weight: 800;
    cursor: pointer;
}

.league-my-button:hover,
.league-my-button:focus-visible {
    background: rgba(214, 162, 30, 0.15);
    outline: none;
}

.league-tabs {
    margin-top: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: transparent;
}

.league-tabs::before {
    content: none;
}

.league-tabs>.tab-btn {
    gap: 0.55rem;
    align-items: center;
    border-radius: 0;
    color: rgba(242, 242, 239, 0.78);
    background: transparent;
    line-height: 1;
}

.league-tabs>.tab-btn span {
    color: var(--league-gold);
    font-weight: 900;
}

.league-tabs>.tab-btn img {
    width: 1.15rem;
    height: 0.9rem;
    object-fit: contain;
    flex: 0 0 auto;
    transform: translateY(1px);
    filter: drop-shadow(0 0 8px rgba(214, 162, 30, 0.22));
}

.league-tabs>.tab-btn.active {
    color: #f7d777;
    background: linear-gradient(180deg, rgba(214, 162, 30, 0.08), transparent);
}

.league-tabs>.tab-btn.active::after {
    background: var(--league-gold);
}

.league-tab-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.league-table-head {
    align-items: end;
}

.league-zone-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.league-zone-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
}

.league-zone-chip.promotion {
    background: rgba(47, 191, 113, 0.16);
    color: #75d79d;
}

.league-zone-chip.relegation {
    background: rgba(216, 155, 34, 0.16);
    color: #e2bd68;
}

.league-zone-chip.danger {
    background: rgba(227, 72, 72, 0.16);
    color: #ef8b8b;
}

.league-content-card {
    display: grid;
    gap: 1rem;
    padding: 1.25rem;
    border: 1px solid rgba(214, 162, 30, 0.18);
    border-radius: 18px;
    background: radial-gradient(circle at 22% 0%, rgba(214, 162, 30, 0.08), transparent 28%), linear-gradient(135deg, rgba(19, 24, 21, 0.9), rgba(9, 12, 11, 0.88));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.league-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
}

.league-summary-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.85rem;
    align-items: center;
    min-width: 0;
    padding: 0.95rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025));
}

.league-summary-icon {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    color: #14140e;
    background: linear-gradient(145deg, #f1d58a, #bf8d24);
    line-height: 1;
    text-align: center;
    font-weight: 900;
    overflow: hidden;
}

.league-summary-icon.has-image {
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(214, 162, 30, 0.18);
}

.league-summary-icon.has-image img {
    width: 78%;
    height: 78%;
    display: block;
    object-fit: contain;
    margin: auto;
}

.league-summary-card span:not(.league-summary-icon) {
    display: block;
    color: var(--league-gold-soft);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.league-summary-card strong {
    display: block;
    min-width: 0;
    overflow: hidden;
    color: #fff;
    font-size: 0.96rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.league-summary-card small {
    display: block;
    margin-top: 0.15rem;
    color: var(--league-text-muted);
}

.league-summary-card-select .league-select-field {
    gap: 0.35rem;
}

.league-summary-card-select .league-select-field-compact {
    min-width: 0;
}

.league-summary-card-select select {
    min-height: 36px;
    padding: 0.45rem 0.65rem;
    font-size: 0.9rem;
}

.league-table-shell .app-table {
    min-width: 980px;
}

.league-standings-desktop.table-container {
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(3, 5, 5, 0.26);
}

.league-standings-table th {
    color: rgba(242, 242, 239, 0.7);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.league-standings-table td {
    border-bottom-color: rgba(255, 255, 255, 0.075);
}

.league-team-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

.league-team-logo {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    overflow: hidden;
    color: #fff;
    font-size: 0.63rem;
    font-weight: 900;
    background: linear-gradient(145deg, #21683a, #12351f);
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.league-team-logo.has-logo {
    background: transparent;
}

.league-team-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.league-club-link {
    padding: 0;
    margin: 0;
    border: none;
    background: none;
    box-shadow: none;
    color: inherit;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.league-club-link:hover {
    color: var(--league-gold);
}

.league-row.own-team-row {
    color: #fff5be;
    background: var(--league-green-highlight);
}

.league-row.zone-promotion td:first-child {
    box-shadow: inset 4px 0 0 var(--league-green-accent);
}

.league-row.zone-relegation td:first-child {
    box-shadow: inset 4px 0 0 var(--league-draw);
}

.league-row.zone-danger td:first-child {
    box-shadow: inset 4px 0 0 var(--league-danger);
}

.league-standings-mobile {
    display: none;
}

.league-mobile-header {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr) auto auto auto auto 0.8rem;
    gap: 0.7rem;
    align-items: center;
    padding: 0.65rem 0.85rem;
    color: var(--league-text-muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.league-mobile-row {
    position: relative;
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr) auto auto auto auto 0.8rem;
    gap: 0.7rem;
    align-items: center;
    min-height: 64px;
    padding: 0.72rem 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.025);
}

.league-mobile-row:first-child {
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.league-mobile-row:last-child {
    border-bottom: none;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

.league-mobile-row.own-team-row {
    background: var(--league-green-highlight);
}

.league-mobile-row.zone-promotion {
    box-shadow: inset 4px 0 0 var(--league-green-accent);
}

.league-mobile-row.zone-relegation {
    box-shadow: inset 4px 0 0 var(--league-draw);
}

.league-mobile-row.zone-danger {
    box-shadow: inset 4px 0 0 var(--league-danger);
}

.league-mobile-rank {
    color: #fff;
    font-size: 1.15rem;
    font-weight: 900;
    text-align: center;
}

.league-mobile-team {
    min-width: 0;
}

.league-mobile-team .league-team-cell {
    width: 100%;
}

.league-mobile-team .league-team-cell span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.league-mobile-points {
    display: grid;
    justify-items: end;
    line-height: 1.05;
}

.league-mobile-points strong {
    font-size: 1rem;
}

.league-mobile-points span,
.league-mobile-diff,
.league-mobile-played {
    color: var(--league-text-muted);
    font-size: 0.78rem;
}

.league-mobile-played,
.league-mobile-diff {
    min-width: 1.8rem;
    text-align: center;
}

.league-mobile-form {
    display: inline-flex;
    gap: 0.25rem;
}

.league-mobile-chevron {
    color: rgba(242, 242, 239, 0.72);
    font-size: 1.2rem;
}

.league-select-field-compact {
    min-width: 220px;
}

.league-stats-grid,
.league-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.league-fixtures-list,
.league-stats-grid,
.league-info-grid {
    align-items: stretch;
}

.league-matchday-card,
.league-stat-card,
.league-info-grid .card,
.league-profile-card,
.league-tree-card {
    border: 1px solid rgba(214, 162, 30, 0.18);
    border-radius: 16px;
    background: radial-gradient(circle at 18% 0%, rgba(214, 162, 30, 0.07), transparent 30%), linear-gradient(135deg, rgba(19, 24, 21, 0.9), rgba(9, 12, 11, 0.88));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.league-matchday-card {
    overflow: hidden;
    padding: 1rem;
}

.league-matchday-card.is-next {
    border-color: rgba(214, 162, 30, 0.38);
}

.league-matchday-head {
    margin: -0.2rem -0.2rem 1rem;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    gap: 1rem;
    border: 1px solid rgba(214, 162, 30, 0.16);
    background: linear-gradient(135deg, rgba(214, 162, 30, 0.13), rgba(255, 255, 255, 0.035));
    color: #f5d98f;
}

.league-matchday-head h4,
.league-stat-card h4,
.league-info-grid h4 {
    margin: 0;
    color: #f5d98f;
    letter-spacing: 0.02em;
    text-align: center;
}

.league-match-row {
    border-radius: 10px;
    border: 1px solid transparent;
}

.league-match-row:nth-child(even) {
    background: rgba(255, 255, 255, 0.035);
}

.league-match-row.is-own-match {
    border-color: rgba(47, 191, 113, 0.24);
    background: rgba(35, 95, 48, 0.2);
}

.league-match-score-btn,
.league-fixture-arrow {
    border-color: rgba(214, 162, 30, 0.2);
    background: rgba(214, 162, 30, 0.08);
    color: #f2d58b;
}

.league-match-score-btn:hover,
.league-fixture-arrow:hover:not(:disabled) {
    border-color: rgba(214, 162, 30, 0.48);
    background: rgba(214, 162, 30, 0.14);
    color: #ffe7a1;
}

.league-fixture-current {
    color: var(--league-text-muted);
}

.league-stat-summary-card {
    border: 1px solid rgba(214, 162, 30, 0.16);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025));
}

.league-stat-summary-card span:not(.league-summary-icon),
.league-info-line,
.league-profile-row span,
.league-tree-label span {
    color: var(--league-text-muted);
}

.league-stat-summary-card strong,
.league-profile-row strong,
.league-tree-label strong {
    color: var(--league-text-main);
}

.league-info-line {
    border-color: rgba(214, 162, 30, 0.12);
    background: rgba(255, 255, 255, 0.035);
}

.league-profile-row {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.league-tree-tier.is-selected {
    background: rgba(35, 95, 48, 0.28);
    outline-color: rgba(47, 191, 113, 0.34);
}

.league-tree-box {
    border-color: rgba(242, 242, 239, 0.72);
    background: rgba(255, 255, 255, 0.04);
}

.league-tree-tier.is-selected .league-tree-box,
.league-tree-tier.is-selected .league-tree-label strong,
.league-tree-tier.is-selected .league-tree-infinity {
    color: #77d99f;
    border-color: #77d99f;
}

@media (max-width: 1180px) {
    .league-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .league-my-button {
        grid-column: 1 / -1;
    }

    .league-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .league-stats-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .league-page {
        gap: 0.75rem;
    }

    .league-hero {
        min-height: 232px;
        padding: 1.75rem 1.1rem 3rem;
        border-radius: 0;
    }

    .league-title {
        font-size: 2.08rem;
    }

    .league-subtitle {
        max-width: 23rem;
        margin-left: auto;
        margin-right: auto;
        line-height: 1.35;
    }

    .league-hero-pills {
        display: none;
    }

    .league-hero-banner {
        top: 12%;
        width: 150px;
        height: 70%;
        opacity: 0.9;
    }

    .league-hero-banner-left {
        left: -32px;
    }

    .league-hero-banner-right {
        right: -32px;
    }

    .league-hero-trophy {
        left: 8%;
        bottom: 1rem;
        width: 200px;
        opacity: 0.82;
    }

    .league-toolbar {
        width: calc(100% - 1.2rem);
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.8rem;
        margin-top: 0.8rem;
        padding: 1rem;
        border-radius: 14px;
    }

    .league-my-button {
        grid-column: 1 / -1;
    }

    .league-tabs {
        overflow-x: auto;
        padding-bottom: 0.15rem;
    }

    .league-tabs>.tab-btn {
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.035);
    }

    .league-tabs>.tab-btn.active {
        border-color: rgba(214, 162, 30, 0.45);
    }

    .league-table-head {
        flex-direction: column;
        align-items: stretch;
    }

    .league-content-card {
        padding: 0.75rem;
        border-radius: 16px;
    }

    .league-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }

    .league-stats-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }

    .league-summary-card,
    .league-stat-summary-card {
        grid-template-columns: auto minmax(0, 1fr);
        padding: 0.85rem;
    }

    .league-summary-icon {
        width: 34px;
        height: 34px;
    }

    .league-standings-desktop {
        display: none;
    }

    .league-standings-mobile {
        display: grid;
        overflow: hidden;
        border: 1px solid rgba(255, 255, 255, 0.09);
        border-radius: 12px;
        background: rgba(3, 5, 5, 0.24);
    }

    .league-mobile-row {
        grid-template-columns: 1.7rem minmax(0, 1fr) auto auto auto auto 0.8rem;
        gap: 0.55rem;
    }

    .league-mobile-header {
        grid-template-columns: 1.7rem minmax(0, 1fr) auto auto auto auto 0.8rem;
        gap: 0.55rem;
    }

    .league-mobile-form {
        grid-column: 3 / 7;
        justify-self: end;
    }

    .league-mobile-chevron {
        grid-column: 7;
        grid-row: 1 / 3;
    }

    .league-stats-grid,
    .league-info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 460px) {

    .league-toolbar,
    .league-summary-grid,
    .league-stats-summary {
        grid-template-columns: 1fr;
    }

    .league-mobile-row {
        grid-template-columns: 1.4rem minmax(0, 1fr) 1.65rem 2rem 2rem;
        gap: 0.4rem;
        padding-inline: 0.65rem;
    }

    .league-mobile-header {
        grid-template-columns: 1.4rem minmax(0, 1fr) 1.65rem 2rem 2rem;
        gap: 0.4rem;
        padding-inline: 0.65rem;
    }

    .league-mobile-header span:nth-child(6),
    .league-mobile-header span:nth-child(7),
    .league-mobile-form,
    .league-mobile-chevron,
    .league-mobile-points span {
        display: none;
    }

    .league-mobile-team .league-team-logo {
        width: 1.55rem;
        height: 1.55rem;
    }

    .league-mobile-team .league-team-cell {
        gap: 0.4rem;
    }

    .league-mobile-points {
        justify-items: center;
    }
}
