/* Leagues Page Styles */

/* Override default section padding - must be more specific than section selector */
section.leagues-section {
    padding-top: 48px !important;
    padding-bottom: 48px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Also add padding to container as backup */
.leagues-section > .container {
    padding-top: 48px;
    padding-bottom: 48px;
}

.leagues-info {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 40px;
    color: var(--color-white);
}

.leagues-info h2 {
    color: var(--color-white);
    margin-bottom: 15px;
    font-size: 28px;
    font-weight: 600;
}

.leagues-info p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 0;
}

.leagues-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    width: 100%;
    overflow: visible; /* allow card shadows (Select League, Match List) to show */
}

.leagues-sidebar-wrapper {
    display: flex;
    flex-direction: column;
    gap: 30px;
    flex: 0 0 300px;
    min-width: 300px;
    max-width: 300px;
    font-size: 14px;
    overflow-anchor: none; /* Prevent scroll anchoring */
    overflow: visible; /* allow shadows from sidebar and match-list to show */
    width: 300px;
}

/* White rounded shape from pseudo-element so no sharp corner shows */
.leagues-sidebar {
    background: transparent;
    border-radius: 12px;
    padding: 10px;
    max-height: none;
    overflow: visible; /* allow shadow to show (was hidden, which clipped it) */
    transition: max-height 0.4s ease;
    position: relative;
    overflow-anchor: none;
    contain: none; /* allow shadow to paint outside */
}
.leagues-sidebar::before {
    content: "";
    position: absolute;
    inset: -1px;
    background: var(--color-white);
    border-radius: 13px;
    /* Match Top Streaks; slightly stronger so shadow is visible (no clipping) */
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
    z-index: 0;
    pointer-events: none;
}
.leagues-sidebar .league-sidebar-header,
.leagues-sidebar .league-list,
.leagues-sidebar .text-center.mt-3 {
    position: relative;
    z-index: 1;
}

.leagues-sidebar .league-sidebar-header {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-primary);
    font-size: 20px;
    text-align: center;
}

.leagues-sidebar.collapsed {
    max-height: var(--collapsed-height, 500px);
    overflow: visible; /* keep shadow visible; .league-list clips content */
    position: relative;
    display: flex;
    flex-direction: column;
}

.leagues-sidebar.collapsed .league-list {
    flex: 1;
    overflow: hidden;
    max-height: none;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.league-list::-webkit-scrollbar {
    display: none;
}

/* Ensure button container is always visible */
.leagues-sidebar .text-center.mt-3 {
    flex-shrink: 0;
    margin-top: 12px !important;
    visibility: visible !important;
    display: block !important;
}

.leagues-sidebar .text-center {
    visibility: visible !important;
    display: block !important;
    position: relative;
    z-index: 10;
}

.leagues-sidebar.collapsed .show-all-leagues-btn {
    position: relative;
    z-index: 10;
    visibility: visible !important;
    display: inline-block !important;
    opacity: 1 !important;
}

.show-all-leagues-btn {
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    background: transparent;
}

.show-all-leagues-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background: var(--color-primary);
    color: var(--color-white);
}

.show-all-leagues-btn i {
    transition: transform 0.3s ease;
    display: inline-block;
}

.show-all-leagues-btn.expanded i {
    transform: rotate(180deg);
}

/* Match List Section: same rounded card + visible shadow as Select League (no sharp corner) */
.match-list-section {
    background: transparent;
    border-radius: 12px;
    padding: 10px;
    position: relative;
    overflow: visible;
    contain: none;
}
.match-list-section::before {
    content: "";
    position: absolute;
    inset: -1px;
    background: var(--color-white);
    border-radius: 13px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
    z-index: 0;
    pointer-events: none;
}
.match-list-section .match-list-header,
.match-list-section .round-navigation-control,
.match-list-section .match-list-container {
    position: relative;
    z-index: 1;
}

.match-list-header {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-primary);
    font-size: 20px;
    text-align: center;
}

.leagues-content {
    flex: 1;
}


.league-list {
    padding-left: 0;
    list-style: none;
    margin: 0;
    font-size: 12px;
    overflow: hidden;
}

.league-list li {
    margin-bottom: 0;
}

