/* ============================================================
   DASHBOARD 2 — Race Result Viewer
   ============================================================ */

:root {
    --bg-dark:       #0a0a0b;
    --bg-nav:        #101012;
    --bg-subbar:     #141416;
    --bg-card:       #18181b;
    --bg-card2:      #1f1f23;
    --border:        #27272a;
    --border-light:  #3f3f46;
    --text:          #ffffff;
    --text-dim:      #a1a1aa;
    --text-muted:    #52525b;
    --gold:          #F5A623;
    --gold-dark:     #c47f0a;
    --silver:        #94a3b8;
    --bronze:        #cd7f32;
    --green:         #22c55e;
    --red:           #e10600;
    --purple:        #7b2cbf;
    --purple-light:  #9d4edd;
    --fl-purple:     #c026d3;
    --dotd-orange:   #f97316;

    /* Grid accent colors */
    --color-elite:      #F5A623;  /* gold  */
    --color-ascension:  #94a3b8;  /* silver */
    --color-pilotos:    #9d4edd;  /* purple */
    --color-seletiva:   #60a5fa;  /* light blue */

    /* Active grid accent — default purple, overridden by body class */
    --grid-accent:      #9d4edd;
    --grid-accent-dim:  rgba(157,78,221,0.15);
    --grid-accent-glow: rgba(157,78,221,0.35);
}

