:root {
    --bg: #0a0b0e;
    --panel: #13151a;
    --panel-soft: #191c22;
    --text: #f5f5f5;
    --muted: #9da3ae;
    --line: #292d36;
    --accent: #ff3b30;
    --max-width: 1180px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system,
        BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: inherit; text-decoration: none; }
button, select { font: inherit; }

.site-header {
    width: min(calc(100% - 32px), var(--max-width));
    margin: 0 auto;
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.brand-mark {
    background: var(--accent);
    padding: 6px 9px;
    border-radius: 6px;
    font-style: italic;
}

nav a, .back-link { color: var(--muted); }
nav a:hover, .back-link:hover { color: var(--text); }

.page-shell {
    width: min(calc(100% - 32px), var(--max-width));
    margin: 0 auto;
    padding: 64px 0 96px;
}

.hero { padding: 44px 0 56px; max-width: 800px; }

.hero h1, .page-intro h1, .race-hero h1 {
    font-size: clamp(3rem, 8vw, 6.4rem);
    line-height: .92;
    letter-spacing: -0.065em;
    margin: 8px 0 20px;
}

.hero-copy, .page-intro p, .race-hero p {
    color: var(--muted);
    font-size: 1.15rem;
}

.eyebrow {
    margin: 0;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: .76rem;
    font-weight: 800;
}

.filter-panel {
    border: 1px solid var(--line);
    background: var(--panel);
    border-radius: 18px;
    padding: 24px;
    margin-bottom: 58px;
}

.filter-heading {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 20px;
    margin-bottom: 22px;
}

.filter-heading h2 { margin: 5px 0 0; }

.clear-link {
    color: var(--muted);
    border-bottom: 1px solid var(--line);
    padding-bottom: 2px;
}

.clear-link:hover { color: var(--text); }

.filter-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    align-items: end;
    gap: 14px;
}

.filter-form label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--muted);
    font-size: .84rem;
    font-weight: 700;
}

.filter-form select {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0 12px;
    background: var(--panel-soft);
    color: var(--text);
}

.filter-form button, .button {
    min-height: 46px;
    border: 0;
    border-radius: 10px;
    padding: 0 18px;
    background: var(--accent);
    color: white;
    font-weight: 800;
    cursor: pointer;
}

.filter-form button:hover { filter: brightness(1.08); }

.filter-summary {
    margin: 18px 0 0;
    color: var(--muted);
    line-height: 1.6;
}

.filter-summary strong { color: var(--text); }

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    margin-bottom: 20px;
}

.section-heading h2 { margin: 4px 0 0; }
.section-heading > span { color: var(--muted); }

.season-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: 12px;
}

.season-card {
    min-height: 120px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform .15s ease, border-color .15s ease;
}

.season-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
}

.season-card span { font-size: 1.65rem; font-weight: 800; }
.season-card small { color: var(--muted); }

.empty-results {
    border: 1px dashed var(--line);
    border-radius: 16px;
    padding: 36px;
    color: var(--muted);
}

.empty-results h3 { color: var(--text); margin-top: 0; }
.button.secondary { display: inline-flex; align-items: center; margin-top: 10px; }

.page-intro { padding: 36px 0 48px; }
.race-list { border-top: 1px solid var(--line); }

.race-row {
    display: grid;
    grid-template-columns: 54px 1fr auto 24px;
    align-items: center;
    gap: 18px;
    padding: 22px 4px;
    border-bottom: 1px solid var(--line);
}

.race-row:hover .arrow {
    color: var(--accent);
    transform: translateX(3px);
}

.round-number, .race-date, .race-main small { color: var(--muted); }
.race-main { display: flex; flex-direction: column; gap: 5px; }
.arrow { transition: .15s ease; }

.race-hero {
    padding: 36px 0 48px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.race-hero h1 {
    font-size: clamp(2.8rem, 7vw, 5.5rem);
    max-width: 900px;
}

.round-badge {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 10px 14px;
    color: var(--muted);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 56px;
}

.stat-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 20px;
    min-height: 135px;
    display: flex;
    flex-direction: column;
}

.stat-card span, .stat-card small { color: var(--muted); }
.stat-card strong { margin: auto 0 5px; font-size: 1.12rem; }

