/* ─── VARIABLES ──────────────────────────────────────────────────────────────── */
:root {
    --bg-color: #090909;
    --surface: #111111;
    --surface-strong: #1f1f1f;
    --text-color: #f2f2f2;
    --muted: #a8a8a8;
    --accent-color: #ff2121;
    --accent-strong: #ff7878;
    --border-color: #2d2d2d;

    /* Colores de equipos como variables */
    --mercedes:        #00D2BE;
    --ferrari:         #E10600;
    --mclaren:         #FF8700;
    --redbull:         #3671C6;
    --alpine:          #0093CC;
    --racing-bulls:    #6692FF;
    --haas:            #B6BABD;
    --williams:        #64C4FF;
    --audi:            #C0C0C0;
    --cadillac:        #00827F;
    --aston:           #358C75;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background: radial-gradient(circle at top, #141414 0%, #090909 55%, #050505 100%);
    color: var(--text-color);
    font-family: Inter, Arial, sans-serif;
}

body { line-height: 1.6; }

.container {
    width: min(1100px, 94%);
    margin: 0 auto;
    padding: 2rem 0 3rem;
    display: grid;
    gap: 1.5rem;
}

h1, h2, h3 { margin: 0 0 1rem; color: #ffffff; }
h4 { margin: 0 0 0.75rem; color: #ffffff; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.08em; }
p { margin: 0 0 1rem; color: var(--muted); }

/* ─── CARD ───────────────────────────────────────────────────────────────────── */
.card {
    background: linear-gradient(180deg, rgba(20,20,20,0.96), rgba(15,15,15,0.98));
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 1.75rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

/* ─── HEADER ─────────────────────────────────────────────────────────────────── */
.page-header {
    display: grid;
    grid-template-columns: 1.4fr 0.9fr;
    gap: 1.5rem;
    align-items: start;
}

.header-actions {
    display: grid;
    gap: 1rem;
    justify-content: end;
}

.search-form { display: flex; justify-content: flex-end; }
.search-input-small { width: min(320px, 100%); }

.hero-links {
    display: flex;
    gap: 0.85rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.hero-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1.1rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    color: #f2f2f2;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.2s, border-color 0.2s;
}

.hero-link:hover {
    background: rgba(255,33,33,0.18);
    border-color: rgba(255,33,33,0.35);
}

.season-label {
    display: inline-block;
    margin-bottom: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent-color);
    font-size: 0.8rem;
}

/* ─── HOME: STATS ────────────────────────────────────────────────────────────── */
.hero-overview { padding: 1.5rem; }

.hero-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.hero-stat {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 1.25rem;
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
}

/* ─── COUNTDOWN ──────────────────────────────────────────────────────────────── */
.countdown-card {
    background: linear-gradient(135deg, rgba(255,33,33,0.08), rgba(15,15,15,0.98));
    border-color: rgba(255,33,33,0.25);
    text-align: center;
    padding: 1.5rem 2rem;
}

.countdown-inner { display: grid; gap: 0.75rem; }

.countdown-label {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
}

.countdown-time {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.cd-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 3.5rem;
}

.cd-unit strong {
    font-size: 2.2rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}

.cd-unit small {
    font-size: 0.7rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.cd-sep {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 0.8rem;
}

.countdown-hour {
    font-size: 0.85rem;
    color: var(--muted);
}

.countdown-live {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--accent-color);
    animation: pulse 1s ease-in-out infinite alternate;
}

@keyframes pulse { from { opacity: 0.6; } to { opacity: 1; } }

/* ─── LÍDERES DEL CAMPEONATO ─────────────────────────────────────────────────── */
.leaders-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.leader-card {
    display: grid;
    gap: 0.5rem;
}

.leader-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--muted);
}

.leader-name {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.1;
}

.leader-detail {
    color: var(--muted);
    font-size: 0.95rem;
}

/* ─── TABLAS DE CLASIFICACIÓN ────────────────────────────────────────────────── */
.standings-card { min-height: 320px; }