/* ── Grid-specific accent overrides ── */
body.grid-elite     { --grid-accent: #F5A623; --grid-accent-dim: rgba(245,166,35,0.15); --grid-accent-glow: rgba(245,166,35,0.35); }
body.grid-ascension { --grid-accent: #94a3b8; --grid-accent-dim: rgba(148,163,184,0.15); --grid-accent-glow: rgba(148,163,184,0.3); }
body.grid-pilotos   { --grid-accent: #9d4edd; --grid-accent-dim: rgba(157,78,221,0.15); --grid-accent-glow: rgba(157,78,221,0.35); }
body.grid-seletiva  { --grid-accent: #60a5fa; --grid-accent-dim: rgba(96,165,250,0.15); --grid-accent-glow: rgba(96,165,250,0.3); }

html { zoom: 1.25; }

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: var(--bg-dark);
    color: var(--text);
    font-family: 'Segoe UI', Roboto, Arial, sans-serif;
    min-height: 100vh;
    -webkit-user-select: none;
    user-select: none;
    font-size: 13px;
    padding-bottom: 40px;
}

/* ── TOP NAV ── */
.top-nav {
    display: flex;
    align-items: center;
    background: var(--bg-nav);
    border-bottom: 1px solid var(--border);
    height: 52px;
    padding: 0 16px;
    gap: 4px;
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
}

.nav-logo {
    font-size: 18px;
    color: var(--red);
    margin-right: 8px;
    display: flex;
    align-items: center;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}
.nav-left::-webkit-scrollbar { display: none; }

.nav-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: var(--text-dim);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}

.nav-tab:hover { background: rgba(255,255,255,0.06); color: var(--text); transform: translateY(-1px); }

.nav-save-img-btn { background: var(--green, #00c853) !important; color: #fff !important; border-radius: 6px !important; padding: 6px 14px !important; font-weight: 700 !important; margin-left: 6px; }
.nav-save-img-btn:hover { opacity: 0.88; transform: translateY(-1px); }

.nav-tab.active {
    background: rgba(255,255,255,0.07);
    color: var(--text);
    border-bottom: 2px solid var(--red);
    box-shadow: 0 2px 12px rgba(225,6,0,0.2);
}

.nav-tab .nav-icon { font-size: 11px; }

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}
.nav-right::-webkit-scrollbar { display: none; }

/* Grid tabs in nav */
.grid-tabs {
    display: flex;
    gap: 4px;
    align-items: center;
}

.grid-tab-btn {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 5px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    transition: all 0.2s;
}

.grid-tab-btn:hover { color: var(--text); border-color: rgba(255,255,255,0.25); background: rgba(255,255,255,0.07); transform: translateY(-1px); }
.grid-tab-btn.active {
    background: var(--grid-accent);
    border-color: var(--grid-accent);
    color: #000;
    font-weight: 900;
    box-shadow: 0 0 12px var(--grid-accent-glow);
}

/* Per-grid pill colors when active */
body.grid-elite     .grid-tab-btn.active { color: #000; }
body.grid-ascension .grid-tab-btn.active { color: #111; }
body.grid-pilotos   .grid-tab-btn.active { color: #fff; }
body.grid-seletiva  .grid-tab-btn.active { color: #000; }

/* Season selector */
.nav-season {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 11px;
    color: var(--text-dim);
}

.nav-season i { color: var(--purple-light); }

.nav-season span { font-weight: 700; text-transform: uppercase; }

.nav-season select {
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    outline: none;
    padding: 0 4px;
}

.nav-season select option { background: #1f1f23; }

/* ── RACE SUBBAR ── */
.race-subbar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-subbar);
    border-bottom: 1px solid var(--border);
    padding: 0 16px;
    height: 46px;
}

.race-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-dim);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.race-selector i { color: var(--red); }

.race-selector select {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    outline: none;
    min-width: 200px;
}

.race-selector select option { background: #1f1f23; }

.view-tabs {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.view-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}

.view-tab:hover { background: var(--bg-card2); color: var(--text); border-color: var(--border-light); transform: translateY(-1px); }

.view-tab.active {
    background: var(--grid-accent);
    border-color: var(--grid-accent);
    color: #000;
    box-shadow: 0 0 10px var(--grid-accent-glow);
}
body.grid-pilotos .view-tab.active { color: #fff; }

/* ── MAIN CONTENT ── */
.race-content {
    display: grid;
    grid-template-columns: 260px 1fr 290px;
    gap: 0;
    min-height: calc(100vh - 100px);
    max-width: 1440px;
    margin: 0 auto;
    padding: 16px;
    align-items: start;
}

/* Loading/empty state */
.loading-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 80px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.loading-state i { font-size: 32px; }

/* ── PODIUM PANEL ── */
.podium-panel {
    grid-column: 1 / -1;
    flex-direction: row;
    gap: 12px;
    padding-bottom: 4px;
}

.seletiva-promo-card {
    flex: 0 0 160px;
    min-width: 140px;
}

/* Podium cards */
.podium-card {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    position: relative;
    overflow: hidden;
}
.podium-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.5); }

.podium-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 12px 0 0 12px;
}

.podium-card.pos-first  { border-color: rgba(245,166,35,0.4); box-shadow: 0 0 20px rgba(245,166,35,0.1); }
.podium-card.pos-first::before  { background: var(--gold); }
.podium-card.pos-first:hover    { box-shadow: 0 8px 32px rgba(245,166,35,0.2); }
.podium-card.pos-second { border-color: rgba(148,163,184,0.25); }
.podium-card.pos-second::before { background: var(--silver); }
.podium-card.pos-third  { border-color: rgba(205,127,50,0.25); }
.podium-card.pos-third::before  { background: var(--bronze); }

/* Position badge */
.podium-pos-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.podium-pos-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.pos-first .podium-pos-badge  { color: var(--gold); }
.pos-second .podium-pos-badge { color: var(--silver); }
.pos-third .podium-pos-badge  { color: var(--bronze); }

.podium-pts-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 20px;
}

.pts-up {
    background: rgba(34, 197, 94, 0.15);
    color: var(--green);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.pts-down {
    background: rgba(225, 6, 0, 0.15);
    color: var(--red);
    border: 1px solid rgba(225, 6, 0, 0.3);
}

.pts-neutral {
    background: rgba(156, 163, 175, 0.1);
    color: #6b7280;
    border: 1px solid rgba(156, 163, 175, 0.2);
}

.podium-pts-top-right {
    position: absolute;
    top: 10px;
    right: 14px;
}

.podium-delta-bottom {
    position: absolute;
    bottom: 10px;
    right: 14px;
}

/* Driver photo */
.podium-photo-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.podium-photo {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-light);
}

.podium-photo-placeholder {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--bg-card2);
    border: 2px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 900;
    color: var(--text-dim);
}

/* Driver info */
.podium-driver-name {
    text-align: center;
}

.podium-first-name {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.podium-last-name {
    display: block;
    font-size: 17px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.1;
}

.pos-first .podium-last-name  { color: var(--gold); }
.pos-second .podium-last-name { color: var(--silver); }
.pos-third .podium-last-name  { color: var(--bronze); }

.pole-badge {
    background: var(--gold);
    color: #000;
    font-size: 9px;
    font-weight: 900;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 4px;
    vertical-align: middle;
}

.podium-team-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--text-dim);
    font-size: 11px;
    font-weight: 600;
}

.team-logo-sm {
    width: 18px;
    height: 18px;
    object-fit: contain;
    border-radius: 2px;
}

.podium-time-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.podium-time-row i { color: var(--purple-light); font-size: 9px; }

/* ── RESULTS PANEL ── */
.results-panel {
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

/* Race title bar */
.race-title-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    border-radius: 10px 10px 0 0;
}

.race-title-flag {
    width: 32px;
    height: auto;
    border-radius: 3px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.race-title-text {
    font-size: 14px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text);
}

/* Results table */
.results-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: 0 0 10px 10px;
    overflow: hidden;
}

