/* ============================================================
   Zona Campeonato - App stylesheet
   Paleta: azul/gris editorial sport-hub
   ============================================================ */

:root {
  --brand-500: #5d86a8;
  --brand-600: #496c89;
  --brand-700: #36506a;
  --brand-400: #7e9fba;
  --brand-300: #a4bfd4;
  --brand-200: #cbdbe8;
  --accent: #5f7aad;

  --bg-0: #060b13;
  --bg-1: #0c1623;
  --bg-2: #131f2f;
  --bg-3: #1a283a;
  --bg-4: #233247;
  --bg-5: #2c3d54;

  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.14);

  --t-1: #ffffff;
  --t-2: #cbd5e1;
  --t-3: #8a99ad;
  --t-4: #5a6778;

  --win: #3ddc84;
  --draw: #b8c5d3;
  --loss: #ef4f5f;
  --yellow: #ffc233;
  --red: #ef4f5f;
  --gold: #f5c542;

  --sidebar-w: 244px;
  --topbar-h: 64px;
  --radius-s: 8px;
  --radius: 12px;
  --radius-l: 18px;

  --font-display: 'Archivo', system-ui, sans-serif;
  --font-body: 'Manrope', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg-0);
  color: var(--t-1);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; }

/* ----------------- Login / Register layout ----------------- */
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  background:
    radial-gradient(1200px 600px at 20% 0%, rgba(93,134,168,0.18), transparent 60%),
    radial-gradient(800px 500px at 100% 100%, rgba(95,122,173,0.15), transparent 60%),
    var(--bg-0);
}
/* Capa de fondo opcional para auth (Login/Register) que se aplica cuando hay branding
   de un organizador. Cubre full viewport por detras de la card y reemplaza visualmente
   el fondo default del .auth-shell.
   Usamos !important para que no la pise la regla siguiente que mete todo en el flow. */
.auth-bg-tinted {
  position: fixed !important;
  inset: 0 !important;
  z-index: 0 !important;
  pointer-events: none;
}
.auth-bg-tinted:not([style]),
.auth-bg-tinted[style=""] { display: none; }
.auth-shell > *:not(.auth-bg-tinted) { position: relative; z-index: 1; }
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 36px 32px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
  box-sizing: border-box;
}

/* Compactar el card en mobile chico (≤ 480px) — el padding original de 32px se come
   demasiado ancho y termina haciendo overflow horizontal del logo y el boton de Google. */
@media (max-width: 480px) {
  .auth-shell { padding: 12px; }
  .auth-card { padding: 24px 18px; border-radius: 14px; }
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.auth-brand .logo {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 900;
  color: white; font-size: 18px;
}
.auth-brand h1 {
  font-size: 22px;
  letter-spacing: -0.02em;
}
.auth-brand .tagline {
  color: var(--t-3);
  font-size: 12px;
  font-weight: 500;
}
.auth-card h2 {
  font-size: 24px;
  margin-bottom: 6px;
}
.auth-card .sub {
  color: var(--t-3);
  font-size: 13px;
  margin-bottom: 22px;
}
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--t-2);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.form-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--t-1);
  outline: none;
  transition: border-color .15s, background .15s;
}
.form-input:focus {
  border-color: var(--brand-500);
  background: var(--bg-3);
}
.form-input::placeholder { color: var(--t-4); }
/* Ocultar las flechitas (spinners) de los inputs type="number" — ocupan espacio y
   en formularios de score (goles, penales, etc) no aportan valor. El usuario tipea. */
.form-input[type="number"]::-webkit-inner-spin-button,
.form-input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.form-input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

.btn {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform .1s, background .15s;
  border: 1px solid transparent;
}
.btn:active { transform: scale(0.99); }
.btn-primary {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: white;
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.btn-secondary {
  background: var(--bg-3);
  color: var(--t-1);
  border-color: var(--line-strong);
}
.btn-secondary:hover { background: var(--bg-4); }
.btn-ghost {
  background: transparent;
  color: var(--t-2);
}
.btn-ghost:hover { color: var(--t-1); }
.btn-small {
  width: auto;
  padding: 8px 14px;
  font-size: 13px;
}

.alert {
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
}
.alert-error {
  background: rgba(239, 79, 95, 0.14);
  border: 1px solid rgba(239, 79, 95, 0.45);
  color: #ffb3bb;
}
.alert-success {
  background: rgba(34, 197, 94, 0.16);
  border: 1px solid rgba(34, 197, 94, 0.5);
  color: #a8f0c8;
}
.alert-info {
  background: rgba(93, 134, 168, 0.18);
  border: 1px solid rgba(93, 134, 168, 0.45);
  color: var(--brand-200);
}
/* En contextos con fondo claro (auth-card sobre cream, etc) los colores
   pasteles arriba se ven muy lavados. Detectamos via color-mix del bg
   tinted no aplica facilmente, asi que el override se hace por contexto
   (.invitacion-card .alert-*, .auth-card-themed .alert-* etc). */

.auth-footer {
  margin-top: 22px;
  text-align: center;
  font-size: 13px;
  color: var(--t-3);
}
/* Separador "o" entre login con email y login con Google */
.auth-sep {
  display: flex; align-items: center; gap: 10px;
  margin: 18px 0 14px;
  color: var(--t-4);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
}
.auth-sep::before, .auth-sep::after {
  content: ''; flex: 1; height: 1px;
  background: color-mix(in srgb, var(--t-3) 20%, transparent);
}
.zc-google-btn-wrap {
  display: flex; justify-content: center;
  min-height: 44px; /* reserva espacio hasta que renderice el botón de Google */
  overflow: hidden; /* el iframe de Google tiene ancho fijo, recortamos si no entra */
  max-width: 100%;
}
.zc-google-btn-wrap > div { max-width: 100%; }
.auth-footer a {
  color: var(--brand-300);
  font-weight: 600;
}
.auth-footer a:hover { color: var(--brand-200); }

/* ----------------- App layout ----------------- */
.app-layout {
  display: block;
  min-height: 100vh;
}
.sidebar {
  background: var(--bg-1);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  /* Sidebar fija: ocupa el alto completo de la ventana */
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  z-index: 60;
  transition: transform .25s ease;
}
.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(6, 11, 19, 0.55);
  backdrop-filter: blur(2px);
  z-index: 55;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--line);
}
.sidebar-brand .logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 900;
  color: white;
}
.sidebar-brand .name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.01em;
}
.sidebar-brand .name small {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: var(--t-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  overflow-y: auto;
}
.nav-section-title {
  font-size: 11px;
  color: var(--t-4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  padding: 14px 10px 6px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-s);
  color: var(--t-2);
  font-weight: 600;
  font-size: 13.5px;
  margin-bottom: 2px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--bg-2); color: var(--t-1); }
.nav-link.active {
  background: var(--bg-3);
  color: var(--t-1);
  box-shadow: inset 3px 0 0 var(--brand-500);
}
.nav-link .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--t-4);
}
.nav-link.active .dot { background: var(--brand-300); }
.sidebar-foot {
  padding: 14px 12px;
  border-top: 1px solid var(--line);
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-chip .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-4);
  display: grid; place-items: center;
  font-weight: 700;
  font-family: var(--font-display);
}
.user-chip .who {
  flex: 1;
  min-width: 0;
}
.user-chip .who .name {
  font-size: 13px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-chip .who .email {
  font-size: 11px; color: var(--t-4);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-left: var(--sidebar-w);
}
.topbar {
  height: var(--topbar-h);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  background: var(--bg-1);
  /* Topbar pegada arriba al hacer scroll */
  position: sticky;
  top: 0;
  z-index: 50;
}
.sidebar-toggle {
  display: none;
  background: transparent; border: none;
  color: var(--t-2); font-size: 20px;
  width: 36px; height: 36px; align-items: center; justify-content: center;
  border-radius: 8px; cursor: pointer;
}
.sidebar-toggle:hover { background: var(--bg-2); color: var(--t-1); }

/* ============================================================
   RESPONSIVE — mobile (≤ 900px) y tablet (≤ 1100px)
   ============================================================ */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: 8px 0 32px rgba(0,0,0,0.4);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar.open ~ .sidebar-backdrop,
  body.sidebar-open .sidebar-backdrop { display: block; }
  .main { margin-left: 0; }
  .topbar { padding: 0 10px; gap: 8px; }
  .sidebar-toggle { display: inline-flex; }
  /* Crumb: truncar en una línea, ocultar el subtítulo */
  .topbar .crumb {
    font-size: 13px; flex: 1 1 auto; min-width: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .topbar .crumb-sub { display: none; }
  .topbar-right { gap: 6px !important; flex: 0 0 auto; }
  /* En mobile: ocultamos search y bell para que entre todo en una línea */
  .topbar-search, .topbar-bell { display: none !important; }
  /* CTA principal: solo el ícono (más compacto) */
  .topbar-cta .cta-label { display: none; }
  .topbar-cta { padding: 8px 10px !important; }
  .view { padding: 14px 10px; }
  .page-header { padding-left: 10px; padding-right: 10px; }
  .card { padding: 12px 10px; }
  .card + .card { margin-top: 10px; }
  .card-title { font-size: 14px; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
  .view-header { margin-bottom: 14px; gap: 10px; }
  .view-header h2 { font-size: 22px; }
  /* tablas con scroll horizontal en mobile */
  .table { font-size: 12px; }
  .card > .table { display: block; overflow-x: auto; }
  /* fila de partido en mobile: nombres más chicos */
  .partido { gap: 8px; padding: 10px 12px; }
  .partido .equipo strong { font-size: 12.5px; }
  .partido .marcador { font-size: 18px; min-width: 56px; }
  /* modales: usar casi todo el ancho */
  .modal { padding: 18px; max-width: calc(100vw - 16px) !important; }
  .modal h3 { font-size: 17px; }
  .modal-actions { flex-wrap: wrap; }
  .modal-actions .btn { flex: 1 1 auto; }
  /* tabs scrolleables horizontalmente */
  .modal-tabs { overflow-x: auto; flex-wrap: nowrap; }
  .modal-tab { white-space: nowrap; flex-shrink: 0; }
  /* form rows */
  .row { flex-wrap: wrap; }
}
@media (min-width: 901px) {
  .sidebar-toggle { display: none !important; }
}
.topbar .crumb {
  font-size: 13px;
  color: var(--t-3);
}
.topbar .crumb strong {
  color: var(--t-1);
  font-weight: 600;
}
.topbar .spacer { flex: 1; }

.view {
  padding: 24px;
  overflow-y: auto;
}
.view-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.view-header h2 {
  font-size: 28px;
}
.view-header .sub {
  color: var(--t-3);
  font-size: 13px;
  margin-top: 4px;
}
.actions { display: flex; gap: 8px; }

/* ----------------- Cards / Tables ----------------- */
.card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 20px;
}
.card + .card { margin-top: 16px; }
.card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.stat {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.stat .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--t-3);
  font-weight: 700;
}
.stat .value {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.table {
  width: 100%;
  border-collapse: collapse;
}
.table th, .table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.table th {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--t-3);
  font-weight: 700;
  letter-spacing: 0.06em;
}
.table tr:hover td { background: var(--bg-2); }
.table .num { text-align: center; }
.table .pts { font-family: var(--font-display); font-weight: 800; color: var(--t-1); }

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-borrador { background: rgba(184, 197, 211, 0.15); color: var(--draw); }
.badge-en_curso { background: rgba(93, 134, 168, 0.2); color: var(--brand-300); }
.badge-finalizado { background: rgba(61, 220, 132, 0.15); color: var(--win); }
.badge-pendiente { background: rgba(138, 153, 173, 0.15); color: var(--t-3); }
.badge-jugado { background: rgba(61, 220, 132, 0.15); color: var(--win); }

