.race-single-page{
    background:#f5f6f8;
    padding-bottom:40px;
}

/* =========================================================
   HERO
========================================================= */

.race-hero-media{
    position:relative;
    min-height:420px;
    background:#111 center/cover no-repeat;
}

.race-hero-overlay{
    position:absolute;
    inset:0;
    background:linear-gradient(180deg, rgba(0,0,0,.28) 0%, rgba(0,0,0,.72) 100%);
}

.race-hero-content{
    position:relative;
    z-index:2;
    padding:56px 0 42px;
    color:#fff;
}

.race-hero-meta-top{
    margin-bottom:18px;
}

.race-country{
    display:inline-flex;
    align-items:center;
    gap:10px;
    padding:10px 14px;
    background:rgba(255,255,255,.12);
    border:1px solid rgba(255,255,255,.16);
    border-radius:999px;
    backdrop-filter:blur(6px);
    font-weight:700;
}

.race-country img{
    width:26px;
    height:18px;
    object-fit:cover;
    border-radius:3px;
}

.race-title{
    margin:0 0 22px;
    font-size:44px;
    line-height:1.05;
    font-weight:900;
    letter-spacing:-1px;
    color:#fff;
}

/* =========================================================
   HERO META GRID
========================================================= */

.race-meta-grid{
    display:grid;
    grid-template-columns:repeat(4, minmax(0,1fr));
    gap:14px;
}

.race-meta-card{
    padding:16px 18px;
    border-radius:16px;
    background:rgba(255,255,255,.10);
    border:1px solid rgba(255,255,255,.14);
    backdrop-filter:blur(6px);
}

.race-meta-label{
    display:block;
    margin-bottom:8px;
    font-size:12px;
    text-transform:uppercase;
    letter-spacing:.5px;
    opacity:.84;
}

.race-meta-card strong{
    font-size:16px;
    font-weight:800;
}

.race-hero .race-meta-grid{
    display:grid;
    grid-template-columns:repeat(5, minmax(0, 1fr));
    gap:14px;
    align-items:stretch;
}

.race-hero .race-meta-card{
    min-width:0;
    padding:14px 16px;
}

.race-hero .race-meta-card strong{
    display:block;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

/* =========================================================
   MAIN CONTENT BOXES
========================================================= */

.race-main{
    margin-top:30px;
}

.race-results-section,
.race-content-section{
    margin-bottom:24px;
    padding:24px;
    background:#fff;
    border:1px solid #e8e8e8;
    border-radius:18px;
    box-shadow:0 10px 30px rgba(17,17,17,.04);
}

.section-head{
    margin-bottom:18px;
    padding-bottom:12px;
    border-bottom:2px solid rgba(177,18,23,.10);
}

.section-head h2{
    margin:0;
    font-size:26px;
    font-weight:900;
    color:#111;
    letter-spacing:-.5px;
}

/* =========================================================
   TABS
========================================================= */

.race-tabs-nav{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    margin:0 0 18px;
    padding-bottom:14px;
    border-bottom:1px solid #ececec;
}

.race-tab-btn{
    appearance:none;
    border:1px solid #ddd;
    background:#fff;
    color:#111;
    padding:10px 16px;
    border-radius:999px;
    font-weight:800;
    cursor:pointer;
    transition:.2s ease;
}

.race-tab-btn:hover{
    border-color:#b11217;
    color:#b11217;
}

.race-tab-btn.is-active{
    background:#b11217;
    border-color:#b11217;
    color:#fff;
    box-shadow:0 8px 18px rgba(177,18,23,.20);
}

.race-tab-panel{
    display:none;
}

.race-tab-panel.is-active{
    display:block;
}

.race-subtabs-nav{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin:0 0 14px;
}

.race-subtab-btn{
    appearance:none;
    border:1px solid #ddd;
    background:#fafafa;
    color:#111;
    padding:8px 14px;
    border-radius:999px;
    font-weight:800;
    cursor:pointer;
    transition:.2s ease;
}

.race-subtab-btn:hover{
    border-color:#b11217;
    color:#b11217;
}

.race-subtab-btn.is-active{
    background:#111;
    border-color:#111;
    color:#fff;
}

.race-subtab-panel{
    display:none;
}

.race-subtab-panel.is-active{
    display:block;
}

/* =========================================================
   RESULTS CARDS
========================================================= */

.race-results-card{
    margin-bottom:16px;
    padding:18px;
    background:#fafafa;
    border:1px solid #ececec;
    border-radius:16px;
}

.race-results-card:last-child{
    margin-bottom:0;
}

.race-results-card-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    margin-bottom:14px;
}

.race-results-card-head h3{
    margin:0;
    font-size:18px;
    font-weight:800;
    color:#111;
}

