:root {
  --bg: #f4f6fb;
  --bg2: #ffffff;
  --bg3: #eaecf3;
  --surface: #ffffff;
  --border: rgba(0,0,0,0.07);
  --border2: rgba(0,0,0,0.13);
  --text: #1a1d2e;
  --muted: #6b7390;
  --accent: #1a56db;
  --accent2: #1e429f;
  --gold: #f59e0b;
  --silver: #9ca3af;
  --bronze: #b45309;
  --green: #059669;
  --orange: #d97706;
  --red: #dc2626;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,0.07), 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.10), 0 2px 6px rgba(0,0,0,0.06);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Barlow', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
}

/* ── AD CAROUSEL ── */
#adCarousel {
  display: none;
  width: 100%;
  aspect-ratio: 16 / 3;
  max-height: 130px;
  position: relative;
  overflow: hidden;
  background: #0f1923;
}
.ad-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.7s ease;
  text-decoration: none;
  display: block;
}
.ad-slide.active { opacity: 1; }
.ad-slide img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.ad-tag { position:absolute;top:10px;right:10px;background:rgba(0,0,0,.45);color:#fff;font-size:8px;font-weight:900;letter-spacing:.18em;text-transform:uppercase;padding:3px 8px;border-radius:4px;backdrop-filter:blur(6px);border:1px solid rgba(255,255,255,.1);z-index:10;pointer-events:none }
.ad-arrow { position:absolute;top:50%;transform:translateY(-50%);width:34px;height:34px;border-radius:50%;background:rgba(0,0,0,.35);border:none;color:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer;backdrop-filter:blur(6px);z-index:20;opacity:0;transition:opacity .2s;padding:0 }
#adCarousel:hover .ad-arrow { opacity:1 }
.ad-arrow.prev { left:12px }
.ad-arrow.next { right:12px }
.ad-dots { position:absolute;bottom:8px;left:50%;transform:translateX(-50%);display:flex;gap:6px;z-index:20 }
.ad-dot { width:6px;height:6px;border-radius:50%;background:rgba(255,255,255,.35);border:none;cursor:pointer;padding:0;transition:all .3s }
.ad-dot.active { width:18px;border-radius:3px;background:#fff }

/* ── HEADER ── */
.site-header {
  background: #0f1923;
  color: #fff;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(0,0,0,0.18);
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.header-brand { display: flex; align-items: center; gap: 12px; }
.header-logo-wrap {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.18);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.header-logo-wrap img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.header-info { display: flex; flex-direction: column; gap: 1px; }
.logo-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-size: 21px;
  letter-spacing: 0.5px;
  color: #ffffff;
  text-transform: uppercase;
  line-height: 1;
}
.logo-sub {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: #94a3b8;
  text-transform: uppercase;
}
.header-right { display: flex; align-items: center; gap: 10px; }

/* badge ACTIVO — torneo activo */
.activo-badge {
  display: none;
  align-items: center;
  gap: 5px;
  background: rgba(5,150,105,0.2);
  border: 1px solid rgba(5,150,105,0.4);
  border-radius: 20px;
  padding: 4px 10px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #6ee7b7;
}
.activo-badge.show { display: flex; }
.activo-dot { width: 6px; height: 6px; background: #34d399; border-radius: 50%; }

/* badge actualización en vivo (realtime) */
.live-badge {
  display: none;
  align-items: center;
  gap: 5px;
  background: rgba(220,38,38,0.15);
  border: 1px solid rgba(220,38,38,0.3);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #fca5a5;
  animation: pulse-badge 2s infinite;
}
.live-badge.show { display: flex; }
@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
.live-dot { width: 7px; height: 7px; background: #f87171; border-radius: 50%; animation: pulse-dot 1.5s infinite; }
@keyframes pulse-dot { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.4); opacity: 0.7; } }

.btn-admin {
  font-family: 'Barlow', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 7px;
  padding: 6px 14px;
  text-decoration: none;
  transition: background 0.2s;
}
.btn-admin:hover { background: rgba(255,255,255,0.12); color: #fff; }

/* ── MAIN CONTAINER ── */
.container { max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px; }

/* ── META BAR ── */
.meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}
.last-updated { font-size: 12px; color: var(--muted); }

/* ── CATEGORY TABS ── */
.category-scroll-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  margin-bottom: 20px;
  scrollbar-width: none;
}
.category-scroll-wrap::-webkit-scrollbar { display: none; }
.category-tabs {
  display: flex;
  gap: 8px;
  white-space: nowrap;
  min-width: max-content;
}
.cat-pill {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 7px 18px;
  border-radius: 30px;
  border: 2px solid var(--border2);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.cat-pill:hover { border-color: var(--accent); color: var(--accent); }
.cat-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 2px 10px rgba(26,86,219,0.3);
}

/* ── NAV BAR (tabs debajo del header) ── */
.portal-nav {
  position: sticky;
  top: 56px;
  z-index: 95;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.portal-nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.portal-nav-inner::-webkit-scrollbar { display: none; }
.view-tab {
  font-family: 'Barlow', sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 14px 20px;
  border: none;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: -1px;
}
.view-tab svg { opacity: 0.5; }
.view-tab:hover { color: var(--text); }
.view-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 700;
}
.view-tab.active svg { opacity: 1; }

/* ── VIEW PANELS ── */
.view-panel { display: none; }
.view-panel.active { display: block; }

/* ── JORNADA SELECTOR ── */
.jornada-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.jornada-btn {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 6px 14px;
  border-radius: 7px;
  border: 1.5px solid var(--border2);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
  text-transform: uppercase;
}
.jornada-btn:hover { border-color: var(--accent); color: var(--accent); }
.jornada-group-head {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 10px 0 -2px;
}
.jornada-group-head:first-child { margin-top: 0; }
.jg-num {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 28px; padding: 0 8px; border-radius: 8px;
  background: var(--text); color: #fff;
  font-family: 'Barlow Condensed', sans-serif; font-size: 15px; font-weight: 800;
}
.jg-name { font-family: 'Barlow Condensed', sans-serif; font-size: 20px; font-weight: 800; text-transform: uppercase; }
.jg-meta { font-size: 13px; color: var(--muted); }
.jg-meta::before { content: '·'; margin-right: 10px; }
.jornada-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── TEAM FILTER ── */
.team-filter-wrap {
  margin-bottom: 18px;
}
.team-filter-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  margin-bottom: 8px;
}
.team-filter-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.team-filter-scroll::-webkit-scrollbar { display: none; }
.team-filter-pills {
  display: flex;
  gap: 6px;
  white-space: nowrap;
  min-width: max-content;
}
.team-pill {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border2);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.team-pill:hover { border-color: var(--accent); color: var(--accent); }
.team-pill.active {
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.team-pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── GAME CARDS GRID ── */
.games-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.game-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border-left: 4px solid var(--accent);
  transition: box-shadow 0.2s, transform 0.15s;
  position: relative;
}
.game-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--border);
}
.card-category-tag {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent);
  background: rgba(26,86,219,0.08);
  border-radius: 4px;
  padding: 2px 7px;
}
.card-date {
  font-size: 11px;
  color: var(--muted);
}

