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

body {
  background: #f5f5f5;
  color: #111;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

a { text-decoration: none; color: inherit; }

/* ADMIN BAR */
.admin-bar {
  background: #162b1a;
  border-bottom: 1px solid #2d8a3e33;
  padding: 6px 1.5rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-pill {
  font-size: 11px;
  background: #2d8a3e22;
  color: #4db863;
  border: 1px solid #2d8a3e44;
  border-radius: 20px;
  padding: 2px 10px;
}
.admin-status { font-size: 11px; color: #4db863; }
.admin-btn {
  font-size: 11px;
  background: #2d8a3e;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 3px 10px;
  cursor: pointer;
  margin-left: auto;
}

/* NAVBAR */
.navbar {
  background: #1a1a1a;
  border-bottom: 3px solid #2d8a3e;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar-brand { display: flex; align-items: center; gap: 12px; }
.navbar-logo-wrap {
  width: 48px;
  height: 48px;
  background: #fff;
  border-radius: 50%;
  border: 2px solid #2d8a3e;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.navbar-logo-wrap img { width: 42px; height: 42px; object-fit: contain; }
.navbar-name { font-size: 15px; font-weight: 500; color: #fff; }
.navbar-name span { color: #4db863; }
.navbar-sub { font-size: 11px; color: #aaa; margin-top: 1px; }
.nav-links { display: flex; gap: 1.5rem; }
.nav-link {
  font-size: 13px;
  color: #ccc;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.nav-link:hover, .nav-link.active { color: #fff; border-bottom-color: #4db863; }

/* BANNER */
.banner { width: 100%; background: #1a2a1a; overflow: hidden; }
.banner-img { width: 100%; height: auto; display: block; }

/* ESTADÍSTICAS */
.hero-stats {
  display: flex;
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
}
.hero-stat {
  flex: 1;
  text-align: center;
  padding: 14px 0;
  border-right: 1px solid #eee;
}
.hero-stat:last-child { border-right: none; }
.hero-stat .num { font-size: 20px; font-weight: 500; color: #2d8a3e; }
.hero-stat .lbl { font-size: 11px; color: #888; margin-top: 2px; }

/* CONTENIDO */
.content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: #e0e0e0;
}
.panel { background: #fff; padding: 1.25rem; }
.panel-title {
  font-size: 12px;
  color: #2d8a3e;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
  font-weight: 500;
}
.loading { font-size: 13px; color: #aaa; }

/* TABLA DE POSICIONES */
.standings table { width: 100%; border-collapse: collapse; font-size: 12px; }
.standings th {
  color: #999;
  font-weight: 400;
  padding: 4px 6px;
  text-align: center;
  border-bottom: 1px solid #eee;
}
.standings th:first-child { text-align: left; }
.standings td {
  padding: 7px 6px;
  text-align: center;
  border-bottom: 1px solid #f0f0f0;
  color: #333;
}
.standings td:first-child { text-align: left; }
.standings tr.mi-equipo td { color: #1a5c28; background: #f0faf3; font-weight: 500; }
.standings tr:hover td { background: #fafafa; }
.pos-badge {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #fff;
  background: #ccc;
}
.pos-badge.p1 { background: #2d8a3e; }
.pos-badge.p2 { background: #4db863; }
.pos-badge.p3 { background: #999; }

/* RESULTADOS */
.results { display: flex; flex-direction: column; gap: 8px; }
.match {
  background: #f8f8f8;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #eee;
}
.match-date { font-size: 10px; color: #999; width: 48px; flex-shrink: 0; }
.match-teams { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 12px; }
.match-team { flex: 1; color: #333; }
.match-team.home { text-align: right; }
.match-score {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 13px;
  font-weight: 500;
  color: #222;
  min-width: 48px;
  text-align: center;
  flex-shrink: 0;
}
.match-score.win { border-color: #2d8a3e; color: #2d8a3e; background: #f0faf3; }
.match-score.loss { border-color: #e24b4a; color: #e24b4a; background: #fff5f5; }

/* PRÓXIMOS PARTIDOS */
.next-matches { display: flex; flex-direction: column; gap: 8px; }
.next-match {
  background: #f8f8f8;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #eee;
}
.next-date { font-size: 11px; color: #2d8a3e; width: 52px; flex-shrink: 0; font-weight: 500; }
.next-info { flex: 1; }
.next-rival { font-size: 13px; color: #222; }
.next-loc { font-size: 11px; color: #999; margin-top: 2px; }
.vs-badge {
  font-size: 10px;
  color: #2d8a3e;
  background: #f0faf3;
  border-radius: 4px;
  padding: 2px 8px;
  flex-shrink: 0;
  border: 1px solid #c3e6cb;
}

/* GOLEADORES */
.goleador {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8f8f8;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 8px;
  border: 1px solid #eee;
}
.goleador-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #eee;
  border: 1px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #666;
  font-weight: 500;
  flex-shrink: 0;
}
.goleador-avatar.top { background: #f0faf3; border-color: #2d8a3e55; color: #2d8a3e; }
.goleador-nombre { font-size: 13px; color: #222; }
.goleador-pos { font-size: 11px; color: #999; margin-top: 2px; }
.goleador-goles { font-size: 15px; font-weight: 500; color: #aaa; margin-left: auto; }
.goleador-goles.top { color: #2d8a3e; }

/* SECCIONES */
.section {
  background: #fff;
  padding: 1.5rem;
  border-top: 1px solid #e0e0e0;
}
.section-title {
  font-size: 12px;
  color: #2d8a3e;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
  font-weight: 500;
}

/* PLANTEL */
.plantel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}
.jugador-card {
  background: #f8f8f8;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  border: 1px solid #eee;
  transition: border-color 0.2s;
}
.jugador-card:hover { border-color: #2d8a3e55; }
.jugador-foto {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #e8f5e9;
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 500;
  color: #2d8a3e;
  border: 2px solid #c3e6cb;
  overflow: hidden;
}
.jugador-foto img { width: 100%; height: 100%; object-fit: cover; }
.jugador-nombre { font-size: 13px; color: #222; font-weight: 500; }
.jugador-pos { font-size: 11px; color: #999; margin-top: 2px; }
.jugador-num {
  font-size: 11px;
  color: #2d8a3e;
  background: #f0faf3;
  border-radius: 4px;
  padding: 1px 6px;
  margin-top: 4px;
  display: inline-block;
  border: 1px solid #c3e6cb;
}

/* GALERÍA */
.galeria-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}
.galeria-item {
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 16/9;
  background: #eee;
}
.galeria-item img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: transform 0.3s;
}
.galeria-item img:hover { transform: scale(1.05); }

/* FOOTER */
.footer {
  background: #1a1a1a;
  border-top: 3px solid #2d8a3e;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer-text { font-size: 11px; color: #888; }
.footer-tag { font-size: 11px; color: #4db863; }

/* ===================== */
/* RESPONSIVE - MÓVIL    */
/* ===================== */
@media (max-width: 768px) {
  .navbar {
    padding: 0 1rem;
    height: auto;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .navbar-logo-wrap { width: 40px; height: 40px; }
  .navbar-logo-wrap img { width: 34px; height: 34px; }
  .navbar-name { font-size: 13px; }
  .navbar-sub { font-size: 10px; }
  .nav-links {
    width: 100%;
    justify-content: space-around;
    border-top: 1px solid #333;
    padding-top: 8px;
    gap: 0;
  }
  .nav-link { font-size: 12px; }
  .hero-stat .num { font-size: 16px; }
  .hero-stat .lbl { font-size: 10px; }
  .hero-stat { padding: 10px 0; }
  .content { grid-template-columns: 1fr; }
  .standings th, .standings td { padding: 5px 4px; font-size: 11px; }
  .match-team { font-size: 11px; }
  .match-score { min-width: 40px; font-size: 12px; padding: 2px 6px; }
  .match-date { width: 38px; font-size: 10px; }
  .plantel-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
  .galeria-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .footer { flex-direction: column; gap: 4px; text-align: center; }
  .admin-bar { flex-wrap: wrap; gap: 6px; }
  .admin-btn { margin-left: 0; }
}

@media (max-width: 400px) {
  .hero-stats { flex-wrap: wrap; }
  .hero-stat { flex: 0 0 33.33%; border-bottom: 1px solid #eee; }
}

/* ADMIN LINK EN NAVBAR */
.nav-admin {
  font-size: 11px;
  color: #2d8a3e;
  border: 1px solid #2d8a3e44;
  border-radius: 4px;
  padding: 3px 10px;
  margin-left: 8px;
  transition: all 0.2s;
}
.nav-admin:hover { background: #2d8a3e; color: #fff; }