.map-placeholder {
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 48px 0;
    margin-bottom: 56px;
    display: grid;
    grid-template-columns: .8fr 1.2fr;
    gap: 48px;
    align-items: center;
}

.map-placeholder h2 { font-size: 2rem; margin: 8px 0; }

.map-placeholder p:not(.eyebrow) {
    color: var(--muted);
    line-height: 1.6;
}

.track-sketch {
    min-height: 300px;
    border: 1px dashed #414754;
    border-radius: 18px;
    display: grid;
    place-items: center;
    color: var(--muted);
}

.two-column {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 310px;
    gap: 28px;
    align-items: start;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 14px;
}

table { width: 100%; border-collapse: collapse; min-width: 720px; }

th, td {
    padding: 15px 14px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

th {
    color: var(--muted);
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .08em;
}

tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--panel-soft); }

.driver-code {
    display: inline-block;
    width: 44px;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 800;
}

.sidebar { display: grid; gap: 18px; }

.insight-panel {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel);
}

.insight-panel h2 { margin: 6px 0 18px; }

.insight-row, .dnf-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 0;
    border-top: 1px solid var(--line);
}

.insight-row div, .dnf-row { flex-direction: column; }

.insight-row small, .dnf-row small {
    color: var(--muted);
    margin-top: 3px;
}

.gain { color: var(--accent); font-weight: 800; }

.empty-state { max-width: 680px; padding: 80px 0; }

footer {
    width: min(calc(100% - 32px), var(--max-width));
    margin: 0 auto;
    padding: 30px 0;
    color: var(--muted);
    border-top: 1px solid var(--line);
    font-size: .85rem;
}