.league-link {
    display: block;
    padding: 10px 15px;
    color: var(--color-primary);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer !important;
}

/* Ensure pointer cursor on nested elements inside clickable league links */
.leagues-sidebar .league-link * {
    cursor: pointer !important;
}

/* Some browsers can keep arrow cursor over <li>/<div> children; enforce pointer */
.leagues-sidebar .league-list li,
.leagues-sidebar .league-list li * {
    cursor: pointer !important;
}

/* Round select (custom) should always show pointer over its inner text/icon */
.custom-round-select-wrapper,
.custom-round-select-wrapper * ,
.custom-round-select,
.custom-round-select * {
    cursor: pointer !important;
}

.custom-round-select-option,
.custom-round-select-option * {
    cursor: pointer !important;
}

/* Preserve disabled cursor for prev/next buttons */
.round-nav-btn:disabled {
    cursor: not-allowed !important;
}

/* Prev/Next round buttons: pointer even on inner icon */
.round-nav-btn,
.round-nav-btn * {
    cursor: pointer !important;
}

/* Keep disabled state consistent even on inner elements */
.round-nav-btn:disabled,
.round-nav-btn:disabled * {
    cursor: not-allowed !important;
}

.league-flag {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.league-link:hover {
    background: rgba(13, 27, 42, 0.1);
    color: var(--color-secondary);
}

.league-link.active {
    background: var(--color-primary);
    color: var(--color-white);
}

.league-table-section {
    background: var(--color-white);
    border-radius: 12px;
    padding: 0px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    width: 100%;
    box-sizing: border-box;
}

/* Leagues page: league table section padding on all sides */
.leagues-section .league-table-section {
    padding: 20px;
}

/* Home league section: wrapper (section[4]/div/div[2]) */
#league-section .league-table-section {
    padding: 15px 30px;
}

/* Home league section: inner cards – one class; !important so padding/margin show in computed */
#league-section .league-summary-card {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 0 24px 0 !important;
}

/* League table headers inside summary cards: no margin-bottom */
#league-section .league-summary-card .league-table-header {
    margin-bottom: 0;
}

/* League table header layout: left block (flag+name, country) | right (goals) */
#league-section .league-table-header-layout {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

#league-section .league-table-header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

#league-section .league-table-header-left .d-flex {
    flex-shrink: 0;
}

#league-section .league-table-header-country {
    color: var(--color-secondary);
    font-size: 14px;
}

/* Goals Per Match in league summary header – right-aligned */
#league-section .league-header-goals-per-match {
    text-align: right;
    font-size: 14px;
    color: var(--color-secondary);
    flex-shrink: 0;
    margin-left: auto;
}

.league-table-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #dee2e6;
}

/* Top Leagues: same horizontal line under last team row as under header (all cells including sticky) */
#league-section .league-standings-table tbody tr:last-child td,
.leagues-section .league-standings-table tbody tr:last-child td {
    border-bottom: 2px solid var(--color-primary) !important;
}

/* Segmented Control Style for Table/Goal Switch */
.league-view-switch {
    display: inline-flex;
    background: #e8e8e8;
    border-radius: 8px;
    padding: 3px;
    position: relative;
    width: fit-content;
}

.league-view-switch-btn {
    padding: 10px 28px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    color: #666;
    position: relative;
    z-index: 2;
}

