/* Radar Fútbol — sitio web.
   Identidad heredada de las apps (morado profundo + menta del ícono,
   Barlow Condensed para titulares) con un layout nuevo: banda oscura
   arriba, contenido en tarjetas, tablas densas y gráficas sobrias. */

@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/barlow-condensed-latin-ext-600-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/barlow-condensed-latin-ext-700-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 800; font-display: swap; src: url("../fonts/barlow-condensed-latin-800-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 800; font-display: swap; src: url("../fonts/barlow-condensed-latin-ext-800-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  --page: #f4f2f8;
  --surface: #ffffff;
  --surface-2: #f8f6fb;
  --surface-3: #efebf6;
  --line: #e6e1ee;
  --line-strong: #d6cfe2;
  --ink: #16121f;
  --ink-2: #4d4659;
  --ink-3: #7c7489;
  --brand: #5b2bd8;
  --brand-ink: #4a1fc2;
  --brand-soft: #efe9fd;
  --focus: #7c4dff;
  --mint: #16a34a;
  --mint-ink: #0f7a37;
  --mint-soft: #e3f5ea;
  --live: #e5484d;
  --warn-ink: #8a5a00;

  /* banda oscura (encabezado, marcadores) — igual en ambos temas */
  --band: #150f26;
  --band-2: #211838;
  --band-3: #2d2249;
  --band-line: rgba(255, 255, 255, 0.1);
  --band-ink: #f4f1fb;
  --band-ink-2: #c3bad8;
  --band-ink-3: #8f86a8;
  --band-accent: #6ee7a0;

  /* gráficas (paleta validada: slots 1–3 + rampa azul secuencial) */
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #e34948;
  --series-muted: #c9c3d4;
  --grid: #ebe7f1;
  --axis: #c9c3d4;
  --pitch: #eef3ee;
  --pitch-line: #c5d3c7;
  --heat-rgb: 42, 120, 214;

  /* rating (semántico, estilo Sofascore) */
  --r-elite: #0e7a43;
  --r-good: #2c9a57;
  --r-ok: #a37700;
  --r-low: #cf641c;
  --r-bad: #c93434;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(40, 20, 90, 0.05), 0 4px 16px rgba(40, 20, 90, 0.05);
  --shadow-lg: 0 10px 40px rgba(20, 10, 50, 0.25);
  /* Fuentes con nombre antes que system-ui: en Linux system-ui sigue la
     fuente del escritorio, que puede ser monoespaciada. */
  --font: Inter, "Segoe UI", Roboto, "Noto Sans", -apple-system, "Helvetica Neue", Arial, system-ui, sans-serif;
  --display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --maxw: 1240px;
  --gutter: 24px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0c0913;
    --surface: #17131f;
    --surface-2: #1c1726;
    --surface-3: #241e31;
    --line: #2b2439;
    --line-strong: #3a3150;
    --ink: #f1eef7;
    --ink-2: #c4bcd4;
    --ink-3: #9088a2;
    --brand: #9b7bff;
    --brand-ink: #b9a4ff;
    --brand-soft: #251c3e;
    --mint: #34c46e;
    --mint-ink: #5fdc8f;
    --mint-soft: rgba(52, 196, 110, 0.14);
    --warn-ink: #f0c054;
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --series-4: #e66767;
    --series-muted: #4a4260;
    --grid: #262033;
    --axis: #3a3150;
    --pitch: #16201a;
    --pitch-line: #2e4535;
    --heat-rgb: 85, 152, 231;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0c0913;
  --surface: #17131f;
  --surface-2: #1c1726;
  --surface-3: #241e31;
  --line: #2b2439;
  --line-strong: #3a3150;
  --ink: #f1eef7;
  --ink-2: #c4bcd4;
  --ink-3: #9088a2;
  --brand: #9b7bff;
  --brand-ink: #b9a4ff;
  --brand-soft: #251c3e;
  --mint: #34c46e;
  --mint-ink: #5fdc8f;
  --mint-soft: rgba(52, 196, 110, 0.14);
  --warn-ink: #f0c054;
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #e66767;
  --series-muted: #4a4260;
  --grid: #262033;
  --axis: #3a3150;
  --pitch: #16201a;
  --pitch-line: #2e4535;
  --heat-rgb: 85, 152, 231;
  --shadow: none;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand-ink); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.num, .tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.ink-2 { color: var(--ink-2); }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.icon { flex: none; }

