* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --red: #e10600;
    --dark: #0a0a0a;
    --darker: #050505;
    --card: #111111;
    --card2: #1a1a1a;
    --border: #2a2a2a;
    --text: #ffffff;
    --muted: #888888;
    --gold: #ffd700;
    --silver: #c0c0c0;
    --bronze: #cd7f32;
    --sprint: #7c3aed;
    --sprint-light: #a78bfa;
    --green: #22c55e;
    --blue: #3b82f6;
}

/* ── Light theme overrides ── */
[data-theme="light"] {
    --dark: #f5f5f5;
    --darker: #e8e8e8;
    --card: #ffffff;
    --card2: #f0f0f0;
    --border: #d4d4d4;
    --text: #1a1a1a;
    --muted: #666666;
}

[data-theme="light"] header {
    background: linear-gradient(135deg, #ffffff 0%, #fff0f0 100%);
}

[data-theme="light"] nav {
    background: #ffffff;
}

[data-theme="light"] .modal-header {
    background: linear-gradient(135deg, #ffffff, #fff5f5);
}

body {
    background: var(--darker);
    color: var(--text);
    font-family: 'Segoe UI', system-ui, sans-serif;
    min-height: 100vh;
}

header {
    background: linear-gradient(135deg, var(--dark) 0%, #1a0000 100%);
    border-bottom: 3px solid var(--red);
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.f1-logo {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--red);
    letter-spacing: -1px;
    font-style: italic;
}

.season-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-toggle {
    background: var(--card2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.theme-toggle:hover {
    border-color: var(--red);
}

.lang-toggle {
    background: var(--card2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.4rem 0.7rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    transition: all 0.2s;
    line-height: 1;
}
.lang-toggle:hover {
    border-color: var(--red);
    color: var(--red);
}

.stats-bar {
    display: flex;
    gap: 1.5rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.stats-bar strong {
    color: var(--text);
    font-size: 1rem;
}

/* ═══════════════════════════════════════════════
   STARTING GRID — Grille de départ F1
   ═══════════════════════════════════════════════ */

.countdown-bar {
    /* Damier subtil */
    background:
        repeating-conic-gradient(rgba(255,255,255,0.03) 0% 25%, transparent 0% 50%) 0 0 / 16px 16px,
        #0a0a0a;
    border-bottom: none;
    padding: 0;
    position: relative;
    overflow: hidden;
}


#countdown-text {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

/* ── Board ── */
.sg-board {
    width: 100%;
    position: relative;
    overflow: hidden;
}

/* Speed lines horizontales */
.sg-speed-lines {
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            transparent 4px,
            rgba(229,0,0,0.02) 4px,
            rgba(229,0,0,0.02) 5px
        );
    pointer-events: none;
}

.sg-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1.2rem;
    gap: 1rem;
    position: relative;
    z-index: 2;
}

/* ── Gauche : Feux + Info ── */
.sg-left {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex-shrink: 0;
}

/* Feux de départ */
.sg-lights {
    display: flex;
    gap: 0.3rem;
    align-items: center;
}

.sg-light {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(80,0,0,0.6);
    border: 1.5px solid rgba(229,0,0,0.2);
    transition: all 0.3s ease;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
}

.sg-light-on {
    background: radial-gradient(circle at 40% 35%, #ff4444, #cc0000 60%, #880000);
    border-color: rgba(255,50,50,0.6);
    box-shadow:
        0 0 8px rgba(229,0,0,0.7),
        0 0 20px rgba(229,0,0,0.4),
        0 0 35px rgba(229,0,0,0.15),
        inset 0 -2px 4px rgba(0,0,0,0.3),
        inset 0 1px 2px rgba(255,150,150,0.3);
    animation: sgLightPulse 0.8s ease-in-out infinite alternate;
}
@keyframes sgLightPulse {
    from { box-shadow: 0 0 8px rgba(229,0,0,0.7), 0 0 20px rgba(229,0,0,0.4), 0 0 35px rgba(229,0,0,0.15), inset 0 -2px 4px rgba(0,0,0,0.3); }
    to   { box-shadow: 0 0 12px rgba(229,0,0,0.9), 0 0 25px rgba(229,0,0,0.5), 0 0 45px rgba(229,0,0,0.2), inset 0 -2px 4px rgba(0,0,0,0.3); }
}

.sg-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.sg-label {
    font-size: 0.45rem;
    font-weight: 900;
    letter-spacing: 4px;
    color: var(--red);
    opacity: 0.7;
}

.sg-session {
    font-size: 0.72rem;
    font-weight: 800;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ── Centre : Timer ── */
.sg-timer {
    display: flex;
    align-items: baseline;
    gap: 0.1rem;
    flex-shrink: 0;
    position: relative;
}

/* Motion blur derrière les chiffres */
.sg-timer::before {
    content: "";
    position: absolute;
    top: 50%;
    left: -15px;
    right: -15px;
    height: 60%;
    transform: translateY(-50%);
    background: linear-gradient(90deg,
        transparent,
        rgba(229,0,0,0.04) 20%,
        rgba(229,0,0,0.06) 50%,
        rgba(229,0,0,0.04) 80%,
        transparent);
    filter: blur(8px);
    pointer-events: none;
}

.sg-digit {
    font-family: 'Arial Black', 'Helvetica Neue', sans-serif;
    font-size: 1.8rem;
    font-weight: 900;
    font-style: italic;
    color: #fff;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -1px;
    position: relative;
    text-shadow:
        3px 0 8px rgba(229,0,0,0.3),
        6px 0 15px rgba(229,0,0,0.15),
        -1px 0 3px rgba(0,0,0,0.5);
    /* Effet de skew/vitesse */
    transform: skewX(-6deg);
}

.sg-digit-sec {
    color: var(--red);
    text-shadow:
        3px 0 10px rgba(229,0,0,0.5),
        6px 0 20px rgba(229,0,0,0.3),
        12px 0 30px rgba(229,0,0,0.1),
        -1px 0 3px rgba(0,0,0,0.5);
    animation: sgSecFlash 1s ease-in-out infinite;
}
@keyframes sgSecFlash {
    0%, 100% { text-shadow: 3px 0 10px rgba(229,0,0,0.5), 6px 0 20px rgba(229,0,0,0.3), 12px 0 30px rgba(229,0,0,0.1); }
    50% { text-shadow: 4px 0 15px rgba(229,0,0,0.7), 8px 0 25px rgba(229,0,0,0.4), 15px 0 40px rgba(229,0,0,0.2); }
}

.sg-colon {
    font-family: 'Arial Black', sans-serif;
    font-size: 1.4rem;
    font-weight: 900;
    font-style: italic;
    color: rgba(255,255,255,0.25);
    margin: 0 0.05rem;
    transform: skewX(-6deg);
    animation: sgColonBlink 1s step-end infinite;
}
@keyframes sgColonBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

/* ── Droite : GP ── */
.sg-right {
    flex-shrink: 0;
}

.sg-gp {
    font-size: 0.75rem;
    font-weight: 700;
    font-style: italic;
    color: rgba(255,255,255,0.45);
    letter-spacing: 0.5px;
    transform: skewX(-3deg);
    display: inline-block;
}

/* ── Light mode — garde le noir ── */
[data-theme="light"] .countdown-bar {
    background: repeating-conic-gradient(rgba(0,0,0,0.04) 0% 25%, transparent 0% 50%) 0 0 / 16px 16px, #0e0e0e;
}
[data-theme="light"] .sg-session { color: #fff; }
[data-theme="light"] .sg-digit { color: #fff; }

nav {
    background: var(--dark);
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 0;
    padding: 0 2rem;
    overflow-x: auto;
}

.nav-tab {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 1rem 1.5rem;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
    letter-spacing: 0.5px;
}

.nav-tab:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
}

.nav-tab.active {
    color: var(--red);
    border-bottom-color: var(--red);
}

main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.view {
    display: none;
}

.view.active {
    display: block;
    animation: viewFadeIn 0.3s ease forwards;
}

@keyframes viewFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Loading skeleton */
.skeleton {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    height: 280px;
    overflow: hidden;
    position: relative;
}

.skeleton::after {
    content: "";
    display: block;
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.04) 50%, transparent 100%);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.section-header {
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: -0.5px;
}

.section-header p {
    color: var(--muted);
    margin-top: 0.25rem;
    font-size: 0.9rem;
}

/* ═══ BARRE DE PROGRESSION SAISON ═══ */
.season-progress {
    margin-bottom: 1.5rem;
    padding: 1rem 1.2rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
}
.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
}
.progress-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
}
.progress-count {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--red);
}
.progress-bar-track {
    width: 100%;
    height: 8px;
    background: var(--card2);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}
.progress-bar-fill {
    height: 100%;
    width: 0%;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--red), #ff4444, var(--red));
    background-size: 200% 100%;
    animation: progressShine 2s ease-in-out infinite;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 0 10px rgba(229,0,0,0.4);
}
.progress-bar-fill::after {
    content: "";
    position: absolute;
    top: 0; right: 0;
    width: 6px; height: 100%;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(255,255,255,0.8), 0 0 15px var(--red);
}
@keyframes progressShine {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ═══ DRAPEAU ANIME AU HOVER ═══ */
.flag-wave {
    display: inline-block;
    transition: transform 0.3s ease;
}
.race-card:hover .flag-wave {
    animation: flagWave 0.6s ease-in-out;
}
@keyframes flagWave {
    0%   { transform: rotate(0deg) scale(1); }
    15%  { transform: rotate(12deg) scale(1.15); }
    30%  { transform: rotate(-8deg) scale(1.15); }
    45%  { transform: rotate(6deg) scale(1.1); }
    60%  { transform: rotate(-4deg) scale(1.1); }
    75%  { transform: rotate(2deg) scale(1.05); }
    100% { transform: rotate(0deg) scale(1); }
}

/* ═══ CARTE NEXT RACE — Bordure pulsante ═══ */
.race-card-next {
    border: 1.5px solid var(--red) !important;
    position: relative;
    overflow: hidden;
    animation: nextCardGlow 2s ease-in-out infinite;
}

@keyframes nextCardGlow {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(0,0,0,0.2), 0 0 15px rgba(229,0,0,0.15);
    }
    50% {
        box-shadow: 0 4px 20px rgba(0,0,0,0.2), 0 0 30px rgba(229,0,0,0.3), 0 0 60px rgba(229,0,0,0.1);
    }
}

/* Barre animée en haut */
.race-card-next::after {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 200%;
    height: 2.5px;
    background: linear-gradient(90deg, transparent, var(--red), #ff4444, var(--red), transparent);
    animation: nextCardSweep 2s linear infinite;
}
@keyframes nextCardSweep {
    0%   { transform: translateX(-50%); }
    100% { transform: translateX(0%); }
}

.race-card-next:hover {
    box-shadow: 0 8px 32px rgba(0,0,0,0.3), 0 0 35px rgba(229,0,0,0.3) !important;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
    font-weight: 700;
}

.filter-options {
    display: flex;
    gap: 0.25rem;
}

.filter-btn {
    background: var(--card2);
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: var(--red);
    color: var(--text);
}

.filter-btn.active {
    background: rgba(225, 6, 0, 0.15);
    color: var(--red);
    border-color: rgba(225, 6, 0, 0.3);
}

.filter-search {
    background: var(--card2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.82rem;
    outline: none;
    min-width: 180px;
}

.filter-search:focus {
    border-color: var(--red);
}

.races-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

.race-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s;
    position: relative;
}

.race-card-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.08;
    z-index: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.race-card:hover .race-card-bg {
    opacity: 0.14;
}
.race-card-header, .race-card-body {
    position: relative;
    z-index: 1;
}

.race-card:hover {
    transform: translateY(-3px) scale(1.01);
    border-color: var(--red);
    box-shadow: 0 8px 30px rgba(225, 6, 0, 0.15);
}

.race-card.completed {
    border-left: 4px solid var(--green);
}

.race-card.next {
    border-left: 4px solid var(--red);
    box-shadow: 0 0 20px rgba(225, 6, 0, 0.1);
}

.race-card.cancelled {
    border-left: 4px solid #ef4444;
    opacity: 0.6;
    filter: grayscale(0.3);
}

.race-card.sprint-card {
    border-left: 4px solid var(--sprint);
}

.race-card-header {
    background: var(--card2);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.race-round {
    font-size: 0.85rem;
    font-weight: 900;
    color: var(--red);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-style: italic;
    position: relative;
    padding-right: 1rem;
    text-shadow: 0 0 8px rgba(229,0,0,0.3);
}

/* Lignes de vitesse */
.race-round::before,
.race-round::after {
    content: "";
    position: absolute;
    right: 0;
    height: 1.5px;
    border-radius: 1px;
    background: linear-gradient(90deg, var(--red), transparent);
    opacity: 0.6;
    animation: speedLines 1.5s ease-in-out infinite;
}
.race-round::before {
    top: 3px;
    width: 10px;
}
.race-round::after {
    bottom: 3px;
    width: 7px;
    animation-delay: 0.3s;
}

@keyframes speedLines {
    0%, 100% { opacity: 0.3; transform: translateX(0); }
    50% { opacity: 0.8; transform: translateX(3px); }
}

.sprint-round {
    color: var(--sprint-light);
}

.race-badges {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    flex-wrap: wrap;
}

.race-card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.race-flag-name {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.race-flag {
    font-size: 2.5rem;
    line-height: 1;
}

.race-name {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
}

.race-country {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 0.15rem;
}

.race-info-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--muted);
}

.badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-done {
    background: rgba(34, 197, 94, 0.15);
    color: var(--green);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-next {
    background: rgba(225, 6, 0, 0.15);
    color: var(--red);
    border: 1px solid rgba(225, 6, 0, 0.3);
}

.badge-upcoming {
    background: rgba(136, 136, 136, 0.1);
    color: var(--muted);
    border: 1px solid var(--border);
}

.badge-cancelled {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.35);
    text-decoration: line-through;
    opacity: 0.85;
}

/* 🔴 Live — course en cours, badge pulsant */
.badge-live {
    background: rgba(225, 6, 0, 0.18);
    color: #fff;
    border: 1px solid rgba(225, 6, 0, 0.55);
    font-weight: 800;
    letter-spacing: 0.04em;
    box-shadow: 0 0 14px rgba(225, 6, 0, 0.45);
    animation: livePulse 1.4s ease-in-out infinite;
}
@keyframes livePulse {
    0%, 100% { box-shadow: 0 0 10px rgba(225, 6, 0, 0.4); opacity: 1; }
    50%      { box-shadow: 0 0 22px rgba(225, 6, 0, 0.85); opacity: 0.85; }
}

/* Carte course en mode live — bordure rouge brillante */
.race-card.live,
.race-card.race-status-live {
    border-color: rgba(225, 6, 0, 0.7);
    box-shadow: 0 0 0 1px rgba(225, 6, 0, 0.4), 0 6px 22px rgba(225, 6, 0, 0.25);
    position: relative;
}
.race-card.live::before,
.race-card.race-status-live::before {
    content: "🔴 LIVE";
    position: absolute;
    top: 0.6rem;
    left: 0.6rem;
    background: var(--red);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 900;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    letter-spacing: 0.08em;
    z-index: 5;
    animation: livePulse 1.4s ease-in-out infinite;
    box-shadow: 0 0 12px rgba(225, 6, 0, 0.6);
}

.sprint-tag {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    background: rgba(124, 58, 237, 0.15);
    color: var(--sprint-light);
    border: 1px solid rgba(124, 58, 237, 0.3);
}

/* ═══ NOUVEAU CIRCUIT — Badge ═══ */
.new-tag {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(255,215,0,0.25), rgba(255,165,0,0.15));
    color: #fbbf24;
    border: 1px solid rgba(255,215,0,0.5);
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 0 12px rgba(255,215,0,0.2), 0 0 25px rgba(255,215,0,0.08);
    animation: newTagPulse 2s ease-in-out infinite;
    position: relative;
}

@keyframes newTagPulse {
    0%, 100% { box-shadow: 0 0 12px rgba(255,215,0,0.2), 0 0 25px rgba(255,215,0,0.08); }
    50% { box-shadow: 0 0 18px rgba(255,215,0,0.4), 0 0 35px rgba(255,215,0,0.15); }
}

/* ═══ NOUVEAU CIRCUIT — Carte spéciale ═══ */
.race-card-new {
    border: 1px solid rgba(255,215,0,0.35) !important;
    position: relative;
    overflow: hidden;
}

.race-card-new::before {
    content: "★ NOUVEAU CIRCUIT ★";
    position: absolute;
    top: 22px;
    right: -45px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #000;
    font-size: 0.48rem;
    font-weight: 900;
    letter-spacing: 1.2px;
    padding: 0.3rem 3.5rem;
    transform: rotate(45deg);
    z-index: 5;
    box-shadow: 0 2px 10px rgba(245,158,11,0.5);
    text-transform: uppercase;
    white-space: nowrap;
}

.race-card-new::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255,215,0,0.6), rgba(255,165,0,0.8), rgba(255,215,0,0.6), transparent);
    animation: newCardShine 3s ease-in-out infinite;
}