.league-view-switch-indicator {
    position: absolute;
    top: 3px;
    left: 3px;
    width: calc(50% - 3px);
    height: calc(100% - 6px);
    background: white;
    border-radius: 6px;
    transition: all 0.3s;
    z-index: 1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.league-view-switch .league-view-switch-btn.active {
    color: #3498db;
}

.league-view-switch .league-view-switch-btn:not(.active) {
    color: #666;
}

/* Move indicator when Goal is active */
.league-view-switch.goal-active .league-view-switch-indicator {
    transform: translateX(100%);
}

.league-view-switch.goal-active .league-view-switch-btn:last-child {
    color: #3498db;
}

.league-view-switch:not(.goal-active) .league-view-switch-btn:first-child {
    color: #3498db;
}

.league-table-header h3 {
    color: var(--color-primary);
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

.league-table-header-flag {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.league-table-header p {
    color: var(--color-secondary);
    margin: 0;
    font-size: 14px;
}

.league-goals-table {
    width: 100%;
}

.table.league-goals-table thead th,
.league-goals-table.table thead th {
    font-weight: 600;
    vertical-align: middle;
    border: 1px solid #dee2e6;
    font-size: 12px;
    white-space: nowrap;
    padding: 6px 4px !important;
}

.table.league-goals-table tbody td,
.league-goals-table.table tbody td {
    vertical-align: middle;
    border: 1px solid #dee2e6;
    font-size: 13px;
    padding: 6px 4px !important;
}

/* Position Box Style for Goal View - Smaller dimensions */
.league-goals-table tbody td.position-box-cell {
    padding: 4px 6px !important;
    text-align: center;
    vertical-align: middle;
}

.league-goals-table tbody td.position-box-cell .position-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    clip-path: polygon(0 0, 100% 0, 100% 80%, 80% 100%, 0 100%);
    border-radius: 0;
    padding: 0;
    margin: 0 auto;
    vertical-align: middle;
    font-size: 10px;
}

.league-goals-table tbody td.position-box-cell[style*="background-color"] {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    clip-path: polygon(0 0, 100% 0, 100% 80%, 80% 100%, 0 100%) !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 auto;
    vertical-align: middle;
    font-size: 11px !important;
}

/* Goal View Tabs - Left Aligned */
.goal-view-tabs {
    justify-content: flex-start !important;
    margin: 0 !important;
}

/* Goal Tabs Container - Side by Side, Centered */
.goal-tabs-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

@media (max-width: 768px) {
    .leagues-container {
        flex-direction: column;
    }
    
    .leagues-sidebar-wrapper {
        flex: 1;
        width: 100%;
    }
    
    .leagues-sidebar {
        flex: 1;
        max-height: none;
    }
    
    .match-list-section {
        margin-top: 20px;
    }
    
    section.leagues-section {
        padding-top: 48px !important;
        padding-bottom: 48px !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    .leagues-section > .container {
        padding-top: 48px;
        padding-bottom: 48px;
    }
}

/* Home page League section (section[4]): no .py-5, only bottom padding in px */
#league-section,
.league-section {
    padding-top: 0;
    padding-bottom: 48px;
}

/* Home page League section (section[4]): same table styling as leagues page. Scoped to .league-section so match schedule .team-logo is not affected. */
.league-section .league-standings-table {
    margin-bottom: 0;
    font-size: 13px;
    table-layout: fixed;
    width: 100%;
}

/* Table: never compress – scroll horizontally when container is narrow */
#league-section .table-responsive,
.leagues-section .table-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}
/* Top Leagues: fills container; min 598px for home (team 148px), 530px for leagues page – scrolls when narrower */
#league-section .league-standings-table {
    width: 100% !important;
    min-width: 598px !important;
    table-layout: fixed !important;
}
.leagues-section .league-standings-table {
    width: 100% !important;
    min-width: 530px !important;
    table-layout: fixed !important;
}

/* Col: Pos + stats = fixed px (never shrink); Team = auto (takes remainder, only one that shrinks) */
#league-section .league-standings-table col:nth-child(1),
.leagues-section .league-standings-table col:nth-child(1) { width: 30px !important; }
#league-section .league-standings-table col:nth-child(2),
.leagues-section .league-standings-table col:nth-child(2) { width: auto !important; }
#league-section .league-standings-table col:nth-child(3),
#league-section .league-standings-table col:nth-child(4),
#league-section .league-standings-table col:nth-child(5),
#league-section .league-standings-table col:nth-child(3),
#league-section .league-standings-table col:nth-child(4),
#league-section .league-standings-table col:nth-child(5),
#league-section .league-standings-table col:nth-child(6),
.leagues-section .league-standings-table col:nth-child(3),
.leagues-section .league-standings-table col:nth-child(4),
.leagues-section .league-standings-table col:nth-child(5),
.leagues-section .league-standings-table col:nth-child(6) { width: 32px !important; }
#league-section .league-standings-table col:nth-child(7),
#league-section .league-standings-table col:nth-child(8),
#league-section .league-standings-table col:nth-child(9),
#league-section .league-standings-table col:nth-child(10),
.leagues-section .league-standings-table col:nth-child(7),
.leagues-section .league-standings-table col:nth-child(8),
.leagues-section .league-standings-table col:nth-child(9),
.leagues-section .league-standings-table col:nth-child(10) { width: 38px !important; }
#league-section .league-standings-table col:nth-child(11),
.leagues-section .league-standings-table col:nth-child(11) { width: 140px !important; }

/* Pos + P,W,D,L,GF,GA,GD,Pts,Form: fixed px – NEVER shrink */
#league-section .league-standings-table thead th:nth-child(1),
.leagues-section .league-standings-table thead th:nth-child(1)  { width: 30px !important; min-width: 30px !important; max-width: 30px !important; }
#league-section .league-standings-table thead th:nth-child(2),
.leagues-section .league-standings-table thead th:nth-child(2)  { width: auto !important; min-width: 80px !important; }
#league-section .league-standings-table thead th:nth-child(3),
#league-section .league-standings-table thead th:nth-child(4),
#league-section .league-standings-table thead th:nth-child(5),
#league-section .league-standings-table thead th:nth-child(6),
.leagues-section .league-standings-table thead th:nth-child(3),
.leagues-section .league-standings-table thead th:nth-child(4),
.leagues-section .league-standings-table thead th:nth-child(5),
.leagues-section .league-standings-table thead th:nth-child(6)  { width: 32px !important; min-width: 32px !important; max-width: 32px !important; }
#league-section .league-standings-table thead th:nth-child(7),
#league-section .league-standings-table thead th:nth-child(8),
#league-section .league-standings-table thead th:nth-child(9),
#league-section .league-standings-table thead th:nth-child(10),
.leagues-section .league-standings-table thead th:nth-child(7),
.leagues-section .league-standings-table thead th:nth-child(8),
.leagues-section .league-standings-table thead th:nth-child(9),
.leagues-section .league-standings-table thead th:nth-child(10) { width: 38px !important; min-width: 38px !important; max-width: 38px !important; }
#league-section .league-standings-table thead th:nth-child(11),
#league-section .league-standings-table tbody td:nth-child(11),
.leagues-section .league-standings-table thead th:nth-child(11),
.leagues-section .league-standings-table tbody td:nth-child(11) {
    width: 140px !important;
    min-width: 140px !important;
    max-width: 140px !important;
}

#league-section .league-standings-table tbody td:nth-child(1),
.leagues-section .league-standings-table tbody td:nth-child(1)  { width: 30px !important; min-width: 30px !important; max-width: 30px !important; }
#league-section .league-standings-table tbody td:nth-child(2),
.leagues-section .league-standings-table tbody td:nth-child(2)  { width: auto !important; min-width: 80px !important; }
#league-section .league-standings-table tbody td:nth-child(3),
#league-section .league-standings-table tbody td:nth-child(4),
#league-section .league-standings-table tbody td:nth-child(5),
#league-section .league-standings-table tbody td:nth-child(6),
.leagues-section .league-standings-table tbody td:nth-child(3),
.leagues-section .league-standings-table tbody td:nth-child(4),
.leagues-section .league-standings-table tbody td:nth-child(5),
.leagues-section .league-standings-table tbody td:nth-child(6)  { width: 32px !important; min-width: 32px !important; max-width: 32px !important; }
#league-section .league-standings-table tbody td:nth-child(7),
#league-section .league-standings-table tbody td:nth-child(8),
#league-section .league-standings-table tbody td:nth-child(9),
#league-section .league-standings-table tbody td:nth-child(10),
.leagues-section .league-standings-table tbody td:nth-child(7),
.leagues-section .league-standings-table tbody td:nth-child(8),
.leagues-section .league-standings-table tbody td:nth-child(9),
.leagues-section .league-standings-table tbody td:nth-child(10) { width: 38px !important; min-width: 38px !important; max-width: 38px !important; }

/* Home Top Leagues: Team cell – only column that shrinks; takes remainder, min 148px (team name 110px); 5px gap + 5px divider */
body section#league-section .league-standings-table tbody td.league-summary-team-cell {
    width: auto !important;
    min-width: 148px !important;
    box-sizing: border-box !important;
    padding-left: 0 !important;
    padding-right: 10px !important;
    overflow: hidden !important;
    overflow-x: clip !important;
}

