/* ============================================================
   CB Utrera · Liga Nacional N1 Masculino · Control de Multas
   Design: Dark glassmorphism with orange+white palette
   ============================================================ */

:root {
  --primary: #FF6B00;
  --primary-dark: #D45A00;
  --primary-light: #FF9A4D;
  --primary-glow: rgba(255, 107, 0, 0.3);
  --secondary: #1A1D2E;
  --surface: #12141F;
  --surface-2: #1E2035;
  --surface-3: #252840;
  --border: rgba(255, 255, 255, 0.07);
  --border-accent: rgba(255, 107, 0, 0.3);
  --text: #F0F2FF;
  --text-muted: rgba(240, 242, 255, 0.55);
  --text-dim: rgba(240, 242, 255, 0.35);
  --success: #00C896;
  --error: #FF4D6D;
  --warn: #FFD166;
  --sidebar-width: 260px;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 24px rgba(255, 107, 0, 0.15);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--surface);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ── SIDEBAR ── */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-header {
  padding: 28px 20px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(255,107,0,0.1), transparent);
}

.team-badge {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 2px solid var(--primary);
  box-shadow: 0 0 16px var(--primary-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.team-badge img { width: 100%; height: 100%; object-fit: cover; }
.badge-fallback { font-size: 24px; display: flex; align-items: center; justify-content: center; }

.team-info-header h2 {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.team-info-header span {
  font-size: 11px;
  color: var(--primary-light);
  font-weight: 600;
  letter-spacing: 0.06em;
}

.nav-links {
  list-style: none;
  padding: 16px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.nav-link:hover {
  color: var(--text);
  background: var(--surface-3);
}
.nav-link.active {
  color: var(--text);
  background: linear-gradient(135deg, rgba(255,107,0,0.2), rgba(255,107,0,0.08));
  border: 1px solid var(--border-accent);
  box-shadow: var(--shadow-glow);
}
.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: var(--primary);
  border-radius: 0 2px 2px 0;
}
.nav-link .icon { font-size: 18px; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
}

/* ── MOBILE HEADER ── */
.mobile-header {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 60px;
  background: var(--secondary);
  border-bottom: 1px solid var(--border);
  align-items: center;
  padding: 0 16px;
  gap: 16px;
  z-index: 200;
}
.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--transition);
}
.mobile-title {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 16px;
}
.mobile-badge {
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
}

/* ── MAIN CONTENT ── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  padding: 32px;
  max-width: 1200px;
}

.view { display: none; animation: fadeIn 0.3s ease; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.page-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.page-header h1 {
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, #fff, var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.season-badge {
  background: var(--surface-3);
  border: 1px solid var(--border-accent);
  color: var(--primary-light);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
}
.subtitle-text {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
}

/* ── CARDS ── */
.card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
  transition: box-shadow var(--transition);
}
.card:hover { box-shadow: 0 4px 24px rgba(0,0,0,0.3); }

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}
.card-icon { font-size: 20px; }
.card-header h3 {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.card-action {
  font-size: 13px;
  color: var(--primary-light);
  font-weight: 600;
  transition: color var(--transition);
}
.card-action:hover { color: var(--primary); }
.card-content { padding: 20px; }
.loader-placeholder { display: flex; align-items: center; justify-content: center; min-height: 80px; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

/* ── TEAM OVERVIEW CARD ── */
.team-overview-card {
  background: linear-gradient(135deg, var(--surface-2), rgba(255,107,0,0.06));
  border: 1px solid var(--border-accent);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-glow);
}
.team-overview-card::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(255,107,0,0.15), transparent 70%);
  pointer-events: none;
}
.team-ov-loader { display: flex; align-items: center; justify-content: center; min-height: 100px; }
.team-overview-inner {
  display: flex;
  align-items: center;
  gap: 24px;
}
.team-ov-badge {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 3px solid var(--primary);
  box-shadow: 0 0 24px var(--primary-glow);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
  overflow: hidden; flex-shrink: 0;
}
.team-ov-badge img { width: 100%; height: 100%; object-fit: cover; }
.team-ov-info h2 {
  font-size: 24px; font-weight: 900; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--text);
}
.team-ov-info .liga { 
  font-size: 13px; color: var(--primary-light); font-weight: 600;
  letter-spacing: 0.08em; margin-top: 2px;
}
.team-ov-info .delegacion { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.team-ov-stats {
  display: flex; gap: 0; margin-left: auto;
  background: var(--surface-3);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}
.stat-block {
  padding: 14px 22px;
  text-align: center;
  border-right: 1px solid var(--border);
}
.stat-block:last-child { border-right: none; }
.stat-block .val {
  font-size: 28px; font-weight: 900; color: var(--text);
  display: block;
}
.stat-block .lbl {
  font-size: 10px; font-weight: 700; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-top: 2px; display: block;
}
.stat-block.wins .val { color: var(--success); }
.stat-block.losses .val { color: var(--error); }

/* ── MATCH CARDS ── */
.match-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
}
.match-item:hover {
  border-color: var(--border-accent);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  transform: translateY(-1px);
}
.match-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 8px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
}
.match-estado {
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
}
.match-estado.terminado { background: rgba(0,200,150,0.15); color: var(--success); }
.match-estado.pendiente { background: rgba(255,209,102,0.15); color: var(--warn); }
.match-estado.en-curso { background: rgba(255,107,0,0.2); color: var(--primary-light); animation: pulse 2s infinite; }

