/* ── Page title ── */
.page-title {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 1.75rem;
}

.page-title .accent {
    color: var(--red);
}

/* ── Cards ── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: border-color var(--duration) var(--ease);
}

.card:hover {
    border-color: var(--border-strong);
}

.card-highlight {
    border-color: var(--red);
    background: linear-gradient(135deg, rgba(225, 6, 0, 0.08) 0%, var(--bg-card) 60%);
}

.card-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 1rem;
}

/* ── Dashboard grid ── */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Next race hero ── */
.next-race {
    text-align: center;
    padding: 1.5rem 0 0.5rem;
}

.next-race .race-round {
    display: inline-block;
    background: var(--red);
    color: var(--white);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 0.2rem 0.7rem;
    border-radius: 100px;
    margin-bottom: 0.75rem;
}

.next-race .race-name {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 0.35rem;
}

.next-race .race-circuit {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 0.1rem;
}

.next-race .race-location {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.next-race .race-date {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 600;
    color: var(--green);
}

/* ── Last race header ── */
.last-race-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.last-race-header .race-name {
    font-weight: 700;
    font-size: 1.05rem;
}

.last-race-header .race-round {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-family: var(--font-mono);
}

/* ── Tabs ── */
.tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
    background: var(--bg-surface);
    border-radius: var(--radius);
    padding: 0.25rem;
    width: fit-content;
}

.tab {
    padding: 0.5rem 1.25rem;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--duration) var(--ease);
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    color: var(--white);
    background: var(--red);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ── View more link ── */
.view-more {
    display: inline-flex;
    align-items: center;
    margin-top: 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: color var(--duration) var(--ease);
}

.view-more:hover {
    color: var(--red);
}

/* ── Result card header ── */
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1rem;
}

.result-header .race-round {
    display: inline-block;
    background: var(--red);
    color: var(--white);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.15rem 0.5rem;
    border-radius: 100px;
    margin-right: 0.6rem;
    vertical-align: middle;
}

.result-header .race-name {
    font-weight: 700;
    font-size: 1.1rem;
}

.result-header .race-date {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-family: var(--font-mono);
}

/* ── Race meta ── */
.race-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.race-meta span {
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 0.8rem;
    padding: 0.3rem 0.75rem;
    border-radius: 100px;
    border: 1px solid var(--border);
}

/* ── Live session ── */
.live-session-info {
    text-align: center;
    padding: 0.5rem 0;
}

.live-badge {
    display: inline-block;
    background: var(--red);
    color: var(--white);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 0.25rem 0.8rem;
    border-radius: 100px;
    margin-bottom: 0.75rem;
    animation: pulse-bg 2s ease infinite;
}

@keyframes pulse-bg {
    0%, 100% { box-shadow: 0 0 0 0 var(--red-glow); }
    50% { box-shadow: 0 0 0 8px transparent; }
}

.live-session-info h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.session-meta {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.session-meta span:not(:last-child)::after {
    content: ' \00b7 ';
    color: var(--text-muted);
}

/* ── Weather ── */
.weather-card {
    background: linear-gradient(135deg, rgba(0, 230, 118, 0.04) 0%, var(--bg-card) 60%);
}

.weather-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
}

.weather-item {
    text-align: center;
}

.weather-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.3rem;
}

.weather-value {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--green);
}

/* ── Utility ── */
.muted {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.race-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--duration) var(--ease);
}

.race-link:hover {
    color: var(--red);
}

.result-card {
    margin-bottom: 1.5rem;
}

/* ── Table scroll wrapper ── */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -0.25rem;
    padding: 0 0.25rem;
}

/* ── Visibility helpers ── */
.show-mobile {
    display: none;
}

/* ── Schedule mobile cards ── */
.schedule-cards {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.schedule-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: border-color var(--duration) var(--ease);
}

.schedule-card:hover {
    border-color: var(--border-strong);
}

.schedule-card-next {
    border-color: var(--red);
    background: linear-gradient(135deg, rgba(225, 6, 0, 0.06) 0%, var(--bg-card) 60%);
}

.schedule-card-round {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--text-muted);
    min-width: 2rem;
    text-align: center;
}

.schedule-card-body {
    flex: 1;
    min-width: 0;
}

.schedule-card-name {
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.schedule-card-detail {
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.schedule-card-date {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
}

.schedule-card-badge {
    background: var(--red);
    color: var(--white);
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    padding: 0.15rem 0.5rem;
    border-radius: 100px;
    flex-shrink: 0;
}

/* ── Mobile breakpoints ── */
@media (max-width: 768px) {
    .page-title {
        font-size: 1.35rem;
        margin-bottom: 1.25rem;
    }

    .card {
        padding: 1rem;
        border-radius: var(--radius);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .next-race .race-name {
        font-size: 1.25rem;
    }

    .tabs {
        width: 100%;
    }

    .tab {
        flex: 1;
        text-align: center;
        padding: 0.5rem 0.75rem;
        font-size: 0.82rem;
    }

    .result-header {
        flex-direction: column;
        gap: 0.25rem;
    }

    .result-header .race-date {
        font-size: 0.75rem;
    }

    .race-meta {
        gap: 0.35rem;
    }

    .race-meta span {
        font-size: 0.72rem;
        padding: 0.2rem 0.55rem;
    }

    .hide-mobile {
        display: none !important;
    }

    .show-mobile {
        display: flex;
    }

    .weather-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }

    .weather-value {
        font-size: 0.95rem;
    }

    .live-session-info h2 {
        font-size: 1.05rem;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.15rem;
        margin-bottom: 1rem;
    }

    .card {
        padding: 0.75rem;
        border-radius: var(--radius-sm);
    }

    .card-title {
        font-size: 0.62rem;
        margin-bottom: 0.7rem;
    }

    .next-race .race-name {
        font-size: 1.1rem;
    }

    .next-race {
        padding: 0.75rem 0 0.25rem;
    }

    .hide-mobile-sm {
        display: none !important;
    }

    .weather-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .result-header .race-name {
        font-size: 0.95rem;
    }

    .schedule-card {
        padding: 0.7rem 0.75rem;
    }
}