.half-point-badge{
    display:inline-flex;
    align-items:center;
    padding:7px 10px;
    border-radius:999px;
    background:rgba(177,18,23,.08);
    color:#b11217;
    font-size:12px;
    font-weight:800;
    border:1px solid rgba(177,18,23,.14);
}

/* =========================================================
   RESULTS TABLE
========================================================= */

.race-results-table-wrap{
    overflow-x:auto;
}

.race-results-table{
    width:100%;
    border-collapse:separate;
    border-spacing:0;
}

.race-results-table th,
.race-results-table td{
    padding:10px 12px;
    border-bottom:1px solid #ececec;
    text-align:left;
    vertical-align:middle;
}

.race-results-table th{
    font-size:12px;
    color:#666;
    text-transform:uppercase;
    letter-spacing:.35px;
    font-weight:800;
}

.race-results-table td{
    font-size:14px;
    color:#111;
    font-weight:700;
}

.compact-table .col-pos{
    width:72px;
}

.compact-table .col-points{
    width:92px;
    text-align:right;
}

.compact-table .race-points-cell{
    text-align:right;
}

.race-results-table tr.is-first{
    background:linear-gradient(135deg,#fff7d6,#ffefad);
}

.race-results-table tr.is-second{
    background:linear-gradient(135deg,#f4f5f7,#e7eaee);
}

.race-results-table tr.is-third{
    background:linear-gradient(135deg,#f8e4d8,#f1c9b0);
}

.race-pos-number{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:36px;
    height:36px;
    padding:0 8px;
    border-radius:999px;
    background:#111;
    color:#fff;
    font-size:13px;
    font-weight:900;
}

.race-results-table tr.is-first .race-pos-number{
    background:#c69400;
}

.race-results-table tr.is-second .race-pos-number{
    background:#7b8794;
}

.race-results-table tr.is-third .race-pos-number{
    background:#a45b32;
}

.race-driver-wrap{
    display:flex;
    align-items:center;
    gap:8px;
    min-width:0;
}

.race-driver-flag{
    width:20px;
    height:14px;
    object-fit:cover;
    border-radius:3px;
    flex:0 0 auto;
}

.race-driver-number{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:42px;
    padding:5px 8px;
    border-radius:999px;
    background:rgba(177,18,23,.08);
    color:#b11217;
    font-size:11px;
    font-weight:900;
    line-height:1;
}

.race-driver-name{
    font-size:14px;
    font-weight:800;
    color:#111;
}

.race-points-badge{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:44px;
    padding:6px 8px;
    border-radius:999px;
    background:#111;
    color:#fff;
    font-size:12px;
    font-weight:900;
}

.race-results-table tr.is-first .race-points-badge{
    background:#c69400;
}

.race-results-table tr.is-second .race-points-badge{
    background:#7b8794;
}

.race-results-table tr.is-third .race-points-badge{
    background:#a45b32;
}

.race-empty{
    padding:18px;
    border:1px dashed #ddd;
    border-radius:14px;
    background:#fafafa;
    color:#666;
    font-weight:600;
}

.race-content-entry{
    font-size:16px;
    line-height:1.7;
    color:#222;
}

/* =========================================================
   RACE PROGRAM / TIMELINE
========================================================= */

.race-program-section{
    margin:0 0 28px;
    scroll-margin-top:110px;
}

.race-program-box{
    background:linear-gradient(180deg, #121418 0%, #0d0f13 100%);
    border:1px solid rgba(255,255,255,.06);
    border-radius:22px;
    padding:22px;
    box-shadow:
        0 18px 42px rgba(0,0,0,.22),
        inset 0 1px 0 rgba(255,255,255,.03);
}

.race-program-head{
    margin-bottom:18px;
}

.race-program-head h2{
    margin:0 0 6px;
    color:#fff;
    font-size:24px;
    font-weight:800;
    letter-spacing:-.02em;
    line-height:1.2;
}

.race-program-head p{
    margin:0;
    color:rgba(255,255,255,.62);
    font-size:14px;
    font-weight:500;
}

.race-program-day-tabs{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    margin:0 0 18px;
    padding:0 0 14px;
    border-bottom:1px solid rgba(255,255,255,.06);
}

.race-program-day-tab{
    appearance:none;
    border:none;
    background:rgba(255,255,255,.05);
    color:rgba(255,255,255,.72);
    min-height:40px;
    padding:0 16px;
    border-radius:999px;
    font-size:12px;
    font-weight:800;
    letter-spacing:.05em;
    text-transform:uppercase;
    cursor:pointer;
    transition:all .18s ease;
}

.race-program-day-tab:hover{
    background:rgba(255,255,255,.08);
    color:#fff;
}

.race-program-day-tab.is-active{
    background:#b11217;
    color:#fff;
    box-shadow:0 8px 20px rgba(177,18,23,.28);
}

.race-program-day-panel{
    display:none;
}

.race-program-day-panel.is-active{
    display:block;
}

.race-program-header{
    display:grid;
    grid-template-columns:100px 170px minmax(0,1fr);
    align-items:center;
    gap:24px;
    padding:0 18px 10px;
    margin-bottom:10px;
    color:rgba(255,255,255,.44);
    font-size:11px;
    font-weight:800;
    letter-spacing:.08em;
    text-transform:uppercase;
    border-bottom:1px solid rgba(255,255,255,.06);
}

.race-program-header-time,
.race-program-header-series,
.race-program-header-session{
    min-width:0;
    white-space:nowrap;
}

.race-program-list--timeline{
    display:flex;
    flex-direction:column;
    gap:12px;
}

.race-program-item--timeline{
    display:grid;
    grid-template-columns:100px 170px minmax(0,1fr);
    align-items:center;
    gap:24px;
    padding:16px 18px;
    border-radius:18px;
    background:
        linear-gradient(180deg, rgba(255,255,255,.04) 0%, rgba(255,255,255,.015) 100%),
        linear-gradient(180deg, #1a1d22 0%, #111317 100%);
    border:1px solid rgba(255,255,255,.08);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.03),
        0 10px 24px rgba(0,0,0,.16);
    transition:
        transform .18s ease,
        box-shadow .18s ease,
        border-color .18s ease,
        background .18s ease;
}

.race-program-item--timeline:hover{
    transform:translateY(-2px);
    border-color:rgba(255,255,255,.12);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.04),
        0 16px 32px rgba(0,0,0,.24);
}

.race-program-item-time{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:44px;
    min-width:90px;
    padding:0 14px;
    border-radius:12px;
    background:
        linear-gradient(180deg, rgba(255,255,255,.04) 0%, rgba(255,255,255,.01) 100%),
        linear-gradient(180deg, #0f1114 0%, #090b0e 100%);
    border:1px solid rgba(255,255,255,.07);
    color:#fff;
    font-size:15px;
    font-weight:800;
    line-height:1;
    letter-spacing:.02em;
    white-space:nowrap;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.03);
}

.race-program-item-series{
    display:flex;
    align-items:center;
    justify-content:flex-start;
    min-width:0;
}

.race-program-series-badge{
    position:relative;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:118px;
    height:36px;
    padding:0 16px 0 30px;
    border-radius:999px;
    font-size:11px;
    font-weight:800;
    line-height:1;
    letter-spacing:.08em;
    text-transform:uppercase;
    white-space:nowrap;
    color:#f3f4f6;
    background:
        linear-gradient(180deg, rgba(255,255,255,.05) 0%, rgba(255,255,255,.015) 100%),
        linear-gradient(180deg, #1d2025 0%, #111317 100%);
    border:1px solid rgba(255,255,255,.09);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.04),
        0 8px 20px rgba(0,0,0,.16);
    overflow:hidden;
    transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.race-program-series-badge::before{
    content:"";
    position:absolute;
    left:13px;
    top:50%;
    width:8px;
    height:8px;
    border-radius:50%;
    transform:translateY(-50%);
    background:#777;
}

.race-program-series-badge::after{
    content:"";
    position:absolute;
    inset:0;
    border-radius:inherit;
    pointer-events:none;
    background:linear-gradient(180deg, rgba(255,255,255,.06) 0%, rgba(255,255,255,0) 46%);
    opacity:.8;
}

.race-program-item--timeline:hover .race-program-series-badge{
    transform:translateY(-1px);
}

.race-program-series-badge--motogp{
    border-color:rgba(215,25,32,.30);
}

.race-program-series-badge--motogp::before{
    background:#d71920;
    box-shadow:0 0 12px rgba(215,25,32,.42);
}

.race-program-series-badge--moto2{
    border-color:rgba(43,92,255,.30);
}

.race-program-series-badge--moto2::before{
    background:#2b5cff;
    box-shadow:0 0 12px rgba(43,92,255,.42);
}

.race-program-series-badge--moto3{
    border-color:rgba(255,138,0,.30);
}

.race-program-series-badge--moto3::before{
    background:#ff8a00;
    box-shadow:0 0 12px rgba(255,138,0,.42);
}

.race-program-series-badge--worldsbk{
    border-color:rgba(215,25,32,.30);
}

.race-program-series-badge--worldsbk::before{
    background:#d71920;
    box-shadow:0 0 12px rgba(215,25,32,.42);
}

.race-program-series-badge--worldssp{
    border-color:rgba(29,185,84,.30);
}

.race-program-series-badge--worldssp::before{
    background:#1db954;
    box-shadow:0 0 12px rgba(29,185,84,.42);
}

.race-program-item-label{
    min-width:0;
    font-size:15px;
    font-weight:700;
    color:#f5f5f5;
    line-height:1.4;
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1280px){
    .race-hero .race-meta-grid{
        grid-template-columns:repeat(5, minmax(0, 1fr));
        gap:12px;
    }

    .race-hero .race-meta-card{
        padding:12px 14px;
    }

    .race-hero .race-meta-card strong{
        font-size:14px;
    }
}

@media (max-width: 1024px){
    .race-meta-grid{
        grid-template-columns:repeat(2, minmax(0,1fr));
    }

    .race-title{
        font-size:36px;
    }

    .race-hero .race-meta-grid{
        grid-template-columns:repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 991px){
    .race-program-box{
        padding:18px;
        border-radius:18px;
    }

    .race-program-header{
        grid-template-columns:88px 140px minmax(0,1fr);
        gap:16px;
        padding:0 14px 10px;
    }

    .race-program-item--timeline{
        grid-template-columns:88px 140px minmax(0,1fr);
        gap:16px;
        padding:14px;
        border-radius:16px;
    }

    .race-program-item-time{
        min-width:88px;
        min-height:40px;
        font-size:14px;
        padding:0 12px;
    }

    .race-program-series-badge{
        min-width:108px;
        height:34px;
        padding:0 14px 0 26px;
        font-size:10px;
    }

    .race-program-series-badge::before{
        left:11px;
        width:7px;
        height:7px;
    }

    .race-program-item-label{
        font-size:14px;
    }
}

@media (max-width: 767px){
    .race-hero-media{
        min-height:360px;
    }

    .race-title{
        font-size:30px;
    }

    .race-meta-grid{
        grid-template-columns:1fr;
    }

    .race-hero .race-meta-grid{
        grid-template-columns:repeat(2, minmax(0, 1fr));
    }

    .race-results-section,
    .race-content-section{
        padding:18px;
    }

    .compact-table .col-pos{
        width:52px;
    }

    .compact-table .col-points{
        width:68px;
    }

    .race-results-table th,
    .race-results-table td{
        padding:7px 6px;
    }

    .race-results-table td{
        font-size:12px;
        line-height:1.35;
    }

    .race-results-table th{
        font-size:10px;
    }

    .race-pos-number{
        min-width:27px;
        height:27px;
        padding:0 6px;
        font-size:10px;
    }

    .race-driver-wrap{
        gap:6px;
        min-width:0;
    }

    .race-driver-flag{
        width:18px;
        height:13px;
    }

    .race-driver-number{
        min-width:32px;
        padding:3px 6px;
        font-size:9px;
    }

    .race-driver-name{
        font-size:13px;
        font-weight:800;
        letter-spacing:-0.2px;
    }

    .race-points-badge{
        min-width:34px;
        padding:4px 6px;
        font-size:10px;
    }

    .race-program-box{
        padding:16px;
        border-radius:16px;
    }

    .race-program-head h2{
        font-size:21px;
    }

    .race-program-head p{
        font-size:13px;
    }

    .race-program-day-tabs{
        gap:8px;
        margin-bottom:16px;
        padding-bottom:12px;
    }

    .race-program-day-tab{
        min-height:36px;
        padding:0 13px;
        font-size:11px;
    }

    .race-program-header{
        display:none;
    }

    .race-program-item--timeline{
        grid-template-columns:72px 88px minmax(0,1fr);
        gap:10px;
        padding:12px;
        border-radius:14px;
    }

    .race-program-item-time{
        min-width:72px;
        min-height:38px;
        padding:0 10px;
        font-size:13px;
        justify-content:center;
    }

    .race-program-item-series{
        justify-content:flex-start;
    }

    .race-program-series-badge{
        min-width:82px;
        height:30px;
        padding:0 10px 0 24px;
        font-size:9px;
        letter-spacing:.05em;
    }

    .race-program-series-badge::before{
        left:10px;
        width:6px;
        height:6px;
    }

    .race-program-item-label{
        font-size:13px;
        line-height:1.3;
    }
}

@media (max-width: 480px){
    .race-hero .race-meta-grid{
        grid-template-columns:1fr;
    }

    .race-program-item--timeline{
        grid-template-columns:64px 78px minmax(0,1fr);
        gap:8px;
        padding:10px;
    }

    .race-program-item-time{
        min-width:64px;
        min-height:34px;
        font-size:12px;
        padding:0 8px;
    }

    .race-program-series-badge{
        min-width:72px;
        height:28px;
        padding:0 8px 0 20px;
        font-size:8.5px;
    }

    .race-program-series-badge::before{
        left:8px;
        width:5px;
        height:5px;
    }

    .race-program-item-label{
        font-size:12px;
        line-height:1.25;
    }
}