/* ---------- Encabezado ---------- */
.site-header {
  background: var(--band);
  color: var(--band-ink);
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--band-line);
}
.header-row {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 60px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--band-ink);
  flex: none;
}
.brand:hover { color: var(--band-ink); }
.brand img { width: 32px; height: 32px; }
.brand-name {
  font: 800 22px/1 var(--display);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.brand-name span { color: var(--band-accent); }

.league-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 5px 10px 5px 6px;
  border-radius: 999px;
  border: 1px solid var(--band-line);
  background: var(--band-2);
  color: var(--band-ink);
  max-width: 340px;
}
.league-btn:hover { background: var(--band-3); }
.league-btn .logo-wrap { width: 26px; height: 26px; border-radius: 50%; background: #fff; display: grid; place-items: center; flex: none; }
.league-btn img { width: 20px; height: 20px; object-fit: contain; }
.league-btn .lb-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; text-align: left; }
.league-btn .lb-name { font-weight: 650; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.league-btn .lb-season { font-size: 11.5px; color: var(--band-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.header-spacer { flex: 1; }

.search-box { position: relative; width: 300px; }
.search-box input {
  width: 100%;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--band-line);
  background: var(--band-2);
  color: var(--band-ink);
  padding: 0 38px 0 38px;
  outline: none;
}
.search-box input::placeholder { color: var(--band-ink-3); }
.search-box input:focus { border-color: var(--band-accent); background: var(--band-3); }
.search-box > .icon { position: absolute; left: 12px; top: 10px; color: var(--band-ink-3); pointer-events: none; }
.search-box kbd {
  position: absolute; right: 10px; top: 9px;
  font: 600 11px/18px var(--font);
  padding: 0 6px; border-radius: 5px;
  border: 1px solid var(--band-line); color: var(--band-ink-3);
}
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(440px, calc(100vw - 32px));
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  max-height: 70vh;
  overflow-y: auto;
}
.search-results[hidden] { display: none; }
.sr-group { font: 700 12px/1 var(--display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); padding: 10px 10px 6px; }
.sr-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 9px;
}
.sr-item:hover, .sr-item.active { background: var(--surface-3); color: var(--ink); }
.sr-item .sr-main { min-width: 0; flex: 1; }
.sr-item .sr-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-item .sr-sub { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-empty { padding: 14px 10px; color: var(--ink-3); font-size: 14px; }

.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--band-line);
  background: var(--band-2);
  color: var(--band-ink-2);
  flex: none;
}
.icon-btn:hover { color: var(--band-ink); background: var(--band-3); }
.search-toggle { display: none; }

.main-nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter); }
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 12px 12px;
  font: 700 16px/1 var(--display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--band-ink-3);
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}
.main-nav a:hover { color: var(--band-ink); }
.main-nav a.active { color: var(--band-ink); border-bottom-color: var(--band-accent); }
.main-nav .icon { width: 17px; height: 17px; }

