
:root {
  --bg: #eef3f9; --bg-soft: #f4f8fd; --card: #ffffff;
  --text: #1e293b; --muted: #64748b; --muted-2: #94a3b8;
  --border: #cbd5e1; --head: #0d2535; --head2: #163d5a;
  --accent: #0ea5e9; --gold: #f59e0b; --silver: #60a5fa;
  --promo: #fde68a; --des: #fecaca;
  --row: #f8fbff; --hover: #e8f4ff;
  --shadow: 0 8px 28px rgba(13,37,53,.1);
  --shadow-soft: 0 4px 16px rgba(13,37,53,.07);
  --radius: 16px;
  --ok-bg: #ecfdf5;   --ok-bd: #a7f3d0;   --ok-tx: #065f46;
  --info-bg: #eff6ff; --info-bd: #bfdbfe; --info-tx: #1e3a8a;
  --warn-bg: #fff7ed; --warn-bd: #fed7aa; --warn-tx: #9a3412;
  --up: #16a34a; --down: #dc2626; --same: #94a3b8;
  --win: #2563eb; --loss: #dc2626; --draw: #94a3b8;
  --focus: 0 0 0 3px rgba(14,165,233,.25);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: 'Barlow', Arial, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; overflow-x: hidden; }

/* ── PORTADA ── */
#portada { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #0d2535; }
.portada-inner { text-align: center; padding: 40px 24px; }
.portada-logo { margin-bottom: 28px; line-height: 1; }
.portada-logo img { width: 100%; max-width: 620px; height: auto; display: block; margin: 0 auto; filter: drop-shadow(0 6px 32px rgba(0,0,0,.55)); }
.portada-titulo { display: none; }
.portada-sub { color: rgba(255,255,255,.6); font-size: 1.1rem; margin: 0 0 48px; }
.portada-cards { display: flex; gap: 24px; justify-content: center; flex-wrap: wrap; }
.portada-card {
  text-decoration: none;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  border-radius: 20px; padding: 32px 40px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  transition: transform .2s, background .2s, box-shadow .2s;
  min-width: 240px; text-align: center;
  backdrop-filter: blur(8px);
}
.portada-card:hover { transform: translateY(-4px); background: rgba(255,255,255,.1); box-shadow: 0 16px 48px rgba(0,0,0,.3); }
.portada-card-badge { font-family: 'Barlow Condensed', sans-serif; font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; padding: 4px 14px; border-radius: 999px; }
.card-a .portada-card-badge { background: rgba(14,165,233,.2); border: 1px solid rgba(14,165,233,.4); color: #7dd3fc; }
.badge-b-pill { background: rgba(245,158,11,.25); border: 1px solid rgba(245,158,11,.45); color: #fde68a; }
.portada-card-title { font-family: 'Barlow Condensed', sans-serif; font-size: 1.5rem; font-weight: 800; color: #fff; }
.portada-card-desc { font-size: .88rem; color: rgba(255,255,255,.5); }

/* ── SECCIONES ── */
.seccion { display: block; }
.seccion.hidden { display: none; }

/* ── HEADER ── */
header { color: #fff; padding: 28px 24px; box-shadow: var(--shadow); }
.header-a { background: linear-gradient(135deg, var(--head), var(--head2)); }
.header-b { background: linear-gradient(135deg, #1a1200, #3d2e00); }
.container { width: min(1400px, 96vw); margin: 0 auto; }
header h1 { margin: 0 0 6px; font-family: 'Barlow Condensed', sans-serif; font-size: clamp(1.6rem, 3.5vw, 2.6rem); font-weight: 800; letter-spacing: -.01em; }
header p { margin: 0; color: rgba(255,255,255,.7); font-size: .95rem; }
.ultima-actualizacion { margin-top: 6px !important; font-size: .82rem; color: rgba(255,255,255,.5) !important; }

/* ── VOLVER ── */
.btn-volver { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); color: rgba(255,255,255,.8); padding: 6px 14px; border-radius: 8px; font-family: 'Barlow', sans-serif; font-size: .85rem; font-weight: 600; cursor: pointer; margin-bottom: 16px; transition: background .15s; }
.btn-volver:hover { background: rgba(255,255,255,.2); color: #fff; }

/* ── BADGES ── */
.badge-a { display: inline-block; background: rgba(14,165,233,.2); border: 1px solid rgba(14,165,233,.35); color: #7dd3fc; font-family: 'Barlow Condensed', sans-serif; font-size: .82rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 3px 12px; border-radius: 999px; margin-bottom: 10px; }
.badge-b { display: inline-block; background: rgba(245,158,11,.25); border: 1px solid rgba(245,158,11,.4); color: #fde68a; font-family: 'Barlow Condensed', sans-serif; font-size: .82rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 3px 12px; border-radius: 999px; margin-bottom: 10px; }

/* ── NAV TABS ── */
.nav-tabs { display: flex; gap: 4px; padding: 16px 24px 0; flex-wrap: nowrap;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; width: 100%; box-sizing: border-box; }
.nav-tabs::-webkit-scrollbar { display: none; }
.nav-tab { padding: 9px 18px; border-radius: 10px 10px 0 0; border: 1px solid transparent;
  background: none; color: rgba(255,255,255,.55); font-family: 'Barlow Condensed', sans-serif;
  font-size: 1rem; font-weight: 700; cursor: pointer; letter-spacing: .02em;
  transition: background .15s, color .15s; white-space: nowrap; flex-shrink: 0; }
.nav-tab:hover { background: rgba(255,255,255,.08); color: rgba(255,255,255,.85); }
.nav-tab.active { background: var(--bg); color: var(--head); border-color: var(--border); border-bottom-color: var(--bg); }

/* ── MAIN ── */
main { padding: 0 0 48px; }
.tab-panel { display: none; padding: 24px 0; }
.tab-panel.active { display: block; }

/* ── CARD ── */
.card { background: var(--card); border: 1px solid rgba(203,213,225,.8); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 24px; }
.card h2 { margin: 0 0 16px; font-family: 'Barlow Condensed', sans-serif; font-size: 1.45rem; font-weight: 800; color: var(--head); letter-spacing: .01em; }
.card-desc { font-size: .9rem; color: var(--muted); margin-bottom: 16px; line-height: 1.55; }

/* ── TABLA ── */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
table { width: 100%; border-collapse: collapse; background: #fff; table-layout: fixed; }
thead th { background: var(--head); color: #fff; padding: 10px 6px; text-align: center; font-family: 'Barlow Condensed', sans-serif; font-size: .9rem; font-weight: 700; white-space: nowrap; height: 44px; vertical-align: middle; }
tbody td { padding: 9px 6px; border-bottom: 1px solid #e8eef5; text-align: center; font-size: .88rem; white-space: nowrap; height: 44px; vertical-align: middle; }
tbody tr:nth-child(even):not(.detail-row) { background: var(--row); }
tbody tr:hover:not(.detail-row) { background: var(--hover); }
th.pos, td.pos { width: 42px; font-weight: 700; }
th.team, td.team { text-align: left; width: 32%; min-width: 0; }
th.forma, td.forma { width: 96px; }
td.pts { font-weight: 700; }
thead th:nth-child(n+3):nth-child(-n+10), tbody td:nth-child(n+3):nth-child(-n+10) { width: 40px; }
tbody td:nth-child(n+4):nth-child(-n+10) { border-left: 1px solid #e8eef5; }

/* ── CLASIFICADOS A ── */
.clasificado { font-weight: 600; }
.clasificado-1 { background: linear-gradient(90deg, rgba(245,158,11,.14), rgba(245,158,11,.03)) !important; }
.clasificado-2 { background: linear-gradient(90deg, rgba(96,165,250,.14), rgba(96,165,250,.03)) !important; }
.clasificado-1 td.team::before { content: "★ "; color: var(--gold); }
.clasificado-2 td.team::before { content: "● "; color: var(--silver); }
.promo-row    { background: linear-gradient(90deg, rgba(253,230,138,.35), rgba(253,230,138,.06)) !important; }
.promo-row td.pos { color: #92400e; }
.descenso-row { background: linear-gradient(90deg, rgba(254,202,202,.45), rgba(254,202,202,.06)) !important; }
.descenso-row td.pos { color: #991b1b; }

/* ── CLASIFICADOS B ── */
.campeón-row  { background: linear-gradient(90deg, rgba(245,158,11,.18), rgba(245,158,11,.04)) !important; }
.reducido-row { background: linear-gradient(90deg, rgba(14,165,233,.10), rgba(14,165,233,.02)) !important; }
.eliminado-row { background: transparent; }
.campeón-row td.pos  { color: #d97706; font-weight: 800; }
.reducido-row td.pos { color: #0369a1; }

/* ── ESTADO BOX ── */
.estado-box { border-radius: 12px; padding: 14px 16px; border: 1px solid; line-height: 1.55; margin-bottom: 16px; font-size: .95rem; }
.estado-box.info  { background: var(--info-bg);  border-color: var(--info-bd);  color: var(--info-tx); }
.estado-box.warn  { background: var(--warn-bg);  border-color: var(--warn-bd);  color: var(--warn-tx); }
.estado-box.ok    { background: var(--ok-bg);    border-color: var(--ok-bd);    color: var(--ok-tx); }

/* ── LEYENDA ── */
.leyenda { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 14px; font-size: .88rem; color: var(--muted); }
.leyenda span { display: flex; align-items: center; gap: 7px; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.swatch.gold      { background: rgba(245,158,11,.55); border: 1px solid var(--gold); }
.swatch.silver    { background: rgba(96,165,250,.55); border: 1px solid var(--silver); }
.swatch.promo     { background: rgba(253,230,138,.7);  border: 1px solid #f59e0b; }
.swatch.descenso  { background: rgba(254,202,202,.8);  border: 1px solid #dc2626; }
.swatch.up        { background: var(--up); }
.swatch.down      { background: var(--down); }
.swatch.same      { background: var(--same); }
.swatch.campeon   { background: rgba(245,158,11,.55); border: 1px solid #f59e0b; }
.swatch.reducido-sw { background: rgba(14,165,233,.45); border: 1px solid #0ea5e9; }
.swatch.fuera     { background: #f1f5f9; border: 1px solid var(--border); }

/* ── TEAM BUTTON ── */
.team-button { background: none; border: none; color: inherit; font: inherit; width: 100%; padding: 0; cursor: pointer; text-align: left; display: flex; align-items: center; gap: 6px; line-height: 1.2; }
.team-button:hover .team-name { text-decoration: underline; }
.team-button:focus-visible { outline: none; border-radius: 6px; box-shadow: var(--focus); }
.team-button::after { content: "▼"; font-size: .7em; color: var(--muted); margin-left: auto; flex: 0 0 auto; transition: transform .15s; }
.team-button-static { cursor: default; pointer-events: none; }
.team-button-static::after { display: none; }
.team-button[aria-expanded="true"]::after { transform: rotate(180deg); }
.team-main { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1 1 auto; }
.pos-indicator { display: inline-flex; align-items: center; justify-content: center; width: 14px; font-size: .78em; font-weight: 700; flex: 0 0 14px; }
.pos-indicator.up   { color: var(--up); }
.pos-indicator.down { color: var(--down); }
.pos-indicator.same { color: var(--same); }
.team-name { overflow: hidden; text-overflow: ellipsis; }

/* ── FORMA ── */
.forma-wrap { display: inline-flex; align-items: center; justify-content: center; gap: 4px; white-space: nowrap; }
.forma-item { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; font-size: 11px; font-weight: 700; border-radius: 50%; }
.forma-item.win  { color: var(--win); }
.forma-item.loss { color: var(--loss); }
.forma-item.draw { color: var(--draw); }

/* ── DETALLE FILA ── */
.detail-row td { padding: 0; background: #f9fbfe; border-bottom: 1px solid var(--border); overflow: visible; white-space: normal; }
.detail-box { padding: 16px; }
.detail-header { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 12px; flex-wrap: wrap; }
.detail-title { font-weight: 700; color: var(--text); }
.detail-summary { color: var(--muted); font-size: .9rem; display: flex; gap: 10px; flex-wrap: wrap; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.detail-match { border: 1px solid var(--border); border-radius: 12px; background: #fff; padding: 12px; box-shadow: var(--shadow-soft); }
.detail-match-top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 7px; color: var(--muted); font-size: .84rem; flex-wrap: wrap; }
.detail-rival { font-weight: 700; color: var(--head); line-height: 1.4; }
.detail-result { margin-top: 5px; font-weight: 700; font-size: .9rem; }
.detail-status { margin-top: 8px; display: inline-flex; padding: 3px 8px; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.detail-status.ganado   { background: rgba(37,99,235,.1);    color: var(--win); }
.detail-status.perdido  { background: rgba(220,38,38,.08);   color: var(--loss); }
.detail-status.empatado { background: rgba(148,163,184,.12); color: #475569; }
.detail-status.pendiente{ background: rgba(14,165,233,.08);  color: #0369a1; }

/* ── FIXTURE ── */
.fixture-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.fecha { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: #fff; box-shadow: var(--shadow-soft); display: flex; flex-direction: column; }
.fecha-header { background: linear-gradient(135deg, var(--head), var(--head2)); color: #fff; padding: 12px 14px; font-family: 'Barlow Condensed', sans-serif; font-size: 1.05rem; font-weight: 700; }
.fecha-body { padding: 12px 14px; display: flex; flex-direction: column; flex: 1; }
.partido { padding: 9px 0; border-bottom: 1px solid #e8eef5; font-size: .93rem; line-height: 1.45; }
.partido:last-child { border-bottom: none; }
.libre { margin-top: auto; padding: 9px 12px; border-radius: 9px; background: #ecfeff; border: 1px solid #a5f3fc; color: #164e63; font-weight: 700; font-size: .88rem; }
.partido-resultado { font-size: .93rem; line-height: 1.45; }
.fixture-goleadores { margin-top: 6px; display: flex; flex-direction: column; gap: 3px; }
.fixture-gol-fila { display: flex; flex-direction: column; gap: 1px; padding: 4px 8px; background: #f0fdf4; border-left: 2px solid #86efac; border-radius: 0 6px 6px 0; }
.fixture-gol-equipo { font-size: .72rem; font-weight: 700; color: #15803d; text-transform: uppercase; letter-spacing: .05em; line-height: 1.2; }
.fixture-gol-nombres { font-size: .82rem; color: #166534; line-height: 1.4; }

/* ── FIXTURE ZONAS A/B LADO A LADO ── */
.fixture-zonas-wrap { display: flex; gap: 20px; align-items: flex-start; }
.fixture-zona-col   { flex: 1 1 0; min-width: 0; }

/* ── FIXTURE B PAGINADO ── */
.fixture-paginacion { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.pag-btn { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border); background: #fff; color: var(--muted); font-weight: 700; font-size: .85rem; cursor: pointer; transition: background .12s; }
.pag-btn:hover, .pag-btn.active { background: var(--head); color: #fff; border-color: var(--head); }

/* ── FASE FINAL ── */
.fase-stage-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.fase-stage { border: 1px solid var(--border); border-radius: 16px; background: #fff; overflow: hidden; box-shadow: var(--shadow-soft); }
.fase-stage-title { background: linear-gradient(135deg, var(--head), var(--head2)); color: #fff; padding: 13px 16px; font-family: 'Barlow Condensed', sans-serif; font-size: 1.1rem; font-weight: 700; letter-spacing: .02em; }
.fase-stage-body { padding: 14px; display: grid; gap: 12px; }
.match-card { border: 1px solid var(--border); border-radius: 14px; padding: 13px; background: #fff; }
.match-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: .84rem; margin-bottom: 10px; flex-wrap: wrap; }
.match-teams { display: grid; gap: 7px; }
.team-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; background: #f8fbff; }
.team-line.winner { background: linear-gradient(90deg, rgba(14,165,233,.12), rgba(14,165,233,.03)); border: 1px solid rgba(14,165,233,.2); }
.team-line.pending { opacity: .8; }
.team-score { font-weight: 800; font-size: 1rem; min-width: 28px; text-align: right; }
.team-name-line { font-weight: 600; }
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 10px; font-size: .82rem; font-weight: 700; }
.badge.info    { background: #eef6ff; color: #1e3a8a; border: 1px solid #bfdbfe; }
.badge.success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.badge.pending { background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; }
.fase-stage.final-stage .fase-stage-title { background: linear-gradient(135deg, #5b21b6, #1d4ed8); }
.trophy-row { display: flex; align-items: center; justify-content: center; gap: 10px; color: #5b21b6; font-weight: 800; font-family: 'Barlow Condensed', sans-serif; font-size: 1.2rem; margin: 4px 0; }
.empty-final { border: 1px dashed #cbd5e1; border-radius: 14px; padding: 18px; text-align: center; color: var(--muted); background: #fbfdff; font-size: .9rem; }

/* ── REDUCIDO ── */
.fase-bloque { margin-bottom: 28px; }
.fase-bloque-title { font-family: 'Barlow Condensed', sans-serif; font-size: 1.2rem; font-weight: 800; color: var(--head); letter-spacing: .02em; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 2px solid var(--border); }
.fase-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.reordenamiento-grid { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.reord-chip { display: flex; align-items: center; gap: 6px; background: #f1f5f9; border: 1px solid var(--border); border-radius: 10px; padding: 6px 12px; font-size: .88rem; font-weight: 600; }
.reord-num { font-family: 'Barlow Condensed', sans-serif; font-size: 1rem; font-weight: 800; color: var(--head); }
.promo-directa-box { display: flex; align-items: flex-start; gap: 14px; background: linear-gradient(90deg, rgba(245,158,11,.12), rgba(245,158,11,.03)); border: 1px solid rgba(245,158,11,.3); border-radius: 14px; padding: 16px; margin-top: 16px; }
.promo-directa-ico { font-size: 1.8rem; flex-shrink: 0; }
.promo-directa-label { font-size: .82rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 4px; }
.promo-directa-equipo { font-family: 'Barlow Condensed', sans-serif; font-size: 1.3rem; font-weight: 800; color: var(--head); }
.promo-directa-nota { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.global-box { background: #f1f5f9; border: 1px solid var(--border); border-radius: 10px; padding: 10px 16px; margin-top: 12px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.global-label { font-size: .84rem; font-weight: 700; color: var(--muted); }
.global-scores { font-family: 'Barlow Condensed', sans-serif; font-size: 1.1rem; font-weight: 800; color: var(--head); }

/* ── GUÍA ── */
.guia-card { background: #fbfdff; }
.guia-bloque { margin-bottom: 22px; }
.guia-bloque:last-child { margin-bottom: 0; }
.guia-bloque-titulo { font-family: 'Barlow Condensed', sans-serif; font-size: 1.05rem; font-weight: 800; color: var(--head2); margin-bottom: 10px; }
.guia-cruces-grid { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.guia-cruce-chip { background: #f1f5f9; border: 1px solid var(--border); border-radius: 8px; padding: 6px 12px; font-weight: 700; font-size: .88rem; display: flex; gap: 5px; align-items: center; }
.guia-cruce-chip span { color: var(--muted); font-weight: 400; }
.guia-lista { margin: 0; padding-left: 20px; font-size: .9rem; line-height: 1.7; color: var(--text); }

/* ── GOLEADORES ── */
.filtro-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.filtro-btn { padding: 7px 16px; border-radius: 10px; border: 1px solid var(--border); background: #fff; color: var(--muted); font-weight: 700; font-size: .88rem; cursor: pointer; transition: background .12s, color .12s, border-color .12s; }
.filtro-btn:hover, .filtro-btn.active { background: var(--head); color: #fff; border-color: var(--head); }
.ranking-wrap { display: flex; flex-direction: column; gap: 0; }
.ranking-fila { display: grid; grid-template-columns: 52px 1fr auto auto; align-items: center; gap: 0 14px; padding: 13px 16px; border-bottom: 1px solid #e8eef5; transition: background .12s; }
.ranking-fila:last-child { border-bottom: none; }
.ranking-fila:hover { background: var(--hover); }
.ranking-fila.pos-1 { background: linear-gradient(90deg, rgba(245,158,11,.13), rgba(245,158,11,.02)); }
.ranking-fila.pos-2 { background: linear-gradient(90deg, rgba(148,163,184,.13), rgba(148,163,184,.02)); }
.ranking-fila.pos-3 { background: linear-gradient(90deg, rgba(180,83,9,.10), rgba(180,83,9,.02)); }
.ranking-pos { font-family: 'Barlow Condensed', sans-serif; font-size: 1.4rem; font-weight: 800; text-align: center; color: var(--muted-2); line-height: 1; }
.pos-1 .ranking-pos { color: #d97706; }
.pos-2 .ranking-pos { color: #64748b; }
.pos-3 .ranking-pos { color: #b45309; }
.ranking-medalla { display: block; font-size: 1.4rem; text-align: center; line-height: 1; }
.ranking-info { min-width: 0; }
.ranking-nombre { font-weight: 700; font-size: 1rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ranking-equipo { font-size: .82rem; color: var(--muted); margin-top: 2px; }
.ranking-zona-badge { font-size: .72rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: #f1f5f9; color: var(--muted); white-space: nowrap; align-self: center; }
.ranking-goles { font-family: 'Barlow Condensed', sans-serif; font-size: 1.8rem; font-weight: 800; color: var(--head); min-width: 40px; text-align: right; line-height: 1; }
.ranking-goles-label { font-size: .7rem; color: var(--muted); font-weight: 500; text-align: right; margin-top: 1px; }
.goles-col { text-align: right; }
.ranking-vacio { text-align: center; padding: 40px 24px; color: var(--muted); font-size: .95rem; line-height: 1.6; }
.ranking-vacio .ico { font-size: 2.6rem; display: block; margin-bottom: 12px; }
.resumen-bar { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.resumen-chip { background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; padding: 10px 16px; font-size: .88rem; color: var(--muted); }
.resumen-chip strong { display: block; font-family: 'Barlow Condensed', sans-serif; font-size: 1.4rem; font-weight: 800; color: var(--head); line-height: 1.1; }

/* ── PALMARÉS ── */
.palmares-covid-row td { color: var(--muted); font-style: italic; background: #fafafa; }
.palmares-ranking-wrap { display: flex; flex-direction: column; gap: 0; }
.palmares-ranking-fila { border-bottom: 1px solid #e8eef5; transition: background .12s; }
.palmares-ranking-fila:last-child { border-bottom: none; }
.palmares-ranking-fila.pos-1 { background: linear-gradient(90deg, rgba(245,158,11,.1), rgba(245,158,11,.01)); }
.palmares-ranking-fila.pos-2 { background: linear-gradient(90deg, rgba(148,163,184,.1), rgba(148,163,184,.01)); }
.palmares-ranking-fila.pos-3 { background: linear-gradient(90deg, rgba(180,83,9,.08), rgba(180,83,9,.01)); }
.palmares-ranking-fila.open { background: #f0f7ff; }
.palmares-ranking-btn { width: 100%; background: none; border: none; padding: 13px 16px; display: flex; align-items: center; gap: 14px; cursor: pointer; text-align: left; font-family: inherit; }
.palmares-ranking-btn:hover { background: var(--hover); }
.palmares-pos { width: 40px; flex-shrink: 0; text-align: center; }
.palmares-club-info { flex: 1; min-width: 0; }
.palmares-club-nombre { font-weight: 700; font-size: 1rem; color: var(--text); }
.palmares-titulos-badge { font-family: 'Barlow Condensed', sans-serif; font-size: 1.1rem; font-weight: 800; color: var(--head); white-space: nowrap; background: #eef3f9; border: 1px solid var(--border); border-radius: 999px; padding: 2px 12px; }
.palmares-chevron { font-size: .75rem; color: var(--muted); flex-shrink: 0; }
.palmares-detalle { padding: 0 16px 14px 70px; }
.palmares-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.palmares-chip { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 4px 10px; font-size: .8rem; font-weight: 600; color: var(--head2); }
.stats-resumen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stats-chip { background: linear-gradient(135deg, #f8fafc, #eef3f9); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; text-align: center; }
.stats-chip-value { font-family: 'Barlow Condensed', sans-serif; font-size: 2.4rem; font-weight: 800; color: var(--head); line-height: 1; margin-bottom: 4px; }
.stats-chip-label { font-size: .82rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.stats-charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.stats-chart-card { background: #f8fafc; border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.stats-chart-card h3 { margin: 0 0 18px; font-family: 'Barlow Condensed', sans-serif; font-size: 1.1rem; font-weight: 800; color: var(--head); }
.chart-wrap { position: relative; max-width: 320px; margin: 0 auto; }
.stats-empty { text-align: center; padding: 32px; color: var(--muted); font-size: .95rem; }
.stats-empty .ico { font-size: 2rem; display: block; margin-bottom: 8px; }

/* ── RESPONSIVE ── */
@media (max-width: 1000px) {
  .fase-stage-grid { grid-template-columns: 1fr; }
  .stats-charts-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .container { width: 96vw; }
  .card { padding: 14px; }
  thead th, tbody td { padding: 7px 4px; font-size: .8rem; }
  th.team, td.team { width: 36%; }
  th.forma, td.forma { width: 80px; }
  .detail-grid { grid-template-columns: 1fr; }
  .fixture-grid { grid-template-columns: 1fr; }
  .fixture-zonas-wrap { flex-direction: column; }
  .nav-tabs { gap: 2px; padding: 12px 16px 0; }
  .nav-tab { padding: 8px 12px; font-size: .88rem; }
  .portada-cards { flex-direction: column; align-items: center; }
  .portada-card { min-width: 280px; width: 100%; max-width: 340px; }
  .stats-resumen-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .nav-tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    overflow-x: visible;
    gap: 4px;
    padding: 10px 12px 12px;
  }
  .nav-tab {
    border-radius: 8px;
    text-align: center;
    white-space: normal;
    line-height: 1.2;
  }
  .nav-tab.active { border-bottom-color: var(--border); }
}

/* ── SELECTOR DE AÑO (portada) ── */
.anio-selector { display:flex; gap:8px; flex-wrap:wrap; justify-content:center; margin:24px 0 32px; }
.anio-btn { padding:8px 22px; border-radius:10px; border:1px solid rgba(255,255,255,.2);
  background:rgba(255,255,255,.07); color:rgba(255,255,255,.7);
  font-family:'Barlow Condensed',sans-serif; font-size:1.1rem; font-weight:700;
  cursor:pointer; transition:background .15s,color .15s,border-color .15s; }
.anio-btn:hover { background:rgba(255,255,255,.14); color:#fff; }
.anio-btn.active { background:var(--accent); color:#fff; border-color:var(--accent); }

/* ── BADGE ESTADO TORNEO ── */
.badge-estado { display:inline-block; padding:2px 10px; border-radius:999px;
  font-size:.75rem; font-weight:700; letter-spacing:.06em; text-transform:uppercase; }
.badge-estado.en-curso    { background:rgba(16,185,129,.2); border:1px solid rgba(16,185,129,.4); color:#6ee7b7; }
.badge-estado.finalizado  { background:rgba(148,163,184,.15); border:1px solid rgba(148,163,184,.3); color:#94a3b8; }
.badge-estado.planificado { background:rgba(245,158,11,.18); border:1px solid rgba(245,158,11,.35); color:#fde68a; }

/* ── TORNEO CARDS (portada) ── */
.div-section { margin-bottom:40px; flex:1; min-width:280px; }
#torneos-content { display:flex; gap:32px; justify-content:center;
  flex-wrap:wrap; align-items:flex-start; margin-top:8px; }

@media (max-width:700px) {
  #torneos-content { flex-direction:column; align-items:center; }
  .div-section { width:100%; max-width:400px; }
}
.div-label { font-family:'Barlow Condensed',sans-serif; font-size:.8rem; font-weight:700;
  letter-spacing:.15em; text-transform:uppercase; color:rgba(255,255,255,.4);
  margin-bottom:12px; }
.torneos-grid { display:flex; gap:16px; flex-wrap:wrap; justify-content:center; }
.torneo-card { text-decoration:none; background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12); border-radius:16px; padding:22px 28px;
  display:flex; flex-direction:column; gap:10px; min-width:260px; max-width:360px;
  backdrop-filter:blur(8px); transition:transform .2s,background .2s,box-shadow .2s; }
.torneo-card:hover { transform:translateY(-3px); background:rgba(255,255,255,.1);
  box-shadow:0 12px 36px rgba(0,0,0,.3); }
.torneo-card-top { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.torneo-card-nombre { font-family:'Barlow Condensed',sans-serif; font-size:1.3rem;
  font-weight:800; color:#fff; }
.torneo-card-meta { font-size:.82rem; color:rgba(255,255,255,.45); }

/* Líderes en portada */
.portada-lideres { display:flex; flex-direction:column; gap:6px;
  border-top:1px solid rgba(255,255,255,.1); padding-top:10px; margin-top:2px; }
.portada-lider { display:flex; align-items:center; gap:8px; }
.portada-zona-titulo { font-size:.72rem; font-weight:700; color:rgba(255,255,255,.4);
  text-transform:uppercase; letter-spacing:.08em; margin-bottom:2px; }
.portada-lider-pos { font-size:.8rem; font-weight:700; color:rgba(255,255,255,.45);
  min-width:22px; }
.portada-lider-zona { font-size:.72rem; font-weight:700; color:rgba(255,255,255,.4);
  text-transform:uppercase; letter-spacing:.06em; min-width:46px; }
.portada-lider-equipo { font-size:.88rem; font-weight:600; color:#fff; flex:1;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; text-align:left; }
.portada-lider-pts { font-size:.8rem; font-weight:700; color:rgba(255,255,255,.55);
  white-space:nowrap; }

/* Fechas en portada */
.portada-fechas { display:flex; gap:12px; flex-wrap:wrap;
  border-top:1px solid rgba(255,255,255,.1); padding-top:10px; margin-top:2px; }
.portada-fecha-item { display:flex; flex-direction:column; gap:2px; }
.portada-fecha-label { font-size:.7rem; color:rgba(255,255,255,.4);
  text-transform:uppercase; letter-spacing:.06em; font-weight:700; }
.portada-fecha-val { font-size:.85rem; color:rgba(255,255,255,.75); font-weight:600; }

/* ── LOGIN ADMIN ── */
.login-wrap { min-height:100vh; display:flex; align-items:center; justify-content:center;
  background:linear-gradient(145deg,#0d2535,#163d5a); }
.login-card { background:#fff; border-radius:20px; padding:40px 36px; width:min(400px,92vw);
  box-shadow:0 24px 60px rgba(0,0,0,.3); text-align:center; }
.login-logo { font-size:3rem; margin-bottom:12px; }
.login-title { font-family:'Barlow Condensed',sans-serif; font-size:1.8rem; font-weight:800;
  color:var(--head); margin:0 0 4px; }
.login-sub { color:var(--muted); font-size:.9rem; margin:0 0 28px; }
.login-field { width:100%; padding:12px 14px; border:1px solid var(--border);
  border-radius:10px; font-size:1rem; font-family:'Barlow',sans-serif;
  margin-bottom:14px; box-sizing:border-box; transition:border-color .15s,box-shadow .15s; }
.login-field:focus { outline:none; border-color:var(--accent); box-shadow:var(--focus); }
.login-btn { width:100%; padding:13px; background:var(--head); color:#fff; border:none;
  border-radius:10px; font-family:'Barlow Condensed',sans-serif; font-size:1.1rem;
  font-weight:700; cursor:pointer; transition:filter .15s; }
.login-btn:hover { filter:brightness(1.15); }
.login-error { color:#dc2626; font-size:.88rem; margin-top:10px; min-height:20px; }

/* ── ADMIN LAYOUT ── */
.admin-nav { display:flex; gap:4px; flex-wrap:wrap; margin-bottom:24px; }
.admin-nav-btn { padding:9px 16px; border-radius:10px; border:1px solid var(--border);
  background:#fff; color:var(--muted); font-weight:700; font-size:.88rem; cursor:pointer;
  transition:background .12s,color .12s; }
.admin-nav-btn:hover, .admin-nav-btn.active { background:var(--head); color:#fff; border-color:var(--head); }
.admin-section { display:none; } .admin-section.active { display:block; }

/* ── TABLA PROMEDIOS ── */
.promedio-editado { opacity:.5; font-size:.75rem; }

/* ── TOAST ── */
.toast { position:fixed; bottom:24px; right:24px; background:var(--head); color:#fff;
  padding:12px 20px; border-radius:12px; font-weight:600; font-size:.9rem;
  box-shadow:0 8px 24px rgba(0,0,0,.25); z-index:9999; opacity:0;
  transform:translateY(12px); transition:opacity .25s,transform .25s; pointer-events:none; }
.toast.show { opacity:1; transform:translateY(0); }
.toast.ok   { background:#059669; }
.toast.err  { background:#dc2626; }

/* ── LOADING ── */
.loading-spinner { display:flex; align-items:center; justify-content:center;
  gap:12px; padding:48px; color:var(--muted); font-size:.95rem; }
.spinner { width:28px; height:28px; border:3px solid var(--border);
  border-top-color:var(--accent); border-radius:50%; animation:spin .7s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }

/* ── GOLEADORES INLINE FIXTURE ── */
.fixture-goleadores { margin-top:6px; display:flex; flex-direction:column; gap:3px; }
.fixture-gol-fila { padding:3px 8px; background:#f0fdf4; border-left:2px solid #86efac;
  border-radius:0 6px 6px 0; font-size:.81rem; color:#166534; line-height:1.5; }
.fixture-gol-equipo { font-weight:700; font-size:.71rem; color:#15803d;
  text-transform:uppercase; letter-spacing:.05em; }

/* ── COLORES TABLA POSICIONES ── */
tr.clasificado-sf td { background: rgba(14,165,233,.12); }
tr.clasificado-sf td:first-child { border-left: 3px solid var(--accent); }
tr.campeon-unica-row td { background: rgba(245,158,11,.15); }
tr.campeon-unica-row td:first-child { border-left: 3px solid var(--gold); }

/* ── SWATCH nuevos ── */
.swatch.clasificado-sf-sw { background: rgba(14,165,233,.45); }
.swatch.campeon-unica     { background: rgba(245,158,11,.6); }

/* ── PROMEDIOS: promo vs descenso ── */
tr.promo-row td { background: rgba(253,230,138,.35); }
tr.promo-row td:first-child { border-left: 3px solid #f59e0b; }
.swatch.promo-sw { background: rgba(245,158,11,.55); }

/* ── GUÍA FASE FINAL / REDUCIDO ── */
.guia-bloque { margin-bottom: 20px; padding: 16px; background: #f8fafc;
  border: 1px solid var(--border); border-radius: 12px; }
.guia-bloque-titulo { font-family: 'Barlow Condensed', sans-serif; font-size: 1rem;
  font-weight: 800; color: var(--head); margin-bottom: 10px; letter-spacing: .02em; }
.guia-cruces-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.guia-cruce-chip { display: flex; align-items: center; gap: 8px; padding: 7px 14px;
  background: #fff; border: 1px solid var(--border); border-radius: 999px;
  font-size: .88rem; font-weight: 600; color: var(--head); }
.guia-cruce-chip span { color: var(--muted); font-weight: 400; font-size: .8rem; }
.guia-lista { margin: 0; padding-left: 18px; }
.guia-lista li { font-size: .9rem; color: var(--text); line-height: 1.7; }

/* ── ESTADÍSTICAS — GRID PRINCIPAL ── */
.stats-principales-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 4px;
}
@media (max-width: 600px) {
  .stats-principales-grid { grid-template-columns: repeat(2, 1fr); }
}
.stat-principal {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 14px 14px;
  text-align: center;
  position: relative;
  transition: box-shadow .15s;
}
.stat-principal:hover { box-shadow: 0 4px 16px rgba(13,37,53,.1); }
.stat-principal-ico  { font-size: 1.5rem; margin-bottom: 6px; }
.stat-principal-valor {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 2.2rem; font-weight: 900;
  color: var(--head); line-height: 1;
}
.stat-principal-label {
  font-size: .78rem; color: var(--muted);
  font-weight: 600; margin-top: 4px;
  text-transform: uppercase; letter-spacing: .05em;
}
.stat-principal-pct {
  display: inline-block; margin-top: 6px;
  padding: 2px 9px; border-radius: 999px;
  font-size: .75rem; font-weight: 700;
  background: rgba(14,165,233,.12); color: var(--accent);
}
.stat-principal.stat-local   { border-top: 3px solid var(--win); }
.stat-principal.stat-visita  { border-top: 3px solid var(--loss); }
.stat-principal.stat-empate  { border-top: 3px solid var(--draw); }

/* ── PORTADA CARDS MÓVIL ── */
@media (max-width: 480px) {
  .portada-lideres { gap:4px; }
  .portada-lider { gap:6px; }
  .portada-lider-equipo { font-size:.82rem; }
  .portada-lider-pts { font-size:.75rem; }
  .portada-zona-titulo { font-size:.68rem; margin-bottom:1px; }
  .portada-fechas { gap:8px; }
  .portada-fecha-val { font-size:.8rem; }
  .portada-fecha-label { font-size:.66rem; }
  .torneo-card { padding:16px 18px; gap:8px; }
  .torneo-card-nombre { font-size:1.1rem; }
}

/* ── TABLA RESPONSIVE MÓVIL ── */
@media (max-width: 480px) {
  /* Posiciones: mostrar solo # Equipo PJ PTS DIF */
  #tab-posiciones th.forma, #tab-posiciones td.forma { display: none; }
  #tab-posiciones thead th:nth-child(5), #tab-posiciones tbody td:nth-child(5) { display: none; } /* PG */
  #tab-posiciones thead th:nth-child(6), #tab-posiciones tbody td:nth-child(6) { display: none; } /* PE */
  #tab-posiciones thead th:nth-child(7), #tab-posiciones tbody td:nth-child(7) { display: none; } /* PP */
  #tab-posiciones thead th:nth-child(8), #tab-posiciones tbody td:nth-child(8) { display: none; } /* GF */
  #tab-posiciones thead th:nth-child(9), #tab-posiciones tbody td:nth-child(9) { display: none; } /* GC */

  /* Leyenda de pie de página oculta en móvil */
  .leyenda { display: none; }

  /* Equipo: nombre completo y legible */
  th.team, td.team { width: auto !important; min-width: 120px; }
  .team-name { white-space: normal; word-break: break-word; font-size: .82rem; line-height: 1.2; }
  .pos-indicator { display: none; }

  /* Celdas compactas */
  thead th, tbody td { padding: 6px 4px; font-size: .82rem; }
  th.pos, td.pos { width: 28px; }

  /* Scroll suave */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { table-layout: auto; }
}

/* ── DETALLE GOLEADOR ── */
.gol-chevron { font-size: .7rem; color: var(--muted); margin-left: 4px; }
.gol-open .ranking-nombre { color: var(--head); }
.gol-detalle { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.gol-detalle-fila { display: flex; gap: 8px; align-items: center; padding: 5px 0;
  border-bottom: 1px solid #f0f4f8; font-size: .82rem; flex-wrap: wrap; }
.gol-detalle-fila:last-child { border-bottom: none; }
.gol-detalle-fecha { color: var(--muted); min-width: 58px; }
.gol-detalle-rival { flex: 1; font-weight: 600; color: var(--text); }
.gol-detalle-cant { background: var(--head); color: #fff; border-radius: 20px;
  padding: 2px 10px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.gol-detalle-vacio { color: var(--muted); font-size: .85rem; padding: 6px 0; }

/* ── CLUBES PARTICIPANTES — LAYOUT CON SIDEBAR ── */
.clubes-layout { display: flex; gap: 20px; align-items: flex-start; }
.clubes-main { flex: 1; min-width: 0; }
.clubes-sidebar { width: 260px; flex-shrink: 0; }
.aniv-card { padding: 16px 18px; }
.aniv-titulo { margin: 0 0 12px; font-family: 'Barlow Condensed', sans-serif;
  font-size: 1rem; font-weight: 800; color: var(--head);
  text-transform: uppercase; letter-spacing: .04em; }
.aniv-fila { display: flex; justify-content: space-between; align-items: flex-start;
  gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.aniv-fila:last-child { border-bottom: none; }
.aniv-nombre { font-weight: 600; font-size: .88rem; color: var(--text); }
.aniv-det { text-align: right; flex-shrink: 0; }
.aniv-fecha { display: block; font-size: .78rem; color: var(--muted); }
.aniv-anios { font-size: .75rem; color: var(--muted-2); font-weight: 600; }
@media (max-width: 700px) {
  .clubes-layout { flex-direction: column; }
  .clubes-sidebar { width: 100%; order: -1; }
}

/* ── CLASES MIGRADAS DESDE ESTILOS INLINE ── */

/* Fixture */
.partido-goles-label { font-size:.8rem; color:var(--muted); margin-top:4px; }
.vs-sep { color:var(--muted); }
.txt-muted { color:var(--muted); }

/* Goleadores */
.ranking-fila { cursor:pointer; }

/* Estado box */
.estado-box-mb { margin-bottom:16px; }

/* Fase final */
.fase-desc { font-size:.9rem; color:var(--muted); margin:0 0 12px; line-height:1.6; }
.fase-bloque-mt { margin-top:20px; }
.match-card-mb { margin-bottom:12px; }
.badge-consagracion { margin-top:12px; display:inline-flex; }

/* Cards con separación */
.card-mt-20 { margin-top:20px; }
.card-mt-24 { margin-top:24px; }
.mt-10 { margin-top:10px; }

/* Estadísticas — barra */
.stats-bar-track { background:#eef3f9; border-radius:6px; height:12px; margin-top:8px; overflow:hidden; }
.stats-bar-fill  { height:100%; border-radius:6px; transition:width .7s ease; }

/* Estadísticas — distribución */
.stats-charts-grid-mt { margin-top:24px; }
.stats-dist-col  { display:flex; flex-direction:column; gap:16px; margin-top:4px; }
.stats-dist-row  { display:flex; justify-content:space-between; font-size:.9rem; }
.stats-pct-muted { color:var(--muted); font-weight:400; }
.stats-progreso-label { display:flex; justify-content:space-between; font-size:.9rem; margin-bottom:6px; }
.stats-chips-grid { margin-top:16px; display:grid; grid-template-columns:1fr 1fr; gap:10px; }

/* Partido con más goles */
.mas-goles-card    { margin-top:24px; padding:16px; background:#f8fafc; border:1px solid var(--border); border-radius:12px; }
.mas-goles-titulo  { font-size:.78rem; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.06em; margin-bottom:10px; }
.mas-goles-row     { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; }
.mas-goles-resultado { font-weight:700; font-size:1rem; color:var(--text); }
.mas-goles-marcador  { color:var(--head); }
.mas-goles-meta    { display:flex; gap:8px; flex-wrap:wrap; }
.mas-goles-chip    { background:#eef3f9; color:var(--muted); border-radius:20px; padding:3px 12px; font-size:.8rem; }

/* Palmarés */
.palmares-vacio    { color:var(--muted); text-align:center; padding:20px; }
.th-torneo         { width:160px; }
.palmares-covid-cell { color:var(--muted); font-style:italic; }
.palmares-nota-cell  { color:var(--muted); font-size:.83rem; }

/* ── FICHA DEL CLUB ── */
.ficha-club { margin-bottom:16px; padding:14px 16px;
  background:linear-gradient(135deg,#f0f7ff,#f8fafc);
  border:1px solid #dbeafe; border-radius:12px; }
.ficha-club-titulo { font-size:.75rem; font-weight:700; color:var(--head);
  text-transform:uppercase; letter-spacing:.08em; margin-bottom:10px; }
.ficha-club-grid { display:flex; flex-direction:column; gap:6px; }
.ficha-item { display:flex; gap:10px; align-items:baseline; font-size:.87rem; }
.ficha-label { color:var(--muted); min-width:110px; flex-shrink:0; font-size:.82rem; }
.ficha-val { color:var(--text); font-weight:500; }

@media (max-width:480px) {
  .ficha-label { min-width:90px; font-size:.78rem; }
  .ficha-val { font-size:.82rem; }
}

/* ── CLUBES PARTICIPANTES TAB ── */
.club-row { border-bottom:1px solid var(--border); }
.club-row:last-child { border-bottom:none; }
.club-row-btn { width:100%; display:flex; align-items:center; justify-content:space-between;
  padding:14px 4px; background:none; border:none; cursor:pointer; font-family:inherit;
  text-align:left; transition:background .15s; }
.club-row-btn:hover { background:#f0f7ff; border-radius:8px; }
.club-row-open .club-row-btn { color:var(--head); }
.club-row-nombre { font-weight:600; font-size:.95rem; color:var(--text); flex:1; text-align:left; }
.club-row-open .club-row-nombre { color:var(--head); }
.club-row-chevron { font-size:.75rem; color:var(--muted); }
.ficha-club-inline { margin:0 4px 12px; }

/* ── ESTADÍSTICAS HISTÓRICAS ──────────────────────────────────── */

/* Botón Historial */
.btn-historial { background:var(--accent); color:#fff; border:none;
  border-radius:8px; padding:8px 18px; font-size:13px; font-weight:700;
  cursor:pointer; margin-top:10px; font-family:inherit; display:inline-block; }
.btn-historial:hover { opacity:.85; }

/* Modal overlay */
.est-modal-overlay { position:fixed; inset:0; background:rgba(0,0,0,.72);
  display:flex; align-items:stretch; justify-content:stretch;
  z-index:9999; }
.est-modal-overlay[hidden] { display:none; }
.est-modal-box { background:var(--card); width:100%; height:100%;
  overflow-y:auto; overflow-x:hidden; padding:24px 32px; position:relative; }
@media (max-width:700px) {
  .est-modal-box { padding:60px 14px 24px; }
}
.est-loading { display:flex; align-items:center; gap:12px; justify-content:center;
  padding:60px 0; color:var(--muted); font-size:14px; }
.est-spinner { width:22px; height:22px; border:3px solid var(--border);
  border-top-color:var(--accent); border-radius:50%;
  animation:est-spin .7s linear infinite; flex-shrink:0; }
@keyframes est-spin { to { transform:rotate(360deg); } }
.est-modal-close { position:fixed; top:16px; right:20px;
  background:var(--bg-soft); border:1px solid var(--border); border-radius:6px;
  color:var(--muted); cursor:pointer; font-size:16px; padding:6px 12px;
  font-family:inherit; z-index:10000; }
.est-modal-close:hover { background:var(--border); color:var(--text); }
.est-modal-header { margin-bottom:20px; padding-bottom:14px; border-bottom:1px solid var(--border); }
.est-modal-title { font-size:22px; font-weight:700; color:var(--text); margin:0; }
.est-modal-title span { font-size:15px; font-weight:400; color:var(--muted); margin-left:6px; }

.est-hist-card { background:transparent; border:none; padding:0; }
#est-historica-table { overflow-x:auto; }

/* ── Torneos: layout tabla + fixture colapsable ── */
.est-tor-layout { display:flex; gap:20px; align-items:flex-start; flex-wrap:wrap; }
.est-tor-tabla  { flex:1; min-width:0; background:var(--card);
  border:1px solid var(--border); border-radius:8px; padding:12px; overflow-x:auto; }
.est-fix-wrap   { min-width:260px; max-width:380px; flex-shrink:0;
  background:var(--card); border:1px solid var(--border); border-radius:8px; padding:12px; }
.est-fix-grupo  { border:1px solid var(--border); border-radius:6px; margin-bottom:5px; overflow:hidden; }
.est-fix-btn    { width:100%; background:var(--hover); border:none; padding:6px 12px;
  font-size:12px; font-weight:600; cursor:pointer; display:flex;
  justify-content:space-between; align-items:center; color:var(--fg); }
.est-fix-btn:hover { background:var(--border); }
.est-fix-arr    { font-size:10px; transition:transform .15s; }
.est-fix-grupo.open .est-fix-arr { transform:rotate(180deg); }
.est-fix-rows   { display:none; }
.est-fix-grupo.open .est-fix-rows { display:block; }
.est-fix-row    { display:grid; grid-template-columns:1fr 52px 1fr; gap:4px;
  align-items:center; padding:4px 10px; font-size:12px;
  border-top:1px solid var(--border); }
.est-fix-row:first-child { border-top:none; }
.est-fix-loc    { text-align:right; }
.est-fix-vis    { text-align:left; }
.est-fix-score  { text-align:center; font-weight:700; color:var(--accent); white-space:nowrap; }

/* Gráfico de evolución */

/* ── Layout Oficial: tabla anual + final en fila ── */
.est-oficial-layout { display:flex; gap:16px; align-items:flex-start; flex-wrap:wrap; }
.est-oficial-tabla  { flex:1; min-width:0; background:var(--card);
  border:1px solid var(--border); border-radius:8px; padding:12px; overflow-x:auto; }
.est-oficial-final  { min-width:240px; max-width:340px; flex-shrink:0;
  background:var(--bg-soft); border:2px solid var(--accent);
  border-radius:8px; padding:12px; }

/* ── Serie Final (panel Torneos, tipo Oficial) ── */
.est-final-matches { display:flex; flex-direction:column; gap:4px; margin-bottom:8px; }
.est-final-row { display:flex; align-items:center; gap:8px; padding:6px 10px;
  background:var(--bg-soft); border-radius:6px; font-size:12px; flex-wrap:wrap; }
.est-final-num   { color:var(--muted); width:64px; flex-shrink:0; }
.est-final-local { flex:1; text-align:right; font-weight:600; }
.est-final-score { font-weight:800; color:var(--accent); width:44px;
  text-align:center; flex-shrink:0; }
.est-final-visit { flex:1; font-weight:600; }
.est-final-fecha { color:var(--muted); font-size:11px; flex-shrink:0; }
.est-final-pen   { color:var(--muted); font-size:11px; font-style:italic; padding:2px 10px 6px; }
.est-final-subtitle { font-size:12px; color:var(--muted); margin-bottom:8px; }
.est-final-campeon { margin-top:10px; font-size:13px; font-weight:700;
  color:var(--accent); padding:8px 14px; background:var(--bg-soft);
  border-radius:8px; border:1px solid var(--accent); display:inline-block; }

.est-nav-tabs { display:flex; gap:4px; margin-bottom:12px; flex-wrap:wrap; }
.est-tab { background:transparent; border:1px solid var(--border); border-radius:6px;
  padding:5px 9px; font-size:11px; font-weight:600; cursor:pointer;
  color:var(--muted); transition:all .15s; font-family:inherit; }
.est-tab:hover { background:var(--bg-soft); color:var(--text); }
.est-tab.active { background:var(--accent); color:#fff; border-color:var(--accent); }

.est-panel { display:none; }
.est-panel.active { display:block; }

.est-controls { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:10px; align-items:center; }
.est-controls label { font-size:11px; color:var(--muted); }
.est-controls select, .est-controls input[type="text"] {
  background:var(--bg-soft); color:var(--text); border:1px solid var(--border);
  padding:5px 8px; border-radius:6px; font-size:11px; font-family:inherit; outline:none; }
.est-controls select:focus, .est-controls input:focus { border-color:var(--accent); }
.est-search { flex:1; min-width:120px; }

.est-stats-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-bottom:10px; }
.est-stat-chip { background:var(--bg-soft); border:1px solid var(--border);
  border-radius:8px; padding:8px 6px; text-align:center; }
.est-stat-chip .val { font-size:18px; font-weight:800; color:var(--head); line-height:1.1; }
.est-stat-chip .lbl { font-size:10px; color:var(--muted); margin-top:2px; }

.est-tbl-wrap { overflow-x:auto; border-radius:6px; border:1px solid var(--border); margin-top:4px; width:fit-content; max-width:100%; }
.est-tbl-wrap table { width:auto; border-collapse:collapse; font-size:11px; table-layout:auto; }
.est-tbl-wrap th { background:var(--bg-soft); padding:6px 7px; text-align:center;
  border-bottom:1px solid var(--border); color:var(--muted); font-weight:700;
  font-size:10px; text-transform:uppercase; white-space:nowrap; }
.est-tbl-wrap th:nth-child(2) { text-align:left; }
.est-tbl-wrap td { padding:5px 7px; border-bottom:1px solid var(--border); text-align:center; white-space:nowrap; }
.est-tbl-wrap td:nth-child(2) { text-align:left; }
.est-rec-tbl th, .est-rec-tbl td { text-align:left; }
.est-tbl-wrap tr:last-child td { border-bottom:none; }
.est-tbl-wrap tr:hover td { background:var(--hover); }
.est-tbl-wrap td.est-pts { font-weight:700; }
.est-tbl-wrap td.est-score { font-weight:700; font-size:13px; text-align:center; min-width:50px; }
.est-pos-1 td:first-child { color:var(--gold); font-weight:700; }
.est-pos-2 td:first-child { color:var(--silver); font-weight:700; }
.est-pos-3 td:first-child { color:#cd7f32; font-weight:700; }
.est-win  { color:var(--win); }
.est-loss { color:var(--loss); }
.est-draw { color:var(--draw); }

.est-badge { display:inline-block; padding:2px 7px; border-radius:10px;
  font-size:10px; font-weight:700; margin-right:4px; }
.est-badge-ap { background:#e0f2fe; color:#0369a1; }
.est-badge-cl { background:#ede9fe; color:#6d28d9; }
.est-badge-of { background:#fef3c7; color:#92400e; }

.est-no-data { color:var(--muted); text-align:center; padding:20px; font-style:italic; font-size:12px; }
.est-rec-section { margin-bottom:10px; }
.est-rec-section-title { font-size:10px; color:var(--muted); text-transform:uppercase;
  letter-spacing:.05em; margin:12px 0 6px; font-weight:700; }
.est-rec-subtabs { display:flex; gap:6px; margin-bottom:12px; padding-bottom:10px; border-bottom:1px solid var(--border); }
.est-rec-subtab { background:none; border:1px solid var(--border); border-radius:6px; padding:4px 13px;
  font-size:12px; font-weight:600; cursor:pointer; color:var(--muted); transition:all .15s; }
.est-rec-subtab.active { background:var(--accent); border-color:var(--accent); color:#fff; }
.est-rec-subtab:hover:not(.active) { background:var(--hover); color:var(--fg); }
.est-bal-club { font-weight:700; color:var(--head); }

/* ── Ascensos y Descensos ───────────────────────────────────── */
.est-inter-year-block { border-bottom:1px solid var(--border); padding:10px 0; }
.est-inter-year-block:last-child { border-bottom:none; }
.est-inter-year { font-size:13px; font-weight:800; color:var(--head); margin-bottom:6px; }
.est-inter-nota { font-size:11px; color:var(--muted); font-style:italic; margin-bottom:6px;
  padding:4px 8px; background:var(--bg-soft); border-radius:5px; border-left:3px solid var(--border); }
.est-inter-cols { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.est-inter-col-hdr { font-size:10px; font-weight:700; text-transform:uppercase;
  letter-spacing:.05em; margin-bottom:4px; }
.est-inter-col-hdr--asc { color:#16a34a; }
.est-inter-col-hdr--des { color:#dc2626; }
.est-inter-row { display:flex; align-items:center; gap:5px; margin-bottom:3px; flex-wrap:wrap; }
.est-inter-badge { display:inline-block; padding:2px 8px; border-radius:10px;
  font-size:11px; font-weight:600; }
.est-inter-badge--asc { background:#dcfce7; color:#166534; border:1px solid #86efac; }
.est-inter-badge--des { background:#fee2e2; color:#991b1b; border:1px solid #fca5a5; }
.est-inter-tipo { display:inline-block; font-size:9px; font-weight:700; padding:1px 5px;
  border-radius:4px; text-transform:uppercase; letter-spacing:.04em; }
.est-inter-tipo--directo     { background:#16a34a; color:#fff; }
.est-inter-tipo--promocion   { background:transparent; color:#16a34a; border:1px solid #16a34a; }
.est-inter-tipo--reducido    { background:transparent; color:#0ea5e9; border:1px dashed #0ea5e9; }
.est-inter-tipo--desafiliado { background:#f1f5f9; color:var(--muted); border:1px solid var(--border); }
.est-inter-row--pos td { background:rgba(220,252,231,.35); }
.est-inter-row--neg td { background:rgba(254,226,226,.35); }
.est-inter-asc-count { color:#166534; font-weight:700; }
.est-inter-des-count { color:#991b1b; font-weight:700; }
.est-inter-bal { font-weight:800; }
.est-inter-bal--pos { color:#16a34a; }
.est-inter-bal--neg { color:#dc2626; }
@media (max-width:500px) { .est-inter-cols { grid-template-columns:1fr; } }

.est-inter-tip-target { cursor:default; text-decoration:underline dotted; text-underline-offset:3px; }
.est-inter-tip {
  display: none;
  position: fixed;
  z-index: 9999;
  background: #1e293b;
  color: #f1f5f9;
  padding: 7px 11px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.7;
  white-space: pre;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(0,0,0,.35);
}


/* ===== Detalle de Torneo ===== */
.det-wrap{max-width:760px;margin:0 auto;padding:0 0 60px}
.det-volver{display:inline-flex;align-items:center;gap:6px;color:rgba(255,255,255,.55);font-size:.85rem;text-decoration:none;margin-bottom:20px;letter-spacing:.03em;transition:color .2s}
.det-volver:hover{color:#fff}
.det-header{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-bottom:24px}
.det-nombre{font-size:2rem;font-weight:800;color:#fff;margin:0;width:100%;font-family:'Barlow Condensed',sans-serif;text-transform:uppercase;letter-spacing:.02em}
.det-tabs{display:flex;gap:2px;margin-bottom:20px;border-bottom:2px solid rgba(255,255,255,.1);overflow-x:auto}
.det-tab{background:none;border:none;color:rgba(255,255,255,.45);font-family:'Barlow Condensed',sans-serif;font-size:1rem;font-weight:700;letter-spacing:.07em;text-transform:uppercase;padding:8px 16px;cursor:pointer;border-bottom:2px solid transparent;margin-bottom:-2px;transition:color .2s,border-color .2s;white-space:nowrap}
.det-tab:hover{color:rgba(255,255,255,.8)}
.det-tab.active{color:#fff;border-bottom-color:#4fc3f7}
.det-zona-title{font-family:'Barlow Condensed',sans-serif;font-size:.72rem;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:rgba(255,255,255,.35);margin:20px 0 6px;padding-bottom:4px;border-bottom:1px solid rgba(255,255,255,.08)}
.det-tabla-wrap{overflow-x:auto;margin-bottom:4px;border:none}
/* Override global table styles */
.det-tabla{width:100%;border-collapse:collapse;font-size:.88rem;background:transparent;table-layout:auto}
.det-tabla thead th{background:rgba(255,255,255,.06);color:rgba(255,255,255,.4);padding:8px 8px;text-align:center;font-family:'Barlow Condensed',sans-serif;font-weight:700;letter-spacing:.06em;text-transform:uppercase;font-size:.72rem;border-bottom:1px solid rgba(255,255,255,.1);white-space:nowrap;height:auto}
.det-tabla thead th:nth-child(2){text-align:left}
.det-tabla tbody td{background:transparent;padding:9px 8px;text-align:center;color:rgba(255,255,255,.8);border-bottom:1px solid rgba(255,255,255,.06);font-size:.88rem;white-space:nowrap;height:auto}
.det-tabla tbody td:nth-child(2){text-align:left}
.det-tabla tbody tr:nth-child(even){background:transparent}
.det-tabla tbody tr:hover td{background:rgba(255,255,255,.04)}
.det-tabla tbody tr:last-child td{border-bottom:none}
.det-pts{font-weight:700;color:#fff!important}
.det-equipo{font-weight:600}
.det-fecha{margin-bottom:5px;background:rgba(255,255,255,.04);border-radius:8px;overflow:hidden}
.det-fecha summary{padding:10px 14px;font-family:'Barlow Condensed',sans-serif;font-weight:700;letter-spacing:.06em;text-transform:uppercase;font-size:.88rem;color:rgba(255,255,255,.75);cursor:pointer;list-style:none;display:flex;justify-content:space-between;align-items:center;-webkit-tap-highlight-color:transparent}
.det-fecha summary::-webkit-details-marker{display:none}
.det-fecha summary::after{content:'▸';font-size:.75rem;color:rgba(255,255,255,.3);flex-shrink:0}
.det-fecha[open] summary::after{content:'▾'}
.det-fecha-body{padding:4px 0 8px}
.det-partido{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:8px;padding:5px 14px}
.det-local{text-align:right;font-size:.85rem;color:rgba(255,255,255,.8);line-height:1.2}
.det-visit{text-align:left;font-size:.85rem;color:rgba(255,255,255,.8);line-height:1.2}
.det-score{font-family:'Barlow Condensed',sans-serif;font-size:1.05rem;font-weight:800;color:#fff;text-align:center;white-space:nowrap;background:rgba(255,255,255,.1);border-radius:4px;padding:2px 10px;min-width:50px}
.det-score-pend{font-family:'Barlow Condensed',sans-serif;font-size:.75rem;font-weight:600;color:rgba(255,255,255,.3);text-align:center;white-space:nowrap;background:rgba(255,255,255,.04);border-radius:4px;padding:2px 10px;min-width:50px}
.det-gol-row{display:flex;align-items:center;gap:12px;padding:8px 0;border-bottom:1px solid rgba(255,255,255,.06)}
.det-gol-row:last-child{border-bottom:none}
.det-gol-num{font-family:'Barlow Condensed',sans-serif;font-size:1.5rem;font-weight:800;color:#4fc3f7;min-width:30px;text-align:right;flex-shrink:0}
.det-gol-nombre{font-weight:600;font-size:.9rem;color:#fff}
.det-gol-equipo{font-size:.78rem;color:rgba(255,255,255,.45);margin-top:1px}
.det-empty{color:rgba(255,255,255,.35);text-align:center;padding:32px 0;font-size:.88rem}
.det-goles-sub{padding-top:0;padding-bottom:6px}
.det-goles-sub .det-local,.det-goles-sub .det-visit{font-size:.72rem;color:rgba(255,255,255,.4);font-weight:400}
.det-ec{color:#f87171;font-style:italic}
.det-libre{font-size:.78rem;color:rgba(255,255,255,.45);padding:3px 14px 5px;font-style:italic}

/* ===== Camisetas ===== */
/* Alineación en tablas y listas */
.team-name      { display:inline-flex; align-items:center; gap:5px; }
.ranking-equipo { display:inline-flex; align-items:center; gap:5px; flex-wrap:wrap; }
.club-row-btn   { display:flex; align-items:center; gap:8px; }
.palmares-club-info { display:inline-flex; align-items:center; gap:6px; }

/* Editor de camiseta (secretaria.html) */
.cf-patron-grid { display:flex; gap:8px; flex-wrap:wrap; margin:6px 0 10px; }
.cf-patron-opt  { display:flex; flex-direction:column; align-items:center; gap:3px;
  padding:7px 10px; border:2px solid var(--border); border-radius:10px; cursor:pointer;
  background:#fff; transition:border-color .15s, background .15s; }
.cf-patron-opt.active { border-color:#0ea5e9; background:#f0f9ff; }
.cf-patron-opt span   { font-size:.7rem; font-weight:700; color:var(--muted); text-align:center; white-space:nowrap; }
.cf-colores-row       { display:flex; gap:16px; align-items:flex-end; flex-wrap:wrap; margin-bottom:10px; }
.cf-color-group       { display:flex; flex-direction:column; gap:4px; transition:opacity .2s; }
.cf-color-group label { font-size:.78rem; font-weight:600; color:var(--muted); }
.cf-color-input { width:44px; height:36px; padding:2px; border:1px solid var(--border);
  border-radius:8px; cursor:pointer; background:none; }

/* ===== Footer ===== */
.site-footer{margin-top:0;padding:24px 20px 32px;border-top:1px solid rgba(255,255,255,.1);text-align:center;background:linear-gradient(145deg,#0d2535,#163d5a)}
.site-footer-fuentes{font-size:.78rem;color:rgba(255,255,255,1);line-height:1.6;margin:0 0 8px}
.site-footer-libre{font-size:.75rem;color:rgba(255,255,255,.8);margin:0;font-style:italic}
/* Footer variante clara (torneo.html, secretaria.html) */
.site-footer--light{background:var(--bg-soft,#f4f8fd);border-top:1px solid var(--border,#d1dce8)}
.site-footer--light .site-footer-fuentes{color:var(--muted,#6b7e94)}
.site-footer--light .site-footer-libre{color:var(--muted,#6b7e94)}

/* ===== Botón Compartir (dark context — torneo.html header) ===== */
.header-top-bar{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}
.header-top-bar .btn-volver{margin-bottom:0}
.btn-share{display:inline-flex;align-items:center;gap:6px;padding:6px 14px;
  border-radius:8px;border:1px solid rgba(255,255,255,.2);background:rgba(255,255,255,.08);
  color:rgba(255,255,255,.75);font-size:.82rem;font-weight:600;cursor:pointer;
  font-family:'Barlow',sans-serif;transition:background .15s,color .15s,border-color .15s;white-space:nowrap}
.btn-share:hover{background:rgba(255,255,255,.18);color:#fff}
.btn-share.copiado{border-color:rgba(16,185,129,.5);background:rgba(16,185,129,.12);color:#6ee7b7}
/* Botón Compartir — variante clara (index.html det-header) */
.det-share{display:inline-flex;align-items:center;gap:5px;padding:5px 12px;
  border-radius:8px;border:1px solid var(--border);background:transparent;
  color:var(--muted);font-size:.78rem;font-weight:600;cursor:pointer;
  font-family:'Barlow',sans-serif;transition:background .12s,color .12s,border-color .12s;margin-top:6px}
.det-share:hover{background:var(--bg-soft);color:var(--head)}
.det-share.copiado{border-color:#059669;color:#059669;background:rgba(5,150,105,.06)}
/* Loading portada (dark context) */
.portada-loading{display:flex;align-items:center;justify-content:center;gap:10px;
  padding:40px 0;color:rgba(255,255,255,.4);font-size:.9rem}
.portada-spinner{width:20px;height:20px;border:2px solid rgba(255,255,255,.15);
  border-top-color:rgba(255,255,255,.6);border-radius:50%;flex-shrink:0;
  animation:est-spin .7s linear infinite}