/* Pos: fixed – never shrinks; sticky on horizontal scroll */
#league-section .league-standings-table thead th:nth-child(1),
#league-section .league-standings-table tbody td:nth-child(1),
.leagues-section .league-standings-table thead th:nth-child(1),
.leagues-section .league-standings-table tbody td:nth-child(1) {
    width: 30px !important;
    min-width: 30px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    overflow: hidden !important;
    overflow-x: clip !important;
    position: sticky !important;
    left: 0 !important;
    z-index: 2 !important;
    background-color: #fff !important;
    border-bottom: 1px solid #dee2e6 !important;
}
#league-section .league-standings-table thead th:nth-child(1),
.leagues-section .league-standings-table thead th:nth-child(1) {
    z-index: 4 !important;
    background-color: #f8f9fa !important;
    border-bottom: 2px solid #dee2e6 !important;
}
/* Team: auto – only column that shrinks; takes remainder; sticky on horizontal scroll; 5px reserved for divider at right */
#league-section .league-standings-table thead th:nth-child(2),
#league-section .league-standings-table tbody td:nth-child(2),
.leagues-section .league-standings-table thead th:nth-child(2),
.leagues-section .league-standings-table tbody td:nth-child(2) {
    width: auto !important;
    min-width: 80px !important;
    padding-left: 0 !important;
    padding-right: 10px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    overflow-x: clip !important;
    position: sticky !important;
    left: 30px !important;
    z-index: 3 !important;
    background-color: #fff !important;
}
#league-section .league-standings-table thead th:nth-child(2),
.leagues-section .league-standings-table thead th:nth-child(2) {
    z-index: 5 !important;
    background-color: #f8f9fa !important;
    border-bottom: 2px solid #dee2e6 !important;
}
#league-section .league-standings-table tbody td:nth-child(2),
.leagues-section .league-standings-table tbody td:nth-child(2) {
    border-bottom: 1px solid #dee2e6 !important;
}
/* Last row: full 2px primary line – use box-shadow on row so line spans full width and is not clipped */
#league-section .league-standings-table tbody tr:last-child,
.leagues-section .league-standings-table tbody tr:last-child {
    box-shadow: inset 0 -2px 0 0 var(--color-primary);
}
#league-section .league-standings-table tbody tr:last-child td:nth-child(1),
#league-section .league-standings-table tbody tr:last-child td:nth-child(2),
.leagues-section .league-standings-table tbody tr:last-child td:nth-child(1),
.leagues-section .league-standings-table tbody tr:last-child td:nth-child(2) {
    border-bottom: 2px solid var(--color-primary) !important;
}
/* Team cell: flex must stay within bounds – no overflow into Pos */
#league-section .league-standings-table tbody td:nth-child(2) .d-flex,
.leagues-section .league-standings-table tbody td:nth-child(2) .d-flex {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
}
/* Team name: ellipsis when long; logo stays fixed via flex-shrink: 0 */
#league-section .league-standings-table tbody td:nth-child(2) .d-flex span,
.leagues-section .league-standings-table tbody td:nth-child(2) .d-flex span {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}
#league-section .league-standings-table tbody td:nth-child(2) .me-2,
.leagues-section .league-standings-table tbody td:nth-child(2) .me-2 {
    margin-right: 4px !important; /* gap between logo and name on all scales */
}