@keyframes newCardShine {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.race-card-new:hover {
    border-color: rgba(255,215,0,0.6) !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3), 0 0 20px rgba(255,215,0,0.15) !important;
}

.race-result {
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
}

/* ═══════════════════════════════════════════════
   PODIUM STAGE — Style F1 TV Premium
   ═══════════════════════════════════════════════ */

.podium-stage {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 0 0;
    position: relative;
}

/* ── Carte individuelle ── */
.podium-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
}

.podium-card:hover {
    transform: translateY(-6px) !important;
}

/* ── Couronne P1 ── */
.podium-crown {
    font-size: 1.4rem;
    height: 1.6rem;
    line-height: 1.6rem;
    filter: drop-shadow(0 2px 6px rgba(255,215,0,0.6));
    animation: crownFloat 2.5s ease-in-out infinite;
}
@keyframes crownFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* ── Label position (1ST, 2ND, 3RD) ── */
.podium-position {
    font-size: 0.6rem;
    font-weight: 900;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 0.3rem;
    opacity: 0.7;
}

/* ── Logo équipe ── */
.podium-team-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    margin-bottom: 0.3rem;
    filter: brightness(1.1) drop-shadow(0 2px 6px rgba(0,0,0,0.5));
    mix-blend-mode: screen;
    transition: transform 0.3s ease, filter 0.3s ease;
}
.podium-card:hover .podium-team-logo {
    transform: scale(1.15);
    filter: brightness(1.3) drop-shadow(0 2px 10px var(--team-color));
}
.podium-p1 .podium-team-logo {
    width: 44px;
    height: 44px;
}

/* ── Barre couleur équipe ── */
.podium-team-bar {
    width: 70%;
    height: 3px;
    border-radius: 3px;
    background: var(--team-color);
    box-shadow: 0 0 12px var(--team-color), 0 0 25px color-mix(in srgb, var(--team-color) 50%, transparent);
    margin-bottom: 0.5rem;
}

