/* Página pública de partidos. Diseño: hero azul con cancha y tarjetas por liga. */

:root {
  --ground: #0e3a8c;
  --accent: #1d4ed8;
  --bg: #f3f6fc;
  --card: #ffffff;
  --line: #e2e8f0;
  --text: #0f172a;
  --muted: #475569;
  --suave: #f5f8ff;
  --chip: #f1f5fb;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a111f;
    --card: #121c2e;
    --line: #24324c;
    --text: #e8edf6;
    --muted: #9fb0c9;
    --suave: #16233b;
    --chip: #1a2740;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-family: "Space Grotesk", Inter, system-ui, sans-serif; letter-spacing: -0.01em; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  background: var(--ground);
  color: #fff;
  padding: 28px 32px 72px;
}

.hero-cancha { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

.hero-wrap {
  position: relative;
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.marca { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 1.05rem; font-family: "Space Grotesk", sans-serif; }

.marca-logo {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.hero-fila {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.hero-fila h1 { font-size: 2.5rem; font-weight: 700; }

.toggle {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.24);
  flex: none;
}

.toggle a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 10px;
  color: #fff;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.toggle a.on { background: #fff; color: var(--ground); font-weight: 600; }

/* ---------- Contenido ---------- */

.wrap {
  position: relative;
  margin-top: -40px;
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.vacio {
  margin: 0;
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.dia { display: flex; flex-direction: column; gap: 14px; }

.dia-cab { display: flex; align-items: center; gap: 12px; }

.dia-cab h2 {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 6px 18px rgba(14, 58, 140, 0.08);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.dia-cab h2 svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
.dia-cab .linea { flex: 1; height: 1px; background: color-mix(in srgb, var(--line) 80%, var(--muted)); }
.dia-cab .dia-cuenta { font-size: 0.82rem; font-weight: 500; color: var(--muted); white-space: nowrap; }

/* ---------- Tarjeta de liga ---------- */

.liga {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
}

.liga-cab {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--suave);
  border-bottom: 1px solid var(--line);
}

.liga-ico {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line));
  color: var(--accent);
}

.liga-ico svg { width: 16px; height: 16px; }
.liga-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.liga-region { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.liga-txt h3 { font-size: 0.95rem; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.liga-cuenta {
  margin-left: auto;
  flex: none;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Fila de partido ---------- */

.fila {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 16px 18px;
  border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  transition: background-color 150ms ease;
}

.liga .fila:first-of-type { border-top: 0; }
.fila:hover { background: color-mix(in srgb, var(--accent) 4%, transparent); }

.col-hora { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.dia-min { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); }
.hora { font-family: "Space Grotesk", sans-serif; font-size: 1.05rem; font-weight: 700; color: var(--text); white-space: nowrap; }

.estado-pill {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.por-jugar .estado-pill { background: #eff4ff; color: #1e40af; }
.en-juego .estado-pill { background: #fee2e2; color: #b91c1c; }
.finalizado .estado-pill { background: var(--chip); color: var(--muted); }

.col-partido { display: flex; flex-direction: column; gap: 10px; min-width: 0; }

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

.eq { display: flex; align-items: center; gap: 10px; min-width: 0; }
.eq-local { justify-content: flex-end; text-align: right; }
.eq-nombre { font-size: 0.95rem; font-weight: 600; color: var(--text); overflow-wrap: break-word; line-height: 1.2; }
.eq.gana .eq-nombre { color: var(--accent); }

.chip {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 10px;
  background: var(--chip);
}

.chip img { width: 20px; height: 20px; object-fit: contain; }
.chip svg { width: 16px; height: 16px; }

.vs {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1.5px solid color-mix(in srgb, var(--muted) 40%, var(--line));
  background: var(--card);
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}

.marcador {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 40px;
  padding: 6px 12px;
  border-radius: 12px;
  background: var(--chip);
  font-family: "Space Grotesk", sans-serif;
  font-variant-numeric: tabular-nums;
}

.marcador b { font-size: 1.15rem; font-weight: 700; color: var(--text); }
.marcador b.alto { color: var(--accent); }
.marcador i { color: var(--muted); font-style: normal; }

.canales {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

.canales svg { width: 14px; height: 14px; flex: none; }

.pie {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.pie svg { width: 14px; height: 14px; }

/* ---------- Teléfono ---------- */

@media (max-width: 720px) {
  .hero { padding: 20px 16px 56px; }
  .hero-fila { flex-direction: column; align-items: flex-start; }
  .hero-fila h1 { font-size: 1.9rem; }
  .toggle { width: 100%; }
  .toggle a { flex: 1; justify-content: center; }

  .wrap { padding: 0 12px 32px; }

  .dia-cab { flex-wrap: wrap; }
  .dia-cab .linea { display: none; }
  .dia-cab h2 { flex: 1 1 auto; }

  .fila { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 14px; }
  .col-hora { flex-direction: row; align-items: center; gap: 10px; }
  .eq-nombre { font-size: 0.88rem; }
  .chip { width: 28px; height: 28px; }
  .chip img { width: 18px; height: 18px; }
  .encuentro { gap: 8px; }
}

@media (max-width: 400px) {
  .marcador b { font-size: 1rem; }
  .vs { width: 34px; height: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