/* Sticky divider: 5px from team cell (rightmost), line + shadow */
#league-section .league-standings-table thead th:nth-child(2)::after,
#league-section .league-standings-table tbody td:nth-child(2)::after {
    content: "";
    display: none;
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: linear-gradient(to right, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.00) 100%);
    box-shadow: 4px 0 14px -2px rgba(0,0,0,0.42), 8px 0 22px -4px rgba(0,0,0,0.28);
    pointer-events: none;
}
/* Allow shadow to extend – team cell clips shadow by default */
#league-section .league-standings-scroll-wrap.has-horizontal-scroll .league-standings-table thead th:nth-child(2),
#league-section .league-standings-scroll-wrap.has-horizontal-scroll .league-standings-table tbody td:nth-child(2) {
    overflow-x: visible !important;
}
#league-section .league-standings-scroll-wrap.has-horizontal-scroll .league-standings-table thead th:nth-child(2)::after,
#league-section .league-standings-scroll-wrap.has-horizontal-scroll .league-standings-table tbody td:nth-child(2)::after {
    display: block;
}

/* Leagues page only: same team cell behavior as home Top Leagues (min-width, overflow for divider) */
.leagues-section .league-standings-table tbody td.league-summary-team-cell {
    width: auto !important;
    min-width: 148px !important;
    box-sizing: border-box !important;
    padding-left: 0 !important;
    padding-right: 10px !important;
    overflow: hidden !important;
    overflow-x: clip !important;
}