@media (max-width: 850px) {
    .filter-form { grid-template-columns: 1fr 1fr; }
    .filter-form button { grid-column: 1 / -1; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .map-placeholder, .two-column { grid-template-columns: 1fr; }
    .sidebar { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .page-shell { padding-top: 40px; }
    .hero { padding-top: 20px; }
    .filter-form, .stat-grid, .sidebar { grid-template-columns: 1fr; }
    .filter-form button { grid-column: auto; }
    .race-row { grid-template-columns: 42px 1fr 20px; }
    .race-date { display: none; }
    .race-hero { display: block; }
    .round-badge { display: inline-block; margin-top: 12px; }
}



.driver-search-field {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.driver-search-field > label {
    color: var(--muted);
    font-size: .84rem;
    font-weight: 700;
}

.driver-search-input {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0 14px;
    background: var(--panel-soft);
    color: var(--text);
    font: inherit;
    outline: none;
}

.driver-search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 59, 48, .12);
}

.driver-search-input::placeholder { color: var(--muted); }

.driver-results {
    position: absolute;
    z-index: 30;
    top: calc(100% + 7px);
    left: 0;
    right: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #17191f;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .42);
}

.driver-result {
    width: 100%;
    min-height: 58px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 0;
    border-bottom: 1px solid var(--line);
    padding: 9px 12px;
    background: transparent;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.driver-result:last-child { border-bottom: 0; }
.driver-result:hover,
.driver-result:focus,
.driver-result.is-active { background: #20232b; }

.driver-result-initials {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 59, 48, .14);
    color: var(--accent);
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .04em;
}

.driver-result-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.driver-result-text strong { font-size: .94rem; }
.driver-result-text small { color: var(--muted); font-size: .76rem; }

.driver-no-results {
    margin: 0;
    padding: 16px;
    color: var(--muted);
    text-align: center;
    font-size: .88rem;
}


/* Shared driver/team autocomplete */
.autocomplete-field {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.autocomplete-field > label {
    color: var(--muted);
    font-size: .84rem;
    font-weight: 700;
}

.autocomplete-input {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0 13px;
    background: var(--panel-soft);
    color: var(--text);
    font: inherit;
    outline: none;
}

.autocomplete-input:focus {
    border-color: #606775;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .04);
}

.autocomplete-results {
    position: absolute;
    z-index: 30;
    top: calc(100% + 7px);
    left: 0;
    right: 0;
    overflow: hidden;
    border: 1px solid #363b46;
    border-radius: 12px;
    background: #17191f;
    box-shadow: 0 18px 45px rgba(0, 0, 0, .42);
}

.autocomplete-option {
    width: 100%;
    min-height: 58px;
    border: 0;
    border-bottom: 1px solid var(--line);
    padding: 9px 11px;
    display: flex;
    align-items: center;
    gap: 11px;
    background: transparent;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.autocomplete-option:last-child { border-bottom: 0; }
.autocomplete-option:hover,
.autocomplete-option.is-active { background: #22252d; }

.autocomplete-badge {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: grid;
    place-items: center;
    border: 1px solid #3d424d;
    border-radius: 9px;
    background: #101216;
    color: #d8dbe1;
    font-size: .7rem;
    font-weight: 850;
    letter-spacing: .04em;
}

.autocomplete-option-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.autocomplete-option-text strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .93rem;
}

.autocomplete-option-text small {
    color: var(--muted);
    font-size: .76rem;
}

.autocomplete-empty {
    margin: 0;
    padding: 16px;
    color: var(--muted);
    font-size: .86rem;
}


.season-card-topline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.season-card-topline > span {
    font-size: 1.65rem;
    font-weight: 800;
}

.season-card-with-result {
    min-height: 175px;
}

.wdc-position {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 30px;
    padding: 0 9px;
    border: 1px solid rgba(255, 59, 48, .45);
    border-radius: 999px;
    background: rgba(255, 59, 48, .09);
    color: #ff746c;
    font-size: .78rem;
    letter-spacing: .04em;
}

.season-driver-result {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.season-driver-result small,
.season-driver-result em {
    color: var(--muted);
}

.season-driver-result span {
    font-size: .9rem;
    font-weight: 750;
}

.season-driver-result em {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .76rem;
    font-style: normal;
}

.season-intro {
    padding-bottom: 34px;
}

.championship-overview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 64px;
}

.standings-panel {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel);
}

.standings-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    padding: 22px;
    border-bottom: 1px solid var(--line);
}

.standings-heading h2 {
    margin: 6px 0 0;
    font-size: 1.35rem;
}

.standings-heading > span {
    color: var(--muted);
    font-size: .8rem;
    white-space: nowrap;
}

.standings-list {
    display: flex;
    flex-direction: column;
}

.standing-row {
    min-height: 70px;
    display: grid;
    grid-template-columns: 30px 5px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--line);
}

.standing-row:last-child {
    border-bottom: 0;
}

.standings-podium .standing-row:first-child {
    background: linear-gradient(90deg, rgba(255, 255, 255, .045), transparent);
}

.standing-position {
    color: var(--muted);
    font-weight: 850;
    text-align: center;
}

.team-colour {
    align-self: stretch;
    width: 5px;
    min-height: 42px;
    border-radius: 99px;
    background: var(--team-colour);
    box-shadow: 0 0 18px color-mix(in srgb, var(--team-colour) 35%, transparent);
}

.standing-identity,
.standing-record {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.standing-identity strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.standing-identity small,
.standing-record small {
    color: var(--muted);
    font-size: .75rem;
}

.standing-record {
    align-items: flex-end;
    text-align: right;
}

.standing-record strong {
    font-size: .92rem;
}

.full-standings {
    border-top: 1px solid var(--line);
}

.full-standings summary {
    padding: 15px 18px;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 750;
    cursor: pointer;
    list-style-position: inside;
}

.full-standings summary:hover {
    color: var(--text);
    background: var(--panel-soft);
}

.full-standings[open] summary {
    border-bottom: 1px solid var(--line);
}

.standings-unavailable {
    padding: 28px 22px;
    color: var(--muted);
    line-height: 1.55;
}

@media (max-width: 850px) {
    .championship-overview {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .standing-row {
        grid-template-columns: 26px 4px minmax(0, 1fr);
    }

    .standing-record {
        grid-column: 3;
        align-items: flex-start;
        text-align: left;
        margin-top: -6px;
    }
}


.race-map-section {
    margin: 10px 0 64px;
    padding: 42px 0 50px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.race-map-intro {
    display: flex;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 28px;
}

.race-map-intro h2 {
    margin: 7px 0 10px;
    font-size: 2rem;
}

.race-map-intro p:not(.eyebrow) {
    max-width: 670px;
    color: var(--muted);
    line-height: 1.6;
}

.race-map-legend {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    justify-content: flex-end;
    gap: 12px 16px;
    color: var(--muted);
    font-size: .8rem;
}

.map-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 6px;
    border-radius: 50%;
}

.map-dot.overtake, .event-marker.overtake { background: #68d391; fill: #68d391; }
.map-dot.incident, .event-marker.incident { background: #f6ad55; fill: #f6ad55; }
.map-dot.retirement, .event-marker.retirement { background: #fc8181; fill: #fc8181; }

.race-map-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, .75fr);
    gap: 22px;
    align-items: stretch;
}

.circuit-stage {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background:
        radial-gradient(circle at 50% 48%, rgba(255,255,255,.025), transparent 40%),
        var(--panel);
}

.circuit-map {
    display: block;
    width: 100%;
    height: auto;
}

.track-underlay path {
    fill: none;
    stroke: #050608;
    stroke-width: 31;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.track-segments path {
    fill: none;
    stroke: #d5d8de;
    stroke-width: 15;
    stroke-linecap: round;
    stroke-linejoin: round;
    cursor: pointer;
    transition:
        stroke .16s ease,
        stroke-width .16s ease;
}

.track-segments path:hover,
.track-segments path.active {
    stroke: #ff7b74;
    stroke-width: 18;
}

.track-segments path[data-segment="pit-entry"] {
    stroke-width: 7;
    stroke-dasharray: 3 6;
}

.track-segments path[data-segment="pit-entry"]:hover,
.track-segments path[data-segment="pit-entry"].active {
    stroke-width: 10;
}

.event-marker {
    stroke: #0a0b0e;
    stroke-width: 3;
    cursor: pointer;
    transition: r .15s ease;
}

.event-marker:hover {
    r: 10;
}

.map-label {
    fill: var(--muted);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .12em;
}

.lake-label {
    fill: rgba(157, 163, 174, .28);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: .18em;
    text-anchor: middle;
}

.segment-tooltip {
    position: absolute;
    z-index: 5;
    pointer-events: none;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(10, 11, 14, .94);
    color: var(--text);
    font-size: .78rem;
    font-weight: 750;
}

.map-attribution {
    margin: 0;
    padding: 0 18px 16px;
    color: var(--muted);
    font-size: .72rem;
}

.segment-panel {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel);
    padding: 22px;
}

.segment-panel h3 {
    margin: 6px 0;
    font-size: 1.5rem;
}

.segment-kind {
    margin: 0 0 22px;
    color: var(--muted);
    font-size: .82rem;
}

.segment-events {
    display: grid;
    gap: 12px;
}

.segment-empty {
    padding: 22px 0;
    color: var(--muted);
    line-height: 1.5;
}

.map-event-card {
    padding: 15px;
    border: 1px solid var(--line);
    border-left-width: 4px;
    border-radius: 12px;
    background: var(--panel-soft);
}

.map-event-card.overtake { border-left-color: #68d391; }
.map-event-card.incident { border-left-color: #f6ad55; }
.map-event-card.retirement { border-left-color: #fc8181; }

.map-event-meta {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: .69rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.map-event-card h4 {
    margin: 8px 0 5px;
}

.map-event-card p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: .84rem;
    line-height: 1.45;
}

.map-event-card .map-event-matchup {
    color: var(--text);
}

@media (max-width: 850px) {
    .race-map-intro,
    .race-map-layout {
        grid-template-columns: 1fr;
        display: grid;
    }

    .race-map-legend {
        justify-content: flex-start;
    }
}


.corner-number-labels text {
    fill: var(--text);
    font-size: 13px;
    font-weight: 850;
    text-anchor: middle;
    paint-order: stroke;
    stroke: var(--panel);
    stroke-width: 7px;
    stroke-linejoin: round;
}

.start-line {
    stroke: var(--text);
    stroke-width: 4;
    stroke-dasharray: 4 3;
}

.circuit-stage .lake-label {
    fill: rgba(157, 163, 174, .23);
}


.race-championship {
    margin: 12px 0 64px;
}

.championship-section-heading {
    margin-bottom: 18px;
}

.championship-section-heading h2 {
    margin: 6px 0 0;
}

.championship-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.race-standings-panel {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel);
}

.race-standings-panel-after {
    border-color: rgba(255, 59, 48, .32);
}

.race-standings-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 20px;
    border-bottom: 1px solid var(--line);
}

.race-standings-heading h3 {
    margin: 5px 0 0;
    font-size: 1.25rem;
}

.race-standings-heading > span {
    color: var(--muted);
    font-size: .76rem;
    white-space: nowrap;
}

.standings-moment {
    color: var(--muted);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.race-standings-list {
    display: flex;
    flex-direction: column;
}

.race-standing-row {
    min-height: 66px;
    display: grid;
    grid-template-columns: 28px 5px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 11px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--line);
}

.race-standing-row:last-child {
    border-bottom: 0;
}

.race-standing-position {
    color: var(--muted);
    text-align: center;
}

.race-standing-colour {
    align-self: stretch;
    width: 5px;
    min-height: 38px;
    border-radius: 99px;
    background: var(--team-colour);
}

.race-standing-driver {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.race-standing-driver strong,
.race-standing-driver small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.race-standing-driver small {
    color: var(--muted);
    font-size: .72rem;
}

.race-standing-points {
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 4px;
    min-width: 54px;
    font-size: .9rem;
}

.race-standing-points small {
    color: var(--muted);
    font-size: .68rem;
    font-weight: 700;
}

.standing-change {
    min-width: 34px;
    text-align: center;
    font-size: .74rem;
    font-weight: 850;
}

.position-up {
    color: #68d391;
}

.position-down {
    color: #fc8181;
}

.position-same {
    color: var(--muted);
}

.position-new {
    color: #ff746c;
    font-size: .62rem;
    letter-spacing: .05em;
}

.race-full-standings {
    border-top: 1px solid var(--line);
}

.race-full-standings summary {
    padding: 14px 16px;
    color: var(--muted);
    cursor: pointer;
    font-size: .8rem;
    font-weight: 750;
    list-style-position: inside;
}

.race-full-standings summary:hover {
    color: var(--text);
    background: var(--panel-soft);
}

.race-full-standings[open] summary {
    border-bottom: 1px solid var(--line);
}

.preseason-empty {
    min-height: 172px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px;
}

.preseason-empty p {
    max-width: 420px;
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.55;
}

@media (max-width: 850px) {
    .championship-comparison {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .race-standing-row {
        grid-template-columns: 25px 4px minmax(0, 1fr) auto;
    }

    .standing-change {
        grid-column: 3;
        justify-self: start;
        margin-top: -7px;
    }

    .race-standing-points {
        grid-column: 4;
        grid-row: 1 / span 2;
    }
}


.static-circuit-section {
    margin-top: 8px;
}

.geometry-status {
    align-self: flex-start;
    padding: 7px 11px;
    border: 1px solid rgba(104, 211, 145, .32);
    border-radius: 999px;
    color: #68d391;
    background: rgba(104, 211, 145, .07);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.static-circuit-stage {
    position: relative;
    min-height: 430px;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 38px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background:
        radial-gradient(circle at center, rgba(255, 255, 255, .025), transparent 50%),
        var(--panel);
}

.static-circuit-image {
    display: block;
    width: min(100%, 660px);
    height: 400px;
    object-fit: contain;
    opacity: .96;
}

.static-circuit-overlay {
    position: absolute;
    right: 18px;
    bottom: 18px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(10, 11, 14, .88);
    color: var(--muted);
    font-size: .7rem;
    font-weight: 750;
}

.static-map-attribution {
    padding: 12px 4px 0;
}

.static-map-attribution a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
}

@media (max-width: 650px) {
    .static-circuit-stage {
        min-height: 320px;
        padding: 24px;
    }

    .static-circuit-image {
        height: 290px;
    }
}


.race-timeline {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid var(--line);
}

.timeline-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 26px;
}

.timeline-heading h3 {
    margin: 6px 0 8px;
    font-size: 1.55rem;
}

.timeline-heading p:not(.eyebrow) {
    max-width: 650px;
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.timeline-reset {
    padding: 9px 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel);
    color: var(--text);
    font: inherit;
    font-size: .76rem;
    font-weight: 750;
    cursor: pointer;
}

.timeline-reset:hover {
    border-color: rgba(255, 59, 48, .45);
}

.timeline-scale {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 21px 18px 30px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel);
    color: var(--muted);
    font-size: .72rem;
    font-weight: 750;
}

.timeline-rail-wrap {
    position: relative;
    min-width: 0;
}

.timeline-rail {
    position: relative;
    height: 8px;
    border-radius: 99px;
    background:
        linear-gradient(
            90deg,
            rgba(255, 255, 255, .18),
            rgba(255, 255, 255, .07)
        );
}

.timeline-dot {
    position: absolute;
    top: 50%;
    width: 15px;
    height: 15px;
    padding: 0;
    border: 3px solid var(--panel);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    transition:
        width .15s ease,
        height .15s ease,
        opacity .15s ease,
        box-shadow .15s ease;
}

.timeline-dot.overtake {
    background: #68d391;
}

.timeline-dot.incident {
    background: #f6ad55;
}

.timeline-dot.retirement {
    background: #fc8181;
}

.timeline-dot:hover,
.timeline-dot.selected {
    width: 21px;
    height: 21px;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, .08);
    z-index: 2;
}

.timeline-dot.muted {
    opacity: .16;
}

.timeline-ticks {
    position: relative;
    height: 22px;
    margin-top: 9px;
}

.timeline-ticks span {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    color: var(--muted);
    font-size: .64rem;
    font-weight: 700;
}

.timeline-filter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 18px 0;
}

.timeline-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.timeline-filter {
    padding: 8px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: .74rem;
    font-weight: 750;
    cursor: pointer;
}

.timeline-filter:hover,
.timeline-filter.active {
    border-color: rgba(255, 59, 48, .45);
    background: rgba(255, 59, 48, .08);
    color: var(--text);
}

.timeline-context {
    margin: 0;
    color: var(--muted);
    font-size: .76rem;
    text-align: right;
}

.timeline-list {
    position: relative;
    display: grid;
    gap: 10px;
}

.timeline-list::before {
    content: "";
    position: absolute;
    top: 20px;
    bottom: 20px;
    left: 53px;
    width: 1px;
    background: var(--line);
}

.timeline-event {
    position: relative;
    width: 100%;
    display: grid;
    grid-template-columns: 50px 15px minmax(0, 1fr);
    align-items: start;
    gap: 13px;
    padding: 15px 16px 15px 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel);
    color: var(--text);
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.timeline-event:hover,
.timeline-event.selected {
    border-color: rgba(255, 59, 48, .42);
    background: var(--panel-soft);
}

.timeline-lap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding-top: 1px;
}

.timeline-lap small {
    color: var(--muted);
    font-size: .59rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.timeline-lap strong {
    font-size: 1.12rem;
}

.timeline-card-dot {
    position: relative;
    z-index: 1;
    width: 13px;
    height: 13px;
    margin-top: 5px;
    border: 3px solid var(--panel);
    border-radius: 50%;
}

.timeline-event.overtake .timeline-card-dot {
    background: #68d391;
}

.timeline-event.incident .timeline-card-dot {
    background: #f6ad55;
}

.timeline-event.retirement .timeline-card-dot {
    background: #fc8181;
}

.timeline-event-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.timeline-event-topline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.timeline-event-topline > strong {
    font-size: .95rem;
}

.timeline-event-topline em {
    color: var(--muted);
    font-size: .65rem;
    font-style: normal;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
    white-space: nowrap;
}

.timeline-location {
    color: #ff746c;
    font-size: .71rem;
    font-weight: 750;
}

.timeline-matchup {
    font-size: .79rem;
}

.timeline-description {
    color: var(--muted);
    font-size: .79rem;
    line-height: 1.48;
}

.timeline-empty {
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: 14px;
    color: var(--muted);
    text-align: center;
}

.map-event-card {
    width: 100%;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.map-event-card.selected {
    border-color: rgba(255, 59, 48, .55);
    background: rgba(255, 59, 48, .06);
}

.map-event-title {
    display: block;
    margin: 8px 0 5px;
}

.map-event-description {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: .84rem;
    line-height: 1.45;
}

.event-marker.selected {
    r: 11;
}

.event-marker.muted {
    opacity: .2;
}

@media (max-width: 650px) {
    .timeline-heading,
    .timeline-filter-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .timeline-context {
        text-align: left;
    }

    .timeline-scale {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .timeline-scale > span {
        display: none;
    }

    .timeline-event {
        grid-template-columns: 42px 13px minmax(0, 1fr);
        gap: 10px;
    }

    .timeline-list::before {
        left: 46px;
    }

    .timeline-event-topline {
        flex-direction: column;
        gap: 4px;
    }
}


.circuit-svg-object {
    display: block;
    width: 100%;
    min-height: 430px;
    border: 0;
}
.svg-circuit-stage {
    min-height: 470px;
}
.segment-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0 0;
}
.segment-chip {
    padding: 8px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: .73rem;
    font-weight: 750;
    cursor: pointer;
}
.segment-chip:hover,
.segment-chip.active {
    border-color: rgba(255,59,48,.5);
    background: rgba(255,59,48,.08);
    color: var(--text);
}
.map-dot.lead-change,
.timeline-dot.lead-change,
.timeline-event.lead-change .timeline-card-dot {
    background: #b794f4;
}
.map-dot.safety-car,
.timeline-dot.safety-car,
.timeline-dot.vsc,
.timeline-event.safety-car .timeline-card-dot,
.timeline-event.vsc .timeline-card-dot {
    background: #63b3ed;
}
.timeline-dot.strategy,
.timeline-event.strategy .timeline-card-dot {
    background: #68d391;
}
.event-confidence {
    display: inline-flex;
    width: fit-content;
    margin-top: 3px;
    padding: 3px 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: .61rem;
    font-weight: 750;
}
.map-event-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
@media (max-width: 650px) {
    .circuit-svg-object { min-height: 300px; }
    .svg-circuit-stage { min-height: 340px; }
}


.timeline-playback {
    display: grid;
    grid-template-columns: auto auto minmax(100px, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel);
}

.timeline-play-button,
.timeline-step-button {
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: .72rem;
    font-weight: 780;
    cursor: pointer;
}

.timeline-play-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-color: rgba(255, 59, 48, .45);
    background: rgba(255, 59, 48, .08);
}

.timeline-play-button.playing {
    background: #ff3b30;
    color: #fff;
}

.play-icon {
    width: 14px;
    text-align: center;
}

.timeline-step-button:hover,
.timeline-play-button:hover {
    border-color: rgba(255, 59, 48, .75);
}

.timeline-lap-readout {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    min-width: 0;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 720;
}

.timeline-lap-readout strong {
    color: var(--text);
    font-size: 1.22rem;
}

.timeline-speed {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: .68rem;
    font-weight: 720;
}

.timeline-speed select {
    min-height: 36px;
    padding: 0 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel-soft);
    color: var(--text);
    font: inherit;
    cursor: pointer;
}

.timeline-playhead {
    position: absolute;
    z-index: 3;
    top: 50%;
    width: 3px;
    height: 28px;
    border-radius: 99px;
    background: #fff;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .12);
    pointer-events: none;
    transition: left 180ms linear;
}

.timeline-playhead::before {
    content: "";
    position: absolute;
    top: -4px;
    left: 50%;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #ff3b30;
    transform: translateX(-50%);
}

.segment-tooltip {
    z-index: 20;
    display: grid;
    gap: 2px;
    max-width: 260px;
    padding: 9px 11px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 10px;
    background: rgba(12, 12, 14, .94);
    color: #fff;
    pointer-events: none;
}

.segment-tooltip strong {
    font-size: .78rem;
}

.segment-tooltip span {
    color: rgba(255, 255, 255, .68);
    font-size: .66rem;
}

.timeline-dot.pulse {
    animation: timeline-dot-pulse 1.1s ease-in-out 2;
}

@keyframes timeline-dot-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, .10);
    }
    50% {
        box-shadow: 0 0 0 9px rgba(255, 255, 255, .03);
    }
}