.results-table thead th {
    background: var(--bg-card2);
    color: var(--text-dim);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.results-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

.results-table tbody tr:hover { background: rgba(255,255,255,0.03); }

.results-table tbody tr:last-child { border-bottom: none; }

.results-table tbody tr.row-dnf { opacity: 0.55; }

.results-table td {
    padding: 9px 12px;
    vertical-align: middle;
}

/* Position cell */
.pos-cell {
    width: 70px;
    text-align: center;
}

.pos-cell-inner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: 100%;
}

.pos-number {
    font-size: 14px;
    font-weight: 900;
    color: var(--text);
    line-height: 1;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.pos-change {
    font-size: 9px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 1px;
    line-height: 1;
    width: 22px;
    justify-content: flex-start;
}

.pos-change.up      { color: var(--green); }
.pos-change.down    { color: var(--red); }
.pos-change.neutral { color: #4b5563; }

/* Driver cell */
.driver-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.driver-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: contain;
    border: 1px solid var(--border-light);
    flex-shrink: 0;
}

.driver-avatar-placeholder {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--bg-card2);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 900;
    color: var(--text-dim);
    flex-shrink: 0;
}

.driver-name-group { display: flex; flex-direction: column; line-height: 1.2; }

.d-first { font-size: 10px; color: var(--text-dim); font-weight: 400; }
.d-last  { font-size: 13px; font-weight: 800; color: var(--text); text-transform: uppercase; }

.badges-inline {
    display: flex;
    gap: 3px;
    margin-left: auto;
}