/* Leagues page only: same sticky divider as home Top Leagues when table has horizontal scroll */
.leagues-section .league-standings-table thead th:nth-child(2)::after,
.leagues-section .league-standings-table tbody td:nth-child(2)::after {
    content: "";
    display: none;
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: linear-gradient(to right, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.00) 100%);
    box-shadow: 4px 0 14px -2px rgba(0,0,0,0.42), 8px 0 22px -4px rgba(0,0,0,0.28);
    pointer-events: none;
}
.leagues-section .league-standings-scroll-wrap.has-horizontal-scroll .league-standings-table thead th:nth-child(2),
.leagues-section .league-standings-scroll-wrap.has-horizontal-scroll .league-standings-table tbody td:nth-child(2) {
    overflow-x: visible !important;
}
.leagues-section .league-standings-scroll-wrap.has-horizontal-scroll .league-standings-table thead th:nth-child(2)::after,
.leagues-section .league-standings-scroll-wrap.has-horizontal-scroll .league-standings-table tbody td:nth-child(2)::after {
    display: block;
}

/* Show divider on small viewports even without JS (table scrolls at narrow widths) */
@media (max-width: 991px) {
    .leagues-section .league-standings-table thead th:nth-child(2),
    .leagues-section .league-standings-table tbody td:nth-child(2) {
        overflow-x: visible !important;
    }
    .leagues-section .league-standings-table thead th:nth-child(2)::after,
    .leagues-section .league-standings-table tbody td:nth-child(2)::after {
        display: block;
    }
}

/* P, W, D, L, GF, GA, GD, Pts, Form: no horizontal padding – same as original */
#league-section .league-standings-table thead th:nth-child(n+3),
#league-section .league-standings-table tbody td:nth-child(n+3),
.leagues-section .league-standings-table thead th:nth-child(n+3),
.leagues-section .league-standings-table tbody td:nth-child(n+3) {
    padding-left: 0 !important;
    padding-right: 0 !important;
}
/* P column: add gap from divider line */
#league-section .league-standings-table thead th:nth-child(3),
#league-section .league-standings-table tbody td:nth-child(3) {
    padding-left: 5px !important;
}