/* ── Nom pilote ── */
.podium-driver-name {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
    padding: 0 0.4rem;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

/* ── Badge équipe ── */
.podium-team-name {
    font-size: 0.6rem;
    color: var(--team-color);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 700;
    margin-top: 0.3rem;
    margin-bottom: 0.5rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    background: color-mix(in srgb, var(--team-color) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--team-color) 30%, transparent);
    text-shadow: 0 0 8px color-mix(in srgb, var(--team-color) 40%, transparent);
    white-space: nowrap;
    max-width: 95%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Pilier / Socle en bas ── */
.podium-pillar {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    position: relative;
    overflow: hidden;
}
.podium-pillar-num {
    font-size: 1.6rem;
    opacity: 0.35;
    font-style: italic;
    font-weight: 900;
    position: relative;
    letter-spacing: -1px;
    transform: skewX(-12deg);
}

/* Lignes de vitesse sur les numéros du podium */
.podium-pillar-num::before,
.podium-pillar-num::after,
.podium-pillar::before,
.podium-pillar::after {
    content: "";
    position: absolute;
    left: -5px;
    height: 2px;
    border-radius: 2px;
    opacity: 0;
    animation: podiumSpeed 1.2s ease-in-out infinite;
}
.podium-pillar-num::before {
    top: 15%;
    width: 18px;
    background: linear-gradient(270deg, currentColor, transparent);
    animation-delay: 0s;
}
.podium-pillar-num::after {
    bottom: 15%;
    width: 12px;
    background: linear-gradient(270deg, currentColor, transparent);
    animation-delay: 0.2s;
}
.podium-pillar::before {
    top: 30%;
    left: 8px;
    width: 22px;
    height: 1.5px;
    border-radius: 2px;
    background: linear-gradient(270deg, currentColor, transparent);
    color: inherit;
    animation: podiumSpeed 1.2s ease-in-out infinite 0.4s;
    z-index: 2;
}
.podium-pillar::after {
    top: 60%;
    left: 5px;
    width: 15px;
    height: 1.5px;
    border-radius: 2px;
    background: linear-gradient(270deg, currentColor, transparent);
    color: inherit;
    animation: podiumSpeed 1.2s ease-in-out infinite 0.6s;
    z-index: 2;
}

/* P1 lignes dorées */
.podium-p1 .podium-pillar::before,
.podium-p1 .podium-pillar::after {
    background: linear-gradient(270deg, rgba(255,215,0,0.5), transparent);
}
/* P2 lignes argentées */
.podium-p2 .podium-pillar::before,
.podium-p2 .podium-pillar::after {
    background: linear-gradient(270deg, rgba(192,192,192,0.4), transparent);
}
/* P3 lignes bronze */
.podium-p3 .podium-pillar::before,
.podium-p3 .podium-pillar::after {
    background: linear-gradient(270deg, rgba(205,127,50,0.4), transparent);
}

@keyframes podiumSpeed {
    0%   { opacity: 0; transform: translateX(0); }
    20%  { opacity: 0.8; }
    60%  { opacity: 0.6; transform: translateX(-12px); }
    100% { opacity: 0; transform: translateX(-20px); }
}

/* ═══ P1 — OR — centre, le plus grand ═══ */
.podium-p1 {
    order: 2;
    z-index: 3;
    width: 130px;
    background: linear-gradient(180deg,
        rgba(255,215,0,0.12) 0%,
        rgba(255,180,0,0.05) 40%,
        rgba(20,20,20,0.95) 40%,
        rgba(30,30,30,0.98) 100%);
    border: 1px solid rgba(255,215,0,0.4);
    box-shadow:
        0 0 40px rgba(255,215,0,0.2),
        0 0 80px rgba(255,215,0,0.08),
        0 8px 30px rgba(0,0,0,0.5);
}
.podium-p1 .podium-position { color: var(--gold); }
.podium-p1 .podium-driver-name {
    font-size: 0.82rem;
    background: linear-gradient(180deg, #fff 20%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.podium-p1 .podium-pillar {
    height: 70px;
    background: linear-gradient(180deg, rgba(255,215,0,0.15), rgba(255,215,0,0.04));
    border-top: 2px solid rgba(255,215,0,0.3);
}
.podium-p1 .podium-pillar-num {
    color: var(--gold);
    font-size: 2.5rem;
    opacity: 0.45;
    text-shadow: 0 0 25px rgba(255,215,0,0.4), 0 0 50px rgba(255,215,0,0.15);
    transform: skewX(-15deg);
}

/* Shimmer P1 */
.podium-p1::before {
    content: "";
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255,215,0,0.1) 50%, transparent 100%);
    animation: podiumSweep 3s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

/* ═══ P2 — ARGENT — gauche ═══ */
.podium-p2 {
    order: 1;
    z-index: 2;
    width: 115px;
    background: linear-gradient(180deg,
        rgba(192,192,192,0.1) 0%,
        rgba(192,192,192,0.03) 40%,
        rgba(20,20,20,0.95) 40%,
        rgba(25,25,25,0.98) 100%);
    border: 1px solid rgba(192,192,192,0.25);
    box-shadow:
        0 0 25px rgba(192,192,192,0.1),
        0 6px 20px rgba(0,0,0,0.4);
}
.podium-p2 .podium-position { color: var(--silver); }
.podium-p2 .podium-driver-name { color: rgba(220,220,230,0.95); }
.podium-p2 .podium-pillar {
    height: 50px;
    background: linear-gradient(180deg, rgba(192,192,192,0.1), rgba(192,192,192,0.02));
    border-top: 2px solid rgba(192,192,192,0.2);
}
.podium-p2 .podium-pillar-num {
    color: var(--silver);
    text-shadow: 0 0 15px rgba(192,192,192,0.2);
}

/* Shimmer P2 */
.podium-p2::before {
    content: "";
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(192,192,192,0.06) 50%, transparent 100%);
    animation: podiumSweep 4s ease-in-out infinite 0.8s;
    pointer-events: none;
}

/* ═══ P3 — BRONZE — droite ═══ */
.podium-p3 {
    order: 3;
    z-index: 1;
    width: 110px;
    background: linear-gradient(180deg,
        rgba(205,127,50,0.1) 0%,
        rgba(205,127,50,0.03) 40%,
        rgba(20,20,20,0.95) 40%,
        rgba(25,25,25,0.98) 100%);
    border: 1px solid rgba(205,127,50,0.25);
    box-shadow:
        0 0 25px rgba(205,127,50,0.1),
        0 6px 20px rgba(0,0,0,0.4);
}
.podium-p3 .podium-position { color: var(--bronze); }
.podium-p3 .podium-driver-name { color: rgba(220,210,200,0.95); }
.podium-p3 .podium-pillar {
    height: 35px;
    background: linear-gradient(180deg, rgba(205,127,50,0.1), rgba(205,127,50,0.02));
    border-top: 2px solid rgba(205,127,50,0.2);
}
.podium-p3 .podium-pillar-num {
    color: var(--bronze);
    text-shadow: 0 0 15px rgba(205,127,50,0.2);
}

/* Shimmer P3 */
.podium-p3::before {
    content: "";
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(205,127,50,0.06) 50%, transparent 100%);
    animation: podiumSweep 4.5s ease-in-out infinite 1.5s;
    pointer-events: none;
}

/* ═══ Animations ═══ */
@keyframes podiumSweep {
    0%   { left: -100%; }
    50%  { left: 100%; }
    100% { left: 100%; }
}

@keyframes podiumRise {
    from { opacity: 0; transform: translateY(40px); }
    to   { opacity: 1; transform: translateY(0); }
}

.podium-p2 { animation: podiumRise 0.5s ease-out 0.1s both; }
.podium-p1 { animation: podiumRise 0.6s ease-out 0.35s both; }
.podium-p3 { animation: podiumRise 0.5s ease-out 0.55s both; }

/* Hover glow additionnel */
.podium-p1:hover { box-shadow: 0 0 50px rgba(255,215,0,0.35), 0 0 100px rgba(255,215,0,0.12), 0 10px 40px rgba(0,0,0,0.5); }
.podium-p2:hover { box-shadow: 0 0 35px rgba(192,192,192,0.25), 0 0 70px rgba(192,192,192,0.08), 0 8px 30px rgba(0,0,0,0.4); }
.podium-p3:hover { box-shadow: 0 0 35px rgba(205,127,50,0.25), 0 0 70px rgba(205,127,50,0.08), 0 8px 30px rgba(0,0,0,0.4); }

.podium-team {
    font-size: 0.62rem;
    color: var(--muted);
    margin-top: 0.3rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.no-result {
    text-align: center;
    color: var(--muted);
    font-size: 0.8rem;
    padding: 0.75rem;
    background: var(--card2);
    border-radius: 8px;
    border: 1px dashed var(--border);
}

.standings-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .standings-container {
        grid-template-columns: 1fr;
    }
}

.standings-block h3 {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--red);
}

.standings-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--card);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.standings-table thead {
    background: linear-gradient(180deg, var(--card2), rgba(30,30,30,0.95));
}

.standings-table th {
    padding: 0.85rem 1rem;
    text-align: left;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--muted);
    border-bottom: 2px solid var(--border);
    font-weight: 700;
}

.standings-table td {
    padding: 0.7rem 0.8rem;
    font-size: 0.88rem;
    border-bottom: 1px solid rgba(42, 42, 42, 0.4);
    vertical-align: middle;
}

.standings-table tbody tr:last-child td {
    border-bottom: none;
}

.standings-table tbody tr {
    transition: all 0.25s ease;
    position: relative;
}

.standings-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
    transform: scale(1.005);
}