.badge {
    font-size: 8px;
    font-weight: 900;
    padding: 2px 5px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-pole { background: var(--gold); color: #000; }
.badge-fl   { background: var(--fl-purple); color: #fff; }
.badge-dotd { background: var(--dotd-orange); color: #fff; }

/* Team cell */
.results-table td.team-cell {
    display: table-cell;
    text-align: left;
    vertical-align: middle;
    color: var(--text-dim);
    font-size: 11px;
    font-weight: 600;
}
.team-cell-inner {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 7px;
    overflow: hidden;
}
.team-cell-inner span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.team-logo-xs {
    width: 20px;
    height: 20px;
    object-fit: contain;
    border-radius: 2px;
}

/* Points/time cell */
.points-cell {
    text-align: center;
    font-size: 13px;
    font-weight: 800;
    color: var(--text);
    white-space: nowrap;
}

.points-cell.dnf { color: var(--text-muted); font-weight: 600; }

.points-cell.dsq { color: var(--text-muted); font-weight: 600; }

.dnf-with-bonus { display: inline-flex; align-items: center; gap: 4px; }
.nc-bonus-tag {
    font-size: 9px;
    font-weight: 800;
    color: var(--purple);
    background: rgba(168,85,247,0.15);
    border: 1px solid rgba(168,85,247,0.3);
    padding: 1px 5px;
    border-radius: 3px;
    letter-spacing: 0.3px;
}

.points-cell .pts-positive { color: var(--green); }

/* ── INFO CARDS PANEL (esquerda) ── */
.info-cards-panel {
    flex-direction: column;
    gap: 12px;
    padding-right: 12px;
}

/* ── PENALTIES PANEL (direita) ── */
.penalties-panel {
    flex-direction: column;
    gap: 0;
    padding-left: 12px;
}

/* DOTD Card */
.dotd-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.dotd-header {
    background: linear-gradient(90deg, var(--red) 0%, #a00400 100%);
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 7px;
    box-shadow: 0 2px 8px rgba(225,6,0,0.25);
}

.dotd-body {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
}

.dotd-photo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(225, 6, 0, 0.4);
    flex-shrink: 0;
}

.dotd-photo-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--bg-card2);
    border: 2px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 900;
    color: var(--text-dim);
    flex-shrink: 0;
}

.dotd-info { flex: 1; }

.dotd-name {
    font-size: 18px;
    font-weight: 900;
    text-transform: uppercase;
    color: var(--text);
    line-height: 1;
}

.dotd-team-row {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-dim);
    font-size: 11px;
    font-weight: 600;
    margin-top: 4px;
}

.dotd-stats {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0 14px 14px;
}

.dotd-stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dotd-stat-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-dim);
    font-weight: 600;
}

.dotd-stat-bar-wrap {
    flex: 1;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 0 10px;
    overflow: hidden;
}

.dotd-stat-bar {
    height: 100%;
    border-radius: 2px;
    background: var(--red);
}

.dotd-stat-value {
    font-size: 12px;
    font-weight: 900;
    color: var(--text);
    min-width: 16px;
    text-align: right;
}

/* Top Performers */
.tp-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.tp-header {
    background: var(--bg-card2);
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 7px;
    border-bottom: 1px solid var(--border);
}

.tp-header i { color: var(--purple-light); }

.tp-list { padding: 8px 0; }

.tp-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    transition: background 0.15s;
}

.tp-item:hover { background: rgba(255,255,255,0.03); }

.tp-photo {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-light);
    flex-shrink: 0;
}

.tp-photo-placeholder {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--bg-card2);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 900;
    color: var(--text-dim);
    flex-shrink: 0;
}

.tp-info { flex: 1; }

.tp-name {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text);
    display: block;
    line-height: 1.1;
}

.tp-team {
    font-size: 10px;
    color: var(--text-dim);
    font-weight: 600;
    display: block;
}

.tp-badge {
    font-size: 9px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 10px;
    text-transform: uppercase;
}

.tp-badge.fl   { background: rgba(192, 38, 211, 0.2); color: var(--fl-purple); border: 1px solid rgba(192,38,211,0.3); }
.tp-badge.dotd { background: rgba(249, 115, 22, 0.2); color: var(--dotd-orange); border: 1px solid rgba(249,115,22,0.3); }
.tp-badge.pts  { background: rgba(34, 197, 94, 0.15); color: var(--green); border: 1px solid rgba(34,197,94,0.3); }
.tp-badge.gain { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59,130,246,0.3); }

/* Fastest lap row highlight */
.results-table tbody tr.row-fl td { border-left: 2px solid var(--fl-purple); }

/* ── POLE / FL MINI-CARDS ── */
.info-mini-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}
.info-mini-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,0.4); }