.standings {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.standings th,
.standings td {
    padding: 0.85rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.standings th {
    color: var(--muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.standings tr:hover td { background: rgba(255,255,255,0.025); }

.standings td.position {
    font-weight: 700;
    width: 2rem;
    color: var(--muted);
}

.strong-text { font-weight: 700; }

.gap-cell {
    color: var(--muted);
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
}

.driver-name-cell { font-weight: 600; }
.driver-flag { margin-right: 0.3rem; }

/* Puntos individuales en tabla de escuderías */
.driver-pts-list { display: flex; flex-direction: column; gap: 0.2rem; }
.driver-pts-mini { font-size: 0.82rem; color: var(--muted); }
.driver-pts-mini strong { color: #fff; }

/* ─── CHIP DE EQUIPO ─────────────────────────────────────────────────────────── */
.team-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.3rem 0.7rem 0.3rem 0.5rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
    color: #ffffff;
    font-size: 0.88rem;
    border-left: 3px solid transparent;
}

.logo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 50%;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    flex-shrink: 0;
}

/* Fallbacks si no hay color inline */
.team-redbull .logo-badge    { background: linear-gradient(135deg, #0f2148, #ea7a00); }
.team-mercedes .logo-badge   { background: linear-gradient(135deg, #1a3a3a, #00b2a9); }
.team-ferrari .logo-badge    { background: linear-gradient(135deg, #760000, #e10600); }
.team-mclaren .logo-badge    { background: linear-gradient(135deg, #ff8700, #1f1f1f); }
.team-aston .logo-badge      { background: linear-gradient(135deg, #143a22, #94c73d); }
.team-alpine .logo-badge     { background: linear-gradient(135deg, #0f1e58, #00a0df); }
.team-williams .logo-badge   { background: linear-gradient(135deg, #002e72, #88d0ff); }
.team-haas .logo-badge       { background: linear-gradient(135deg, #333, #d2d2d2); }
.team-audi .logo-badge       { background: linear-gradient(135deg, #101820, #8d8e8f); }
.team-racing-bulls .logo-badge { background: linear-gradient(135deg, #1a2a5e, #6692ff); }
.team-cadillac .logo-badge   { background: linear-gradient(135deg, #004c4c, #9fd7d7); }

.team-cell-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 6px;
    background: rgba(255,255,255,0.06);
    padding: 0.2rem;
}

/* ─── TARJETAS DE ENTIDAD ────────────────────────────────────────────────────── */
.entity-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.entity-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-top: 3px solid transparent;
    border-radius: 18px;
    padding: 1.35rem;
    display: grid;
    gap: 0.75rem;
    transition: border-color 0.2s;
}

.entity-card:hover { background: rgba(255,255,255,0.06); }

.entity-card-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.entity-flag { font-size: 1.4rem; }

.entity-logo {
    width: 100%;
    max-height: 100px;
    object-fit: contain;
    border-radius: 12px;
    background: rgba(255,255,255,0.04);
    padding: 0.6rem;
}

.entity-card h3 { margin-bottom: 0; font-size: 1rem; }
.entity-meta { color: var(--muted); font-size: 0.88rem; margin: 0; }
.entity-description { color: #e8e8e8; font-size: 0.88rem; margin: 0; }

/* ─── BÚSQUEDA ───────────────────────────────────────────────────────────────── */
.search-input {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    background: rgba(255,255,255,0.03);
    color: #fff;
    font-size: 0.95rem;
}

.search-input::placeholder { color: rgba(255,255,255,0.4); }

.search-input:focus {
    outline: none;
    border-color: var(--accent-strong);
    box-shadow: 0 0 0 4px rgba(225,6,0,0.16);
}

.results { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.75rem; }

.search-result-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-left: 3px solid transparent;
}

.search-result-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
    padding: 0.25rem;
    flex-shrink: 0;
}

.search-result-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    flex-wrap: wrap;
}

.result-type { color: var(--muted); font-size: 0.82rem; }
.result-points { font-weight: 700; font-size: 0.88rem; }
.empty-message { color: var(--muted); font-size: 0.9rem; }

/* ─── LINKS ──────────────────────────────────────────────────────────────────── */
.detail-link, .detail-link-inline, .team-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
}

.detail-link:hover, .detail-link-inline:hover, .team-link:hover { color: var(--accent-strong); }
.detail-link-inline { margin-left: auto; flex-shrink: 0; }

/* ─── DETALLE PILOTO / EQUIPO ────────────────────────────────────────────────── */
.detail-card { margin-top: 0; }

.detail-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1.4fr 0.8fr;
}

.detail-card-main { display: grid; gap: 1rem; align-content: start; }

.detail-image {
    width: 100%;
    max-width: 240px;
    border-radius: 16px;
    display: block;
}

.driver-bio { color: #ddd; font-size: 0.95rem; margin: 0; }

.detail-aside {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    padding: 1.25rem;
    align-self: start;
    display: grid;
    gap: 0.75rem;
}

.detail-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.5rem;
}

.detail-list li { color: #e8e8e8; font-size: 0.92rem; }
.muted-text { color: var(--muted); font-size: 0.85rem; }

/* Stats pills en detalle de piloto */
.driver-stats-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.driver-stat-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.6rem 1rem;
    border-radius: 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid;
    border-color: rgba(255,255,255,0.1);
    min-width: 64px;
    gap: 0.15rem;
}

.stat-pill-num {
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}

.stat-pill-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

/* ─── TABLA DE RESULTADOS POR CARRERA ────────────────────────────────────────── */
.race-results-table { display: grid; gap: 0.5rem; }

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

.results-mini-table th,
.results-mini-table td {
    padding: 0.55rem 0.65rem;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.results-mini-table th {
    color: var(--muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.results-mini-table .pos-cell { font-weight: 700; }
.results-mini-table .pts-mini { color: #6eff99; font-weight: 700; }
.results-mini-table tr.row-win td { background: rgba(255, 215, 0, 0.06); }
.results-mini-table tr.row-podium td { background: rgba(255, 255, 255, 0.03); }

.sprint-tag {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    background: rgba(255, 165, 0, 0.2);
    color: #ffa500;
    margin-left: 0.3rem;
}

.dnf { color: #ff4444; font-weight: 700; font-size: 0.8rem; }

/* ─── GRÁFICO SVG ────────────────────────────────────────────────────────────── */
.chart-wrapper { display: grid; gap: 0.5rem; }

.points-chart {
    width: 100%;
    height: auto;
    border-radius: 10px;
    background: rgba(255,255,255,0.02);
    overflow: visible;
}

/* ─── BREAKDOWN DE EQUIPO ────────────────────────────────────────────────────── */
.team-breakdown { display: grid; gap: 0.75rem; }

.driver-bar-row {
    display: grid;
    grid-template-columns: 1fr 2fr auto;
    align-items: center;
    gap: 0.75rem;
}

.driver-bar-name { font-size: 0.88rem; color: #e8e8e8; }

.driver-bar-track {
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    overflow: hidden;
}

.driver-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.8s ease;
}

.driver-bar-pts { font-size: 0.85rem; color: var(--muted); white-space: nowrap; }
.driver-bar-pts strong { color: #fff; }

.driver-links-list { display: grid; gap: 0.5rem; }

.driver-link-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* ─── CALENDARIO ─────────────────────────────────────────────────────────────── */
.schedule-card { padding: 1.75rem; }

.calendar-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
    display: grid;
    gap: 0.6rem;
}

.calendar-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 14px;
    padding: 0.85rem 1rem;
    line-height: 1.5;
    font-size: 0.9rem;
}

.race-round {
    font-weight: 800;
    font-size: 0.75rem;
    color: var(--muted);
    min-width: 2rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.race-info { flex: 1; color: #e8e8e8; }
.race-info strong { color: #fff; }

.race-winner {
    font-size: 0.82rem;
    color: #ffd700;
    font-weight: 600;
    white-space: nowrap;
}

.race-tv {
    font-size: 0.78rem;
    color: var(--muted);
    white-space: nowrap;
}

.race-status { font-size: 0.8rem; white-space: nowrap; }
.race-status.next { color: #4ade80; font-weight: 700; }

/* Estados de carrera */
.race-done {
    opacity: 0.75;
    border-left: 3px solid rgba(100, 200, 100, 0.3);
}

.race-next {
    border-left: 3px solid var(--accent-color);
    background: rgba(255,33,33,0.06) !important;
    border-color: rgba(255,33,33,0.3);
}

.race-upcoming { border-left: 3px solid rgba(255,255,255,0.1); }

.race-latenight { border-left: 3px solid rgba(255, 200, 0, 0.4); }

.summer-break {
    color: #ffd966 !important;
    background: rgba(255, 217, 102, 0.06) !important;
    border-color: rgba(255, 217, 102, 0.15) !important;
    font-style: italic;
    justify-content: center;
    gap: 0.5rem;
}

.debut-tag {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    background: rgba(100,200,255,0.15);
    color: #64c4ff;
    margin-left: 0.3rem;
    font-style: normal;
}

.latenight-tag {
    font-size: 0.75rem;
    color: #ffcc44;
    font-style: normal;
}

/* ─── RESPONSIVE ─────────────────────────────────────────────────────────────── */
@media (max-width: 980px) {
    .page-header { grid-template-columns: 1fr; }
    .hero-stats { grid-template-columns: repeat(2, 1fr); }
    .leaders-grid { grid-template-columns: 1fr; }
    .entity-grid { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .driver-stats-row { gap: 0.5rem; }
}

@media (max-width: 760px) {
    .hero-links { justify-content: flex-start; }
    .search-input-small { width: 100%; }
    .standings th:nth-child(3),
    .standings td:nth-child(3) { display: none; }
    .calendar-list li { font-size: 0.82rem; }
    .race-tv { display: none; }
    .cd-unit strong { font-size: 1.6rem; }
}

@media (max-width: 500px) {
    .hero-stats { grid-template-columns: repeat(2, 1fr); }
    .driver-bar-row { grid-template-columns: 1fr 1.5fr auto; }
}

/* ─── GUÍA DE TRANSMISIONES ─────────────────────────────────────────────────── */
.tv-legend-card { padding: 1.5rem 1.75rem; }

.tv-legend {
    display: grid;
    gap: 1.25rem;
    margin-top: 1rem;
}

.tv-legend-item {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    padding: 1rem 1.25rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 14px;
}

.tv-logo-lg {
    width: 72px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 8px;
    background: rgba(255,255,255,0.06);
    padding: 0.3rem 0.5rem;
}

.tv-logo-sm {
    width: 36px;
    height: 20px;
    object-fit: contain;
    border-radius: 5px;
    background: rgba(255,255,255,0.08);
    padding: 0.15rem 0.3rem;
    flex-shrink: 0;
}

.tv-legend-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.25rem 0;
    color: #ccc;
    font-size: 0.88rem;
}

.tv-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    border-radius: 5px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}

.tv-badge.live {
    background: rgba(74, 222, 128, 0.15);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.tv-badge.delayed {
    background: rgba(251, 146, 60, 0.15);
    color: #fb923c;
    border: 1px solid rgba(251, 146, 60, 0.3);
}

/* ─── CHIPS DE TV EN CADA CARRERA ───────────────────────────────────────────── */
.tv-chips {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.tv-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.5rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
}

/* ─── HORARIOS EN PISTA (SCHEDULE) ──────────────────────────────────────────── */
.schedule-legend {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.calendar-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.cal-filter-btn {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--muted);
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.cal-filter-btn:hover {
    border-color: var(--accent-color);
    color: white;
}

.cal-filter-btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

.race-main-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    width: 100%;
}

.race-schedule {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: grid;
    gap: 0.3rem;
    width: 100%;
}

.sched-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.83rem;
    color: var(--muted);
    padding: 0.2rem 0;
}

.sched-row.race-row {
    color: #fff;
    font-weight: 600;
}

.sched-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sched-dot.fp           { background: #60a5fa; }   /* azul — práctica libre */
.sched-dot.qual         { background: #facc15; }   /* amarillo — clasificación */
.sched-dot.sprint-sched { background: #f97316; }   /* naranja — sprint */
.sched-dot.race-dot     { background: #4ade80; }   /* verde — carrera */

.sched-label { flex: 1; }

.sched-time {
    font-variant-numeric: tabular-nums;
    color: #e8e8e8;
    white-space: nowrap;
}

/* Ajuste al nuevo layout de las filas del calendario */
.calendar-list li {
    flex-direction: column;
    align-items: stretch;
}

/* Las carreras disputadas no muestran schedule */
.race-done .race-main-row {
    flex-direction: row;
    align-items: center;
}

@media (max-width: 600px) {
    .tv-legend-item { flex-direction: column; gap: 0.75rem; }
    .tv-logo-lg { width: 56px; height: 32px; }
    .sched-time { font-size: 0.78rem; }
}

/* ─── CATEGORÍAS DE APOYO ────────────────────────────────────────────────────── */
.support-legend {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.07);
}

.support-legend h3 { font-size: 0.85rem; margin-bottom: 0.6rem; }

.support-legend-chips {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
    flex-wrap: wrap;
}

.support-note { font-size: 0.8rem; color: var(--muted); margin: 0; }

.support-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    border-radius: 5px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}

.support-chip.f2 {
    background: rgba(0, 163, 224, 0.15);
    color: #00a3e0;
    border: 1px solid rgba(0, 163, 224, 0.3);
}

.support-chip.f3 {
    background: rgba(255, 0, 60, 0.15);
    color: #ff3c5a;
    border: 1px solid rgba(255, 0, 60, 0.3);
}

.support-chip.fa {
    background: rgba(180, 120, 255, 0.15);
    color: #b478ff;
    border: 1px solid rgba(180, 120, 255, 0.3);
}

.support-chips-row {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    flex-wrap: wrap;
}

/* ══════════════════════════════════════════════════════════════════
   AMBIENTACIÓN F1 / ARGENTINA
   ══════════════════════════════════════════════════════════════════ */

/* Hero header principal */
.hero-header {
    position: relative;
    overflow: hidden;
    padding: 2.5rem 2rem;
}

.hero-flag-stripe {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg,
        #74ACDF 0%, #74ACDF 33%,
        #ffffff 33%, #ffffff 66%,
        #74ACDF 66%, #74ACDF 100%);
}

.hero-checkered {
    position: absolute;
    bottom: 0; right: 0;
    width: 180px;
    height: 100%;
    opacity: 0.04;
    background-image:
        repeating-conic-gradient(#fff 0% 25%, transparent 0% 50%);
    background-size: 20px 20px;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 1.25rem;
}

.hero-eyebrow {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--muted);
}

.hero-tag.accent {
    background: rgba(255, 33, 33, 0.12);
    border-color: rgba(255, 33, 33, 0.3);
    color: var(--accent-strong);
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1;
    margin: 0;
    color: #fff;
}

.hero-title-arg {
    color: var(--accent-color);
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--muted);
    max-width: 500px;
    margin: 0;
}

/* Hero links mejorados */
.hero-link.primary {
    background: rgba(255,33,33,0.12);
    border-color: rgba(255,33,33,0.3);
    color: #fff;
}

.hero-link.primary:hover {
    background: rgba(255,33,33,0.25);
    border-color: rgba(255,33,33,0.5);
}

.hero-link.secondary {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.1);
    color: var(--muted);
}

.hero-link.secondary:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
    color: #fff;
}

/* ─── QUICK LINKS GRID ───────────────────────────────────────────── */
.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.quick-link-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--text-color);
    transition: border-color 0.2s, background 0.2s;
    padding: 1.25rem;
}

.quick-link-card:hover {
    border-color: rgba(255,33,33,0.35);
    background: linear-gradient(180deg, rgba(255,33,33,0.05), rgba(15,15,15,0.98));
}

.ql-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.quick-link-card strong {
    display: block;
    font-size: 1rem;
    color: #fff;
    margin-bottom: 0.2rem;
}

.quick-link-card p {
    font-size: 0.82rem;
    margin: 0;
    color: var(--muted);
}

/* ─── COLAPINTO HIGHLIGHT ────────────────────────────────────────── */
.colapinto-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: linear-gradient(135deg,
        rgba(116,172,223,0.08) 0%,
        rgba(255,255,255,0.04) 50%,
        rgba(116,172,223,0.08) 100%);
    border-color: rgba(116,172,223,0.2);
}

.colapinto-flag {
    font-size: 3.5rem;
    flex-shrink: 0;
    line-height: 1;
}

.colapinto-content { display: grid; gap: 0.5rem; }
.colapinto-content h2 { margin: 0; font-size: 1.5rem; }

/* ─── LÍDERES ────────────────────────────────────────────────────── */
.leaders-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.leader-card { display: grid; gap: 0.5rem; }
.leader-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); }
.leader-name { font-size: 1.5rem; font-weight: 800; line-height: 1.1; color: var(--accent-strong); }
.leader-detail { color: var(--muted); font-size: 0.92rem; }

/* ─── COUNTDOWN ──────────────────────────────────────────────────── */
.countdown-card {
    background: linear-gradient(135deg, rgba(255,33,33,0.08), rgba(15,15,15,0.98));
    border-color: rgba(255,33,33,0.25);
    text-align: center;
    padding: 1.5rem 2rem;
}
.countdown-inner { display: grid; gap: 0.75rem; }
.countdown-label { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.countdown-time { display: flex; align-items: center; justify-content: center; gap: 0.5rem; }
.cd-unit { display: flex; flex-direction: column; align-items: center; min-width: 3.5rem; }
.cd-unit strong { font-size: 2.2rem; font-weight: 800; color: #fff; line-height: 1; }
.cd-unit small { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.cd-sep { font-size: 2rem; font-weight: 700; color: var(--accent-color); margin-bottom: 0.8rem; }
.countdown-hour { font-size: 0.82rem; color: var(--muted); }
.countdown-live { font-size: 1.4rem; font-weight: 800; color: var(--accent-color); animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: 0.6; } to { opacity: 1; } }

/* ─── SESIÓN EN VIVO ─────────────────────────────────────────────── */
.live-session-card {
    background: linear-gradient(135deg, rgba(255,33,33,0.14), rgba(15,15,15,0.98));
    border-color: rgba(255,33,33,0.35);
    padding: 1.1rem 1.5rem;
}
.live-session-inner { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; }
.live-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent-color); flex-shrink: 0; animation: pulse 1s ease-in-out infinite alternate; box-shadow: 0 0 10px var(--accent-color); }
.live-session-text { display: flex; flex-direction: column; gap: 0.1rem; flex: 1; min-width: 200px; }
.live-session-text strong { color: var(--accent-color); font-size: 1.05rem; letter-spacing: 0.02em; }
.live-session-text span { color: var(--text-color); font-size: 0.9rem; }
.live-session-link { color: var(--accent-color); font-weight: 700; font-size: 0.85rem; white-space: nowrap; }
.live-session-link:hover { text-decoration: underline; }

/* ─── PÁGINA DE BÚSQUEDA ─────────────────────────────────────────── */
.search-main-card { padding: 1.75rem; }

.search-input-wrapper {
    position: relative;
    margin-bottom: 1.25rem;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    pointer-events: none;
}

.search-input-big {
    width: 100%;
    padding: 1rem 1rem 1rem 2.8rem;
    border: 2px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    background: rgba(255,255,255,0.04);
    color: #fff;
    font-size: 1.05rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input-big:focus {
    outline: none;
    border-color: var(--accent-strong);
    box-shadow: 0 0 0 4px rgba(225,6,0,0.16);
}

.search-input-big::placeholder { color: rgba(255,255,255,0.35); }

.quick-access-card { padding: 1.5rem; }
.quick-access-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 0.75rem; }
.qa-item {
    padding: 0.85rem 1rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    color: var(--accent-strong);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    transition: background 0.2s;
}
.qa-item:hover { background: rgba(255,255,255,0.08); }

/* ─── CANALES FOX SPORTS ─────────────────────────────────────────── */
.fox-channels {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
}

.fox-channels-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    margin-bottom: 0.75rem;
}

.fox-channels-grid {
    display: grid;
    gap: 0.5rem;
}

.fox-op {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.45rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 0.83rem;
}

.fox-op:last-child { border-bottom: none; }

.fox-op-name {
    font-weight: 700;
    color: #fff;
    min-width: 130px;
    flex-shrink: 0;
}

.fox-op-ch { color: var(--muted); }

/* ─── FOOTER LEGAL ───────────────────────────────────────────────── */
.site-footer {
    margin-top: 3rem;
    padding: 1.5rem 5%;
    border-top: 1px solid rgba(255,255,255,0.07);
    text-align: center;
}

.site-footer p {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.3);
    line-height: 1.6;
    max-width: 760px;
    margin: 0 auto;
}

/* ─── RESPONSIVE ADICIONAL ───────────────────────────────────────── */
@media (max-width: 760px) {
    .quick-links-grid { grid-template-columns: 1fr; }
    .leaders-grid { grid-template-columns: 1fr; }
    .quick-access-grid { grid-template-columns: 1fr; }
    .colapinto-card { flex-direction: column; text-align: center; }
    .fox-op { flex-direction: column; gap: 0.2rem; }
    .fox-op-name { min-width: unset; }
}

/* ─── FOTO Y BANDERA EN DETALLE DE PILOTO ────────────────────────────────────── */
.detail-flag-img {
    width: 20px;
    height: 14px;
    object-fit: cover;
    border-radius: 2px;
    vertical-align: middle;
    margin-right: 0.3rem;
}

.driver-hero {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}

.driver-photo {
    width: 160px;
    height: auto;
    border-radius: 14px;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.08);
}

.driver-hero-info {
    display: grid;
    gap: 0.75rem;
    flex: 1;
}

.detail-team-logo {
    width: 90px;
    height: 36px;
    object-fit: contain;
    border-radius: 6px;
    background: rgba(255,255,255,0.04);
    padding: 0.25rem 0.5rem;
}

/* ─── TARJETAS DE PILOTOS EN DETALLE DE EQUIPO ───────────────────────────────── */
.team-drivers-grid {
    display: grid;
    gap: 1rem;
}

.team-driver-card {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    padding: 0.75rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
}

.driver-card-photo {
    width: 64px;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.team-driver-info {
    flex: 1;
    display: grid;
    gap: 0.4rem;
}

.team-driver-name {
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.team-driver-name a {
    text-decoration: none;
    font-weight: 700;
}

.team-driver-name a:hover { text-decoration: underline; }

.driver-bar-track {
    height: 5px;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    overflow: hidden;
}

.driver-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.8s ease;
}

.team-driver-pts {
    font-size: 0.82rem;
    color: var(--muted);
}

.team-driver-pts strong { color: #fff; }

/* ─── RESPONSIVE FOTO PILOTO ─────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .driver-hero { flex-direction: column; }
    .driver-photo { width: 100%; max-width: 280px; }
}

/* ─── FAVICON SVG (inline data URI approach via meta) ───────────────────────── */

/* ─── COUNTDOWN SPRINT BADGE ─────────────────────────────────────────────────── */
.cd-sprint-badge {
    display: inline-block;
    background: rgba(255, 165, 0, 0.15);
    border: 1px solid rgba(255, 165, 0, 0.4);
    color: #ffaa00;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 0.2rem 0.75rem;
    border-radius: 999px;
    text-transform: uppercase;
    margin: 0 auto;
    display: block;
    width: fit-content;
}
.cd-next-sprint {
    font-size: 0.78rem;
    color: var(--muted);
    display: block;
    text-align: center;
}

/* ─── DRIVER PHOTO BORDER WITH TEAM COLOR ────────────────────────────────────── */
.driver-card-photo {
    border: 3px solid var(--photo-border-color, #333);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.5), 0 6px 18px rgba(0,0,0,0.4);
}

/* ─── STANDINGS MOBILE FIX ───────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .standings {
        font-size: 0.78rem;
    }
    .standings th,
    .standings td {
        padding: 0.5rem 0.4rem;
    }
    .standings th:last-child,
    .standings td:last-child {
        display: none;
    }
    .team-chip {
        flex-wrap: nowrap;
        max-width: 100px;
        overflow: hidden;
        font-size: 0.72rem;
    }
    .team-chip span:last-child {
        display: none;
    }
    .standings-card {
        overflow-x: auto;
    }
}

/* ─── CALENDAR SESSIONS COLLAPSIBLE ─────────────────────────────────────────── */
.sessions-toggle {
    background: none;
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--muted);
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s;
}
.sessions-toggle:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text-color);
}
.sessions-detail {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease;
}
.sessions-detail.open {
    max-height: 300px;
}
.sessions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.4rem;
    padding: 0.6rem 0 0.2rem;
}
.session-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 8px;
    padding: 0.35rem 0.6rem;
    font-size: 0.78rem;
}
.session-item strong {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent-color);
}

/* ─── COMPARE PAGE ───────────────────────────────────────────────────────────── */
.compare-selector-card { padding: 1.75rem; }
.compare-selectors {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1.25rem;
}
.compare-selector-wrap { display: grid; gap: 0.4rem; }
.compare-selector-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-color);
}
.compare-select {
    width: 100%;
    background: var(--surface-strong);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.65rem 0.9rem;
    border-radius: 10px;
    font-size: 0.9rem;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.2s;
}
.compare-select:focus {
    outline: none;
    border-color: var(--accent-color);
}
.compare-vs {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--accent-color);
    padding-bottom: 0.5rem;
    align-self: end;
    text-align: center;
}
/* Botones genéricos usados en páginas públicas (predictor, trivia, etc.) */
.btn-primary {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}
.btn-primary:hover { background: #ff4444; transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; cursor: default; transform: none; }

.btn-secondary {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: rgba(255,255,255,0.06);
    color: var(--text-color);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-secondary:hover { background: rgba(255,255,255,0.12); }
[data-theme="light"] .btn-secondary { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.15); }
[data-theme="light"] .btn-secondary:hover { background: rgba(0,0,0,0.08); }

.compare-btn {
    display: block;
    width: 100%;
    padding: 0.75rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}
.compare-btn:hover { background: #ff4444; transform: translateY(-1px); }
.compare-result-hidden { display: none; }
.compare-result-visible { display: grid; gap: 1.5rem; }
.compare-same-warning { padding: 1.5rem; color: var(--muted); }

.cmp-headers {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: center;
}
.cmp-header-a, .cmp-header-b {
    padding: 1.25rem;
    text-align: center;
}
.cmp-hname { font-size: 1.1rem; font-weight: 800; margin: 0.4rem 0 0.2rem; }
.cmp-hteam { font-size: 0.85rem; color: var(--muted); }
.cmp-hpts { font-size: 0.9rem; font-weight: 700; margin-top: 0.25rem; }
.cmp-vs-badge {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--accent-color);
    text-align: center;
}

.cmp-stats-card { padding: 1.5rem; }
.cmp-stats-grid { display: grid; gap: 0.85rem; margin-top: 1rem; }
.cmp-stat-row {
    display: grid;
    grid-template-columns: 1fr 120px 1fr;
    gap: 0.6rem;
    align-items: center;
}
.cmp-stat-label {
    text-align: center;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}
.cmp-stat-a, .cmp-stat-b {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.cmp-stat-b { flex-direction: row-reverse; }
.cmp-val {
    font-weight: 800;
    font-size: 1rem;
    min-width: 2.5rem;
    text-align: center;
}
.cmp-bar-track {
    flex: 1;
    height: 6px;
    background: rgba(255,255,255,0.07);
    border-radius: 999px;
    overflow: hidden;
}
.cmp-bar-fill {
    height: 100%;
    border-radius: 999px;
    transform-origin: left;
    transition: width 0.5s ease;
}
.cmp-bar-fill-right {
    float: right;
}
.cmp-stat-winner .cmp-val {
    text-shadow: 0 0 12px currentColor;
}

.cmp-chart-wrap { padding: 0.5rem 0; }
.cmp-chart-legend {
    display: flex;
    gap: 1.25rem;
    font-size: 0.82rem;
    color: var(--muted);
    margin-bottom: 0.5rem;
}
.cmp-legend-dot {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}
.cmp-chart-svg { width: 100%; }

.cmp-race-card { padding: 1.5rem; }
.cmp-race-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.cmp-race-table th {
    padding: 0.5rem;
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}
.cmp-race-table th:nth-child(2) { text-align: center; color: var(--muted); }
.cmp-race-table td { padding: 0.5rem 0.4rem; border-bottom: 1px solid rgba(255,255,255,0.04); }
.cmp-race-name { text-align: center; color: var(--muted); }
.cmp-race-cell { text-align: center; font-weight: 700; }
.cmp-race-winner {
    background: rgba(255,255,255,0.04);
    border-radius: 6px;
}
.cmp-race-pts {
    font-size: 0.72rem;
    color: #6eff99;
    font-weight: 700;
    margin-left: 2px;
}

@media (max-width: 640px) {
    .compare-selectors { grid-template-columns: 1fr; }
    .compare-vs { padding: 0; }
    .cmp-headers { grid-template-columns: 1fr; }
    .cmp-vs-badge { display: none; }
    .cmp-stat-row { grid-template-columns: 1fr 90px 1fr; }
}

/* ─── CIRCUITS PAGE ──────────────────────────────────────────────────────────── */
.circuits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}
.circuit-card { padding: 1.5rem; }
.circuit-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}
.circuit-country {
    font-size: 0.78rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    margin-bottom: 0.3rem;
}
.circuit-name {
    font-size: 1rem;
    font-weight: 800;
    margin: 0;
    color: white;
    line-height: 1.3;
}
.circuit-year {
    font-size: 0.75rem;
    color: var(--accent-color);
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}
.circuit-layout-wrap {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 1rem;
    margin: 0 0 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 130px;
}
.circuit-svg {
    width: 100%;
    max-height: 130px;
}
.circuit-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}
.circuit-stat {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    padding: 0.5rem;
    text-align: center;
}
.cs-val {
    display: block;
    font-weight: 800;
    font-size: 0.95rem;
    color: white;
}
.cs-label {
    display: block;
    font-size: 0.68rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 0.1rem;
}
.circuit-record-holder {
    font-size: 0.78rem;
    color: var(--muted);
    text-align: center;
    margin-bottom: 0.75rem;
}
.circuit-desc {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 0;
    line-height: 1.5;
}

/* ─── TEAM COLOR PHOTO BORDERS ───────────────────────────────────────────────── */
.team-driver-card .driver-card-photo {
    border-radius: 10px;
    width: 54px;
    height: 54px;
    object-fit: cover;
    flex-shrink: 0;
}

/* ─── QUICK LINK CARD FOR COMPARE/CIRCUITS ───────────────────────────────────── */
.quick-link-card.compare-card .ql-icon { font-size: 1.6rem; }


/* ─── LOGO HERO ──────────────────────────────────────────────────────────────── */
.hero-logo-wrap {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.25rem;
}
.hero-logo-img {
    width: 54px;
    height: 54px;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid rgba(255,255,255,0.15);
    flex-shrink: 0;
}
.hero-logo-wrap h1 {
    margin: 0;
}

/* ─── FOOTER MEJORADO ────────────────────────────────────────────────────────── */
.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    text-align: center;
    padding: 0.5rem 0;
}
.footer-logo-wrap {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.footer-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.15);
}
.footer-brand {
    font-weight: 800;
    font-size: 1rem;
    color: white;
    letter-spacing: 0.04em;
}
.footer-credit {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 0;
}
.footer-credit a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 700;
}
.footer-credit a:hover {
    text-decoration: underline;
}
.footer-disclaimer {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.28);
    margin: 0;
    max-width: 600px;
    line-height: 1.5;
}

/* ─── CIRCUIT SVG UPDATES (real track files) ─────────────────────────────────── */
.circuit-svg-loading {
    width: 100%;
    height: 120px;
    background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.07) 50%, rgba(255,255,255,0.03) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 8px;
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.circuit-svg {
    width: 100%;
    max-height: 140px;
    display: block;
}
.circuit-no-svg {
    color: var(--muted);
    font-size: 0.78rem;
    text-align: center;
    padding: 2rem 0;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   BLOQUE 1 — GLOSARIO, ROOKIES, ESTE DÍA
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ─── GLOSARIO ─────────────────────────────────────────────────────────────── */
.glossary-search-card { padding: 1.25rem; }
.glossary-search-input {
    width: 100%; box-sizing: border-box;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    color: white; padding: 0.75rem 1rem;
    border-radius: 12px; font-size: 1rem;
    transition: border-color 0.2s;
}
.glossary-search-input:focus { outline: none; border-color: var(--accent-color); }
.glossary-cats {
    display: flex; gap: 0.5rem; flex-wrap: wrap;
    margin-bottom: 1rem;
}
.glossary-cat-btn {
    padding: 0.35rem 0.9rem; border-radius: 999px;
    font-size: 0.78rem; font-weight: 700; cursor: pointer;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04); color: var(--muted);
    transition: all 0.2s;
}
.glossary-cat-btn.active,
.glossary-cat-btn:hover { background: var(--accent-color); color: white; border-color: var(--accent-color); }
.glossary-list { display: grid; gap: 1.5rem; }
.glossary-cat-section {}
.glossary-cat-title {
    font-size: 0.72rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: 0.12em; color: var(--muted);
    margin: 0 0 0.75rem; padding-left: 0.25rem;
}
.glossary-cat-items { display: grid; gap: 0.75rem; }
.glossary-item { padding: 1.1rem 1.25rem; }
.glossary-item-header {
    display: flex; justify-content: space-between;
    align-items: flex-start; margin-bottom: 0.5rem; gap: 0.75rem;
}
.glossary-term { font-size: 1rem; font-weight: 900; color: white; }
.glossary-full { font-size: 0.82rem; color: var(--muted); font-weight: 400; margin-left: 0.3rem; }
.glossary-tag {
    font-size: 0.68rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: 0.08em; padding: 0.2rem 0.6rem;
    border-radius: 999px; white-space: nowrap; flex-shrink: 0;
}
.tag-new { background: rgba(0,210,190,0.12); border: 1px solid rgba(0,210,190,0.3); color: #00D2BE; }
.tag-eliminated { background: rgba(255,80,80,0.1); border: 1px solid rgba(255,80,80,0.25); color: #ff6b6b; }
.glossary-def { font-size: 0.88rem; color: var(--muted); margin: 0; line-height: 1.65; }
.glossary-empty { padding: 2rem; text-align: center; color: var(--muted); }

/* ─── ROOKIES ──────────────────────────────────────────────────────────────── */
.rookies-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.rookie-card { padding: 1.4rem; display: grid; gap: 0.85rem; }
.rookie-header { display: flex; align-items: center; gap: 0.75rem; }
.rookie-name { font-size: 1.1rem; font-weight: 900; margin: 0 0 0.15rem; }
.rookie-team { font-size: 0.8rem; color: var(--muted); }
.rookie-pos { margin-left: auto; font-size: 1.4rem; font-weight: 900; color: rgba(255,255,255,0.15); }
.rookie-highlight {
    background: rgba(255,215,0,0.07); border: 1px solid rgba(255,215,0,0.2);
    border-radius: 8px; padding: 0.5rem 0.75rem;
    font-size: 0.8rem; color: #ffd700;
}
.rookie-stats-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 0.4rem; }
.rookie-stat { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07); border-radius: 8px; padding: 0.45rem; text-align: center; }
.rs-val { display: block; font-size: 1.1rem; font-weight: 900; }
.rs-label { display: block; font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); margin-top: 0.1rem; }
.rookie-sparkline-wrap { padding: 0.25rem 0; }
.rookie-sparkline { width: 100%; display: block; }
.rookie-extra { display: grid; gap: 0.35rem; }
.rookie-info-row { display: flex; gap: 0.5rem; font-size: 0.82rem; color: var(--muted); align-items: center; }
.rookie-quote { border-left: 3px solid var(--accent-color); margin: 0.25rem 0 0; padding: 0.4rem 0.75rem; font-size: 0.82rem; color: var(--muted); font-style: italic; }
.rookie-detail-link { font-size: 0.82rem; font-weight: 700; text-decoration: none; }
.rookie-detail-link:hover { text-decoration: underline; }
.rookies-compare-card { padding: 1.5rem; }
.rookies-compare-card h2 { margin: 0 0 0.25rem; }
.rookies-compare-sub { font-size: 0.85rem; color: var(--muted); margin: 0 0 1rem; }

/* ─── ESTE DÍA ─────────────────────────────────────────────────────────────── */
.today-main-card { padding: 2rem; }
.today-loading { color: var(--muted); text-align: center; padding: 2rem 0; }
.today-cat-label { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 0.5rem; }
.today-year { font-size: 3.5rem; font-weight: 900; color: rgba(255,255,255,0.08); margin: -0.5rem 0 0.25rem; line-height: 1; }
.today-title { font-size: 1.4rem; font-weight: 900; margin: 0 0 0.75rem; }
.today-desc { font-size: 0.92rem; color: var(--muted); margin: 0; line-height: 1.7; }
.today-empty { text-align: center; padding: 2.5rem 0; color: var(--muted); }
.today-empty h3 { color: white; margin: 0 0 0.5rem; }
.today-more-grid { display: grid; gap: 0.75rem; margin-bottom: 1rem; }
.today-more-title { font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin: 0.5rem 0; }
.today-more-card { padding: 1rem 1.25rem; }
.today-more-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.35rem; }
.today-more-year { font-size: 1.1rem; font-weight: 900; color: rgba(255,255,255,0.15); }
.today-more-fact-title { font-size: 0.92rem; display: block; margin-bottom: 0.3rem; }
.today-more-desc { font-size: 0.82rem; color: var(--muted); margin: 0; line-height: 1.6; }
.today-nav-card { padding: 1rem 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.today-nav-btn { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); color: white; padding: 0.55rem 1.1rem; border-radius: 10px; cursor: pointer; font-size: 0.88rem; font-weight: 700; transition: background 0.2s; }
.today-nav-btn:hover { background: rgba(255,255,255,0.12); }
.today-nav-label { font-size: 0.9rem; color: var(--muted); font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════════════════════
   BLOQUE 2 — ESTADÍSTICAS Y TIMELINE
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ─── STATS GENERAL ──────────────────────────────────────────────────────────── */
.stats-section { margin-bottom: 2rem; }
.stats-section-title {
    font-size: 1rem; font-weight: 800; margin: 0 0 0.9rem;
    display: flex; align-items: center; gap: 0.5rem;
}

/* ─── RÉCORDS ────────────────────────────────────────────────────────────────── */
.records-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}
.record-card { padding: 1.1rem 1.25rem; }
.record-label {
    font-size: 0.7rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: 0.1em; color: var(--muted); margin-bottom: 0.4rem;
}
.record-value { font-size: 1.5rem; font-weight: 900; line-height: 1.1; }
.record-holder { font-size: 0.88rem; font-weight: 700; margin-top: 0.2rem; }
.record-sub { font-size: 0.75rem; color: var(--muted); margin-top: 0.15rem; }

/* ─── BARRAS ─────────────────────────────────────────────────────────────────── */
.stats-bar-card { padding: 1.25rem; }
.stats-bars { display: grid; gap: 0.7rem; }
.stats-bar-row { display: grid; grid-template-columns: 140px 1fr 40px; gap: 0.75rem; align-items: center; }
.stats-bar-name { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; font-weight: 600; }
.stats-bar-track {
    height: 10px; background: rgba(255,255,255,0.06);
    border-radius: 999px; overflow: hidden;
}
.stats-bar-fill { height: 100%; border-radius: 999px; transition: width 0.6s ease; }
.stats-bar-val { font-weight: 800; font-size: 0.9rem; text-align: right; }

/* ─── MATRIZ DE RESULTADOS ───────────────────────────────────────────────────── */
.matrix-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; min-width: 400px; }
.matrix-table th { padding: 0.4rem 0.3rem; color: var(--muted); font-size: 0.7rem; text-align: center; border-bottom: 1px solid var(--border-color); }
.matrix-driver-th { text-align: left; padding-left: 0.5rem; }
.matrix-race-th { min-width: 32px; line-height: 1.3; }
.matrix-total-th { font-weight: 800; color: white; }
.matrix-table td { padding: 0.35rem 0.3rem; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.04); }
.matrix-driver-cell { display: flex; align-items: center; gap: 0.4rem; padding-left: 0.5rem; white-space: nowrap; }
.matrix-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.matrix-cell { font-weight: 700; font-size: 0.82rem; border-radius: 4px; }
.matrix-p1 { background: rgba(255,215,0,0.18); color: #ffd700; }
.matrix-p3 { background: rgba(200,200,200,0.1); color: #ccc; }
.matrix-pts { background: rgba(100,200,100,0.08); color: #6eff99; }
.matrix-nopt { color: var(--muted); }
.matrix-null { color: rgba(255,255,255,0.15); }
.matrix-total { font-weight: 900; font-size: 0.9rem; }

/* ─── HEAD-TO-HEAD ───────────────────────────────────────────────────────────── */
.h2h-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.h2h-card { padding: 1.1rem; }
.h2h-team { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 0.5rem; }
.h2h-names { display: flex; justify-content: space-between; font-size: 1rem; font-weight: 900; margin-bottom: 0.6rem; }
.h2h-vs { color: var(--muted); font-weight: 400; font-size: 0.8rem; }
.h2h-bar-wrap { display: flex; height: 8px; border-radius: 999px; overflow: hidden; margin-bottom: 0.5rem; background: rgba(255,255,255,0.06); }
.h2h-bar-a, .h2h-bar-b { height: 100%; transition: width 0.5s ease; }
.h2h-scores { display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; }
.h2h-score { font-weight: 900; font-size: 1.1rem; }
.h2h-winner { font-size: 1.3rem; }
.h2h-score-label { font-size: 0.72rem; color: var(--muted); }
.h2h-pts-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; font-weight: 700; margin-top: 0.4rem; }

/* ─── NACIONALIDADES ─────────────────────────────────────────────────────────── */
.stats-nat-card { padding: 1.25rem; display: grid; gap: 0.6rem; }
.nat-row { display: grid; grid-template-columns: 24px 110px 1fr 80px; gap: 0.6rem; align-items: center; font-size: 0.85rem; }
.nat-flag { width: 22px; height: 15px; object-fit: cover; border-radius: 2px; }
.nat-name { font-weight: 600; }
.nat-bar-track { height: 6px; background: rgba(255,255,255,0.06); border-radius: 999px; overflow: hidden; }
.nat-bar { height: 100%; background: var(--accent-color); border-radius: 999px; }
.nat-count { font-size: 0.78rem; color: var(--muted); text-align: right; }

/* ─── TIMELINE ───────────────────────────────────────────────────────────────── */
.timeline-races-grid { display: grid; gap: 0.9rem; margin-top: 1.25rem; }
.tl-legend { display: flex; flex-wrap: wrap; gap: 0.2rem; margin-top: 0.75rem; }
.timeline-race-card { padding: 1rem 1.25rem; }
.tl-race-header { display: grid; grid-template-columns: 44px 1fr auto; gap: 0.75rem; align-items: start; margin-bottom: 0.75rem; }
.tl-round {
    font-size: 1.3rem; font-weight: 900; color: rgba(255,255,255,0.12);
    line-height: 1; padding-top: 0.1rem;
}
.tl-race-name { font-weight: 800; font-size: 0.95rem; margin-bottom: 0.2rem; }
.tl-winner { font-size: 0.8rem; font-weight: 700; }
.tl-leader-wrap { text-align: right; }
.tl-leader-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.tl-leader-name { font-size: 1rem; font-weight: 900; }
.tl-leader-pts { font-size: 0.75rem; color: var(--muted); }
.tl-podium { display: flex; gap: 0.5rem; }
.tl-pos-chip {
    display: flex; align-items: center; gap: 0.3rem;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07);
    border-radius: 8px; padding: 0.3rem 0.6rem; font-size: 0.78rem;
}
.tl-pos-num { color: var(--muted); font-weight: 700; }
.tl-pos-code { font-weight: 900; }
.tl-pos-pts { color: var(--muted); font-size: 0.72rem; }

@media (max-width: 600px) {
    .records-grid { grid-template-columns: repeat(2,1fr); }
    .stats-bar-row { grid-template-columns: 100px 1fr 32px; }
    .nat-row { grid-template-columns: 22px 90px 1fr 60px; }
    .h2h-grid { grid-template-columns: 1fr; }
    .tl-race-header { grid-template-columns: 32px 1fr auto; }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   BLOQUE 3 — PREDICTOR, TRIVIA, ICS, BUSCADOR GLOBAL
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ─── PREDICTOR ──────────────────────────────────────────────────────────────── */
.pred-form-card { padding: 1.5rem; }
.pred-race-title { font-size: 1.2rem; font-weight: 900; margin: 0 0 0.2rem; }
.pred-race-sub { font-size: 0.82rem; color: var(--muted); margin: 0 0 1.25rem; }
.pred-podium-inputs { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; }
.pred-pos-group { display: grid; gap: 0.4rem; }
.pred-pos-medal { font-size: 1.6rem; text-align: center; }
.pred-pos-label { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); text-align: center; }
.pred-select {
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12);
    color: white; padding: 0.55rem 0.5rem; border-radius: 10px;
    font-size: 0.78rem; width: 100%; cursor: pointer; appearance: none;
    transition: border-color 0.2s;
}
.pred-select:focus { outline: none; border-color: var(--accent-color); }
.pred-select option { background: #1a1a2e; }
.pred-saved-msg { background: rgba(110,255,153,0.08); border: 1px solid rgba(110,255,153,0.25); color: #6eff99; border-radius: 10px; padding: 0.65rem 1rem; font-size: 0.88rem; font-weight: 700; margin-top: 0.75rem; }
.pred-score-summary { padding: 1.5rem; text-align: center; }
.pred-score-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 0.4rem; }
.pred-score-value { font-size: 2.5rem; font-weight: 900; margin-bottom: 0.6rem; }
.pred-score-bar-track { height: 8px; background: rgba(255,255,255,0.06); border-radius: 999px; overflow: hidden; max-width: 300px; margin: 0 auto; }
.pred-score-bar { height: 100%; border-radius: 999px; transition: width 0.6s ease; }
.pred-accuracy-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--border-color); }
.pred-accuracy-num { font-size: 1.4rem; font-weight: 900; color: var(--text-color); }
.pred-accuracy-label { font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 0.2rem; line-height: 1.3; }
@media (max-width: 600px) { .pred-accuracy-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; } }
.pred-history-grid { display: grid; gap: 0.85rem; }
.pred-hist-card { padding: 1rem 1.25rem; }
.pred-hist-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.pred-hist-race { font-weight: 700; font-size: 0.92rem; }
.pred-hist-score { font-weight: 900; font-size: 0.88rem; }
.pred-hist-compare { display: grid; grid-template-columns: 1fr 1px 1fr; gap: 1rem; }
.pred-hist-col-title { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 0.5rem; font-weight: 700; }
.pred-hist-row { display: flex; gap: 0.5rem; align-items: center; padding: 0.2rem 0; }
.pred-hist-pos { font-size: 1rem; }
.pred-hist-name { font-size: 0.82rem; font-weight: 600; }
.pred-hist-divider { background: rgba(255,255,255,0.08); }
@media (max-width: 480px) {
    .pred-podium-inputs { grid-template-columns: 1fr; }
    .pred-hist-compare { grid-template-columns: 1fr; }
    .pred-hist-divider { display: none; }
}

