/* Home, Results and Fixtures: borrow space from the empty ad rail for badges. */
@media (min-width: 1026px) {
    .home-score-layout > .left-sidebar {
        flex: 0 1 168px !important;
        min-width: 0;
    }

    .home-score-layout > .main-content {
        /* Let the empty rail shrink further on smaller laptops. */
        flex: 1 0 724px;
    }

    .home-score-layout > .right-sidebar {
        flex-shrink: 1 !important;
        min-width: 0;
    }
}

/* Results has six columns; Fixtures has four. Keep their shares independent of Home. */
.home-score-layout .match-table.results thead th:nth-child(1) { width: 8% !important; }
.home-score-layout .match-table.results thead th:nth-child(2),
.home-score-layout .match-table.results thead th:nth-child(4) { width: 32% !important; }
.home-score-layout .match-table.results thead th:nth-child(3),
.home-score-layout .match-table.results thead th:nth-child(5) { width: 9% !important; }
.home-score-layout .match-table.results thead th:nth-child(6) { width: 10% !important; }
.home-score-layout .match-table.results tbody td { width: auto !important; }
.home-score-layout .match-table.results td.col-score { color: var(--match-odd); }
.home-score-layout .match-table.results td.col-score,
.home-score-layout .match-table.results td.col-ht,
.home-score-layout .match-table.results td.col-tc { text-align: center; }
.home-score-layout .match-table.upcoming thead th:nth-child(1) { width: 8% !important; }
.home-score-layout .match-table.upcoming thead th:nth-child(2) { width: 40% !important; }
.home-score-layout .match-table.upcoming thead th:nth-child(3) { width: 10% !important; }
.home-score-layout .match-table.upcoming thead th:nth-child(4) { width: 42% !important; }

@media (max-width: 768px) {
    .home-score-layout .match-table.results thead th:nth-child(1),
    .home-score-layout .match-table.results thead th:nth-child(3),
    .home-score-layout .match-table.results thead th:nth-child(5),
    .home-score-layout .match-table.results thead th:nth-child(6) { width: 11% !important; }
    .home-score-layout .match-table.results thead th:nth-child(2),
    .home-score-layout .match-table.results thead th:nth-child(4) { width: 28% !important; }
    .home-score-layout .match-table.upcoming thead th:nth-child(1),
    .home-score-layout .match-table.upcoming thead th:nth-child(3) { width: 12% !important; }
    .home-score-layout .match-table.upcoming thead th:nth-child(2),
    .home-score-layout .match-table.upcoming thead th:nth-child(4) { width: 38% !important; }
}

/* Explicit shares include padding, so the last odds column cannot be clipped. */
.home-score-layout .match-table thead th { box-sizing: border-box; }
.home-score-layout .match-table thead th:nth-child(1) { width: 6%; }
.home-score-layout .match-table thead th:nth-child(2),
.home-score-layout .match-table thead th:nth-child(4) { width: 27%; }
.home-score-layout .match-table thead th:nth-child(3) { width: 6.5%; }
.home-score-layout .match-table thead th:nth-child(5) { width: 4%; }
.home-score-layout .match-table thead th:nth-child(6),
.home-score-layout .match-table thead th:nth-child(7) { width: 5%; }
.home-score-layout .match-table thead th:nth-child(8) { width: 19.5%; }

.home-score-layout .team-line {
    display: flex;
    align-items: center;
    gap: 3px;
    min-width: 0;
}

.home-score-layout .col-home .team-line {
    justify-content: flex-end;
}

.home-score-layout .table-team {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
}

