.race-to-section {
    margin: 24px 0;
    padding: 18px 18px 12px;
    background: #0f1d2b;
    border: 1px solid rgba(100,255,218,0.18);
    border-radius: 10px;
}

.section-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: #64ffda;
    margin: 0 0 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.race-compact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(440px,1fr));
    gap: 18px;
}

.race-milestone-group {
    background: #142636;
    border: 1px solid rgba(100,255,218,0.12);
    border-radius: 8px;
    padding: 12px 14px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.milestone-title {
    font-size: .95rem;
    font-weight: 600;
    color: #64ffda;
    margin: 0 0 4px;
    text-align: center;
    letter-spacing: .5px;
}

.race-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: .82rem;
    line-height: 1.25;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 6px;
    background: #1a2f44;
}

.race-table thead th {
    padding: 6px 6px;
    text-align: center;
    font-weight: 600;
    color: #64ffda;
    background: #183245;
    font-size: .75rem;
    border-bottom: 1px solid rgba(100,255,218,0.25);
    letter-spacing: .5px;
}

.race-table thead th:first-child {
    border-top-left-radius: 6px;
}
.race-table thead th:last-child {
    border-top-right-radius: 6px;
}

.race-table tbody tr {
    transition: background .15s ease;
}

.race-table tbody td {
    padding: 6px 6px;
    text-align: center;
    color: #d2dde9;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.race-table tbody td:first-child {
    text-align: left;
    font-weight: 600;
    color: #64ffda;
    width: 48px;
}

.race-table tbody tr:nth-child(odd) td {
    background: #20394d;
}

.race-table tbody tr:nth-child(even) td {
    background: #1d3447;
}

.race-table tbody tr:hover td {
    background: #25465e;
}

.race-table tbody tr:last-child td {
    border-bottom: none;
}

.stat-value {
    font-weight: 500;
    color: #eef4f8;
}

.pct-value {
    font-weight: 600;
    font-size: .85rem;
    padding: 4px 6px;
    border-radius: 4px;
    background: rgba(255,255,255,0.06);
    min-width: 54px;
}

.away-pct {
    color: #ff8181;
    background: rgba(255,129,129,0.10);
}

.home-pct {
    color: #58d8ca;
    background: rgba(88,216,202,0.10);
}

.vs-col {
    font-weight: 700;
    color: #64ffda;
    background: #173646;
    border-radius: 4px;
    width: 30px;
}

.quarter-label {
    font-size: .78rem;
    letter-spacing: .5px;
}

@media (max-width: 1100px) {
    .race-compact-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .race-milestone-group {
        padding: 10px;
    }
    .race-table {
        font-size: .75rem;
    }
    .race-table thead th,
    .race-table tbody td {
        padding: 5px 4px;
    }
    .pct-value {
        font-size: .75rem;
        padding: 3px 4px;
        min-width: 46px;
    }
}

.h2h-wrapper {
    margin-top: 26px;
    background: #101e2c;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    padding: 18px 20px 20px;
}

.h2h-title {
    font-size: 1.15rem;
    color: #f0f6fa;
    font-weight: 600;
    margin: 0 0 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.h2h-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(380px,1fr));
    gap: 18px;
    margin-bottom: 18px;
}

.h2h-card {
    background: #162a3a;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
}

.h2h-card-header {
    padding: 10px 14px;
    font-weight: 600;
    font-size: .9rem;
    background: #1f3b53;
    color: #64ffda;
    letter-spacing: .5px;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.h2h-card-body {
    padding: 8px 10px 6px;
}

.h2h-summary-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: .78rem;
    background: #0a1823;
    border: 1px solid #1e394b;
    border-radius: 6px;
    overflow: hidden;
}

.h2h-summary-table thead th {
    background: #0d2a3a;
    color: #e9f5fa;
    font-weight: 600;
    padding: 7px 6px;
    letter-spacing: .4px;
    border-bottom: 1px solid #2c4e61;
}

.h2h-summary-table tbody td {
    padding: 7px 6px;
    font-weight: 500;
    color: #f2f7fa;
    border-bottom: 1px solid #193242;
}

.h2h-summary-table tbody tr:nth-child(odd) td {
    background: #132b3b;
}

.h2h-summary-table tbody tr:nth-child(even) td {
    background: #0f2330;
}

.h2h-summary-table tbody tr:hover td {
    background: #1d4155;
}

.h2h-summary-table tbody tr:last-child td {
    border-bottom: none;
}

/* Percentage cells */
.pct-cell {
    font-weight: 600;
    color: #ffffff;
}

.pct-win-away {
    background: rgba(255,90,90,0.22);
    color: #ffd8d8;
    border-radius: 4px;
    box-shadow: inset 0 0 0 1px rgba(255,120,120,0.35);
}

.pct-win-home {
    background: rgba(70,200,188,0.26);
    color: #e2fffb;
    border-radius: 4px;
    box-shadow: inset 0 0 0 1px rgba(70,200,188,0.40);
}

/* Edge badge */
.edge-cell {
    font-weight: 700;
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: #ffffff;
}

.edge-away {
    background: linear-gradient(135deg,#ff5a5a,#b52020);
    padding: 4px 6px;
    border-radius: 4px;
}

.edge-home {
    background: linear-gradient(135deg,#37b5a5,#1c655d);
    padding: 4px 6px;
    border-radius: 4px;
}

.edge-even {
    background: linear-gradient(135deg,#475965,#2a343b);
    padding: 4px 6px;
    border-radius: 4px;
    color: #d7e5ec;
}

/* Footnote contrast */
.h2h-footnote {
    color: #b9c9d3;
}

/* Detail tables (increase contrast similarly) */
.h2h-detail-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: .74rem;
    background: #091721;
    border: 1px solid #1d3949;
    border-radius: 6px;
    overflow: hidden;
}

.h2h-detail-table thead th {
    background: #0d2c3e;
    color: #eaf6fb;
    font-weight: 600;
    padding: 7px 6px;
    border-bottom: 1px solid #255063;
}

.h2h-detail-table tbody td {
    padding: 6px 6px;
    color: #f3f8fb;
    border-bottom: 1px solid #183544;
}

.h2h-detail-table tbody tr:nth-child(odd) td {
    background: #143042;
}

.h2h-detail-table tbody tr:nth-child(even) td {
    background: #102634;
}

.h2h-detail-table tbody tr:hover td {
    background: #1c4457;
}

.h2h-detail-table tbody tr:last-child td {
    border-bottom: none;
}

/* Responsive adjustments */
@media (max-width: 700px) {
    .h2h-summary-table, .h2h-detail-table { font-size: .70rem; }
    .h2h-summary-table thead th,
    .h2h-detail-table thead th { padding: 6px 5px; }
    .h2h-summary-table tbody td,
    .h2h-detail-table tbody td { padding: 5px 5px; }
}