@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.6; } }

.match-item-body {
  display: flex;
  align-items: center;
  padding: 16px;
  gap: 12px;
}
.match-team {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.match-team.right { align-items: flex-end; }
.match-team-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.match-team-name.utrera { color: var(--primary-light); }
.match-team-club { font-size: 11px; color: var(--text-dim); }

.match-score-box {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.score {
  font-size: 30px;
  font-weight: 900;
  color: var(--text);
  min-width: 40px;
  text-align: center;
}
.score.winner { color: var(--success); }
.score.loser { color: var(--error); }
.score-separator {
  font-size: 18px;
  color: var(--text-dim);
  font-weight: 300;
}
.no-score { font-size: 20px; color: var(--text-dim); font-weight: 300; }

.match-campo {
  padding: 8px 16px;
  font-size: 11px;
  color: var(--text-dim);
  display: flex; align-items: center; gap: 6px;
  border-top: 1px solid var(--border);
}

.match-multa-badge {
  margin-left: auto;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}
.match-multa-badge.win { background: rgba(0,200,150,0.15); color: var(--success); }
.match-multa-badge.has-multa { background: rgba(255,209,102,0.2); color: var(--warn); }

/* ── STATS TABLE ── */
.stats-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
}
.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.stats-table th {
  background: var(--surface-3);
  padding: 10px 12px;
  text-align: right;
  font-weight: 700;
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 2px solid var(--border-accent);
  white-space: nowrap;
}
.stats-table th:first-child, .stats-table th:nth-child(2) { text-align: left; }
.stats-table td {
  padding: 10px 12px;
  text-align: right;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
  white-space: nowrap;
}
.stats-table td:first-child, .stats-table td:nth-child(2) { text-align: left; }
.stats-table tr:last-child td { border-bottom: none; }
.stats-table tbody tr { transition: background var(--transition); }
.stats-table tbody tr:hover { background: rgba(255,107,0,0.04); }
.stats-table tbody tr.totals-row { 
  background: var(--surface-3); 
  font-weight: 700;
  border-top: 2px solid var(--border-accent);
}
.dorsal-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 26px; padding: 0 4px;
  background: var(--surface-3);
  border-radius: 6px;
  font-size: 11px; font-weight: 800;
  color: var(--primary-light);
  border: 1px solid var(--border-accent);
}
.dorsal-badge.coach-badge {
  background: rgba(255, 71, 87, 0.15);
  color: var(--error);
  border-color: rgba(255, 71, 87, 0.4);
}
.highlight-miss { color: var(--error); font-weight: 700; }
.highlight-ok { color: var(--success); }

