:root {
  --bg: #050505;
  --surface: #0d0d0f;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f4f4f5;
  --muted: #9a9aa3;
  --dim: #63636d;
  --red: #e31b23;
  --red-soft: rgba(227, 27, 35, 0.16);
  --grey: #8a8f98;
  --display: "Bebas Neue", Impact, sans-serif;
  --sans: "Manrope", system-ui, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

.splash {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: #000;
  transition: opacity .7s var(--ease), visibility .7s;
}
.splash.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-glow {
  position: absolute; width: 42vmin; height: 42vmin; border-radius: 50%;
  background: radial-gradient(circle, rgba(227,27,35,.28), transparent 70%);
  filter: blur(8px);
}
.splash-logo {
  position: relative; width: min(280px, 62vw);
  filter: drop-shadow(0 20px 50px rgba(227,27,35,.25));
  animation: rise .9s var(--ease) both;
}
.splash-tag {
  position: relative; margin: 18px 0 0;
  font-size: 12px; letter-spacing: .28em; text-transform: uppercase;
  color: var(--grey); animation: rise .9s var(--ease) .12s both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(18px) scale(.96); }
  to { opacity: 1; transform: none; }
}

.top {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 18px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(5,5,5,.88);
  backdrop-filter: blur(12px);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text);
  font-family: var(--display); font-size: 28px; letter-spacing: .04em;
}
.brand img { width: 40px; height: 40px; object-fit: contain; }
.nav { display: flex; gap: 6px; flex: 1; justify-content: center; }
.nav-btn, .ghost, .primary, .stat-tabs button, .fecha-tabs button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-family: var(--sans);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 999px;
  padding: 9px 14px;
  transition: .18s ease;
}
.nav-btn.is-active, .stat-tabs button.is-active, .fecha-tabs button.is-active {
  color: #fff; border-color: rgba(227,27,35,.5); background: var(--red-soft);
}
.nav-btn:hover, .ghost:hover, .stat-tabs button:hover, .fecha-tabs button:hover {
  color: #fff; border-color: rgba(255,255,255,.22);
}
.primary {
  background: linear-gradient(135deg, #ff3b3f, #b50f16);
  border: 0; color: #fff;
  box-shadow: 0 10px 28px rgba(227,27,35,.25);
}
.top-actions { display: flex; gap: 8px; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 220px) 1fr;
  gap: 28px;
  align-items: center;
  padding: 42px 22px 18px;
  max-width: 1100px;
  margin: 0 auto;
}
.hero-mark {
  aspect-ratio: 1;
  border-radius: 28px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 35%, rgba(227,27,35,.18), transparent 55%),
    #080808;
  display: grid; place-items: center;
  overflow: hidden;
}
.hero-mark img { width: 78%; height: 78%; object-fit: contain; }
.eyebrow {
  margin: 0 0 8px;
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--red);
  font-weight: 800;
}
.hero h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(64px, 12vw, 108px);
  line-height: .9;
  letter-spacing: .02em;
}
.lede { margin: 12px 0 0; color: var(--muted); font-size: 16px; max-width: 42ch; }

.panel {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 22px 64px;
}
.panel-head { margin-bottom: 18px; }
.panel-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 42px;
  letter-spacing: .03em;
}
.panel-head p { margin: 6px 0 0; color: var(--dim); font-size: 13px; }

.fecha-tabs, .stat-tabs {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 18px;
}