/* ---------- Banda de jornada / héroes oscuros ---------- */
.band {
  background:
    radial-gradient(900px 300px at 12% -40%, rgba(124, 77, 255, 0.35), transparent 70%),
    radial-gradient(700px 260px at 95% 0%, rgba(110, 231, 160, 0.10), transparent 70%),
    var(--band);
  color: var(--band-ink);
  padding: 22px 0 26px;
}
.band a:hover { color: var(--band-ink); }
.band-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.eyebrow { font: 700 13px/1 var(--display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--band-accent); margin: 0 0 6px; }
.band h1 { font: 800 clamp(30px, 4.2vw, 46px)/0.95 var(--display); text-transform: uppercase; letter-spacing: 0.01em; margin: 0; }
.band .band-sub { color: var(--band-ink-2); margin: 6px 0 0; font-size: 14.5px; }
.band-link { display: inline-flex; align-items: center; gap: 6px; font: 700 15px/1 var(--display); letter-spacing: 0.06em; text-transform: uppercase; color: var(--band-accent); }
.band-link:hover { color: #fff; }

.strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: var(--band-3) transparent; }
.tile {
  flex: 0 0 214px;
  scroll-snap-align: start;
  background: var(--band-2);
  border: 1px solid var(--band-line);
  border-radius: 12px;
  padding: 10px 12px 11px;
  display: flex; flex-direction: column; gap: 6px;
  transition: background 0.15s, border-color 0.15s;
}
.tile:hover { background: var(--band-3); border-color: rgba(255, 255, 255, 0.18); }
.tile-status { display: flex; justify-content: space-between; font-size: 12px; color: var(--band-ink-3); font-weight: 600; }
.tile-status .live { color: #ff8589; }
.tile-team { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.tile-team .name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-team .sc { font: 700 19px/1 var(--display); min-width: 16px; text-align: right; font-variant-numeric: tabular-nums; }
.tile-team.lost { color: var(--band-ink-3); }

/* ---------- Estructura de página ---------- */
main { flex: 1; }
/* Sólo arriba/abajo: los lados los pone .wrap (el margen lateral en celular). */
.page { padding-top: 26px; padding-bottom: 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font: 800 clamp(30px, 4vw, 42px)/0.95 var(--display); text-transform: uppercase; margin: 0; letter-spacing: 0.01em; }
.page-head p { margin: 6px 0 0; color: var(--ink-3); }
.grid { display: grid; gap: 18px; }
.grid-12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; }
.span-8 { grid-column: span 8; }
.span-7 { grid-column: span 7; }
.span-6 { grid-column: span 6; }
.span-5 { grid-column: span 5; }
.span-4 { grid-column: span 4; }
.span-12 { grid-column: span 12; }
.stack { display: flex; flex-direction: column; gap: 18px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  min-width: 0;
}
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card.flush .card-head { padding: 16px 20px 0; }
.card-head h2, .section-title {
  font: 800 21px/1 var(--display);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0;
}
.card-head .sub { font-size: 13px; color: var(--ink-3); margin-top: 3px; }
.link-more { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 13.5px; color: var(--brand-ink); white-space: nowrap; }
.link-more:hover { text-decoration: underline; }
.section-title { margin: 28px 0 12px; }
.note { font-size: 13px; color: var(--ink-3); margin: 10px 0 0; }

/* ---------- Controles ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 15px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-weight: 600; font-size: 14px;
  white-space: nowrap;
}
.btn:hover { border-color: var(--brand); color: var(--brand-ink); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); color: #fff; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-icon { width: 36px; padding: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  height: 32px; padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-size: 13.5px; font-weight: 600;
  color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 6px;
}
.chip:hover { color: var(--ink); border-color: var(--ink-3); }
.chip[aria-pressed="true"], .chip.active { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.segmented { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-3); gap: 2px; }
.segmented button { border: 0; background: transparent; height: 30px; padding: 0 13px; border-radius: 999px; font-weight: 600; font-size: 13.5px; color: var(--ink-2); }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }

.select, .input {
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  padding: 0 12px;
  min-width: 0;
}
.select:focus, .input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; margin-bottom: 16px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs button {
  border: 0; background: none;
  padding: 11px 14px;
  font: 700 16px/1 var(--display); letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ink-3);
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--brand); }

/* ---------- Escudos, fotos, insignias ---------- */
.crest { object-fit: contain; flex: none; }
/* Escudos oscuros (Monterrey, Atlante…) se pierden sobre fondo oscuro: un
   contorno claro de 1px los separa sin encerrarlos en una caja. */
.band .crest, .site-header .crest { filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.75)) drop-shadow(0 0 0.5px rgba(255, 255, 255, 0.9)); }
:root[data-theme="dark"] .crest { filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.55)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .crest { filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.55)); } }
.crest-box .crest, .logo-wrap .crest, .pl .shirt .crest { filter: none; }
.crest-fallback, .photo-fallback {
  display: grid; place-items: center; flex: none;
  border-radius: 50%;
  background: var(--surface-3); color: var(--ink-3);
  font: 700 11px/1 var(--display);
}
/* Fondo algo más claro que la tarjeta: la silueta genérica de Sofascore
   (jugadores sin foto) es oscura y se perdía en modo oscuro. */
.photo { border-radius: 50%; object-fit: cover; background: var(--line-strong); flex: none; }
.pos-badge {
  display: inline-grid; place-items: center;
  min-width: 34px; height: 20px; padding: 0 5px;
  border-radius: 5px;
  font: 700 12px/1 var(--display); letter-spacing: 0.06em;
  background: var(--surface-3); color: var(--ink-2);
}
.rating {
  display: inline-grid; place-items: center;
  min-width: 34px; height: 21px; padding: 0 5px;
  border-radius: 6px;
  font: 700 12.5px/1 var(--font);
  color: #fff;
  font-variant-numeric: tabular-nums;
  background: var(--ink-3);
}
.rating.lg { min-width: 46px; height: 28px; font-size: 15px; border-radius: 8px; }
.rating.elite { background: var(--r-elite); }
.rating.good { background: var(--r-good); }
.rating.ok { background: var(--r-ok); }
.rating.low { background: var(--r-low); }
.rating.bad { background: var(--r-bad); }

.form { display: inline-flex; gap: 3px; }
.form span {
  width: 20px; height: 20px; border-radius: 5px;
  display: grid; place-items: center;
  font: 700 11.5px/1 var(--font); color: #fff;
}
.form .W { background: var(--mint); }
.form .D { background: #8b8398; }
.form .L { background: var(--live); }

.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--live); margin-right: 5px; vertical-align: 1px; animation: pulse 1.6s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

.stale-banner {
  display: flex; gap: 10px; align-items: center;
  background: #fff4dc; color: #6b4a00;
  border: 1px solid #f1d9a0;
  border-radius: 10px;
  padding: 9px 13px; font-size: 13.5px; margin-bottom: 16px;
}
:root[data-theme="dark"] .stale-banner { background: rgba(240, 192, 84, 0.1); color: var(--warn-ink); border-color: rgba(240, 192, 84, 0.3); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .stale-banner { background: rgba(240, 192, 84, 0.1); color: var(--warn-ink); border-color: rgba(240, 192, 84, 0.3); } }