.info-mini-header {
    padding: 8px 14px;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.info-mini-header.dotd {
    background: linear-gradient(90deg, var(--red) 0%, #a00400 100%);
    color: #fff;
    border-bottom: 1px solid rgba(225,6,0,0.3);
}

.info-mini-header.pole {
    background: rgba(168,85,247,0.12);
    color: var(--purple);
    border-bottom: 1px solid rgba(168,85,247,0.18);
}

.info-mini-header.fl {
    background: rgba(34,197,94,0.1);
    color: var(--green);
    border-bottom: 1px solid rgba(34,197,94,0.18);
}

.info-mini-body {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
}

.info-mini-photo {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-light);
    flex-shrink: 0;
}

.info-mini-placeholder {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-card2);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 900;
    color: var(--text-dim);
    flex-shrink: 0;
}

.info-mini-info { flex: 1; min-width: 0; }

.info-mini-name {
    font-size: 14px;
    font-weight: 900;
    text-transform: uppercase;
    color: var(--text);
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.info-mini-team {
    font-size: 10px;
    color: var(--text-dim);
    font-weight: 600;
    margin-top: 2px;
}

.info-mini-time {
    font-size: 11px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    margin-top: 3px;
}

.info-mini-time.pole { color: var(--purple); }
.info-mini-time.fl   { color: var(--green); }

.info-mini-pos-row {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
    font-size: 11px;
    font-weight: 700;
}

.dotd-pos-from {
    color: var(--text-dim);
}

.dotd-pos-to {
    color: var(--green);
}

/* ── RACE PENALTIES CARD ── */
.race-pen-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.race-pen-header {
    background: rgba(251,191,36,0.07);
    border-bottom: 1px solid rgba(251,191,36,0.15);
    padding: 10px 14px;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fbbf24;
    display: flex;
    align-items: center;
    gap: 6px;
}

.race-pen-body { padding: 10px 14px; }

.pen-driver-block { margin-bottom: 10px; }
.pen-driver-block:last-child { margin-bottom: 0; }

.pen-driver-name {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 4px;
    letter-spacing: 0.5px;
    padding-bottom: 3px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.pen-entry {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    padding: 4px 0;
}

.pen-lap-tag {
    background: rgba(251,191,36,0.15);
    color: #fbbf24;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 1px;
}

.pen-detail { flex: 1; }
.pen-type { font-size: 10px; color: #fbbf24; font-weight: 600; line-height: 1.3; }
.pen-infr { font-size: 9px; color: #777; margin-top: 1px; line-height: 1.3; }

.pen-team {
    font-size: 9px;
    color: var(--text-muted);
    font-weight: 500;
}

.pen-versus-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.pen-versus-side {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.pen-versus-right {
    text-align: right;
    align-items: flex-end;
}

.pen-versus-name {
    font-size: 12px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: .04em;
}

.pen-versus-team {
    font-size: 9px;
    color: var(--text-muted);
    font-weight: 500;
}

.pen-versus-x {
    font-size: 14px;
    font-weight: 900;
    color: var(--text-muted);
    flex-shrink: 0;
}

.pen-badges-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 4px;
}

.pen-sev-badge {
    font-size: 9px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pen-sanction {
    font-size: 11px;
    font-weight: 700;
    color: #fbbf24;
    margin-top: 4px;
    font-family: 'Courier New', monospace;
}

.pen-summary-footer {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.pen-summary-footer-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pen-expand-btn {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 11px;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.pen-block-open .pen-expand-btn i {
    transform: rotate(180deg);
    display: inline-block;
}

.pen-details {
    padding: 0 14px 14px;
    border-top: 1px solid rgba(255,255,255,0.06);
    margin-top: 4px;
}

.pen-text-label {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #c084fc;
    margin-top: 12px;
    margin-bottom: 5px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(192,132,252,0.2);
}

.pen-analysis {
    font-size: 11px;
    color: #d4d4d8;
    line-height: 1.6;
}

.pen-result {
    font-size: 11px;
    color: #a1a1aa;
    line-height: 1.6;
}

.pen-empty {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    padding: 20px 14px;
}

/* Sprint badge in race selector */
.sprint-label {
    font-size: 9px;
    background: var(--purple);
    color: #fff;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 4px;
    font-weight: 800;
}

/* ── Telemetria scrollbars ── */
#main-telemetria-panel,
#res-subtab-telemetria {
    scrollbar-width: thin;
    scrollbar-color: #2a2a2e transparent;
}
#main-telemetria-panel::-webkit-scrollbar,
#res-subtab-telemetria::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
#main-telemetria-panel::-webkit-scrollbar-track,
#res-subtab-telemetria::-webkit-scrollbar-track {
    background: transparent;
}
#main-telemetria-panel::-webkit-scrollbar-thumb,
#res-subtab-telemetria::-webkit-scrollbar-thumb {
    background: #2a2a2e;
    border-radius: 3px;
}
#main-telemetria-panel::-webkit-scrollbar-thumb:hover,
#res-subtab-telemetria::-webkit-scrollbar-thumb:hover {
    background: var(--purple);
}
/* Table overflow containers inside telemetria */
#main-telemetria-panel div[style*="overflow-x"],
#res-subtab-telemetria div[style*="overflow-x"] {
    scrollbar-width: thin;
    scrollbar-color: #2a2a2e transparent;
}
#main-telemetria-panel div[style*="overflow-x"]::-webkit-scrollbar,
#res-subtab-telemetria div[style*="overflow-x"]::-webkit-scrollbar {
    height: 5px;
}
#main-telemetria-panel div[style*="overflow-x"]::-webkit-scrollbar-track,
#res-subtab-telemetria div[style*="overflow-x"]::-webkit-scrollbar-track {
    background: transparent;
}
#main-telemetria-panel div[style*="overflow-x"]::-webkit-scrollbar-thumb,
#res-subtab-telemetria div[style*="overflow-x"]::-webkit-scrollbar-thumb {
    background: #2a2a2e;
    border-radius: 3px;
}
#main-telemetria-panel div[style*="overflow-x"]::-webkit-scrollbar-thumb:hover,
#res-subtab-telemetria div[style*="overflow-x"]::-webkit-scrollbar-thumb:hover {
    background: var(--purple);
}

