:root {
  --bg: #f4f4f1;
  --card: #ffffff;
  --ink: #141414;
  --muted: #6d6d6d;
  --line: #e5e5df;
  --soft: #f8f8f5;
  --accent: #111111;
  --good: #0f5132;
  --gold: #b8860b;
  --danger: #d71920;
  --radius: 22px;
  --shadow: 0 18px 45px rgba(0, 0, 0, .08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(15, 81, 50, .10), transparent 34rem),
    radial-gradient(circle at top right, rgba(184, 134, 11, .12), transparent 30rem),
    var(--bg);
  color: var(--ink);
}

.page-shell {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
}

.hero { padding: 44px 0 28px; }

.kicker {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 7px 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.68);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.kicker::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--danger);
  box-shadow: 0 0 0 6px rgba(215, 25, 32, .10);
}

.hero h1 {
  margin: 18px 0 10px;
  max-width: 800px;
  font-size: clamp(34px, 6vw, 72px);
  line-height: .94;
  letter-spacing: -0.06em;
}

.hero p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.nav-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin: 22px 0 0;
}

.nav-grid a {
  text-decoration: none;
  color: var(--ink);
  background: rgba(255,255,255,.82);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  font-weight: 900;
  font-size: 13px;
}

.widget-grid {
  display: grid;
  grid-template-columns: 1.12fr .88fr;
  gap: 22px;
  align-items: start;
  padding-bottom: 42px;
}

.full-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
  padding-bottom: 42px;
}

.stack { display: grid; gap: 22px; }

.widget-card {
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(229,229,223,.86);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.widget-pad { padding: 22px; }

.widget-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}

.widget-title h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.widget-title small {
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.match-selector {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--card);
  padding: 12px 14px;
  border-radius: 14px;
  margin-bottom: 14px;
  font-weight: 800;
}

.match-top {
  padding: 24px;
  color: white;
  background:
    linear-gradient(135deg, rgba(0,0,0,.88), rgba(0,0,0,.68)),
    linear-gradient(90deg, var(--home-color, #0f5132), var(--away-color, #b8860b));
}

.match-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: rgba(255,255,255,.72);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 20px;
}

.scoreboard {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
}

.team { min-width: 0; }
.team.away { text-align: right; }

.team-name {
  display: block;
  font-size: clamp(20px, 4vw, 32px);
  font-weight: 950;
  letter-spacing: -0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-short {
  display: inline-flex;
  margin-top: 7px;
  color: rgba(255,255,255,.70);
  font-weight: 900;
  font-size: 13px;
}

.score {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 10px;
  align-items: center;
  font-size: clamp(42px, 8vw, 76px);
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.07em;
}

.score small {
  color: rgba(255,255,255,.45);
  font-size: .65em;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  padding: 9px 13px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.86);
  font-weight: 900;
  font-size: 13px;
}

.live-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--danger);
}