.card-matchup {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.team-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.team-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.team-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--accent);
}
.team-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}
.team-score {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  min-width: 36px;
  text-align: right;
}
.team-row.winner .team-name,
.team-row.winner .team-score { color: var(--text); }
.team-row.loser .team-name,
.team-row.loser .team-score { color: var(--muted); }
.team-row.pending .team-name,
.team-row.pending .team-score { color: var(--text); }

.score-divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  margin: 2px 0;
}

.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px 10px;
  border-top: 1px solid var(--border);
}
.card-jornada-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}

.estado-chip {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 9px;
  border-radius: 20px;
}
.estado-chip.finalizado { background: #d1fae5; color: #065f46; }
.estado-chip.en_curso {
  background: #fee2e2;
  color: #991b1b;
  animation: pulse-chip 1.5s infinite;
}
@keyframes pulse-chip { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
.estado-chip.pendiente { background: var(--bg3); color: var(--muted); }

/* ── SKELETON ── */
.skeleton-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-left: 4px solid var(--bg3);
  padding: 14px;
  height: 130px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.skel-line {
  background: var(--bg3);
  border-radius: 6px;
  animation: shimmer 1.4s infinite linear;
  background: linear-gradient(90deg, var(--bg3) 25%, #d8dce8 50%, var(--bg3) 75%);
  background-size: 200% 100%;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.skel-line.h12 { height: 12px; }
.skel-line.h20 { height: 20px; }
.skel-line.h28 { height: 28px; }
.skel-line.w40 { width: 40%; }
.skel-line.w60 { width: 60%; }
.skel-line.w80 { width: 80%; }
.skel-line.w100 { width: 100%; }

/* ── EMPTY / ERROR ── */
.empty-state, .error-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
}
.empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-msg { font-family: 'Barlow Condensed', sans-serif; font-size: 18px; font-weight: 700; color: var(--text); }
.empty-sub { font-size: 14px; margin-top: 4px; }
.error-state .empty-msg { color: var(--red); }

/* ── VER MÁS ── */
.ver-mas-wrap { text-align: center; margin-top: 20px; }
.btn-ver-mas {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 10px 28px;
  border-radius: 8px;
  border: 2px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-ver-mas:hover { background: var(--accent); color: #fff; }

/* ── STANDINGS ── */
.podium-wrap {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
  margin-bottom: 28px;
  padding: 20px 0 0;
}
.podium-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.podium-medal { font-size: 26px; line-height: 1; }
.podium-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  text-align: center;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.podium-pts {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border-radius: 20px;
  padding: 3px 10px;
}
.podium-column {
  border-radius: 8px 8px 0 0;
  width: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.podium-rank-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 20px;
  font-weight: 900;
  color: rgba(255,255,255,0.7);
}
.podium-block.p1 .podium-column { background: linear-gradient(180deg,#f6d860,#d97706); height: 90px; }
.podium-block.p2 .podium-column { background: linear-gradient(180deg,#d1d5db,#9ca3af); height: 65px; }
.podium-block.p3 .podium-column { background: linear-gradient(180deg,#e5c594,#92400e); height: 50px; }
.podium-block.p1 .podium-pts { background: #d97706; }
.podium-block.p2 .podium-pts { background: #6b7280; }
.podium-block.p3 .podium-pts { background: #92400e; }

.standings-table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); }
.standings-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-family: 'Barlow', sans-serif;
  font-size: 14px;
}
.standings-table th {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  background: var(--bg3);
  padding: 10px 12px;
  text-align: center;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: color 0.15s;
}
.standings-table th:hover { color: var(--accent); }
.standings-table th.sorted { color: var(--accent); }
.sort-arrow { margin-left: 4px; font-size: 10px; }
.standings-table th:first-child,
.standings-table td:first-child { text-align: center; padding-left: 14px; }
.standings-table td {
  padding: 11px 12px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.standings-table tbody tr:last-child td { border-bottom: none; }
.standings-table tbody tr:hover { background: var(--bg); }
.standings-table tbody tr.rank-1 td:first-child { border-left: 4px solid var(--gold); }
.standings-table tbody tr.rank-2 td:first-child { border-left: 4px solid var(--silver); }
.standings-table tbody tr.rank-3 td:first-child { border-left: 4px solid var(--bronze); }
.rank-badge {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 15px;
}
.rank-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 900;
  flex-shrink: 0;
  color: var(--muted);
  background: transparent;
}
.rank-inline.rank-1 { background: #f6d860; color: #92400e; }
.rank-inline.rank-2 { background: #d1d5db; color: #374151; }
.rank-inline.rank-3 { background: #e5c594; color: #78350f; }
.pts-bold {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 16px;
  color: var(--accent);
}
.team-cell { display: flex; align-items: center; gap: 8px; text-align: left; }
.table-team-dot { width: 14px; height: 14px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); border-radius: 50%; flex-shrink: 0; background: var(--accent); }
.team-cell-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ── ESTADÍSTICAS ── */
.stats-subtabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
}
.stats-subtab {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 7px 18px;
  border-radius: 7px;
  border: 1.5px solid var(--border2);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
}
.stats-subtab:hover { color: var(--accent); border-color: var(--accent); }
.stats-subtab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.stats-subpanel { display: none; }
.stats-subpanel.active { display: block; }

.chart-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 14px;
}
.chart-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 16px;
}
.bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.bar-team-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  width: 120px;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar-track {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bar-line { display: flex; align-items: center; gap: 6px; }
.bar-fill {
  height: 10px;
  border-radius: 6px;
  transition: width 0.6s cubic-bezier(.22,.68,0,1.2);
  min-width: 2px;
}
.bar-fill.pa { background: var(--accent); }
.bar-fill.pc { background: #fca5a5; }
.bar-val {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  min-width: 28px;
}
.chart-legend {
  display: flex;
  gap: 16px;
  margin-top: 4px;
  margin-bottom: 16px;
}
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; }
.legend-dot.pa { background: var(--accent); }
.legend-dot.pc { background: #fca5a5; }

.players-table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); }
.players-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 14px;
  table-layout: auto;
}
.players-table th {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  background: var(--bg3);
  padding: 10px 8px;
  text-align: left;
  white-space: nowrap;
}
.players-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
}
.players-table tbody tr:last-child td { border-bottom: none; }
.players-table tbody tr:hover { background: var(--bg); }
.players-table tbody tr.rank-1 td:first-child { border-left: 3px solid var(--gold); }
.players-table tbody tr.rank-2 td:first-child { border-left: 3px solid var(--silver); }
.players-table tbody tr.rank-3 td:first-child { border-left: 3px solid var(--bronze); }
.player-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}
.player-team { font-size: 11px; color: var(--muted); }
.team-table td:nth-child(2), .team-table th:nth-child(2) { text-align: left; }
.table-note { margin-top: 10px; font-size: 12px; color: var(--muted); }
.players-table tbody tr.rank-1 td:first-child, .players-table tbody tr.rank-2 td:first-child, .players-table tbody tr.rank-3 td:first-child { font-weight: 800; }
.player-cell { display: flex; align-items: center; gap: 6px; }
.player-cell-name { overflow: hidden; min-width: 0; }
.num-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 4px; border-radius: 999px; background: var(--text); color: #fff; font-family: 'Barlow Condensed', sans-serif; font-size: 12px; font-weight: 800; flex-shrink: 0; }
/* jugador avatar con numero badge */
.jug-avatar { position: relative; width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; overflow: visible; }
.jug-avatar-img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); display: block; }
.jug-avatar-fallback { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; font-family: 'Barlow Condensed', sans-serif; font-size: 14px; font-weight: 800; display: flex; align-items: center; justify-content: center; border: 2px solid var(--border); }
.jug-num-badge { position: absolute; bottom: -4px; right: -4px; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 999px; background: var(--text); color: #fff; font-family: 'Barlow Condensed', sans-serif; font-size: 9px; font-weight: 900; display: flex; align-items: center; justify-content: center; border: 1.5px solid var(--surface); line-height: 1; z-index: 1; }
/* equipo mini badge redondo */
.mini-badge-round { position: relative; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; overflow: hidden; background: #fff; box-shadow: 0 0 0 1px #e6e9f0; }
.mini-badge-round img { width: 100%; height: 100%; object-fit: contain; padding: 2px; }
.mini-badge-round.auto { background: #f2f4f8; }
.mini-badge-round.auto img { position: absolute; inset: 0; padding: 3px; opacity: .16; filter: grayscale(1); }
.mini-badge-round.auto b { position: relative; font-family: 'Barlow Condensed', sans-serif; font-size: 8px; font-weight: 900; color: #1a1d2e; }
.stat-eq-cell { display: flex; align-items: center; gap: 4px; overflow: hidden; }
/* stat cols and rank col center-aligned */
.players-table td:first-child, .players-table th:first-child { text-align: center; }
.players-table td:nth-child(n+4), .players-table th:nth-child(n+4) { text-align: center; }
/* team name col: truncate */
.stat-team-cell { overflow: hidden; text-overflow: ellipsis; display: block; font-size: 12px; }
.team-cell-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── TOAST ── */
#toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text);
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.35s cubic-bezier(.22,.68,0,1.2);
  z-index: 999;
  pointer-events: none;
}
#toast.show { transform: translateY(0); opacity: 1; }

/* ── LOADING STATE ── */
.loading-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.7);
  border-radius: var(--radius);
  z-index: 10;
}

/* ── CONNECTION ERROR BANNER ── */
.conn-error {
  display: none;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 20px;
  color: var(--red);
  font-size: 14px;
  font-weight: 600;
  align-items: center;
  gap: 10px;
}
.conn-error.show { display: flex; }

@media (max-width: 700px) {
  .logo-name { font-size: 17px; }
  .logo-sub { font-size: 10px; }
  .podium-column { width: 72px; }
  .podium-name { font-size: 12px; max-width: 72px; }
  .view-tabs { max-width: 100%; }
  .bar-team-name { width: 80px; font-size: 11px; }
  .container { padding-bottom: 24px; }
  .toolbar { top: calc(56px + 43px) !important; }
  .portal-nav-inner { padding: 0 4px; }
  .view-tab { flex: 1; justify-content: center; padding: 10px 4px; font-size: 12px; gap: 4px; }
  .view-tab svg { width: 13px; height: 13px; }
  .tb-row { gap: 6px; flex-wrap: nowrap; }
  .tb-select { flex: 1; min-width: 0; font-size: 11px; padding: 0 4px 0 8px; height: 32px; display: flex; }
  .tb-select span { font-size: 9px; white-space: nowrap; }
  .tb-select select { font-size: 11px; width: 100%; min-width: 0; }
  /* Stats tables — fit in viewport, no horizontal scroll */
  .players-table-wrap { overflow-x: hidden; }
  .players-table { font-size: 11px; table-layout: fixed; }
  .players-table th { padding: 7px 4px; font-size: 10px; overflow: hidden; }
  .players-table td { padding: 8px 4px; overflow: hidden; }
  /* rank col narrow, name/equipo flex, stat cols share remaining space equally */
  .players-table th:first-child, .players-table td:first-child { width: 24px; }
  .players-table th:nth-child(2), .players-table td:nth-child(2) { width: 36%; overflow: visible; }
  .players-table th:nth-child(3), .players-table td:nth-child(3) { width: 22%; overflow: hidden; }
  .jug-avatar, .jug-avatar-img, .jug-avatar-fallback { width: 28px; height: 28px; }
  .jug-num-badge { font-size: 8px; min-width: 14px; height: 14px; }
  .player-name { font-size: 12px; }
  .player-team { font-size: 10px; }
  .podium-wrap { display: none; }
  .rank-badge { font-size: 10px; padding: 2px 5px; }
  .pts-bold { font-size: 12px; }
  .team-cell { gap: 4px; }
  .mini-badge { width: 18px; height: 18px; font-size: 9px; }
}

/* ── BOTTOM NAV MOBILE ── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 68px;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  z-index: 300;
  box-shadow: 0 -4px 20px rgba(0,0,0,.10);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bottom-nav-inner {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: stretch;
}
.bottom-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: none;
  background: none;
  color: #9ca3af;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: color 0.14s;
  padding: 0 2px;
  position: relative;
}
.bottom-nav-btn svg {
  width: 24px; height: 24px;
  stroke-width: 2;
  transition: color 0.14s;
}
.bottom-nav-btn.active {
  color: var(--accent, #1a73e8);
}
.bottom-nav-btn.active::before {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 3px;
  background: var(--accent, #1a73e8);
  border-radius: 0 0 3px 3px;
}
@media (max-width: 700px) {
  .bottom-nav { display: flex; }
  .container { padding-bottom: 84px; }
}

/* ── LAYOUT COMPACTO ── */
.header-inner { height: 56px; }
.container { padding: 0 16px 48px; max-width: 1100px; margin: 0 auto; }
.toolbar {
  position: sticky; top: calc(56px + 49px); z-index: 90;
  margin: 0 -16px 14px; padding: 10px 16px;
  background: rgba(244,246,251,.95); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.toolbar .category-scroll-wrap { margin-bottom: 0; padding-bottom: 0; }
.toolbar .cat-pill { font-size: 13px; padding: 5px 14px; border-width: 1.5px; }
.tb-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.tb-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.tb-select { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 6px 0 12px; border: 1.5px solid var(--border2); border-radius: 8px; background: #fff; font-size: 12px; color: var(--muted); }
.tb-select span { font-weight: 600; color: var(--accent); text-transform: uppercase; font-size: 11px; letter-spacing: .5px; }
.tb-select select { border: none; background: transparent; font-family: 'Barlow', sans-serif; font-size: 13px; font-weight: 600; color: var(--text); padding: 4px 2px; outline: none; cursor: pointer; max-width: 170px; }
.jornada-group-head { margin: 8px 0 -4px; grid-column: 1 / -1; }
.jg-num { min-width: 30px; height: 24px; font-size: 13px; }
.jg-name { font-size: 17px; }
.jg-meta { font-size: 12px; }
.games-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 12px; }
.game-card { position: relative; border: 1px solid #e6e9f0; border-radius: 22px; padding: 16px 18px 14px; box-shadow: 0 1px 2px rgba(16,24,40,.04); text-align: center; }
.game-card:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(16,24,40,.08); }
.game-card.en_curso { border-color: rgba(220,38,38,.35); box-shadow: 0 0 0 3px rgba(220,38,38,.07); }
.gc-share { position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 50%; border: 1px solid #e6e9f0; background: #fff; color: var(--muted); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.gc-share:hover { color: var(--accent); border-color: var(--accent); }
.gc-cat { font-family: 'Barlow', sans-serif; font-size: 13px; font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: .3px; }
.gc-meta { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 1px; font-family: 'Barlow', sans-serif; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; }
.gc-live, .gc-final { font-size: 9.5px; font-weight: 800; letter-spacing: .5px; padding: 1px 6px; border-radius: 999px; }
.gc-live { background: #fee2e2; color: var(--red); animation: pulse-chip 1.5s infinite; }
.gc-final { background: #d1fae5; color: #065f46; }
.gc-pendiente { background: #f1f5f9; color: #94a3b8; }
.gc-main { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; padding: 12px 0 6px; }
.gc-team { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.gc-badge { display: flex; align-items: center; justify-content: center; width: 62px; height: 62px; border-radius: 16px; font-family: 'Barlow Condensed', sans-serif; font-size: 17px; font-weight: 900; letter-spacing: .3px; color: #1a1d2e; background: #f2f4f8; border: 3px solid #fff; box-shadow: 0 0 0 1px #e6e9f0, 0 2px 6px rgba(16,24,40,.08); }
.gc-name { font-family: 'Barlow', sans-serif; font-size: 13px; font-weight: 800; text-transform: uppercase; color: var(--text); line-height: 1.15; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gc-team.lose .gc-name { color: var(--muted); }
.gc-center { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.gc-score { display: flex; align-items: center; gap: 16px; font-family: 'Barlow', sans-serif; font-weight: 800; font-size: 50px; line-height: .9; letter-spacing: -1px; color: var(--text); font-variant-numeric: tabular-nums; }
.gc-score i { width: 22px; height: 2px; border-radius: 2px; background: #e2e5ec; }
.gc-score .lose { color: #b8bfcc; }
.gc-time { font-family: 'Barlow', sans-serif; font-size: 14px; font-weight: 700; color: var(--text); padding: 4px 12px; border-radius: 999px; background: #f2f4f8; }
.gc-field { font-family: 'Barlow', sans-serif; font-size: 11px; font-weight: 600; color: #a3aab8; }
.gc-role { display: block; font-family: 'Barlow', sans-serif; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #a3aab8; margin-top: 3px; }
.gc-role.win { color: var(--green); }
.gc-winner-tag { display: inline-block; background: var(--green); color: #fff; font-size: 9px; font-weight: 800; border-radius: 4px; padding: 1px 5px; margin-left: 3px; letter-spacing: .3px; vertical-align: middle; }
.gc-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.gc-boxscore { font-family: 'Barlow', sans-serif; font-size: 12px; font-weight: 700; color: var(--accent); text-decoration: none; letter-spacing: .2px; }
.gc-boxscore:hover { text-decoration: underline; }
@media (max-width: 700px) {
  .games-grid { grid-template-columns: 1fr; }
  .toolbar .last-updated { display: none; }
  .tb-row { gap: 8px; }
  .tb-select select { max-width: 120px; }
}

/* ── LOGO DE EQUIPO ── */
.gc-badge { position: relative; overflow: hidden; background: #fff; }
.gc-badge img { width: 100%; height: 100%; object-fit: contain; padding: 5px; }
.gc-badge.auto { background: #f2f4f8; }
.gc-badge.auto img { position: absolute; inset: 0; padding: 6px; opacity: .16; filter: grayscale(1); }
.gc-badge.auto b { position: relative; }
.mini-badge { position: relative; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; overflow: hidden; background: #fff; box-shadow: 0 0 0 1px #e6e9f0; }
.mini-badge img { width: 100%; height: 100%; object-fit: contain; padding: 2px; }
.mini-badge.auto { background: #f2f4f8; }
.mini-badge.auto img { position: absolute; inset: 0; padding: 3px; opacity: .16; filter: grayscale(1); }
.mini-badge.auto b { position: relative; font-family: 'Barlow Condensed', sans-serif; font-size: 10px; font-weight: 900; color: #1a1d2e; }

/* selectores de jornada y equipo: primero, siempre arriba */
.tb-main { margin-bottom: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-width: 520px; }
.tb-main .tb-select { height: 40px; border-color: var(--accent); box-shadow: 0 1px 0 rgba(26,86,219,.06); }
.tb-main .tb-select span { color: var(--accent); text-transform: uppercase; letter-spacing: .5px; font-size: 11px; }
.tb-main .tb-select select { flex: 1; max-width: none; font-size: 14px; }
.row-selected td { background: rgba(26,86,219,.06) !important; }
@media (max-width: 700px) { .tb-main { max-width: none; } .tb-main .tb-select select { max-width: none; } }

/* ── COLOR DE CATEGORÍA (opcional) ── */
.cat-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; box-shadow: 0 0 0 2px rgba(255,255,255,.85); }
.game-card { overflow: hidden; }
.gc-stripe { position: absolute; top: 0; bottom: 0; left: 0; width: 6px; }

/* ── CELULAR: tarjetas en columna y filtros a lo ancho ── */
@media (max-width: 1000px) { .games-grid { grid-template-columns: repeat(2, 1fr) !important; } }
@media (max-width: 700px) {
  .games-grid { grid-template-columns: 1fr !important; }
  .tb-row { display: grid; grid-template-columns: 1fr 1fr; }
  .tb-row .tb-select { min-width: 0; }
  .tb-row .tb-select select { flex: 1; min-width: 0; max-width: none; }
  #torneoSelectorWrap[style*="none"] ~ .tb-select:last-child { grid-column: 1 / -1; }   /* 3 filtros: el último a lo ancho */
}

/* ── LOCAL (oscuro) / VISITANTE (claro): como el uniforme ── */
.gc-team .gc-role { display: inline-block; margin-top: 4px; padding: 3px 10px; border-radius: 6px; font-size: 10px; font-weight: 800; letter-spacing: .6px; }
.gc-team:first-child .gc-role { background: #111827; color: #fff; border: 1.5px solid #111827; }
.gc-team:last-child .gc-role  { background: #fff; color: #111827; border: 1.5px solid #111827; }
.gc-team .gc-role.win { color: inherit; }
.gc-team:first-child .gc-role.win { color: #fff; }
.gc-team:last-child .gc-role.win  { color: #111827; }

/* campo en negritas y legible */
.gc-field { font-size: 13px; font-weight: 800; color: var(--text); }

/* encabezado de jornada: fecha y número de partidos bien visibles */
.jornada-group-head .jg-meta { font-size: 15px; font-weight: 800; color: var(--text); }
.jornada-group-head .jg-name { font-size: 20px; }
@media (max-width: 700px) { .jornada-group-head .jg-meta { font-size: 14px; } .jornada-group-head .jg-name { font-size: 18px; } }
