/* Estilos compartidos de las páginas de resultados de carreras (/carreras/...) */
:root {
  --azul: #1a2b4a;
  --rojo: #dc2626;
  --rojo-suave: #fef2f2;
  --crema: #fbf7f2;
  --gris: #6b7280;
  --linea: #ece7e0;
  --oro: #f5b301;
  --plata: #9aa3b2;
  --bronce: #c27a3a;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; background: var(--crema); margin: 0; color: var(--azul); -webkit-text-size-adjust: 100%; }
a { color: inherit; }
.num { font-variant-numeric: tabular-nums; }

/* ---- header (igual que el resto del sitio) ---- */
.header-flotante { max-width: 980px; margin: 16px auto 0; background: white; border-radius: 20px; padding: 14px 20px; box-shadow: 0 4px 16px rgba(0,0,0,.08); display: flex; align-items: center; justify-content: space-between; gap: 12px; width: calc(100% - 32px); flex-wrap: wrap; }
.header-flotante img { height: 56px; display: block; }
.header-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.header-nav a { text-decoration: none; font-weight: 700; font-size: 13px; padding: 8px 14px; border-radius: 20px; background: #f4f6f8; }
.header-nav a:hover { background: var(--rojo-suave); color: var(--rojo); }

/* ---- hero ---- */
.hero { max-width: 980px; margin: 14px auto 0; width: calc(100% - 32px); border-radius: 28px; color: white; text-align: center; padding: 34px 20px 70px; background: radial-gradient(circle at 85% 0%, rgba(255,255,255,.14), transparent 45%), linear-gradient(160deg, var(--azul) 0%, #7a1f3a 55%, var(--rojo) 100%); position: relative; overflow: hidden; }
.hero-logo { width: 84px; height: 84px; border-radius: 50%; background: white; margin: 0 auto 14px; display: flex; align-items: center; justify-content: center; overflow: hidden; box-shadow: 0 6px 20px rgba(0,0,0,.25); font-size: 38px; }
.hero-logo img { width: 100%; height: 100%; object-fit: contain; }
.estado { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; letter-spacing: .12em; padding: 6px 14px; border-radius: 999px; background: rgba(255,255,255,.16); backdrop-filter: blur(4px); }
.estado.en-vivo { background: white; color: var(--rojo); }
.punto-vivo { width: 9px; height: 9px; border-radius: 50%; background: var(--rojo); animation: latido 1.2s infinite; }
@keyframes latido { 0% { box-shadow: 0 0 0 0 rgba(220,38,38,.6); } 70% { box-shadow: 0 0 0 9px rgba(220,38,38,0); } 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0); } }
.hero h1 { font-size: clamp(26px, 6vw, 44px); line-height: 1.1; margin: 14px 0 8px; font-weight: 900; letter-spacing: -.02em; }
.hero-meta { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; opacity: .92; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 22px auto 0; max-width: 460px; }
.hero-stat { background: rgba(255,255,255,.12); border-radius: 16px; padding: 10px 4px; }
.hero-stat b { display: block; font-size: 22px; font-weight: 900; }
.hero-stat span { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; opacity: .85; }

/* ---- buscador grande ---- */
.buscador { max-width: 720px; margin: -34px auto 0; width: calc(100% - 32px); position: relative; z-index: 2; }
.buscador input { width: 100%; font-size: 18px; padding: 20px 16px 20px 56px; border: 3px solid white; border-radius: 22px; background: white; color: var(--azul); box-shadow: 0 10px 30px rgba(26,43,74,.22); font-weight: 600; }
.buscador input:focus { outline: none; border-color: var(--rojo); }
.buscador::before { content: "🔍"; position: absolute; left: 22px; top: 31px; transform: translateY(-50%); font-size: 22px; }
.buscador small { display: block; text-align: center; color: var(--gris); font-size: 12px; margin-top: 10px; }

/* ---- pestañas ---- */
.tabs-wrap { position: sticky; top: 0; z-index: 5; background: linear-gradient(var(--crema) 80%, transparent); padding: 16px 0 10px; }
.tabs { max-width: 980px; margin: 0 auto; width: calc(100% - 32px); display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: 0 0 auto; border: 2px solid var(--linea); background: white; color: var(--azul); font-weight: 800; font-size: 14px; padding: 10px 18px; border-radius: 999px; cursor: pointer; font-family: inherit; }
.tab.activa { background: var(--azul); border-color: var(--azul); color: white; }
.tab:hover:not(.activa) { border-color: var(--rojo); color: var(--rojo); }

.contenido { max-width: 980px; margin: 0 auto; width: calc(100% - 32px); padding: 6px 0 40px; min-height: 320px; }
.subtitulo { font-size: 13px; color: var(--gris); margin: 4px 4px 12px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.chip { border: 2px solid var(--linea); background: white; padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: 13px; cursor: pointer; font-family: inherit; color: var(--azul); }
.chip.activa { background: var(--rojo); border-color: var(--rojo); color: white; }

/* ---- fila de corredor ---- */
.fila { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; background: white; border-radius: 18px; padding: 14px 16px; margin-bottom: 8px; text-decoration: none; box-shadow: 0 1px 4px rgba(26,43,74,.06); border: 2px solid transparent; transition: transform .12s, border-color .12s, box-shadow .12s; }
.fila:hover { border-color: var(--rojo); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(26,43,74,.1); }
.pos { width: 48px; height: 48px; border-radius: 14px; background: #f4f6f8; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 18px; }
.pos.p1 { background: var(--oro); color: white; } .pos.p2 { background: var(--plata); color: white; } .pos.p3 { background: var(--bronce); color: white; }
.fila-nombre { font-weight: 800; font-size: 16px; line-height: 1.2; }
.fila-sub { font-size: 12.5px; color: var(--gris); margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.fila-sub b { color: var(--azul); }
.fila-tiempo { text-align: right; }
.fila-tiempo .t { font-weight: 900; font-size: 20px; letter-spacing: -.01em; }
.fila-tiempo .r { font-size: 12px; color: var(--gris); margin-top: 2px; }
.bib { display: inline-block; background: var(--azul); color: white; font-weight: 800; font-size: 11px; padding: 2px 8px; border-radius: 6px; letter-spacing: .04em; }
.fila-extra { display: none; }
@media (min-width: 720px) {
  .fila { grid-template-columns: 52px 1fr 110px 110px 120px; }
  .fila-extra { display: block; text-align: center; font-size: 13px; }
  .fila-extra b { display: block; font-size: 17px; }
  .fila-extra span { color: var(--gris); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
  .solo-movil { display: none; }
}
.encabezado-tabla { display: none; }
@media (min-width: 720px) {
  .encabezado-tabla { display: grid; grid-template-columns: 52px 1fr 110px 110px 120px; gap: 12px; padding: 0 16px 6px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--gris); }
  .encabezado-tabla div:nth-child(n+3) { text-align: center; } .encabezado-tabla div:last-child { text-align: right; }
}
.mas { display: block; margin: 16px auto 0; padding: 12px 26px; border-radius: 999px; border: 2px solid var(--azul); background: white; font-weight: 800; cursor: pointer; font-size: 14px; font-family: inherit; color: var(--azul); }
.vacio { text-align: center; color: var(--gris); background: white; border-radius: 18px; padding: 40px 20px; }

/* ---- Mi resultado (tarjeta estrella) ---- */
.mi-resultado { background: linear-gradient(160deg, var(--azul), #7a1f3a 60%, var(--rojo)); color: white; border-radius: 26px; padding: 26px 22px; margin-bottom: 14px; text-decoration: none; display: block; }
.mi-resultado .quien { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.mi-resultado h3 { margin: 0; font-size: 22px; font-weight: 900; }
.mi-resultado .tiempo-grande { font-size: clamp(54px, 15vw, 88px); font-weight: 900; letter-spacing: -.03em; line-height: 1; margin: 16px 0 4px; }
.mi-resultado .ritmo { opacity: .9; font-size: 15px; }
.mini-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; }
.mini { background: rgba(255,255,255,.14); border-radius: 16px; padding: 12px 6px; text-align: center; }
.mini b { display: block; font-size: 24px; font-weight: 900; } .mini span { font-size: 11px; opacity: .85; display: block; margin-top: 2px; }
.mi-resultado .ver { margin-top: 16px; display: inline-block; background: white; color: var(--rojo); font-weight: 800; padding: 10px 18px; border-radius: 999px; font-size: 14px; }
.bib.claro { background: rgba(255,255,255,.2); }

/* ---- página del corredor ---- */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 0 0 14px; }
@media (min-width: 720px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }
.stat { background: white; border-radius: 20px; padding: 18px 12px; text-align: center; box-shadow: 0 1px 4px rgba(26,43,74,.06); }
.stat span { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--gris); font-weight: 800; }
.stat b { display: block; font-size: 32px; font-weight: 900; margin: 4px 0 2px; }
.stat small { color: var(--gris); font-size: 12.5px; }
.tarjeta { background: white; border-radius: 22px; padding: 22px 20px; margin-bottom: 14px; box-shadow: 0 1px 4px rgba(26,43,74,.06); }
.tarjeta h2 { margin: 0 0 14px; font-size: 17px; font-weight: 900; }
.medidor { height: 14px; border-radius: 999px; background: #eef0f3; overflow: hidden; }
.medidor div { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--azul), var(--rojo)); }

.linea-tiempo { position: relative; padding-left: 36px; }
.linea-tiempo::before { content: ""; position: absolute; left: 9px; top: 8px; bottom: 8px; width: 3px; background: linear-gradient(var(--azul), var(--rojo)); border-radius: 3px; }
.paso { position: relative; margin-bottom: 14px; }
.paso::before { content: ""; position: absolute; left: -36px; top: 4px; width: 19px; height: 19px; border-radius: 50%; background: white; border: 4px solid var(--azul); }
.paso.meta::before { border-color: var(--rojo); background: var(--rojo); }
.paso-cab { display: flex; justify-content: space-between; align-items: baseline; font-weight: 800; }
.paso-cab .acum { font-size: 18px; }
.paso-det { font-size: 12.5px; color: var(--gris); margin: 2px 0 6px; }
.barra { height: 8px; border-radius: 8px; background: #eef0f3; overflow: hidden; } .barra div { height: 100%; background: var(--azul); border-radius: 8px; }
.paso.rapido .barra div { background: #16a34a; }
.tag-rapido { color: #16a34a; font-weight: 800; }

.acciones { display: grid; gap: 10px; }
@media (min-width: 720px) { .acciones { grid-template-columns: repeat(3, 1fr); } }
.btn { display: block; text-align: center; text-decoration: none; padding: 15px 18px; border-radius: 16px; font-weight: 800; font-size: 15px; border: 2px solid var(--azul); background: white; color: var(--azul); cursor: pointer; font-family: inherit; width: 100%; }
.btn.primario { background: var(--rojo); border-color: var(--rojo); color: white; }
.btn:hover { filter: brightness(.96); }
.imagen-previa { width: 100%; max-width: 360px; display: block; margin: 0 auto 16px; border-radius: 20px; box-shadow: 0 10px 30px rgba(26,43,74,.25); }
.nota { color: var(--gris); font-size: 13px; text-align: center; margin: 10px 0 0; }

/* ---- lista de carreras ---- */
.grilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.carrera { background: white; border-radius: 22px; padding: 20px; text-decoration: none; box-shadow: 0 2px 8px rgba(26,43,74,.07); border: 2px solid transparent; display: block; transition: transform .12s, border-color .12s; }
.carrera:hover { border-color: var(--rojo); transform: translateY(-2px); }
.carrera-logo { width: 58px; height: 58px; border-radius: 16px; background: #f4f6f8; display: flex; align-items: center; justify-content: center; overflow: hidden; font-size: 28px; margin-bottom: 12px; }
.carrera-logo img { width: 100%; height: 100%; object-fit: contain; }
.carrera h3 { margin: 8px 0 6px; font-size: 18px; line-height: 1.2; }
.carrera .meta { color: var(--gris); font-size: 13px; line-height: 1.6; }
.pildora { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .08em; padding: 4px 10px; border-radius: 999px; background: #f4f6f8; color: var(--gris); }
.pildora.vivo { background: var(--rojo); color: white; }
.pildora.proxima { background: #fef3c7; color: #92400e; }
.carrera.proxima { cursor: default; }

.footer-bottom { text-align: center; padding: 24px 20px 34px; font-size: 12px; color: #999; }
.footer-bottom a { color: #999; margin: 0 8px; text-decoration: none; }

/* varias distancias en una misma carrera */
.chip .n { opacity: .6; font-weight: 600; margin-left: 4px; }
.bib.bib-dist { background: var(--rojo); }
.bib.bib-num { background: #0B0F14; }
.stats-grid .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (min-width: 720px) { .stats-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } .stats-grid .stat:last-child:nth-child(odd) { grid-column: auto; } }
