/**
 * F1 Stats Pro — Main Stylesheet
 * Version: 1.0.0
 */

/* ── Custom Properties ──────────────────────────────────────────────────── */
:root {
    --f1sp-accent:         #e10600;
    --f1sp-bg:             #ffffff;
    --f1sp-bg-alt:         #f5f5f5;
    --f1sp-bg-card:        #ffffff;
    --f1sp-border:         #e0e0e0;
    --f1sp-text:           #1a1a1a;
    --f1sp-text-muted:     #666666;
    --f1sp-font:           -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --f1sp-radius:         6px;
    --f1sp-shadow:         0 2px 8px rgba(0,0,0,.08);

    /* Tyre colours */
    --f1sp-soft:           #e8002d;
    --f1sp-medium:         #ffd700;
    --f1sp-hard:           #ffffff;
    --f1sp-inter:          #3ec14a;
    --f1sp-wet:            #1e6db5;

    /* Position medal */
    --f1sp-gold:           #ffd700;
    --f1sp-silver:         #c0c0c0;
    --f1sp-bronze:         #cd7f32;
}

/* Dark theme */
.f1sp-theme-dark,
.f1sp-theme-dark * {
    --f1sp-bg:         #121212;
    --f1sp-bg-alt:     #1e1e1e;
    --f1sp-bg-card:    #1e1e1e;
    --f1sp-border:     #333333;
    --f1sp-text:       #f0f0f0;
    --f1sp-text-muted: #999999;
}

/* System preference */
@media (prefers-color-scheme: dark) {
    .f1sp-theme-system,
    .f1sp-theme-system * {
        --f1sp-bg:         #121212;
        --f1sp-bg-alt:     #1e1e1e;
        --f1sp-bg-card:    #1e1e1e;
        --f1sp-border:     #333333;
        --f1sp-text:       #f0f0f0;
        --f1sp-text-muted: #999999;
    }
}

/* ── Base Wrapper ─────────────────────────────────────────────────────────── */
.f1sp-wrap {
    font-family:   var(--f1sp-font);
    font-size:     15px;
    line-height:   1.5;
    color:         var(--f1sp-text);
    background:    var(--f1sp-bg);
    border-radius: var(--f1sp-radius);
    overflow:      hidden;
    box-sizing:    border-box;
}

.f1sp-wrap *,
.f1sp-wrap *::before,
.f1sp-wrap *::after {
    box-sizing: inherit;
}

.f1sp-table-title,
.f1sp-chart-title {
    font-size:     1.1em;
    font-weight:   700;
    margin:        0 0 12px;
    color:         var(--f1sp-text);
}

/* ── Tables ──────────────────────────────────────────────────────────────── */
.f1sp-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.f1sp-table {
    width:           100%;
    border-collapse: collapse;
    font-size:       .9em;
}

.f1sp-table th,
.f1sp-table td {
    padding:      8px 12px;
    text-align:   left;
    white-space:  nowrap;
    border-bottom: 1px solid var(--f1sp-border);
}