/* ═══ Barre de couleur équipe ═══ */
.standing-color-cell {
    width: 4px;
    padding: 0 !important;
    position: relative;
}
.standing-color-bar {
    display: block;
    width: 4px;
    height: 70%;
    min-height: 22px;
    border-radius: 2px;
    position: absolute;
    top: 15%;
    left: 0.5rem;
    box-shadow: 0 0 6px color-mix(in srgb, var(--team-color, #666) 60%, transparent);
}

/* ═══ Position ═══ */
.standing-pos {
    font-weight: 900;
    font-size: 0.95rem;
    text-align: center;
    width: 38px;
    min-width: 38px;
}

/* ═══ Nom pilote / écurie ═══ */
.standing-driver {
    font-weight: 700;
    letter-spacing: 0.3px;
}

.standing-team {
    color: var(--muted);
    font-size: 0.78rem;
}

/* ═══ Ligne animée ═══ */
.standing-row {
    transition: background 0.25s ease;
}

/* ═══ Cellule points avec barre de progression ═══ */
.standing-points-cell {
    position: relative;
    min-width: 140px;
    padding-right: 1rem !important;
}
.standing-points-bar-wrap {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    overflow: hidden;
    border-radius: 0 2px 2px 0;
}
.standing-points-bar {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    opacity: 0.18;
    border-radius: 0 3px 3px 0;
    /* L'animation est gérée par JS via requestAnimationFrame */
    transition: none;
}
/* Tip lumineux à l'extrémité de la barre */
.standing-points-bar::after {
    content: "";
    position: absolute;
    right: 0; top: 15%; bottom: 15%;
    width: 3px;
    background: inherit;
    filter: brightness(2.5);
    border-radius: 2px;
    box-shadow: 0 0 8px currentColor;
}
.standing-pts-value {
    position: relative;
    z-index: 1;
    font-weight: 900;
    font-size: 0.95rem;
    color: white;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.5px;
}

/* ═══ TOP 3 — Effets premium ═══ */
.standing-top {
    position: relative;
}

/* P1 — Gold */
.standing-p1 {
    background: linear-gradient(90deg, rgba(255,215,0,0.08) 0%, transparent 60%) !important;
}
.standing-p1:hover {
    background: linear-gradient(90deg, rgba(255,215,0,0.14) 0%, rgba(255,215,0,0.03) 60%) !important;
}
.standing-p1 .standing-pos {
    font-size: 1.2rem;
    filter: drop-shadow(0 2px 4px rgba(255,215,0,0.3));
}
.standing-p1 .standing-driver {
    color: var(--gold);
    text-shadow: 0 0 15px rgba(255,215,0,0.15);
}
.standing-p1 .standing-pts-value {
    color: var(--gold);
    text-shadow: 0 0 10px rgba(255,215,0,0.3);
    font-size: 1.05rem;
}
.standing-p1 td:first-child {
    box-shadow: inset 3px 0 0 var(--gold);
}

/* P2 — Silver */
.standing-p2 {
    background: linear-gradient(90deg, rgba(192,192,192,0.06) 0%, transparent 50%) !important;
}
.standing-p2:hover {
    background: linear-gradient(90deg, rgba(192,192,192,0.1) 0%, rgba(192,192,192,0.02) 50%) !important;
}
.standing-p2 .standing-pos {
    font-size: 1.15rem;
    filter: drop-shadow(0 2px 4px rgba(192,192,192,0.2));
}
.standing-p2 .standing-driver {
    color: var(--silver);
}
.standing-p2 .standing-pts-value {
    color: var(--silver);
}
.standing-p2 td:first-child {
    box-shadow: inset 3px 0 0 var(--silver);
}

/* P3 — Bronze */
.standing-p3 {
    background: linear-gradient(90deg, rgba(205,127,50,0.06) 0%, transparent 50%) !important;
}
.standing-p3:hover {
    background: linear-gradient(90deg, rgba(205,127,50,0.1) 0%, rgba(205,127,50,0.02) 50%) !important;
}
.standing-p3 .standing-pos {
    font-size: 1.1rem;
    filter: drop-shadow(0 2px 4px rgba(205,127,50,0.2));
}
.standing-p3 .standing-driver {
    color: var(--bronze);
}
.standing-p3 .standing-pts-value {
    color: var(--bronze);
}
.standing-p3 td:first-child {
    box-shadow: inset 3px 0 0 var(--bronze);
}

/* Séparateur après le top 3 */
.standing-p3 td {
    border-bottom: 2px solid rgba(255,255,255,0.08) !important;
}

.points-cell {
    font-weight: 800;
    color: var(--red);
    white-space: nowrap;
}

.timeline-month {
    margin-bottom: 2rem;
}

.timeline-month-label {
    font-size: 1rem;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.timeline-race-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.6rem;
    cursor: pointer;
    transition: all 0.2s;
    gap: 1rem;
}

.timeline-race-item:hover {
    border-color: var(--red);
    transform: translateX(4px);
}

.timeline-race-item.completed {
    border-left: 4px solid var(--green);
}

.timeline-race-item.next {
    border-left: 4px solid var(--red);
}

.timeline-race-item.cancelled {
    border-left: 4px solid #ef4444;
    opacity: 0.55;
    filter: grayscale(0.4);
}

.timeline-race-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.timeline-flag {
    font-size: 1.8rem;
}

.timeline-race-name {
    font-weight: 700;
    font-size: 0.95rem;
}

.timeline-race-date {
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 0.15rem;
}

.timeline-race-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(20px) scale(0.98);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.open .modal {
    transform: translateY(0) scale(1);
}

/* ═══════════════════════════════════════════════
   MODAL PREMIUM — Header + Onglets
   ═══════════════════════════════════════════════ */

.modal-header {
    background: linear-gradient(160deg, #0e0e0e 0%, #1a0000 60%, #0d0d0d 100%);
    padding: 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    z-index: 10;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
}

/* Barre de couleur équipe vainqueur en haut */
.modal-hero-bar {
    height: 4px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--hero-color, var(--red)) 20%,
        var(--hero-color, var(--red)) 80%,
        transparent 100%);
    box-shadow: 0 0 20px var(--hero-color, var(--red)),
                0 0 40px color-mix(in srgb, var(--hero-color, var(--red)) 40%, transparent);
}

.modal-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1.2rem 1.2rem 1rem 1.5rem;
}

.modal-title-block {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex: 1;
}

.modal-flag {
    font-size: 2.8rem;
    line-height: 1;
    filter: drop-shadow(0 3px 8px rgba(0,0,0,0.5));
}

.modal-race-name {
    font-size: 1.25rem;
    font-weight: 900;
    line-height: 1.3;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.4rem;
    font-size: 0.75rem;
    color: var(--muted);
}
.modal-meta-sprint {
    color: var(--sprint-light);
    font-weight: 700;
}
.modal-meta-new {
    color: var(--gold);
    font-weight: 700;
}

.modal-close {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s ease, border-color 0.2s ease;
    flex-shrink: 0;
}
.modal-close:hover {
    background: var(--red);
    border-color: var(--red);
}

/* ── Rangée d'onglets ── */
.modal-tabs {
    display: flex;
    gap: 0;
    border-top: 1px solid rgba(255,255,255,0.06);
    overflow-x: auto;
    scrollbar-width: none;
}
.modal-tabs::-webkit-scrollbar { display: none; }

.modal-tab-btn {
    flex: 1;
    min-width: 80px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 0.7rem 0.5rem;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
    white-space: nowrap;
}
.modal-tab-btn:hover {
    color: white;
    background: rgba(255,255,255,0.04);
}
.modal-tab-btn.active {
    color: white;
    border-bottom-color: var(--red);
    background: rgba(229,0,0,0.06);
}

/* ── Pane contenu ── */
.modal-tab-pane {
    animation: tabFadeIn 0.25s ease-out both;
}
@keyframes tabFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Bouton save admin */
.modal-save-btn {
    margin-top: 0.75rem;
    padding: 0.5rem 1.2rem;
    background: var(--red);
    border: none;
    color: white;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.85rem;
    transition: filter 0.2s ease;
}
.modal-save-btn:hover { filter: brightness(1.15); }

.modal-body {
    padding: 1.2rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.modal-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.modal-section-title {
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--muted);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

/* ── Dropdown accordion pour qualifs ── */
.dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--card2);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--muted);
    transition: all 0.3s ease;
    user-select: none;
}

.dropdown-header:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.15);
    color: white;
}

.dropdown-header.open {
    border-radius: 10px 10px 0 0;
    border-bottom-color: transparent;
    color: white;
    background: rgba(255,255,255,0.04);
}