/* Responsive adjustments */
@media (max-width: 1100px) {
    .race-content {
        grid-template-columns: 220px 1fr 250px;
    }
}

@media (max-width: 900px) {
    .race-content {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .results-panel    { border: none; }
    .info-cards-panel { padding-right: 0; }
    .penalties-panel  { padding-left: 0; }
    .podium-panel     { flex-wrap: wrap; }
    .podium-card      { min-width: 160px; }
}


/* ══════════════════════════════════════════════
   SPONSOR PLACEMENT OPTIONS (preview)
══════════════════════════════════════════════ */

/* Shared label */
.sponsor-label {
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    opacity: 0.6;
}
.sponsor-name-placeholder {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--text-muted);
    opacity: 0.4;
    border: 1px dashed rgba(255,255,255,0.15);
    padding: 4px 12px;
    border-radius: 4px;
}

/* Footer patrocinador */
.sponsor-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: var(--bg-nav);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    z-index: 100;
}
.sponsor-logo-footer {
    width: 80px;
    height: auto;
    object-fit: contain;
}

/* OPÇÃO 3 — Card no painel lateral */
.sponsor-panel-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-top: 10px;
}
.sponsor-logo-panel {
    width: 120px;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
}

/* OPÇÃO 5 — Dentro do card do pódio */
.podium-sponsor-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-top: 1px solid var(--border);
    padding-top: 8px;
    margin-top: 2px;
}
.podium-sponsor-logo {
    width: 64px;
    height: auto;
    object-fit: contain;
    border-radius: 3px;
    opacity: 0.85;
}