.match-selector-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.match-sel-btn {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 14px;
  cursor: pointer;
  transition: all var(--transition);
}
.match-sel-btn:hover { border-color: var(--primary); color: var(--text); }
.match-sel-btn.active {
  background: rgba(255,107,0,0.15);
  border-color: var(--primary);
  color: var(--primary-light);
}

/* ── MULTAS ── */
.multas-summary-bar {
  background: linear-gradient(135deg, rgba(255,107,0,0.15), rgba(255,107,0,0.05));
  border: 1px solid var(--border-accent);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-glow);
}
.multas-total-big {
  font-size: 48px;
  font-weight: 900;
  color: var(--warn);
  line-height: 1;
}
.multas-total-big sup { font-size: 22px; font-weight: 700; vertical-align: top; margin-top: 8px; }
.multas-total-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}
.multas-legend {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.multas-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}
.multas-legend-item .dot {
  width: 8px; height: 8px; border-radius: 50%;
}

.multas-matches {
  display: grid;
  gap: 12px;
  margin-bottom: 28px;
}
.multa-match-row {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.multa-match-row.won {
  border-color: rgba(0,200,150,0.25);
  background: rgba(0,200,150,0.04);
}
.multa-match-vs {
  font-size: 14px; font-weight: 700; flex: 1;
  min-width: 0;
}
.multa-match-vs .opponent { color: var(--text-muted); font-weight: 400; font-size: 13px; }
.multa-match-result {
  font-size: 14px; font-weight: 800; text-align: center;
  min-width: 50px;
}
.multa-match-result.win { color: var(--success); }
.multa-match-result.loss { color: var(--error); }
.multa-match-amount {
  font-size: 18px; font-weight: 900;
  min-width: 70px; text-align: right;
}
.multa-match-amount.zero { color: var(--success); }
.multa-match-amount.paid { color: var(--warn); }
.annulled-tag {
  font-size: 10px; padding: 2px 8px; border-radius: 8px;
  background: rgba(0,200,150,0.15); color: var(--success);
  font-weight: 700; letter-spacing: 0.05em;
}

.multas-players-table-wrap {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.multas-players-table-wrap .table-title {
  padding: 18px 20px 14px;
  font-size: 15px; font-weight: 700;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.multa-rank {
  font-size: 14px; font-weight: 900;
  color: var(--text-dim); min-width: 28px;
}
.multa-rank.first { color: var(--warn); }
.multa-rank.second { color: #C0C0C0; }
.multa-rank.third { color: #CD7F32; }

.multa-amount-cell {
  font-size: 16px; font-weight: 900;
  text-align: right;
}
.multa-amount-cell.zero { color: var(--success); }
.multa-amount-cell.small { color: var(--text-muted); }
.multa-amount-cell.large { color: var(--error); }
.multa-amount-cell.medium { color: var(--warn); }

.multa-bar-wrap {
  height: 4px;
  background: var(--surface-3);
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}
.multa-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 2px;
}

/* ── CLASIFICACIÓN ── */
.clas-table { width: 100%; border-collapse: collapse; }
.clas-table th {
  background: var(--surface-3);
  padding: 10px 14px;
  text-align: center;
  font-size: 10px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase;
}
.clas-table th:nth-child(2) { text-align: left; }
.clas-table td {
  padding: 11px 14px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.clas-table td:nth-child(2) { text-align: left; font-weight: 600; }
.clas-table tr:hover td { background: rgba(255,107,0,0.04); }
.clas-table tr.utrera-row td {
  background: rgba(255,107,0,0.08);
  color: var(--primary-light);
  font-weight: 700;
}
.clas-table tr.utrera-row td:nth-child(2) { color: var(--text); }
.clas-pos { font-weight: 900; min-width: 28px; display: inline-block; text-align: center; }

/* ── MODAL ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.active { display: flex; animation: fadeIn 0.2s ease; }
.modal-box {
  background: var(--secondary);
  border: 1px solid var(--border-accent);
  border-radius: 20px;
  width: 100%; max-width: 720px;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  padding: 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.modal-close {
  position: absolute;
  top: 18px; right: 18px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 34px; height: 34px;
  border-radius: 50%;
  cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--error); color: white; border-color: transparent; }

.modal-match-header {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; margin-bottom: 24px; text-align: center;
}
.modal-match-header h2 { font-size: 14px; font-weight: 600; color: var(--text-muted); }
.modal-score-display {
  display: flex; align-items: center; gap: 16px;
  font-size: 42px; font-weight: 900;
}
.modal-score-display .team-score { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.modal-score-display .team-score span { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.modal-score-display .separator { font-size: 24px; color: var(--text-dim); font-weight: 300; }
.modal-resultado-tag {
  padding: 5px 16px; border-radius: 16px;
  font-size: 12px; font-weight: 800;
}
.modal-resultado-tag.win { background: rgba(0,200,150,0.2); color: var(--success); }
.modal-resultado-tag.loss { background: rgba(255,77,109,0.2); color: var(--error); }

.modal-section-title {
  font-size: 12px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.08em; margin: 20px 0 10px;
  display: flex; align-items: center; gap: 8px;
}
.modal-section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.periods-strip {
  display: flex; gap: 0;
  background: var(--surface-3); border-radius: var(--radius-sm);
  overflow: hidden; border: 1px solid var(--border);
  margin-bottom: 20px;
}
.period-cell {
  flex: 1; text-align: center;
  padding: 10px 8px;
  border-right: 1px solid var(--border);
  font-size: 13px;
}
.period-cell:last-child { border-right: none; }
.period-cell .period-name { font-size: 9px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; }
.period-cell .period-scores { display: flex; justify-content: center; gap: 8px; font-weight: 700; margin-top: 4px; }

.modal-multas-total {
  background: var(--surface-3);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
  border: 1px solid var(--border-accent);
}
.modal-multas-total .label { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.modal-multas-total .amount { font-size: 28px; font-weight: 900; }
.modal-multas-total .amount.zero { color: var(--success); }
.modal-multas-total .amount.paid { color: var(--warn); }
.victory-banner {
  background: rgba(0,200,150,0.1);
  border: 1px solid rgba(0,200,150,0.3);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 600; color: var(--success);
  margin-bottom: 16px;
}

/* ── SPINNER & ERROR ── */
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--surface-3);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spinner-centered { display: flex; justify-content: center; padding: 60px 0; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-dim); }
.empty-state .emoji { font-size: 48px; display: block; margin-bottom: 12px; }
.empty-state p { font-size: 15px; }

.error-msg {
  background: rgba(255,77,109,0.1);
  border: 1px solid rgba(255,77,109,0.3);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  color: var(--error);
  font-size: 14px; font-weight: 600;
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .mobile-header { display: flex; }
  .main-content { margin-left: 0; padding: 80px 16px 24px; }
  .grid-2 { grid-template-columns: 1fr; }
  .team-overview-inner { flex-direction: column; text-align: center; }
  .team-ov-stats { margin-left: 0; width: 100%; }
  .multas-summary-bar { flex-direction: column; }
  .multas-legend { margin-left: 0; }
}

.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 99;
}
.sidebar-backdrop.active { display: block; }

/* ── SPECIALIZED FINE BADGES (UX/UI) ── */
.ft-perdonado-tag {
  display: inline-block;
  background: rgba(0, 200, 150, 0.15);
  color: var(--success);
  border: 1px solid rgba(0, 200, 150, 0.35);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  margin-left: 6px;
  letter-spacing: 0.03em;
}

.tecnica-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 77, 109, 0.18);
  color: var(--error);
  border: 1px solid rgba(255, 77, 109, 0.4);
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  box-shadow: 0 0 10px rgba(255, 77, 109, 0.2);
}
.tecnica-badge.banq-badge {
  background: rgba(255, 121, 121, 0.12);
  color: #ff7979;
  border: 1px dashed rgba(255, 121, 121, 0.5);
  font-size: 10px;
  box-shadow: none;
}