.tabs {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.tab-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 12px;
  border-radius: 999px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

.tab-btn.active {
  color: white;
  background: var(--accent);
}

.panel { display: none; }
.panel.active { display: block; }

.stat-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.stat-row:last-child { border-bottom: 0; }

.stat-head {
  display: grid;
  grid-template-columns: 70px 1fr 70px;
  gap: 10px;
  align-items: center;
  margin-bottom: 9px;
  font-weight: 950;
}

.stat-head span:nth-child(2) {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.stat-head span:last-child { text-align: right; }

.stat-bars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 12px;
  background: #ededeb;
  border-radius: 999px;
  overflow: hidden;
}

.home-bar {
  justify-self: end;
  height: 100%;
  background: var(--home-color, #0f5132);
  border-radius: 999px 0 0 999px;
}

.away-bar {
  height: 100%;
  background: var(--away-color, #b8860b);
  border-radius: 0 999px 999px 0;
}

.event-list, .cards-list { display: grid; gap: 10px; }

.event-item, .info-card {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 12px;
  padding: 13px;
  background: var(--soft);
  border-radius: 16px;
}

.event-minute, .info-number { font-weight: 950; }

.event-body strong, .info-body strong { display: block; }
.event-body small, .info-body small { color: var(--muted); }

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

th, td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

td.num, th.num { text-align: right; }

tr.qualify td:first-child {
  font-weight: 950;
  color: var(--good);
}

.group-block + .group-block { margin-top: 24px; }
.group-name { margin: 0 0 10px; font-size: 18px; }

.match-list { display: grid; gap: 12px; }

.schedule-item {
  display: grid;
  grid-template-columns: 76px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--soft);
}

.schedule-time { font-weight: 950; }

.schedule-teams { min-width: 0; }

.schedule-teams strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.schedule-teams small { color: var(--muted); }

.badge {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  background: #ededeb;
  font-weight: 900;
  font-size: 12px;
  white-space: nowrap;
}

.badge.live {
  color: white;
  background: var(--danger);
}

.stat-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 11px;
}

.metric {
  padding: 14px;
  border-radius: 18px;
  background: var(--soft);
  border: 1px solid var(--line);
}

.metric strong {
  display: block;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.metric small { color: var(--muted); font-weight: 800; }

.bracket {
  display: grid;
  grid-template-columns: repeat(3, minmax(210px, 1fr));
  gap: 14px;
  overflow-x: auto;
}

.round {
  min-width: 210px;
  display: grid;
  gap: 10px;
}

.bracket-match {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--soft);
}

.bracket-match strong { display: block; }
.bracket-match small { color: var(--muted); }

.embed-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 14px;
}

.embed-code {
  display: block;
  margin-top: 12px;
  padding: 14px;
  border-radius: 16px;
  background: #111;
  color: #fff;
  overflow-x: auto;
  font-size: 13px;
}

.footer {
  padding: 24px 0 42px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 980px) {
  .widget-grid, .full-grid { grid-template-columns: 1fr; }
  .nav-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 580px) {
  .page-shell { width: min(100% - 20px, 1180px); }
  .hero { padding-top: 28px; }
  .widget-pad, .match-top { padding: 18px; }
  .scoreboard { gap: 8px; }
  .team-name { font-size: 18px; }
  .score { font-size: 42px; }
  .schedule-item { grid-template-columns: 1fr; }
  .badge { justify-self: start; }
  .stat-head { grid-template-columns: 54px 1fr 54px; }
  .stat-cards { grid-template-columns: 1fr; }
}

/* v1.3 · Ajustes de marca y encabezado compacto */
.brand-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  color: rgba(255,255,255,.78);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.brand-dot {
  width: 9px;
  height: 9px;
  border-radius: 99px;
  background: #fff;
  box-shadow: 0 0 0 5px rgba(255,255,255,.12);
}

.match-top {
  padding: 18px 22px 16px;
}

.match-meta {
  margin-bottom: 14px;
}

.score {
  font-size: clamp(38px, 6vw, 64px);
}

.team-name {
  font-size: clamp(20px, 3vw, 28px);
}

.live-pill {
  margin-top: 15px;
}

.match-context {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.context-chip {
  display: inline-flex;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.11);
  color: rgba(255,255,255,.78);
  font-size: 12px;
  font-weight: 850;
}

.summary-hero {
  display: grid;
  gap: 12px;
}

.hero-goal {
  padding: 18px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(15,81,50,.12), rgba(184,134,11,.12)),
    var(--soft);
  border: 1px solid var(--line);
}

.hero-goal strong {
  display: block;
  font-size: clamp(22px, 4vw, 34px);
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin-bottom: 8px;
}

.hero-goal span {
  color: var(--muted);
  font-weight: 800;
}

.summary-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 11px;
}

.embed-code {
  white-space: pre-wrap;
}

