:root {
    --bg: #fff8f8;
    --surface: #ffffff;
    --surface-soft: #fff1f1;
    --text: #241416;
    --muted: #715a5d;
    --primary: #b51f2b;
    --primary-dark: #8d1420;
    --primary-soft: #ffe2e5;
    --border: #f0cfd3;
    --shadow: 0 22px 60px rgba(75, 12, 20, 0.12);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg);
}

a {
    color: inherit;
    text-decoration: none;
}

.hero {
    min-height: 76vh;
    color: #fff;
    background:
        radial-gradient(circle at 15% 20%, rgba(255,255,255,0.22), transparent 24rem),
        linear-gradient(135deg, rgba(125, 13, 24, 0.96), rgba(195, 36, 49, 0.92)),
        url("data:image/svg+xml,%3Csvg width='160' height='160' viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='white' fill-opacity='0.08'%3E%3Cpath d='M80 126S20 92 20 48c0-19 14-34 32-34 11 0 22 7 28 18 6-11 17-18 28-18 18 0 32 15 32 34 0 44-60 78-60 78z'/%3E%3C/g%3E%3C/svg%3E");
    padding-bottom: 4rem;
}

.navbar {
    width: min(1160px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1.25rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    font-weight: 850;
    letter-spacing: -.03em;
    font-size: 1.1rem;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 2.3rem;
    height: 2.3rem;
    border-radius: .9rem;
    color: var(--primary);
    background: #fff;
    box-shadow: 0 12px 32px rgba(0,0,0,.12);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.nav-links a {
    padding: .65rem .9rem;
    border-radius: 999px;
    color: inherit;
    opacity: .92;
}

.nav-links a:hover {
    background: rgba(255,255,255,.14);
}

.hero-content {
    width: min(980px, calc(100% - 2rem));
    margin: 5rem auto 0;
}

.eyebrow {
    margin: 0 0 .7rem;
    color: var(--primary);
    font-weight: 850;
    letter-spacing: .12em;
    text-transform: uppercase;
    font-size: .78rem;
}

.hero .eyebrow {
    color: #ffd9de;
}

h1, h2, h3, p {
    margin-top: 0;
}

h1 {
    max-width: 880px;
    margin-bottom: 1.2rem;
    font-size: clamp(3rem, 7vw, 6.8rem);
    line-height: .92;
    letter-spacing: -.07em;
}

h2 {
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1;
    letter-spacing: -.055em;
    margin-bottom: 1rem;
}

h3 {
    letter-spacing: -.03em;
}

.lead {
    max-width: 660px;
    font-size: clamp(1.1rem, 2.2vw, 1.35rem);
    line-height: 1.65;
    color: rgba(255,255,255,.88);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .85rem;
    margin-top: 2rem;
}

.btn {
    border: 0;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 3rem;
    padding: .85rem 1.15rem;
    border-radius: 999px;
    font-weight: 800;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    color: #fff;
    background: var(--primary);
    box-shadow: 0 16px 35px rgba(181,31,43,.28);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    color: #fff;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.35);
}

.btn-full {
    width: 100%;
}

main {
    width: min(1160px, calc(100% - 2rem));
    margin: 0 auto;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: -4rem;
    position: relative;
    z-index: 2;
}

.stat-card,
.info-panel,
.podium-card,
.filters-card,
.results-card,
.empty-state {
    background: rgba(255,255,255,.94);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.stat-card {
    padding: 1.35rem;
}

.stat-value {
    display: block;
    color: var(--primary);
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: -.05em;
}

.stat-label {
    display: block;
    color: var(--muted);
    font-weight: 650;
}

.section {
    padding: 5rem 0 0;
}

.split {
    display: grid;
    grid-template-columns: 1.25fr .75fr;
    gap: 2rem;
    align-items: center;
}

.split p {
    line-height: 1.8;
    color: var(--muted);
}

.info-panel {
    padding: 1.5rem;
    background: var(--surface);
}

.text-link {
    color: var(--primary);
    font-weight: 850;
}

.section-heading {
    margin-bottom: 1.3rem;
}

.podium {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.podium-card {
    padding: 1.5rem;
    min-height: 210px;
}

.podium-rank {
    display: grid;
    place-items: center;
    width: 3.5rem;
    height: 3.5rem;
    margin-bottom: 1rem;
    color: #fff;
    background: var(--primary);
    border-radius: 1.2rem;
    font-size: 1.6rem;
    font-weight: 950;
}

.podium-card p {
    color: var(--muted);
}

.podium-card strong {
    font-size: 1.4rem;
}

.empty-state {
    padding: 2rem;
    text-align: center;
}

.empty-state p {
    color: var(--muted);
}

.footer {
    width: min(1160px, calc(100% - 2rem));
    margin: 5rem auto 0;
    padding: 2rem 0;
    color: var(--muted);
}

/* Página de resultados */

.compact-header {
    color: #fff;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    padding-bottom: 3rem;
}

.compact-title {
    width: min(1160px, calc(100% - 2rem));
    margin: 2rem auto 0;
}

.compact-title .eyebrow {
    color: #ffd9de;
}

.compact-title h1 {
    margin-bottom: 1rem;
    font-size: clamp(2.6rem, 6vw, 5.4rem);
}

.compact-title p {
    color: rgba(255,255,255,.86);
}

.results-layout {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 1.2rem;
    margin-top: -2rem;
    align-items: start;
}

.filters-card,
.results-card {
    padding: 1.2rem;
}

.filters-card {
    position: sticky;
    top: 1rem;
}

.field {
    display: grid;
    gap: .45rem;
    margin-bottom: 1rem;
}

label {
    font-weight: 800;
    font-size: .92rem;
}

input,
select {
    width: 100%;
    min-height: 2.8rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    color: var(--text);
    padding: .75rem .85rem;
    font: inherit;
}

input:focus,
select:focus {
    outline: 3px solid var(--primary-soft);
    border-color: var(--primary);
}

.results-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.results-toolbar h2 {
    font-size: 1.8rem;
    margin-bottom: 0;
}

.live-pill {
    display: inline-flex;
    padding: .5rem .8rem;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: .85rem;
    font-weight: 850;
    white-space: nowrap;
}

.table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 18px;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 980px;
    background: #fff;
}

.results-table th,
.results-table td {
    padding: .95rem .85rem;
    text-align: left;
    border-bottom: 1px solid #f5e1e4;
    vertical-align: middle;
}

.results-table th {
    color: var(--muted);
    background: #fff7f7;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.results-table tr:last-child td {
    border-bottom: 0;
}

.rank-cell {
    color: var(--primary);
    font-weight: 950;
    font-size: 1.05rem;
}

.muted {
    display: block;
    color: var(--muted);
    font-size: .85rem;
    margin-top: .15rem;
}

.status {
    display: inline-flex;
    padding: .35rem .55rem;
    border-radius: 999px;
    background: #f8eeee;
    color: var(--primary-dark);
    font-size: .78rem;
    font-weight: 850;
}

.hidden {
    display: none;
}

@media (max-width: 860px) {
    .stats-grid,
    .podium,
    .split,
    .results-layout {
        grid-template-columns: 1fr;
    }

    .filters-card {
        position: static;
    }

    .results-toolbar {
        flex-direction: column;
    }

    .hero-content {
        margin-top: 3rem;
    }
}