.victory-banner {
  background: linear-gradient(135deg, rgba(0, 200, 150, 0.15), rgba(0, 200, 150, 0.05));
  border: 1px solid rgba(0, 200, 150, 0.4);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(0, 200, 150, 0.1);
}

/* ============================================================
   Nuevos estilos: Selector de partidos, Mejores Jugadores y Multas
   ============================================================ */

.match-pills-container {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.match-pill {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.match-pill:hover {
  background: var(--surface-3);
  color: var(--text);
  border-color: rgba(255,255,255,0.2);
}
.match-pill.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(255, 90, 0, 0.35);
}

.category-pills-container {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 14px 0 20px;
}
.category-pill {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}
.category-pill:hover {
  background: var(--surface-3);
  color: var(--text);
}
.category-pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(255, 90, 0, 0.3);
}

.podium-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.podium-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.podium-card.first {
  border-color: rgba(255, 215, 0, 0.5);
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.08), var(--surface-2));
}
.podium-card.second {
  border-color: rgba(192, 192, 192, 0.4);
}
.podium-card.third {
  border-color: rgba(205, 127, 50, 0.4);
}
.podium-rank-badge {
  font-size: 20px;
  font-weight: 900;
}
.podium-card.first .podium-rank-badge { color: #ffd700; }
.podium-card.second .podium-rank-badge { color: #c0c0c0; }
.podium-card.third .podium-rank-badge { color: #cd7f32; }

.podium-val-big {
  font-size: 32px;
  font-weight: 900;
  color: var(--primary-light);
  line-height: 1;
  margin: 10px 0 4px;
}
.podium-avg-label {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 600;
}

.match-fines-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
}
.match-fines-card.won {
  border-color: rgba(0, 200, 150, 0.3);
}
.match-fines-card-header {
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.match-fines-card-body {
  padding: 0;
}

.dorsal-tag {
  display: inline-block;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  margin-right: 4px;
}

/* ── COACH & CAPTAIN BADGES ── */
.coach-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 107, 0, 0.16);
  color: var(--primary-light);
  border: 1px solid var(--border-accent);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  vertical-align: middle;
  margin-left: 6px;
}
.coach-squad-banner {
  background: linear-gradient(135deg, rgba(255, 107, 0, 0.14), rgba(30, 32, 53, 0.8));
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}
.coach-squad-banner strong {
  color: var(--primary-light);
  font-weight: 800;
}
.team-coach-sub {
  font-size: 11px;
  color: var(--primary-light);
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
}
.captain-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 900;
  margin-left: 4px;
  vertical-align: middle;
}