/* ─── TRIVIA ─────────────────────────────────────────────────────────────────── */
.trivia-progress-card { padding: 1rem 1.25rem; }
.trivia-progress-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.6rem; }
.trivia-cat-tag { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; background: rgba(255,255,255,0.07); border-radius: 999px; padding: 0.2rem 0.65rem; color: var(--muted); }
.trivia-counter { font-size: 0.82rem; color: var(--muted); font-weight: 600; }
.trivia-score-live { font-size: 0.88rem; font-weight: 800; color: #ffcc00; }
.trivia-progress-bar-track { height: 5px; background: rgba(255,255,255,0.06); border-radius: 999px; overflow: hidden; }
.trivia-progress-bar { height: 100%; background: var(--accent-color); border-radius: 999px; transition: width 0.4s ease; }
.trivia-question-card { padding: 1.5rem; }
.trivia-question { font-size: 1.1rem; font-weight: 800; margin: 0 0 1.25rem; line-height: 1.45; }
.trivia-options { display: grid; gap: 0.65rem; }
.trivia-opt-btn {
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
    color: white; padding: 0.85rem 1rem; border-radius: 12px;
    font-size: 0.9rem; text-align: left; cursor: pointer; transition: all 0.15s;
    font-weight: 600;
}
.trivia-opt-btn:hover:not(:disabled) { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.25); }
.trivia-opt-btn:disabled { cursor: default; }
.trivia-opt-btn.trivia-correct { background: rgba(110,255,153,0.12); border-color: rgba(110,255,153,0.4); color: #6eff99; }
.trivia-opt-btn.trivia-wrong { background: rgba(255,80,80,0.1); border-color: rgba(255,80,80,0.3); color: #ff6b6b; }
.trivia-feedback { margin-top: 0.85rem; padding: 0.65rem 1rem; border-radius: 10px; font-size: 0.88rem; font-weight: 700; }
.trivia-fb-correct { color: #6eff99; }
.trivia-fb-wrong { color: #ff6b6b; }
.trivia-next-btn { margin-top: 1rem; width: 100%; }
.trivia-results-card { padding: 2rem; text-align: center; }
.trivia-result-emoji { font-size: 3rem; margin-bottom: 0.5rem; }
.trivia-result-title { font-size: 1.4rem; font-weight: 900; margin: 0 0 0.5rem; }
.trivia-result-score { font-size: 3rem; font-weight: 900; line-height: 1; }
.trivia-result-pct { font-size: 1rem; font-weight: 700; margin: 0.4rem 0 0.75rem; }
.trivia-result-bar-track { height: 8px; background: rgba(255,255,255,0.06); border-radius: 999px; overflow: hidden; max-width: 260px; margin: 0 auto; }
.trivia-result-bar { height: 100%; border-radius: 999px; transition: width 0.6s ease; }
.trivia-review-card { padding: 1.25rem; }
.trivia-review-item { padding: 0.6rem 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.trivia-review-item:last-child { border-bottom: none; }
.review-q { font-size: 0.82rem; font-weight: 700; margin-bottom: 0.2rem; color: var(--muted); }
.review-a { font-size: 0.88rem; font-weight: 600; }

/* ─── ICS BUTTON ─────────────────────────────────────────────────────────────── */
.btn-ics {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.15);
    color: white; padding: 0.55rem 1.1rem; border-radius: 10px;
    font-size: 0.85rem; font-weight: 700; cursor: pointer;
    transition: background 0.2s; margin-top: 0.75rem;
}
.btn-ics:hover { background: rgba(255,255,255,0.12); }

/* ─── BUSCADOR GLOBAL Ctrl+K ─────────────────────────────────────────────────── */
.gs-modal {
    position: fixed; inset: 0; z-index: 9999;
    display: none; align-items: flex-start; justify-content: center;
    padding-top: clamp(60px, 12vh, 140px);
}
.gs-modal.gs-open { display: flex; }

.gs-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.gs-dialog {
    position: relative; z-index: 1;
    width: 100%; max-width: 560px;
    background: #1a1a2a;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.6);
    overflow: hidden;
    margin: 0 1rem;
}
.gs-input-wrap {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.gs-icon { font-size: 1.1rem; flex-shrink: 0; }
.gs-input {
    flex: 1; background: none; border: none; color: white;
    font-size: 1rem; outline: none; min-width: 0;
}
.gs-input::placeholder { color: rgba(255,255,255,0.3); }
.gs-esc-hint {
    background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.12);
    border-radius: 5px; padding: 0.15rem 0.45rem; font-size: 0.72rem;
    color: var(--muted); flex-shrink: 0;
}
.gs-results { max-height: 360px; overflow-y: auto; }
.gs-result-item {
    display: flex; align-items: center; gap: 0.85rem;
    padding: 0.75rem 1.1rem; text-decoration: none;
    transition: background 0.1s; cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.gs-result-item:last-child { border-bottom: none; }
.gs-result-item:hover, .gs-result-item.gs-selected { background: rgba(255,255,255,0.07); }
.gs-result-icon { font-size: 1rem; flex-shrink: 0; width: 22px; text-align: center; }
.gs-result-info { flex: 1; min-width: 0; display: grid; gap: 0.1rem; }
.gs-result-title { font-size: 0.92rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-result-sub { font-size: 0.75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-result-type { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); background: rgba(255,255,255,0.06); border-radius: 5px; padding: 0.15rem 0.5rem; flex-shrink: 0; }
.gs-empty { padding: 1.5rem; text-align: center; color: var(--muted); font-size: 0.88rem; }
.gs-footer {
    display: flex; gap: 1rem; padding: 0.6rem 1.1rem;
    border-top: 1px solid rgba(255,255,255,0.07);
    font-size: 0.72rem; color: rgba(255,255,255,0.3);
}
.gs-footer kbd {
    background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.12);
    border-radius: 4px; padding: 0.1rem 0.35rem; font-size: 0.68rem;
    font-family: inherit;
}

/* Trigger hint badge */
.gs-trigger-hint {
    position: fixed; bottom: 1.5rem; right: 1.5rem;
    background: rgba(30,30,50,0.95); border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px; padding: 0.45rem 0.85rem;
    display: flex; gap: 0.3rem; align-items: center;
    font-size: 0.75rem; color: var(--muted);
    cursor: pointer; z-index: 100;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    transition: background 0.2s;
}
.gs-trigger-hint:hover { background: rgba(50,50,80,0.98); }
.gs-trigger-hint kbd {
    background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15);
    border-radius: 4px; padding: 0.1rem 0.4rem;
    font-family: inherit; font-size: 0.72rem; color: white;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   BLOQUE 4 — TEMA CLARO/OSCURO, SCROLL ANIM, SWIPE, PWA, SHARE
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ─── MODO CLARO ─────────────────────────────────────────────────────────────── */
[data-theme="light"] {
    --bg-color: #f0f0f5;
    --surface-color: #ffffff;
    --surface-strong: #e8e8f0;
    --text-color: #111122;
    --muted: #555577;
    --border-color: rgba(0,0,0,0.10);
    --accent-color: #E10600;
}
[data-theme="light"] body { background: var(--bg-color); color: var(--text-color); }
[data-theme="light"] .card {
    background: var(--surface-color);
    border-color: rgba(0,0,0,0.08);
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}
[data-theme="light"] .standings th,
[data-theme="light"] .matrix-table th { color: #444; }
[data-theme="light"] .gs-dialog { background: #ffffff; border-color: rgba(0,0,0,0.12); }
[data-theme="light"] .gs-backdrop { background: rgba(0,0,0,0.4); }
[data-theme="light"] .gs-input { color: #111; }
[data-theme="light"] .gs-result-item:hover,
[data-theme="light"] .gs-result-item.gs-selected { background: rgba(0,0,0,0.05); }
[data-theme="light"] .hero-links { background: rgba(0,0,0,0.04); }
[data-theme="light"] .hero-link { color: #333; }
[data-theme="light"] .hero-link:hover { background: rgba(0,0,0,0.08); color: #111; }
[data-theme="light"] input, [data-theme="light"] select, [data-theme="light"] textarea {
    background: rgba(0,0,0,0.04) !important;
    border-color: rgba(0,0,0,0.15) !important;
    color: #111 !important;
}
[data-theme="light"] .glossary-item { background: #fafafa; }
[data-theme="light"] .swipe-btn { background: rgba(0,0,0,0.06); color: #333; border-color: rgba(0,0,0,0.12); }
[data-theme="light"] .trivia-opt-btn { background: rgba(0,0,0,0.03); color: #111122; border-color: rgba(0,0,0,0.12); }
[data-theme="light"] .trivia-opt-btn:hover:not(:disabled) { background: rgba(0,0,0,0.06); border-color: rgba(0,0,0,0.25); }
[data-theme="light"] .today-nav-btn { background: rgba(0,0,0,0.04); color: #111122; border-color: rgba(0,0,0,0.12); }
[data-theme="light"] .today-nav-btn:hover { background: rgba(0,0,0,0.08); }
[data-theme="light"] .glossary-cat-btn { border-color: rgba(0,0,0,0.12); background: rgba(0,0,0,0.03); }
[data-theme="light"] .pwa-dismiss-btn { border-color: rgba(0,0,0,0.15); }
[data-theme="light"] .pwa-dismiss-btn:hover { background: rgba(0,0,0,0.06); }
[data-theme="light"] .cal-filter-btn { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.12); }
[data-theme="light"] .pwa-banner { background: #ffffff; border-color: rgba(0,0,0,0.12); }

/* ─── THEME TOGGLE BUTTON ────────────────────────────────────────────────────── */
.theme-toggle-btn {
    position: fixed; top: 1rem; right: 1rem;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    font-size: 1.1rem; cursor: pointer;
    z-index: 500; transition: background 0.2s, transform 0.15s;
    display: flex; align-items: center; justify-content: center;
}
.theme-toggle-btn:hover { background: rgba(255,255,255,0.16); transform: scale(1.1); }
[data-theme="light"] .theme-toggle-btn {
    background: rgba(0,0,0,0.08); border-color: rgba(0,0,0,0.15);
}

/* ─── SCROLL ANIMATIONS ──────────────────────────────────────────────────────── */
.scroll-hidden {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    /* Safety: reveal after 1.5s even if observer fails */
    animation: scroll-fallback 0s 1.5s forwards;
}
@keyframes scroll-fallback {
    to { opacity: 1; transform: translateY(0); }
}
.scroll-visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
    animation: none !important;
}

/* ─── SWIPE NAV ──────────────────────────────────────────────────────────────── */
.swipe-nav {
    display: flex; align-items: center; justify-content: space-between;
    gap: 0.75rem; margin-bottom: 1rem;
}
.swipe-btn {
    display: inline-flex; align-items: center; gap: 0.4rem;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
    color: white; padding: 0.45rem 0.9rem; border-radius: 10px;
    text-decoration: none; font-size: 0.82rem; font-weight: 700;
    transition: background 0.2s; max-width: 45%;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.swipe-btn:hover { background: rgba(255,255,255,0.12); }
.swipe-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.swipe-disabled { opacity: 0.25; cursor: default; background: transparent; border-color: transparent; }
.swipe-counter { font-size: 0.78rem; color: var(--muted); flex-shrink: 0; }

/* ─── SHARE BUTTONS ──────────────────────────────────────────────────────────── */
.share-img-btn {
    display: inline-flex; align-items: center; gap: 0.4rem;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
    color: white; padding: 0.45rem 0.9rem; border-radius: 8px;
    font-size: 0.82rem; font-weight: 700; cursor: pointer;
    transition: background 0.2s; margin-top: 0.75rem;
}
.share-img-btn:hover { background: rgba(255,255,255,0.12); }
[data-theme="light"] .share-img-btn { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.15); color: #111122; }
[data-theme="light"] .share-img-btn:hover { background: rgba(0,0,0,0.08); }

.cmp-share-row { text-align: center; margin-top: 0.5rem; }

.share-fab-btn {
    position: fixed; bottom: 5rem; right: 1.5rem;
    width: 46px; height: 46px; border-radius: 50%;
    background: var(--accent-color); border: none;
    font-size: 1.2rem; cursor: pointer; z-index: 100;
    box-shadow: 0 4px 18px rgba(225,6,0,0.4);
    transition: transform 0.15s, box-shadow 0.15s;
    display: flex; align-items: center; justify-content: center;
}
.share-fab-btn:hover { transform: scale(1.1); box-shadow: 0 6px 24px rgba(225,6,0,0.55); }

/* ─── PWA INSTALL BANNER ─────────────────────────────────────────────────────── */
.pwa-banner {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: #1a1a2e; border-top: 1px solid rgba(255,255,255,0.12);
    padding: 0.9rem 1.25rem;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    z-index: 800; transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
    box-shadow: 0 -8px 32px rgba(0,0,0,0.35);
}
.pwa-banner.pwa-banner-visible { transform: translateY(0); }
.pwa-banner-content { display: flex; align-items: center; gap: 0.9rem; flex: 1; min-width: 0; }
.pwa-banner-icon { width: 42px; height: 42px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.pwa-banner-content strong { display: block; font-size: 0.92rem; font-weight: 800; }
.pwa-banner-content p { font-size: 0.78rem; color: var(--muted); margin: 0.1rem 0 0; }
.pwa-banner-actions { display: flex; gap: 0.5rem; align-items: center; flex-shrink: 0; }
.pwa-install-btn {
    background: var(--accent-color); color: white; border: none;
    padding: 0.55rem 1.1rem; border-radius: 8px;
    font-size: 0.88rem; font-weight: 700; cursor: pointer;
    transition: background 0.2s;
}
.pwa-install-btn:hover { background: #cc0000; }
.pwa-dismiss-btn {
    background: transparent; border: 1px solid rgba(255,255,255,0.15);
    color: var(--muted); width: 34px; height: 34px; border-radius: 50%;
    font-size: 0.9rem; cursor: pointer; transition: background 0.2s;
    display: flex; align-items: center; justify-content: center;
}
.pwa-dismiss-btn:hover { background: rgba(255,255,255,0.08); }

/* ─── NOTIFY BUTTON ──────────────────────────────────────────────────────────── */
.notify-btn-wrap { text-align: center; padding: 0.5rem 0 0; }
.notify-btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12);
    color: white; padding: 0.6rem 1.25rem; border-radius: 999px;
    font-size: 0.85rem; font-weight: 700; cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.notify-btn:hover { background: rgba(255,255,255,0.1); }
.notify-btn.notify-active { border-color: rgba(110,255,153,0.4); color: #6eff99; }
.notify-btn:disabled { opacity: 0.45; cursor: not-allowed; }