.crest.crest-logo {
  background-color: transparent;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.crest {
  width: 28px; height: 28px; border-radius: 8px;
  display: inline-grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 11px;
  color: white;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  text-transform: uppercase;
}

.partido {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  margin-bottom: 8px;
}
.partido .equipo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600;
}
.partido .equipo.visit { justify-content: flex-end; }
.partido .marcador {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  color: var(--t-1);
  min-width: 70px;
  text-align: center;
}
.partido .marcador.pendiente { color: var(--t-4); font-size: 16px; }
/* Card de partido con metadata dentro (Partidos tab) */
.partido-card {
  grid-template-columns: 1fr auto 1fr;
  grid-template-rows: auto auto;
  row-gap: 8px;
  padding-bottom: 10px;
  transition: border-color .15s ease, background .15s ease;
}
.partido-card:hover { border-color: var(--brand-500); background: var(--bg-3); }
.partido-card .partido-meta {
  grid-column: 1 / -1;
  display: flex; flex-wrap: wrap; gap: 14px;
  font-size: 11.5px; color: var(--t-3);
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--line);
  margin-bottom: 4px;
}
.partido-card .partido-meta .meta-jornada {
  background: var(--brand-700); color: white;
  font-family: var(--font-display); font-weight: 700;
  font-size: 10.5px; padding: 2px 8px; border-radius: 999px;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.partidos-jornada-titulo {
  font-family: var(--font-display); font-weight: 800;
  font-size: 12.5px; color: var(--brand-300);
  text-transform: uppercase; letter-spacing: 0.1em;
  margin: 18px 4px 8px;
}
.partidos-jornada-titulo:first-child { margin-top: 4px; }

/* Navegador de fechas (admin) — select + prev/next + boton planillas */
.partidos-fecha-nav {
    display: flex; align-items: center; gap: 6px;
    margin-bottom: 14px; flex-wrap: wrap;
}
.partidos-fecha-select {
    min-width: 220px; max-width: 380px;
    font-weight: 600; font-size: 13px;
    padding: 6px 10px;
}
.partidos-fecha-nav .btn-small { padding: 6px 10px; }
.partidos-fecha-nav .btn-small[disabled] { opacity: .35; cursor: not-allowed; }
@media (max-width: 600px) {
    .partidos-fecha-select { min-width: 0; flex: 1 1 100%; order: -1; }
}
.rapido-input {
  width: 50px !important; text-align: center;
  font-family: var(--font-display); font-weight: 800; font-size: 18px;
  padding: 4px 6px !important;
}
.alert-warn {
  background: rgba(245, 197, 24, 0.12);
  border-left: 3px solid #f5c518;
  color: #f5c518;
  padding: 10px 12px; border-radius: 6px;
  font-size: 12.5px; margin: 8px 0;
}
.alert-warn i { margin-right: 6px; }
/* Tab Parámetros */
.param-section { padding: 12px 0; border-bottom: 1px solid var(--line); }
.param-section:last-child { border-bottom: none; }
.param-section h4 {
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
  color: var(--brand-300); margin: 0 0 10px;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.param-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 4px 12px; }
.param-rule { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 6px 0; flex-wrap: wrap; }
.param-rule .form-input { padding: 6px 8px !important; text-align: center; }
.partido-card .partido-meta i { margin-right: 4px; }
.partido-card .partido-meta span { display: inline-flex; align-items: center; }

/* ============================================================
   LANDING PUBLICO / PREVIEW DEL CONFIGURADOR
   ============================================================ */
.lp-root {
    min-height: 100vh;
    background: var(--lp-bg, #0c1623);
    color: var(--lp-fg, white);
    font-family: var(--font-body);
}
.lp-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 50;
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px;
    padding: 26px max(28px, calc((100% - 1200px) / 2));
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: padding .25s ease, background .25s ease, border-color .25s ease, backdrop-filter .25s ease;
    color: var(--lp-fg);
}
/* Cuando hay un hero detrás, header arranca totalmente transparente para que se vea la foto */
.lp-has-hero .lp-header { background: transparent; border-bottom-color: transparent; }
/* Cuando el usuario hace scroll, header se achica y toma el color del landing */
body.lp-scrolled .lp-header {
    padding-top: 12px; padding-bottom: 12px;
    background: color-mix(in srgb, var(--lp-bg) 90%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom-color: color-mix(in srgb, var(--lp-fg) 10%, transparent);
}
body.lp-scrolled .lp-logo img { height: 48px; }
body.lp-scrolled .lp-org-text strong { font-size: 16px; }
body.lp-scrolled .lp-org-text small { display: none; }
.lp-logo { display: inline-flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.lp-logo img { height: 96px; max-width: 240px; object-fit: contain; transition: height .25s ease, max-width .25s ease, opacity .25s ease; }
/* Si el hero tiene logo, ocultamos el del header mientras no se haya scrolleado */
.lp-hero-has-logo .lp-logo { opacity: 0; pointer-events: none; }
body.lp-scrolled .lp-hero-has-logo .lp-logo { opacity: 1; pointer-events: auto; }
.lp-org-name { font-family: var(--font-display); font-weight: 800; font-size: 28px; }
.lp-org-text { display: flex; flex-direction: column; line-height: 1.2; }
.lp-org-text strong { font-family: var(--font-display); font-weight: 800; font-size: 20px; }
.lp-org-text small { font-size: 12px; opacity: .65; font-weight: 500; }
.lp-header-nav { display: flex; flex-wrap: wrap; gap: 4px; }
.lp-header-nav a {
    padding: 8px 14px; border-radius: 999px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    color: inherit; text-decoration: none;
    font-size: 12.5px; font-weight: 600;
    transition: all .15s ease;
}
.lp-header-nav a:hover { background: var(--lp-primary); color: white; border-color: var(--lp-primary); }
@media (max-width: 700px) {
    .lp-header { padding: 16px; }
    .lp-logo img { height: 48px; }
    .lp-header-nav { width: 100%; }
}
.lp-foot { padding: 22px; text-align: center; opacity: .65; font-size: 12px; border-top: 1px solid color-mix(in srgb, var(--lp-fg) 8%, transparent); }
.lp-foot a { color: inherit; text-decoration: underline; }
.lp-muted { opacity: .65; font-size: 13px; }

.lp-section { max-width: 1100px; margin: 0 auto; padding: 36px 24px; }
.lp-section h2 { font-family: var(--font-display); font-size: 28px; margin-bottom: 16px; }

/* ====== Grilla de bloques (permite 1, 2 o 3 columnas) ====== */
.lp-blocks {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 24px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 36px 24px;
    align-items: start;
}
.lp-blocks .lp-section {
    max-width: none;
    margin: 0;
    padding: 0;
    grid-column: span 6;
    min-width: 0; /* permite que tablas internas hagan scroll sin romper grid */
}
.lp-blocks .lp-section-half { grid-column: span 3; }
.lp-blocks .lp-section-tercio { grid-column: span 2; }
@media (max-width: 900px) {
    .lp-blocks { padding: 24px 16px; gap: 16px; }
    .lp-blocks .lp-section-half,
    .lp-blocks .lp-section-tercio { grid-column: span 6; }
}

.lp-hero {
    position: relative;
    min-height: 100vh;
    width: 100%;
    display: flex; flex-direction: column; justify-content: center; align-items: stretch;
    padding: 120px 24px 60px;
    background:
        linear-gradient(rgba(0,0,0,0.35), rgba(0,0,0,0.55)),
        linear-gradient(135deg, var(--lp-primary), #36506a) center/cover;
    background-size: cover; background-position: center;
    gap: 28px;
    overflow: hidden;
}
.lp-hero-vid { background: #000; }
.lp-hero-video {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: 0;
    pointer-events: none;
}
.lp-hero-vid-overlay {
    position: absolute; inset: 0;
    width: 100% !important;
    max-width: none !important;
    z-index: 1;
    pointer-events: none;
}
.lp-hero > *:not(.lp-hero-video):not(.lp-hero-vid-overlay) { position: relative; z-index: 2; }
.lp-hero-with-cards { justify-content: flex-start; padding-top: 130px; padding-bottom: 32px; }
.lp-hero-with-cards .lp-hero-content { flex: 0 0 auto; margin-top: auto; }
.lp-hero-logo {
    display: block;
    width: 100%;
    max-width: 1200px !important;
    margin-left: auto;
    margin-right: auto;
}
.lp-hero-logo img { max-width: 92%; object-fit: contain; filter: drop-shadow(0 8px 24px rgba(0,0,0,0.55)); }

/* Animaciones de entrada del hero */
.lp-anim { animation-duration: .9s; animation-timing-function: cubic-bezier(.21,.86,.36,1); animation-fill-mode: both; }
.lp-anim-none { animation: none !important; }
.lp-anim-fade { animation-name: lpFade; }
.lp-anim-fade-up { animation-name: lpFadeUp; }
.lp-anim-fade-down { animation-name: lpFadeDown; }
.lp-anim-zoom { animation-name: lpZoom; }
.lp-anim-slide-left { animation-name: lpSlideLeft; }
.lp-anim-slide-right { animation-name: lpSlideRight; }
@keyframes lpFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes lpFadeUp { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } }
@keyframes lpFadeDown { from { opacity: 0; transform: translateY(-40px); } to { opacity: 1; transform: translateY(0); } }
@keyframes lpZoom { from { opacity: 0; transform: scale(.88); } to { opacity: 1; transform: scale(1); } }
@keyframes lpSlideLeft { from { opacity: 0; transform: translateX(-60px); } to { opacity: 1; transform: translateX(0); } }
@keyframes lpSlideRight { from { opacity: 0; transform: translateX(60px); } to { opacity: 1; transform: translateX(0); } }
.lp-hero-content { width: 100%; max-width: 1200px; margin: 0 auto; }
.lp-hero-rich { font-size: 18px; line-height: 1.5; }
.lp-hero-rich { line-height: 1.15; }
.lp-hero-rich h1 { font-family: var(--font-display); font-size: clamp(36px, 6vw, 68px); margin: 0 0 8px; line-height: 1.02; text-shadow: 0 4px 20px rgba(0,0,0,0.5); }
.lp-hero-rich h2 { font-family: var(--font-display); font-size: clamp(22px, 4vw, 38px); margin: 8px 0 6px; line-height: 1.05; text-shadow: 0 4px 16px rgba(0,0,0,0.45); }
.lp-hero-rich p { margin: 4px 0; line-height: 1.2; color: rgba(255,255,255,0.93); text-shadow: 0 2px 12px rgba(0,0,0,0.5); }
.lp-hero-rich span { line-height: 1; }
.lp-hero-rich br + br { display: none; }
@media (max-width: 700px) {
    .lp-hero-rich { line-height: 1.05; }
    .lp-hero-rich h1 { line-height: 0.98; margin-bottom: 4px; }
    .lp-hero-rich h2 { line-height: 1.0; margin: 4px 0; }
    .lp-hero-rich p { line-height: 1.15; margin: 2px 0; }
}
.lp-hero-rich ul { padding-left: 22px; margin: 8px 0; }
.lp-hero-rich a { color: var(--lp-primary); text-decoration: underline; }
/* Cuando NO hay hero block, dejamos espacio para que el header fixed no tape la primera sección */
.lp-root:not(.lp-has-hero) main { padding-top: 90px; }
.lp-hero > div { max-width: 1000px; }
.lp-hero h1 {
    font-family: var(--font-display); font-weight: 800;
    font-size: clamp(36px, 6vw, 64px);
    margin: 0; line-height: 1.05;
    text-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.lp-hero p {
    max-width: 700px; margin: 18px auto 0;
    font-size: clamp(15px, 2vw, 19px);
    color: rgba(255,255,255,0.92);
    text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}
.lp-btn {
    background: var(--lp-primary); color: white;
    padding: 14px 28px; border-radius: 999px;
    text-decoration: none; margin-top: 26px;
    display: inline-block; font-weight: 700;
    box-shadow: 0 8px 24px -4px color-mix(in srgb, var(--lp-primary) 60%, transparent);
    transition: transform .15s ease, box-shadow .15s ease;
}
.lp-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 32px -4px color-mix(in srgb, var(--lp-primary) 70%, transparent); }

/* Cards de torneos flotantes sobre la foto del hero */
.lp-hero-cards {
    margin-top: 28px;
    max-width: 1200px; width: 100%;
    margin-left: auto; margin-right: auto;
    padding: 0;
}
.lp-hero-cards-title {
    display: flex; align-items: center; gap: 10px;
    font-family: var(--font-display); font-weight: 800;
    color: white; font-size: 12px; letter-spacing: 0.14em;
    margin-bottom: 12px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.lp-hero-cards-title::before {
    content: ""; display: inline-block; width: 22px; height: 2px;
    background: var(--lp-primary);
}
.lp-hero-cards-count {
    background: rgba(255,255,255,0.15); color: white;
    padding: 2px 8px; border-radius: 999px;
    font-size: 11px; letter-spacing: 0; margin-left: 2px;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.2);
}
.lp-hero-cards-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}
.lp-hero-card {
    position: relative;
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 16px;
    padding: 16px 18px;
    color: white;
    text-decoration: none;
    transition: transform .25s ease, background .2s ease, border-color .2s ease, box-shadow .25s ease;
    display: flex; flex-direction: column; gap: 8px;
    min-height: 130px;
}
.lp-hero-card::before {
    content: ""; position: absolute; inset: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--lp-primary) 30%, transparent), transparent 70%);
    opacity: 0; transition: opacity .25s ease;
    pointer-events: none;
}
.lp-hero-card:hover {
    transform: translateY(-4px);
    background: rgba(255,255,255,0.14);
    border-color: rgba(255,255,255,0.3);
    box-shadow: 0 16px 36px -10px rgba(0,0,0,0.5);
}
.lp-hero-card:hover::before { opacity: 1; }
.lp-hero-card-tag {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--font-display); font-weight: 700;
    font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
    color: rgba(255,255,255,0.85);
}
.lp-hero-card-dot { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; }
.lp-hero-card-dot-en_curso { background: #3ddc84; box-shadow: 0 0 8px #3ddc84; animation: pubPulse 1.8s ease-in-out infinite; }
.lp-hero-card-dot-borrador { background: #f5c518; }
.lp-hero-card-dot-playoffs { background: var(--lp-primary); }
.lp-hero-card-dot-finalizado { background: #94a3b8; }
.lp-hero-card h3 {
    margin: 0;
    font-family: var(--font-display); font-weight: 800;
    font-size: 17px; line-height: 1.15;
    color: white;
}
.lp-hero-card-meta {
    display: flex; flex-wrap: wrap; gap: 10px;
    font-size: 11.5px; opacity: .88;
    margin-top: auto;
}
.lp-hero-card-meta i { color: var(--lp-primary); margin-right: 4px; font-size: 10.5px; }
.lp-hero-card-arrow {
    position: absolute; top: 16px; right: 18px;
    width: 26px; height: 26px; border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: grid; place-items: center;
    font-size: 11px; color: white;
    transition: background .2s ease, transform .25s ease;
}
.lp-hero-card:hover .lp-hero-card-arrow {
    background: var(--lp-primary);
    transform: translateX(2px);
}

/* Scroll hint debajo del hero */
.lp-hero-scrollhint {
    position: absolute; left: 50%; bottom: 18px;
    transform: translateX(-50%);
    width: 28px; height: 28px;
    color: rgba(255,255,255,0.7);
    display: grid; place-items: center;
    font-size: 14px;
    animation: lpBounce 2.2s ease-in-out infinite;
    pointer-events: none;
}
@keyframes lpBounce {
    0%, 100% { transform: translate(-50%, 0); opacity: .55; }
    50% { transform: translate(-50%, 8px); opacity: 1; }
}

@media (max-width: 700px) {
    .lp-hero { min-height: calc(100vh - 64px); padding: 64px 16px 40px; }
    .lp-hero-with-cards { padding-top: 88px; padding-bottom: 18px; }
    .lp-hero-cards-row { grid-template-columns: 1fr; }
    .lp-hero-card { min-height: auto; padding: 12px 14px; }
    .lp-hero-card h3 { font-size: 15px; }
    .lp-hero-scrollhint { display: none; }
}

.lp-torneos { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.lp-torneo {
    background: color-mix(in srgb, var(--lp-fg) 6%, transparent);
    border: 1px solid color-mix(in srgb, var(--lp-fg) 12%, transparent);
    border-radius: 16px; padding: 20px; text-decoration: none; color: inherit;
    transition: border-color .15s, transform .15s;
}
.lp-torneo:hover { border-color: var(--lp-primary); transform: translateY(-2px); }
.lp-torneo-tag { font-size: 11px; letter-spacing: 0.12em; color: var(--lp-primary); font-weight: 700; }
.lp-torneo h3 { font-family: var(--font-display); font-size: 20px; margin: 6px 0 4px; }
.lp-torneo-meta { font-size: 12px; opacity: .7; }

.lp-noticias { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.lp-noticia {
    background: color-mix(in srgb, var(--lp-fg) 5%, transparent);
    border: 1px solid color-mix(in srgb, var(--lp-fg) 10%, transparent);
    border-radius: 16px; overflow: hidden;
    text-decoration: none; color: inherit; display: block;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.lp-noticia:hover {
    transform: translateY(-4px);
    border-color: var(--lp-primary);
    box-shadow: 0 10px 30px -10px color-mix(in srgb, var(--lp-primary) 50%, transparent);
}
.lp-noticia-img {
    aspect-ratio: 16/9;
    background-size: cover; background-position: center;
    background-color: color-mix(in srgb, var(--lp-fg) 5%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--lp-fg) 6%, transparent);
}
.lp-noticia-body { padding: 18px; }
.lp-noticia h4 {
    font-family: var(--font-display); font-weight: 700;
    font-size: 17px; margin: 0 0 8px; line-height: 1.3;
}
.lp-noticia-fecha {
    font-size: 11px; opacity: .65;
    font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
    margin-bottom: 8px;
}
.lp-noticia-fecha i { color: var(--lp-primary); margin-right: 4px; }
.lp-noticia-excerpt {
    font-size: 13px; line-height: 1.55; opacity: .8;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
    overflow: hidden; margin-bottom: 10px;
}
.lp-noticia-leer {
    font-size: 12px; font-weight: 700;
    color: var(--lp-primary); display: inline-flex; align-items: center; gap: 6px;
    transition: gap .2s ease;
}
.lp-noticia:hover .lp-noticia-leer { gap: 10px; }

/* Galería mejorada con overlay */
.lp-galeria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}
.lp-media-cell {
    position: relative; aspect-ratio: 1/1;
    border-radius: 12px; overflow: hidden;
    background: color-mix(in srgb, var(--lp-fg) 6%, transparent);
    text-decoration: none; color: inherit;
    cursor: zoom-in; display: block;
}
.lp-media-cell-vid { cursor: default; aspect-ratio: 16/9; }
.lp-media-cell-vid video { width: 100%; height: 100%; object-fit: cover; }
.lp-media-img {
    width: 100%; height: 100%;
    background-size: cover; background-position: center;
    transition: transform .35s ease;
}
.lp-media-cell:hover .lp-media-img { transform: scale(1.08); }
.lp-media-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent 50%);
    display: flex; flex-direction: column; justify-content: flex-end;
    padding: 12px; opacity: 0; transition: opacity .2s ease;
    color: white; font-size: 12.5px; font-weight: 600;
}
.lp-media-overlay i {
    align-self: flex-end; font-size: 18px; color: white;
    background: rgba(0,0,0,0.4); width: 32px; height: 32px;
    border-radius: 50%; display: grid; place-items: center;
    margin-bottom: auto;
}
.lp-media-cell:hover .lp-media-overlay { opacity: 1; }
.lp-media-caption {
    padding: 6px 10px; font-size: 12px; opacity: .75;
    background: rgba(0,0,0,0.2);
}

/* Rich Text Editor (RTE) */
.rte { border: 1px solid var(--line); border-radius: 8px; background: var(--bg-2); overflow: hidden; }
.rte-toolbar {
    display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
    padding: 8px; border-bottom: 1px solid var(--line);
    background: var(--bg-3);
}
.rte-btn {
    width: 32px; height: 30px; border-radius: 6px;
    background: transparent; border: 1px solid transparent;
    color: var(--t-2); cursor: pointer; font-size: 13px;
    display: inline-grid; place-items: center;
    transition: background .12s, border-color .12s;
}
.rte-btn:hover { background: var(--bg-1); border-color: var(--line); color: var(--t-1); }
.rte-btn b, .rte-btn i, .rte-btn u { font-style: inherit; }
.rte-btn i { font-style: italic; }
.rte-sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.rte-font, .rte-size {
    height: 30px; padding: 2px 6px; border-radius: 6px;
    background: var(--bg-1); border: 1px solid var(--line);
    color: var(--t-1); font-size: 12.5px;
}
.rte-color-input { width: 0; height: 0; opacity: 0; position: absolute; pointer-events: none; }
.rte-editor {
    min-height: 200px; padding: 14px;
    color: var(--t-1); font-size: 14px; line-height: 1.6;
    outline: none;
}
.rte-editor:empty:before {
    content: attr(data-placeholder);
    color: var(--t-4);
}
.rte-editor h1 { font-family: var(--font-display); font-size: 28px; margin: 6px 0; }
.rte-editor h2 { font-family: var(--font-display); font-size: 22px; margin: 6px 0; }
.rte-editor p { margin: 4px 0; }

/* Lightbox de galería */
.lp-lightbox {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 200; display: grid; place-items: center;
    padding: 32px;
    cursor: zoom-out;
    animation: lpFadeIn .15s ease;
}
.lp-lightbox img {
    max-width: 95vw; max-height: 85vh;
    border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    cursor: default;
}
.lp-lightbox-close {
    position: absolute; top: 18px; right: 18px;
    background: rgba(255,255,255,0.1); border: none;
    width: 40px; height: 40px; border-radius: 50%;
    color: white; font-size: 18px; cursor: pointer;
    transition: background .15s;
}
.lp-lightbox-close:hover { background: rgba(255,255,255,0.2); }
.lp-lightbox-caption {
    position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,0.6); color: white;
    padding: 8px 16px; border-radius: 999px;
    font-size: 13px; max-width: 80vw;
}
@keyframes lpFadeIn { from { opacity: 0; } to { opacity: 1; } }

.lp-texto p { font-size: 16px; line-height: 1.7; opacity: .9; white-space: pre-wrap; max-width: 800px; margin: 0; }

.lp-cta-box {
    background: linear-gradient(135deg, var(--lp-primary), rgba(0,0,0,0.2));
    padding: 36px; border-radius: 18px;
    display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap;
}
.lp-cta-box h2 { margin: 0; }
.lp-cta-btn { background: white; color: var(--lp-primary); padding: 12px 24px; border-radius: 999px; text-decoration: none; font-weight: 700; }

.lp-contacto { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.lp-contacto a { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 10px; padding: 14px; border: 1px solid color-mix(in srgb, var(--lp-fg) 14%, transparent); border-radius: 12px; transition: border-color .15s; background: color-mix(in srgb, var(--lp-fg) 4%, transparent); }
.lp-contacto a:hover { border-color: var(--lp-primary); }
.lp-contacto i { font-size: 22px; color: var(--lp-primary); }

/* Bloques de estadisticas */
.lp-stats-card {
    background: color-mix(in srgb, var(--lp-fg) 5%, transparent);
    border: 1px solid color-mix(in srgb, var(--lp-fg) 10%, transparent);
    border-radius: 14px; overflow: hidden;
}
.lp-table-wrap {
    container-type: inline-size;
    container-name: lp-table;
}
/* Disclosure progresivo en la tabla de posiciones del landing del organizador.
   Orden: 1=# 2=Equipo 3=Pts 4=PJ 5=PG 6=PE 7=PP 8=GF 9=GC 10=DG 11=Forma. Mantenemos #, Equipo, PTS, PJ, DG. */
@container lp-table (max-width: 720px) {
    .lp-table th:nth-child(5), .lp-table td:nth-child(5),
    .lp-table th:nth-child(6), .lp-table td:nth-child(6),
    .lp-table th:nth-child(7), .lp-table td:nth-child(7) { display: none; }
}
@container lp-table (max-width: 560px) {
    .lp-table th:nth-child(8), .lp-table td:nth-child(8),
    .lp-table th:nth-child(9), .lp-table td:nth-child(9) { display: none; }
}
@container lp-table (max-width: 440px) {
    .lp-table th:nth-child(11), .lp-table td:nth-child(11) { display: none; }
}
/* Goleadores landing: misma idea, equipo con minimo ~13ch + ellipsis */
.lp-goleadores-table td:nth-child(3),
.lp-goleadores-table th:nth-child(3) {
    min-width: 13ch;
    width: 50%;
}
.lp-goleadores-table .lp-team-cell {
    white-space: nowrap;
    overflow: hidden;
}
.lp-goleadores-table .lp-team-cell > span:not(.lp-crest):not(.lp-foto) {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
    display: block;
}
.lp-table { width: 100%; border-collapse: collapse; table-layout: auto; }
.lp-table th, .lp-table td { padding: 10px 12px; text-align: center; font-size: 13px; vertical-align: middle; }
.lp-table th:nth-child(2), .lp-table td:nth-child(2) { text-align: left; }
/* La segunda columna (equipo/jugador) reserva como minimo unos 13ch para que siempre
   se vean al menos ~10-11 letras del nombre, y crece cuando hay espacio. */
.lp-table td:nth-child(2),
.lp-table th:nth-child(2) {
    min-width: 13ch;
    width: 100%;
}
.lp-table th { background: color-mix(in srgb, var(--lp-fg) 12%, transparent); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; opacity: .85; white-space: nowrap; }
.lp-table tr + tr td { border-top: 1px solid color-mix(in srgb, var(--lp-fg) 8%, transparent); }
.lp-table tbody tr:hover td { background: color-mix(in srgb, var(--lp-fg) 5%, transparent); }
.lp-table .lp-pts { font-family: var(--font-display); font-weight: 800; color: var(--lp-primary); font-size: 15px; }
.lp-dg-pos { color: #3ddc84; font-weight: 700; }
.lp-dg-neg { color: #ef4f5f; font-weight: 700; }

/* Celda de equipo/jugador: nowrap + ellipsis para que el nombre largo no rompa en 2-3 lineas */
.lp-team-cell, .lp-jug-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.lp-team-cell strong {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
}
/* En goleadores el strong vive dentro de .lp-jug-info para poder apilarle el fallback de equipo */
.lp-jug-cell .lp-jug-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}
.lp-jug-cell .lp-jug-info strong {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* Tabla de goleadores: columna "Equipo" como columna ancha + fallback (oculto por default)
   bajo el nombre del jugador, que se muestra solo en mobile. */
.lp-jug-team-mobile {
    display: none;
    font-size: 11px;
    color: color-mix(in srgb, var(--lp-fg) 55%, transparent);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

@media (max-width: 640px) {
    .lp-table th, .lp-table td { padding: 8px 8px; font-size: 12.5px; }
}
/* Disparado por el ancho del contenedor (no viewport): si la tabla de goleadores no entra,
   ocultar la columna Equipo y poner el nombre del equipo chiquitito debajo del jugador. */
@container lp-table (max-width: 520px) {
    .lp-goleadores-table th:nth-child(3),
    .lp-goleadores-table td:nth-child(3) { display: none; }
    .lp-goleadores-table .lp-jug-team-mobile { display: block; }
    .lp-goleadores-table .lp-jug-cell { align-items: flex-start; }
    .lp-goleadores-table .lp-jug-cell > div.lp-jug-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
}
.lp-crest {
    width: 26px; height: 26px; border-radius: 6px;
    display: inline-grid; place-items: center;
    font-family: var(--font-display); font-weight: 800; font-size: 10px;
    color: white; flex-shrink: 0;
    background-color: rgba(255,255,255,0.1);
}
.lp-crest-logo { background-size: cover; background-position: center; background-color: transparent; }
.lp-foto {
    width: 30px; height: 30px; border-radius: 50%;
    background-size: cover; background-position: center;
    background-color: rgba(255,255,255,0.08); flex-shrink: 0;
    display: inline-block;
}
.lp-foto-empty { display: inline-grid; place-items: center; color: rgba(255,255,255,0.5); }
.lp-forma { display: inline-flex; gap: 3px; }
.lp-forma span { width: 18px; height: 18px; border-radius: 4px; display: inline-grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 10px; color: white; }
.lp-f-W { background: #3ddc84; }
.lp-f-D { background: #b8c5d3; color: #0c1623; }
.lp-f-L { background: #ef4f5f; }

.lp-match-hero {
    background: color-mix(in srgb, var(--lp-fg) 5%, transparent);
    border: 1px solid color-mix(in srgb, var(--lp-fg) 12%, transparent);
    border-radius: 18px; overflow: hidden;
}
.lp-match-tag { padding: 12px 18px; font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; opacity: .75; border-bottom: 1px solid color-mix(in srgb, var(--lp-fg) 8%, transparent); }
.lp-match-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: center; padding: 30px 24px; }
.lp-match-team { display: flex; align-items: center; gap: 14px; }
.lp-match-team > div { display: flex; flex-direction: column; gap: 4px; }
.lp-match-team .lp-crest { width: 48px; height: 48px; border-radius: 10px; font-size: 14px; }
.lp-match-team strong { font-family: var(--font-display); font-size: 22px; line-height: 1.1; }
.lp-match-team .lp-muted { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; }
.lp-match-team.right { justify-content: flex-end; }
.lp-match-team.right > div { text-align: right; align-items: flex-end; }
.lp-match-mid { text-align: center; }
.lp-match-time { font-family: var(--font-display); font-weight: 800; font-size: 32px; color: var(--lp-primary); line-height: 1; }
.lp-match-date { font-size: 12px; margin-top: 4px; }
.lp-match-foot { padding: 12px 18px; border-top: 1px solid color-mix(in srgb, var(--lp-fg) 8%, transparent); font-size: 13px; opacity: .85; }
.lp-match-foot i { color: var(--lp-primary); margin-right: 6px; }

.lp-results { display: grid; gap: 8px; }
.lp-result-row {
    display: grid; grid-template-columns: 1fr auto 1fr;
    align-items: center; gap: 14px;
    padding: 12px 16px;
    background: color-mix(in srgb, var(--lp-fg) 5%, transparent);
    border: 1px solid color-mix(in srgb, var(--lp-fg) 10%, transparent);
    border-radius: 10px;
}
.lp-result-team { display: flex; align-items: center; gap: 10px; }
.lp-result-team strong { font-size: 14px; }
.lp-result-team.right { justify-content: flex-end; }
.lp-result-score {
    font-family: var(--font-display); font-weight: 800; font-size: 22px;
    color: var(--lp-primary);
    padding: 4px 14px; background: color-mix(in srgb, var(--lp-fg) 12%, transparent); border-radius: 8px;
    min-width: 80px; text-align: center; font-variant-numeric: tabular-nums;
}

.lp-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.lp-stat {
    background: color-mix(in srgb, var(--lp-fg) 5%, transparent);
    border: 1px solid color-mix(in srgb, var(--lp-fg) 10%, transparent);
    border-radius: 14px; padding: 20px; text-align: center;
}
.lp-stat-num { font-family: var(--font-display); font-weight: 800; font-size: 38px; color: var(--lp-primary); line-height: 1; }
.lp-stat-lbl { font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; opacity: .7; margin-top: 6px; }

@media (max-width: 700px) {
    .lp-hero h1 { font-size: 32px; }
    .lp-section { padding: 24px 16px; }
    .lp-match-row { grid-template-columns: 1fr; text-align: center; }
    .lp-match-team.right { align-items: center; text-align: center; }
}

/* ============================================================
   TORNEO PÚBLICO (/t/{id}) — usa lp-* base + colores del organizador
   ============================================================ */
.pub-root { color: var(--lp-fg); background: var(--lp-bg); }
.pub-head {
    max-width: 1200px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 24px; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.pub-head-org img { height: 44px; max-width: 220px; object-fit: contain; }
.pub-head-name { font-family: var(--font-display); font-weight: 800; font-size: 18px; }
.pub-cta {
    background: var(--lp-primary); color: white;
    padding: 8px 16px; border-radius: 999px;
    font-size: 13px; font-weight: 700; text-decoration: none;
    transition: opacity .15s;
}
.pub-cta:hover { opacity: .85; }
.pub-hero-section {
    position: relative;
    background: transparent;
    border-bottom: none;
    padding: 28px 0 24px;
}
.pub-hero-inner { position: relative; max-width: 1200px; margin: 0 auto; padding: 0 24px; text-align: left; }
.pub-hero-badges {
    display: flex; flex-wrap: wrap; gap: 5px; align-items: center;
    margin-bottom: 10px;
}
.pub-hero-tag {
    font-family: var(--font-display); font-weight: 800;
    color: white; background: var(--lp-primary);
    font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase;
    padding: 4px 9px; border-radius: 999px;
}
.pub-hero-pill {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11px; font-weight: 600;
    padding: 3px 9px; border-radius: 999px;
    background: color-mix(in srgb, var(--lp-fg) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--lp-fg) 12%, transparent);
    opacity: .9;
}
.pub-hero-pill i { color: var(--lp-primary); font-size: 9.5px; }
.pub-hero-inner h1 {
    font-family: var(--font-display); font-weight: 800;
    font-size: clamp(26px, 3.6vw, 38px);
    margin: 0;
    line-height: 1.05;
    letter-spacing: -0.015em;
}
.pub-estado {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px; border-radius: 999px;
    background: color-mix(in srgb, var(--lp-fg) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--lp-fg) 12%, transparent);
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
}
.pub-estado::before {
    content: ""; display: inline-block; width: 6px; height: 6px;
    border-radius: 50%; background: #94a3b8;
}
.pub-estado-en_curso { color: #2f9e58; border-color: color-mix(in srgb, #3ddc84 35%, transparent); background: color-mix(in srgb, #3ddc84 12%, transparent); }
.pub-estado-en_curso::before { background: #3ddc84; box-shadow: 0 0 8px #3ddc84; animation: pubPulse 1.8s ease-in-out infinite; }
.pub-estado-playoffs { color: var(--lp-primary); border-color: color-mix(in srgb, var(--lp-primary) 35%, transparent); background: color-mix(in srgb, var(--lp-primary) 10%, transparent); }
.pub-estado-playoffs::before { background: var(--lp-primary); }
.pub-estado-finalizado { opacity: .7; }
@keyframes pubPulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }

.pub-wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px 60px; }
.pub-tabs {
    display: flex; gap: 4px;
    margin: 4px 0 16px;
    padding: 6px;
    background: color-mix(in srgb, var(--lp-fg) 6%, transparent);
    border: 1px solid color-mix(in srgb, var(--lp-fg) 10%, transparent);
    border-radius: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}
.pub-tabs::-webkit-scrollbar { height: 4px; }
.pub-tabs::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--lp-fg) 20%, transparent); border-radius: 2px; }
.pub-tab {
    flex-shrink: 0;
    padding: 9px 14px; border: 0;
    background: transparent;
    color: color-mix(in srgb, var(--lp-fg) 70%, transparent);
    font-family: inherit;
    font-weight: 600; font-size: 13px; cursor: pointer;
    border-radius: 10px;
    white-space: nowrap; display: inline-flex; align-items: center; gap: 7px;
    position: relative;
    transition: background .15s, color .15s;
}
.pub-tab:hover {
    color: var(--lp-fg);
    background: color-mix(in srgb, var(--lp-fg) 8%, transparent);
}
.pub-tab.active {
    color: var(--lp-primary);
    font-weight: 800;
    background: color-mix(in srgb, var(--lp-primary) 16%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--lp-primary) 30%, transparent);
}
.pub-tab.active::after {
    content: "";
    position: absolute;
    left: 12px; right: 12px; bottom: 2px;
    height: 2px; border-radius: 2px;
    background: var(--lp-primary);
}
.pub-tab.active i { color: var(--lp-primary); }
@media (max-width: 700px) {
    .pub-tabs { padding: 4px; gap: 2px; margin: 0 0 12px; }
    .pub-tab { padding: 8px 12px; font-size: 12.5px; gap: 6px; }
}
@media (max-width: 520px) {
    /* En celular chico: tabs no activas se reducen a icono (texto invisible via font-size:0).
       Solo la activa muestra el label completo para que el usuario sepa donde esta. */
    .pub-tab:not(.active) {
        font-size: 0;
        padding: 8px 10px;
    }
    .pub-tab:not(.active) i { font-size: 14px; }
    .pub-tab:not(.active) .pub-tab-badge { display: none; }
    .pub-tab.active { padding: 8px 12px; }
    .pub-tab.active::after { left: 8px; right: 8px; }
}
.pub-tab-badge {
    background: var(--lp-primary); color: white;
    border-radius: 999px; padding: 1px 8px;
    font-size: 10.5px; font-weight: 800; margin-left: 2px;
    min-width: 18px; text-align: center;
}
.pub-tab.active .pub-tab-badge {
    background: var(--lp-primary);
}

.pub-content {
    background: color-mix(in srgb, var(--lp-fg) 4%, transparent);
    border: 1px solid color-mix(in srgb, var(--lp-fg) 10%, transparent);
    border-radius: 16px; padding: 20px;
}
.pub-empty { text-align: center; padding: 50px 20px; opacity: .65; }
.pub-empty h3 { font-family: var(--font-display); font-size: 18px; margin: 0; }

.pub-grupo {
    font-family: var(--font-display); font-weight: 800;
    color: var(--lp-primary); font-size: 13px;
    text-transform: uppercase; letter-spacing: 0.1em;
    margin: 18px 0 10px;
}
.pub-grupo:first-child { margin-top: 4px; }

/* Tablas */
.pub-table-wrap {
    container-type: inline-size;
    container-name: pub-table;
}
.pub-table { width: 100%; border-collapse: collapse; }
.pub-table-grupos { table-layout: auto; min-width: 0; }
.pub-table-grupos td, .pub-table-grupos th { overflow: hidden; text-overflow: ellipsis; }
.pub-table-grupos .pub-team strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }

/* Mobile (contenedor angosto): scroll horizontal con # y Equipo fijos a la izquierda.
   Asi el usuario siempre ve a que equipo corresponde la fila aunque scrollee a la derecha. */
@container pub-table (max-width: 700px) {
    .pub-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .pub-table-grupos { min-width: 620px; }
    .pub-table-grupos th, .pub-table-grupos td { white-space: nowrap; overflow: visible; }

    /* Columna 1 (#) y 2 (Equipo) sticky */
    .pub-table-grupos th:nth-child(1), .pub-table-grupos td:nth-child(1),
    .pub-table-grupos th:nth-child(2), .pub-table-grupos td:nth-child(2) {
        position: sticky;
        background: var(--lp-bg, #0c1623);
        z-index: 2;
    }
    .pub-table-grupos th:nth-child(1), .pub-table-grupos td:nth-child(1) { left: 0; min-width: 36px; max-width: 36px; }
    .pub-table-grupos th:nth-child(2), .pub-table-grupos td:nth-child(2) {
        left: 36px;
        max-width: 160px;
        box-shadow: 2px 0 6px -2px rgba(0,0,0,0.4);
    }
    .pub-table-grupos td:nth-child(2) .pub-team strong { max-width: 130px; }
    /* Header sticky tambien */
    .pub-table-grupos thead th:nth-child(1),
    .pub-table-grupos thead th:nth-child(2) {
        background: color-mix(in srgb, var(--lp-fg) 12%, var(--lp-bg, #0c1623)) !important;
        z-index: 3;
    }
    /* Hover/highlight con bg distinto, sticky */
    .pub-table-grupos tbody tr:hover td:nth-child(1),
    .pub-table-grupos tbody tr:hover td:nth-child(2) {
        background: color-mix(in srgb, var(--lp-fg) 8%, var(--lp-bg, #0c1623)) !important;
    }
    .pub-table-grupos tbody tr.pub-row-highlight td:nth-child(1),
    .pub-table-grupos tbody tr.pub-row-highlight td:nth-child(2) {
        background: color-mix(in srgb, var(--lp-primary) 30%, var(--lp-bg, #0c1623)) !important;
    }
}

/* Goleadores: la columna Equipo (3ra) reserva al menos ~13ch tambien y trunca con ellipsis */
.pub-table-goleadores td:nth-child(3),
.pub-table-goleadores th:nth-child(3) {
    min-width: 13ch;
    width: 50%;
}
.pub-table-goleadores .pub-team {
    white-space: nowrap;
    overflow: hidden;
}
.pub-table-goleadores .pub-team > span:not(.pub-crest):not(.pub-foto) {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
    display: block;
}

/* ====== Llave pública ====== */
.pub-bracket {
    display: flex; align-items: flex-start;
    gap: 48px;
    overflow-x: auto;
    padding: 4px 4px 12px;
}
.pub-bracket-col { display: flex; flex-direction: column; min-width: 240px; flex: 0 0 auto; }
.pub-bracket-col-title {
    font-family: var(--font-display);
    font-size: 12px; color: color-mix(in srgb, var(--lp-primary) 80%, transparent);
    text-transform: uppercase; letter-spacing: 0.1em;
    margin: 0 0 14px; padding-left: 14px;
}
.pub-bracket-matches { display: flex; flex-direction: column; gap: 0; }
.pub-bracket-pair { position: relative; display: flex; flex-direction: column; gap: 0; }
.pub-bracket-match {
    background: color-mix(in srgb, var(--lp-fg) 6%, transparent);
    border: 1px solid color-mix(in srgb, var(--lp-fg) 12%, transparent);
    border-radius: 10px;
    padding: 8px;
    cursor: pointer;
    transition: border-color .15s, transform .12s;
    position: relative;
    min-height: 108px;
    box-sizing: border-box;
    display: flex; flex-direction: column;
    justify-content: center;
    margin: var(--bracket-m, 12px) 0;
}
.pub-bracket-match:hover { border-color: var(--lp-primary); transform: translateY(-1px); }
.pub-bracket-team {
    display: grid; grid-template-columns: 22px 1fr auto;
    gap: 8px; align-items: center;
    padding: 5px 8px; border-radius: 6px;
    color: color-mix(in srgb, var(--lp-fg) 75%, transparent);
    font-size: 13px;
}
.pub-bracket-team.winner { color: var(--lp-fg); font-weight: 700; background: color-mix(in srgb, #3ddc84 12%, transparent); }
.pub-bracket-team .pub-crest { width: 22px; height: 22px; font-size: 10px; }
.pub-bracket-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pub-bracket-score { font-family: var(--font-display); font-weight: 800; font-variant-numeric: tabular-nums; }
.pub-bracket-meta {
    margin-top: 6px; padding-top: 6px;
    border-top: 1px dashed color-mix(in srgb, var(--lp-fg) 18%, transparent);
    font-size: 10.5px; color: color-mix(in srgb, var(--lp-fg) 60%, transparent);
}
.pub-bracket-meta i { color: var(--lp-primary); margin-right: 4px; font-size: 9.5px; }
/* Lineas conectoras: mismas reglas que el bracket admin */
.pub-bracket-col:not(.is-last) .pub-bracket-pair .pub-bracket-match::after {
    content: ''; position: absolute;
    right: -24px; top: 50%; transform: translateY(-50%);
    width: 24px; height: 2px;
    background: color-mix(in srgb, var(--lp-primary) 50%, transparent);
    border-radius: 1px;
}
.pub-bracket-col:not(.is-last) .pub-bracket-pair:not(.lonely) > .pub-bracket-match:first-child::before {
    content: ''; position: absolute;
    right: -24px; top: 50%; width: 2px;
    height: calc(100% + 2 * var(--bracket-m, 12px));
    background: color-mix(in srgb, var(--lp-primary) 50%, transparent);
    border-radius: 1px;
}
.pub-bracket-col:not(.is-last) .pub-bracket-pair:not(.lonely)::before {
    content: ''; position: absolute;
    right: -48px; top: 50%; transform: translateY(-50%);
    width: 24px; height: 2px;
    background: color-mix(in srgb, var(--lp-primary) 50%, transparent);
    border-radius: 1px;
}
.pub-bracket-col:not(.is-last) .pub-bracket-pair.lonely .pub-bracket-match::after {
    width: 48px; right: -48px;
}
.pub-bracket-tercero {
    margin-top: 24px; max-width: 320px;
    padding: 12px 16px;
    background: color-mix(in srgb, var(--lp-primary) 6%, transparent);
    border: 1px solid color-mix(in srgb, var(--lp-primary) 20%, transparent);
    border-radius: 10px;
}
.pub-bracket-tercero .pub-bracket-match { margin: 0; }
.pub-table thead th {
    background: color-mix(in srgb, var(--lp-fg) 12%, transparent);
    color: color-mix(in srgb, var(--lp-fg) 75%, transparent);
    font-size: 10.5px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.08em;
    padding: 10px 12px; text-align: left;
    white-space: nowrap;
}
.pub-table tbody td {
    padding: 10px 12px; font-size: 13.5px;
    border-bottom: 1px solid color-mix(in srgb, var(--lp-fg) 8%, transparent);
    vertical-align: middle;
}
.pub-table tbody tr:hover td { background: color-mix(in srgb, var(--lp-fg) 5%, transparent); }
.pub-table .num { text-align: center; font-variant-numeric: tabular-nums; }
.pub-pts { font-family: var(--font-display); font-weight: 800; color: var(--lp-primary); font-size: 15px; }
.pub-pos { color: #3ddc84; font-weight: 700; }
.pub-neg { color: #ef4f5f; font-weight: 700; }
.pub-ama { color: #f5c518; font-weight: 700; }
.pub-roj { color: #d62828; font-weight: 700; }

.pub-team {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.pub-team strong {
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
}
.pub-team > span:not(.pub-crest):not(.pub-foto) {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
}
.pub-jugador {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.pub-jugador .pub-jug-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}
.pub-jugador .pub-jug-info strong {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.pub-jug-team-mobile {
    display: none;
    font-size: 11.5px;
    color: color-mix(in srgb, var(--lp-fg) 55%, transparent);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Columna "Equipo/Jugador" reserva siempre ~13ch para mostrar al menos 10-11 letras del nombre,
   y crece cuando hay espacio. */
.pub-table td:nth-child(2),
.pub-table th:nth-child(2) {
    min-width: 13ch;
    width: 100%;
}

/* Cuando el contenedor de la tabla es chico (independiente del viewport): ocultar
   la columna Equipo y mostrar el nombre del equipo abajo del jugador, chiquito y sin negrita. */
@container pub-table (max-width: 560px) {
    .pub-table-goleadores th:nth-child(3),
    .pub-table-goleadores td:nth-child(3) { display: none; }
    .pub-table-goleadores .pub-jug-team-mobile { display: block; }
}

.pub-crest {
    width: 28px; height: 28px; border-radius: 7px;
    display: inline-grid; place-items: center;
    font-family: var(--font-display); font-weight: 800; font-size: 10.5px;
    color: white; flex-shrink: 0;
    background-color: color-mix(in srgb, var(--lp-fg) 15%, transparent);
}
.pub-crest-logo { background-size: cover; background-position: center; background-color: transparent; }
.pub-foto {
    width: 32px; height: 32px; border-radius: 50%;
    background-size: cover; background-position: center;
    background-color: color-mix(in srgb, var(--lp-fg) 12%, transparent); flex-shrink: 0;
}
.pub-foto-empty { display: inline-grid; place-items: center; color: color-mix(in srgb, var(--lp-fg) 50%, transparent); }

/* Forma */
.lp-forma span { width: 22px; height: 22px; border-radius: 6px; font-size: 11px; }
.lp-f-E { background: #94a3b8; color: #0c1623; }

/* Navegador de jornada (select + prev/next) */
.pub-fecha-nav {
    display: flex; align-items: stretch; gap: 8px; margin-bottom: 18px;
    max-width: 480px;
}
.pub-fecha-btn {
    width: 42px; flex-shrink: 0;
    background: color-mix(in srgb, var(--lp-fg) 6%, transparent);
    border: 1px solid color-mix(in srgb, var(--lp-fg) 12%, transparent);
    border-radius: 10px;
    color: var(--lp-fg); cursor: pointer;
    font-size: 14px;
    transition: background .15s, border-color .15s, opacity .15s;
}
.pub-fecha-btn:hover:not(:disabled) {
    background: var(--lp-primary); color: white; border-color: var(--lp-primary);
}
.pub-fecha-btn:disabled { opacity: .35; cursor: not-allowed; }
.pub-fecha-select {
    flex: 1; min-width: 0;
    padding: 0 14px;
    background: color-mix(in srgb, var(--lp-fg) 6%, transparent);
    border: 1px solid color-mix(in srgb, var(--lp-fg) 12%, transparent);
    border-radius: 10px;
    color: var(--lp-fg); font-family: inherit;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                      linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
    background-size: 5px 5px;
    background-repeat: no-repeat;
    padding-right: 32px;
}
.pub-fecha-select:focus { outline: none; border-color: var(--lp-primary); }
.pub-fecha-select option { background: var(--lp-bg); color: var(--lp-fg); }

/* Chips por jornada (legacy, conservado por si se usa en otro lado) */
.pub-chip-row {
    display: flex; flex-wrap: wrap; gap: 6px;
    margin-bottom: 16px;
}
.pub-chip {
    padding: 6px 14px; border-radius: 999px;
    background: color-mix(in srgb, var(--lp-fg) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--lp-fg) 12%, transparent);
    color: color-mix(in srgb, var(--lp-fg) 85%, transparent);
    font-size: 12.5px; font-weight: 600; cursor: pointer;
    transition: all .15s;
}
.pub-chip:hover { background: color-mix(in srgb, var(--lp-fg) 14%, transparent); color: var(--lp-fg); }
.pub-chip.active {
    background: var(--lp-primary); color: white;
    border-color: var(--lp-primary);
}

/* Partidos */
.pub-partido {
    background: color-mix(in srgb, var(--lp-fg) 5%, transparent);
    border: 1px solid color-mix(in srgb, var(--lp-fg) 10%, transparent);
    border-radius: 12px; margin-bottom: 10px;
    overflow: hidden;
}
.pub-partido-meta {
    display: flex; flex-wrap: wrap; gap: 16px;
    padding: 8px 16px;
    border-bottom: 1px dashed color-mix(in srgb, var(--lp-fg) 12%, transparent);
    font-size: 11.5px; opacity: .8;
}
.pub-partido-meta i { margin-right: 4px; color: var(--lp-primary); }
.pub-partido-body {
    display: grid; grid-template-columns: 1fr auto 1fr;
    align-items: center; gap: 14px;
    padding: 14px 18px;
}
.pub-partido-team {
    display: flex; align-items: center; gap: 10px;
    font-size: 14px;
}
.pub-partido-team strong { font-weight: 700; }
.pub-partido-team.right {
    justify-content: flex-end;
}
/* Para el visitante: nombre primero, escudo al final (pegado al borde derecho) */
.pub-partido-team.right .pub-crest { order: 2; }
.pub-partido-score {
    text-align: center; min-width: 80px;
    font-family: var(--font-display);
    font-weight: 800; font-size: 24px;
    color: color-mix(in srgb, var(--lp-fg) 55%, transparent);
}
.pub-partido-score.jugado { color: var(--lp-fg); }
.pub-partido-score .pub-pen { font-size: 11px; opacity: .65; margin-top: 4px; font-weight: 500; }

/* Noticias */
.pub-noticias {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 18px;
}
.pub-noticia {
    background: color-mix(in srgb, var(--lp-fg) 5%, transparent);
    border: 1px solid color-mix(in srgb, var(--lp-fg) 10%, transparent);
    border-radius: 14px; overflow: hidden;
    transition: transform .2s, border-color .2s;
}
.pub-noticia:hover { transform: translateY(-3px); border-color: var(--lp-primary); }
.pub-noticia-img {
    aspect-ratio: 16/9;
    background-size: cover; background-position: center;
    background-color: color-mix(in srgb, var(--lp-fg) 5%, transparent);
}
.pub-noticia-body { padding: 16px; }
.pub-noticia-fecha {
    font-size: 11px; opacity: .7;
    font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
    margin-bottom: 6px;
}
.pub-noticia-fecha i { margin-right: 4px; color: var(--lp-primary); }
.pub-noticia h3 {
    font-family: var(--font-display); font-weight: 700;
    font-size: 17px; margin: 0 0 8px; line-height: 1.3;
}
.pub-noticia-text {
    font-size: 13.5px; line-height: 1.6;
    opacity: .85; white-space: pre-wrap;
    display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Filas/cards clickeables */
.pub-row-clickable { cursor: pointer; }
.pub-row-clickable:hover td { background: color-mix(in srgb, var(--lp-fg) 8%, transparent) !important; }
.pub-row-highlight td {
    background: color-mix(in srgb, var(--lp-primary) 18%, transparent) !important;
    font-weight: 700;
}
.pub-partido-link {
    display: block; width: 100%; text-align: left;
    text-decoration: none; color: inherit; cursor: pointer;
    background: color-mix(in srgb, var(--lp-fg) 5%, transparent);
    font: inherit; padding: 0;
    transition: border-color .15s, transform .15s, background .15s;
}
.pub-partido-link:hover { border-color: var(--lp-primary); transform: translateY(-1px); }
.pub-partido-link.abierto {
    border-color: var(--lp-primary);
    background: color-mix(in srgb, var(--lp-primary) 10%, transparent);
    border-bottom-left-radius: 0; border-bottom-right-radius: 0;
    margin-bottom: 0;
}
.pub-partido-toggle {
    margin-left: auto; opacity: .55; font-size: 10px;
    transition: opacity .15s, transform .15s;
}
.pub-partido-link:hover .pub-partido-toggle { opacity: 1; }
.pub-partido-link.abierto .pub-partido-toggle { opacity: 1; color: var(--lp-primary); }

/* Expand inline del detalle del partido (anclado al partido de arriba) */
.pub-partido-expand {
    margin: -1px 0 10px 0; /* solapa el borde superior con el partido */
    border: 1px solid var(--lp-primary);
    border-top: 0;
    border-radius: 0 0 14px 14px;
    background: color-mix(in srgb, var(--lp-fg) 3%, transparent);
    padding: 6px 10px 10px;
    animation: pubExpand .25s ease-out;
    overflow: hidden;
}
@keyframes pubExpand {
    from { opacity: 0; transform: translateY(-6px); max-height: 0; }
    to   { opacity: 1; transform: translateY(0);    max-height: 4000px; }
}
.pub-partido-expand .part-mc {
    margin: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    border-radius: 0;
}
.pub-partido-expand .part-mc-tag {
    padding-top: 8px;
    border-bottom: 1px solid color-mix(in srgb, var(--lp-fg) 8%, transparent);
}
.part-mc-embed { position: relative; }
.part-mc-close {
    position: absolute; top: 8px; right: 10px; z-index: 5;
    background: color-mix(in srgb, var(--lp-fg) 8%, transparent);
    border: 0; color: var(--lp-fg);
    width: 28px; height: 28px; border-radius: 999px;
    cursor: pointer; font-size: 13px;
    display: grid; place-items: center;
    transition: background .15s;
}
.part-mc-close:hover { background: color-mix(in srgb, var(--lp-fg) 18%, transparent); }
.part-mc-fulllink {
    display: inline-flex; align-items: center; gap: 6px;
    margin: 4px 0 4px 22px;
    color: var(--lp-primary); text-decoration: none;
    font-size: 11.5px; font-weight: 600;
    opacity: .8; transition: opacity .15s;
}
.part-mc-fulllink:hover { opacity: 1; text-decoration: underline; }
.part-mc-loading { padding: 30px; text-align: center; opacity: .6; font-size: 13px; }
.part-mc-skeleton::before {
    content: ""; display: inline-block; width: 14px; height: 14px;
    border: 2px solid color-mix(in srgb, var(--lp-fg) 25%, transparent);
    border-top-color: var(--lp-primary);
    border-radius: 50%; vertical-align: middle; margin-right: 8px;
    animation: pubSpin .8s linear infinite;
}
@keyframes pubSpin { to { transform: rotate(360deg); } }
.pub-tab-badge-warn { background: #f5c518 !important; color: #1a1a1a !important; }

/* Detalle de Equipo (/t/{tid}/equipo/{eid}) */
.eq-hero { position: relative; padding: 0; overflow: hidden; min-height: 280px; }
.eq-hero-grupal {
    position: absolute; inset: 0;
    background-size: cover; background-position: center;
    filter: blur(2px);
    transform: scale(1.1);
}
.eq-hero-overlay {
    position: relative; z-index: 1;
    background: linear-gradient(to bottom, rgba(0,0,0,0.45), rgba(0,0,0,0.85));
    min-height: 280px; padding: 60px 24px 40px;
    display: flex; align-items: flex-end;
}
.eq-hero-content {
    max-width: 1200px; width: 100%; margin: 0 auto;
    display: flex; gap: 24px; align-items: flex-end; flex-wrap: wrap;
}
.eq-hero-crest {
    width: 110px; height: 110px; border-radius: 18px;
    background-size: cover; background-position: center;
    box-shadow: 0 12px 32px rgba(0,0,0,0.5);
    flex-shrink: 0;
}
.eq-hero-crest-colors {
    display: grid; place-items: center;
    color: white; font-family: var(--font-display);
    font-weight: 800; font-size: 30px;
}
.eq-hero-overlay h1 { margin: 6px 0 12px; font-size: clamp(28px, 4vw, 42px); }
.eq-stats-mini {
    display: flex; flex-wrap: wrap; gap: 18px;
    font-size: 13px; opacity: .85;
}
.eq-stats-mini span { display: inline-flex; align-items: baseline; gap: 4px; }
.eq-stats-mini strong { font-family: var(--font-display); font-weight: 800; font-size: 18px; color: var(--lp-fg); }
.eq-stats-mini .ws strong { color: #3ddc84; }
.eq-stats-mini .ds strong { color: #94a3b8; }
.eq-stats-mini .ls strong { color: #ef4f5f; }

/* Plantel grid */
.eq-plantel { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.eq-jugador-card {
    display: flex; align-items: center; gap: 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px; padding: 12px;
    transition: border-color .15s ease;
}
.eq-jugador-card:hover { border-color: var(--lp-primary); }
.eq-jugador-foto {
    width: 56px; height: 56px; border-radius: 50%;
    background-size: cover; background-position: center;
    background-color: rgba(255,255,255,0.08); flex-shrink: 0;
}
.eq-jugador-foto-empty { display: grid; place-items: center; color: rgba(255,255,255,0.4); font-size: 22px; }
.eq-jugador-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.eq-jugador-info strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eq-jugador-info small { font-size: 11px; opacity: .65; text-transform: uppercase; letter-spacing: 0.06em; }
.eq-jugador-num {
    font-family: var(--font-display); font-weight: 800;
    font-size: 11px; padding: 2px 8px; border-radius: 999px;
    background: var(--lp-primary); color: white;
    align-self: flex-start; margin-bottom: 2px;
}
.eq-jugador-num.inline { margin-right: 6px; }

/* Sanciones */
.eq-sanciones { display: flex; flex-direction: column; gap: 10px; }
.eq-sancion-card {
    display: flex; align-items: center; gap: 14px;
    background: rgba(245,197,24,0.08);
    border: 1px solid rgba(245,197,24,0.25);
    border-radius: 12px; padding: 14px;
}
.eq-sancion-info { flex: 1; }
.eq-sancion-info strong { font-size: 15px; }
.eq-sancion-motivo { font-size: 12px; color: #f5c518; margin-top: 4px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.eq-sancion-motivo i { margin-right: 4px; }
.eq-sancion-fechas { font-size: 12.5px; opacity: .85; margin-top: 4px; }
.eq-sancion-detalle { font-size: 12.5px; opacity: .7; margin-top: 6px; font-style: italic; }
.eq-sancion-badge {
    background: #d62828; color: white;
    padding: 4px 12px; border-radius: 999px;
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
    flex-shrink: 0;
}
.eq-sancion-badge-ok { background: #94a3b8; color: #0c1623; }
.eq-sancion-card-cumplida {
    background: color-mix(in srgb, var(--lp-fg) 4%, transparent);
    border-color: color-mix(in srgb, var(--lp-fg) 10%, transparent);
    opacity: .85;
}
.eq-sancion-card { text-decoration: none; color: inherit; transition: border-color .15s; }
a.eq-sancion-card:hover { border-color: var(--lp-primary); }
.eq-sancion-team {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; opacity: .85; margin-top: 4px;
}
.eq-sancion-team .pub-crest.small { width: 18px; height: 18px; border-radius: 4px; font-size: 8px; }

/* ====== Detalle de Partido (/t/{tid}/partido/{pid}) — Match Card unificado ====== */
.part-wrap { padding: 22px 16px 32px; }

.part-mc {
    background: color-mix(in srgb, var(--lp-fg) 4%, transparent);
    border: 1px solid color-mix(in srgb, var(--lp-fg) 10%, transparent);
    border-radius: 20px; overflow: hidden;
    box-shadow: 0 10px 30px color-mix(in srgb, var(--lp-bg) 35%, transparent);
    margin: 22px 0 18px;
}

.part-mc-tag {
    font-family: var(--font-display); font-weight: 700;
    color: var(--lp-primary); font-size: 11.5px;
    letter-spacing: 0.16em; text-transform: uppercase;
    text-align: center;
    padding: 14px 20px 8px;
    border-bottom: 1px solid color-mix(in srgb, var(--lp-fg) 6%, transparent);
}

/* ---- Cabecera (equipos + score) ---- */
.part-mc-head {
    display: grid; grid-template-columns: 1fr auto 1fr;
    align-items: center; gap: 18px;
    padding: 26px 24px 18px;
}
.part-mc-team {
    display: flex; flex-direction: column; align-items: center;
    gap: 10px; text-decoration: none; color: inherit;
    transition: transform .15s, opacity .15s;
}
.part-mc-team:hover { transform: translateY(-2px); opacity: .92; }
.part-mc-team strong {
    font-family: var(--font-display);
    font-size: clamp(15px, 2.4vw, 22px);
    text-align: center; line-height: 1.1;
}
.part-mc-team small {
    font-size: 10.5px; opacity: .55;
    letter-spacing: 0.14em; text-transform: uppercase;
    font-weight: 700;
}
.part-team-crest {
    width: 88px; height: 88px; border-radius: 18px;
    background-size: cover; background-position: center;
    display: grid; place-items: center;
    color: white; font-family: var(--font-display);
    font-weight: 800; font-size: 22px;
    box-shadow: 0 8px 24px color-mix(in srgb, var(--lp-bg) 50%, transparent);
}

.part-mc-score { text-align: center; min-width: 110px; }
.part-mc-score-row {
    font-family: var(--font-display); font-weight: 800;
    font-size: clamp(36px, 7vw, 64px);
    line-height: 1;
    display: inline-flex; gap: 14px; align-items: baseline;
}
.part-mc-score-row span { transition: opacity .2s; }
.part-mc-score-row .lose { opacity: .35; }
.part-mc-score-row em {
    font-style: normal; opacity: .25;
    font-size: 0.55em; font-weight: 600;
    transform: translateY(-0.2em);
}
.part-mc-score-row.vs { font-size: clamp(24px, 4vw, 36px); opacity: .55; }
.part-mc-state {
    font-family: var(--font-display); font-weight: 800;
    font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--lp-primary); margin-top: 6px;
}
.part-mc-pen { font-size: 12px; opacity: .65; margin-top: 4px; }
.part-mc-pen strong { color: var(--lp-fg); }

.part-mc-meta {
    display: flex; flex-wrap: wrap; justify-content: center;
    gap: 8px 24px; font-size: 12.5px; opacity: .75;
    padding: 0 20px 22px;
}
.part-mc-meta i { color: var(--lp-primary); margin-right: 6px; }

/* ---- Secciones (goles / tarjetas / notas) ---- */
.part-mc-sec {
    border-top: 1px solid color-mix(in srgb, var(--lp-fg) 8%, transparent);
    padding: 18px 22px 20px;
}
.part-mc-sec-title {
    font-family: var(--font-display); font-weight: 800;
    font-size: 12px; text-transform: uppercase; letter-spacing: 0.14em;
    color: var(--lp-primary);
    margin: 0 0 14px;
    display: flex; align-items: center; gap: 8px;
}
.part-mc-sec-title i { font-size: 14px; }
.part-mc-sec-count {
    background: color-mix(in srgb, var(--lp-primary) 18%, transparent);
    color: var(--lp-primary);
    border-radius: 999px; padding: 1px 8px;
    font-size: 10px; font-weight: 800;
    margin-left: auto;
}

.part-mc-cols {
    display: grid; grid-template-columns: 1fr 1px 1fr; gap: 18px;
    align-items: stretch;
}
.part-mc-col { display: flex; flex-direction: column; gap: 8px; }
.part-mc-col.right { align-items: flex-end; }
.part-mc-col-sep {
    background: color-mix(in srgb, var(--lp-fg) 10%, transparent);
    width: 1px; align-self: stretch;
}
.part-mc-empty { opacity: .35; font-size: 13px; padding: 6px 0; }

.part-mc-evt {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; border-radius: 10px;
    background: color-mix(in srgb, var(--lp-fg) 3%, transparent);
    font-size: 13.5px; max-width: 100%;
    border: 1px solid color-mix(in srgb, var(--lp-fg) 5%, transparent);
}
.part-mc-evt.right { flex-direction: row; }
.part-mc-evt-min {
    font-family: var(--font-display); font-weight: 800;
    color: var(--lp-primary); font-size: 13px;
    min-width: 32px; text-align: center; flex-shrink: 0;
}
.part-mc-evt-text { display: flex; align-items: center; gap: 6px; min-width: 0; line-height: 1.2; }
.part-mc-evt-text strong { font-weight: 700; word-break: break-word; }
.part-mc-evt-text .ec { color: #ef4f5f; font-size: 10.5px; font-style: normal; font-weight: 700; opacity: .9; }
.part-mc-evt .pub-foto { width: 28px; height: 28px; flex-shrink: 0; }

.part-tarj { display: inline-block; width: 12px; height: 16px; border-radius: 2px; flex-shrink: 0; }
.part-tarj-amarilla { background: #f5c518; }
.part-tarj-roja { background: #d62828; }
.part-tarj-azul { background: #2563eb; }

.part-mc-notas {
    font-size: 14px; line-height: 1.6;
    white-space: pre-wrap; opacity: .85;
}

@media (max-width: 700px) {
    .eq-hero-content { gap: 14px; }
    .eq-hero-crest { width: 76px; height: 76px; font-size: 22px; }
    .eq-stats-mini { gap: 10px; font-size: 11.5px; }
    .eq-stats-mini strong { font-size: 15px; }

    .part-wrap { padding: 14px 10px 24px; }
    .part-mc { border-radius: 16px; margin: 14px 0; }
    .part-mc-tag { font-size: 10.5px; padding: 12px 14px 6px; }
    .part-mc-head {
        grid-template-columns: 1fr auto 1fr;
        gap: 8px; padding: 18px 12px 14px;
    }
    .part-mc-team { gap: 6px; }
    .part-mc-team strong { font-size: 13px; }
    .part-mc-team small { font-size: 9.5px; }
    .part-team-crest { width: 56px; height: 56px; font-size: 14px; border-radius: 12px; }
    .part-mc-score { min-width: 80px; }
    .part-mc-score-row { font-size: 32px; gap: 8px; }
    .part-mc-state { font-size: 10px; }
    .part-mc-meta { font-size: 11.5px; gap: 6px 14px; padding: 0 14px 16px; }
    .part-mc-sec { padding: 14px 14px 16px; }
    .part-mc-sec-title { font-size: 11px; }
    .part-mc-cols { gap: 8px; grid-template-columns: 1fr 1px 1fr; }
    .part-mc-evt { padding: 6px 8px; font-size: 12px; gap: 6px; border-radius: 8px; }
    .part-mc-evt .pub-foto { width: 22px; height: 22px; }
    .part-mc-evt-min { font-size: 11.5px; min-width: 24px; }
    .part-mc-evt-text { font-size: 12px; }
    .part-mc-evt-text .ec { font-size: 9.5px; }
}

/* Reglamento público */
.pub-reglamento { font-size: 14px; line-height: 1.7; padding: 4px 6px; }
.pub-reglamento h2 { font-family: var(--font-display); font-size: 22px; margin: 22px 0 10px; color: var(--lp-fg); }
.pub-reglamento h3 { font-family: var(--font-display); font-size: 17px; margin: 18px 0 8px; color: var(--lp-primary); }
.pub-reglamento h4 { font-size: 14px; margin: 14px 0 6px; opacity: .9; }
.pub-reglamento ul { padding-left: 22px; margin: 6px 0 10px; list-style: disc; }
.pub-reglamento li { margin-bottom: 4px; opacity: .9; }
.pub-reglamento p { margin: 6px 0; opacity: .85; }
.pub-reglamento strong { color: var(--lp-fg); }

/* Footer público */
.pub-foot {
    margin-top: 30px; text-align: center;
    color: rgba(255,255,255,0.55); font-size: 12px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.pub-foot a { color: var(--lp-primary); text-decoration: underline; }

@media (max-width: 700px) {
    .pub-head { padding: 10px 12px; }
    .pub-head-org img { height: 32px; }
    .pub-hero-section { padding: 32px 12px 24px; }
    .pub-wrap { padding: 0 10px 30px; }
    .pub-content { padding: 10px 8px; }
    .pub-tabs { gap: 4px; }
    .pub-table thead th, .pub-table tbody td { padding: 6px 5px; font-size: 12px; }
    .pub-partido { margin-bottom: 8px; border-radius: 10px; }
    .pub-partido-meta { padding: 6px 10px; font-size: 11px; gap: 8px; }
    .pub-partido-body { grid-template-columns: 1fr auto 1fr; gap: 8px; padding: 10px 12px; }
    .pub-partido-team { font-size: 12.5px; gap: 6px; }
    .pub-partido-score { font-size: 20px; min-width: 56px; }
    .pub-crest, .pub-foto { width: 26px; height: 26px; }
}

/* ====== Celular chico (≤ 520px): aprovechar al maximo el ancho ====== */
@media (max-width: 520px) {
  /* Admin */
  .view { padding: 10px 6px; }
  .page-header { padding-left: 6px; padding-right: 6px; }
  .card { padding: 10px 8px; border-radius: 10px; }
  .card + .card { margin-top: 8px; }
  .view-header { margin-bottom: 10px; }
  .view-header h2 { font-size: 19px; }
  .topbar { padding: 0 6px; gap: 6px; }
  .topbar .crumb { font-size: 12.5px; }
  .modal { padding: 14px; max-width: calc(100vw - 8px) !important; }

  /* Publico — landing + torneo + partido */
  .pub-head { padding: 8px 10px; }
  .pub-hero-section { padding: 22px 10px 16px; }
  .pub-wrap { padding: 0 6px 22px; }
  .pub-content { padding: 8px 6px; }
  .pub-table thead th, .pub-table tbody td { padding: 5px 4px; font-size: 11.5px; }

  /* Landing organizador */
  .lp-header { padding: 12px 10px !important; }
  .lp-section { padding: 18px 10px; }
  .lp-blocks { padding: 14px 8px; gap: 12px; }
  .lp-hero { padding: 56px 12px 24px; }

  /* Match card / partido detalle */
  .part-wrap { padding: 10px 6px 18px; }
  .part-mc { border-radius: 12px; }
  .part-mc-head { padding: 12px 8px 10px; gap: 6px; }
  .part-mc-meta { padding: 0 10px 12px; font-size: 11px; gap: 4px 12px; }
  .part-mc-sec { padding: 10px 10px 12px; }
  .part-mc-cols { gap: 6px; }
  .part-mc-evt { padding: 5px 6px; font-size: 11.5px; gap: 4px; border-radius: 6px; }
  .part-mc-evt .pub-foto { width: 20px; height: 20px; }
}

.reglamento-render { font-family: var(--font-body); font-size: 14px; line-height: 1.7; color: var(--t-2); }
.reglamento-render h2 { font-size: 22px; margin: 18px 0 8px; color: var(--t-1); }
.reglamento-render h3 { font-size: 16px; margin: 14px 0 6px; color: var(--brand-300); }
.reglamento-render h4 { font-size: 14px; margin: 10px 0 4px; color: var(--t-1); }
.reglamento-render ul { padding-left: 20px; margin: 6px 0; list-style: disc; }
.reglamento-render li { margin-bottom: 4px; }
.reglamento-render p { margin-bottom: 4px; }
.reglamento-render strong { color: var(--t-1); }
.reglamento-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.reglamento-edit .preview-box {
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: 14px; background: var(--bg-2);
    max-height: 480px; overflow-y: auto;
}
@media (max-width: 900px) { .reglamento-edit { grid-template-columns: 1fr; } }

/* Color picker con swatch visible al lado */
.color-pick-wrap { display: inline-flex; align-items: center; gap: 8px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 10px; }
.color-pick-wrap .color-input { width: 36px; height: 28px; padding: 0; border: 0; cursor: pointer; background: transparent; }
.color-pick-wrap .color-swatch { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line-strong); }

/* Preview equipo en modal de edicion */
.equipo-preview {
    background: var(--bg-2); border: 1px solid var(--line);
    border-radius: var(--radius-l); padding: 18px;
    text-align: center;
}
.preview-crest-big {
    width: 96px; height: 96px;
    border-radius: 20px;
    display: grid; place-items: center;
    color: white; font-family: var(--font-display); font-weight: 800; font-size: 26px;
    margin: 0 auto;
    background-size: cover; background-position: center;
    text-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.preview-nombre { font-family: var(--font-display); font-weight: 800; font-size: 16px; margin-top: 12px; line-height: 1.3; }
.preview-abrev { font-size: 11px; color: var(--t-3); letter-spacing: 0.1em; text-transform: uppercase; margin-top: 4px; }
.preview-mini { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); justify-content: center; }
.preview-foto-grupal {
    margin-top: 12px; width: 100%; aspect-ratio: 16/9;
    background-size: cover; background-position: center;
    border-radius: var(--radius); border: 1px solid var(--line);
}

/* Indicador de Forma WDL (ultimos resultados): cuadradito redondeado con color solido */
.forma-row { display: inline-flex; gap: 4px; }
.forma-cell {
    display: inline-grid; place-items: center;
    width: 22px; height: 22px; border-radius: 6px;
    font-family: var(--font-display); font-weight: 800; font-size: 11px;
    color: white;
}
.forma-W { background: #22c55e; }
.forma-E, .forma-D { background: #94a3b8; color: #0b1220; }
.forma-L { background: #ef4444; }
.dg-pos { color: #22c55e; font-weight: 700; }
.dg-neg { color: #ef4444; font-weight: 700; }
.col-amarillas { color: #f5c518; font-weight: 700; }
.col-rojas { color: #d62828; font-weight: 700; }

.jug-foto {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg-4); background-size: cover; background-position: center;
  display: inline-grid; place-items: center; color: var(--t-4);
  flex-shrink: 0; font-size: 11px;
}

.empty {
  text-align: center;
  padding: 36px 20px;
  color: var(--t-3);
}
.empty h3 { font-size: 18px; margin-bottom: 6px; color: var(--t-2); }

/* ----------------- Modal ----------------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(6, 11, 19, 0.7);
  backdrop-filter: blur(6px);
  display: grid; place-items: center;
  z-index: 100;
  padding: 16px;
}
.modal-backdrop-top { z-index: 200; }
.modal {
  background: var(--bg-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-l);
  width: 100%;
  max-width: 520px;
  padding: 28px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.modal-large { max-width: 720px; }
/* Modal con header/footer fijos y body scrolleable */
.modal.modal-split {
  display: flex; flex-direction: column;
  padding: 0;
  overflow: hidden; /* el scroll lo hace .modal-split-body */
}
.modal-split-head {
  padding: 22px 28px 14px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.modal-split-head h3 { margin: 0 0 4px; font-size: 20px; }
.modal-split-head .sub { margin: 0; }
.modal-split-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 6px 28px;
  overscroll-behavior: contain;
}
.modal-split-foot {
  padding: 14px 28px 18px;
  border-top: 1px solid var(--line);
  margin-top: 0 !important;
  flex-shrink: 0;
  background: var(--bg-1);
}
/* Tabla dentro de modal-split: header sticky */
.modal-split-body .jug-table thead th {
  position: sticky; top: 0;
  background: var(--bg-1);
  z-index: 1;
  box-shadow: 0 1px 0 var(--line);
}
/* tarjetas amarilla/roja: pintar select con el color */
.tarjeta-select.tarjeta-amarilla { background: #f5c518 !important; color: #1a1a1a !important; border-color: #c69b00 !important; }
.tarjeta-select.tarjeta-roja { background: #d62828 !important; color: #fff !important; border-color: #8a1414 !important; }
.tarjeta-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; font-weight: 700; font-size: 11.5px; }
.tarjeta-pill.amarilla { background: #f5c518; color: #1a1a1a; }
.tarjeta-pill.roja { background: #d62828; color: #fff; }

/* Modal tabs (Programación/Resultado/Tarjetas/Notas) */
.modal-tabs {
  display: flex; gap: 0; margin-top: 12px;
  border-bottom: 2px solid var(--line-strong);
}
.modal-tab {
  background: transparent; border: none; padding: 10px 16px 11px;
  color: var(--t-3); font-family: var(--font-display); font-weight: 700;
  font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  border-radius: 8px 8px 0 0; position: relative; bottom: -2px;
  border: 2px solid transparent; border-bottom: none;
  transition: all .15s ease;
}
.modal-tab:hover { color: var(--t-1); background: rgba(255,255,255,0.03); }
.modal-tab.active {
  color: var(--brand-300); background: var(--bg-1);
  border-color: var(--line-strong); border-bottom-color: var(--bg-1);
}
.modal-tab .pill {
  display: inline-grid; place-items: center;
  min-width: 18px; height: 18px; padding: 0 6px;
  border-radius: 9px; background: var(--bg-3); color: var(--t-2);
  font-size: 11px; font-weight: 700;
}
.modal-tab.active .pill { background: var(--brand-500); color: white; }

/* ============================================================
   Tabs de página (CampeonatoDetalle, etc) — .zc-tabs / .zc-tab
   - Activa con subrayado + fondo tinted + texto bold + color brand
   - Mobile: scroll horizontal sin wrap, una sola fila siempre
   ============================================================ */
.zc-tabs {
    display: flex;
    gap: 2px;
    background: var(--bg-1);
    border: 1px solid var(--line);
    border-radius: var(--radius-l);
    padding: 6px;
    margin-bottom: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
}
.zc-tabs::-webkit-scrollbar { height: 4px; }
.zc-tabs::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 2px; }
.zc-tab {
    flex-shrink: 0;
    background: transparent;
    border: 0;
    padding: 9px 14px;
    color: var(--t-3);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    scroll-snap-align: start;
    position: relative;
    transition: color .15s, background .15s;
}
.zc-tab i { font-size: 13px; color: var(--t-4); transition: color .15s; }
.zc-tab:hover {
    color: var(--t-1);
    background: var(--bg-2);
}
.zc-tab:hover i { color: var(--brand-300); }
.zc-tab.active {
    color: var(--brand-200);
    background: color-mix(in srgb, var(--brand-500) 18%, transparent);
    font-weight: 700;
    box-shadow: 0 1px 0 0 color-mix(in srgb, var(--brand-500) 30%, transparent) inset,
                0 0 0 1px color-mix(in srgb, var(--brand-500) 40%, transparent);
}
.zc-tab.active i { color: var(--brand-300); }
.zc-tab.active::after {
    content: "";
    position: absolute;
    left: 12px; right: 12px; bottom: 2px;
    height: 2px; border-radius: 2px;
    background: var(--brand-400);
}
@media (max-width: 700px) {
    .zc-tabs { padding: 4px; gap: 0; margin-bottom: 10px; border-radius: 12px; }
    .zc-tab { padding: 8px 12px; font-size: 12.5px; gap: 6px; }
    .zc-tab i { font-size: 12px; }
}
@media (max-width: 520px) {
    .zc-tabs { padding: 4px; }
    .zc-tab { padding: 7px 10px; font-size: 12px; }
    /* En celular muy chico, mostramos solo iconos para tabs no activas — ahorra mucho espacio */
    .zc-tab:not(.active) span { display: none; }
    .zc-tab i { font-size: 14px; }
    .zc-tab.active::after { left: 8px; right: 8px; }
}
.modal-tab .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--bg-3); display: inline-block;
}
.modal-tab .dot.on { background: #22c55e; box-shadow: 0 0 0 2px rgba(34,197,94,0.2); }

.modal-tab-body {
  min-height: 360px;
  padding-top: 16px;
}
/* Cabecera de Resultado: compacta (una fila) */
.resultado-row {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; padding: 8px 0 12px;
}
.resultado-equipo {
  display: flex; align-items: center; gap: 8px;
  flex: 1 1 0; min-width: 0;
}
.resultado-equipo:last-of-type { justify-content: flex-end; }
.resultado-nombre {
  font-family: var(--font-display);
  font-size: 15px; color: var(--t-1); font-weight: 800;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 220px;
  letter-spacing: 0.01em;
}
.resultado-goles {
  width: 60px !important; flex: 0 0 60px;
  text-align: center; font-size: 22px; font-family: var(--font-display);
}
.resultado-sep {
  font-size: 22px; color: var(--t-3); font-weight: 700;
}
/* Listado scrolleable dentro de modal (goles/tarjetas) */
.lista-scroll {
  max-height: 280px;
  overflow-y: auto;
  padding: 4px 6px 4px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.015);
  margin-top: 6px;
}
.lista-scroll > .row:last-child { margin-bottom: 0 !important; }
.lista-scroll::-webkit-scrollbar { width: 8px; }
.lista-scroll::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }
.modal h3 {
  font-size: 20px;
  margin-bottom: 6px;
}
.modal .sub { color: var(--t-3); font-size: 13px; margin-bottom: 18px; }
.modal-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 20px;
}
.modal-actions .btn { width: auto; padding: 10px 18px; }

/* small helper to switch checkbox */
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  font-size: 13px;
  color: var(--t-2);
}
.check-row input { width: 16px; height: 16px; accent-color: var(--brand-500); }

.row { display: flex; gap: 8px; align-items: center; }
.row.between { justify-content: space-between; }
.muted { color: var(--t-3); }
.right { margin-left: auto; }

/* Stat cards globales (antes solo vivían en Dashboard) */
.stat-card {
    background: var(--bg-1); border: 1px solid var(--line);
    border-radius: var(--radius-l); padding: 16px 18px;
    display: flex; gap: 14px; align-items: flex-start;
}
.stat-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; flex-shrink: 0; }
.stat-card .label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--t-3); font-weight: 700; }
.stat-card .value { font-family: var(--font-display); font-size: 28px; font-weight: 800; line-height: 1.1; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat-card .hint { font-size: 11.5px; color: var(--t-3); margin-top: 4px; }

/* Card de Campeón al final de la llave pública */
.pub-bracket-champ-col { min-width: 220px; align-self: stretch; }
.pub-campeon-card {
    margin-top: auto; margin-bottom: auto;
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    padding: 22px 18px;
    background: linear-gradient(160deg,
        color-mix(in srgb, #f5c518 15%, transparent) 0%,
        color-mix(in srgb, #f5c518 4%, transparent) 100%);
    border: 1.5px solid color-mix(in srgb, #f5c518 50%, transparent);
    border-radius: 16px;
    box-shadow: 0 18px 40px -16px color-mix(in srgb, #f5c518 35%, transparent);
}
.pub-campeon-trophy {
    font-size: 36px;
    color: #f5c518;
    text-shadow: 0 2px 10px rgba(245, 197, 24, 0.4);
}
.pub-campeon-crest .pub-crest { width: 56px; height: 56px; font-size: 18px; border-radius: 14px; }
.pub-campeon-name {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 16px;
    text-align: center;
    color: var(--lp-fg);
}