/* ── TABLE SCROLL HINT (MOBILE FRIENDLY) ── */
.table-scroll-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-light);
  background: rgba(255, 107, 0, 0.08);
  border: 1px dashed rgba(255, 107, 0, 0.35);
  border-radius: 8px;
  padding: 6px 12px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ============================================================
   RESPONSIVE DESIGN (AUTOMATIC ADAPTATION: DESKTOP & MOBILE)
   ============================================================ */

/* ── BASE MOBILE NAVIGATION & OVERLAY ── */
.mobile-bottom-nav {
  display: none;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 290;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── DESKTOP MODE (min-width: 992px) ── */
@media (min-width: 992px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    transform: none !important;
    display: flex !important;
  }
  .main-content {
    margin-left: var(--sidebar-width);
    padding: 32px 36px;
    max-width: 1300px;
  }
  .mobile-header {
    display: none !important;
  }
  .mobile-bottom-nav {
    display: none !important;
  }
  .sidebar-backdrop {
    display: none !important;
  }
}

/* ── TABLET & MOBILE MODE (max-width: 991px) ── */
@media (max-width: 991px) {
  body {
    display: block;
    padding-bottom: 70px;
  }

  /* Off-canvas mobile drawer sidebar */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 290px;
    z-index: 300;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.8);
  }
  .sidebar.open {
    transform: translateX(0);
  }

  /* Backdrop overlay */
  .sidebar-backdrop {
    display: block;
  }
  .sidebar-backdrop.active {
    opacity: 1;
    pointer-events: auto;
  }

  /* Mobile Top Sticky Header */
  .mobile-header {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 58px;
    background: rgba(18, 20, 31, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    align-items: center;
    padding: 0 16px;
    gap: 12px;
    z-index: 200;
  }
  .mobile-title {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 15px;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mobile-badge {
    background: var(--surface-3);
    border: 1px solid var(--border-accent);
    color: var(--primary-light);
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
  }

  /* Mobile Bottom Navigation Bar */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(18, 20, 31, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    z-index: 250;
    justify-content: space-around;
    align-items: stretch;
    padding: 4px 6px env(safe-area-inset-bottom, 2px);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.45);
  }
  .mobile-nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s ease;
    padding: 2px 0;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-nav-btn:active {
    transform: scale(0.92);
  }
  .mobile-nav-btn .mobile-nav-icon {
    font-size: 20px;
    transition: transform 0.2s ease, filter 0.2s ease;
  }
  .mobile-nav-btn .mobile-nav-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-dim);
    transition: color 0.2s ease;
  }
  .mobile-nav-btn.active {
    color: var(--primary);
  }
  .mobile-nav-btn.active .mobile-nav-icon {
    transform: scale(1.15);
    filter: drop-shadow(0 0 10px var(--primary-glow));
  }
  .mobile-nav-btn.active .mobile-nav-label {
    color: #fff;
    font-weight: 800;
  }

  /* Main content layout */
  .main-content {
    margin-left: 0 !important;
    padding: 72px 14px 80px 14px;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
  }

  /* Page headers on mobile */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 18px;
  }
  .page-header h1 {
    font-size: 20px;
    line-height: 1.25;
  }

  /* Grids collapse cleanly */
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* Team overview banner on mobile */
  .team-overview-card {
    padding: 18px 16px;
  }
  .team-overview-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .team-ov-stats {
    width: 100%;
    margin-left: 0;
    justify-content: space-around;
  }
  .stat-block {
    flex: 1;
    padding: 10px 8px;
  }
  .stat-block .val {
    font-size: 22px;
  }

  /* Match cards on mobile */
  .match-card {
    padding: 14px;
  }
  .match-card-teams {
    gap: 8px;
  }
  .match-card-vs {
    font-size: 11px;
  }
  .match-card-score {
    font-size: 20px;
  }

  /* Tables scroll smoothly on mobile without letter overlap */
  .stats-table-wrap, .multas-players-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    position: relative;
    border: 1px solid var(--border);
  }
  .stats-table {
    width: 100%;
    min-width: 680px; /* Crucial: Guarantees full column room so letters NEVER squeeze or overlap */
    border-collapse: separate;
    border-spacing: 0;
  }
  .stats-table th, .stats-table td {
    padding: 10px 12px;
    font-size: 12px;
    white-space: nowrap;
  }
  /* Sticky ONLY first column for stats tables with 100% opaque solid background */
  .stats-table.sticky-col th:first-child,
  .stats-table.sticky-col td:first-child {
    position: sticky;
    left: 0;
    background: #191c2f !important; /* 100% solid, prevents bleed-through */
    z-index: 5;
    min-width: 140px;
    max-width: 165px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.45);
    border-right: 1px solid rgba(255, 107, 0, 0.25);
    text-align: left;
  }
  .stats-table.sticky-col th:first-child {
    background: #23273e !important;
    z-index: 6;
  }

  /* Podiums on mobile */
  .podium-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .podium-card {
    padding: 14px 16px;
  }

  /* Multas top banner on mobile */
  .multas-total-card {
    padding: 18px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .multas-legend {
    margin-left: 0;
    width: 100%;
  }

  /* Modals on mobile */
  .modal-box {
    width: 95vw;
    max-height: 88vh;
    padding: 18px 14px;
    border-radius: var(--radius);
  }
}

/* ── SMALL PHONES (max-width: 480px) ── */
@media (max-width: 480px) {
  .page-header h1 {
    font-size: 18px;
  }
  .podium-val-big {
    font-size: 26px;
  }
  .mobile-bottom-nav {
    height: 60px;
  }
  .mobile-nav-btn .mobile-nav-icon {
    font-size: 18px;
  }
  .mobile-nav-btn .mobile-nav-label {
    font-size: 9.5px;
  }
}