/* ---------- Estados ---------- */
.state {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  text-align: center; padding: 48px 20px; color: var(--ink-3);
}
.state h3 { margin: 0; color: var(--ink); font-size: 17px; }
.state p { margin: 0; max-width: 460px; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.table th {
  text-align: right; font-weight: 600; font-size: 12px; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: 0.04em;
  padding: 9px 8px; border-bottom: 1px solid var(--line); white-space: nowrap;
  background: var(--surface);
}
.table td { padding: 8px 8px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table .l { text-align: left; }
.table .c { text-align: center; }
.table tbody tr:hover td { background: var(--surface-2); }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--ink); }
.table th.sorted { color: var(--brand-ink); }
.table .pts { font-weight: 800; }
.table .strong { font-weight: 700; }
.team-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.team-cell .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.player-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.player-cell .pc-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.player-cell .pc-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.player-cell .pc-sub { font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; }
.pos-cell { position: relative; padding-left: 14px !important; font-weight: 700; }
.pos-cell::before { content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 4px; border-radius: 2px; background: var(--zone, transparent); }
.zones { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--ink-2); margin-top: 14px; }
.zones span { display: inline-flex; align-items: center; gap: 7px; }
.zones i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* ---------- Partidos ---------- */
.day-group + .day-group { margin-top: 22px; }
.day-title { font: 800 17px/1 var(--display); text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-2); margin: 0 0 10px; }
.match-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.match-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) 86px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.match-row:last-child { border-bottom: 0; }
.match-row:hover { background: var(--surface-2); color: var(--ink); }
.mr-status { font-size: 13px; font-weight: 600; color: var(--ink-3); line-height: 1.2; }
.mr-status .live { color: var(--live); }
.mr-team { display: flex; align-items: center; gap: 10px; font-weight: 600; min-width: 0; }
.mr-team .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mr-team.home { justify-content: flex-end; text-align: right; }
.mr-team.lost { color: var(--ink-3); font-weight: 500; }
.mr-score {
  text-align: center;
  font: 800 22px/1 var(--display);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.mr-score.pending { font: 600 14px/1 var(--font); color: var(--ink-2); }
.mr-score.live-score { color: var(--live); }
.mr-go { color: var(--ink-3); display: grid; place-items: center; }
.round-nav { display: flex; align-items: center; gap: 8px; }
.round-nav .select { font-weight: 600; }

/* ---------- Marcador (ficha de partido) ---------- */
.scoreboard { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 18px; padding: 8px 0 4px; }
.sb-team { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; min-width: 0; }
.sb-team .name { font: 800 clamp(20px, 2.6vw, 28px)/1 var(--display); text-transform: uppercase; }
.sb-team .crest-box { width: 76px; height: 76px; border-radius: 20px; background: rgba(255, 255, 255, 0.95); display: grid; place-items: center; }
.sb-team .manager { font-size: 12.5px; color: var(--band-ink-3); }
.sb-center { text-align: center; }
.sb-score { font: 800 clamp(48px, 7vw, 76px)/0.9 var(--display); letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.sb-score .dash { color: var(--band-ink-3); margin: 0 6px; }
.sb-status { margin-top: 8px; font-weight: 700; font-size: 14px; color: var(--band-ink-2); }
.sb-status .live { color: #ff8589; }
.sb-meta { margin-top: 4px; font-size: 13px; color: var(--band-ink-3); }
.sb-scorers { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 16px; font-size: 13px; color: var(--band-ink-2); }
.sb-scorers ul { list-style: none; margin: 0; padding: 0; }
.sb-scorers .home { text-align: right; }
.match-facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 20px; margin-top: 16px; font-size: 13px; color: var(--band-ink-3); }
.match-facts span { display: inline-flex; align-items: center; gap: 6px; }

/* línea de tiempo */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--line); }
.tl-item { display: grid; grid-template-columns: 1fr 56px 1fr; align-items: center; min-height: 40px; }
.tl-min { text-align: center; }
.tl-min span { display: inline-block; background: var(--surface); position: relative; z-index: 1; padding: 2px 6px; font: 700 13px/1.2 var(--font); color: var(--ink-2); font-variant-numeric: tabular-nums; border: 1px solid var(--line); border-radius: 999px; }
.tl-body { display: flex; align-items: center; gap: 9px; padding: 4px 10px; font-size: 14px; min-width: 0; }
.tl-home { justify-content: flex-end; text-align: right; grid-column: 1; }
.tl-away { grid-column: 3; }
.tl-body .who { font-weight: 600; }
.tl-body .extra { color: var(--ink-3); font-size: 12.5px; }
.tl-period { grid-column: 1 / -1; text-align: center; padding: 8px 0; }
.tl-period span { position: relative; z-index: 1; background: var(--surface-3); border-radius: 999px; padding: 4px 12px; font: 700 12.5px/1 var(--display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.ev-icon { width: 22px; height: 22px; flex: none; display: grid; place-items: center; }
.card-icon { width: 11px; height: 15px; border-radius: 2px; display: inline-block; }
.card-icon.yellow { background: #f5c518; }
.card-icon.red, .card-icon.yellowRed { background: #e03131; }
.card-icon.yellowRed { box-shadow: -4px -2px 0 #f5c518; }
.sub-in { color: var(--mint); font-weight: 700; }
.sub-out { color: var(--live); font-weight: 700; }

/* estadísticas de partido */
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.cmp-group + .cmp-group { margin-top: 20px; }
.cmp-group h3 { font: 800 16px/1 var(--display); text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-2); margin: 0 0 10px; }
.cmp-row { display: grid; grid-template-columns: 64px 1fr 64px; gap: 4px 10px; align-items: center; padding: 5px 0; }
.cmp-row .lbl { grid-column: 1 / -1; text-align: center; font-size: 13px; color: var(--ink-2); }
.cmp-row .val { font-weight: 600; font-variant-numeric: tabular-nums; font-size: 14px; }
.cmp-row .val.a { text-align: left; }
.cmp-row .val.b { text-align: right; }
.cmp-row .val.win { font-weight: 800; color: var(--ink); }
.cmp-row .val:not(.win) { color: var(--ink-2); }
.cmp-bars { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; height: 8px; }
.cmp-bars .track { background: var(--surface-3); border-radius: 4px; overflow: hidden; display: flex; }
.cmp-bars .track.a { justify-content: flex-end; }
.cmp-bars .fill { height: 100%; border-radius: 4px; }
.cmp-bars .a .fill { background: var(--series-1); }
.cmp-bars .b .fill { background: var(--series-2); }

/* ---------- Cancha (alineaciones, 11 ideal) ---------- */
.pitch-wrap { position: relative; }
.pitch {
  position: relative;
  background: var(--pitch);
  border: 1px solid var(--pitch-line);
  border-radius: 12px;
  overflow: hidden;
}
.pitch svg.lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.pitch svg.lines * { stroke: var(--pitch-line); fill: none; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.pl {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  width: 92px;
  text-align: center;
  cursor: pointer;
  z-index: 1;
}
.pl:hover { z-index: 3; }
.pl .shirt {
  position: relative;
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  font: 800 15px/1 var(--display);
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
}
.pl .pl-name { font-size: 12px; font-weight: 700; line-height: 1.15; color: var(--ink); background: color-mix(in srgb, var(--surface) 82%, transparent); padding: 1px 5px; border-radius: 5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl .rating { position: absolute; top: -9px; right: -24px; min-width: 30px; height: 18px; font-size: 11px; }
.pl .marks { position: absolute; bottom: -4px; left: -12px; display: flex; gap: 1px; }
.pl .marks span { font-size: 11px; line-height: 1; }
.pl .cap { position: absolute; top: -6px; left: -8px; width: 16px; height: 16px; border-radius: 50%; background: #f5c518; color: #1b1400; font: 800 10px/16px var(--font); }
.lineup-side-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0 0 8px; font-weight: 700; }
.lineup-side-title .formation { font: 800 18px/1 var(--display); letter-spacing: 0.04em; color: var(--ink-2); }
.bench { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 16px; }
.bench-item { display: flex; align-items: center; gap: 9px; padding: 6px 4px; border-radius: 8px; font-size: 14px; }
.bench-item:hover { background: var(--surface-2); }
.bench-item .num { width: 22px; text-align: right; color: var(--ink-3); font-weight: 700; font-size: 13px; }
.bench-item .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }

.tooltip {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 10px 12px;
  font-size: 13px;
  min-width: 170px;
  max-width: 260px;
}
.tooltip[hidden] { display: none; }
.tooltip .tt-title { font-weight: 700; margin-bottom: 4px; }
.tooltip .tt-sub { color: var(--ink-3); font-size: 12px; margin-bottom: 6px; }
.tooltip dl { display: grid; grid-template-columns: 1fr auto; gap: 2px 14px; margin: 0; }
.tooltip dt { color: var(--ink-2); }
.tooltip dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Líderes ---------- */
.leader-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.leader-card .top1 { display: flex; align-items: center; gap: 12px; padding: 4px 0 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.leader-card .top1 .big { font: 800 34px/1 var(--display); margin-left: auto; font-variant-numeric: tabular-nums; }
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-item { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 0; }
.rank-item .rk { font-weight: 700; color: var(--ink-3); font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }
.rank-item .v { font-weight: 700; font-variant-numeric: tabular-nums; }
.rank-bar { height: 6px; border-radius: 3px; background: var(--surface-3); margin-top: 4px; overflow: hidden; }
.rank-bar i { display: block; height: 100%; background: var(--series-1); border-radius: 3px; }

/* ---------- Jugador ---------- */
.profile { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 22px; align-items: center; }
.profile .photo-lg { width: 112px; height: 112px; border-radius: 28px; background: rgba(255, 255, 255, 0.95); object-fit: cover; }
.profile h1 { font: 800 clamp(32px, 4.6vw, 52px)/0.92 var(--display); text-transform: uppercase; margin: 4px 0 8px; }
.profile .team-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--band-ink); }
.profile .team-link:hover { color: var(--band-accent); }
.facts { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 14px; }
.fact { display: flex; flex-direction: column; }
.fact .k { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--band-ink-3); font-weight: 600; }
.fact .v { font-weight: 650; font-size: 15px; }
.profile-side { text-align: right; }
.profile-side .mv { font: 800 34px/1 var(--display); }
.profile-side .mv-k { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--band-ink-3); font-weight: 600; }
.profile-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.band .btn { background: transparent; border-color: var(--band-line); color: var(--band-ink); }
.band .btn:hover { border-color: var(--band-accent); color: var(--band-accent); }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 12px; }
.stat-tile { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat-tile .k { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.stat-tile .v { font-size: 26px; font-weight: 700; line-height: 1.15; margin-top: 2px; }
.stat-tile .d { font-size: 12px; color: var(--ink-3); }

.pct-list { display: flex; flex-direction: column; gap: 9px; }
.pct-row { display: grid; grid-template-columns: minmax(120px, 190px) minmax(0, 1fr) 44px; gap: 12px; align-items: center; font-size: 13.5px; }
.pct-row .lbl { color: var(--ink-2); }
.pct-row .lbl small { display: block; color: var(--ink-3); font-size: 12px; }
.pct-track { height: 10px; border-radius: 5px; background: var(--surface-3); position: relative; }
.pct-track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; background: var(--series-1); }
.pct-track::after { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--axis); }
.pct-row .pv { font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }

.stat-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0 28px; }
.stat-group h3 { font: 800 16px/1 var(--display); text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-2); margin: 18px 0 6px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv span:first-child { color: var(--ink-2); }
.kv span:last-child { font-weight: 650; font-variant-numeric: tabular-nums; }

