:root {
  --bg: #0a0a0b;
  --panel: #141416;
  --panel-2: #1d1d20;
  --line: #2b2b2f;
  --text: #f3f3f3;
  --muted: #9a9a9f;
  --accent: #e10600;
  --accent-2: #ff4d4d;
  --gold: #f2c230;
  --silver: #c3cad5;
  --bronze: #d98a4e;
  --ok: #3fcf8e;
  --radius: 14px;
  --head: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
code { background: var(--panel-2); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
.muted { color: var(--muted); }
.loading { color: var(--muted); padding: 40px 0; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  height: 58px; padding: 0 18px;
  background: rgba(10, 10, 11, .94);
  box-shadow: inset 0 -3px 0 var(--accent);
  border-bottom-color: transparent;
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.menu-btn {
  display: none;
  background: none; border: 0; color: var(--text);
  font-size: 22px; cursor: pointer; padding: 4px 6px;
}
.logo {
  font: 800 26px/1 var(--head);
  letter-spacing: .04em;
}
.logo span { color: var(--accent); font-size: .7em; }
.topnav { margin-left: auto; display: flex; gap: 4px; }
.topnav a {
  padding: 8px 12px; border-radius: 10px;
  color: var(--muted); font-weight: 600; font-size: 14px;
}
.topnav a:hover, .topnav a.active { background: var(--panel-2); color: var(--text); }

/* ---------- Layout ---------- */
.layout {
  flex: 1;
  display: grid;
  grid-template-columns: 270px 1fr;
  max-width: 1320px; width: 100%;
  margin: 0 auto;
}
.main { padding: 28px 32px 60px; min-width: 0; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky; top: 58px;
  height: calc(100vh - 58px);
  overflow-y: auto;
  padding: 22px 14px 40px;
  border-right: 1px solid var(--line);
}
.side-h {
  font: 700 13px/1 var(--head);
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
  margin: 20px 10px 8px;
}
.side-h:first-child { margin-top: 0; }
.side-link {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 9px;
  font-size: 14px; color: #cfcfd4;
}
.side-link:hover { background: var(--panel); color: var(--text); }
.side-link.active { background: var(--panel-2); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.side-link.copa { color: var(--accent-2); font-weight: 600; }
.side-sec { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 10px 10px 2px; }
.side-group { margin-top: 4px; }
.side-group > button {
  width: 100%;
  display: flex; justify-content: space-between; align-items: center;
  background: none; border: 0; color: var(--text);
  font: 700 17px/1 var(--head); letter-spacing: .04em; text-transform: uppercase;
  padding: 10px; border-radius: 9px; cursor: pointer;
}
.side-group > button:hover { background: var(--panel); }
.side-group > button .chev { transition: transform .2s; color: var(--muted); font-size: 12px; }
.side-group.closed > button .chev { transform: rotate(-90deg); }
.side-group.closed .side-items { display: none; }
.side-items { padding-left: 8px; border-left: 1px solid var(--line); margin-left: 14px; }

/* ---------- Headings ---------- */
.tagline {
  font: 700 13px/1 var(--head);
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
h1 {
  font: 800 clamp(38px, 6vw, 64px)/.95 var(--head);
  text-transform: uppercase;
  margin: 0 0 10px;
  letter-spacing: .01em;
}
h2 {
  font: 700 26px/1.1 var(--head);
  text-transform: uppercase;
  margin: 36px 0 14px;
  letter-spacing: .02em;
}
.sub { color: var(--muted); font-size: 16px; max-width: 720px; margin: 0 0 22px; }
.crumb { display: inline-block; color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.crumb:hover { color: var(--text); }

/* ---------- Hero / leader ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(800px 260px at 100% 0%, rgba(225, 6, 0, .38), transparent 60%),
    linear-gradient(180deg, var(--panel), var(--bg));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 30px 30px 26px;
  margin-bottom: 26px;
}
.hero::after {
  content: '';
  position: absolute; right: -40px; bottom: -60px;
  width: 260px; height: 260px;
  border: 22px solid rgba(255, 255, 255, .03);
  border-radius: 50%;
  box-shadow: 0 0 0 40px rgba(255, 255, 255, .015);
}
.leader {
  display: flex; align-items: center; gap: 18px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  max-width: 560px;
  position: relative; z-index: 1;
}
.leader .trophy { font-size: 42px; }
.leader .who { flex: 1; min-width: 0; }
.leader .lbl { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.leader .name { font: 800 28px/1.05 var(--head); text-transform: uppercase; }
.leader .pts { text-align: right; }
.leader .pts b { display: block; font: 800 40px/1 var(--head); color: var(--accent); }
.leader .pts span { font-size: 12px; color: var(--muted); }
.live { display: inline-flex; align-items: center; gap: 6px; }
.live::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(63, 207, 142, .6);
  animation: pulse 1.8s infinite;
}
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(63, 207, 142, 0); } 100% { box-shadow: 0 0 0 0 rgba(63, 207, 142, 0); } }

.note {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 0 0 12px;
  color: #cfcfd4;
  max-width: 860px;
}
.note b { color: var(--text); }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  transition: border-color .15s, transform .15s;
}
a.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card .ic { font-size: 28px; margin-bottom: 6px; }
.card .t { font: 700 22px/1.1 var(--head); text-transform: uppercase; }
.card .s { color: var(--muted); font-size: 13px; margin-top: 4px; }
.card .big { font: 800 34px/1 var(--head); color: var(--accent); margin-top: 8px; }

.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; }

/* ---------- Tabs / chips ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 8px 0 18px; }
.tab {
  background: none; border: 0; color: var(--muted);
  font: 700 18px/1 var(--head); letter-spacing: .04em; text-transform: uppercase;
  padding: 12px 16px; cursor: pointer;
  border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.chip {
  background: var(--panel); color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 12px; font: 600 13px/1 var(--body); cursor: pointer;
}
.chip:hover { color: var(--text); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.pending { border-style: dashed; }

/* ---------- Tables ---------- */
.table-wrap {
  overflow-x: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 12px; text-align: left; white-space: nowrap; }
thead th {
  font: 700 13px/1 var(--head); letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted);
  background: var(--panel-2);
  position: sticky; top: 0;
}
tbody tr { border-top: 1px solid var(--line); }
tbody tr:hover { background: rgba(255, 255, 255, .025); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.total { font: 800 19px/1 var(--head); color: var(--text); }
td.dim { color: #545c6b; }
.pos {
  display: inline-grid; place-items: center;
  width: 28px; height: 28px; border-radius: 8px;
  font: 800 16px/1 var(--head);
  background: var(--panel-2);
}
.pos.p1 { background: var(--gold); color: #1a1400; }
.pos.p2 { background: var(--silver); color: #13161b; }
.pos.p3 { background: var(--bronze); color: #1d0f03; }
.club-cell { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.dot { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.small { font-size: 12px; color: var(--muted); font-weight: 400; }
.rider-link:hover { color: var(--accent); }
.bar { height: 6px; border-radius: 3px; background: var(--accent); opacity: .85; min-width: 2px; }
.bar-cell { width: 22%; min-width: 120px; }

/* ---------- Calendar ---------- */
.fecha-card { display: flex; gap: 16px; align-items: center; }
.fecha-card .day {
  flex: none; width: 64px; text-align: center;
  background: var(--panel-2); border-radius: 12px; padding: 8px 0;
}
.fecha-card .day b { display: block; font: 800 30px/1 var(--head); }
.fecha-card .day span { font-size: 12px; color: var(--muted); text-transform: uppercase; }
.badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  background: var(--panel-2); color: var(--muted);
}
.badge.done { background: rgba(63, 207, 142, .14); color: var(--ok); }
.badge.next { background: rgba(225, 6, 0, .18); color: var(--accent); }

/* ---------- Search ---------- */
.search {
  width: 100%; max-width: 560px;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; font: 16px var(--body);
  outline: none; margin-bottom: 18px;
}
.search:focus { border-color: var(--accent); }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 20px 32px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  font-size: 13px;
}
.backdrop { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .menu-btn { display: block; }
  .sidebar {
    position: fixed; top: 58px; left: 0; z-index: 25;
    width: 290px; background: var(--bg);
    transform: translateX(-100%); transition: transform .25s;
  }
  body.menu-open .sidebar { transform: none; }
  body.menu-open .backdrop {
    display: block; position: fixed; inset: 58px 0 0 0; z-index: 20;
    background: rgba(0, 0, 0, .55);
  }
  .main { padding: 20px 16px 50px; }
  .topnav a span { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
  .hero { padding: 22px 18px; }
  .leader { flex-wrap: wrap; }
  .footer { padding: 18px 16px; }
}

/* ---------- Rojo y negro: detalles ---------- */
.logo { color: #fff; }
.logo span { color: var(--accent); }
.hero { border-color: #3a0d0c; }
.hero::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px;
  background: var(--accent);
}
h1 { text-shadow: 0 2px 0 rgba(225, 6, 0, .35); }
.leader { border-color: #3a0d0c; }
.leader .pts b { color: var(--accent-2); }
thead th { border-bottom: 2px solid var(--accent); }
.bar { background: linear-gradient(90deg, #8f0400, var(--accent)); }
.note a { color: var(--accent-2); }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 13px; }

.chips-grupo { margin-bottom: 4px; }
.chips-h { display: block; font: 700 12px/1 var(--head); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 6px 0 8px; }
.carrera-head { margin: 10px 0 14px; border-left: 4px solid var(--accent); }

.podio ol { list-style: none; padding: 0; margin: 12px 0 0; }
.podio li { display: flex; gap: 8px; align-items: baseline; padding: 4px 0; font-size: 14px; border-top: 1px solid var(--line); }
.podio li:first-child { border-top: 0; font-weight: 700; }
.podio li em { margin-left: auto; color: var(--muted); font-style: normal; font-size: 12px; text-align: right; }

.ganadores { display: flex; flex-direction: column; gap: 8px; }
.ganador {
  display: flex; align-items: center; gap: 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 14px;
}
.ganador:hover { border-color: var(--accent); }
.ganador .ic { font-size: 22px; }
.ganador .who { flex: 1; display: flex; flex-direction: column; }

.fuentes { padding-left: 18px; }
.fuentes li { margin: 6px 0; word-break: break-all; }
.fuentes a { color: var(--accent-2); font-weight: 600; }

.side-group > button .cnt { margin-left: auto; margin-right: 8px; font: 600 12px/1 var(--body); color: var(--muted); background: var(--panel-2); padding: 3px 7px; border-radius: 999px; }
.side-date { display: inline-block; min-width: 46px; font-size: 11px; color: var(--accent-2); font-variant-numeric: tabular-nums; }
