:root {
    --bg: #0b1020;
    --bg-2: #111827;
    --panel: #141b2d;
    --panel-2: #0f172a;
    --text: #e5e7eb;
    --muted: #9aa3b2;
    --accent: #e10600;
    --accent-2: #ffb100;
    --border: rgba(255, 255, 255, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Space Grotesk", "Segoe UI", sans-serif;
    color: var(--text);
    background:
        repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 12px),
        radial-gradient(circle at 8% 8%, rgba(225, 6, 0, 0.2), transparent 40%),
        #050608;
}

body.theme-light {
    --bg: #cfd6e4;
    --bg-2: #d8dee9;
    --panel: #e2e7f0;
    --panel-2: #d2d9e6;
    --text: #101623;
    --muted: #4a5568;
    --accent: #e10600;
    --accent-2: #c47d00;
    --border: rgba(15, 23, 42, 0.16);
    background:
        repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.1) 0 1px, transparent 1px 14px),
        radial-gradient(circle at 8% 8%, rgba(225, 6, 0, 0.1), transparent 42%),
        radial-gradient(circle at top, #cfd6e4, #c1c9d7 55%, #b3bccd);
}

.results-page {
    max-width: 1240px;
    margin: 0 auto;
    padding: 28px 28px 40px;
}

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

.brand {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 6px;
}

.brand-f1 {
    color: var(--accent);
    font-weight: 700;
    font-size: 28px;
    letter-spacing: 0.04em;
}

.brand-name {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-weight: 700;
    font-size: 20px;
}

h1,
h2,
h3,
h4,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 6px;
}

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

.topbar-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.ghost {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    border-radius: 12px;
    padding: 10px 16px;
    text-decoration: none;
    font: inherit;
    cursor: pointer;
}

.layout {
    display: grid;
    gap: 20px;
}

.hero,
.panel {
    background: linear-gradient(180deg, var(--panel), var(--panel-2));
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

.hero {
    padding: 24px;
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr);
    gap: 20px;
    align-items: end;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-size: 12px;
    color: var(--accent-2);
}

.hero-copy h2 {
    margin-bottom: 10px;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.hero-text {
    max-width: 720px;
    line-height: 1.6;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.hero-stat {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    min-height: 96px;
}

.hero-stat-label {
    display: block;
    color: var(--muted);
    font-size: 0.8rem;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.hero-stat strong {
    font-size: 1.2rem;
    line-height: 1.35;
}

.status {
    border-radius: 14px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
}

.hidden {
    display: none;
}

.section-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.panel {
    padding: 22px;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.standings-table {
    width: 100%;
    border-collapse: collapse;
}

.standings-table th,
.standings-table td {
    padding: 10px 8px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.standings-table th {
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.standings-table td:last-child,
.standings-table th:last-child {
    text-align: right;
}

.points-total {
    cursor: help;
    text-decoration: underline dotted;
    text-underline-offset: 3px;
}

.standings-table td:nth-last-child(2),
.standings-table th:nth-last-child(2),
.standings-table td:nth-last-child(3),
.standings-table th:nth-last-child(3) {
    text-align: right;
}

.position-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: rgba(225, 6, 0, 0.12);
    border: 1px solid rgba(225, 6, 0, 0.28);
    font-weight: 700;
}

.race-list {
    display: grid;
    gap: 16px;
}

.race-card {
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.03);
}

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

.race-card-head h4 {
    margin-bottom: 6px;
    font-size: 1.15rem;
}

.race-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.chip {
    border-radius: 999px;
    border: 1px solid var(--border);
    padding: 6px 10px;
    font-size: 0.82rem;
    color: var(--muted);
}

.race-session-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.session-box {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.025);
}

.session-box h5 {
    margin: 0 0 10px;
    font-size: 0.95rem;
}

.result-list {
    display: grid;
    gap: 8px;
}

.result-row {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) 48px;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.045);
}

.result-driver {
    min-width: 0;
}

.result-driver strong,
.result-driver span {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-driver span {
    color: var(--muted);
    font-size: 0.84rem;
}

.result-points {
    text-align: right;
    font-weight: 700;
}

.empty-state {
    color: var(--muted);
    padding: 8px 0;
}

@media (max-width: 980px) {
    .hero,
    .section-grid,
    .race-session-grid {
        grid-template-columns: 1fr;
    }

    .hero-stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .results-page {
        padding: 18px 14px 28px;
    }

    .topbar,
    .race-card-head {
        flex-direction: column;
    }

    .standings-table th:nth-child(3),
    .standings-table td:nth-child(3) {
        display: none;
    }
}