.dropdown-chevron {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.dropdown-content {
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 10px 10px;
    padding: 0.5rem;
    background: rgba(0,0,0,0.15);
    animation: dropdownSlide 0.25s ease-out;
}

@keyframes dropdownSlide {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.schedule-grid {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.schedule-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.65rem 1rem;
    background: var(--card2);
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 0.85rem;
    transition: background 0.2s;
}

.schedule-item.highlight {
    background: rgba(225, 6, 0, 0.08);
    border-color: rgba(225, 6, 0, 0.3);
}

.schedule-item.sprint-session {
    background: rgba(124, 58, 237, 0.08);
    border-color: rgba(124, 58, 237, 0.3);
}

.schedule-day {
    font-weight: 700;
    color: var(--muted);
    min-width: 80px;
    font-size: 0.78rem;
}

.schedule-name {
    flex: 1;
    font-weight: 600;
}

.schedule-time {
    font-weight: 800;
    color: var(--red);
    font-size: 0.9rem;
}

.full-results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.full-results-table thead tr {
    background: var(--card2);
    border-bottom: 1px solid var(--border);
}

.full-results-table th {
    padding: 0.65rem 0.75rem;
    text-align: left;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
}

.full-results-table td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid rgba(42, 42, 42, 0.5);
    vertical-align: middle;
}

.full-results-table tbody tr:last-child td {
    border-bottom: none;
}

.full-results-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Podium rows - prestigious glow */
.full-results-table tbody tr.podium-row-1 {
    background: linear-gradient(90deg, rgba(255,215,0,0.1) 0%, transparent 60%);
    border-left: 3px solid var(--gold);
    box-shadow: inset 0 0 30px rgba(255,215,0,0.03);
}
.full-results-table tbody tr.podium-row-2 {
    background: linear-gradient(90deg, rgba(192,192,192,0.08) 0%, transparent 60%);
    border-left: 3px solid var(--silver);
    box-shadow: inset 0 0 30px rgba(192,192,192,0.03);
}
.full-results-table tbody tr.podium-row-3 {
    background: linear-gradient(90deg, rgba(205,127,50,0.08) 0%, transparent 60%);
    border-left: 3px solid var(--bronze);
    box-shadow: inset 0 0 30px rgba(205,127,50,0.03);
}
.full-results-table tbody tr.podium-row-1:hover {
    background: linear-gradient(90deg, rgba(255,215,0,0.18) 0%, rgba(255,215,0,0.02) 70%);
}
.full-results-table tbody tr.podium-row-2:hover {
    background: linear-gradient(90deg, rgba(192,192,192,0.15) 0%, rgba(192,192,192,0.02) 70%);
}
.full-results-table tbody tr.podium-row-3:hover {
    background: linear-gradient(90deg, rgba(205,127,50,0.15) 0%, rgba(205,127,50,0.02) 70%);
}

.pos-medal {
    font-weight: 900;
    font-size: 0.95rem;
}

.pos-medal.gold {
    color: var(--gold);
    text-shadow: 0 0 8px rgba(255,215,0,0.4);
}
.pos-medal.silver {
    color: var(--silver);
    text-shadow: 0 0 8px rgba(192,192,192,0.35);
}
.pos-medal.bronze {
    color: var(--bronze);
    text-shadow: 0 0 8px rgba(205,127,50,0.35);
}

.fastest-lap {
    font-size: 0.75rem;
    color: var(--sprint-light);
    margin-left: 0.3rem;
}

/* ═══ PALMARÈS ═══ */
.palmares-podiums-row,
.palmares-tables-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.palmares-podiums-row { margin-bottom: 2rem; }
.palmares-tables-row { margin-bottom: 1rem; }

@media (max-width: 768px) {
    .palmares-podiums-row,
    .palmares-tables-row {
        grid-template-columns: 1fr;
    }
}

.palmares-section {
    margin-bottom: 1.5rem;
}
.palmares-title {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 1.2rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
    letter-spacing: 0.3px;
}
.palmares-table {
    width: 100%;
}
.palmares-table th {
    text-align: left;
}

.no-data-box {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--muted);
    background: var(--card2);
    border-radius: 12px;
    border: 1px dashed var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.modal::-webkit-scrollbar {
    width: 6px;
}

.modal::-webkit-scrollbar-track {
    background: var(--card);
}

.modal::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.modal::-webkit-scrollbar-thumb:hover {
    background: var(--red);
}

/* ── Race card stats (winner / pole) ── */
.race-stats-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.race-stat-chip {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--card2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.stat-color-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.stat-label {
    font-size: 0.7rem;
}

.stat-value {
    color: var(--text);
    font-weight: 700;
    letter-spacing: 0.3px;
}

/* ── F1 Driver Picker ── */
.f1-picker {
    position: relative;
    width: 100%;
}

/* Picker verrouillé */
.f1-picker-locked .f1-picker-btn {
    cursor: default;
    opacity: 0.85;
    border-color: rgba(34,197,94,0.3);
    background: rgba(34,197,94,0.05);
}
.f1-picker-locked .f1-picker-btn:hover {
    border-color: rgba(34,197,94,0.3);
}

/* Bouton éditer */
.f1-picker-edit {
    display: none;
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--card2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.15rem 0.35rem;
    font-size: 0.7rem;
    cursor: pointer;
    z-index: 3;
    line-height: 1;
    transition: all 0.2s;
}
.f1-picker-edit:hover {
    border-color: var(--red);
    background: rgba(229,0,0,0.1);
}
.f1-picker-locked .f1-picker-edit {
    display: block;
}

/* ═══ Pilote déjà pris — Effet ULTIME ═══ */
.f1-picker-disabled {
    pointer-events: none;
    position: relative;
    overflow: hidden;
    border-left-color: transparent !important;
    padding-right: 95px;
    height: 32px;
    display: flex;
    align-items: center;
    background:
        repeating-linear-gradient(
            -45deg,
            rgba(229,0,0,0.03),
            rgba(229,0,0,0.03) 3px,
            transparent 3px,
            transparent 8px
        ),
        linear-gradient(105deg,
            rgba(229,0,0,0.08) 0%,
            rgba(10,10,10,0.97) 30%,
            rgba(10,10,10,0.97) 70%,
            rgba(229,0,0,0.08) 100%);
    border-top: 1px solid rgba(229,0,0,0.1) !important;
    border-bottom: 1px solid rgba(229,0,0,0.1) !important;
    transition: none;
}

/* Ligne de scan rouge animée */
.f1-picker-disabled::before {
    content: "";
    position: absolute;
    top: 0; bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, transparent, var(--red), transparent);
    box-shadow: 0 0 8px var(--red), 0 0 15px rgba(229,0,0,0.4);
    animation: disabledLaserScan 2s ease-in-out infinite;
    z-index: 2;
    pointer-events: none;
    border-radius: 2px;
}
@keyframes disabledLaserScan {
    0%   { left: 0; opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { left: calc(100% - 3px); opacity: 0; }
}

/* Nom du pilote — glitch */
.f1-picker-disabled .f1-opt-name {
    color: rgba(255,255,255,0.18);
    position: relative;
    font-style: italic;
    animation: disabledGlitch 4s ease-in-out infinite;
}
@keyframes disabledGlitch {
    0%, 92%, 100% { opacity: 1; transform: none; }
    93% { opacity: 0.5; transform: translateX(2px) skewX(-2deg); color: rgba(229,0,0,0.3); }
    94% { opacity: 0.8; transform: translateX(-1px); }
    95% { opacity: 0.5; transform: translateX(1px) skewX(1deg); color: rgba(0,150,255,0.2); }
    96% { opacity: 1; transform: none; }
}

/* Double barre rouge sur le nom */
.f1-picker-disabled .f1-opt-name::before,
.f1-picker-disabled .f1-opt-name::after {
    content: "";
    position: absolute;
    left: -4px; right: -4px;
    height: 1.5px;
    border-radius: 1px;
}
.f1-picker-disabled .f1-opt-name::before {
    top: 38%;
    background: linear-gradient(90deg, transparent, var(--red), var(--red), transparent);
    box-shadow: 0 0 4px rgba(229,0,0,0.5);
}
.f1-picker-disabled .f1-opt-name::after {
    top: 62%;
    background: linear-gradient(90deg, transparent, rgba(229,0,0,0.4), transparent);
}

/* Drapeau — noir et blanc, réduit, pulsant */
.f1-picker-disabled .f1-opt-flag {
    filter: grayscale(1) brightness(0.4) contrast(0.8);
    font-size: 0.65em;
    opacity: 0.3;
    animation: disabledFlagPulse 3s ease-in-out infinite;
}
@keyframes disabledFlagPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.15; }
}

/* Badge INDISPONIBLE — style terminal/militaire */
.f1-picker-disabled::after {
    content: "⛔ INDISPONIBLE";
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.4rem;
    font-weight: 900;
    letter-spacing: 2px;
    font-family: monospace;
    color: #ff3333;
    background:
        linear-gradient(180deg, rgba(30,0,0,0.95), rgba(50,0,0,0.95));
    padding: 0.2rem 0.5rem;
    border-radius: 2px;
    text-transform: uppercase;
    box-shadow:
        0 0 12px rgba(229,0,0,0.35),
        0 0 25px rgba(229,0,0,0.1),
        inset 0 0 15px rgba(229,0,0,0.15);
    z-index: 3;
    border: 1px solid rgba(229,0,0,0.5);
    text-shadow: 0 0 6px rgba(255,0,0,0.6);
    animation: disabledBadgePulse 2s ease-in-out infinite;
}
@keyframes disabledBadgePulse {
    0%, 100% {
        box-shadow: 0 0 12px rgba(229,0,0,0.35), 0 0 25px rgba(229,0,0,0.1), inset 0 0 15px rgba(229,0,0,0.15);
        text-shadow: 0 0 6px rgba(255,0,0,0.6);
    }
    50% {
        box-shadow: 0 0 18px rgba(229,0,0,0.5), 0 0 35px rgba(229,0,0,0.2), inset 0 0 20px rgba(229,0,0,0.25);
        text-shadow: 0 0 10px rgba(255,0,0,0.9);
    }
}

/* Vignette rouge sur les bords */
.f1-picker-option.f1-picker-disabled {
    box-shadow: inset 0 0 20px rgba(229,0,0,0.06);
}

.f1-picker-btn {
    width: 100%;
    padding: 0.45rem 0.6rem;
    background: var(--card2);
    border: 1px solid var(--border);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    font-weight: 600;
    transition: border-color 0.2s;
    text-align: left;
}

.f1-picker-btn:hover,
.f1-picker-btn:focus {
    border-color: var(--red);
    outline: none;
}

.f1-picker-btn .f1-color-bar {
    width: 4px;
    height: 20px;
    border-radius: 2px;
    flex-shrink: 0;
}

.f1-picker-btn .f1-picker-flag {
    font-size: 1rem;
    line-height: 1;
}

.f1-picker-btn .f1-picker-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.f1-picker-btn .f1-picker-team {
    font-size: 0.68rem;
    color: var(--muted);
    font-weight: 400;
    margin-left: auto;
    flex-shrink: 0;
}

.f1-picker-btn .f1-picker-chevron {
    font-size: 0.6rem;
    color: var(--muted);
    flex-shrink: 0;
    transition: transform 0.2s;
}

.f1-picker.open .f1-picker-chevron {
    transform: rotate(180deg);
}

.f1-picker-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    max-height: 320px;
    overflow-y: auto;
    z-index: 50;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    padding: 0.25rem;
}

.f1-picker.open .f1-picker-dropdown {
    display: block;
}

.f1-picker-group-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.6rem 0.25rem;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
}

.f1-picker-group-bar {
    width: 12px;
    height: 3px;
    border-radius: 2px;
}

.f1-picker-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    transition: background 0.15s;
    border-left: 3px solid transparent;
}

.f1-picker-option:hover {
    background: rgba(255, 255, 255, 0.06);
}

.f1-picker-option.selected {
    background: rgba(225, 6, 0, 0.1);
}

.f1-picker-option .f1-opt-flag {
    font-size: 0.95rem;
    line-height: 1;
}

.f1-picker-option .f1-opt-name {
    flex: 1;
}

.f1-picker-dropdown::-webkit-scrollbar {
    width: 4px;
}

.f1-picker-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.f1-picker-dropdown::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

/* ── Anti-spoil ── */
.spoil-wrapper {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
}

.spoil-blur {
    filter: blur(8px);
    user-select: none;
    pointer-events: none;
    transition: filter 0.4s ease;
}

.spoil-wrapper.revealed .spoil-blur {
    filter: none;
    user-select: auto;
    pointer-events: auto;
}

.spoil-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: rgba(10, 10, 10, 0.55);
    backdrop-filter: blur(2px);
    z-index: 5;
    transition: opacity 0.35s ease;
    border-radius: 10px;
}

.spoil-wrapper.revealed .spoil-overlay {
    opacity: 0;
    pointer-events: none;
}

.spoil-overlay-icon {
    font-size: 2rem;
}

.spoil-overlay-text {
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 600;
}

.spoil-btn {
    padding: 0.5rem 1.2rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 700;
    transition: all 0.2s;
    letter-spacing: 0.3px;
}

.spoil-btn:hover {
    background: rgba(225, 6, 0, 0.15);
    border-color: var(--red);
    color: var(--red);
}

.spoil-wrapper.revealed .spoil-btn-reveal {
    display: none;
}

.spoil-btn-hide {
    display: none;
    margin-top: 0.75rem;
    padding: 0.35rem 1rem;
    background: rgba(225, 6, 0, 0.1);
    border: 1px solid rgba(225, 6, 0, 0.3);
    color: var(--red);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    transition: all 0.2s;
}

.spoil-wrapper.revealed .spoil-btn-hide {
    display: inline-block;
}

.spoil-btn-hide:hover {
    background: rgba(225, 6, 0, 0.2);
}

/* ═══════════════════════════════════════════════
   ANTI-SPOIL — Cartes page d'accueil
   ═══════════════════════════════════════════════ */

.card-spoil-wrapper {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 0.5rem;
}

/* Contenu masqué par défaut */
.card-spoil-content {
    filter: blur(8px);
    pointer-events: none;
    user-select: none;
    transition: filter 0.4s ease, opacity 0.4s ease;
    opacity: 0.4;
}