.map-marker-pulse {
    animation: authored-marker-pulse 1.1s ease-in-out 1;
    transform-box: fill-box;
    transform-origin: center;
}

@keyframes authored-marker-pulse {
    0%, 100% {
        transform: scale(1);
        filter: none;
    }
    50% {
        transform: scale(1.8);
        filter: drop-shadow(0 0 8px rgba(255, 255, 255, .85));
    }
}

.circuit-svg-object {
    filter: drop-shadow(0 16px 30px rgba(0, 0, 0, .18));
}

@media (max-width: 760px) {
    .timeline-playback {
        grid-template-columns: 1fr 1fr;
    }

    .timeline-lap-readout {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .timeline-speed {
        justify-content: flex-end;
    }
}

@media (max-width: 480px) {
    .timeline-playback {
        grid-template-columns: 1fr;
    }

    .timeline-lap-readout,
    .timeline-speed {
        grid-column: auto;
    }

    .timeline-speed {
        justify-content: space-between;
    }
}


/* v16: clean authored-style presentation for imported circuit geometry */
.svg-circuit-stage {
    display: flex;
    min-height: 500px;
    align-items: center;
    justify-content: center;
    padding: 28px;
    overflow: visible;
    background:
        radial-gradient(
            circle at center,
            rgba(255,255,255,.025),
            transparent 68%
        );
}

.circuit-svg-object {
    width: 100%;
    height: 470px;
    min-height: 0;
    filter: none;
}

.svg-circuit-stage .map-attribution {
    position: absolute;
    right: 18px;
    bottom: 13px;
    left: 18px;
    margin: 0;
    text-align: center;
}

@media (max-width: 650px) {
    .svg-circuit-stage {
        min-height: 360px;
        padding: 16px;
    }

    .circuit-svg-object {
        height: 330px;
    }
}


/* v17 — rounds 2–10 now use Australia's exact inline SVG architecture */
.generated-circuit-map {
    width: 100%;
    max-height: 570px;
    padding: 22px;
    box-sizing: border-box;
}

.generated-circuit-map .track-segments path {
    pointer-events: stroke;
}

.generated-circuit-map .track-underlay path {
    stroke-width: 30;
}

.generated-circuit-map .track-segments path {
    stroke-width: 15;
}

.generated-circuit-map .corner-number-labels text {
    text-anchor: middle;
    paint-order: stroke;
    stroke: #0a0b0e;
    stroke-width: 5px;
    stroke-linejoin: round;
}

.generated-map-error {
    display: grid;
    place-content: center;
    min-height: 430px;
    padding: 28px;
    text-align: center;
    color: var(--muted);
}

.generated-map-error strong {
    color: var(--text);
}


/* v18: accurate full-corner maps and Australia-scale presentation */
.generated-circuit-map {
    display: block;
    width: 100%;
    height: clamp(540px, 62vw, 720px);
    max-height: none;
    padding: 8px;
}

.generated-circuit-map .track-underlay path {
    stroke-width: 25;
}

.generated-circuit-map .track-segments path {
    stroke-width: 13;
}

.generated-circuit-map .corner-number-labels text {
    font-size: 13px;
    font-weight: 800;
}

@media (max-width: 760px) {
    .generated-circuit-map {
        height: clamp(400px, 86vw, 580px);
        padding: 2px;
    }

    .generated-circuit-map .corner-number-labels text {
        font-size: 11px;
    }
}




/* v21: generated tracks use Australia's original SVG styling verbatim */
#generated-track-root .track-underlay path {
    stroke-width: calc(31px / var(--generated-map-scale, 1));
}

#generated-track-root .track-segments path {
    stroke-width: calc(15px / var(--generated-map-scale, 1));
}

#generated-track-root .track-segments path:hover,
#generated-track-root .track-segments path.active {
    stroke-width: calc(18px / var(--generated-map-scale, 1));
}

#generated-track-root .event-marker {
    stroke-width: calc(3px / var(--generated-map-scale, 1));
}

#generated-track-root .start-line {
    stroke-width: calc(4px / var(--generated-map-scale, 1));
}

#generated-track-root .map-label {
    font-size: calc(13px / var(--generated-map-scale, 1));
}