/* ── Language selector ── */
.lang-selector { display:flex; gap:2px; align-items:center; flex-shrink:0; }
.lang-btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    padding: 2px 4px;
    opacity: 0.45;
    transition: opacity 0.15s, border-color 0.15s;
    line-height: 1;
    display: flex;
    align-items: center;
}
.lang-btn img { width: 22px; height: 15px; object-fit: cover; border-radius: 2px; display: block; }
.lang-btn:hover { opacity: 0.8; border-color: var(--border); }
.lang-btn.active { opacity: 1; border-color: var(--border-light); }

/* ══════════════════════════════════════════════
   MOBILE — ≤ 768px
══════════════════════════════════════════════ */
@media (max-width: 768px) {
    html { zoom: 1; }

    /* ── Two-row sticky nav ── */
    .top-nav {
        flex-direction: column;
        align-items: stretch;
        height: auto;
        padding: 0;
        gap: 0;
        overflow: visible;
    }

    /* Row 1: page tabs — horizontally scrollable */
    .nav-left {
        width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        padding: 6px 8px 4px;
        gap: 2px;
        flex-shrink: 0;
        border-bottom: 1px solid var(--border);
    }
    .nav-left::-webkit-scrollbar { display: none; }
    .nav-logo { display: none; }
    .nav-tab  { flex-shrink: 0; white-space: nowrap; padding: 5px 10px; font-size: 10px; gap: 4px; }
    .nav-save-img-btn { display: none !important; }

    /* Row 2: grid tabs + season — horizontally scrollable */
    .nav-right {
        width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        padding: 4px 8px 6px;
        gap: 8px;
        margin-left: 0;
        flex-shrink: 0;
    }
    .nav-right::-webkit-scrollbar { display: none; }
    .grid-tabs { gap: 4px; flex-shrink: 0; }
    .grid-tab-btn { flex-shrink: 0; white-space: nowrap; padding: 4px 10px; font-size: 9px; }
    .nav-season { flex-shrink: 0; white-space: nowrap; padding: 4px 8px; }
    .nav-season > span { display: none; }
    /* Subbar */
    .race-subbar {
        flex-direction: column;
        align-items: stretch;
        height: auto;
        padding: 8px 10px;
        gap: 6px;
    }
    .race-selector { width: 100%; }
    .race-selector select { width: 100%; }
    .view-tabs { margin-left: 0; justify-content: center; }
    .view-tab  { flex: 1; justify-content: center; font-size: 10px; padding: 6px 8px; }

    /* Content */
    .race-content { padding: 10px 8px; grid-template-columns: 1fr; gap: 10px; }
    .results-panel { border: none; }

    /* Podium */
    .podium-panel { flex-direction: row; overflow-x: auto; gap: 8px; padding-bottom: 4px; }
    .podium-card  { min-width: 140px; flex: 0 0 140px; }
    .podium-last-name { font-size: 14px; }
    .podium-photo, .podium-photo-placeholder { width: 56px; height: 56px; }

    /* Results table */
    .results-table .team-cell,
    .results-table thead th:nth-child(3) { display: none; }

    /* Settings overlay */
    .sett-topbar { padding: 0 8px; height: 44px; overflow-x: auto; }
    .sett-topbar-left { display: none; }
    .sett-tab-nav { padding: 6px 8px; height: auto; flex-wrap: wrap; gap: 4px; }
    .sett-tab-btn { padding: 5px 10px; font-size: 10px; }
    .sett-login-card { width: calc(100vw - 32px); padding: 28px 20px; }
    .sa-content { padding: 12px; }
    .sa-form-grid-2, .sa-form-grid-3 { grid-template-columns: 1fr; }
    .calendar-add-row { grid-template-columns: 1fr 1fr !important; }
    .btn-add-race { grid-column: span 2; width: 100%; }
}