.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .axis { stroke: var(--axis); stroke-width: 1; }
.chart .tick { fill: var(--ink-3); font-size: 11px; font-family: var(--font); }
.chart .axis-label { fill: var(--ink-2); font-size: 12px; font-weight: 600; font-family: var(--font); }
.chart .dlabel { fill: var(--ink); font-size: 11.5px; font-weight: 600; font-family: var(--font); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.chart .quad-label { fill: var(--ink-3); font-size: 11.5px; font-weight: 600; font-family: var(--font); }
.chart .median { stroke: var(--axis); stroke-width: 1; }
.heat-legend { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); margin-top: 10px; }
.heat-legend i { height: 8px; width: 120px; border-radius: 4px; background: linear-gradient(90deg, rgba(var(--heat-rgb), 0.08), rgba(var(--heat-rgb), 1)); }

/* ---------- Comparar ---------- */
.cmp-head { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 16px; align-items: stretch; }
.cmp-slot { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden; }
.cmp-slot::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--slot); }
.cmp-slot.a { --slot: var(--series-1); }
.cmp-slot.b { --slot: var(--series-2); }
.cmp-slot .who { display: flex; align-items: center; gap: 12px; }
.cmp-slot .who h2 { font: 800 24px/1 var(--display); text-transform: uppercase; margin: 0; }
.cmp-vs { align-self: center; font: 800 26px/1 var(--display); color: var(--ink-3); }
.picker { position: relative; }
.picker .input { width: 100%; }
.picker-results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; max-height: 320px; overflow-y: auto; }
.picker-results[hidden] { display: none; }

