/* ========================================
   FONTS
   ======================================== */

@font-face {
    font-family: 'Google Sans';
    src: url('../fonts/GoogleSans-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Google Sans';
    src: url('../fonts/GoogleSans-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Google Sans';
    src: url('../fonts/GoogleSans-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ========================================
   BASE & VARIABLES
   ======================================== */

/* Global default font size: drop the root to 14px so all rem-based type,
   buttons, and spacing scale down ~12% (the site read too large). Body keeps
   a readable ~14px via the 1rem body var below. */
html {
    font-size: 14px;
}

:root {
    --bs-body-font-size: 1rem;
    --bs-card-border-width: 0;
    --bs-list-group-border-width: 0;
    --bs-table-border-width: 0;
    --accent: #3b82f6;
    --accent-subtle: rgba(59, 130, 246, 0.08);
    /* Brand the Bootstrap primary to the site accent so buttons, links and
       focus rings match the rest of the UI (was the default #0d6efd). */
    --bs-primary: #3b82f6;
    --bs-primary-rgb: 59, 130, 246;
    --surface-elevated: #ffffff;
    --surface-subtle: #f8fafc;
    --border-subtle: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --nav-height: 56px;
}

body {
    font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h4 {
    font-size: 1.0rem;
}

/* ========================================
   BUTTONS (cohesive, branded, less "default")
   ======================================== */
.btn {
    --bs-btn-font-weight: 500;
    --bs-btn-border-radius: 0.5rem;
    --bs-btn-padding-y: 0.45rem;
    --bs-btn-padding-x: 0.95rem;
    /* Force the site font onto every button — native button/.btn elements
       otherwise fall back to a system font, which is why the search button
       (font-family: inherit) looked right and the rest looked off. */
    font-family: inherit;
    letter-spacing: 0.005em;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.btn-sm { --bs-btn-border-radius: 0.45rem; --bs-btn-padding-y: 0.3rem; --bs-btn-padding-x: 0.7rem; }
.btn-lg { --bs-btn-border-radius: 0.6rem; }

.btn-primary {
    --bs-btn-bg: var(--accent);
    --bs-btn-border-color: var(--accent);
    --bs-btn-hover-bg: #2f6fe0;
    --bs-btn-hover-border-color: #2f6fe0;
    --bs-btn-active-bg: #2563eb;
    --bs-btn-active-border-color: #2563eb;
    --bs-btn-disabled-bg: var(--accent);
    --bs-btn-disabled-border-color: var(--accent);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.10);
}
.btn-primary:hover { box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35); }

/* "Soft" buttons: a subtle fill + crisp border instead of a thin ghost
   outline, so they read as finished buttons next to the solid search button. */
.btn-outline-primary {
    --bs-btn-color: var(--accent);
    --bs-btn-bg: rgba(59, 130, 246, 0.10);
    --bs-btn-border-color: rgba(59, 130, 246, 0.30);
    --bs-btn-hover-bg: var(--accent);
    --bs-btn-hover-border-color: var(--accent);
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #2563eb;
    --bs-btn-active-border-color: #2563eb;
    --bs-btn-active-color: #fff;
}

.btn-outline-secondary {
    --bs-btn-color: var(--text-primary);
    --bs-btn-bg: var(--surface-subtle);
    --bs-btn-border-color: var(--border-subtle);
    --bs-btn-hover-bg: var(--surface-elevated);
    --bs-btn-hover-color: var(--text-primary);
    --bs-btn-hover-border-color: var(--text-tertiary);
    --bs-btn-active-bg: var(--surface-subtle);
    --bs-btn-active-color: var(--text-primary);
}

/* ========================================
   LIGHT THEME
   ======================================== */

[data-bs-theme="light"] {
    --bs-body-bg: #ffffff;
    --bs-card-bg-custom: #f8fafc;
    --bs-table-hover-bg-custom: #f1f5f9;
    --bs-border-color: #e2e8f0;
    --surface-elevated: #ffffff;
    --surface-subtle: #f8fafc;
    --border-subtle: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
}

[data-bs-theme="light"] .navbar-custom {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
}

[data-bs-theme="light"] .card,
[data-bs-theme="light"] .list-group-item {
    background-color: var(--bs-card-bg-custom);
}

/* Homepage Tools row */
.tools-section { margin-top: 2.75rem; margin-bottom: 2.75rem; }
.tool-card {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1.05rem 1.2rem;
    border: 1px solid var(--border-subtle);
    border-radius: 0.7rem;
    background-color: var(--surface-elevated);
    text-decoration: none;
    height: 100%;
    min-height: 76px;
    transition: border-color 0.15s ease, transform 0.15s ease;
}
.tool-card:hover { border-color: var(--bs-primary); transform: translateY(-2px); }
.tool-card .bi { font-size: 1.5rem; color: var(--bs-primary); flex-shrink: 0; }
.tool-card-title {
    display: block; color: var(--text-primary);
    font-family: var(--font-display); font-weight: 700;
    text-transform: uppercase; letter-spacing: .01em; font-size: 0.98rem;
    line-height: 1.1;
}
.tool-card-sub { display: block; font-size: 0.8rem; color: var(--text-secondary); line-height: 1.25; margin-top: 0.1rem; }
.tool-card .bi { transition: transform .15s ease; }
.tool-card:hover .bi { transform: scale(1.08); }

/* Community Pulse — live homepage band */
.pulse-band {
    position: relative;
    overflow: hidden;
    margin: 1.25rem 0 0.25rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    background: var(--surface-elevated);
}
/* Ambient telemetry wave — sits behind the content, clipped to the band. */
.pulse-canvas {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    z-index: 0; pointer-events: none;
}
.pulse-band > *:not(.pulse-canvas) { position: relative; z-index: 1; }
.pulse-head { margin-bottom: 0.65rem; }
.pulse-live {
    display: inline-flex; align-items: center; gap: 0.45rem;
    font-family: var(--font-mono); font-size: 0.66rem; text-transform: uppercase;
    letter-spacing: 0.1em; color: var(--text-tertiary);
}
.pulse-dot {
    width: 7px; height: 7px; border-radius: 50%; background: #ef4444;
    box-shadow: 0 0 0 0 rgba(239,68,68,0.6); animation: pulse-glow 2s infinite;
}
@keyframes pulse-glow {
    0%   { box-shadow: 0 0 0 0 rgba(239,68,68,0.55); }
    70%  { box-shadow: 0 0 0 7px rgba(239,68,68,0); }
    100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
}
.pulse-stats {
    display: flex; flex-wrap: wrap; gap: 1.75rem;
    padding-bottom: 0.85rem; margin-bottom: 0.85rem;
    border-bottom: 1px solid var(--border-subtle);
}
.pulse-stat { display: flex; flex-direction: column; line-height: 1.1; }
.pulse-num {
    font-family: var(--font-display); font-weight: 700;
    font-size: clamp(1.5rem, 4vw, 2rem); color: var(--text-primary);
    letter-spacing: -0.01em;
}
.pulse-lbl {
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--text-tertiary); margin-top: 0.15rem;
}
/* Discipline tabs for the per-category highlights. */
.pulse-cat-tabs {
    display: flex; flex-wrap: wrap; gap: 0.4rem;
    margin-bottom: 0.7rem;
}
.pulse-cat-tab {
    font-family: var(--font-mono); font-size: 0.68rem; text-transform: uppercase;
    letter-spacing: 0.06em; color: var(--text-secondary);
    background: var(--surface-subtle); border: 1px solid var(--border-subtle);
    border-radius: 999px; padding: 0.3rem 0.7rem; cursor: pointer;
    transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.pulse-cat-tab:hover { color: var(--text-primary); border-color: var(--text-tertiary); }
.pulse-cat-tab.active {
    color: var(--accent); border-color: var(--accent);
    background: rgba(59, 130, 246, 0.10); font-weight: 600;
}
/* Per-category highlights — uniform card grid (--cat set inline per panel). */
.pulse-cat-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}
@media (max-width: 575.98px) {
    .pulse-cat-panel { grid-template-columns: 1fr; }
}
.pulse-card {
    display: flex; align-items: center; gap: 0.65rem;
    padding: 0.65rem 0.8rem;
    background: var(--surface-subtle); border: 1px solid var(--border-subtle);
    border-radius: 12px; text-decoration: none;
    transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.pulse-card:hover {
    border-color: var(--cat, var(--accent));
    background: var(--surface-elevated);
    transform: translateY(-1px);
}
.pulse-card-icon {
    flex-shrink: 0; width: 2rem; height: 2rem; border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.95rem; color: var(--cat, var(--accent));
    background: color-mix(in srgb, var(--cat, var(--accent)) 16%, transparent);
}
.pulse-card-body { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.pulse-card-lbl {
    font-family: var(--font-mono); font-size: 0.58rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--cat, var(--accent)); margin-bottom: 0.12rem;
}
.pulse-card-val { font-size: 0.82rem; color: var(--text-secondary); }
.pulse-card-val strong { color: var(--text-primary); font-weight: 600; }

/* Head-to-head comparison */
.compare-table thead th {
    font-family: var(--font-display); text-transform: uppercase;
    font-size: clamp(1.2rem, 2.8vw, 1.55rem); letter-spacing: 0.01em;
    font-weight: 700; line-height: 1.15;
    border: 0 !important; padding-bottom: .6rem;
}
.compare-table thead th.text-muted {  /* the "Metric" middle header */
    font-family: var(--font-mono); font-size: .6rem; letter-spacing: .14em;
    font-weight: 600; color: var(--text-tertiary) !important; vertical-align: middle;
}
.compare-table tbody td { font-size: 0.95rem; padding-top: 0.95rem; padding-bottom: 0.95rem; vertical-align: middle; }
/* The two driver-value columns read as instrument numerics. */
.compare-table tbody td:first-child,
.compare-table tbody td:last-child {
    font-family: var(--font-mono); font-variant-numeric: tabular-nums;
    font-size: 1.3rem; font-weight: 600;
}
/* The centre metric label in mono caps. */
.compare-table tbody td:nth-child(2) {
    font-family: var(--font-mono); text-transform: uppercase;
    font-size: .76rem !important; letter-spacing: .1em; color: var(--text-secondary) !important;
}
.compare-table tbody tr { border-bottom: 1px solid var(--border-subtle); }
.compare-table tbody tr:last-child { border-bottom: 0; }
.compare-table tbody tr:hover { background: var(--surface-subtle); }
.compare-picker {
    position: relative;
    background:
        radial-gradient(130% 130% at 50% -25%, var(--accent-subtle), transparent 60%),
        var(--surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 2rem 1.75rem 1.75rem;
    box-shadow: 0 18px 48px -24px rgba(15, 23, 42, 0.35);
}
/* Two driver slots flanking a centred VS medallion. */
.vs-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: end;
    gap: 0.85rem;
}
.vs-slot { position: relative; min-width: 0; }
.vs-slot-label {
    display: block; margin-bottom: 0.45rem; padding-left: 0.15rem;
    font-family: var(--font-mono); text-transform: uppercase;
    letter-spacing: 0.12em; font-size: 0.62rem; font-weight: 600;
    color: var(--text-tertiary);
}
.vs-input-wrap { position: relative; }
.vs-input-icon {
    position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%);
    color: var(--text-tertiary); font-size: 0.95rem; pointer-events: none;
    transition: color 0.15s ease;
}
.compare-picker .cmp-search {
    height: 52px; border-radius: 12px;
    padding-left: 2.55rem; padding-right: 1rem;
    background-color: var(--surface-subtle);
    border: 1.5px solid var(--border-subtle);
    font-size: 0.98rem; font-weight: 500; color: var(--text-primary);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.compare-picker .cmp-search::placeholder { color: var(--text-tertiary); font-weight: 400; }
.compare-picker .cmp-search:focus {
    background-color: var(--surface-elevated);
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-subtle);
}
.vs-slot:focus-within .vs-input-icon { color: var(--accent); }
/* Selected-driver state: accent border + check, hide the search glyph. */
.vs-slot.is-selected .cmp-search {
    background-color: var(--surface-elevated);
    border-color: var(--accent);
    padding-left: 1rem; padding-right: 2.5rem; font-weight: 600;
}
.vs-slot.is-selected .vs-input-icon { opacity: 0; }
.vs-slot-check {
    position: absolute; right: 0.9rem; top: 50%;
    transform: translateY(-50%) scale(0.5);
    color: var(--accent); font-size: 1.15rem;
    opacity: 0; pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.vs-slot.is-selected .vs-slot-check { opacity: 1; transform: translateY(-50%) scale(1); }
/* Centre VS medallion (nudged to sit centred on the 52px inputs). */
.vs-divider { display: flex; align-items: center; justify-content: center; margin-bottom: 3px; }
.vs-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 46px; height: 46px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #2563eb);
    color: #fff; font-family: var(--font-display);
    font-weight: 700; font-size: 1rem; letter-spacing: 0.04em;
    border: 3px solid var(--surface-elevated);
    box-shadow: 0 6px 18px -4px rgba(59, 130, 246, 0.55);
}
/* Full-width Compare CTA: muted until both drivers chosen, then a glowing gradient. */
.cmp-go-btn {
    width: 100%; margin-top: 1.5rem; height: 50px;
    border-radius: 12px; font-size: 1rem; font-weight: 600;
}
.cmp-go-btn:disabled {
    background: var(--surface-subtle); border-color: var(--border-subtle);
    color: var(--text-tertiary); box-shadow: none; opacity: 1;
}
.cmp-go-btn:not(:disabled) {
    background: linear-gradient(135deg, var(--accent), #2563eb);
    border-color: transparent;
    box-shadow: 0 10px 26px -8px rgba(59, 130, 246, 0.6);
}
/* Autocomplete dropdown. */
.cmp-results {
    top: calc(100% + 6px); left: 0;
    padding: 0.3rem; border-radius: 12px;
    border: 1px solid var(--border-subtle);
    background-color: var(--surface-elevated);
    box-shadow: 0 16px 40px -12px rgba(15, 23, 42, 0.35);
    overflow: hidden;
}
.cmp-results:empty { display: none; }
.cmp-results .list-group-item {
    display: flex; align-items: center; gap: 0.6rem;
    cursor: pointer; border: 0; border-radius: 8px;
    padding: 0.6rem 0.7rem; font-weight: 500;
    background-color: transparent; color: var(--text-primary);
}
.cmp-results .list-group-item i { color: var(--text-tertiary); font-size: 1.05rem; }
.cmp-results .list-group-item:hover,
.cmp-results .list-group-item:focus {
    background-color: var(--accent-subtle); color: var(--accent);
}
.cmp-results .list-group-item:hover i { color: var(--accent); }
@media (max-width: 575.98px) {
    .vs-grid { grid-template-columns: 1fr; gap: 0.5rem; }
    .vs-divider { margin: 0.15rem 0; }
    .compare-picker { padding: 1.5rem 1.25rem; }
}
.matchup-chip {
    display: inline-flex; align-items: center;
    padding: 0.4rem 0.85rem; border-radius: 999px;
    border: 1px solid var(--border-subtle); background-color: var(--surface-elevated);
    color: var(--text-primary); text-decoration: none; font-size: 0.875rem;
    transition: border-color 0.15s ease, transform 0.15s ease;
}
.matchup-chip:hover { border-color: var(--bs-primary); transform: translateY(-1px); }
.cat-pill {
    display: inline-flex; align-items: center;
    padding: 0.3rem 0.8rem; border-radius: 999px; font-size: 0.8rem; font-weight: 500;
    border: 1px solid var(--border-subtle); background-color: var(--surface-elevated);
    color: var(--text-secondary); text-decoration: none; transition: all 0.15s;
}
.cat-pill:hover { border-color: var(--bs-primary); color: var(--bs-primary); }
.cat-pill.active { background-color: var(--accent); border-color: var(--accent); color: #fff; }
.rank-badge {
    display: inline-flex; align-items: center; margin-bottom: 1.25rem;
    padding: 0.3rem 0.8rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600;
    color: var(--accent); background-color: var(--accent-subtle);
    border: 1px solid rgba(59, 130, 246, 0.25); text-decoration: none; transition: all 0.15s;
}
.rank-badge:hover { background-color: var(--accent); color: #fff; }

/* Driver profile header: keep the name + lede column narrow so the action
   buttons (and the Top N% chip stacked beneath them) sit clearly on the right. */
.driver-header-info { max-width: 40rem; }

/* Chart surfaces: white panel in light mode, elevated dark surface in dark mode,
   so transparent Chart.js canvases don't show the gray card background. */
.chart-surface {
    background-color: var(--surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 0.5rem;
    padding: 0.5rem;
}

[data-bs-theme="light"] .table {
    --bs-table-bg: var(--bs-card-bg-custom);
    --bs-table-hover-bg: var(--bs-table-hover-bg-custom);
    --bs-table-striped-bg: var(--bs-table-hover-bg-custom);
}

[data-bs-theme="light"] .race-results-table {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: var(--bs-table-hover-bg-custom);
    --bs-table-striped-bg: var(--bs-table-hover-bg-custom);
}
[data-bs-theme="light"] .race-results-table thead {
    background-color: transparent;
}
[data-bs-theme="light"] .race-results-table thead th {
    border-bottom: 1px solid var(--bs-border-color);
}

/* ========================================
   DARK THEME
   ======================================== */

[data-bs-theme="dark"] {
    --bs-body-bg: #0a0a0a;
    --bs-card-bg-custom: #141414;
    --bs-table-hover-bg-custom: #1e1e1e;
    --bs-border-color: #1e1e1e;
    --surface-elevated: #141414;
    --surface-subtle: #0f0f0f;
    --border-subtle: rgba(255, 255, 255, 0.08);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    --accent-subtle: rgba(59, 130, 246, 0.12);
}

[data-bs-theme="dark"] .navbar-custom {
    background-color: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
}

[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .list-group-item {
    background-color: var(--bs-card-bg-custom);
}

[data-bs-theme="dark"] .table {
    --bs-table-bg: var(--bs-card-bg-custom);
    --bs-table-hover-bg: var(--bs-table-hover-bg-custom);
    --bs-table-striped-bg: var(--bs-table-hover-bg-custom);
}

[data-bs-theme="dark"] .race-results-table {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: var(--bs-table-hover-bg-custom);
    --bs-table-striped-bg: var(--bs-table-hover-bg-custom);
}
[data-bs-theme="dark"] .race-results-table thead {
    background-color: transparent;
}
[data-bs-theme="dark"] .race-results-table thead th {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] #bd-theme.btn-link,
[data-bs-theme="dark"] .theme-toggle-btn {
    color: #fff;
}

[data-bs-theme="dark"] .dropdown-menu .bi {
    color: #fff;
}

[data-bs-theme="dark"] #bd-theme .bi {
    fill: #fff;
}

/* ========================================
   NAVIGATION
   ======================================== */

.navbar-custom {
    padding: 0.5rem 0;
    box-shadow: none;
    transition: background-color 0.2s;
    z-index: 1030;
}

.navbar-logo {
    height: 32px;
    width: auto;
}

.nav-link-custom {
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    padding: 0.4rem 0.75rem !important;
    border-radius: 6px;
    transition: background-color 0.15s, color 0.15s;
    text-decoration: none !important;
    color: var(--text-secondary) !important;
}

.nav-link-custom:hover {
    background-color: var(--accent-subtle);
    color: var(--accent) !important;
}

.theme-toggle-btn {
    border: none !important;
    border-radius: 6px;
    opacity: 0.5;
    transition: opacity 0.15s;
}

.theme-toggle-btn:hover {
    opacity: 1;
}

/* Hide the dropdown caret on theme toggle */
.theme-toggle-btn::after {
    display: none;
}

/* Dropdown menus (theme switcher, etc.) — rounded padded items with a soft
   tinted selected state instead of Bootstrap's harsh full-bleed blue bar. */
.dropdown-menu {
    --bs-dropdown-bg: var(--surface-elevated);
    --bs-dropdown-border-color: var(--border-subtle);
    --bs-dropdown-border-radius: 12px;
    --bs-dropdown-link-color: var(--text-secondary);
    --bs-dropdown-link-hover-bg: var(--surface-subtle);
    --bs-dropdown-link-hover-color: var(--text-primary);
    --bs-dropdown-link-active-bg: rgba(59, 130, 246, 0.16);
    --bs-dropdown-link-active-color: var(--accent);
    padding: 0.35rem;
    box-shadow: 0 12px 32px -12px rgba(15, 23, 42, 0.45);
}
.dropdown-item {
    display: flex; align-items: center; gap: 0.55rem;
    border-radius: 8px;
    padding: 0.45rem 0.6rem;
    font-size: 0.85rem; font-weight: 500;
}
.dropdown-item.active .bi,
.dropdown-item:active .bi { color: var(--accent) !important; }

@media (min-width: 992px) {
    .navbar-center-links {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        margin: 0;
    }

    .navbar-collapse {
        position: static;
    }
}

@media (max-width: 991.98px) {
    .navbar-logo {
        max-width: 130px;
        height: auto;
    }
}

/* ========================================
   LOGO THEME HANDLING
   ======================================== */

.logo-dark { display: none; }
.logo-light { display: inline-block; }
[data-bs-theme="dark"] .logo-dark { display: inline-block; }
[data-bs-theme="dark"] .logo-light { display: none; }

@media (prefers-color-scheme: dark) {
    [data-bs-theme="auto"] .logo-dark { display: inline-block; }
    [data-bs-theme="auto"] .logo-light { display: none; }
}

@media (prefers-color-scheme: light) {
    [data-bs-theme="auto"] .logo-dark { display: none; }
    [data-bs-theme="auto"] .logo-light { display: inline-block; }
}

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

main.container {
    margin-top: 24px;
}

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

.card {
    border: none !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.06);
    border-radius: 10px;
}

[data-bs-theme="dark"] .card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.card-header {
    padding: 1.25rem 1.25rem;
}

.card-header h2,
.card-header h3,
.card-header h4,
.card-header h5 {
    font-size: 0.9rem;
    font-weight: 600;
}

.list-group-item h5 {
    font-size: 0.9rem;
    font-weight: 600;
}

/* Mobile race result cards should have borders */
.mobile-race-card {
    border: 1px solid var(--bs-border-color) !important;
}

/* ========================================
   HERO LANDING PAGE
   ======================================== */

.hero-landing {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 0;
}

.hero-logo-wrapper {
    margin-bottom: 1rem;
}

.hero-logo {
    max-width: 420px;
    width: 100%;
    height: auto;
}

.hero-subtitle {
    font-size: 0.9rem;
    color: var(--text-tertiary);
    margin-bottom: 2.5rem;
    letter-spacing: 0.01em;
}

.hero-search-wrapper {
    max-width: 520px;
    margin: 0 auto;
}

.hero-famous-driver {
    margin-top: 1.5rem;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 1.5em;
}

.famous-driver-cycle-link {
    color: var(--accent);
    font-weight: 500;
    text-decoration: none;
    transition: opacity 0.3s, transform 0.3s;
}

.famous-driver-cycle-link:hover {
    text-decoration: underline;
    color: var(--accent);
}

.hero-nav-links {
    margin-top: 2.5rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.hero-nav-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 1rem;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--text-secondary);
    background-color: var(--surface-subtle);
    border: 1px solid var(--border-subtle);
    transition: all 0.15s;
}

.hero-nav-pill:hover {
    color: var(--accent);
    border-color: var(--accent);
    background-color: var(--accent-subtle);
}

.hero-nav-pill i {
    font-size: 0.75rem;
}

@media (max-width: 768px) {
    .hero-logo {
        max-width: 260px;
    }
    .hero-subtitle {
        font-size: 0.8rem;
    }
}

/* ========================================
   SEARCH BAR
   ======================================== */

.search-bar {
    display: flex;
    align-items: center;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    background-color: var(--surface-elevated);
    padding: 0.25rem 0.25rem 0.25rem 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    gap: 0.5rem;
}

.search-bar:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

.search-bar-icon {
    color: var(--text-tertiary);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.search-bar-input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.9rem;
    flex: 1;
    padding: 0.5rem 0;
    color: var(--text-primary);
    font-family: inherit;
    min-width: 0;
}

.search-bar-input::placeholder {
    color: var(--text-tertiary);
}

.search-bar-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: none;
    background-color: var(--accent);
    color: white;
    padding: 0.5rem 1.1rem;
    border-radius: 9px;
    font-size: 0.8rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.15s, transform 0.1s;
    white-space: nowrap;
    flex-shrink: 0;
}

.search-bar-btn:hover {
    background-color: #2563eb;
}

.search-bar-btn:active {
    transform: scale(0.97);
}

.search-bar-btn-icon {
    font-size: 0.8rem;
}

/* Legacy support for old search-input-group */
.search-input-group {
    border-radius: .375rem;
    overflow: hidden;
    border: var(--bs-border-width) solid var(--bs-border-color);
}

.search-input-group:focus-within {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.search-input-group .form-control {
    border: 0;
    box-shadow: none;
}

.search-input-group .btn {
    border: 0;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

@media (max-width: 576px) {
    .search-bar {
        padding: 0.2rem 0.2rem 0.2rem 0.75rem;
    }
    .search-bar-input {
        font-size: 0.85rem;
    }
    .search-bar-btn-text {
        display: none;
    }
}

/* ========================================
   SEARCH RESULTS PAGE
   ======================================== */

.search-results-hero {
    padding: 3rem 0 4rem;
}

.search-page-logo {
    height: 36px;
    width: auto;
}

/* Homepage top nav — sits beside the in-hero logo, aligned with the search bar. */
.search-page-nav { gap: 0.15rem; }
.search-page-nav .nav-link-custom { white-space: nowrap; }

.search-results-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    color: var(--text-tertiary);
}

.search-results-query {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0.25rem 0 0;
    color: var(--text-primary);
}

.search-result-count {
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

.search-results-list-new {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.search-result-card {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    background-color: var(--surface-elevated);
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}

.search-result-card:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.08);
    color: inherit;
    transform: translateY(-1px);
}

.search-result-card-inner {
    display: flex;
    align-items: center;
    padding: 0.85rem 1rem;
    gap: 0.85rem;
}

.search-result-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background-color: var(--accent-subtle);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.search-result-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.search-result-name {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result-id {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.search-result-arrow {
    color: var(--text-tertiary);
    font-size: 0.85rem;
    flex-shrink: 0;
    transition: transform 0.15s, color 0.15s;
}

.search-result-card:hover .search-result-arrow {
    color: var(--accent);
    transform: translateX(2px);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state-icon {
    font-size: 2rem;
    color: var(--text-tertiary);
    margin-bottom: 1rem;
    display: block;
}

.empty-state-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* ========================================
   FAMOUS DRIVERS (Search Results)
   ======================================== */

.famous-drivers-section {
    margin-top: 2.5rem;
}

.section-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    color: var(--text-tertiary);
    margin-bottom: 0.75rem;
}

.famous-drivers-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.famous-driver-chip {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--text-secondary);
    background-color: var(--surface-subtle);
    border: 1px solid var(--border-subtle);
    transition: all 0.15s;
}

.famous-driver-chip:hover {
    color: var(--accent);
    border-color: var(--accent);
    background-color: var(--accent-subtle);
}

/* Legacy famous-driver-card support */
.famous-driver-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    cursor: pointer;
    height: 100%;
    min-height: 80px;
    box-shadow: none !important;
}

.famous-driver-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

[data-bs-theme="dark"] .famous-driver-card {
    background-color: var(--bs-gray-800);
    border: 1px solid var(--bs-gray-700);
}

[data-bs-theme="dark"] .famous-driver-card:hover {
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1) !important;
}

[data-bs-theme="light"] .famous-driver-card {
    background-color: var(--bs-white);
    border: 1px solid var(--bs-gray-300);
}

/* ========================================
   FEATURED SERIES (Search Results)
   ======================================== */

.featured-series-section {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-subtle);
}

.series-category-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.7rem;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid var(--border-subtle);
    text-decoration: none;
    transition: color 0.15s;
}

.series-category-label:hover {
    color: var(--accent);
}

/* A small accent square per discipline gives each category its own identity so
   the list reads as distinct sections instead of one wall of text. */
.series-category-label::before {
    content: "";
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 2px;
    background: var(--accent);
    flex: 0 0 auto;
}
.series-cat-block[data-cat="sports-car"]  .series-category-label::before { background: #34d399; }
.series-cat-block[data-cat="formula-car"] .series-category-label::before { background: #a78bfa; }
.series-cat-block[data-cat="oval"]        .series-category-label::before { background: #fbbf24; }
.series-cat-block[data-cat="dirt-oval"]   .series-category-label::before { background: #fb923c; }
.series-cat-block[data-cat="dirt-road"]   .series-category-label::before { background: #f87171; }

.series-link-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.series-link-item-new {
    font-size: 0.84rem;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.3rem 0.5rem;
    margin: 0 -0.5rem;
    border-radius: 6px;
    transition: color 0.12s, background 0.12s;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.series-link-item-new:hover {
    color: var(--accent);
    background: var(--surface-subtle);
}

/* One block per category, every series listed. Series flow into as many
   responsive columns as fit so a 40-series category stays compact. */
.series-cat-block { margin-bottom: 2.25rem; }
.series-cat-block:last-child { margin-bottom: 0; }

.series-category-label .series-cat-count {
    margin-left: 0.5rem;
    font-size: 0.66rem;
    font-weight: 600;
    color: var(--text-tertiary);
    background: var(--surface-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    padding: 0.05rem 0.45rem;
    vertical-align: middle;
}

.series-link-cols {
    display: block;          /* override the flex column for CSS multi-columns */
    columns: 240px;
    column-gap: 2rem;
}
.series-link-cols .series-link-item-new {
    display: block;
    break-inside: avoid;
    white-space: normal;     /* allow long series names to wrap, not clip */
    overflow: visible;
    text-overflow: clip;
    line-height: 1.3;
}

/* ========================================
   FOOTER
   ======================================== */

.site-footer {
    padding: 2rem 0;
    margin-top: 3rem;
    border-top: 1px solid var(--border-subtle);
}

.site-footer--landing {
    border-top: none;
    margin-top: 0;
    padding: 1.5rem 0;
}

.footer-logo {
    height: 22px;
    width: auto;
    opacity: 0.4;
}

.footer-copyright {
    font-size: 0.75rem;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s;
}

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

.footer-nav-link {
    font-size: 0.75rem;
}

.bmc-btn {
    font-size: 0.7rem;
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
}

/* Cookie banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    padding: 1rem;
    background-color: var(--surface-elevated);
    border-top: 1px solid var(--border-subtle);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

/* ========================================
   UPDATE NOTIFICATION BANNER
   ======================================== */

#update-banner {
    position: sticky;
    top: 70px;
    z-index: 1020;
    margin-bottom: 1rem;
    border-radius: 0.375rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#update-banner .btn-close {
    padding: 0.5rem;
}

[data-bs-theme="dark"] #update-banner {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* ========================================
   DRIVER STATS PAGE
   ======================================== */

.driver-stats-page h2.driver-name, .race-results-page h2.display-5 {
    font-size: 1.75rem;
}

.driver-stats-page .card-title {
    font-size: 1rem;
}

.driver-name {
    font-size: 1.5rem !important;
}

.career-stats-text {
    font-size: 1.1rem !important;
}

h3.stat-value {
    font-size: 2rem !important;
    font-weight: 500;
}

@media (max-width: 767.98px) {
    h3.stat-value {
        font-size: 1.5rem !important;
        font-weight: 500;
    }
}

.driver-name-link {
    font-weight: 500;
}

/* ========================================
   FORM ELEMENTS
   ======================================== */

.form-select {
    font-size: .875rem;
    padding-top: .25rem;
    padding-bottom: .25rem;
    padding-left: .5rem;
}

/* ========================================
   LICENSE PLATES
   ======================================== */

.license-plate {
    display: inline-block;
    padding: 0.2em 0.4em;
    font-size: 0.8em;
    font-weight: bold;
    color: #fff;
    border-radius: 0.2rem;
}

.license-r {
    background-color: #d9534f;
    border: 1px solid #d43f3a;
}

.license-d {
    background-color: #f0ad4e;
    border: 1px solid #eea236;
}

.license-c {
    background-color: #f0e44e;
    border: 1px solid #e5d936;
    color: #333;
    text-shadow: none;
}

.license-b {
    background-color: #5cb85c;
    border: 1px solid #4cae4c;
}

.license-a {
    background-color: #0275d8;
    border: 1px solid #025aa5;
}

.license-pro {
    background: linear-gradient(45deg, #f0e44e, #d9534f, #0275d8);
    border: 1px solid #aaa;
}

.license-p {
    background-color: #111;
    border: 1px solid #000;
}

.license-n {
    background-color: #777;
    border: 1px solid #666;
}

/* ========================================
   TABLES
   ======================================== */

.table tbody tr td {
    vertical-align: middle;
}

/* Race results list-group styling */
/* Race finishing-order list adopts the championship "timing" treatment. */
.race-results-list { font-family: var(--font-mono); }

/* On the bare page (no card), the race list mirrors the leaderboard timing
   table: each row a separated panel with an inset hairline + hover slide. */
.race-results-list .list-group-item:not(.fw-bold) {
    background: var(--surface-elevated) !important;
    box-shadow: inset 0 0 0 1px var(--border-subtle);
    border: 0 !important;
    border-radius: .55rem;
    margin-bottom: 4px;
    padding: 0.6rem 1rem;
    transition: transform .12s ease, box-shadow .12s ease;
}

.race-results-list .list-group-item:not(.fw-bold):hover {
    transform: translateX(3px);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, var(--border-subtle));
}

.race-results-list .list-group-item .row {
    margin-left: 0;
    margin-right: 0;
}

/* Car name is secondary info — smaller + muted so it doesn't compete with
   the driver names (and wraps less awkwardly in its narrow column). */
.race-results-list .car-cell {
    font-size: 0.78rem;
    line-height: 1.2;
    color: var(--text-secondary);
}

/* Lazy-refresh pill: a self-contained centered chip at the top of the
   recent-races card while the latest results load (stale driver page). A pill
   (not a full-width bar) reads cleanly at any width, including narrow phones. */
.races-refresh-bar {
    display: flex; align-items: center; justify-content: center; gap: 0.45rem;
    width: fit-content; max-width: calc(100% - 1.6rem);
    margin: 0.85rem auto;
    padding: 0.45rem 0.9rem;
    background: var(--surface-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
}
.races-refresh-label {
    font-family: var(--font-mono); font-size: 0.74rem;
    letter-spacing: 0.02em; color: var(--text-secondary);
    white-space: nowrap;
}

.race-results-list .list-group-item.fw-bold {
    font-family: var(--font-mono);
    font-weight: 600 !important;
    text-transform: uppercase;
    font-size: 0.62rem;
    letter-spacing: 0.14em;
    color: var(--text-tertiary);
    background: transparent !important;
    border: 0 !important;
    padding: 0.2rem 1rem 0.4rem !important;
    margin-top: 0 !important;
}

/* Stats by category table */
/* Driver-profile tables adopt the championship "timing" treatment:
   separated rows with an inset hairline, hover slide, mono numerics, and
   condensed-mono uppercase headers. */
.stats-by-category-table {
    margin-bottom: 0 !important;
    border-collapse: collapse !important;
    font-family: var(--font-mono);
}

.stats-by-category-table thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.62rem;
    letter-spacing: 0.14em;
    color: var(--text-tertiary);
    border: 0 !important;
    background: transparent !important;
    padding: 0.2rem 1.25rem 0.65rem;
}

.stats-by-category-table tbody tr {
    background: transparent !important;
    border-bottom: 1px solid var(--border-subtle);
    transition: background-color .12s ease;
}
.stats-by-category-table tbody tr:last-child { border-bottom: 0; }

.stats-by-category-table tbody tr:hover {
    background: var(--surface-subtle) !important;
}

.stats-by-category-table tbody td {
    border: 0 !important;
    background: transparent !important;
    padding: 0.7rem 1.25rem;
    vertical-align: middle;
}

.stats-by-category-table tbody td:first-child {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: .01em;
    color: var(--text-primary);
}

/* Splits table */
.splits-table th,
.splits-table td {
    padding: 0.5rem 1rem;
}

.splits-table thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--bs-secondary-color);
    border-top: 1px solid var(--bs-border-color);
}

[data-bs-theme="light"] .splits-table thead {
    background-color: #f8f9fa;
}

[data-bs-theme="dark"] .splits-table thead {
    background-color: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="light"] .splits-table tbody tr {
    background-color: #ffffff;
}

[data-bs-theme="dark"] .splits-table tbody tr {
    background-color: var(--bs-card-bg-custom);
}

.splits-expand-row {
    background-color: #ffffff !important;
}

[data-bs-theme="dark"] .splits-expand-row {
    background-color: var(--bs-card-bg-custom) !important;
}

/* Race results table */
.race-results-table th,
.race-results-table td {
    padding: 0.75rem 1rem;
}

.race-results-table thead th {
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: var(--bs-secondary-color);
}

/* Recent Races Table */
/* Recent races + race-result tables share the championship "timing" look. */
.recent-races-table,
.race-results-table {
    margin-bottom: 0 !important;
    border-collapse: collapse !important;
    font-family: var(--font-mono);
}

.recent-races-table thead th,
.race-results-table thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.62rem;
    letter-spacing: 0.14em;
    color: var(--text-tertiary);
    border: 0 !important;
    background: transparent !important;
    padding: 0.2rem 1.25rem 0.65rem;
}

.recent-races-table tbody tr,
.race-results-table tbody tr {
    background: transparent !important;
    border-bottom: 1px solid var(--border-subtle);
    transition: background-color .12s ease;
}
.recent-races-table tbody tr:last-child,
.race-results-table tbody tr:last-child { border-bottom: 0; }

.recent-races-table tbody tr:hover,
.race-results-table tbody tr:hover {
    background: var(--surface-subtle) !important;
}

.recent-races-table tbody td,
.race-results-table tbody td {
    border: 0 !important;
    background: transparent !important;
    padding: 0.7rem 1.25rem;
    vertical-align: middle;
}
/* Series-name column in the condensed display face, matching leaderboard names. */
.recent-races-table tbody td:nth-child(2) {
    font-family: var(--font-display); font-weight: 600; font-size: 1.02rem;
}

/* Series/driver name columns read in the condensed display face. */
.recent-races-table tbody td:nth-child(2),
.race-results-table .name-col { font-family: var(--font-display); font-weight: 600; font-size: 1rem; }

/* ========================================
   RACE DETAIL ELEMENTS
   ======================================== */

.race-details-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
}

.race-detail-value {
    font-size: 1.1rem;
    font-weight: 500;
}

.race-series-name {
    font-size: 1.1rem;
    font-weight: 600;
}

.race-track-info {
    font-size: 0.8rem;
}

.race-main-row {
    background-color: rgba(0,0,0,0.02);
}

[data-bs-theme="dark"] .race-main-row {
    background-color: rgba(255,255,255,0.03);
}

.race-main-row td {
    border-bottom: 0 !important;
}

.race-details-row td {
    padding: 0 !important;
}

.race-details-container {
    display: flex;
    justify-content: space-around;
    padding: 0.75rem 1rem;
}

[data-bs-theme="dark"] .race-details-container {
    background-color: transparent;
}

.race-detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.8rem;
}

.race-detail-label {
    font-weight: 600;
    color: var(--bs-secondary-color);
    font-size: 0.7rem;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

@media (max-width: 767.98px) {
    .stats-by-category-table {
        font-size: 0.8rem;
    }

    .race-track-info {
        font-size: 0.75rem;
    }

    .race-details-grid {
        gap: 0.5rem;
    }

    .race-detail-label {
        font-size: 0.6rem;
    }

    .race-detail-value {
        font-size: 1rem;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .col-md-5-cols {
        flex: 0 0 auto;
        width: 20%;
    }
}

/* ========================================
   STAT ITEMS
   ======================================== */

.stats-container {
    display: flex;
    flex-wrap: wrap;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
    text-align: center;
}

.stat-item {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    flex: 0 0 20%;
    max-width: 20%;
}

.desktop-stat-separator {
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    height: 4px;
}

/* ========================================
   LINKS
   ======================================== */

a.text-reset {
    text-decoration: underline;
}

.link-black-underlined {
    color: var(--bs-body-color);
    text-decoration: underline;
    font-weight: 600;
}

.link-black-underlined:hover {
    color: var(--bs-body-color);
    text-decoration: underline;
    font-weight: 600;
}

/* Race results series link */
.race-series-link {
    text-decoration: underline;
}

[data-bs-theme="light"] .race-series-link {
    color: black;
}

[data-bs-theme="dark"] .race-series-link {
    color: white;
}

/* ========================================
   LOGOS
   ======================================== */

.main-logo {
    max-width: 400px;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .main-logo {
        max-width: 330px;
    }
}

.search-results-list {
    min-width: 300px;
    max-width: 600px;
    margin: 0 auto;
}

.famous-driver-item {
    padding: 0.5rem 1rem;
}

.famous-driver-link {
    font-size: 1.1rem;
}

/* ========================================
   ANIMATION
   ======================================== */

.spinner-animation {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   BADGES
   ======================================== */

.verified-badge {
    font-size: 0.8rem !important;
    padding: 0.2rem 0.5rem;
    border-radius: 50px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background-color: var(--accent) !important;
    color: white !important;
    border: 2px solid var(--accent);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.verified-badge i {
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .verified-badge {
        font-size: 0.7rem !important;
        padding: 0.4rem 0.6rem;
    }

    .verified-badge i {
        font-size: 0.8rem;
    }
}

/* ========================================
   TOOLTIPS
   ======================================== */

.tooltip .tooltip-inner {
    font-size: 0.6rem !important;
    max-width: 280px !important;
    line-height: 1.2 !important;
    padding: 0.3rem 0.5rem !important;
}

.tooltip .tooltip-inner a {
    color: #ffeb3b !important;
    text-decoration: underline !important;
}

.tooltip .tooltip-inner a:hover {
    color: #fff59d !important;
}

.tooltip:hover {
    visibility: visible !important;
    opacity: 1 !important;
}

/* ========================================
   CATEGORY TAGS
   ======================================== */

.category-text {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.category-formula-road {
    color: #e74c3c;
    background-color: rgba(231, 76, 60, 0.1);
}

.category-sports-car {
    color: #28a745;
    background-color: rgba(40, 167, 69, 0.1);
}

.category-road {
    color: #6c757d;
    background-color: rgba(108, 117, 125, 0.1);
}

.category-oval {
    color: #007bff;
    background-color: rgba(0, 123, 255, 0.1);
}

.category-dirt-oval {
    color: #6f4f28;
    background-color: rgba(111, 79, 40, 0.1);
}

.category-dirt-road {
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}

/* ========================================
   STANDINGS TABLE
   ======================================== */

/* Series standings + series recent races (contained in cards) get the same
   clean hairline + mono treatment as the driver-profile tables, matching the
   leaderboard type scale. */
.standings-table,
.contained-data-table {
    font-family: var(--font-mono);
    border-collapse: collapse !important;
    margin-bottom: 0;
}
.standings-table thead th,
.contained-data-table thead th {
    font-weight: 600; text-transform: uppercase;
    font-size: 0.62rem; letter-spacing: 0.14em;
    color: var(--text-tertiary);
    border: 0 !important; background: transparent !important;
    padding: 0.2rem 1rem 0.65rem;
}
.standings-table tbody tr,
.contained-data-table tbody tr {
    background: transparent !important;
    border-bottom: 1px solid var(--border-subtle);
    transition: background-color .12s ease;
}
.standings-table tbody tr:last-child,
.contained-data-table tbody tr:last-child { border-bottom: 0; }
.standings-table tbody tr:hover,
.contained-data-table tbody tr:hover { background: var(--surface-subtle) !important; }
.standings-table tbody td,
.contained-data-table tbody td {
    border: 0 !important; background: transparent !important;
    padding: 0.7rem 1rem; vertical-align: middle;
}
/* Driver/winner name columns read in the condensed display face, like the
   leaderboard driver column. */
.standings-table tbody td:nth-child(2),
.contained-data-table tbody td:nth-child(4) {
    font-family: var(--font-display); font-weight: 600; font-size: 1.02rem;
}

.standings-table .flag-icon {
    width: 1.2em;
    height: 0.9em;
    vertical-align: baseline;
}

@media (max-width: 768px) {
    .standings-table {
        font-size: 0.75rem;
    }

    .standings-table th {
        font-size: 0.65rem;
        padding: 0.5rem 0.25rem;
    }

    .standings-table td {
        padding: 0.5rem 0.25rem;
    }

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

/* ============================================================
   CHAMPIONSHIPS & LEADERBOARDS — "Timing Tower" design system
   Motorsport-instrument aesthetic: condensed display type,
   monospaced numerics, podium hierarchy, dense timing rows.
   Cohesive with the global accent + light/dark surface tokens.
   ============================================================ */
:root {
    --font-display: 'Saira Condensed', 'Google Sans', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;
    --gold:   #f5c518;
    --silver: #cbd5e1;
    --bronze: #d08b54;
}
[data-bs-theme="dark"] { --silver: #aab4c2; }

/* ---- Hero band ------------------------------------------------ */
.lb-hero {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    border: 1px solid var(--border-subtle);
    padding: 2.4rem 1.75rem 2rem;
    margin-bottom: 1.75rem;
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(59,130,246,0.16), transparent 55%),
        linear-gradient(180deg, var(--surface-elevated), var(--surface-subtle));
}
.lb-hero::before {  /* diagonal speed lines */
    content: "";
    position: absolute; inset: 0;
    background-image: repeating-linear-gradient(
        -64deg, transparent 0 22px,
        color-mix(in srgb, var(--text-primary) 4%, transparent) 22px 24px);
    -webkit-mask-image: linear-gradient(105deg, #000, transparent 62%);
            mask-image: linear-gradient(105deg, #000, transparent 62%);
    pointer-events: none;
}
.lb-hero::after {  /* checkered flag corner */
    content: "";
    position: absolute; top: 0; right: 0; width: 120px; height: 120px;
    background-image:
        linear-gradient(45deg, color-mix(in srgb, var(--text-primary) 8%, transparent) 25%, transparent 25%, transparent 75%, color-mix(in srgb, var(--text-primary) 8%, transparent) 75%),
        linear-gradient(45deg, color-mix(in srgb, var(--text-primary) 8%, transparent) 25%, transparent 25%, transparent 75%, color-mix(in srgb, var(--text-primary) 8%, transparent) 75%);
    background-size: 18px 18px;
    background-position: 0 0, 9px 9px;
    -webkit-mask-image: radial-gradient(120px 120px at 100% 0%, #000, transparent 70%);
            mask-image: radial-gradient(120px 120px at 100% 0%, #000, transparent 70%);
    opacity: .6; pointer-events: none;
}
.lb-hero > * { position: relative; z-index: 1; }
.lb-eyebrow {
    font-family: var(--font-mono);
    font-size: .72rem; font-weight: 600; letter-spacing: .22em;
    text-transform: uppercase; color: var(--accent);
    display: inline-flex; align-items: center; gap: .5rem;
}
.lb-title {
    font-family: var(--font-display);
    font-weight: 800; letter-spacing: .005em; line-height: .98;
    text-transform: uppercase;
    font-size: clamp(2rem, 5vw, 3.25rem);
    color: var(--text-primary); margin: .35rem 0 .35rem;
}
.lb-sub { color: var(--text-secondary); max-width: 46rem; margin: 0; }
.lb-hero-logo {
    height: 56px; width: auto; object-fit: contain;
    filter: drop-shadow(0 4px 14px rgba(0,0,0,.25));
}

/* ---- Category chips ------------------------------------------- */
.cat-chip {
    display: inline-flex; align-items: center; gap: .4rem;
    font-family: var(--font-mono);
    font-size: .68rem; font-weight: 600; letter-spacing: .12em;
    text-transform: uppercase;
    padding: .28rem .6rem; border-radius: .4rem;
    border: 1px solid currentColor;
}
.cat-chip[data-cat="oval"]        { color:#3b82f6; }
.cat-chip[data-cat="sports-car"]  { color:#22c55e; }
.cat-chip[data-cat="formula-car"],
.cat-chip[data-cat="formula-road"]{ color:#ef4444; }
.cat-chip[data-cat="dirt-oval"]   { color:#d08b54; }
.cat-chip[data-cat="dirt-road"]   { color:#f59e0b; }
.cat-chip[data-cat="road"]        { color:#94a3b8; }
.cat-chip .dot { width:.5rem; height:.5rem; border-radius:50%; background:currentColor; }

/* ---- Championship index grid --------------------------------- */
.champ-cat-label {
    font-family: var(--font-display);
    text-transform: uppercase; letter-spacing: .05em; font-weight: 700;
    font-size: 1.05rem; color: var(--text-primary);
    display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem;
}
.champ-cat-label::after {
    content: ""; flex: 1; height: 1px;
    background: linear-gradient(90deg, var(--border-subtle), transparent);
}
.champ-card {
    display: flex; align-items: center; gap: .85rem;
    padding: .8rem .9rem; height: 100%;
    border: 1px solid var(--border-subtle); border-radius: .7rem;
    background: var(--surface-elevated); text-decoration: none;
    position: relative; overflow: hidden;
    transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
}
.champ-card::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    background: var(--accent); transform: scaleY(0); transform-origin: bottom;
    transition: transform .16s ease;
}
.champ-card:hover {
    transform: translateY(-2px); border-color: var(--accent);
    box-shadow: 0 10px 26px -16px rgba(59,130,246,.7);
}
.champ-card:hover::before { transform: scaleY(1); }
.champ-card .series-logo,
.champ-card .series-logo-placeholder {
    width: 34px; height: 34px; object-fit: contain; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.champ-card-name {
    font-weight: 600; color: var(--text-primary); line-height: 1.2;
    display: block;
}
.champ-card-meta {
    font-family: var(--font-mono); font-size: .68rem; letter-spacing: .08em;
    text-transform: uppercase; color: var(--text-tertiary);
}
.champ-card .bi-chevron-right { color: var(--text-tertiary); transition: transform .14s ease; }
.champ-card:hover .bi-chevron-right { transform: translateX(3px); color: var(--accent); }

/* ---- Season hub cards ---------------------------------------- */
.season-card {
    display: flex; flex-direction: column; gap: .35rem;
    padding: 1rem 1.1rem; height: 100%;
    border: 1px solid var(--border-subtle); border-radius: .7rem;
    background: var(--surface-elevated); text-decoration: none;
    transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
}
.season-card:hover {
    transform: translateY(-2px); border-color: var(--accent);
    box-shadow: 0 12px 28px -18px rgba(59,130,246,.7);
}
.season-card-year {
    font-family: var(--font-display); font-weight: 800; font-size: 1.7rem;
    line-height: 1; color: var(--text-primary); text-transform: uppercase;
}
.season-card-q {
    font-family: var(--font-mono); font-size: .72rem; font-weight: 600;
    letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
}
.season-card-foot {
    margin-top: auto; padding-top: .6rem;
    color: var(--text-tertiary); font-size: .8rem;
    display: flex; align-items: center; gap: .4rem;
}
.season-card.is-current { border-color: color-mix(in srgb, var(--accent) 45%, var(--border-subtle)); }
.season-live {
    font-family: var(--font-mono); font-size: .62rem; font-weight: 700;
    letter-spacing: .14em; text-transform: uppercase;
    color: #22c55e; display: inline-flex; align-items: center; gap: .35rem;
}
.season-live .dot { width:.5rem; height:.5rem; border-radius:50%; background:#22c55e;
    box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: livePulse 1.8s infinite; }
@keyframes livePulse { 70%{ box-shadow:0 0 0 6px rgba(34,197,94,0);} 100%{box-shadow:0 0 0 0 rgba(34,197,94,0);} }

/* ---- Podium (top 3) ------------------------------------------ */
.podium {
    display: grid; grid-template-columns: 1fr 1.18fr 1fr;
    align-items: end; gap: .9rem; margin-bottom: 1.5rem;
}
.podium-card {
    position: relative; border: 1px solid var(--border-subtle);
    border-radius: .85rem; background: var(--surface-elevated);
    padding: 1.1rem 1rem 1rem; text-align: center; overflow: hidden;
    text-decoration: none; display: block;
    transition: transform .15s ease, box-shadow .15s ease;
}
.podium-card:hover { transform: translateY(-3px); box-shadow: 0 16px 34px -20px rgba(0,0,0,.6); }
.podium-card::before {
    content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
    background: var(--tier, var(--accent));
}
.podium-card[data-pos="1"] { padding-top: 1.4rem; --tier: var(--gold);
    background: radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--gold) 16%, var(--surface-elevated)), var(--surface-elevated) 70%); }
.podium-card[data-pos="2"] { --tier: var(--silver); }
.podium-card[data-pos="3"] { --tier: var(--bronze); }
.podium-pos {
    font-family: var(--font-display); font-weight: 800; line-height: 1;
    font-size: 2.4rem; color: var(--tier, var(--accent));
}
.podium-card[data-pos="1"] .podium-pos { font-size: 3rem; }
.podium-crown { font-size: 1.1rem; color: var(--gold); margin-bottom: .2rem; }
.podium-leader-tag {
    font-family: var(--font-mono); font-size: .58rem; font-weight: 700;
    letter-spacing: .16em; text-transform: uppercase; color: #22c55e;
    margin-bottom: .15rem;
}
.podium-name {
    font-family: var(--font-display); font-weight: 700; text-transform: uppercase;
    letter-spacing: .01em; font-size: 1.05rem; color: var(--text-primary);
    margin: .5rem 0 .1rem; line-height: 1.05;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.podium-pts {
    font-family: var(--font-mono); font-weight: 700; font-size: 1.5rem;
    color: var(--text-primary); margin-top: .35rem;
}
.podium-pts small { font-size: .6rem; font-weight: 600; letter-spacing: .12em;
    text-transform: uppercase; color: var(--text-tertiary); display: block; margin-top: .1rem; }
.podium-line {
    font-family: var(--font-mono); font-size: .72rem; color: var(--text-secondary);
    margin-top: .55rem; display: flex; justify-content: center; gap: .9rem; flex-wrap: wrap;
}
.podium-line b { color: var(--text-primary); font-weight: 700; }

/* ---- Timing-tower table -------------------------------------- */
.timing {
    width: 100%; border-collapse: separate; border-spacing: 0 4px;
    font-family: var(--font-mono);
}
.timing thead th {
    font-size: .62rem; font-weight: 600; letter-spacing: .14em;
    text-transform: uppercase; color: var(--text-tertiary);
    padding: .2rem .6rem .5rem; text-align: right; white-space: nowrap;
}
.timing thead th.col-driver { text-align: left; }
.timing tbody tr { transition: transform .12s ease; }
/* Row fill AND outline live on the CELLS — anything painted on the tr
   (background or inset shadow) ignores the corner cells' border-radius
   and pokes out square at the four row corners. */
.timing tbody td {
    background: var(--surface-elevated);
    border-block: 1px solid var(--border-subtle);
    transition: border-color .12s ease;
}
.timing tbody td:first-child { border-left: 1px solid var(--border-subtle); }
.timing tbody td:last-child  { border-right: 1px solid var(--border-subtle); }
.timing tbody tr:hover { transform: translateX(3px); }
.timing tbody tr:hover td {
    border-color: color-mix(in srgb, var(--accent) 55%, var(--border-subtle));
}
/* Reserve the 3px hover shift inside scroll wrappers — otherwise the shifted
   row overflows the wrapper by 3px and macOS pops a horizontal scrollbar. */
.table-responsive { padding-right: 3px; }
.timing tbody td { padding: .5rem .6rem; text-align: right; vertical-align: middle; white-space: nowrap; }
.timing tbody td:first-child { border-radius: .55rem 0 0 .55rem; }
.timing tbody td:last-child  { border-radius: 0 .55rem .55rem 0; }
.timing .col-pos {
    width: 52px; text-align: center; font-weight: 700; font-size: .95rem;
    color: var(--text-secondary); position: relative;
}
.timing tr[data-tier="1"] .col-pos { color: var(--gold); }
.timing tr[data-tier="2"] .col-pos { color: var(--silver); }
.timing tr[data-tier="3"] .col-pos { color: var(--bronze); }
/* Podium rows: the gold/silver/bronze position number (above) is the whole
   treatment — row tints and gradients read as overpowering. */
.timing .col-driver {
    text-align: left; font-family: var(--font-display); font-weight: 600;
    font-size: 1.02rem; letter-spacing: .01em;
}
.timing .col-driver a { color: var(--text-primary); text-decoration: none; }
.timing .col-driver a:hover { color: var(--accent); }
.timing .col-driver .flag-icon { width: 1.1em; height: .8em; margin-left: .45rem; opacity: .9; vertical-align: middle; }
.timing .col-pts { color: var(--text-primary); font-weight: 700; font-size: 1rem; }
.timing .col-gap { color: var(--text-tertiary); font-size: .82rem; }
.timing .col-num { color: var(--text-secondary); }
/* Numeric columns shrink to content (nowrap keeps them readable) so spare
   width pools in the driver column instead of scattering the numbers
   across a wide viewport. */
.timing td.col-pts, .timing td.col-gap, .timing td.col-num {
    width: 1%; padding-inline: .95rem;
}
.timing .col-num.win { color: var(--text-primary); font-weight: 700; }
.timing .ir-badge {
    font-family: var(--font-mono); font-weight: 700; font-size: .8rem;
    color: var(--accent); background: var(--accent-subtle);
    padding: .12rem .45rem; border-radius: .35rem;
}
@media (max-width: 768px) {
    .podium { grid-template-columns: 1fr; }
    .podium-card[data-pos="1"] { order: -1; }
    .timing .hide-sm { display: none; }
    .timing thead th.hide-sm { display: none; }
}

/* ---- Sticky season / class selector bar ---------------------- */
.lb-selectbar {
    display: flex; flex-wrap: wrap; gap: .6rem; align-items: center;
    margin-bottom: 1.25rem;
}
.lb-select {
    font-family: var(--font-mono); font-size: .8rem; font-weight: 600;
    letter-spacing: .04em; border-radius: .5rem; border: 1px solid var(--border-subtle);
    background: var(--surface-elevated); color: var(--text-primary);
    padding: .45rem 2rem .45rem .75rem;
}
.classpill {
    font-family: var(--font-mono); font-size: .72rem; font-weight: 600;
    letter-spacing: .06em; text-transform: uppercase;
    padding: .4rem .8rem; border-radius: 999px; text-decoration: none;
    border: 1px solid var(--border-subtle); color: var(--text-secondary);
    background: var(--surface-elevated); transition: all .14s ease;
}
.classpill:hover { border-color: var(--accent); color: var(--accent); }
.classpill.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---- Breadcrumb --------------------------------------------- */
.lb-crumb {
    font-family: var(--font-mono); font-size: .72rem; letter-spacing: .08em;
    text-transform: uppercase; color: var(--text-tertiary); margin-bottom: 1rem;
}
.lb-crumb a { color: var(--text-secondary); text-decoration: none; }
.lb-crumb a:hover { color: var(--accent); }
.lb-crumb .sep { margin: 0 .5rem; opacity: .5; }

/* ============================================================
   SITEWIDE ADOPTION of the timing-tower design language
   (display headings, mono numerics, card hovers, hero bands)
   Defined after the championship system so the font vars exist.
   ============================================================ */

/* --- Display type on headings & page titles --- */
h1, .h1, h2, .h2, h3, .h3,
.display-1, .display-2, .display-3, .display-4, .display-5, .display-6,
.driver-name, .page-title, .card-title, .series-category-label {
    font-family: var(--font-display);
    letter-spacing: .004em;
}
/* Condensed faces read better a touch heavier */
h1, .h1, h2, .h2, .display-4, .display-5, .display-6,
.driver-name, .page-title { font-weight: 700; }

/* --- Mono, tabular numerics for stats --- */
.stat-value, h3.stat-value, .career-stats-text, .stat-num, .mono,
.metric-value, .big-number {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
}

/* --- Section labels match the championship eyebrow --- */
.section-label, .series-category-label {
    font-family: var(--font-mono);
    letter-spacing: .14em;
    text-transform: uppercase;
}

/* --- Universal card: subtle life on hover --- */
.card { transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
a.card, .card-hover, .hover-lift { cursor: pointer; }
a.card:hover, .card-hover:hover, .hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px -20px rgba(0,0,0,.55);
    border-color: var(--accent) !important;
}

/* --- Reusable page hero (alias of the championship hero) --- */
.page-hero {
    position: relative; overflow: hidden;
    border-radius: 1rem; border: 1px solid var(--border-subtle);
    padding: 2rem 1.75rem; margin-bottom: 1.5rem;
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(59,130,246,0.14), transparent 55%),
        linear-gradient(180deg, var(--surface-elevated), var(--surface-subtle));
}
.page-hero::before {
    content: ""; position: absolute; inset: 0;
    background-image: repeating-linear-gradient(-64deg, transparent 0 22px,
        color-mix(in srgb, var(--text-primary) 4%, transparent) 22px 24px);
    -webkit-mask-image: linear-gradient(105deg, #000, transparent 62%);
            mask-image: linear-gradient(105deg, #000, transparent 62%);
    pointer-events: none;
}
.page-hero > * { position: relative; z-index: 1; }

/* --- Stat tiles (driver profile / series / team) get the instrument feel --- */
.stat-card, .stat-item {
    transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.stat-card:hover, .stat-item:hover { transform: translateY(-2px); }

/* --- Race results header stat strip (timing-tower chips) --- */
.race-stat-strip { display: flex; flex-wrap: wrap; gap: .5rem; }
.race-stat {
    font-family: var(--font-mono); font-size: .76rem;
    padding: .32rem .65rem; border-radius: .45rem;
    border: 1px solid var(--border-subtle); background: var(--surface-subtle);
    color: var(--text-secondary);
}
.race-stat b {
    color: var(--text-tertiary); font-weight: 600; font-size: .62rem;
    letter-spacing: .1em; text-transform: uppercase; margin-right: .35rem;
}

/* --- Race highlights strip (winner / fastest lap / hard charger) --- */
.race-highlights { display: flex; flex-wrap: wrap; gap: .5rem; }
.race-highlight {
    font-size: .82rem;
    padding: .4rem .7rem; border-radius: .5rem;
    border: 1px solid var(--border-subtle); background: var(--surface-subtle);
    color: var(--text-secondary);
}
.race-highlight b {
    color: var(--text-tertiary); font-weight: 600; font-size: .6rem;
    letter-spacing: .08em; text-transform: uppercase; margin: 0 .3rem;
}

/* --- Race results table --- */
.race-results-table { font-size: .88rem; }
.race-results-table thead th {
    font-size: .66rem; letter-spacing: .06em; text-transform: uppercase;
    color: var(--text-tertiary); font-weight: 600; white-space: nowrap;
    border-bottom: 1px solid var(--border-subtle);
}
.race-results-table td {
    border-bottom: 1px solid var(--border-subtle); vertical-align: middle;
    white-space: nowrap;
}
.race-results-table tbody tr:hover { background: var(--surface-subtle); }

/* --- Driver profile name reads bigger inside the hero band --- */
.page-hero .driver-name {
    font-size: clamp(1.6rem, 4vw, 2.4rem) !important;
    text-transform: uppercase; line-height: 1;
}

/* --- Loading indicators: mono "telemetry" label + accent spinner --- */
#loading-spinner p,
#race-results-content p.loading-label,
.lb-loading-text {
    font-family: var(--font-mono) !important;
    text-transform: uppercase;
    letter-spacing: .18em;
    font-size: .72rem;
    color: var(--text-tertiary) !important;
    margin-top: 1rem !important;
}
#loading-spinner .spinner-border,
.lb-loading .spinner-border {
    color: var(--accent);
    width: 2.2rem; height: 2.2rem; border-width: .2em;
}

/* --- Mobile: tighten the timing-style driver tables so they fit ~360px --- */
@media (max-width: 575.98px) {
    .stats-by-category-table,
    .recent-races-table {
        border-spacing: 0 3px;
        font-size: .82rem;
    }
    .stats-by-category-table thead th,
    .recent-races-table thead th { padding: .15rem .55rem .4rem; font-size: .56rem; letter-spacing: .1em; }
    .stats-by-category-table tbody td,
    .recent-races-table tbody td { padding: .5rem .55rem; }
    .stats-by-category-table tbody td:first-child { font-size: .9rem; }
    .recent-races-table tbody td:nth-child(2) { font-size: .88rem; }
    /* keep the Results button compact */
    .recent-races-table .btn-sm { --bs-btn-padding-x: .5rem; --bs-btn-padding-y: .25rem; font-size: .72rem; }
}

/* --- Ad slots: reserve space (no CLS), subtle "Advertisement" label, on-brand --- */
.ad-slot {
    display: block;
    margin: 1.5rem auto;
    max-width: 100%;
    min-height: 100px;              /* reserve space so lazy fill doesn't shift layout */
    padding: .5rem;
    border: 1px solid var(--border-subtle);
    border-radius: .6rem;
    background: var(--surface-subtle);
    text-align: center;
    overflow: hidden;
}
.ad-slot-label {
    display: block;
    font-family: var(--font-mono);
    font-size: .58rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: .35rem;
}
.ad-slot-ins { display: block; width: 100%; min-height: 90px; }
.ad-slot--sidebar { min-height: 250px; }
.ad-slot--leaderboard { min-height: 90px; }

/* ========================================
   SERIES SEASON SCHEDULE
   ======================================== */
.schedule-list { display: flex; flex-direction: column; }
.schedule-week {
    display: grid;
    grid-template-columns: 3.5rem 1fr auto;
    align-items: center;
    gap: 0.5rem 1rem;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
}
.schedule-week:last-child { border-bottom: none; }
.schedule-week--current {
    background: var(--surface-subtle);
    box-shadow: inset 3px 0 0 var(--accent);
}
.schedule-week-num { display: flex; flex-direction: column; align-items: flex-start; gap: 0.2rem; }
.sw-num { font-family: var(--font-mono); font-weight: 700; font-size: 1.05rem; color: var(--text-secondary); line-height: 1; }
.schedule-week--current .sw-num { color: var(--accent); }
.sw-badge {
    font-family: var(--font-mono); font-size: 0.55rem; text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--accent); border: 1px solid var(--accent); border-radius: 999px;
    padding: 0.22rem 0.55rem; white-space: nowrap;
    margin-left: 0.6rem; vertical-align: middle; position: relative; top: -1px;
}
.schedule-week-track { display: flex; flex-direction: column; min-width: 0; }
.sw-track { font-family: var(--font-display); font-weight: 600; color: var(--text-primary); }
.sw-config { font-size: 0.8rem; color: var(--text-tertiary); }
.schedule-week-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 0.1rem; text-align: right; }
.sw-date { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-secondary); }
.sw-len { font-size: 0.75rem; color: var(--text-tertiary); }
@media (max-width: 575.98px) {
    .schedule-week { grid-template-columns: 2.75rem 1fr; }
    .schedule-week-meta { grid-column: 2; align-items: flex-start; flex-direction: row; gap: 0.7rem; }
}

/* This Week index */
.tw-block { margin-bottom: 2.25rem; }
.tw-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 0.1rem 1.5rem;
}
.tw-row {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    padding: 0.5rem 0.6rem;
    margin: 0 -0.6rem;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.12s;
}
.tw-row:hover { background: var(--surface-subtle); }
.tw-series { font-family: var(--font-display); font-weight: 700; color: var(--text-primary); font-size: 0.98rem; letter-spacing: .01em; }
.tw-track { font-size: 0.8rem; color: var(--text-secondary); }
.tw-config { color: var(--text-tertiary); }

/* Series page -> schedule link card */
.schedule-link-card {
    display: flex; align-items: center; gap: 0.9rem;
    padding: 0.9rem 1.1rem;
    border: 1px solid var(--border-subtle); border-radius: 0.6rem;
    background: var(--surface-elevated); text-decoration: none;
    transition: border-color .15s ease, transform .15s ease;
}
.schedule-link-card:hover { border-color: var(--bs-primary); transform: translateY(-2px); }
.schedule-link-card > .bi:first-child { font-size: 1.5rem; color: var(--bs-primary); flex-shrink: 0; }
.schedule-link-title { display: block; font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: .01em; color: var(--text-primary); font-size: 0.98rem; }
.schedule-link-sub { display: block; font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.1rem; }

/* Login prompt on race results — a glowing dark callout with an animated canvas
   aurora behind it. Fixed dark gradient in both themes so the glow always pops. */
.race-login-prompt {
    position: relative;
    overflow: hidden;
    margin-bottom: 1.1rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(99, 102, 241, 0.45);
    background: linear-gradient(135deg, #0a0e1c 0%, #131a30 55%, #0d1424 100%);
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.10), 0 6px 24px rgba(59, 130, 246, 0.18);
    animation: rlp-pulse 4.5s ease-in-out infinite;
}
@keyframes rlp-pulse {
    0%, 100% { box-shadow: 0 0 0 1px rgba(99,102,241,0.10), 0 6px 22px rgba(59,130,246,0.14); }
    50%      { box-shadow: 0 0 0 1px rgba(99,102,241,0.22), 0 8px 34px rgba(59,130,246,0.34); }
}
.race-login-prompt .rlp-glow {
    /* inset:0 fills the parent via offsets — NO percentage height, which iOS
       Safari can resolve against an auto-height parent and blow the canvas up to
       full viewport height. display:block avoids inline descender space. */
    position: absolute; inset: 0; display: block;
    z-index: 0; pointer-events: none; opacity: 0.9;
}
.race-login-prompt .rlp-inner {
    position: relative; z-index: 1;
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.75rem 1rem;
}
.race-login-prompt .rlp-icon {
    flex-shrink: 0; font-size: 1.15rem; color: #a5b4fc;
    filter: drop-shadow(0 0 6px rgba(139, 92, 246, 0.7));
}
.race-login-prompt .rlp-text {
    margin-right: auto; color: #e8ecff; font-size: 0.9rem; font-weight: 500;
}
.race-login-prompt .rlp-cta {
    white-space: nowrap; flex-shrink: 0;
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem; font-weight: 700; text-decoration: none;
    color: #fff; border-radius: 0.5rem;
    background: linear-gradient(135deg, #6366f1, #3b82f6);
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.55);
    transition: transform 0.12s ease, box-shadow 0.2s ease;
}
.race-login-prompt .rlp-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 22px rgba(59, 130, 246, 0.8);
}
.race-login-prompt .rlp-close {
    background: none; border: 0; color: #cbd5e1;
    opacity: 0.6; cursor: pointer; flex-shrink: 0;
    font-size: 1.25rem; line-height: 1; padding: 0 0.15rem;
}
.race-login-prompt .rlp-close:hover { opacity: 1; }
@media (max-width: 576px) {
    /* Compact stacked layout; drop the canvas entirely (decorative only) and use
       a static gradient so there's zero chance of a canvas height blowup. */
    .race-login-prompt {
        background: linear-gradient(135deg, #101733, #1a2247);
        animation: none;
    }
    .race-login-prompt .rlp-glow { display: none; }
    .race-login-prompt .rlp-inner {
        flex-wrap: wrap; gap: 0.5rem; padding: 0.7rem 0.85rem;
    }
    .race-login-prompt .rlp-text { margin-right: 0; flex-basis: 100%; font-size: 0.85rem; }
    .race-login-prompt .rlp-cta { flex: 1 1 auto; justify-content: center; }
    .race-login-prompt .rlp-close {
        position: absolute; top: 0.35rem; right: 0.5rem; font-size: 1.1rem;
    }
}
@media (prefers-reduced-motion: reduce) {
    .race-login-prompt { animation: none; }
}
/* Light mode: the canvas aurora uses 'lighter' compositing, which washes out on
   white — hide it and use a soft animated indigo gradient with dark text instead. */
[data-bs-theme="light"] .race-login-prompt {
    background: linear-gradient(135deg, #eef2ff 0%, #e7e9ff 30%, #e0f2fe 60%, #eef2ff 100%);
    background-size: 300% 300%;
    border-color: rgba(99, 102, 241, 0.35);
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.08), 0 4px 18px rgba(99, 102, 241, 0.18);
    animation: rlp-pulse 4.5s ease-in-out infinite, rlp-shift 9s ease infinite;
}
@keyframes rlp-shift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
[data-bs-theme="light"] .race-login-prompt .rlp-glow { display: none; }
[data-bs-theme="light"] .race-login-prompt .rlp-text { color: #1e293b; }
[data-bs-theme="light"] .race-login-prompt .rlp-icon {
    color: #6366f1; filter: drop-shadow(0 0 5px rgba(99, 102, 241, 0.45));
}
[data-bs-theme="light"] .race-login-prompt .rlp-close { color: #475569; }
@media (prefers-reduced-motion: reduce) {
    [data-bs-theme="light"] .race-login-prompt { animation: none; }
}

/* Login-gated (protected EEA) profile: blur + lock the content behind the modal
   so it can't be read/interacted with until the viewer logs in. */
#driver-stats-content.gate-blur {
    filter: blur(7px);
    pointer-events: none;
    user-select: none;
    transition: filter 0.2s ease;
}

/* ---- League platform pages (public site + /manage) ------------ */
/* Signature: the pit-wall control strip — one monospace bar under the
   hero carrying section nav + season/championship/week context, in place
   of stacked Bootstrap tabs and selects. */
/* Section NAV is a tab rail — pages, not filters. Filters (below, in
   .lg-controls) keep the chip/select look; the two must never match. */
.lg-tabs {
    display: flex; gap: 1.7rem; margin-bottom: 1rem; overflow-x: auto;
    border-bottom: 1px solid var(--border-subtle);
    scrollbar-width: none;
}
.lg-tabs::-webkit-scrollbar { display: none; }
.lg-tab {
    font-family: var(--font-mono); font-size: .72rem; font-weight: 600;
    letter-spacing: .14em; text-transform: uppercase; white-space: nowrap;
    color: var(--text-tertiary); text-decoration: none;
    padding: .55rem .1rem .6rem; border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.lg-tab:hover { color: var(--text-primary); }
.lg-tab.active { color: var(--text-primary); border-bottom-color: var(--accent); }

.lg-controls {
    display: flex; flex-wrap: wrap; align-items: center; gap: .55rem 1.4rem;
    padding: .55rem .8rem; margin-bottom: 1.35rem;
    background: var(--surface-elevated);
    border: 1px solid var(--border-subtle); border-radius: .8rem;
}
/* A league with one season and one championship has nothing to filter —
   don't render an empty strip (:empty fails on whitespace, :has doesn't). */
.lg-controls:not(:has(*)) { display: none; }
/* Control clusters wrap as UNITS (sections / season / championships / week)
   — no mid-group breaks, no orphaned separators. */
.lg-group {
    display: inline-flex; flex-wrap: wrap; align-items: center;
    gap: .45rem .55rem;
}
.lg-controls .sep {
    width: 1px; height: 1.55rem; background: var(--border-subtle);
    margin: 0 .3rem; flex: none;
}
.lg-controls .lb-select { margin: 0; }
.lg-controls .classpill { padding: .34rem .75rem; }
@media (max-width: 575px) { .lg-controls .sep { display: none; } }

/* Section pills: the current page reads like the lit sector on a pit board */
.lg-section-pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Manage stat strip — data readout, not card chrome */
.mg-stats {
    display: flex; flex-wrap: wrap; gap: 2.2rem;
    font-family: var(--font-mono); margin-bottom: 1.9rem;
}
.mg-stats b { font-size: 1.75rem; font-weight: 700; display: block; line-height: 1.1; }
.mg-stats .mg-stat-label {
    font-size: .66rem; font-weight: 600; letter-spacing: .16em;
    text-transform: uppercase; color: var(--text-tertiary);
}
.mg-stats a { text-decoration: none; }
.mg-stats a:hover b { color: var(--accent); }
.mg-stats b { color: var(--text-primary); }

/* ── /manage design system: one panel language, site-voice buttons ──
   Scoped to .mg so the public site is untouched. */
.mg .card {
    background: var(--surface-elevated);
    border: 1px solid var(--border-subtle); border-radius: .9rem;
}
.mg .card-body { padding: 1.25rem 1.4rem; }
.mg-panel-head {
    display: flex; justify-content: space-between; align-items: center;
    gap: 1rem; flex-wrap: wrap; padding: .8rem 1.4rem;
    border-bottom: 1px solid var(--border-subtle);
}
.mg-panel-head .mg-card-h { margin-bottom: 0; }
.mg-panel-actions { display: flex; gap: .5rem; }

/* Buttons in the site's own voice (mono pit-board), not stock pills */
.mg .btn {
    font-family: var(--font-mono); font-size: .7rem; font-weight: 700;
    letter-spacing: .09em; text-transform: uppercase;
    border-radius: .5rem; padding: .5rem .85rem; line-height: 1.15;
}
.mg .btn-primary { background: var(--accent); border-color: var(--accent); }
.mg .btn-outline-primary {
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 55%, transparent);
}
.mg .btn-outline-primary:hover { background: var(--accent); color: #fff;
    border-color: var(--accent); }
.mg .btn-outline-secondary { color: var(--text-secondary);
    border-color: var(--border-subtle); background: transparent; }
.mg .btn-outline-secondary:hover { color: var(--accent);
    border-color: var(--accent); background: transparent; }
.mg .btn-outline-danger {
    color: #ef4444; border-color: color-mix(in srgb, #ef4444 40%, transparent);
}
.mg .btn-outline-danger:hover { background: #ef4444; border-color: #ef4444; }

/* Alerts: quiet bordered notes, not full-color boxes */
.mg .alert {
    background: color-mix(in srgb, var(--text-primary) 4%, transparent);
    border: 1px solid var(--border-subtle);
    border-left: 3px solid var(--accent);
    color: var(--text-secondary); border-radius: .6rem;
}
.mg .alert-danger { border-left-color: #ef4444; }
.mg .alert-warning { border-left-color: #f59e0b; }
.mg .alert-info { border-left-color: var(--accent); }

/* Raw-JSON editor textarea: same dark editor ground as the marketing
   showcase, in both themes */
.mg .mg-json, .mg .mg-json:focus {
    background: #0d1117; color: #9da7b3;
    border-color: rgba(255, 255, 255, .12);
    font-size: .8rem; line-height: 1.65;
}
.mg .mg-json:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.mg .btn-outline-secondary.active {
    color: var(--accent); border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
}

/* Flush lp-card variant: header row + padded body (public panels) */
/* .lp-card.lp-card-flush (two classes) so this beats the base .lp-card
   padding, which is declared LATER in the file — with a lone .lp-card-flush
   selector every flush panel silently gained 1.3rem of dead padding. */
.lp-card.lp-card-flush { padding: 0; overflow: hidden; }
.lp-card-flush .mg-panel-head { background: transparent; }
.lp-card-flush .lp-card-pad { padding: 1rem 1.35rem 1.2rem; }

/* Stats: dense category blocks inside one panel per car class */
.lg-stats-grid {
    display: grid; gap: 1.2rem 1.8rem;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}
.lg-stat-table td { padding: .32rem .5rem; font-size: .8rem; }

.stat-incidents { color: #ef4444; }

/* Narrow centered section that KEEPS the section cadence (inline
   margin:0 auto would override the margin-top rule — that bug once ate
   the space under History import) */
.lp-narrow { max-width: 56rem; margin-inline: auto; }

/* Paddock feature cards: each opens with a mini visual in the timing
   language (sparkline, tower, podium, histogram, grid, class strips) */
.pd-card { display: flex; flex-direction: column; }
.pd-card .lp-league-cta { margin-top: auto; padding-top: .6rem; display: inline-block; }
.pd-viz {
    height: 122px; margin-bottom: .9rem; padding: .55rem .65rem;
    background: color-mix(in srgb, var(--text-primary) 4%, transparent);
    border: 1px solid var(--border-subtle); border-radius: .6rem;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.pd-viz canvas { width: 100% !important; height: 100% !important; }
.pd-mini { width: 100%; align-self: flex-start; }
.pd-mini th { font-family: var(--font-mono); font-size: .58rem;
    letter-spacing: .1em; color: var(--text-tertiary); text-transform: uppercase;
    padding: 0 .4rem .15rem; text-align: right; }
.pd-mini td { padding: .22rem .4rem; font-size: .74rem; }
.pd-drop { text-decoration: line-through; color: var(--text-tertiary); }
.pd-bars { display: flex; align-items: flex-end; gap: .3rem;
    width: 100%; height: 100%; }
.pd-bars span { flex: 1; border-radius: .2rem .2rem 0 0;
    background: linear-gradient(180deg, var(--accent),
        color-mix(in srgb, var(--accent) 45%, transparent)); }
.pd-podium { display: flex; align-items: flex-end; gap: .5rem;
    width: 100%; height: 100%; padding: 0 .5rem; }
.pd-step { flex: 1; border-radius: .35rem .35rem 0 0; position: relative;
    display: flex; flex-direction: column; align-items: center;
    justify-content: flex-start; gap: .3rem; padding-top: .45rem;
    background: color-mix(in srgb, var(--text-primary) 7%, transparent);
    border: 1px solid var(--border-subtle); border-bottom: none; }
.pd-step b { font-family: var(--font-mono); font-size: 1.1rem; }
.pd-p1 { height: 92%; border-top: 3px solid #d4a017; }
.pd-p1 b { color: #d4a017; }
.pd-p2 { height: 68%; border-top: 3px solid #9ca3af; }
.pd-p2 b { color: #9ca3af; }
.pd-p3 { height: 52%; border-top: 3px solid #b36c33; }
.pd-p3 b { color: #b36c33; }
.pd-classes { display: flex; flex-direction: column; gap: .45rem; width: 100%; }
.pd-class { display: flex; align-items: center; gap: .6rem;
    padding: .35rem .6rem; border-radius: .4rem;
    border-left: 3px solid var(--cls, var(--border-subtle));
    background: color-mix(in srgb, var(--text-primary) 5%, transparent); }
.pd-class-name { font-family: var(--font-mono); font-size: .62rem;
    letter-spacing: .08em; text-transform: uppercase;
    color: var(--text-secondary); min-width: 6.5rem; }
.pd-class-pts { margin-left: auto; font-family: var(--font-mono);
    font-size: .78rem; font-weight: 700; }
.pd-split { font-family: var(--font-mono); font-size: .62rem;
    border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
    color: var(--accent); border-radius: .3rem; padding: .12rem .4rem; }

/* Season Wrapped stat grid */
.wr-grid { display: grid; gap: .7rem; margin: 1.4rem 0;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.wr-stat {
    background: var(--surface-elevated); border: 1px solid var(--border-subtle);
    border-radius: .8rem; padding: 1rem 1.1rem; text-align: center;
    display: flex; flex-direction: column; gap: .15rem; justify-content: center;
}
.wr-stat b { font-family: var(--font-mono); font-size: 1.9rem;
    font-weight: 700; line-height: 1.1; }
.wr-stat span { color: var(--text-tertiary); font-size: .78rem; }
.wr-big b { font-size: 2.5rem; color: var(--accent); }
.wr-gold b { color: #d4a017; }
.wr-up b { color: #3fb950; }
.wr-down b { color: #ef4444; }

/* Pricing page */
.pr-plan { display: flex; flex-direction: column; }
.pr-plan .lp-card-pad { display: flex; flex-direction: column; flex: 1; }
.pr-plan .pr-features { margin-bottom: 1rem; }
.pr-plan .lp-btn { margin-top: auto; align-self: flex-start; }

.pr-price { font-size: 1.05rem; color: var(--text-secondary); margin-bottom: 1rem; }
.pr-price b { font-size: 2rem; font-family: var(--font-mono); font-weight: 700;
    color: var(--text-primary); }
.pr-save {
    font-family: var(--font-mono); font-size: .62rem; font-weight: 700;
    letter-spacing: .1em; text-transform: uppercase; color: #3fb950;
    white-space: nowrap; display: inline-block;
    border: 1px solid color-mix(in srgb, #3fb950 45%, transparent);
    border-radius: 999px; padding: .2rem .55rem; margin-left: .5rem;
    vertical-align: middle;
}
.pr-founder {
    max-width: 34rem; margin: 1.2rem auto 0; padding: .8rem 1.1rem;
    border: 1px dashed color-mix(in srgb, #e8a13a 60%, transparent);
    border-radius: .8rem; color: var(--text-secondary); font-size: .95rem;
    background: color-mix(in srgb, #e8a13a 7%, transparent);
}
.pr-founder strong { color: var(--text-primary); }
.pr-founder-badge {
    display: inline-block; font-family: var(--font-mono); font-size: .6rem;
    font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
    padding: .22rem .5rem; border-radius: .35rem; line-height: 1;
    color: #1a1205; background: linear-gradient(135deg, #f5c84b, #e8a13a);
    margin-right: .5rem; vertical-align: middle;
}
.pr-price s { color: var(--text-tertiary); font-size: 1.1rem;
    font-family: var(--font-mono); margin-right: .15rem; }
.pr-save-founder {
    color: #e8a13a; border-color: color-mix(in srgb, #e8a13a 50%, transparent);
}
.pr-pro-card { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.pr-features { list-style: none; margin: 0 0 .5rem; padding: 0; }
.pr-features li {
    color: var(--text-secondary); font-size: .93rem; padding: .3rem 0 .3rem 1.6rem;
    position: relative;
}
.pr-features li::before {
    content: '✓'; position: absolute; left: .1rem; color: var(--accent);
    font-weight: 700;
}
.pr-faq { display: grid; gap: 1.1rem 2rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.pr-faq h3 { font-size: 1rem; font-weight: 700; margin-bottom: .35rem; }
.pr-faq p { color: var(--text-secondary); font-size: .93rem; margin: 0; }

/* PRO badge: the paid-tier gold, used wherever bespoke work is surfaced */
.mg-pro {
    display: inline-block; font-family: var(--font-mono); font-size: .58rem;
    font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
    padding: .18rem .45rem; border-radius: .35rem; line-height: 1;
    color: #1a1205; background: linear-gradient(135deg, #f5c84b, #e8a13a);
    vertical-align: middle; margin-left: .35rem;
    transform: translateY(-1px);
}
.mg-plugin-link { text-decoration: none; color: var(--text-secondary); }
.mg-plugin-link:hover { color: var(--accent); }

/* Fact strip: labeled values instead of a dot-separated run-on line */
.mg-facts { display: flex; flex-wrap: wrap; gap: .6rem 2.2rem; }
.mg-facts > span {
    display: flex; flex-direction: column; gap: .15rem;
    font-size: .88rem; color: var(--text-secondary); max-width: 22rem;
}
.mg-facts b {
    font-family: var(--font-mono); font-size: .62rem; font-weight: 600;
    letter-spacing: .14em; text-transform: uppercase;
    color: var(--text-tertiary);
}

/* Seamless title edit: reads as a heading, edits like a field. The save
   button only appears while editing. */
.mg-title-form { display: inline-flex; align-items: center; gap: .35rem; }
.mg-title-form input.form-control {
    background: transparent; border-color: transparent;
    font-weight: 700; font-size: 1.05rem; color: var(--text-primary);
    padding: .15rem .45rem .15rem 0; box-shadow: none;
}
.mg-title-form input.form-control:hover {
    border-color: var(--border-subtle); padding-left: .45rem;
}
.mg-title-form input.form-control:focus {
    background: color-mix(in srgb, var(--text-primary) 5%, transparent);
    border-color: var(--accent); padding-left: .45rem;
}
.mg-title-form .btn { visibility: hidden; }
.mg-title-form:focus-within .btn, .mg-title-form:hover .btn { visibility: visible; }

/* Card/section TITLES: real headings. (The mono eyebrow .mg-h below is
   for labels above a heading — never for a card's own title.) */
.mg-card-h {
    font-size: 1.08rem; font-weight: 700; letter-spacing: -.01em;
    color: var(--text-primary); margin-bottom: .65rem;
}

/* Card section headers in /manage: eyebrow style, not bold prose */
.mg-h {
    font-family: var(--font-mono); font-size: .7rem; font-weight: 600;
    letter-spacing: .18em; text-transform: uppercase;
    color: var(--text-tertiary); margin-bottom: .8rem;
}

/* 'Add championship' card: dashed like the other 'add one' tiles */
.mg-add-card {
    border: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent);
    background: color-mix(in srgb, var(--text-primary) 3%, transparent);
}

/* Scoring pages: readable helper text (not Bootstrap 'small' soup) and
   mono micro-labels on builder fields, matching the public rules page. */
.mg-help { color: var(--text-secondary); font-size: .9rem; line-height: 1.55; }
#builder .form-label {
    font-family: var(--font-mono); font-size: .64rem; font-weight: 600;
    letter-spacing: .13em; text-transform: uppercase;
    color: var(--text-tertiary); margin-bottom: .3rem;
}
#builder .card-body { padding: 1.1rem 1.4rem 1.3rem; }
.mg-split-head {
    display: flex; gap: .5rem; margin-bottom: .35rem;
    font-family: var(--font-mono); font-size: .62rem; font-weight: 600;
    letter-spacing: .13em; text-transform: uppercase; color: var(--text-tertiary);
}
/* Single-table mode: the split-number column is meaningless — hide it. */
#builder[data-pmode="single_table"] .table-row .tkey { display: none; }
.mg-tb-ord {
    display: grid; place-items: center; width: 1.7rem; height: 1.7rem;
    flex: 0 0 auto; font-family: var(--font-mono); font-size: .7rem;
    font-weight: 700; color: var(--text-tertiary);
    border: 1px solid var(--border-subtle); border-radius: .45rem;
}

/* Collapsed season history on the dashboard */
.mg-seasons-more summary {
    font-family: var(--font-mono); font-size: .72rem; letter-spacing: .08em;
    text-transform: uppercase; color: var(--text-secondary); cursor: pointer;
    padding: .5rem 0;
}
.mg-seasons-more summary:hover { color: var(--accent); }

/* ---- League landing + creation wizard ------------------------- */
.lp { padding: 1.2rem 0 3rem; }
.lp-hero { padding: 3rem 2.2rem 2.6rem; }
.lp-title {
    font-family: var(--font-display, inherit); font-weight: 800;
    font-size: clamp(2.2rem, 5.5vw, 3.6rem); line-height: 1.04;
    letter-spacing: -.02em; margin: .35rem 0 .8rem;
}
.lp-sub { color: var(--text-secondary); font-size: 1.05rem; max-width: 34rem; }
.lp-tower {
    background: var(--surface-elevated); border: 1px solid var(--border-subtle);
    border-radius: .9rem; padding: 1rem 1.1rem .7rem;
}
.lp-tower-head {
    display: flex; gap: .7rem; align-items: baseline; flex-wrap: wrap;
    font-family: var(--font-mono); font-size: .72rem; color: var(--text-secondary);
    margin-bottom: .55rem;
}
.lp-live { color: var(--accent); font-weight: 700; text-transform: uppercase;
    letter-spacing: .14em; display: inline-flex; align-items: center; gap: .35rem; }
.lp-live .dot { width: .5em; height: .5em; border-radius: 50%;
    background: currentColor; animation: lp-pulse 2s infinite; }
@keyframes lp-pulse { 50% { opacity: .35; } }
.lp-tower .timing tbody tr {
    animation: lp-row .5s both; animation-delay: calc(var(--i) * 90ms);
}
@keyframes lp-row { from { opacity: 0; transform: translateX(-10px); } }
@media (prefers-reduced-motion: reduce) {
    .lp-tower .timing tbody tr { animation: none; }
    .lp-live .dot { animation: none; }
}
.lp-tower-caption {
    font-family: var(--font-mono); font-size: .68rem;
    color: var(--text-tertiary); margin: .6rem 0 0;
}
/* One section cadence for the whole page — no per-section drift */
.lp > section:not(:first-child) { margin-top: 3.25rem; }
.lp-card {
    height: 100%; background: var(--surface-elevated);
    border: 1px solid var(--border-subtle); border-radius: .9rem;
    padding: 1.3rem 1.35rem;
}
.lp-card p { color: var(--text-secondary); margin: 0; font-size: .95rem; }
.lp-card-h {
    font-size: 1.2rem; font-weight: 700; letter-spacing: -.01em;
    color: var(--text-primary); margin-bottom: .55rem;
}
/* Steps as grid slots: the lamp row fills as the sequence advances
   (1 lit -> 2 lit -> 3 lit), echoing the wizard's own lights stepper */
.lp-step-card {
    height: 100%; background: var(--surface-elevated);
    border: 1px solid var(--border-subtle); border-radius: .9rem;
    padding: 1.25rem 1.3rem;
}
.lp-step-card p { color: var(--text-secondary); font-size: .92rem; margin: 0; }
.lp-step-card code { font-size: .85em; }
.lp-step-lamps { margin: 0 0 .85rem; gap: .45rem; }
.lp-step-lamps .wz-light { width: .8rem; height: .8rem; }

/* Final CTA: a contained band that bookends the hero — five lights on */
.lp-cta {
    padding: 3rem 2rem 2.8rem;
    background-image:
        radial-gradient(60% 130% at 50% 0%,
            color-mix(in srgb, var(--accent) 12%, transparent), transparent 72%);
    transition: background-image .6s ease;
}
.lp-cta-lights { justify-content: center; margin: 0 0 1.1rem; }
.lp-cta-lights .wz-light { width: .85rem; height: .85rem; }

/* Start procedure: when the band scrolls into view the lamps come on one
   by one, hold, then go out TOGETHER — lights out on the create button.
   JS drives armed -> lit -> go; without JS (or reduced motion) the band
   stays in its static all-on state above. */
.lp-cta-armed .wz-light {
    background: var(--surface-elevated); border-color: var(--border-subtle);
    box-shadow: none;
    transition: background .1s ease, border-color .1s ease, box-shadow .1s ease;
}
.lp-cta-lit .wz-light {
    background: var(--accent); border-color: var(--accent);
    box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 65%, transparent);
}
.lp-cta-lit .wz-light:nth-child(2) { transition-delay: .45s; }
.lp-cta-lit .wz-light:nth-child(3) { transition-delay: .9s; }
.lp-cta-lit .wz-light:nth-child(4) { transition-delay: 1.35s; }
.lp-cta-lit .wz-light:nth-child(5) { transition-delay: 1.8s; }
.lp-cta-go .wz-light:nth-child(n) {
    background: var(--surface-elevated); border-color: var(--border-subtle);
    box-shadow: none; transition-delay: 0s;
}
.lp-cta-go {
    background-image:
        radial-gradient(60% 130% at 50% 0%,
            color-mix(in srgb, #22c55e 14%, transparent), transparent 72%);
}

/* Wizard: grid-lights stepper (five lights, fill as steps complete) */
.wz-lights { display: flex; gap: .55rem; margin: .4rem 0 1.6rem; }
.wz-light {
    width: 2.4rem; height: .55rem; border-radius: 999px;
    background: var(--surface-elevated); border: 1px solid var(--border-subtle);
    transition: background .2s ease, border-color .2s ease;
}
.wz-light.on { background: var(--accent); border-color: var(--accent); }
.wz-section { margin-bottom: 1.6rem; }
.wz-slug-status { font-family: var(--font-mono); font-size: .75rem; }
.wz-slots { display: flex; flex-wrap: wrap; gap: .45rem; }
.wz-slot { cursor: pointer; }
.wz-slot small { opacity: .75; margin-left: .35rem; }
.wz-preset { cursor: pointer; display: block; }
.wz-preset input { display: none; }
.wz-preset .lp-card { border-width: 2px; }
.wz-preset input:checked + .lp-card { border-color: var(--accent); }

/* League forms (wizard .lp + manage .mg): the site's voice, not stock
   Bootstrap — mono eyebrow labels, surface-toned fields, accent focus. */
.lp .form-label, .mg .form-label {
    font-family: var(--font-mono); font-size: .66rem; font-weight: 600;
    letter-spacing: .14em; text-transform: uppercase;
    color: var(--text-tertiary); margin-bottom: .35rem;
}
.lp .form-control, .lp .form-select,
.mg .form-control, .mg .form-select {
    background: color-mix(in srgb, var(--text-primary) 4%, transparent);
    border: 1px solid var(--border-subtle); border-radius: .55rem;
    color: var(--text-primary); padding: .55rem .8rem; font-size: .92rem;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.lp textarea.form-control, .mg textarea.form-control { line-height: 1.55; }
.lp .form-control:focus, .lp .form-select:focus,
.mg .form-control:focus, .mg .form-select:focus {
    background: color-mix(in srgb, var(--text-primary) 6%, transparent);
    border-color: var(--accent); color: var(--text-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
    outline: none;
}
.lp .form-control::placeholder, .mg .form-control::placeholder {
    color: var(--text-tertiary); opacity: .7;
}

/* Powered-by upsell band on public league pages: quiet, one line,
   hidden for the league's own staff */
.lg-upsell {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap; margin-top: 2.2rem;
    padding: .85rem 1.1rem; border: 1px dashed var(--border-subtle);
    border-radius: .8rem; background: color-mix(in srgb, var(--text-primary) 3%, transparent);
}
.lg-upsell-copy { color: var(--text-tertiary); font-size: .85rem; }
.lg-upsell-btn { font-size: .68rem; padding: .55rem .9rem; white-space: nowrap; }

/* Races calendar: week chips + split sub-rows (one table per season) */
.lg-wk {
    display: inline-block; font-family: var(--font-mono); font-size: .68rem;
    font-weight: 700; letter-spacing: .04em; padding: .28rem .5rem;
    border-radius: .45rem; color: var(--text-secondary);
    background: color-mix(in srgb, var(--text-primary) 8%, transparent);
}
.timing tr.lg-split-row td,
.timing tr.lg-split-row:hover td {
    background: transparent; border-color: transparent;
}
.timing tr.lg-split-row:hover { transform: none; }
.lg-split-link {
    font-family: var(--font-mono); font-size: .8rem; font-style: italic;
    color: var(--text-tertiary) !important; font-weight: 400;
}
.lg-split-link:hover { color: var(--accent) !important; }
.timing .lg-winner-col a { color: var(--text-primary); text-decoration: none; }
.timing .lg-winner-col a:hover { color: var(--accent); }

/* League outbound links (hero icon row on public league pages) */
.lg-links { display: flex; gap: .8rem; }
.lg-link { color: var(--text-tertiary); font-size: 1.05rem; text-decoration: none; }
.lg-link:hover { color: var(--accent); }

/* Homepage league callout */
.league-callout {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .8rem;
    margin: 1.1rem 0 0; padding: .8rem 1.1rem;
    background: var(--surface-elevated); border: 1px solid var(--border-subtle);
    border-radius: .8rem; text-decoration: none; color: var(--text-secondary);
    transition: border-color .15s ease;
}
.league-callout:hover { border-color: var(--accent); }
.league-callout-text { font-size: .88rem; }
.league-callout-cta {
    font-family: var(--font-mono); font-size: .78rem; font-weight: 700;
    color: var(--accent); margin-left: auto; white-space: nowrap;
}

/* Rules & Scoring page */
/* Rules & Scoring: rule groups flow as a readable grid, points get their
   own full-width band — a single left-clustered bullet ladder isn't
   scannable on a wide page. */
.rl-grid {
    display: grid; gap: 1.6rem 3rem;
    grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
}
.rl-h {
    font-family: var(--font-mono); font-size: .68rem; font-weight: 600;
    letter-spacing: .16em; text-transform: uppercase;
    color: var(--text-tertiary); margin-bottom: .7rem;
}
.rl-text { color: var(--text-secondary); font-size: .95rem; line-height: 1.6; }
.rl-text-sub { color: var(--text-tertiary); font-size: .83rem; margin-bottom: .5rem; }
.rl-list { padding-left: 1.25rem; margin: 0; }
.rl-list li {
    margin-bottom: .55rem; color: var(--text-secondary);
    font-size: .95rem; line-height: 1.6;
}
.rl-list li::marker { color: var(--accent); }
.rl-list-lg li { font-size: 1rem; }
.rl-points-section {
    margin-top: 1.8rem; padding-top: 1.4rem;
    border-top: 1px solid var(--border-subtle);
}
.rl-points { display: flex; flex-wrap: wrap; gap: .4rem; }
.rl-pt {
    font-family: var(--font-mono); font-size: .82rem;
    background: var(--surface-elevated); border: 1px solid var(--border-subtle);
    border-radius: .5rem; padding: .3rem .6rem; white-space: nowrap;
}
.rl-pt b { color: var(--text-tertiary); font-weight: 600; margin-right: .4rem;
    font-size: .68rem; letter-spacing: .04em; }

/* Championship battle chart (standings page) */
.lg-battle {
    background: var(--surface-elevated); border: 1px solid var(--border-subtle);
    border-radius: .8rem; padding: .8rem .9rem .4rem; height: 220px;
}
.lg-battle canvas { width: 100% !important; height: 100% !important; }

/* League directory cards on /leagues */
.lp-league-card {
    display: block; height: 100%; padding: 1.1rem 1.2rem;
    background: var(--surface-elevated); border: 1px solid var(--border-subtle);
    border-radius: .9rem; color: var(--text-primary); text-decoration: none;
    transition: border-color .15s ease, transform .15s ease;
}
.lp-league-card:hover { border-color: var(--accent); transform: translateY(-2px); color: var(--text-primary); }
.lp-league-host {
    font-family: var(--font-mono); font-size: .68rem; color: var(--accent);
    white-space: nowrap;
}
.lp-league-top3 { margin-bottom: .5rem; }
.lp-league-top3 td { padding: .3rem .45rem; font-size: .78rem; }
.lp-league-cta {
    font-family: var(--font-mono); font-size: .74rem; font-weight: 700;
    color: var(--accent);
}
/* Homepage leagues section (above featured series) */
.home-leagues { margin: 2.6rem 0 1rem; }
.home-leagues-title {
    font-weight: 800; font-size: clamp(1.3rem, 3vw, 1.9rem);
    letter-spacing: -.01em; margin: .25rem 0 .4rem;
}

/* Fixed column grid for stacked per-week tables — every table shares the
   same column positions instead of auto-sizing to its own content. */
.timing-fixed { table-layout: fixed; }
.timing-fixed th, .timing-fixed td { overflow: hidden; text-overflow: ellipsis; }

/* Landing CTAs in the site's own voice (mono pit-board), not stock pills */
.lp-btn {
    display: inline-block; font-family: var(--font-mono); font-size: .78rem;
    font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
    padding: .78rem 1.3rem; border-radius: .55rem; text-decoration: none;
    border: 1px solid transparent; transition: all .15s ease; line-height: 1;
}
.lp-btn-primary { background: var(--accent); color: #fff; }
.lp-btn-primary:hover { filter: brightness(1.12); color: #fff;
    transform: translateY(-1px); }
.lp-btn-ghost { border-color: var(--border-subtle); color: var(--text-primary); }
.lp-btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
/* Hero-grade CTA size for the main league entry points */
.lp-btn-lg { font-size: .88rem; padding: 1rem 1.8rem; border-radius: .65rem; }

/* 'Your league' tile: a ghost timing tower — same anatomy as the live
   league cards (name row, meta line, top-3 table, CTA) so the grid
   aligns, but the standings are placeholders waiting to be earned. */
.lp-league-card-new {
    border: 1px dashed color-mix(in srgb, var(--accent) 55%, transparent);
    background-image: linear-gradient(180deg,
        color-mix(in srgb, var(--accent) 8%, transparent), transparent 62%);
}
.lp-league-card-new:hover { border-style: solid; }
.lp-league-card-new .lp-league-host small { color: var(--text-tertiary); }
.lp-ghost td .lp-skel { margin-left: 0; }
.lp-league-card-new .lp-btn {
    display: block; text-align: center; margin-top: .15rem;
    padding: .7rem 1rem;
}

/* Copy emphasis: bold key phrases pop out of secondary-colored prose */
.lp-card strong, .lp-sub strong, .home-leagues p strong {
    color: var(--text-primary); font-weight: 700;
}

/* Wizard grid lights: five round lamps, not skeleton bars */
.wz-lights { gap: .7rem; margin: .6rem 0 1.9rem; }
.wz-light {
    width: 1.15rem; height: 1.15rem; border-radius: 50%;
    background: var(--surface-elevated); border: 1px solid var(--border-subtle);
}
.wz-light.on {
    background: var(--accent); border-color: var(--accent);
    box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 65%, transparent);
}

/* Rules-as-config showcase: an editor panel with real rulebooks.
   JSON colors reuse the page's own data palette (accent keys, chart
   green strings, chart amber numbers) — a timing screen, not an IDE. */
.lp-rules {
    background: var(--surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 1rem; padding: 1.6rem 1.75rem;
}
.lp-rules-head {
    display: flex; justify-content: space-between; align-items: flex-end;
    gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem;
}
.lp-rules-tabs { display: flex; gap: .45rem; flex-wrap: wrap; }
.lp-rules-tab {
    font-family: var(--font-mono); font-size: .72rem; font-weight: 700;
    letter-spacing: .1em; text-transform: uppercase; cursor: pointer;
    padding: .55rem .95rem; border-radius: .55rem; line-height: 1;
    background: transparent; border: 1px solid var(--border-subtle);
    color: var(--text-secondary); transition: all .15s ease;
}
.lp-rules-tab:hover { border-color: var(--accent); color: var(--accent); }
.lp-rules-tab.active {
    border-color: var(--accent); color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.lp-rules-panel {
    display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 1.6rem; align-items: stretch;
}
.lp-rules-panel[hidden] { display: none; }
/* The editor is dark in BOTH themes — it's a timing screen, and the
   token colors are tuned for a dark ground. Fixed palette on purpose. */
.lp-json-wrap {
    background: #0d1117; border: 1px solid rgba(255, 255, 255, .09);
    border-radius: .9rem; overflow: hidden;
}
.lp-json-head {
    display: flex; justify-content: space-between; gap: 1rem;
    font-family: var(--font-mono); font-size: .68rem;
    color: #7d8590; padding: .6rem 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, .09);
}
.lp-json {
    margin: 0; padding: 1rem 1.1rem; overflow: auto; max-height: 460px;
    font-family: var(--font-mono); font-size: .8rem; line-height: 1.7;
    color: #9da7b3;
}
.lp-json .jk { color: #58a6ff; }
.lp-json .js { color: #3fb950; }
.lp-json .jn { color: #f59e0b; }
.lp-json .jb { color: #a855f7; }
.lp-rules-notes {
    list-style: none; margin: 0; padding: 0;
    display: flex; flex-direction: column; justify-content: space-evenly;
    gap: .35rem;
}
.lp-rules-notes li {
    color: var(--text-secondary); font-size: .92rem;
    padding: .65rem 0 .65rem 1rem; border-left: 2px solid var(--border-subtle);
}
.lp-rules-notes li strong { color: var(--text-primary); }
.lp-rules-notes code {
    font-size: .82em; color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    border-radius: .3rem; padding: .1rem .35rem;
}
/* Championship entry grid: each tile carries its one defining rule —
   the row itself demonstrates 'same races, own rulebook'. */
.lp-champs {
    margin-top: 1.7rem; padding-top: 1.4rem;
    border-top: 1px solid var(--border-subtle);
}
.lp-champs-head {
    display: flex; justify-content: space-between; align-items: baseline;
    gap: 1rem; flex-wrap: wrap;
}
.lp-champs-legend {
    font-family: var(--font-mono); font-size: .68rem;
    color: var(--text-tertiary); display: inline-flex;
    align-items: center; gap: .4rem;
}
.lp-champs-legend .dot {
    width: .5em; height: .5em; border-radius: 50%; background: var(--accent);
    box-shadow: 0 0 6px color-mix(in srgb, var(--accent) 65%, transparent);
}
.lp-champs-grid {
    display: grid; gap: .6rem; margin-top: .9rem;
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
}
.lp-champ {
    border: 1px solid var(--border-subtle); border-radius: .7rem;
    padding: .7rem .85rem; display: flex; flex-direction: column;
    gap: .2rem; color: var(--text-primary); text-decoration: none;
    background: color-mix(in srgb, var(--text-primary) 5%, transparent);
}
.lp-champ b {
    font-size: .92rem; display: inline-flex; align-items: center; gap: .45rem;
}
.lp-champ.live b::before {
    content: ''; width: .5em; height: .5em; border-radius: 50%;
    background: var(--accent); flex: none;
    box-shadow: 0 0 6px color-mix(in srgb, var(--accent) 65%, transparent);
}
.lp-champ span {
    font-family: var(--font-mono); font-size: .67rem;
    color: var(--text-tertiary); line-height: 1.4;
}
.lp-champ-new {
    border: 1px dashed color-mix(in srgb, var(--accent) 55%, transparent);
    transition: border-color .15s ease, background .15s ease;
}
.lp-champ-new b { color: var(--accent); }
.lp-champ-new:hover { border-style: solid; border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 8%, transparent); }
@media (max-width: 991px) {
    .lp-rules-panel { grid-template-columns: 1fr; }
}

/* Marketing-surface surname redaction: a static block, deliberately
   inert (no shimmer — motion reads as 'loading'). */
.lp-skel {
    display: inline-block; height: .8em; border-radius: .25em;
    vertical-align: baseline; margin-left: .1em;
    background: color-mix(in srgb, var(--text-tertiary) 28%, transparent);
}

/* ---- Leagues marketing: graphical pass ------------------------- */
/* Wider canvas for the landing page */
main.lp-wide { max-width: min(1460px, 96%); }

/* Hero: accent wash behind the content + the five-lights motif */
.lp-hero {
    background-image:
        radial-gradient(55% 90% at 82% 8%,
            color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
        linear-gradient(115deg,
            color-mix(in srgb, var(--accent) 7%, transparent), transparent 45%);
}
.lp-hero-lights { margin: 0 0 1rem; }
.lp-hero-lights .wz-light { width: .85rem; height: .85rem; }
.lp-hero-lights .wz-light:nth-child(1) { animation: lp-light 1s .0s both; }
.lp-hero-lights .wz-light:nth-child(2) { animation: lp-light 1s .18s both; }
.lp-hero-lights .wz-light:nth-child(3) { animation: lp-light 1s .36s both; }
.lp-hero-lights .wz-light:nth-child(4) { animation: lp-light 1s .54s both; }
.lp-hero-lights .wz-light:nth-child(5) { animation: lp-light 1s .72s both; }
@keyframes lp-light { from { background: var(--surface-elevated);
    box-shadow: none; } }
@media (prefers-reduced-motion: reduce) {
    .lp-hero-lights .wz-light { animation: none; } }

/* Steps strip: numbered lamps */
.lp-step b {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.5rem; height: 1.5rem; border-radius: 50%;
    background: var(--accent); color: #fff; margin-right: .5rem;
}

/* Battle section: panel treatment */
.lp-battle-section {
    background: var(--surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 1rem; padding: 1.6rem 1.75rem;
}

/* Homepage league band: rides the lb-hero chrome (stripes + checkered
   corner) so it reads as the site's own ad, not another list section */
.lb-hero.home-leagues .hl-founder {
    position: absolute; top: 1.15rem; right: 1.4rem; z-index: 1;
    font-size: .62rem; padding: .3rem .6rem;
}
@media (max-width: 767px) {
    .lb-hero.home-leagues .hl-founder { position: static;
        display: inline-block; margin-bottom: .5rem; }
}
.lb-hero.home-leagues {
    position: relative;
    margin: 2.6rem 0 1rem; padding: 1.9rem 1.75rem 1.75rem;
    background-image:
        radial-gradient(50% 100% at 85% 0%,
            color-mix(in srgb, var(--accent) 13%, transparent), transparent 70%);
}
.lb-hero.home-leagues .lp-league-card { background: color-mix(in srgb, var(--surface-elevated) 70%, transparent); }