/* Contenu visible quand révélé */
.card-spoil-wrapper.revealed .card-spoil-content {
    filter: none;
    pointer-events: auto;
    opacity: 1;
}

/* Overlay par-dessus le contenu flou */
.card-spoil-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg,
        rgba(10,10,10,0.85) 0%,
        rgba(30,0,0,0.75) 100%);
    border: 1px solid rgba(229,0,0,0.2);
    border-radius: 10px;
    backdrop-filter: blur(2px);
    transition: opacity 0.3s ease;
    flex-wrap: wrap;
    padding: 0.5rem;
}

.card-spoil-wrapper.revealed .card-spoil-overlay {
    opacity: 0;
    pointer-events: none;
}

.card-spoil-icon {
    font-size: 1rem;
    animation: cardSpoilPulse 2s ease-in-out infinite;
}
@keyframes cardSpoilPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.card-spoil-text {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
}

.card-spoil-btn {
    background: linear-gradient(135deg, rgba(229,0,0,0.8), rgba(180,0,0,0.9));
    border: 1px solid rgba(229,0,0,0.5);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 0 10px rgba(229,0,0,0.3);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.card-spoil-btn:hover {
    box-shadow: 0 0 18px rgba(229,0,0,0.5);
    transform: scale(1.05);
}

.card-spoil-hide-btn {
    display: none;
    position: relative;
    overflow: hidden;
    width: 100%;
    text-align: center;
    /* Fond sombre avec liseré rouge en bas */
    background: linear-gradient(180deg,
        rgba(25,25,25,0.98) 0%,
        rgba(18,18,18,0.98) 100%);
    border: none;
    border-top: 1px solid rgba(229,0,0,0.15);
    border-bottom: 3px solid var(--red);
    border-radius: 0 0 4px 4px;
    color: rgba(255,255,255,0.65);
    font-size: 0.6rem;
    font-weight: 800;
    font-style: italic;
    letter-spacing: 3px;
    text-transform: uppercase;
    cursor: pointer;
    padding: 0.55rem 1rem;
    margin-top: 0.5rem;
    transition: color 0.25s ease, background 0.25s ease,
                border-bottom-color 0.25s ease, box-shadow 0.25s ease;
}

/* Barre rouge gauche style F1 timing */
.card-spoil-hide-btn::before {
    content: "";
    position: absolute;
    left: 0; top: 15%; bottom: 15%;
    width: 3px;
    background: var(--red);
    border-radius: 0 2px 2px 0;
    box-shadow: 0 0 8px rgba(229,0,0,0.6);
    transition: height 0.2s ease, box-shadow 0.2s ease;
}

/* Reflet diagonal qui traverse au hover */
.card-spoil-hide-btn::after {
    content: "";
    position: absolute;
    top: 0; left: -80%;
    width: 50%; height: 100%;
    background: linear-gradient(105deg,
        transparent 30%,
        rgba(255,255,255,0.06) 50%,
        transparent 70%);
    transition: left 0.4s ease;
}

.card-spoil-hide-btn:hover {
    background: linear-gradient(180deg,
        rgba(35,35,35,0.99) 0%,
        rgba(229,0,0,0.08) 100%);
    color: rgba(255,255,255,0.9);
    border-bottom-color: #ff2222;
    box-shadow: 0 4px 16px rgba(229,0,0,0.2);
}
.card-spoil-hide-btn:hover::before {
    box-shadow: 0 0 14px rgba(229,0,0,0.9);
}
.card-spoil-hide-btn:hover::after { left: 140%; }

.card-spoil-wrapper.revealed .card-spoil-hide-btn {
    display: block;
}

/* ═══════════════════════════════════════════════
   RESPONSIVE — Tablet (≤1024px)
   ═══════════════════════════════════════════════ */
@media (max-width: 1024px) {
    main { padding: 1.5rem; }
    .races-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
    .standings-container { gap: 1rem; }
    .modal { max-width: 90vw; }
}

/* ═══════════════════════════════════════════════
   RESPONSIVE — Mobile (≤768px)
   ═══════════════════════════════════════════════ */
@media (max-width: 768px) {
    /* Header */
    header {
        padding: 0.6rem 1rem;
        height: auto;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .f1-logo { font-size: 1.5rem; }
    .season-title { font-size: 0.8rem; letter-spacing: 1px; }
    .stats-bar { gap: 0.6rem; font-size: 0.72rem; }
    .stats-bar strong { font-size: 0.85rem; }
    .header-right { gap: 0.5rem; }

    /* Starting Grid responsive */
    .sg-content { flex-wrap: wrap; padding: 0.4rem 0.6rem; gap: 0.4rem; justify-content: center; }
    .sg-left { gap: 0.4rem; }
    .sg-light { width: 9px; height: 9px; }
    .sg-session { font-size: 0.6rem; }
    .sg-digit { font-size: 1.3rem; }
    .sg-colon { font-size: 1rem; }
    .sg-gp { font-size: 0.65rem; }
    .sg-right { display: none; }

    /* Nav */
    nav { padding: 0 0.5rem; gap: 0; }
    .nav-tab { padding: 0.75rem 0.7rem; font-size: 0.78rem; letter-spacing: 0; }

    /* Main */
    main { padding: 1rem 0.75rem; }

    /* Section header */
    .section-header h2 { font-size: 1.4rem; }
    .section-header p { font-size: 0.8rem; }

    /* Progress bar */
    .season-progress { padding: 0.75rem 1rem; }
    .progress-label { font-size: 0.65rem; }

    /* Filters */
    .filter-bar { gap: 0.6rem; }
    .filter-group { width: 100%; }
    .filter-options { flex-wrap: wrap; }
    .filter-btn { font-size: 0.7rem; padding: 0.3rem 0.5rem; }
    .filter-search { min-width: 0; width: 100%; }

    /* Grid */
    .races-grid { grid-template-columns: 1fr; gap: 1rem; }

    /* Standings */
    .standings-container { grid-template-columns: 1fr; }

    /* Podium */
    .podium-stage { gap: 0.3rem; padding: 0.8rem 0 0; }
    .podium-p1 { width: 110px; }
    .podium-p2 { width: 95px; }
    .podium-p3 { width: 90px; }
    .podium-p1 .podium-pillar { height: 55px; }
    .podium-p2 .podium-pillar { height: 40px; }
    .podium-p3 .podium-pillar { height: 28px; }
    .podium-driver-name { font-size: 0.62rem; }
    .podium-p1 .podium-driver-name { font-size: 0.7rem; }
    .podium-team-name { font-size: 0.5rem; padding: 0.12rem 0.35rem; }
    .podium-team-logo { width: 28px; height: 28px; }
    .podium-p1 .podium-team-logo { width: 34px; height: 34px; }
    .podium-position { font-size: 0.5rem; }
    .podium-crown { font-size: 1.1rem; }
    .podium-pillar-num { font-size: 1.2rem; }
    .podium-p1 .podium-pillar-num { font-size: 1.8rem; }

    /* Modal */
    .modal { max-width: 95vw; max-height: 85vh; border-radius: 12px; }
    .modal-header { padding: 1rem; }
    .modal-flag { font-size: 2rem; }
    .modal-race-name { font-size: 1.1rem; }
    .modal-meta { font-size: 0.75rem; }
    .modal-body { padding: 1rem; }

    /* Timeline */
    .timeline-race-item { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
    .timeline-race-right { justify-content: flex-start; flex-wrap: wrap; }

    /* Badges */
    .new-tag { font-size: 0.55rem; padding: 0.2rem 0.5rem; letter-spacing: 0.8px; }
    .badge, .sprint-tag { font-size: 0.65rem; }

    /* Ribbon nouveau circuit */
    .race-card-new::before {
        top: 16px; right: -48px;
        font-size: 0.42rem; padding: 0.2rem 3rem;
    }

    /* Admin */
    .admin-row { font-size: 0.8rem; }
}

/* ═══════════════════════════════════════════════
   RESPONSIVE — Small phone (≤480px)
   ═══════════════════════════════════════════════ */
@media (max-width: 480px) {
    /* Header compact */
    header { padding: 0.5rem 0.75rem; }
    .f1-logo { font-size: 1.3rem; }
    .season-title { display: none; }
    .stats-bar { display: none; }

    /* Nav scrollable */
    nav { padding: 0 0.25rem; -webkit-overflow-scrolling: touch; }
    .nav-tab { padding: 0.65rem 0.55rem; font-size: 0.72rem; }

    /* Main */
    main { padding: 0.75rem 0.5rem; }
    .section-header { margin-bottom: 1rem; }
    .section-header h2 { font-size: 1.2rem; }
    .section-header p { font-size: 0.72rem; }

    /* Progress */
    .season-progress { padding: 0.6rem 0.8rem; margin-bottom: 1rem; }
    .progress-bar-track { height: 6px; }

    /* Filters stack */
    .filter-bar { gap: 0.5rem; }
    .filter-btn { font-size: 0.62rem; padding: 0.25rem 0.4rem; border-radius: 6px; }

    /* Cards */
    .race-card { border-radius: 10px; }
    .race-card-header { padding: 0.6rem 0.75rem; }
    .race-card-body { padding: 0.75rem; }
    .race-round { font-size: 0.75rem; }
    .race-name { font-size: 0.88rem; }
    .race-country { font-size: 0.68rem; }
    .race-info-row { font-size: 0.75rem; }

    /* Podium compact */
    .podium-stage { gap: 0.2rem; }
    .podium-p1 { width: 95px; }
    .podium-p2 { width: 80px; }
    .podium-p3 { width: 75px; }
    .podium-p1 .podium-pillar { height: 45px; }
    .podium-p2 .podium-pillar { height: 32px; }
    .podium-p3 .podium-pillar { height: 22px; }
    .podium-driver-name { font-size: 0.55rem; padding: 0 0.2rem; }
    .podium-p1 .podium-driver-name { font-size: 0.62rem; }
    .podium-team-name { font-size: 0.45rem; }
    .podium-team-logo { width: 22px; height: 22px; }
    .podium-p1 .podium-team-logo { width: 28px; height: 28px; }
    .podium-crown { font-size: 0.9rem; height: 1.2rem; line-height: 1.2rem; }
    .podium-pillar-num { font-size: 1rem; }
    .podium-p1 .podium-pillar-num { font-size: 1.4rem; }

    /* Modal fullscreen */
    .modal { max-width: 100vw; max-height: 100vh; border-radius: 0; margin: 0; }
    .modal-overlay { padding: 0; }
    .modal-header { padding: 0.75rem; border-radius: 0; }
    .modal-flag { font-size: 1.6rem; }
    .modal-race-name { font-size: 1rem; }
    .modal-body { padding: 0.75rem; }

    /* Sprint cards */
    .sprint-card { border-radius: 10px; }

    /* Ribbon */
    .race-card-new::before {
        top: 14px; right: -50px;
        font-size: 0.38rem; padding: 0.18rem 3rem;
    }

    /* Tables */
    .standings-table { font-size: 0.75rem; }
    .standings-table th, .standings-table td { padding: 0.5rem 0.4rem; }
}

/* ═══════════════════════════════════════════════
   RESPONSIVE — Ultra small phone (≤360px)
   ═══════════════════════════════════════════════ */
@media (max-width: 360px) {
    header { padding: 0.4rem 0.5rem; }
    .f1-logo { font-size: 1.1rem; }
    .header-right { gap: 0.3rem; }
    .theme-toggle { padding: 0.3rem 0.4rem; font-size: 0.85rem; }

    .nav-tab { padding: 0.55rem 0.4rem; font-size: 0.65rem; }

    main { padding: 0.5rem 0.35rem; }

    .filter-btn { font-size: 0.58rem; padding: 0.2rem 0.3rem; }

    .race-name { font-size: 0.8rem; }

    /* Podium minimal */
    .podium-p1 { width: 85px; }
    .podium-p2 { width: 72px; }
    .podium-p3 { width: 68px; }
    .podium-team-name { display: none; }
    .podium-team-bar { width: 80%; height: 2px; margin-bottom: 0.3rem; }

    /* Modal */
    .modal-race-name { font-size: 0.9rem; }
    .modal-body { padding: 0.5rem; }

    .pred-grid { grid-template-columns: 1fr !important; }
}

/* ============================================================
   🔮 PRÉDICTIONS
   ============================================================ */

.predictions-score-banner {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.pred-score-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.2rem 2rem;
    text-align: center;
    min-width: 120px;
}

.pred-score-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--red);
}

.pred-score-max {
    font-size: 1rem;
    color: var(--muted);
    font-weight: 400;
}

.pred-score-label {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pred-section-title {
    font-size: 1.1rem;
    color: var(--text);
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.pred-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

.pred-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    transition: border-color 0.2s, transform 0.2s;
}

.pred-card:hover {
    border-color: rgba(225, 6, 0, 0.3);
    transform: translateY(-2px);
}

.pred-card--saved {
    border-color: rgba(34, 197, 94, 0.4);
}

.pred-card--result {
    border-color: var(--border);
}

.pred-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.pred-flag {
    font-size: 2rem;
    line-height: 1;
}

.pred-race-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text);
}