.match-list, .stats-wrap, .teams-grid { display: grid; gap: 10px; }
.match-card, .stat-row, .team-card, .admin-editor {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 14px 16px;
}
.match-card {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
}
.match-side { display: grid; gap: 4px; }
.match-side.away { text-align: right; }
.match-name { font-weight: 800; font-size: 15px; }
.match-short { color: var(--dim); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.match-mid { text-align: center; min-width: 88px; }
.score {
  font-family: var(--display);
  font-size: 34px;
  letter-spacing: .04em;
  color: #fff;
}
.vs { color: var(--dim); font-size: 12px; font-weight: 800; letter-spacing: .16em; }
.meta-line { margin-top: 4px; color: var(--muted); font-size: 12px; }
.badge {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: rgba(255,255,255,.05);
  color: var(--muted);
}
.badge.played { color: #8dffb0; background: rgba(80,200,120,.12); }
.badge.live { color: #ffd27a; background: rgba(255,180,60,.14); }
.badge.postponed { color: #ff8f8f; background: rgba(227,27,35,.14); }

.stats-table { width: 100%; border-collapse: collapse; }
.stats-table th, .stats-table td {
  text-align: left; padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.stats-table th {
  color: var(--dim);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.stats-table td.num { font-weight: 800; color: var(--red); width: 64px; }

.teams-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.team-card {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 8px;
  padding-top: 18px;
}
.team-card h3 { margin: 0 0 4px; font-size: 16px; }
.team-card p { margin: 0; color: var(--dim); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }

.team-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
}
.team-logo.sm { width: 28px; height: 28px; border-radius: 7px; }
.team-logo.lg { width: 72px; height: 72px; border-radius: 16px; }
.team-logo-fallback {
  display: inline-grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  color: var(--muted);
  text-transform: uppercase;
}
.team-logo-fallback.lg { font-size: 18px; }
.match-side .team-logo { margin-bottom: 6px; }
.match-side.away .team-logo { margin-left: auto; }
.match-side:not(.away) .team-logo { margin-right: auto; }

.table-wrap { width: 100%; }
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.standings-hint {
  margin: 0 0 12px;
  color: var(--dim);
  font-size: 12px;
}
.standings-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}
.standings-table th,
.standings-table td {
  padding: 11px 10px;
  font-size: 13px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.standings-table thead th {
  color: var(--dim);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 800;
  background: #0a0a0c;
  position: sticky;
  top: 0;
}
.standings-table th.pos,
.standings-table td.pos {
  width: 52px;
  text-align: center;
  padding: 0;
}
.standings-table td.pos span {
  display: grid;
  place-items: center;
  min-height: 46px;
  background: #0b1c3a;
  color: #d8e6ff;
  font-weight: 800;
  font-family: var(--display);
  font-size: 20px;
  letter-spacing: .04em;
  border-right: 1px solid rgba(120,160,220,.18);
}
.standings-table th.team,
.standings-table td.team { min-width: 180px; text-align: left; }
.standings-table td.num,
.standings-table th:not(.team):not(.pos) { text-align: center; }
.standings-table td.pts {
  color: var(--red);
  font-weight: 800;
}
.standings-table tr.is-alt td:not(.pos) {
  background: rgba(255,255,255,.025);
}
.standings-table tbody tr:hover td:not(.pos) {
  background: rgba(227,27,35,.06);
}
.team-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.team-cell-name { font-weight: 700; }
.dif-pos { color: #8dffb0; font-weight: 700; }
.dif-neg { color: #ff8f8f; font-weight: 700; }
.standings-table td.pct { color: var(--muted); }
.standings-empty {
  text-align: center;
  color: var(--dim);
  padding: 28px 12px !important;
}

.admin-bar {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 10px 0 14px;
}
.admin-bar button { border-radius: 10px; }
.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.field-row input, .field-row select, .modal-card input, .admin-editor input, .admin-editor select {
  width: 100%;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #09090b;
  color: var(--text);
  padding: 0 10px;
  font: inherit;
  outline: none;
}
.field-row input:focus, .modal-card input:focus {
  border-color: rgba(227,27,35,.5);
}

.modal {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center;
}
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.72); }
.modal-card {
  position: relative;
  width: min(400px, 92vw);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #0f0f12;
  padding: 22px;
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
}
.modal-card h3 { margin: 0; font-family: var(--display); font-size: 34px; letter-spacing: .04em; }
.modal-sub { margin: 6px 0 16px; color: var(--muted); font-size: 13px; }
.modal-card label { display: grid; gap: 6px; margin-bottom: 12px; font-size: 12px; color: var(--dim); text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.error { color: #ff7d7d; font-size: 13px; margin: 0 0 10px; }

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  z-index: 90; padding: 12px 16px; border-radius: 999px;
  background: #15151a; border: 1px solid var(--line);
  font-size: 13px; font-weight: 700;
  box-shadow: 0 16px 40px rgba(0,0,0,.4);
}

.foot {
  display: flex; justify-content: space-between; gap: 12px;
  max-width: 1100px; margin: 0 auto; padding: 18px 22px 32px;
  color: var(--dim); font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
}
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: #fff; }

@media (max-width: 760px) {
  .top { flex-wrap: wrap; }
  .nav { order: 3; width: 100%; justify-content: flex-start; overflow-x: auto; }
  .hero { grid-template-columns: 1fr; }
  .hero-mark { max-width: 220px; }
  .match-card { grid-template-columns: 1fr; text-align: center; }
  .match-side.away { text-align: center; }
}