.f1sp-table thead th {
    background:    var(--f1sp-bg-alt);
    font-weight:   600;
    color:         var(--f1sp-text-muted);
    font-size:     .8em;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* Striped */
.f1sp-table--striped tbody tr:nth-child(even) {
    background: var(--f1sp-bg-alt);
}

/* Bordered */
.f1sp-table--bordered th,
.f1sp-table--bordered td {
    border: 1px solid var(--f1sp-border);
}

/* Sortable header arrows */
.f1sp-table--sortable thead th {
    cursor: pointer;
    user-select: none;
}
.f1sp-table--sortable thead th:hover {
    color: var(--f1sp-accent);
}
.f1sp-table--sortable thead th[data-sort="asc"]::after  { content: " ↑"; }
.f1sp-table--sortable thead th[data-sort="desc"]::after { content: " ↓"; }

/* ── Driver Cell ─────────────────────────────────────────────────────────── */
.f1sp-driver {
    display:     inline-flex;
    align-items: center;
    gap:         6px;
}
.f1sp-driver__dot {
    width:         10px;
    height:        10px;
    border-radius: 50%;
    flex-shrink:   0;
    display:       inline-block;
}
.f1sp-driver__abbr {
    font-size:   .8em;
    color:       var(--f1sp-text-muted);
    margin-left: 2px;
}
.f1sp-driver__num {
    font-weight: 700;
    font-size:   .85em;
    min-width:   22px;
}

/* ── Position Badges ─────────────────────────────────────────────────────── */
.f1sp-pos {
    font-weight:   700;
    display:       inline-block;
    min-width:     28px;
    text-align:    center;
}
.f1sp-pos--gold   { color: var(--f1sp-gold); }
.f1sp-pos--silver { color: var(--f1sp-silver); }
.f1sp-pos--bronze { color: var(--f1sp-bronze); }
.f1sp-pos--dnf    { color: var(--f1sp-text-muted); font-weight: 400; }

/* ── Generic Badges ──────────────────────────────────────────────────────── */
.f1sp-badge {
    display:       inline-block;
    padding:       2px 6px;
    border-radius: 3px;
    font-size:     .75em;
    font-weight:   700;
    text-transform: uppercase;
    letter-spacing: .04em;
    line-height:   1.4;
}
.f1sp-badge--fl  { background: #9c27b0; color: #fff; }
.f1sp-badge--sc  { background: #ff9800; color: #000; }
.f1sp-badge--vsc { background: #2196f3; color: #fff; }
.f1sp-badge--pit { background: var(--f1sp-bg-alt); color: var(--f1sp-text-muted); border: 1px solid var(--f1sp-border); }
.f1sp-badge--new { background: #4caf50; color: #fff; }

/* ── Tyre Compounds ──────────────────────────────────────────────────────── */
.f1sp-tyre {
    display:       inline-flex;
    align-items:   center;
    justify-content: center;
    width:         28px;
    height:        28px;
    border-radius: 50%;
    font-weight:   700;
    font-size:     .8em;
    border:        2px solid transparent;
}
.f1sp-tyre--soft     { background: var(--f1sp-soft);   color: #fff; }
.f1sp-tyre--medium   { background: var(--f1sp-medium); color: #000; }
.f1sp-tyre--hard     { background: var(--f1sp-hard);   color: #000; border-color: #ccc; }
.f1sp-tyre--inter    { background: var(--f1sp-inter);  color: #fff; }
.f1sp-tyre--wet      { background: var(--f1sp-wet);    color: #fff; }
.f1sp-tyre--unknown  { background: #888;               color: #fff; }

/* ── Team Pills ──────────────────────────────────────────────────────────── */
.f1sp-team-dot {
    border-left:  3px solid;
    padding-left: 8px;
}
.f1sp-team-pill {
    display:       inline-flex;
    align-items:   center;
    gap:           6px;
    border:        1px solid;
    border-radius: 4px;
    padding:       2px 8px;
}
.f1sp-team-pill__swatch {
    width:         10px;
    height:        10px;
    border-radius: 50%;
    flex-shrink:   0;
}

/* ── Notices ─────────────────────────────────────────────────────────────── */
.f1sp-notice {
    padding:       12px 16px;
    border-radius: var(--f1sp-radius);
    margin:        8px 0;
    font-size:     .9em;
}
.f1sp-notice--info  { background: #e3f2fd; color: #1565c0; border-left: 4px solid #1565c0; }
.f1sp-notice--error { background: #fce4e4; color: #c62828; border-left: 4px solid #c62828; }

/* ── Loading Spinner ─────────────────────────────────────────────────────── */
.f1sp-loading {
    display:        flex;
    align-items:    center;
    gap:            10px;
    padding:        16px;
    color:          var(--f1sp-text-muted);
}
.f1sp-spinner {
    width:        20px;
    height:       20px;
    border:       3px solid var(--f1sp-border);
    border-top-color: var(--f1sp-accent);
    border-radius: 50%;
    animation:    f1sp-spin 0.8s linear infinite;
    flex-shrink:  0;
}
@keyframes f1sp-spin { to { transform: rotate(360deg); } }

/* ── Session Header ──────────────────────────────────────────────────────── */
.f1sp-session-header {
    display:     flex;
    align-items: baseline;
    gap:         12px;
    flex-wrap:   wrap;
    margin-bottom: 10px;
}
.f1sp-session-date {
    font-size:  .85em;
    color:      var(--f1sp-text-muted);
}

/* ── Calendar ────────────────────────────────────────────────────────────── */
.f1sp-calendar {
    list-style:   none;
    margin:       0;
    padding:      0;
}
.f1sp-calendar__item {
    display:        grid;
    grid-template-columns: 40px 28px 1fr auto;
    align-items:    center;
    gap:            12px;
    padding:        10px 12px;
    border-bottom:  1px solid var(--f1sp-border);
    transition:     background 0.15s;
}
.f1sp-calendar__item:hover { background: var(--f1sp-bg-alt); }
.f1sp-calendar__item--current {
    background:   rgba(225,6,0,.06);
    border-left:  3px solid var(--f1sp-accent);
}
.f1sp-calendar__item--past { opacity: 0.6; }
.f1sp-calendar__round {
    font-weight:  700;
    font-size:    .8em;
    color:        var(--f1sp-text-muted);
}
.f1sp-calendar__name  { font-weight: 600; }
.f1sp-calendar__venue { font-size: .85em; color: var(--f1sp-text-muted); }
.f1sp-calendar__date  { font-size: .85em; font-weight: 600; color: var(--f1sp-text-muted); }

/* ── Next Race ───────────────────────────────────────────────────────────── */
.f1sp-next-race {
    padding: 20px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    align-items: start;
}
.f1sp-next-race__flag  { font-size: 2.5em; line-height: 1; }
.f1sp-next-race__name  { font-size: 1.2em; font-weight: 700; margin: 0 0 4px; }
.f1sp-next-race__location,
.f1sp-next-race__date  { font-size: .9em; color: var(--f1sp-text-muted); margin: 2px 0; }
.f1sp-next-race__countdown-badge {
    background:    var(--f1sp-accent);
    color:         #fff;
    font-weight:   700;
    font-size:     .85em;
    padding:       6px 12px;
    border-radius: 4px;
    white-space:   nowrap;
}
.f1sp-next-race__sessions {
    grid-column:  1 / -1;
    list-style:   none;
    margin:       0;
    padding:      12px 0 0;
    border-top:   1px solid var(--f1sp-border);
    display:      flex;
    flex-wrap:    wrap;
    gap:          8px;
}
.f1sp-next-race__sessions li {
    display:       flex;
    align-items:   center;
    gap:           6px;
    background:    var(--f1sp-bg-alt);
    border-radius: 4px;
    padding:       4px 10px;
    font-size:     .85em;
}
.f1sp-session-label { font-weight: 600; }

/* ── Countdown ───────────────────────────────────────────────────────────── */
.f1sp-countdown { padding: 20px; text-align: center; }
.f1sp-countdown__label { font-size: .9em; color: var(--f1sp-text-muted); margin-bottom: 12px; }
.f1sp-countdown__timer { display: flex; justify-content: center; gap: 12px; }
.f1sp-countdown__unit  { text-align: center; }
.f1sp-countdown__value {
    display:     block;
    font-size:   2.2em;
    font-weight: 800;
    color:       var(--f1sp-accent);
    line-height: 1;
    min-width:   2ch;
}
.f1sp-countdown__unit-label { font-size: .7em; text-transform: uppercase; letter-spacing: .08em; color: var(--f1sp-text-muted); }
.f1sp-countdown__date { font-size: .8em; color: var(--f1sp-text-muted); margin-top: 12px; }

/* ── Tire Strategy Visual ────────────────────────────────────────────────── */
.f1sp-strategy { font-size: .88em; }
.f1sp-strategy__header,
.f1sp-strategy__row {
    display:     grid;
    grid-template-columns: 100px 1fr;
    align-items: center;
    gap:         8px;
    padding:     4px 0;
}
.f1sp-strategy__header { font-weight: 600; color: var(--f1sp-text-muted); font-size: .8em; text-transform: uppercase; letter-spacing: .04em; }
.f1sp-strategy__bar {
    position:     relative;
    height:       28px;
    background:   var(--f1sp-bg-alt);
    border-radius: 4px;
    overflow:     hidden;
}
.f1sp-stint {
    position:     absolute;
    top:          0;
    height:       100%;
    display:      flex;
    align-items:  center;
    justify-content: center;
    gap:          4px;
    cursor:       pointer;
    transition:   opacity .15s;
}
.f1sp-stint:hover { opacity: .85; }
.f1sp-stint__abbr { font-weight: 700; font-size: .8em; }
.f1sp-stint__laps { font-size: .7em; opacity: .8; }

/* ── Driver Card ─────────────────────────────────────────────────────────── */
.f1sp-driver-card {
    border-radius: var(--f1sp-radius);
    overflow:      hidden;
    box-shadow:    var(--f1sp-shadow);
    background:    var(--f1sp-bg-card);
    max-width:     280px;
}
.f1sp-driver-card__top {
    display:     flex;
    align-items: center;
    gap:         16px;
    padding:     16px;
    border-top:  4px solid var(--f1sp-team-color, var(--f1sp-accent));
    background:  var(--f1sp-bg-alt);
}
.f1sp-driver-card__headshot {
    width:         80px;
    height:        80px;
    object-fit:    cover;
    border-radius: 50%;
    flex-shrink:   0;
    border:        2px solid var(--f1sp-team-color, var(--f1sp-accent));
}
.f1sp-driver-card__number {
    font-size:   2em;
    font-weight: 900;
    line-height: 1;
    display:     block;
}
.f1sp-driver-card__name { font-weight: 700; font-size: 1.05em; margin: 4px 0 2px; }
.f1sp-driver-card__abbr { font-size: .75em; color: var(--f1sp-text-muted); display: block; }
.f1sp-driver-card__team { font-size: .85em; display: block; margin-top: 4px; }
.f1sp-driver-card__stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--f1sp-border);
}
.f1sp-driver-card__stat {
    padding:    12px 8px;
    text-align: center;
    border-right: 1px solid var(--f1sp-border);
}
.f1sp-driver-card__stat:last-child { border-right: none; }
.f1sp-driver-card__stat-label { display: block; font-size: .7em; color: var(--f1sp-text-muted); text-transform: uppercase; letter-spacing: .04em; }
.f1sp-driver-card__stat-value { display: block; font-size: 1.2em; font-weight: 700; margin-top: 2px; }

/* ── Driver Grid ─────────────────────────────────────────────────────────── */
.f1sp-driver-grid {
    display: grid;
    gap: 16px;
}
.f1sp-driver-grid--cols-2 { grid-template-columns: repeat(2, 1fr); }
.f1sp-driver-grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
.f1sp-driver-grid--cols-4 { grid-template-columns: repeat(4, 1fr); }
.f1sp-driver-grid--cols-5 { grid-template-columns: repeat(5, 1fr); }
.f1sp-driver-mini {
    border-radius: var(--f1sp-radius);
    overflow: hidden;
    background: var(--f1sp-bg-card);
    box-shadow: var(--f1sp-shadow);
}
.f1sp-driver-mini__top {
    position: relative;
    padding: 12px;
    min-height: 90px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}
.f1sp-driver-mini__img {
    position:   absolute;
    right:      0;
    bottom:     0;
    height:     80px;
    object-fit: contain;
}
.f1sp-driver-mini__num { font-size: 1.6em; font-weight: 900; line-height: 1; }
.f1sp-driver-mini__body { padding: 10px 12px; border-top: 1px solid var(--f1sp-border); }
.f1sp-driver-mini__name { display: block; font-weight: 700; font-size: .9em; }
.f1sp-driver-mini__abbr { font-size: .75em; color: var(--f1sp-text-muted); display: block; }
.f1sp-driver-mini__team { font-size: .75em; color: var(--f1sp-text-muted); display: block; margin-top: 2px; }

/* ── Team Card ───────────────────────────────────────────────────────────── */
.f1sp-team-card {
    border-radius: var(--f1sp-radius);
    overflow: hidden;
    box-shadow: var(--f1sp-shadow);
    background: var(--f1sp-bg-card);
    max-width: 340px;
}
.f1sp-team-card__header {
    display:  flex;
    align-items: center;
    gap:      12px;
    padding:  16px;
    background: var(--f1sp-bg-alt);
}
.f1sp-team-card__swatch {
    width:         24px;
    height:        24px;
    border-radius: 50%;
    flex-shrink:   0;
}
.f1sp-team-card__name { font-size: 1.1em; font-weight: 700; margin: 0; }
.f1sp-team-card__stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-bottom: 1px solid var(--f1sp-border);
}
.f1sp-team-card__stat {
    padding:    12px 8px;
    text-align: center;
    border-right: 1px solid var(--f1sp-border);
}
.f1sp-team-card__stat:last-child { border-right: none; }
.f1sp-team-card__stat span { display: block; font-size: .7em; color: var(--f1sp-text-muted); text-transform: uppercase; letter-spacing: .04em; }
.f1sp-team-card__stat strong { display: block; font-size: 1.2em; margin-top: 2px; }
.f1sp-team-card__drivers { display: flex; padding: 12px; gap: 12px; }
.f1sp-team-card__driver {
    flex: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.f1sp-team-card__headshot { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.f1sp-team-card__driver-num { font-size: 1.2em; font-weight: 900; }
.f1sp-team-card__driver-name { font-size: .8em; color: var(--f1sp-text-muted); }

/* ── Team Grid ───────────────────────────────────────────────────────────── */
.f1sp-team-grid { display: grid; gap: 12px; }
.f1sp-team-grid--cols-2 { grid-template-columns: repeat(2, 1fr); }
.f1sp-team-grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
.f1sp-team-grid--cols-4 { grid-template-columns: repeat(4, 1fr); }
.f1sp-team-mini {
    padding: 12px;
    border-radius: var(--f1sp-radius);
    background: var(--f1sp-bg-card);
    box-shadow: var(--f1sp-shadow);
}
.f1sp-team-mini__swatch { width: 20px; height: 4px; border-radius: 2px; margin-bottom: 8px; }
.f1sp-team-mini__name   { font-size: .9em; font-weight: 700; margin: 0 0 4px; display: block; }
.f1sp-team-mini__pts    { font-size: .8em; color: var(--f1sp-text-muted); display: block; margin-bottom: 8px; }
.f1sp-team-mini__drivers { display: flex; flex-direction: column; gap: 4px; }
.f1sp-team-mini__driver {
    display:     flex;
    align-items: center;
    gap:         6px;
    font-size:   .8em;
}
.f1sp-team-mini__driver-num {
    font-weight: 700;
    min-width:   22px;
    color:       var(--f1sp-text-muted);
}

/* ── Head-to-Head ────────────────────────────────────────────────────────── */
.f1sp-h2h { padding: 16px; }
.f1sp-h2h__headers {
    display:         grid;
    grid-template-columns: 1fr auto 1fr;
    align-items:     center;
    gap:             16px;
    margin-bottom:   16px;
}
.f1sp-h2h__driver {
    padding:     12px;
    border-radius: var(--f1sp-radius);
    background:  var(--f1sp-bg-alt);
    border-top:  3px solid;
    display:     flex;
    flex-direction: column;
    align-items: center;
    gap:         4px;
}
.f1sp-h2h__headshot { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.f1sp-h2h__num      { font-size: 1.5em; font-weight: 900; }
.f1sp-h2h__name     { font-size: .9em; font-weight: 700; text-align: center; }
.f1sp-h2h__vs       { font-size: 1.4em; font-weight: 900; color: var(--f1sp-text-muted); text-align: center; }
.f1sp-h2h__table    { width: 100%; border-collapse: collapse; }
.f1sp-h2h__table tr { border-bottom: 1px solid var(--f1sp-border); }
.f1sp-h2h__val      { padding: 8px 12px; text-align: center; font-size: 1.05em; }
.f1sp-h2h__val--winner { font-weight: 700; color: var(--f1sp-accent); }
.f1sp-h2h__label    { padding: 8px 12px; text-align: center; font-size: .8em; color: var(--f1sp-text-muted); text-transform: uppercase; letter-spacing: .04em; }

/* ── Starting Grid ───────────────────────────────────────────────────────── */
.f1sp-grid-visual { display: flex; flex-direction: column; gap: 4px; }
.f1sp-grid-row    { display: flex; gap: 4px; }
.f1sp-grid-slot {
    flex:          1;
    padding:       8px 12px;
    border-radius: var(--f1sp-radius);
    background:    var(--f1sp-bg-alt);
    display:       flex;
    align-items:   center;
    gap:           8px;
    font-size:     .875em;
}
.f1sp-grid-slot--left { margin-right: 2%; }
.f1sp-grid-slot__pos  { font-weight: 700; font-size: .8em; color: var(--f1sp-text-muted); min-width: 28px; }
.f1sp-grid-slot__name { font-weight: 600; }
.f1sp-grid-slot__team { font-size: .8em; color: var(--f1sp-text-muted); margin-left: auto; }
.f1sp-grid-slot--empty { background: transparent; }

/* ── Weather ─────────────────────────────────────────────────────────────── */
.f1sp-weather__grid {
    display:               grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap:                   12px;
    padding:               16px;
}
.f1sp-weather__item {
    background:    var(--f1sp-bg-alt);
    border-radius: var(--f1sp-radius);
    padding:       12px;
    text-align:    center;
}
.f1sp-weather__icon  { display: block; font-size: 1.6em; margin-bottom: 4px; }
.f1sp-weather__label { display: block; font-size: .75em; color: var(--f1sp-text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
.f1sp-weather__value { display: block; font-weight: 700; font-size: 1.05em; }
.f1sp-weather__rain--wet .f1sp-weather__value { color: var(--f1sp-wet); }
.f1sp-weather__rain--dry .f1sp-weather__value { color: var(--f1sp-inter); }
.f1sp-weather__updated { text-align: center; font-size: .75em; color: var(--f1sp-text-muted); padding: 0 16px 12px; margin: 0; }

/* ── Race Control ────────────────────────────────────────────────────────── */
.f1sp-rc-list  { list-style: none; margin: 0; padding: 0; }
.f1sp-rc-item  {
    display:       grid;
    grid-template-columns: 80px 60px 1fr;
    align-items:   center;
    gap:           10px;
    padding:       7px 12px;
    border-bottom: 1px solid var(--f1sp-border);
    font-size:     .875em;
}
.f1sp-rc-item--red-flag    { border-left: 4px solid #e8002d; background: rgba(232,0,45,.05); }
.f1sp-rc-item--yellow-flag { border-left: 4px solid #ffd700; background: rgba(255,215,0,.05); }
.f1sp-rc-item--green-flag  { border-left: 4px solid #3ec14a; background: rgba(62,193,74,.05); }
.f1sp-rc-item--chequered   { border-left: 4px solid #000; }
.f1sp-rc-item--sc          { border-left: 4px solid #ff9800; background: rgba(255,152,0,.05); }
.f1sp-rc-item--drs         { border-left: 4px solid #2196f3; }
.f1sp-rc-time { font-variant-numeric: tabular-nums; font-size: .8em; color: var(--f1sp-text-muted); }
.f1sp-rc-lap  { font-size: .8em; color: var(--f1sp-text-muted); }

/* ── Team Radio ──────────────────────────────────────────────────────────── */
.f1sp-radio-list { list-style: none; margin: 0; padding: 0; }
.f1sp-radio-item {
    padding:     10px 12px;
    border-bottom: 1px solid var(--f1sp-border);
    display:     flex;
    align-items: center;
    gap:         12px;
    flex-wrap:   wrap;
}
.f1sp-radio-item__meta { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.f1sp-radio-item__name { font-weight: 700; font-size: .9em; }
.f1sp-radio-item__time { font-size: .8em; color: var(--f1sp-text-muted); }
.f1sp-radio-item__audio { flex: 1; min-width: 200px; height: 32px; }

/* ── Live Intervals / Live Tower ─────────────────────────────────────────── */
.f1sp-live-tower { position: relative; }
.f1sp-live-tower[data-live="1"]::after {
    content:       "LIVE";
    position:      absolute;
    top:           0;
    right:         0;
    background:    var(--f1sp-accent);
    color:         #fff;
    font-size:     .65em;
    font-weight:   700;
    padding:       2px 6px;
    border-radius: 3px;
    letter-spacing: .08em;
}

/* ── Delta Arrows ────────────────────────────────────────────────────────── */
.f1sp-delta         { font-weight: 700; }
.f1sp-delta--gain   { color: #3ec14a; }
.f1sp-delta--loss   { color: var(--f1sp-accent); }
.f1sp-delta--neutral { color: var(--f1sp-text-muted); }

/* ── Session Stats ────────────────────────────────────────────────────────── */
.f1sp-session-stats {
    display:   grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap:       1px;
    background: var(--f1sp-border);
    border:    1px solid var(--f1sp-border);
    border-radius: var(--f1sp-radius);
    overflow:  hidden;
}
.f1sp-session-stats__item {
    padding:    14px 16px;
    background: var(--f1sp-bg-card);
}
.f1sp-session-stats__item dt { font-size: .75em; color: var(--f1sp-text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.f1sp-session-stats__item dd { margin: 0; font-weight: 700; font-size: 1.05em; }

/* ── Charts ──────────────────────────────────────────────────────────────── */
.f1sp-chart-wrap { position: relative; width: 100%; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .f1sp-driver-grid--cols-4,
    .f1sp-driver-grid--cols-5 { grid-template-columns: repeat(2, 1fr); }
    .f1sp-team-grid--cols-3,
    .f1sp-team-grid--cols-4   { grid-template-columns: repeat(2, 1fr); }
    .f1sp-next-race { grid-template-columns: auto 1fr; }
    .f1sp-next-race__countdown-badge { grid-column: 1 / -1; text-align: center; }
    .f1sp-h2h__headers { grid-template-columns: 1fr auto 1fr; gap: 8px; }
    .f1sp-countdown__value { font-size: 1.6em; }
}