.pred-race-date {
    font-size: 0.8rem;
    color: var(--muted);
}

.pred-badge {
    margin-left: auto;
    background: var(--red);
    color: white;
    font-weight: 800;
    font-size: 0.85rem;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    white-space: nowrap;
}

.pred-form {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.pred-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pred-pos {
    font-weight: 800;
    font-size: 0.85rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    flex-shrink: 0;
}

.pred-pos-1 { background: rgba(255, 215, 0, 0.15); color: #ffd700; }
.pred-pos-2 { background: rgba(192, 192, 192, 0.15); color: #c0c0c0; }
.pred-pos-3 { background: rgba(205, 127, 50, 0.15); color: #cd7f32; }

.pred-select {
    flex: 1;
    padding: 0.6rem 0.8rem;
    background: var(--card2);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.pred-select:focus {
    border-color: var(--red);
}

.pred-save-btn {
    margin-top: 0.5rem;
    width: 100%;
    padding: 0.7rem;
    background: var(--red);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}

.pred-save-btn:hover {
    opacity: 0.9;
}

.pred-save-btn:active {
    transform: scale(0.98);
}

.pred-no-prediction {
    color: var(--muted);
    font-size: 0.85rem;
    text-align: center;
    padding: 1rem 0;
    font-style: italic;
}

.pred-comparison {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pred-compare-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    transition: background 0.2s;
}

.pred-compare-row.pred-exact {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.pred-compare-row.pred-partial {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.25);
}

.pred-compare-row.pred-wrong {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.pred-compare-detail {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.pred-compare-pred {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}

.pred-compare-actual {
    font-size: 0.75rem;
    color: var(--muted);
}

.pred-compare-icon {
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
}

/* ============================================================
   🗺️ Circuit Tab (TheSportsDB)
   ============================================================ */
.circuit-tab {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem 0;
}
.circuit-map-section, .circuit-poster-section {
    text-align: center;
}
.circuit-map-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.circuit-map-wrapper {
    background: var(--card2);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border);
}
.circuit-map-img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 8px;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}
[data-theme="light"] .circuit-map-img {
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.1));
}
.circuit-poster-wrapper {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.circuit-poster-img {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    background: #000;
    border-radius: 12px;
}

/* ============================================================
   📄 Footer
   ============================================================ */
.site-footer {
    margin-top: 3rem;
    padding: 2rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--card);
    text-align: center;
}
.footer-content {
    max-width: 720px;
    margin: 0 auto;
}
.footer-brand {
    font-size: 0.95rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--red);
    margin-bottom: 0.75rem;
}
.footer-disclaimer {
    font-size: 0.72rem;
    line-height: 1.6;
    color: var(--muted);
    margin: 0 0 0.75rem;
}
.footer-apis {
    font-size: 0.7rem;
    color: var(--muted);
    opacity: 0.7;
}
.footer-legal-links {
    margin-top: 0.8rem;
    font-size: 0.72rem;
    color: var(--muted);
}
.footer-legal-links a {
    color: var(--muted);
    text-decoration: none;
    border-bottom: 1px dotted var(--muted);
    transition: all 0.2s;
}
.footer-legal-links a:hover {
    color: var(--red);
    border-bottom-color: var(--red);
}

/* ============================================================
   ⚖️ Legal Page
   ============================================================ */
.legal-main {
    max-width: 900px;
    margin: 2rem auto 3rem;
    padding: 0 1.5rem;
}
.legal-container {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 2.5rem 2.5rem 2rem;
}
.legal-header {
    text-align: center;
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border);
}
.legal-header h1 {
    font-size: 2rem;
    font-weight: 900;
    color: var(--red);
    margin: 0 0 0.5rem;
    letter-spacing: 0.02em;
}
.legal-last-updated {
    font-size: 0.82rem;
    color: var(--muted);
    margin: 0;
    font-style: italic;
}
.legal-toc {
    background: var(--card2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.2rem 1.5rem;
    margin-bottom: 2.5rem;
}
.legal-toc strong {
    display: block;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--red);
    margin-bottom: 0.8rem;
}
.legal-toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
    columns: 2;
    column-gap: 1.5rem;
}
.legal-toc li {
    margin-bottom: 0.35rem;
    break-inside: avoid;
}
.legal-toc a {
    color: var(--text);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}
.legal-toc a:hover {
    color: var(--red);
}
.legal-section {
    margin-bottom: 2rem;
    scroll-margin-top: 2rem;
}
.legal-section h2 {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text);
    margin: 0 0 0.8rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}
.legal-section p {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text);
    margin: 0 0 0.8rem;
}
.legal-section ul {
    font-size: 0.88rem;
    line-height: 1.7;
    color: var(--text);
    padding-left: 1.3rem;
    margin: 0 0 0.8rem;
}
.legal-section li {
    margin-bottom: 0.3rem;
}
.legal-section-highlight {
    background: rgba(225, 6, 0, 0.05);
    border-left: 4px solid var(--red);
    padding: 1.2rem 1.5rem;
    border-radius: 0 8px 8px 0;
}
.legal-contact {
    font-size: 1rem !important;
    padding: 0.8rem 1rem;
    background: var(--card2);
    border-radius: 8px;
    border: 1px solid var(--border);
}
.legal-contact a {
    color: var(--red);
    text-decoration: none;
    font-weight: 700;
}
.legal-contact a:hover {
    text-decoration: underline;
}
.legal-small {
    font-size: 0.78rem !important;
    color: var(--muted) !important;
    font-style: italic;
}
.legal-footer-nav {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    text-align: center;
}
.legal-back-btn {
    display: inline-block;
    padding: 0.7rem 1.4rem;
    background: var(--red);
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.88rem;
    transition: all 0.2s;
}
.legal-back-btn:hover {
    background: #c40500;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(225, 6, 0, 0.3);
}

@media (max-width: 640px) {
    .legal-container { padding: 1.5rem 1.2rem; }
    .legal-header h1 { font-size: 1.5rem; }
    .legal-toc ul { columns: 1; }
    .legal-section h2 { font-size: 1rem; }
}

/* ============================================================
   📊 STATS — Chart.js cards
   ============================================================ */
