:root {
  --bg: #f5f7fa;
  --bg-elev: #ffffff;
  --bg-soft: #eef2f7;
  --border: #e3e8ef;
  --border-soft: #eef1f6;
  --text: #1b2230;
  --text-dim: #5a6473;
  --text-faint: #98a1b0;
  --primary: #2563eb;
  --primary-press: #1d4ed8;
  --primary-soft: #e7efff;
  --ok: #16a34a; --ok-soft: #e3f6ea;
  --warn: #d97706; --warn-soft: #fdf0dd;
  --danger: #dc2626;
  --radius: 14px; --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.05);
  --shadow: 0 10px 34px rgba(16,24,40,.10);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 14.5px; line-height: 1.55; letter-spacing: -.005em; -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
.muted { color: var(--text-dim); }
a { color: var(--primary); text-decoration: none; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.88); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.site-header .inner { max-width: 1080px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; gap: 18px; }
.logo { font-weight: 800; font-size: 16px; letter-spacing: -.02em; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.site-nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.site-nav a { color: var(--text-dim); font-weight: 500; font-size: 13.5px; padding: 7px 12px; border-radius: 8px; cursor: pointer; }
.site-nav a:hover { background: var(--bg-soft); color: var(--text); }
.site-nav a.admin { background: var(--text); color: #fff; }
.site-nav a.admin:hover { background: #000; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 32px 24px 90px; }

/* Hero */
.hero { background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 60%, #3b82f6 100%); color: #fff; border-radius: 20px; padding: 52px 44px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.hero::after { content: "⚽"; position: absolute; right: -10px; bottom: -24px; font-size: 180px; opacity: .12; }
.hero h1 { font-size: 32px; font-weight: 800; letter-spacing: -.03em; max-width: 620px; line-height: 1.15; }
.hero p { margin-top: 12px; font-size: 15.5px; opacity: .9; max-width: 560px; }
.hero .cta { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.hero .btn-hero { background: #fff; color: var(--primary-press); border: none; border-radius: 10px; padding: 11px 20px; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; }
.hero .btn-hero.ghost { background: rgba(255,255,255,.15); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.4); }

/* Section */
.section { margin-top: 40px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.section-head h2 { font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.section-head a { font-size: 13px; font-weight: 500; cursor: pointer; }

.grid { display: grid; gap: 16px; }
.grid.c3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid.c2 { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }

.card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s, transform .15s; }
.card.clickable { cursor: pointer; }
.card.clickable:hover { border-color: #cdd6e4; box-shadow: var(--shadow); transform: translateY(-2px); }

/* Tournament card */
.torneo-card .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.torneo-card h3 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.torneo-card .meta { color: var(--text-dim); font-size: 13px; margin-top: 4px; }
.torneo-card .foot { display: flex; gap: 22px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border-soft); }
.torneo-card .foot b { display: block; font-size: 17px; font-weight: 700; }
.torneo-card .foot span { font-size: 11px; color: var(--text-faint); }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 6px; }
.badge.regular { background: var(--primary-soft); color: var(--primary-press); }
.badge.liguilla { background: var(--warn-soft); color: var(--warn); }
.badge.finalizada { background: var(--bg-soft); color: var(--text-dim); }

/* Crest */
.crest { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: 10px; color: #fff; overflow: hidden; flex-shrink: 0; }
.crest img { width: 100%; height: 100%; object-fit: cover; }
.crest.sm { width: 24px; height: 24px; font-size: 9px; border-radius: 6px; }
.team-line { display: flex; align-items: center; gap: 10px; min-width: 0; }
.team-line .name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Match row */
.match-mini { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--border-soft); }
.match-mini:last-child { border-bottom: none; }
.match-mini .side { display: flex; align-items: center; gap: 9px; min-width: 0; }
.match-mini .side.home { justify-content: flex-end; text-align: right; }
.match-mini .side .name { font-weight: 500; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-mini .sc { font-weight: 700; font-size: 15px; background: var(--bg-soft); border-radius: 7px; padding: 3px 10px; white-space: nowrap; }
.match-mini .sc.vs { background: none; color: var(--text-faint); font-weight: 500; font-size: 12px; }
.match-mini .lbl { grid-column: 1/-1; text-align: center; font-size: 11px; color: var(--text-faint); }

.list { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin: 24px 0; overflow-x: auto; }
.tab { padding: 10px 16px; color: var(--text-dim); font-weight: 500; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; font-size: 13.5px; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* Table */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-elev); box-shadow: var(--shadow-sm); }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th, table.data td { padding: 12px; text-align: center; }
table.data th { color: var(--text-faint); font-size: 11px; font-weight: 600; background: var(--bg-soft); border-bottom: 1px solid var(--border); }
table.data td { border-bottom: 1px solid var(--border-soft); }
table.data tr:last-child td { border-bottom: none; }
table.data td.left, table.data th.left { text-align: left; }
.pos { width: 24px; height: 22px; display: inline-grid; place-items: center; font-weight: 700; font-size: 12px; border-radius: 6px; }
.zona td:first-child { box-shadow: inset 3px 0 0 var(--ok); }
.pts-cell { font-weight: 700; font-size: 14px; }
.dg-pos { color: var(--ok); } .dg-neg { color: var(--danger); }

.scorer-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border-soft); }
.scorer-row:last-child { border-bottom: none; }
.scorer-rank { width: 22px; font-weight: 700; color: var(--text-faint); text-align: center; }
.scorer-goals { margin-left: auto; font-weight: 700; font-size: 15px; }

.empty { text-align: center; padding: 70px 20px; color: var(--text-dim); }
.empty .ic { font-size: 36px; opacity: .5; margin-bottom: 12px; }
.empty h3 { color: var(--text); font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.spinner { width: 24px; height: 24px; border: 2.5px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; margin: 70px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

.back { display: inline-flex; align-items: center; gap: 6px; color: var(--text-dim); font-size: 13px; cursor: pointer; margin-bottom: 16px; }
.back:hover { color: var(--text); }
.page-title { font-size: 24px; font-weight: 800; letter-spacing: -.025em; }
.jornada-block { margin-bottom: 20px; }
.jornada-block .jh { font-size: 12px; font-weight: 700; color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }

.site-footer { border-top: 1px solid var(--border); padding: 24px; text-align: center; color: var(--text-faint); font-size: 12.5px; }

@media (max-width: 640px) {
  .hero { padding: 36px 24px; } .hero h1 { font-size: 25px; }
  .wrap { padding: 24px 16px 70px; }
}
