/* La web pública (templates/site.html y las que la extienden). El panel usa tokens.css + app.css.
   Pensada para la tribuna a pleno sol: blanco y casi negro, letra grande y pesada, colores sólidos
   (los tintes suaves se lavan con el sol) y toques de 48 px o más.
   Verde cancha = el fondo del banner de Polo Breeders; oro = el de la AACCP. */

@font-face {
  font-family: "Archivo";
  src: url("fonts/Archivo-latin.woff2") format("woff2");
  font-weight: 400 900; font-stretch: 62% 125%; font-style: normal; font-display: swap;
}

:root {
  color-scheme: light;
  --pitch: #354C44;       /* verde cancha: encabezado, «En cancha», pie */
  --pitch-2: #273932;     /* más hondo: lo abierto adentro del verde */
  --sage: #9BBA9E;        /* salvia de Polo Breeders: texto secundario sobre verde */
  --sage-2: #D2E1D3;      /* salvia clara: texto sobre verde que tiene que leerse bien */
  --paper: #FFFFFF;
  --ground: #EBF0EA;      /* fondo de la página */
  --line: #C3CEC5;
  --ink: #0F1E18;         /* texto: 17:1 sobre blanco */
  --ink-2: #3A4A42;       /* secundario: 9:1, nada más claro que esto */
  --link: #5E8C68;        /* subrayado de los caballos con pedigree */
  --gold: #B49764;        /* AACCP */
  --gold-ink: #6E5427;
  --live: #D3241B;
  --focus: #0F1E18;
  --narrow: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --w: 600px;             /* ancho del contenido */
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--ground); color: var(--ink);
  font-family: var(--narrow); font-size: 16px; font-weight: 500; line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 800; text-wrap: balance; }
p { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.mast, .oncourt:not(.done), .pie { --focus: #FFFFFF; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- Encabezado: la marca de la AACCP y, pegado abajo, el banner de Polo Breeders ---------- */
.mast { background: var(--pitch); color: #FFFFFF; padding-top: env(safe-area-inset-top, 0px); }
.mast-in {
  max-width: var(--w); margin: 0 auto; display: flex; align-items: center; gap: 6px;
  padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
}
/* El logo de la AACCP (static/logos/header_AACCP.svg), solo y centrado; la flecha para volver, a la izquierda. */
.mast-in { position: relative; justify-content: center; }
.mark { display: flex; align-items: center; min-height: 48px; padding: 2px 0; }
.mark img { display: block; height: 44px; width: auto; max-width: calc(100vw - 120px); object-fit: contain; }
.back { position: absolute; left: max(6px, env(safe-area-inset-left, 0px)); top: 50%; margin-top: -24px; display: grid; place-items: center; width: 44px; height: 48px; border-radius: 8px; }
.back:hover { background: rgb(255 255 255 / .1); }
.back svg { width: 26px; height: 26px; }
.banner { border-top: 1px solid rgb(155 186 158 / .28); }
.banner a, .banner img { display: block; }
.banner img { width: 100%; max-width: var(--w); height: auto; margin: 0 auto; }

.page {
  flex: 1; width: 100%; max-width: var(--w); margin: 0 auto;
  padding: 16px max(16px, env(safe-area-inset-right, 0px)) 28px max(16px, env(safe-area-inset-left, 0px));
  display: grid; gap: 16px; align-content: start; grid-template-columns: minmax(0, 1fr);
}

/* Chips: el torneo y el equipo */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding: 2px 16px; }
.chips::-webkit-scrollbar { display: none; }
.chips a, .chips button {
  flex: none; display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px;
  border: 1.5px solid var(--line); background: var(--paper); border-radius: 999px;
  font-size: 15px; font-weight: 600; color: var(--ink-2); white-space: nowrap; cursor: pointer;
}
.chips a[aria-current="true"], .chips button[aria-pressed="true"] { background: var(--pitch); border-color: var(--pitch); color: #FFFFFF; }

.nothing { text-align: center; color: var(--ink-2); padding: 40px 12px; font-size: 16px; }
.note { color: var(--ink-2); font-size: 14px; }
.more {
  justify-self: center; display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px;
  border: 1.5px solid var(--pitch); border-radius: 999px; font-size: 15px; font-weight: 700; color: var(--pitch); background: var(--paper);
}

/* Color del equipo (app/colors.py): una franja o un punto. Con borde, para que el blanco se vea. */
.team-dot { display: inline-block; flex: none; width: .7em; height: .7em; border-radius: 50%; background: var(--team); margin-right: .45em; box-shadow: inset 0 0 0 1.5px rgb(0 0 0 / .25); }

/* ---------- Resultados ---------- */
.day { display: grid; gap: 8px; }
.day-label { font-size: 19px; font-stretch: 85%; padding-top: 4px; }
.results { display: grid; gap: 8px; }
.result {
  display: grid; gap: 2px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px;
}
.result-tour { font-size: 13.5px; font-weight: 500; color: var(--ink-2); margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-tour b { color: var(--ink); font-weight: 800; font-variant-numeric: tabular-nums; }
.result-team { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-height: 28px; }
.result-name { font-size: 17px; font-weight: 500; color: var(--ink-2); line-height: 1.2; min-width: 0; overflow-wrap: anywhere; }
.result-goals { font-size: 24px; font-weight: 800; font-stretch: 70%; line-height: 1; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.result-team.win .result-name { color: var(--ink); font-weight: 700; }
.result-team.win .result-goals { color: var(--ink); font-weight: 900; }
.result-go { justify-self: end; display: inline-flex; align-items: center; gap: 2px; margin-top: 2px; font-size: 14px; font-weight: 700; color: var(--pitch); }
.result-go svg { width: 16px; height: 16px; }
a.result:hover { border-color: var(--pitch); }

/* ---------- Partido: el marcador ---------- */
/* Va de borde a borde, en blanco: lo primero que se lee desde la tribuna. */
.board {
  margin: -16px -16px 0; padding: 14px 16px 0; background: var(--paper); border-bottom: 1px solid var(--line);
}
@media (min-width: 640px) { .board { margin-inline: 0; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 12px 12px; } }
.board-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.board-tour { color: var(--ink); font-weight: 700; }
.board-teams { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; margin: 12px 0 16px; font-weight: 800; }
.board-team { display: flex; align-items: center; gap: 9px; min-height: 48px; min-width: 0; }
.board-team.away { flex-direction: row-reverse; text-align: right; }
.board-team::before { content: ""; flex: none; align-self: stretch; width: 6px; border-radius: 3px; background: var(--team, var(--line)); box-shadow: inset 0 0 0 1.5px rgb(0 0 0 / .2); }
.board-name { min-width: 0; font-size: 18px; font-stretch: 85%; line-height: 1.12; overflow-wrap: break-word; }
.board-score { display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.board-goals { font-size: 42px; font-weight: 900; font-stretch: 66%; line-height: .9; min-width: .9em; text-align: center; }
.board-goals:empty { display: none; }
.board-sep { font-size: 18px; font-weight: 700; color: var(--ink-2); }
.board-team.lose .board-name { font-weight: 600; color: var(--ink-2); }
.board-goals.lose { font-weight: 700; color: var(--ink-2); }

.live-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px 2px 7px; border-radius: 4px;
  background: var(--live); color: #FFFFFF; font-size: 13px; font-weight: 800; letter-spacing: .02em; line-height: 1.2;
}
.live-chip::before, .tab-live::after, .oc-dot { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
/* El único movimiento que no pide nadie: lo que está en vivo late. */
@keyframes latido { 50% { opacity: .25; } }
.live-chip::before, .oc-dot, .tab-live::after { animation: latido 1.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .live-chip::before, .oc-dot, .tab-live::after { animation: none; } }

.views { display: grid; grid-template-columns: 1fr 1fr; margin: 0 -16px; border-top: 1px solid var(--line); }
.views button { border: 0; background: transparent; cursor: pointer; min-height: 46px; font-size: 16px; font-weight: 600; color: var(--ink-2); border-bottom: 4px solid transparent; padding-top: 4px; }
.views button[aria-selected="true"] { color: var(--ink); font-weight: 700; border-bottom-color: var(--pitch); }

.match-body { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.view { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }

.other-live {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 12px;
  background: var(--paper); border: 1.5px solid var(--live); border-radius: 10px; font-size: 15px; font-weight: 600;
}
.other-live > span:nth-child(2) { flex: 1; min-width: 0; }
.other-live svg { width: 20px; height: 20px; flex: none; color: var(--live); }

/* El equipo: una sola barra; el elegido, en blanco adentro de ella. El punto, el color del equipo. */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; border-radius: 10px; background: #D9E2DA; }
.seg button {
  display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 6px 8px; min-width: 0;
  border: 0; border-radius: 8px; background: transparent; cursor: pointer;
  font-size: 15px; font-weight: 600; line-height: 1.15; color: var(--ink-2);
}
.seg button[aria-selected="true"] { background: var(--paper); color: var(--ink); font-weight: 700; box-shadow: 0 1px 2px rgb(15 30 24 / .12), 0 2px 8px rgb(15 30 24 / .08); }
.seg-name { min-width: 0; text-align: center; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.players { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }

/* Los caballos de un jugador: el chukker en un cuadro, el nombre grande, el pelaje abajo */
.player { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.player-name { font-size: 19px; font-stretch: 85%; line-height: 1.15; padding: 10px 14px 8px; border-bottom: 2px solid var(--ground); }
.horses { list-style: none; margin: 0; padding: 0; }
.horse { display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 12px; align-items: start; padding: 8px 14px; min-height: 46px; }
.horse + .horse { border-top: 1px solid var(--ground); }
.horse .ch {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px;
  background: var(--pitch); color: #FFFFFF; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.horse-body { display: grid; min-width: 0; padding-top: 2px; }
/* El tiempo total que jugó (partido terminado), a la derecha del caballo */
.horse:has(.horse-time) { grid-template-columns: 28px minmax(0, 1fr) auto; }
.horses.subs .horse:has(.horse-time) { grid-template-columns: minmax(0, 1fr) auto; }
.horse-time { align-self: start; padding: 4px 0 0 8px; font-size: 15px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hname { font-size: 17px; font-weight: 700; font-stretch: 92%; line-height: 1.22; overflow-wrap: anywhere; }
.pel { font-size: 14px; color: var(--ink-2); }
.subs-title { font-size: 14px; font-weight: 700; color: var(--ink-2); padding: 10px 14px 0; background: #F5F8F4; border-top: 2px solid var(--ground); }
.horses.subs { background: #F5F8F4; padding-bottom: 4px; }
.horses.subs .horse { grid-template-columns: minmax(0, 1fr); }
.horses.subs .horse + .horse { border-top-color: #E4EBE3; }
@media (min-width: 520px) {
  .horses.subs { display: grid; grid-template-columns: 1fr 1fr; }
  .horses.subs .horse:nth-child(2) { border-top: 0; }
}

/* Caballos con pedigree: subrayado grueso (se ve al sol), y el ícono de la AACCP para los inscriptos */
.ped { text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: var(--link); text-underline-offset: 4px; text-decoration-skip-ink: none; }
.ped:hover { text-decoration-color: currentColor; }
.aaccp { display: inline-block; width: auto; height: 14px; vertical-align: -1px; margin-left: 5px; }

/* ---------- En cancha (templates/_en_cancha.html): el tablero verde ---------- */
.oc-slot:not(:has(*)) { display: none; }
.oncourt { background: var(--pitch); color: #FFFFFF; border-radius: 10px; overflow: hidden; }
.oncourt ul { list-style: none; margin: 0; padding: 0; }
.oc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px 6px; }
.oc-title { display: flex; align-items: center; gap: 9px; font-size: 20px; font-stretch: 85%; line-height: 1.1; }
.oc-dot { width: 10px; height: 10px; background: #FF5247; box-shadow: 0 0 0 3px rgb(255 82 71 / .3); }
.oc-chip { flex: none; padding: 3px 9px; border-radius: 4px; background: var(--sage); color: var(--pitch-2); font-size: 14px; font-weight: 700; white-space: nowrap; }
.oc-now li { display: grid; gap: 1px; padding: 8px 14px 10px; border-top: 1px solid rgb(255 255 255 / .13); }
.oc-now li:first-child { border-top: 0; }
.oc-player { font-size: 14px; font-weight: 500; color: var(--sage-2); overflow-wrap: anywhere; }
.oc-horse { display: block; min-width: 0; overflow-wrap: anywhere; }
.oc-name { font-weight: 800; line-height: 1.15; }
.oc-now .oc-name { font-size: 23px; font-stretch: 82%; letter-spacing: .005em; }
.oncourt .ped { text-decoration-color: var(--sage); }
.oc-note { display: block; font-size: 13.5px; color: var(--sage-2); margin-top: 2px; }
.oc-none { color: var(--sage-2); font-style: italic; font-weight: 500; }
.oc-wait { padding: 2px 14px 14px; font-size: 16px; color: var(--sage-2); }
.oc-hist { background: var(--pitch-2); }
.oc-hist summary {
  display: flex; align-items: center; justify-content: space-between; min-height: 46px; padding: 0 14px;
  cursor: pointer; list-style: none; font-size: 15px; font-weight: 700; color: var(--sage-2);
}
.oc-hist summary::-webkit-details-marker { display: none; }
.oc-hist summary::after { content: ""; width: 10px; height: 10px; border: solid currentColor; border-width: 0 3px 3px 0; transform: translateY(-3px) rotate(45deg); }
.oc-hist[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.oc-ch { padding: 4px 0 8px; }
.oc-ch + .oc-ch { border-top: 1px solid rgb(255 255 255 / .12); }
.oc-ch h3 { padding: 10px 14px 2px; font-size: 14px; color: var(--sage); }
.oc-ch li { display: grid; gap: 1px; padding: 5px 14px 7px; }
@media (min-width: 520px) { .oc-ch li { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 12px; align-items: baseline; } }
.oc-ch .oc-player { font-size: 14px; }
.oc-seq { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
/* Un caballo del chukker que pasaría a dos renglones: el script de match.html le achica solo el nombre. */
.oc-step { display: block; min-width: 0; }
.oc-ch .oc-name { font-size: 16px; }
.oc-arrow { color: var(--sage); margin-right: 6px; }
.oc-time { margin-left: 6px; font-size: 13px; font-weight: 600; color: var(--sage-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Entre chukkers: oro, los caballos esperan */
.oncourt.palenques .oc-title { color: #E4CFA3; }
.oc-icon { flex: none; }
.oncourt.palenques .oc-chip { background: var(--gold); color: var(--ink); }
/* Terminado: el historial en blanco, ya no es noticia */
.oncourt.done { background: var(--paper); color: var(--ink); border: 1px solid var(--line); }
.oncourt.done .oc-head { padding-bottom: 4px; }
.oncourt.done .oc-title { font-size: 19px; }
.oncourt.done .oc-hist { background: transparent; padding-bottom: 6px; }
.oncourt.done .oc-ch + .oc-ch { border-top-color: var(--ground); }
.oncourt.done .oc-ch h3, .oncourt.done .oc-arrow { color: var(--ink-2); }
.oncourt.done .oc-player, .oncourt.done .oc-time, .oncourt.done .oc-none { color: var(--ink-2); }
.oncourt.done .ped { text-decoration-color: var(--link); }

/* ---------- Premios: el MPA en oro AACCP ---------- */
.awards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.award { display: grid; gap: 2px; align-content: start; min-width: 0; padding: 12px 14px; background: var(--paper); border: 1px solid var(--line); border-left: 5px solid var(--gold); border-radius: 10px; }
.award-label { font-size: 14px; font-weight: 700; color: var(--gold-ink); }
.award-horse { font-size: 17px; font-weight: 800; line-height: 1.2; overflow-wrap: break-word; }
.award-who { font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; }
.award.mpa { grid-column: 1 / -1; background: var(--gold); border: 0; padding: 16px 18px; }
.award.mpa .award-label, .award.mpa .award-who { color: var(--ink); }
.award.mpa .award-label { font-size: 15px; }
.award.mpa .award-horse { font-size: 27px; font-stretch: 80%; line-height: 1.05; }
.award.mpa .ped { text-decoration-color: var(--ink); }
.award.mpa .aaccp { filter: brightness(0) saturate(100%); height: 20px; }

/* Las nominaciones, lado a lado, comparten las filas (subgrid): el caballo, el jugador y los datos quedan a la
   misma altura aunque un nombre ocupe más renglones que el otro. */
@supports (grid-template-rows: subgrid) {
  .award:not(.mpa) { grid-row: span 4; grid-template-rows: subgrid; row-gap: 2px; }
}
.award-who:empty { display: none; }
.award:not(.mpa) .award-who:empty { display: block; }
/* Lo que jugó el caballo premiado (pantalla del estadio): tiempo, goles y en qué chukkers, titular o de espera */
.award-stats { display: grid; grid-template-columns: auto auto; justify-content: start; align-content: start; gap: 6px 18px; margin: 8px 0 0; padding-top: 8px; border-top: 1px solid var(--ground); }
.award-stats div { display: grid; gap: 0; min-width: 0; }
.award-stats dt { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.award-stats dd { margin: 0; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.award-stats .aw-chukkers { grid-column: 1 / -1; }
.aw-chukkers dd { display: flex; flex-wrap: wrap; gap: 4px; padding-top: 2px; }
.aw-ch { display: inline-flex; align-items: baseline; gap: 4px; padding: 1px 7px; border-radius: 4px; background: var(--ground); font-size: 13px; font-weight: 600; }
.aw-ch b { font-size: 14px; font-weight: 800; }
.aw-ch sup { font-size: .62em; font-weight: 700; line-height: 0; vertical-align: .55em; margin-left: 1px; }
.aw-more { margin-left: 1px; color: var(--ink-2); }
.award.mpa .award-stats { grid-template-columns: auto auto 1fr; border-top-color: rgb(15 30 24 / .2); }
.award.mpa .award-stats .aw-chukkers { grid-column: auto; }
.award.mpa .award-stats dt, .award.mpa .aw-more { color: var(--ink); }
.award.mpa .aw-ch { background: rgb(255 255 255 / .45); }

/* ---------- Sin lista publicada ---------- */
.empty { display: grid; justify-items: center; gap: 8px; padding: 28px 20px; text-align: center; background: var(--paper); border: 2px dashed var(--line); border-radius: 12px; }
.empty-logo { height: 52px; width: auto; }
.empty h2 { font-size: 20px; font-stretch: 85%; }
.empty p { color: var(--ink-2); }
.lineup { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.lineup h3 { display: flex; align-items: center; gap: 10px; padding: 10px 14px 6px; font-size: 18px; font-stretch: 85%; }
.lineup h3::before { content: ""; align-self: stretch; width: 6px; border-radius: 3px; background: var(--team, var(--line)); box-shadow: inset 0 0 0 1.5px rgb(0 0 0 / .2); }
.lineup .row { padding: 9px 14px; border-top: 1px solid var(--ground); font-size: 16px; font-weight: 500; }

/* ---------- Sección Partido: datos y estadísticas ---------- */
.facts { margin: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; }
.facts div { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 10px; padding: 10px 14px; }
.facts div + div { border-top: 1px solid var(--ground); }
.facts dt { color: var(--ink-2); font-size: 14px; font-weight: 500; padding-top: 1px; }
.facts dd { margin: 0; font-weight: 600; }
.stats { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
.sec-title { font-size: 19px; font-stretch: 85%; }
.scorers { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.score-row { display: flex; justify-content: space-between; gap: 12px; }
.score-row b { font-size: 19px; font-weight: 900; font-stretch: 70%; font-variant-numeric: tabular-nums; }
.chk-wrap { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; }
.chk { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 16px; }
.chk th, .chk td { padding: 10px 4px; text-align: center; }
.chk thead th { font-size: 13px; font-weight: 600; color: var(--ink-2); border-bottom: 2px solid var(--ground); }
.chk tbody tr + tr > * { border-top: 1px solid var(--ground); }
.chk tbody th { text-align: left; font-size: 15px; font-weight: 700; padding-left: 14px; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chk td { color: var(--ink-2); min-width: 24px; font-weight: 600; }
.chk td.won { color: var(--ink); font-weight: 900; }
.chk .tot { font-size: 20px; font-weight: 900; font-stretch: 70%; color: var(--ink); padding-right: 16px; border-left: 2px solid var(--ground); }
.chk thead .tot { font-size: 13px; font-weight: 600; font-stretch: 100%; color: var(--ink-2); }
.gen { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; font-variant-numeric: tabular-nums; table-layout: fixed; }
.gen th, .gen td { padding: 10px 14px; }
.gen thead th { font-size: 13px; font-weight: 700; color: var(--ink-2); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gen thead th:first-child { width: 44%; }
.gen tbody th { text-align: left; font-weight: 500; color: var(--ink-2); font-size: 15px; }
.gen td { text-align: right; font-weight: 700; font-size: 16px; }
.gen tbody tr > * { border-top: 1px solid var(--ground); }

/* ---------- Pedigree ---------- */
.ped-dialog { width: min(96vw, 760px); max-height: 96vh; padding: 0; border: 0; border-radius: 12px; background: var(--paper); color: var(--ink); overflow: auto; }
.ped-dialog:focus { outline: none; }
.ped-dialog::backdrop { background: rgb(15 30 24 / .72); }
.ped-head { position: sticky; top: 0; display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; background: var(--pitch); color: #FFFFFF; --focus: #FFFFFF; }
.ped-head h2 { flex: 1; min-width: 0; font-size: 19px; font-stretch: 80%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ped-icon { flex: none; display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 8px; background: transparent; cursor: pointer; color: #FFFFFF; }
.ped-icon:hover { background: rgb(255 255 255 / .12); }
.ped-share svg { width: 24px; height: 24px; }
.ped-close { font-size: 34px; line-height: 1; font-weight: 400; }
.ped-dialog img { display: block; width: 100%; height: auto; background: #FFFFFF; }

/* ---------- Listas de caballos por torneo ---------- */
.search { position: relative; display: block; }
.search svg { position: absolute; left: 15px; top: 50%; width: 20px; height: 20px; margin-top: -10px; color: var(--ink-2); pointer-events: none; }
.lp-search {
  width: 100%; min-height: 46px; padding: 0 16px 0 44px; font: inherit; font-size: 16px; color: var(--ink);
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 999px; -webkit-appearance: none; appearance: none;
}
.lp-search::placeholder { color: var(--ink-2); opacity: 1; }
.lp-search:focus { outline: none; border-color: var(--pitch); }
.lp-team { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.lp-team-name { display: flex; gap: 10px; align-items: stretch; font-size: 22px; font-stretch: 82%; line-height: 1.05; padding-top: 4px; }
.lp-team-name::before { content: ""; flex: none; width: 6px; border-radius: 4px; background: var(--team, var(--line)); box-shadow: inset 0 0 0 1.5px rgb(0 0 0 / .2); }
.lp-player { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.lp-player > h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px 8px; border-bottom: 2px solid var(--ground); font-size: 19px; font-stretch: 85%; line-height: 1.15; }
.lp-badge { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: 4px; background: var(--ground); color: var(--ink); font-size: 13px; font-weight: 700; font-stretch: 100%; }
.lp-block { display: grid; gap: 2px; padding: 10px 14px 6px; }
.lp-block + .lp-block { border-top: 2px solid var(--ground); }
.lp-used { background: #F5F8F4; }
.lp-block h4 { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.count { display: inline-grid; place-items: center; min-width: 24px; height: 20px; padding: 0 7px; border-radius: 999px; background: var(--pitch); color: #FFFFFF; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.lp-horses { list-style: none; margin: 0; padding: 0; }
.lp-horses li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 10px; min-height: 46px; padding: 6px 0; }
.lp-horses li + li { border-top: 1px solid var(--ground); }
.lp-used .lp-horses li + li { border-top-color: #E4EBE3; }
.lp-name { min-width: 0; font-size: 16.5px; font-weight: 700; font-stretch: 92%; line-height: 1.25; overflow-wrap: anywhere; }
.lp-name .who { display: block; font-size: 13.5px; font-weight: 500; font-stretch: 100%; color: var(--ink-2); }
.lp-horses li.unused .hname { color: var(--ink-2); font-weight: 600; }
.lp-horses small { flex: none; margin-left: auto; font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.lp-n {
  flex: none; display: inline-flex; align-items: center; gap: 2px; min-height: 44px; margin: -6px 0 -6px auto; padding: 0 2px 0 10px;
  border: 0; background: transparent; cursor: pointer; font-size: 14px; font-weight: 700; color: var(--pitch); font-variant-numeric: tabular-nums;
}
.lp-n svg { width: 18px; height: 18px; transition: transform .15s; }
.lp-n[aria-expanded="true"] svg { transform: rotate(180deg); }
.lp-matches { flex-basis: 100%; display: grid; gap: 2px; margin: 6px 0 4px; padding: 4px; background: var(--ground); border-radius: 8px; }
.lp-matches a { display: grid; gap: 1px; padding: 10px 12px; border-radius: 6px; }
.lp-matches a:hover { background: var(--paper); }
.lp-matches b { font-size: 15px; font-weight: 700; }
.lp-matches small { font-size: 13px; color: var(--ink-2); }
.lp-teams .team-dot { width: 11px; height: 11px; }

/* ---------- Pie: Polo Breeders, sponsor oficial ---------- */
.pie { background: var(--pitch); color: #FFFFFF; }
.pie-in { max-width: var(--w); margin: 0 auto; display: flex; align-items: center; gap: 14px; padding: 20px 16px; }
.pie-logo { width: 52px; height: 52px; flex: none; border-radius: 50%; }
.pie-words { display: grid; gap: 1px; min-width: 0; }
.pie-kicker { font-size: 13px; font-weight: 600; color: var(--sage); }
.pie-name { font-size: 21px; font-weight: 800; font-stretch: 80%; line-height: 1.1; }
.pie-line { font-size: 14px; color: var(--sage-2); }
a.pie-in:hover .pie-name { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Barra de secciones ---------- */
.tabs { position: sticky; bottom: 0; z-index: 2; background: var(--paper); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
.tabs-in { max-width: var(--w); margin: 0 auto; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.tabs a { position: relative; display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 56px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.tabs a svg, .tab-ico, .tab-live { width: 22px; height: 22px; }
.tab-ico { background: currentColor; -webkit-mask: url("logos/polo_breeders_interno.png") center / contain no-repeat; mask: url("logos/polo_breeders_interno.png") center / contain no-repeat; }
.tab-live { display: grid; place-items: center; color: var(--live); }
.tab-live::after { width: 11px; height: 11px; box-shadow: 0 0 0 4px rgb(211 36 27 / .2); }
.tabs a[aria-current="page"] { color: var(--pitch); font-weight: 700; }
.tabs a[aria-current="page"]::before { content: ""; position: absolute; top: -2px; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--pitch); }

/* ---------- cancha.<dominio> (templates/cancha/): los caballos con su RP y el buscador ---------- */
.cancha-sec { font-size: 15px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; padding-top: 12px; }
.cancha-live { color: var(--live); }
.cancha-head { display: grid; gap: 2px; }
.cancha-tour { font-size: 14px; color: var(--ink-2); }
.cancha-title { font-size: 22px; font-stretch: 85%; line-height: 1.15; }
.cancha-title span { font-weight: 500; color: var(--ink-2); }
/* El buscador queda arriba al bajar por la lista. */
.cancha-search { position: sticky; top: 0; z-index: 2; margin-inline: -16px; padding: 8px 16px; background: var(--ground); }
.cancha-search input {
  width: 100%; min-height: 50px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 10px;
  background: var(--paper); color: var(--ink); font: inherit; font-size: 18px; font-weight: 600;
}
.cancha-search input:focus { outline: none; border-color: var(--pitch); box-shadow: 0 0 0 3px rgb(53 76 68 / .2); }
.horse.cancha-horse { grid-template-columns: 28px minmax(0, 1fr) auto; }
.horses.subs .horse.cancha-horse { grid-template-columns: minmax(0, 1fr) auto; }
.rp { align-self: start; padding: 3px 0 0 8px; font-size: 17px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rp small { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.rp.none { font-size: 13px; font-weight: 500; color: var(--ink-2); padding-top: 5px; }
