/* ============================================================
   Ligas de Fútbol Amateur — hoja de estilos principal
   Paleta deportiva: verde oscuro, verde brillante, negro, dorado
   ============================================================ */
:root {
  --green-dark: #0b3d2e;
  --green-darker: #072a20;
  --green: #22c55e;
  --green-soft: #86efac;
  --black: #0a0f0d;
  --gold: #eab308;
  --white: #ffffff;
  --gray-100: #f2f5f3;
  --gray-300: #ccd6d1;
  --gray-600: #5c6b64;
  --red: #dc2626;
  --radius: 12px;
  --shadow: 0 4px 16px rgba(7, 42, 32, .12);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--black); background: var(--gray-100); line-height: 1.55; }
img { max-width: 100%; height: auto; }
a { color: var(--green-dark); }
.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.center { text-align: center; }
.muted { color: var(--gray-600); font-size: .92rem; }
.muted-light { color: var(--green-soft); }
.mb { margin-bottom: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; background: var(--gold); color: var(--black); padding: 8px 14px; z-index: 100; }
.skip-link:focus { left: 8px; top: 8px; }

/* ---------- Botones ---------- */
.btn { display: inline-block; border: 0; cursor: pointer; text-decoration: none; text-align: center;
  padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: .95rem; transition: transform .12s, opacity .12s; }
.btn:hover { transform: translateY(-1px); opacity: .93; }
.btn-accent { background: var(--green); color: var(--green-darker); }
.btn-outline { background: transparent; color: var(--green-dark); border: 2px solid var(--green-dark); }
.btn-outline-light { background: transparent; color: var(--white); border: 2px solid var(--green-soft); }
.btn-danger { background: var(--red); color: var(--white); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: .82rem; }

/* ---------- Encabezado ---------- */
.site-header { background: linear-gradient(135deg, var(--green-darker), var(--green-dark)); color: var(--white); position: sticky; top: 0; z-index: 50; box-shadow: var(--shadow); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--white); font-weight: 800; text-decoration: none; font-size: 1.1rem; }
.brand-ball { font-size: 1.4rem; }
.main-nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.main-nav a { color: var(--white); text-decoration: none; font-weight: 600; }
.main-nav a:hover { color: var(--green-soft); }

/* ---------- Héroe ---------- */
.hero { background:
    radial-gradient(1200px 400px at 80% -50%, rgba(34,197,94,.25), transparent),
    linear-gradient(160deg, var(--green-darker) 0%, var(--green-dark) 70%, #0e4a38 100%);
  color: var(--white); padding: 64px 0 72px; text-align: center; }
.hero h1 { font-size: clamp(1.8rem, 5vw, 3rem); margin: 0 0 8px; line-height: 1.15; }
.hero .accent { color: var(--green); }
.hero-sub { color: var(--green-soft); margin: 0 0 24px; }
.searchbar { position: relative; display: flex; gap: 8px; max-width: 560px; margin: 0 auto; }
.searchbar input { flex: 1; padding: 13px 18px; border-radius: 999px; border: 0; font-size: 1rem; }
.searchbar-page { margin: 0 0 28px; }
.ac-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--white);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; z-index: 40; text-align: left; }
.ac-results a { display: block; padding: 10px 16px; text-decoration: none; color: var(--black); }
.ac-results a:hover, .ac-results a:focus { background: var(--gray-100); }
.ac-results .ac-type { color: var(--gray-600); font-size: .8rem; margin-left: 6px; }