@media (max-width: 580px) {
  .brand-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .summary-metrics {
    grid-template-columns: 1fr;
  }

  .match-context {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

/* v1.5 · API real + enriquecimiento local */
.team-flag { display:inline-block; margin-right:8px; }
.empty-state { padding:18px; border:1px solid var(--line); border-radius:18px; background:var(--soft); color:var(--muted); font-weight:800; line-height:1.45; }
.source-line { margin-top:12px; color:rgba(255,255,255,.62); font-size:11px; font-weight:800; }
.match-selector { display:none; }


/* v1.6 · Producto limpio */
.section-label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.compact-list {
  display: grid;
  gap: 10px;
}

.feature-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(15,81,50,.08), rgba(184,134,11,.08)),
    var(--soft);
  border: 1px solid var(--line);
}

.feature-card strong {
  display: block;
  font-size: 20px;
  line-height: 1.08;
  letter-spacing: -0.04em;
  margin-bottom: 8px;
}

.feature-card small {
  display: block;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.35;
}

.calendar-toolbar,
.group-toolbar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 14px;
}

.filter-btn {
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--ink);
  padding: 9px 12px;
  border-radius: 999px;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
}

.filter-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.schedule-item {
  grid-template-columns: 72px 1fr;
}

.schedule-item .badge {
  grid-column: 1 / -1;
  width: fit-content;
}

.schedule-date-chip {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #ededeb;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.widget-muted-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.news-card {
  padding: 15px;
  border-radius: 18px;
  background: var(--soft);
  border: 1px solid var(--line);
}

.news-card strong {
  display: block;
  font-size: 16px;
  line-height: 1.2;
  margin-bottom: 6px;
}

.news-card small {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.35;
}

.venue-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.venue-card {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--soft);
}

.venue-card strong {
  display: block;
  font-size: 16px;
  line-height: 1.15;
}

.venue-card small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.35;
}

.venue-card .metric-line {
  margin-top: 10px;
  font-size: 24px;
  font-weight: 950;
  letter-spacing: -0.04em;
}

.dashboard-focus {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 22px;
  align-items: start;
  padding-bottom: 42px;
}

.dashboard-secondary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  padding-bottom: 42px;
}

@media (max-width: 980px) {
  .dashboard-focus,
  .dashboard-secondary,
  .venue-grid {
    grid-template-columns: 1fr;
  }
}


/* v1.7 · Widgets de portada */
.live-stack {
  display: grid;
  gap: 12px;
}

.live-card {
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(15,81,50,.10), rgba(184,134,11,.08)),
    var(--soft);
}

.live-card strong {
  display: block;
  font-size: 22px;
  line-height: 1.08;
  letter-spacing: -0.04em;
  margin-bottom: 7px;
}

.live-card small {
  color: var(--muted);
  font-weight: 850;
  line-height: 1.35;
}

.live-scoreline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}

.live-scoreline span {
  font-weight: 950;
}

.live-scoreline b {
  font-size: 30px;
  letter-spacing: -0.06em;
}

.phase-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.phase-tabs button {
  flex: 1;
}