/* ---------- Equipos ---------- */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.team-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); position: relative; overflow: hidden; transition: border-color 0.15s, transform 0.15s; }
.team-card:hover { border-color: var(--brand); transform: translateY(-1px); color: var(--ink); }
.team-card::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: var(--tc, transparent); opacity: 0.12; }
.team-card .tc-top { display: flex; align-items: center; gap: 12px; }
.team-card .tc-name { font: 800 20px/1.05 var(--display); text-transform: uppercase; }
.team-card .tc-meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-3); }
.team-card .tc-meta b { color: var(--ink); font-variant-numeric: tabular-nums; }
.squad-group h3 { font: 800 17px/1 var(--display); text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-2); margin: 20px 0 8px; }
.squad-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.squad-item { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.squad-item:hover { border-color: var(--brand); color: var(--ink); }
.squad-item .num { width: 24px; text-align: center; font: 800 17px/1 var(--display); color: var(--ink-3); }
.squad-item .si-main { min-width: 0; flex: 1; }
.squad-item .si-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.squad-item .si-sub { font-size: 12.5px; color: var(--ink-3); }
.squad-item .si-mv { font-weight: 700; font-size: 13px; color: var(--ink-2); white-space: nowrap; }

/* ---------- Buscar jugadores ---------- */
.big-search { position: relative; max-width: 720px; }
.big-search input { width: 100%; height: 54px; border-radius: 16px; border: 1px solid var(--line-strong); background: var(--surface); padding: 0 18px 0 50px; font-size: 17px; box-shadow: var(--shadow); }
.big-search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.big-search > .icon { position: absolute; left: 17px; top: 17px; color: var(--ink-3); }
.result-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.result-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); min-width: 0; }
.result-item:hover { border-color: var(--brand); color: var(--ink); }
.result-item .ri-main { min-width: 0; flex: 1; }
.result-item .ri-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-item .ri-sub { font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Modal de ligas ---------- */
dialog.modal {
  border: 0; padding: 0;
  border-radius: 18px;
  width: min(760px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 48px));
  background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-lg);
}
dialog.modal::backdrop { background: rgba(12, 8, 22, 0.6); backdrop-filter: blur(2px); }
.modal-inner { display: flex; flex-direction: column; max-height: inherit; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font: 800 24px/1 var(--display); text-transform: uppercase; margin: 0; }
.modal-head .icon-btn { background: var(--surface-3); border-color: var(--line); color: var(--ink-2); }
.modal-body { padding: 16px 20px 20px; overflow-y: auto; }
.league-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.league-opt { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); text-align: left; }
.league-opt:hover { border-color: var(--brand); }
.league-opt.current { border-color: var(--brand); background: var(--brand-soft); }
.league-opt .lo-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.league-opt .lo-name { font-weight: 650; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.league-opt .lo-sub { font-size: 12px; color: var(--ink-3); }
.cat-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 4px; }
.cat-opt { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 9px; border: 0; background: transparent; text-align: left; font-size: 14px; }
.cat-opt:hover { background: var(--surface-3); }
.cat-opt .fl { width: 20px; text-align: center; }