/* ---------- Secciones y tarjetas ---------- */
.section { padding: 44px 0; }
.section-sm { padding: 20px 0 0; }
.section-dark { background: var(--green-darker); color: var(--white); }
.section-dark .section-title::after { background: var(--gold); }
.section-title { font-size: 1.4rem; margin: 0 0 20px; position: relative; padding-bottom: 8px; }
.section-title::after { content: ""; position: absolute; left: 0; bottom: 0; width: 48px; height: 4px; background: var(--green); border-radius: 4px; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.section-dark .card { background: rgba(255,255,255,.06); }
.league-card-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.league-card-head img { border-radius: 10px; object-fit: cover; }
.league-card h3 { margin: 0; font-size: 1.05rem; }
.badge-fallback { font-size: 1.9rem; }
.league-meta { display: flex; gap: 14px; font-size: .88rem; color: var(--gray-600); margin: 0 0 14px; }
.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.empty-state { color: var(--gray-600); background: rgba(0,0,0,.04); border-radius: var(--radius); padding: 14px 18px; }
.section-dark .empty-state { color: var(--gray-300); background: rgba(255,255,255,.06); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { background: var(--white); border-radius: 999px; padding: 8px 16px; text-decoration: none; box-shadow: var(--shadow); font-weight: 600; }
.chip-count { background: var(--green); color: var(--green-darker); border-radius: 999px; padding: 1px 8px; font-size: .78rem; margin-left: 4px; }

/* ---------- Listas de partidos ---------- */
.match-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.match-row { background: var(--white); color: var(--black); border-radius: var(--radius); padding: 10px 16px; box-shadow: var(--shadow); }
.section-dark .match-row { background: rgba(255,255,255,.08); color: var(--white); }
.match-league { display: block; font-size: .78rem; color: var(--gray-600); margin-bottom: 4px; }
.section-dark .match-league { color: var(--gray-300); }
.match-teams { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-decoration: none; color: inherit; font-weight: 600; }
.match-teams span { flex: 1; }
.match-teams span:last-child { text-align: right; }
.score { background: var(--green-dark); color: var(--white); border-radius: 8px; padding: 3px 12px; white-space: nowrap; }
.vs { color: var(--gold); }

/* ---------- Héroe de liga y campeón ---------- */
.league-hero { background: linear-gradient(160deg, var(--green-darker), var(--green-dark)); background-size: cover; background-position: center; color: var(--white); }
.league-hero-inner { display: flex; gap: 20px; align-items: center; padding: 40px 16px; flex-wrap: wrap;
  background: linear-gradient(90deg, rgba(7,42,32,.88), rgba(7,42,32,.55)); }
.league-hero h1 { margin: 0 0 4px; font-size: clamp(1.5rem, 4vw, 2.2rem); }
.league-logo { border-radius: 14px; background: var(--white); padding: 6px; object-fit: contain; }
.link-light { color: var(--green-soft); }
.season-select { margin-top: 10px; }
.season-select select { border-radius: 8px; padding: 6px 10px; border: 0; }
.champion-banner { background: linear-gradient(90deg, #7a5b00, var(--gold), #7a5b00); color: var(--black);
  font-weight: 700; border-radius: var(--radius); padding: 12px 20px; box-shadow: var(--shadow); }

/* ---------- Tablas ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); box-shadow: var(--shadow); }
table.standings { width: 100%; border-collapse: collapse; background: var(--white); font-size: .92rem; min-width: 640px; }
.standings th, .standings td { padding: 10px 8px; text-align: center; border-bottom: 1px solid var(--gray-100); }
.standings thead th { background: var(--green-dark); color: var(--white); position: sticky; top: 0; }
.standings .th-team, .standings .td-team { text-align: left; min-width: 160px; }
.td-team { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.td-team a { text-decoration: none; }
.td-pts { font-weight: 800; color: var(--green-dark); }
tr.top5 td:first-child { box-shadow: inset 4px 0 0 var(--green); }
.dot { display: inline-flex; width: 20px; height: 20px; border-radius: 50%; font-size: .68rem; align-items: center; justify-content: center; color: var(--white); margin-right: 2px; font-weight: 700; }
.dot-G { background: var(--green); color: var(--green-darker); } .dot-E { background: var(--gray-600); } .dot-P { background: var(--red); }
.td-actions { white-space: nowrap; }
.td-actions .btn { margin: 2px; }

/* ---------- Goleadores / equipos / eventos ---------- */
.scorers { list-style: none; counter-reset: sc; margin: 0; padding: 0; }
.scorers li { counter-increment: sc; display: flex; gap: 10px; align-items: center; background: var(--white);
  border-radius: var(--radius); padding: 10px 14px; margin-bottom: 8px; box-shadow: var(--shadow); }
.scorers li::before { content: counter(sc); font-weight: 800; color: var(--gold); width: 24px; }
.scorer-name { flex: 1; font-weight: 600; }
.scorer-goals { color: var(--green-dark); }
.teams-mini { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.teams-mini a { display: flex; align-items: center; gap: 10px; background: var(--white); border-radius: var(--radius);
  padding: 10px 14px; text-decoration: none; font-weight: 600; box-shadow: var(--shadow); }
.events { list-style: none; margin: 0; padding: 0; }
.events li { display: flex; gap: 12px; align-items: center; padding: 8px 6px; border-bottom: 1px dashed var(--gray-300); }
.ev-min { width: 40px; font-weight: 700; color: var(--green-dark); }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); text-align: center; padding: 16px 8px; }
.stat-num { display: block; font-size: 1.5rem; font-weight: 800; color: var(--green-dark); }
.match-detail-teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; padding: 10px 0 16px; }
.mdt-team { text-align: center; }
.mdt-team a { display: block; font-weight: 700; text-decoration: none; margin-top: 6px; }
.mdt-score { text-align: center; font-size: 1.7rem; }
.badge-status { display: inline-block; font-size: .72rem; padding: 3px 10px; border-radius: 999px; background: var(--gray-300); color: var(--black); font-weight: 700; }
.status-finalizado { background: var(--green); color: var(--green-darker); }
.status-en_juego { background: var(--gold); }
.status-programado { background: var(--gray-300); }
.status-suspendido, .status-cancelado, .status-aplazado, .status-suspendida { background: var(--red); color: var(--white); }
.status-activa { background: var(--green); color: var(--green-darker); }
.status-borrador { background: var(--gray-300); }
.sponsor-strip { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; background: var(--white);
  border-radius: var(--radius); padding: 18px 24px; box-shadow: var(--shadow); }
.sponsor-name { font-weight: 700; color: var(--gray-600); }

/* ---------- Alertas / formularios / modales ---------- */
.alert { border-radius: var(--radius); padding: 12px 18px; margin: 14px 0; font-weight: 600; }
.alert-success { background: #dcfce7; color: #14532d; }
.alert-error { background: #fee2e2; color: #7f1d1d; }
.alert-warning { background: #fef9c3; color: #713f12; }
label { display: block; font-weight: 600; margin: 12px 0 4px; font-size: .92rem; }
input, select, textarea { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1.5px solid var(--gray-300); font-size: .95rem; font-family: inherit; background: var(--white); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--green); border-color: var(--green); }
.check { display: flex; align-items: center; gap: 8px; margin: 12px 0; }
.check input { width: auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid-3 { grid-template-columns: repeat(3, 1fr); }
.inline-form { display: inline-flex; gap: 8px; align-items: center; }
.inline-form input, .inline-form select { width: auto; }
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.auth-box { max-width: 460px; }
.auth-card h1 { margin-top: 0; }
.auth-links { text-align: center; margin-bottom: 0; }
.modal { position: fixed; inset: 0; background: rgba(7,42,32,.65); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 90; }
.modal[hidden] { display: none; }
.modal-card { background: var(--white); border-radius: var(--radius); padding: 24px; width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto; }
.modal-wide { max-width: 680px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.score-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; margin-bottom: 12px; }
.score-team { display: flex; gap: 10px; align-items: center; font-weight: 700; }
.score-team input { width: 74px; text-align: center; font-size: 1.3rem; font-weight: 800; }
.score-sep { font-size: 1.4rem; font-weight: 800; }
.event-row { display: grid; grid-template-columns: 1fr 1fr 1fr 70px 40px; gap: 8px; margin-bottom: 8px; }
.big-404 { font-size: 5rem; margin: 0; color: var(--green-dark); }

/* ---------- Panel administrativo ---------- */
.admin-body { background: var(--gray-100); }
.admin-topbar { display: flex; align-items: center; gap: 14px; background: var(--green-darker); color: var(--white); padding: 10px 16px; position: sticky; top: 0; z-index: 60; }
.topbar-user { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.menu-toggle { display: none; background: none; border: 0; color: var(--white); font-size: 1.4rem; cursor: pointer; }
.admin-wrap { display: grid; grid-template-columns: 230px 1fr; min-height: calc(100vh - 52px); }
.admin-sidebar { background: var(--green-dark); padding: 18px 0; }
.admin-sidebar a { display: block; color: var(--white); text-decoration: none; padding: 9px 20px; font-weight: 600; font-size: .93rem; }
.admin-sidebar a:hover, .admin-sidebar a.active { background: rgba(34,197,94,.18); border-left: 4px solid var(--green); padding-left: 16px; }
.side-title { color: var(--green-soft); text-transform: uppercase; font-size: .72rem; letter-spacing: .08em; padding: 14px 20px 4px; margin: 0; }
.admin-main { padding: 24px; min-width: 0; }
.page-title { margin: 0 0 18px; font-size: 1.5rem; }
.audit-list { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.audit-list li { padding: 6px 0; border-bottom: 1px dashed var(--gray-300); }

/* ---------- Pie ---------- */
.site-footer { background: var(--black); color: var(--gray-300); margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; padding: 36px 16px 12px; }
.site-footer a { color: var(--green-soft); }
.site-footer ul { list-style: none; padding: 0; margin: 8px 0 0; }
.footer-copy { border-top: 1px solid #1d2622; padding: 14px 16px; font-size: .82rem; }

/* ---------- Responsivo ---------- */
@media (max-width: 860px) {
  .two-cols { grid-template-columns: 1fr; }
  .admin-wrap { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; position: fixed; top: 52px; left: 0; bottom: 0; width: 240px; z-index: 70; overflow-y: auto; }
  .admin-sidebar.open { display: block; }
  .menu-toggle { display: block; }
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .event-row { grid-template-columns: 1fr 1fr; }
  .hero { padding: 44px 0 52px; }
  .searchbar { flex-direction: column; }
  .searchbar .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- Banners publicitarios ---------- */
.banner-slider { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.banner-slide { display: none; }
.banner-slide.active { display: block; }
.banner-slide img { width: 100%; display: block; object-fit: cover; max-height: 320px; }
.banner-inline { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 12px; }
.banner-inline img { width: 100%; display: block; object-fit: cover; max-height: 160px; }