.compact-calendar-note {
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(0,0,0,.04);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.venue-region {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.widget-list-link {
  text-decoration: none;
  color: inherit;
}


/* v1.8 · Ajustes finos de lógica y UI */
.filter-btn:disabled,
.filter-btn.disabled {
  opacity: .42;
  cursor: not-allowed;
}

.brand-row span:last-child {
  text-transform: none;
}

.source-line {
  color: rgba(255,255,255,.72);
}

.venue-country-panel {
  display: none;
}

.venue-country-panel.active {
  display: block;
}

.schedule-teams small {
  line-height: 1.35;
}

.no-source {
  display: none;
}


/* v1.9 · En vivo final */
.live-meta {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 850;
  line-height: 1.4;
}

.live-card.upcoming b {
  font-size: 22px;
  letter-spacing: -0.03em;
}

.live-card.finished {
  background:
    linear-gradient(135deg, rgba(0,0,0,.06), rgba(15,81,50,.08)),
    var(--soft);
}

.live-card.live-now {
  background:
    linear-gradient(135deg, rgba(215,25,32,.12), rgba(15,81,50,.08)),
    var(--soft);
}

.live-card.live-now {
  border-color: rgba(215,25,32,.25);
}


/* v2.2 · Fixture visual + partidos de hoy */
.fixture-visual-stack {
  display: grid;
  gap: 18px;
}

.fixture-day-block {
  display: grid;
  gap: 10px;
}

.fixture-day-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.fixture-day-title strong {
  font-size: 18px;
  letter-spacing: -0.03em;
}

.fixture-day-title small {
  color: var(--muted);
  font-weight: 900;
}

.visual-match-grid {
  display: grid;
  gap: 12px;
}

.visual-match-card {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(15,81,50,.08), rgba(184,134,11,.07)),
    var(--soft);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.visual-match-card:hover {
  transform: translateY(-1px);
  border-color: rgba(20,20,20,.22);
}

.visual-match-card.live {
  border-color: rgba(215,25,32,.28);
  background:
    linear-gradient(135deg, rgba(215,25,32,.12), rgba(15,81,50,.08)),
    var(--soft);
}

.visual-match-card.finished {
  background:
    linear-gradient(135deg, rgba(0,0,0,.055), rgba(15,81,50,.07)),
    var(--soft);
}

.visual-match-head,
.visual-match-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
}

.visual-match-head small,
.visual-match-foot span:last-child {
  text-align: right;
}

.visual-match-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px 0 12px;
}

.visual-team {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.visual-team.away {
  text-align: right;
}

.visual-flag {
  font-size: 25px;
  line-height: 1;
}

.visual-team strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 18px;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.visual-center {
  display: grid;
  justify-items: center;
  gap: 5px;
  min-width: 76px;
}

.visual-center b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 70px;
  padding: 9px 10px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.visual-center small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .04em;
}

@media (max-width: 580px) {
  .visual-match-body {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .visual-team,
  .visual-team.away {
    grid-template-columns: auto 1fr;
    align-items: center;
    text-align: left;
  }

  .visual-center {
    order: -1;
    justify-items: start;
  }

  .visual-center b {
    min-width: 92px;
  }
}


/* v23 · limpieza visual editorial */
.match-editorial-summary {
  display: grid;
  gap: 12px;
}

.match-editorial-summary p {
  margin: 0;
  color: var(--ink);
  font-size: clamp(17px, 2.8vw, 23px);
  line-height: 1.28;
  letter-spacing: -0.03em;
}

.match-editorial-summary p strong {
  font-weight: 950;
}

.editorial-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.editorial-meta-line span + span::before {
  content: "•";
  margin-right: 14px;
  color: rgba(20,20,20,.32);
}

.visual-match-card {
  padding: 17px 18px;
  border-radius: 24px;
  background: #fff;
}

.visual-match-body {
  padding: 16px 0 14px;
}

.visual-flag {
  font-size: clamp(34px, 6vw, 50px);
}

.visual-team strong {
  font-size: clamp(19px, 3.5vw, 28px);
  font-weight: 950;
}

.visual-center {
  min-width: 92px;
}

.visual-center b {
  min-width: 86px;
  padding: 10px 13px;
  font-size: clamp(21px, 4vw, 34px);
  font-weight: 950;
}

.visual-center.has-time b {
  font-size: clamp(18px, 3.5vw, 28px);
}

.scoreboard .team-flag {
  display: inline-block;
  margin-right: 10px;
  font-size: clamp(32px, 5vw, 52px);
  vertical-align: middle;
}

.scoreboard .team-name {
  font-weight: 950;
}

.score {
  font-weight: 950;
  letter-spacing: -0.07em;
}

@media (max-width: 580px) {
  .editorial-meta-line {
    display: grid;
    gap: 5px;
  }

  .editorial-meta-line span + span::before {
    content: "";
    margin-right: 0;
  }

  .visual-match-body {
    gap: 10px;
  }

  .visual-center {
    justify-items: center;
  }
}