/* ---------- Pie ---------- */
.site-footer { border-top: 1px solid var(--line); color: var(--ink-3); font-size: 13px; padding: 18px 0 26px; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- Responsivo ---------- */
@media (max-width: 1080px) {
  .span-8, .span-7, .span-6, .span-5, .span-4 { grid-column: span 12; }
  .search-box { width: 240px; }
}
@media (max-width: 820px) {
  :root { --gutter: 16px; }
  .search-box { display: none; }
  .search-box.open { display: block; position: absolute; left: var(--gutter); right: var(--gutter); top: 11px; width: auto; z-index: 5; }
  .search-toggle { display: grid; }
  .brand-name { display: none; }
  .header-spacer { display: none; }
  .league-btn { max-width: none; flex: 1; }
  .profile { grid-template-columns: auto minmax(0, 1fr); }
  .profile-side { grid-column: 1 / -1; text-align: left; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
  .profile-actions { margin-top: 0; }
  .profile .photo-lg { width: 84px; height: 84px; border-radius: 22px; }
  .cmp-head { grid-template-columns: 1fr; }
  .cmp-vs { justify-self: center; }
  .match-row { grid-template-columns: 56px minmax(0, 1fr) 64px minmax(0, 1fr); gap: 8px; padding: 11px 12px; }
  .mr-go { display: none; }
  .mr-team { gap: 7px; font-size: 14px; }
  .mr-team .crest, .mr-team .crest-fallback { width: 22px !important; height: 22px !important; }
  .scoreboard { gap: 10px; }
  .sb-team .crest-box { width: 58px; height: 58px; border-radius: 16px; }
  .pct-row { grid-template-columns: minmax(96px, 130px) minmax(0, 1fr) 36px; gap: 8px; }
  .tl-item { grid-template-columns: 1fr 46px 1fr; }
  .tl-body { padding: 4px 6px; font-size: 13px; }
  .pl { width: 70px; }
  .pl .shirt { width: 30px; height: 30px; font-size: 13px; }
  .pl .pl-name { font-size: 10.5px; }
  .pl .rating { right: -18px; }
}
@media (max-width: 480px) {
  .card-head { flex-wrap: wrap; }
  .multi-table td.l { white-space: normal; min-width: 112px; }
  .header-row { gap: 8px; }
  .league-btn .lb-season { display: none; }
  .card { padding: 16px; }
  .table { font-size: 13px; }
  .table td, .table th { padding: 7px 5px; }
  .hide-sm { display: none; }
}
@media (min-width: 821px) {
  .show-sm { display: none; }
}

/* ---------- Añadidos: seguir, temporada, videos, penales, comparar 5 ---------- */
:root {
  /* Colores categóricos para comparar hasta 5 jugadores (paleta validada,
     en su orden fijo: azul, naranja, aqua, amarillo, magenta). */
  --cat-1: #2a78d6; --cat-2: #eb6834; --cat-3: #1baf7a; --cat-4: #eda100; --cat-5: #e87ba4;
}
:root[data-theme="dark"] { --cat-1: #3987e5; --cat-2: #d95926; --cat-3: #199e70; --cat-4: #c98500; --cat-5: #d55181; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --cat-1: #3987e5; --cat-2: #d95926; --cat-3: #199e70; --cat-4: #c98500; --cat-5: #d55181; } }

.btn-sm { height: 30px; padding: 0 11px; font-size: 13px; gap: 5px; }
.follow-btn[aria-pressed="true"] { border-color: var(--gold, #d99a00); color: #b37d00; }
.follow-btn[aria-pressed="true"] .icon { color: #e0a100; }
.band .follow-btn[aria-pressed="true"] { color: #ffd76a; border-color: rgba(255, 215, 106, 0.6); }
.band-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.season-picker { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); }
.band .season-picker { color: var(--band-ink-3); }
.band .season-select { background: var(--band-2); color: var(--band-ink); border-color: var(--band-line); }
.head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.fav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr)); gap: 10px; }
.fav-item { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); min-width: 0; }
.fav-item:hover { border-color: var(--brand); color: var(--ink); }
.fav-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fav-top .nm { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav-line { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.fav-line > * { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav-line.muted { display: block; }
.fav-line .k { color: var(--ink-3); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }

.video-stage { display: flex; flex-direction: column; gap: 6px; }
.video-hit { display: block; border: 0; padding: 0; background: none; width: 100%; color: inherit; }
.video-stage .thumb, .video-row .thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: var(--surface-3); }
.video-stage .thumb img, .video-row .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; background: rgba(0, 0, 0, 0.25); }
.thumb .play .icon { filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5)); }
.video-stage iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 10px; display: block; }
.video-stage .vt, .video-row .vt { font-weight: 650; font-size: 14px; line-height: 1.3; color: var(--ink); }
.video-stage .vs, .video-row .vs { font-size: 12.5px; color: var(--ink-3); }
.video-list { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.video-row { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 10px; align-items: center; padding: 6px; margin: 0 -6px; border: 0; border-radius: 8px; background: none; text-align: left; color: inherit; }
.video-row:hover { background: var(--surface-2); }
.video-row .thumb { border-radius: 6px; }
.vr-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.rank-bars { display: flex; flex-direction: column; gap: 4px; }
.rb-row { display: grid; grid-template-columns: 24px minmax(90px, 170px) minmax(0, 1fr) 64px; gap: 10px; align-items: center; padding: 5px 4px; border: 0; background: none; border-radius: 8px; font-size: 14px; text-align: left; color: var(--ink); }
button.rb-row:hover { background: var(--surface-2); }
.rb-rank { color: var(--ink-3); font-weight: 700; font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }
.rb-name { display: flex; align-items: center; gap: 8px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rb-track { height: 10px; border-radius: 0 5px 5px 0; background: var(--surface-3); overflow: hidden; }
.rb-track i { display: block; height: 100%; border-radius: 0 5px 5px 0; background: var(--series-1); }
.rb-value { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

.multi-table th .who { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-transform: none; letter-spacing: 0; }
.multi-table th .who b { color: var(--ink); font-size: 13px; }
.multi-table .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: 0; }
.multi-table td.best { font-weight: 800; color: var(--ink); }
.multi-table td.best .v::after { content: " ▲"; font-size: 10px; color: var(--mint-ink); }
.multi-table .cellbar { display: block; height: 4px; border-radius: 2px; margin-top: 4px; margin-left: auto; }
.slot-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.slot-chip { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); position: relative; overflow: hidden; }
.slot-chip::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--slot); }
.slot-chip .nm { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot-chip .sub { font-size: 12.5px; color: var(--ink-3); }
.slot-chip .x { border: 0; background: none; color: var(--ink-3); padding: 4px; border-radius: 6px; }
.slot-chip .x:hover { color: var(--ink); background: var(--surface-3); }
.pen-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.rank-order { flex-direction: row; align-items: center; gap: 8px; min-width: 0; }
.rank-order .select { max-width: 100%; }
@media (max-width: 560px) {
  .card-head:has(.rank-order) { flex-wrap: wrap; }
  .rank-order { flex: 1 1 100%; }
  .rank-order .select { flex: 1; }
  .rb-row { grid-template-columns: 22px minmax(0, 1fr) minmax(56px, 1fr) 48px; gap: 8px; }
}
.segmented button { white-space: nowrap; }