#stats-content {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
}
.stats-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.3rem 1.5rem 1.5rem;
}
.stats-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 1.4rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.stats-card-header h3 {
    font-size: 1.3rem;
    font-weight: 900;
    margin: 0;
    letter-spacing: 0.4px;
}
.stats-card-controls {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    flex-wrap: wrap;
}
.stats-toggle {
    background: var(--card2);
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 0.35rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    transition: all 0.15s;
}
.stats-toggle:hover {
    border-color: var(--red);
    color: var(--text);
}
.stats-toggle.active {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
    box-shadow: 0 0 10px rgba(225, 6, 0, 0.3);
}
.stats-select {
    background: var(--card2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    min-width: 180px;
}
.stats-select:focus {
    outline: none;
    border-color: var(--red);
}
.stats-chart-wrap {
    position: relative;
    width: 100%;
    height: 480px;
}
.stats-chart-radar {
    height: 480px;
    max-width: 600px;
    margin: 0 auto;
}

/* Radar — sélecteurs (1 ou 2 pilotes) */
.radar-selectors {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.radar-selectors .stats-select {
    flex: 1 1 200px;
    min-width: 0;
}
.radar-vs {
    font-size: 0.85rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    color: var(--muted);
    padding: 0 0.3rem;
}

/* Hero compare — 2 colonnes */
.radar-hero--compare {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: stretch;
    gap: 0;
    padding: 0;
    border-left: none;
    overflow: hidden;
    background: linear-gradient(90deg, var(--team-color)15 0%, transparent 50%, var(--team-color-2)15 100%);
}
.radar-hero-side {
    padding: 1rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    border-left: 4px solid var(--side-color);
}
.radar-hero-side:last-child {
    text-align: right;
    align-items: flex-end;
    border-left: none;
    border-right: 4px solid var(--side-color);
}
.radar-hero-side .radar-hero-flag { font-size: 1.6rem; line-height: 1; }
.radar-hero-side .radar-hero-driver {
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--side-color);
}
.radar-hero-side .radar-hero-team {
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 600;
}
.radar-hero-mini {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 0.2rem;
}
.radar-hero-mini b {
    color: var(--text);
    font-weight: 800;
    margin-right: 0.2rem;
}
.radar-hero-vs {
    align-self: center;
    font-size: 1.6rem;
    padding: 0 0.5rem;
    opacity: 0.85;
}

@media (max-width: 640px) {
    .radar-hero--compare {
        grid-template-columns: 1fr;
    }
    .radar-hero-side:last-child {
        text-align: left;
        align-items: flex-start;
        border-right: none;
        border-left: 4px solid var(--side-color);
    }
    .radar-hero-vs { padding: 0.4rem 0; }
}

/* Radar hero — épuré */
.radar-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.2rem;
    margin-bottom: 1.2rem;
    background: var(--card2);
    border: 1px solid var(--border);
    border-left: 4px solid var(--team-color, #e10600);
    border-radius: 10px;
    flex-wrap: wrap;
}
.radar-hero-left {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-width: 0;
}
.radar-hero-flag {
    font-size: 2.2rem;
    line-height: 1;
}
.radar-hero-names { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.radar-hero-driver {
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.2;
}
.radar-hero-team {
    color: var(--muted);
    font-weight: 600;
    font-size: 0.85rem;
}
.radar-hero-stats {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}
.radar-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
}
.radar-stat-num {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text);
    white-space: nowrap;
}
.radar-stat-lbl {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    font-weight: 600;
}

@media (max-width: 900px) {
    .stats-chart-wrap { height: 400px; }
}
@media (max-width: 640px) {
    .stats-card { padding: 1rem; }
    .stats-card-header h3 { font-size: 1rem; }
    .stats-chart-wrap { height: 340px; }
    .stats-chart-radar { height: 360px; }
    .radar-hero-flag { font-size: 1.8rem; }
    .radar-hero-driver { font-size: 1rem; }
    .radar-hero-stats { gap: 1rem; }
}

/* ============================================================
   🏎️ PROFIL PILOTE / ÉCURIE
   ============================================================ */
.profile-modal {
    max-width: 780px;
    padding: 0;
    overflow: hidden;
    position: relative;
}
.profile-modal .modal-close {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    z-index: 10;
    background: rgba(0, 0, 0, 0.55);
    border: none;
    color: #fff;
    font-size: 1.1rem;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    line-height: 1;
    backdrop-filter: blur(6px);
    transition: background 0.15s;
}
.profile-modal .modal-close:hover { background: var(--red); }

/* Header */
.profile-header {
    display: flex;
    align-items: center;
    gap: 1.3rem;
    padding: 2rem 1.8rem 1.5rem;
    background: linear-gradient(135deg, var(--team-color) 0%, var(--team-color)22 60%, transparent 100%);
    border-bottom: 1px solid var(--border);
}
.profile-head-text { flex: 1; min-width: 0; }
.profile-head-rank {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 0.3rem;
}
.profile-head-name {
    font-size: 1.8rem;
    font-weight: 900;
    margin: 0 0 0.4rem;
    color: #fff;
    letter-spacing: 0.3px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
    line-height: 1.1;
}
.profile-head-team {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    opacity: 0.9;
}
.profile-head-team img { height: 22px; width: auto; }

/* Avatar */
.profile-avatar {
    position: relative;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), inset 0 2px 8px rgba(255, 255, 255, 0.15);
    border: 3px solid rgba(255, 255, 255, 0.18);
}
.profile-avatar-initials {
    font-size: 2.1rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: -1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}
.profile-avatar-flag {
    position: absolute;
    bottom: -4px;
    right: -4px;
    font-size: 1.6rem;
    line-height: 1;
    background: var(--card);
    padding: 2px;
    border-radius: 50%;
    border: 2px solid var(--border);
}

.profile-team-logo-box {
    width: 96px;
    height: 96px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.18);
}
.profile-team-logo { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4)); }

/* Stats grid */
.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.75rem;
    padding: 1.2rem 1.8rem;
    border-bottom: 1px solid var(--border);
}
.profile-stat {
    background: var(--card2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.9rem 0.6rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.profile-stat-num {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--text);
    letter-spacing: 0.3px;
}
.profile-stat-lbl {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

/* Sections */
.profile-section {
    padding: 1.2rem 1.8rem;
    border-bottom: 1px solid var(--border);
}
.profile-section:last-child { border-bottom: none; }
.profile-section-title {
    font-size: 0.95rem;
    font-weight: 800;
    margin: 0 0 1rem;
    letter-spacing: 0.3px;
    color: var(--text);
}

/* Comparaison coéquipier */
.profile-compare {
    background: var(--card2);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}
.profile-compare-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--border);
    gap: 1rem;
}
.profile-compare-row:last-child { border-bottom: none; }
.profile-compare-val {
    font-size: 1.05rem;
    font-weight: 800;
    text-align: center;
    color: var(--muted);
    transition: color 0.15s;
}
.profile-compare-val:first-child  { text-align: right; }
.profile-compare-val:last-child   { text-align: left; }
.profile-compare-val.win {
    color: #22c55e;
}
.profile-compare-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    text-align: center;
    padding: 0 0.6rem;
}

/* Historique table */
.profile-history-wrap {
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
}
.profile-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.profile-history-table thead th {
    position: sticky;
    top: 0;
    background: var(--card2);
    padding: 0.7rem 0.9rem;
    text-align: left;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    font-weight: 700;
    border-bottom: 1px solid var(--border);
    z-index: 2;
}
.profile-history-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.12s;
}
.profile-history-table tbody tr:last-child { border-bottom: none; }
.profile-history-table tbody tr:hover {
    background: var(--card2);
}
.profile-history-table td {
    padding: 0.65rem 0.9rem;
    vertical-align: middle;
}
.profile-hist-round {
    font-weight: 800;
    color: var(--muted);
    font-size: 0.78rem;
    width: 45px;
}
.profile-hist-q { color: var(--muted); font-size: 0.85rem; width: 60px; }
.profile-hist-r { width: 55px; }
.profile-hist-pts {
    text-align: right;
    font-weight: 800;
    color: var(--red);
    width: 60px;
}

/* Lineup (team profile) */
.profile-lineup {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}
.profile-driver-card {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: var(--card2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.8rem;
    cursor: pointer;
    transition: transform 0.12s, border-color 0.12s;
}
.profile-driver-card:hover {
    transform: translateY(-2px);
    border-color: var(--red);
}
.profile-driver-card .profile-avatar {
    width: 56px;
    height: 56px;
}
.profile-driver-card .profile-avatar-initials { font-size: 1.2rem; }
.profile-driver-card .profile-avatar-flag { font-size: 1rem; bottom: -2px; right: -2px; padding: 1px; }
.profile-driver-info { flex: 1; min-width: 0; }
.profile-driver-name {
    font-weight: 800;
    font-size: 0.95rem;
    line-height: 1.2;
    margin-bottom: 0.1rem;
}
.profile-driver-meta {
    color: var(--muted);
    font-size: 0.78rem;
    margin-bottom: 0.3rem;
}
.profile-driver-stats {
    display: flex;
    gap: 0.6rem;
    font-size: 0.78rem;
    color: var(--text);
    font-weight: 700;
}

/* Clickable rows everywhere */
tr.clickable { cursor: pointer; transition: background 0.12s; }
tr.clickable:hover { background: var(--card2); }

/* ============================================================
   📜 CARRIÈRE COMPLÈTE (bouton + section fiche pilote)
   ============================================================ */
.career-section-wrap {
    padding-top: 1rem;
}
.career-section-top {
    /* Positionné en haut : pas de bordure supérieure redondante */
    padding-top: 1rem;
    padding-bottom: 0.6rem;
    background: linear-gradient(180deg, rgba(225, 6, 0, 0.04), transparent);
}
.career-btn {
    display: block;
    width: 100%;
    background: linear-gradient(135deg, var(--red), #b0030a);
    color: #fff;
    border: none;
    padding: 0.9rem 1rem;
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: transform 0.1s, filter 0.15s;
    box-shadow: 0 4px 12px rgba(225, 6, 0, 0.3);
}
.career-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.career-btn:active { transform: translateY(1px); }

.career-section {
    margin-top: 1rem;
}
.career-header {
    margin-bottom: 1rem;
}
.career-meta {
    font-size: 0.82rem;
    color: var(--muted);
    font-weight: 600;
    margin-top: -0.5rem;
    margin-bottom: 0.4rem;
}
.career-subtitle {
    font-size: 0.9rem;
    font-weight: 800;
    margin: 1.3rem 0 0.7rem;
    color: var(--text);
    letter-spacing: 0.2px;
}
.career-section .profile-stats-grid {
    padding: 0;
    border: none;
    margin-bottom: 0.5rem;
}
.career-credit {
    text-align: center;
    font-size: 0.72rem;
    color: var(--muted);
    margin: 1rem 0 0;
}
.career-credit a { color: var(--red); text-decoration: none; font-weight: 600; }
.career-credit a:hover { text-decoration: underline; }

.career-loader {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--muted);
}
.career-loader .spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--red);
    border-radius: 50%;
    margin: 0 auto 0.8rem;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 640px) {
    .profile-header { flex-direction: column; align-items: flex-start; padding: 1.5rem 1.2rem 1.2rem; }
    .profile-head-name { font-size: 1.4rem; }
    .profile-avatar, .profile-team-logo-box { width: 72px; height: 72px; }
    .profile-avatar-initials { font-size: 1.6rem; }
    .profile-stats-grid { padding: 1rem 1.2rem; gap: 0.5rem; }
    .profile-stat-num { font-size: 1.15rem; }
    .profile-section { padding: 1rem 1.2rem; }
    .profile-lineup { grid-template-columns: 1fr; }
    .profile-compare-row { padding: 0.6rem 0.7rem; gap: 0.5rem; }
    .profile-compare-val { font-size: 0.95rem; }
}