.home-score-layout .table-team__name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-score-layout .table-team__badge {
    display: block;
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.home-score-layout .team-line > .card-badge {
    flex-shrink: 0;
}

/* A quieter hierarchy: teams first, then time/score, then market details. */
.home-score-layout {
    --match-name: #243449;
    --match-meta: #64748b;
    --match-line: #e5ecf4;
    --match-header: #f8fafc;
    --match-league: #eef3f9;
    --match-hover: #edf5ff;
    --match-odd: #355b85;
    --match-handicap: #946200;
    --match-search: #fff;
}

.home-score-layout .match-table {
    box-shadow: 0 4px 16px rgba(15, 35, 60, .04);
}

.home-score-layout .match-table thead th {
    background: var(--match-header);
    color: var(--match-meta);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .025em;
    padding-top: 8px;
    padding-bottom: 8px;
}

.home-score-layout .match-table thead th:nth-child(2) {
    text-align: right;
    padding-right: 30px;
}

.home-score-layout .match-table thead th:nth-child(4) {
    text-align: left;
    padding-left: 30px;
}

.home-score-layout .match-table td.league-header {
    background: var(--match-league);
    color: var(--match-name);
    font-size: 12px;
    font-weight: 650;
    padding-top: 6px;
    padding-bottom: 6px;
    box-shadow: none;
    border-bottom-color: var(--match-line);
}

.home-score-layout .league-header .fav-toggle.is-favorite .star-icon {
    filter: none;
}

/* Keep matches equally tall when odds are missing or hidden on phones. */
.home-score-layout .match-table tbody tr.match-row {
    height: 42px;
}

.home-score-layout .match-table .match-row td {
    border-bottom-color: var(--match-line);
    vertical-align: middle;
}

.home-score-layout .match-table tbody tr.match-row:hover {
    background: var(--match-hover);
    transform: none;
    cursor: pointer;
    z-index: 1;
}

.home-score-layout .table-team__name {
    color: var(--match-name);
    font-weight: 500;
}

.home-score-layout .table-team:hover .table-team__name {
    color: var(--ole-blue);
}

.home-score-layout .table-team:focus-visible {
    outline: 2px solid #7ca7d8;
    outline-offset: 3px;
    border-radius: 3px;
}

.home-score-layout .match-table td.col-time,
.home-score-layout .match-table td.col-score,
.home-score-layout .match-table td.col-tc,
.home-score-layout .match-table td.col-ht {
    color: var(--match-meta);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    font-size: 12px;
}

.home-score-layout .col-time a { color: inherit; }
.home-score-layout .col-score { font-size: 12px; }

.home-score-layout .ScoreBox {
    box-shadow: none;
    text-shadow: none;
    border-color: transparent;
    border-radius: 4px;
    font-weight: 650;
    letter-spacing: 0;
}

.home-score-layout .tips-icon { max-height: 16px; }

.home-score-layout .match-table td.col-odds {
    border-left-color: var(--match-line);
}

.home-score-layout .match-table td.col-odds:hover {
    background: transparent;
    box-shadow: none;
}

.home-score-layout .odds-grid .pair {
    border-right-color: var(--match-line);
    padding-right: 2px;
}

.home-score-layout .odds-grid .pair:nth-child(1) .top,
.home-score-layout .odds-grid .pair:nth-child(3) .top {
    color: var(--match-odd);
    font-weight: 600;
}

.home-score-layout .odds-grid .pair:nth-child(2) .top {
    color: var(--match-handicap);
    font-weight: 600;
}

.home-score-layout .odds-grid .bot {
    color: var(--match-meta);
    font-weight: 500;
    opacity: 1;
    font-variant-numeric: tabular-nums;
}

.home-score-layout .tabs a.active {
    background: var(--ole-blue) !important;
    border-color: var(--ole-blue) !important;
}

.home-score-layout .ob-search {
    background: var(--match-search);
    border-color: var(--match-line);
    box-shadow: none;
    backdrop-filter: none;
}

.home-score-layout .ob-search:focus-within {
    border-color: #7ca7d8;
    box-shadow: 0 0 0 3px rgba(10, 78, 163, .10);
}

html[data-theme="dark"] .home-score-layout {
    --match-name: #e2eaf4;
    --match-meta: #a4b3c7;
    --match-line: #293b52;
    --match-header: #192a40;
    --match-league: #20324a;
    --match-hover: #243b57;
    --match-odd: #a5c9f5;
    --match-handicap: #e7be6f;
    --match-search: #192a40;
}

html[data-theme="dark"] .home-score-layout .table-team:hover .table-team__name {
    color: #b5d5ff;
}

html[data-theme="dark"] .home-score-layout .tabs a.active {
    background: #21578b !important;
    border-color: #21578b !important;
}

@media (max-width: 768px) {
    .home-score-layout .match-table {
        table-layout: fixed;
    }

    .home-score-layout .match-table thead th:nth-child(1) { width: 11% !important; }
    .home-score-layout .match-table thead th:nth-child(2),
    .home-score-layout .match-table thead th:nth-child(4) { width: 28% !important; }
    .home-score-layout .match-table thead th:nth-child(3) { width: 10% !important; }
    .home-score-layout .match-table thead th:nth-child(5) { width: 5% !important; }
    .home-score-layout .match-table thead th:nth-child(6),
    .home-score-layout .match-table thead th:nth-child(7) { width: 9% !important; }

    .home-score-layout .match-table thead th:nth-child(2) { padding-right: 21px; }
    .home-score-layout .match-table thead th:nth-child(4) { padding-left: 21px; }

    .home-score-layout .match-table td.col-time {
        padding-left: 3px !important;
    }

    .home-score-layout .match-table td.col-ht {
        padding-right: 2px !important;
    }

    .home-score-layout .table-team { gap: 3px; }
    .home-score-layout .table-team__badge {
        flex-basis: 16px;
        width: 16px;
        height: 16px;
    }
}