/* Team logos in home page league summary tables - ID + column so it always applies */
#league-section .league-standings-table tbody td:nth-child(2) img,
.leagues-section .league-standings-table tbody td:nth-child(2) img {
    margin-left: 8px;
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    max-width: 24px !important;
    max-height: 24px !important;
    object-fit: contain;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
    box-sizing: border-box;
}
#league-section .league-standings-table tbody td div img.league-summary-team-logo,
#league-section .league-standings-table tbody td div img[class*="league-summary-team-logo"],
#league-section .league-standings-table tbody td img.league-summary-team-logo,
#league-section img.league-summary-team-logo,
.league-section .league-standings-table tbody td img.league-summary-team-logo,
.league-section .league-standings-table tbody td .league-summary-team-logo,
.league-section .league-summary-team-logo,
.league-section .league-table-team-logo {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    max-width: 24px !important;
    max-height: 24px !important;
    object-fit: contain;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
    box-sizing: border-box;
}
.league-section .league-standings-table tbody td.position-box-cell {
    padding: 6px 6px !important;
    text-align: center;
    vertical-align: middle;
}
/* Pos cell: 0 horizontal padding so 28px position-box fits in 30px col */
#league-section .league-standings-table tbody td.position-box-cell,
.leagues-section .league-standings-table tbody td.position-box-cell {
    padding-left: 0 !important;
    padding-right: 0 !important;
}
.league-section .league-standings-table tbody td.position-box-cell .position-box,
.leagues-section .league-standings-table tbody td.position-box-cell .position-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    clip-path: polygon(0 0, 100% 0, 100% 80%, 80% 100%, 0 100%);
    border-radius: 0;
}
.league-section .table.league-standings-table thead th,
.league-section .league-standings-table.table thead th {
    font-weight: 600;
    font-size: 13px;
    padding: 8px 8px !important;
    border-bottom: 2px solid #dee2e6;
    background-color: #f8f9fa;
}
.league-section .table.league-standings-table tbody td,
.league-section .league-standings-table.table tbody td {
    padding: 6px 8px !important;
    vertical-align: middle;
    line-height: 1.35;
}
/* Pos & Team cells: 0 horizontal padding so width stays exactly 30px/178px – beats general rule & match-detail.css */
body section#league-section .league-standings-table tbody td:nth-child(1),
body section#league-section .league-standings-table tbody td:nth-child(2),
body .leagues-section .league-standings-table tbody td:nth-child(1),
body .leagues-section .league-standings-table tbody td:nth-child(2) {
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding: 6px 0 !important; /* full shorthand so no other rule can add horizontal padding */
}
.league-section .league-standings-row:hover {
    background-color: #f8f9fa;
}
.league-section .league-standings-row:hover td:nth-child(1),
.league-section .league-standings-row:hover td:nth-child(2) {
    background-color: #f8f9fa !important;
}
.league-section .league-standings-table .form-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-weight: bold;
    font-size: 11px;
    color: white;
    margin: 0 1px;
    border: none;
}
.league-section .league-standings-table .form-box.form-win {
    background-color: #10b981;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}
.league-section .league-standings-table .form-box.form-draw {
    background-color: #9ca3af;
    box-shadow: 0 2px 4px rgba(156, 163, 175, 0.3);
}
.league-section .league-standings-table .form-box.form-loss {
    background-color: #dc2626;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.3);
}

/* Fluid team logos in home league section - highest specificity (matches /html/body/section[4]/.../td[2]/div/img) */
body section#league-section .league-standings-table tbody td:nth-child(2) div img {
    margin-left: 8px;
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    max-width: 24px !important;
    max-height: 24px !important;
    object-fit: contain;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
    box-sizing: border-box;
}

/* ============================================
   TOP LEAGUES – Responsive: avoid overlap
   Content reflows or scrolls instead of compressing.
   ============================================ */

/* Tablet and below: header can wrap; reduce padding */
@media (max-width: 767.98px) {
    #league-section .league-table-section {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
    
    /* League header: layout wraps; goals stays right-aligned via margin-left: auto */
    #league-section .league-table-header-layout {
        gap: 8px;
    }
    
    /* Keep table row height stable – fixed font and padding */
    #league-section .league-standings-table,
    .leagues-section .league-standings-table {
        font-size: 13px !important;
    }
    #league-section .league-standings-table thead th,
    .leagues-section .league-standings-table thead th {
        font-size: 13px !important;
        padding: 8px 8px !important;
    }
    #league-section .league-standings-table tbody td,
    .leagues-section .league-standings-table tbody td {
        padding: 6px 8px !important;
    }
    
}

/* Wrapper for div-based sticky divider – home section only */
#league-section .league-standings-scroll-inner {
    min-width: 598px;
}

/* Phone: stack header; smaller padding; table scrolls */
@media (max-width: 575.98px) {
    #league-section .league-table-section {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
    
    /* League header: stack – row 1: flag+league name, row 2: country, row 3: goals (left-aligned) */
    #league-section .league-table-header-layout {
        flex-direction: column !important;
        gap: 6px;
    }
    
    #league-section .league-header-goals-per-match {
        align-self: flex-start;
        margin-left: 0;
        text-align: left !important;
    }
    
    /* Table: overflow for touch scroll when needed; fluid columns scale proportionally (no fixed 520px) */
    #league-section .table-responsive {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }
    
    /* League cards: keep minimum gap so they don't crowd */
    #league-section .league-summary-card {
        margin-bottom: 20px !important;
    }
}

/* Small phone: tighter padding but never below 8px */
@media (max-width: 374px) {
    #league-section .league-table-section {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
}

