:root { --tinta: #1d2a33; --suave: #5b6770; --linea: #e2e6e9; --verde: #1f5e4f; --fondo: #ffffff; --panel: #f5f7f8; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--fondo); color: var(--tinta); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.top { background: var(--verde); padding: 10px 16px; }
.top a { color: #fff; text-decoration: none; font-weight: 700; letter-spacing: .03em; }
/* Ancho completo: en escritorio las tablas de hasta ~25 rondas caben sin desplazarse;
   el texto corrido conserva una medida cómoda de lectura. */
main { max-width: none; margin: 0 auto; padding: 16px 24px; }
main > p, main section > p, main section > ul, .migas, .indice, .filtro, .marco-aviso { max-width: 1100px; }
.migas { font-size: 13px; color: var(--suave); margin-bottom: 6px; }
.migas a { color: var(--verde); text-decoration: none; }
h1 { margin: 6px 0 2px; font-size: 26px; }
h2 { margin: 28px 0 8px; font-size: 19px; color: var(--verde); }
h3 { margin: 18px 0 6px; font-size: 16px; }
.sub { margin: 0 0 8px; color: var(--suave); }
.scroll, .gr-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.clas { border-collapse: collapse; font-variant-numeric: tabular-nums; min-width: 520px; }
.clas th, .clas td { padding: 6px 10px; border-bottom: 1px solid var(--linea); text-align: left; white-space: nowrap; }
.clas th { background: var(--panel); }
.clas .num { text-align: right; }
.clas tr.podio td { background: #f3f8f5; }
.nota { color: var(--suave); font-size: 14px; max-width: 75ch; }
.boton { display: inline-block; background: var(--verde); color: #fff; padding: 9px 16px; border-radius: 6px; text-decoration: none; font-weight: 600; }
.tarjetas { list-style: none; padding: 0; display: grid; gap: 10px; }
.tarjetas a { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--linea); border-radius: 8px; color: inherit; text-decoration: none; }
.tarjetas a:hover { border-color: var(--verde); }
.tarjetas span { color: var(--suave); font-size: 14px; }
/* Columna del jugador anclada: al deslizar una tabla ancha en el celular, el nombre no se pierde. */
.clas th:nth-child(-n+2), .clas td:nth-child(-n+2), .gr-table th:first-child, .gr-table td:first-child { position: sticky; z-index: 1; background-color: var(--fondo); }
.clas th:first-child, .clas td:first-child { left: 0; width: 2.6em; min-width: 2.6em; max-width: 2.6em; }
.clas th:nth-child(2), .clas td:nth-child(2) { left: 2.6em; box-shadow: 1px 0 0 var(--linea), 4px 0 6px -4px rgba(0,0,0,.18); }
.gr-table th:first-child, .gr-table td:first-child { left: 0; box-shadow: 1px 0 0 var(--linea), 4px 0 6px -4px rgba(0,0,0,.18); }
.clas th:nth-child(-n+2), .gr-table th:first-child { background-color: var(--panel); }
.clas tr.podio td:nth-child(-n+2) { background-color: #f3f8f5; }
.gr-table .gr-master td:first-child { background-color: #eef5f1; }
.gr-table .gr-rack td:first-child { background-color: #f4f1e6; }
.gr-table .gr-cat-total td:first-child { background-color: #eef2f5; }
@media (max-width: 600px) {
  main { padding: 12px; }
  h1 { font-size: 22px; }
  .clas th, .clas td { padding: 6px 7px; }
  .clas td:nth-child(2), .gr-table td:first-child { max-width: 42vw; overflow: hidden; text-overflow: ellipsis; }
}
/* Tablas interactivas (tablas.js): ordenar, resaltar fila y columna, seguir a un jugador, filtrar. */
th.ordenable { cursor: pointer; user-select: none; }
th.ordenable:hover { color: var(--verde); }
th[data-dir="desc"]::after { content: " ▼"; font-size: 10px; }
th[data-dir="asc"]::after { content: " ▲"; font-size: 10px; }
.clas td, .gr-table td { cursor: cell; }
tr.sel-fila > td, td.sel-col { box-shadow: inset 0 0 0 9999px rgba(255, 205, 60, .28) !important; }
tr.sel-fila > td.sel-col { box-shadow: inset 0 0 0 9999px rgba(255, 180, 0, .5) !important; }
tr.sel-jugador > td { box-shadow: inset 0 0 0 9999px rgba(31, 94, 79, .16) !important; font-weight: 700; }
.filtro { background: var(--fondo); padding: 8px 0; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; border-bottom: 1px solid var(--linea); }
.filtro input { flex: 1 1 220px; max-width: 360px; padding: 8px 10px; border: 1px solid var(--linea); border-radius: 6px; font: inherit; }
.filtro .cuenta { color: var(--suave); font-size: 14px; }
.filtro .ayuda { flex-basis: 100%; color: var(--suave); font-size: 12px; }
/* Inmovilizar paneles: una tabla más alta que la pantalla se desplaza dentro de su
   marco, con el encabezado y las filas del atril y del máster fijos arriba (tablas.js
   calcula su altura) y la columna del jugador fija a la izquierda. */
main .scroll, main .gr-scroll { overflow: auto; max-height: 85vh; border: 1px solid var(--linea); border-radius: 6px; width: fit-content; max-width: 100%; }
main .scroll.completa, main .gr-scroll.completa { max-height: none; }
@media (max-width: 600px) { main .scroll, main .gr-scroll { max-height: 65vh; } }
/* Descarga para DupMaster y selector de categorías (tablas.js). */
.descarga { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 10px 0; }
.descarga details { font-size: 14px; } .descarga summary { cursor: pointer; color: var(--verde); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; }
.chips button { font: inherit; font-size: 14px; padding: 6px 14px; border: 1px solid var(--verde); border-radius: 16px; background: var(--fondo); color: var(--verde); cursor: pointer; }
.chips button[aria-pressed="true"] { background: var(--verde); color: #fff; }
.vista > h2:first-child { margin-top: 6px; }
/* Pestañas del reporte detallado (tablas.js): una vista, una tabla. */
.pestanas { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 12px; border-bottom: 2px solid var(--verde); }
.pestanas button { font: inherit; font-weight: 600; padding: 8px 16px; border: 1px solid var(--linea); border-bottom: 0; border-radius: 8px 8px 0 0; background: var(--panel); color: var(--suave); cursor: pointer; }
.pestanas button[aria-selected="true"] { background: var(--verde); border-color: var(--verde); color: #fff; }
.vista > h3:first-child { margin-top: 4px; }
/* Tabla compactada por tablas.js para que quepan todas sus columnas. */
table.compacta { font-size: 12px; }
table.compacta th, table.compacta td { padding: 3px 5px; }
/* Aviso de las tablas que se deslizan por dentro (tablas.js), con «Ver completa». */
.marco-aviso { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; justify-content: space-between; font-size: 12px; color: var(--suave); margin: 4px 0; }
.marco-aviso button { font: inherit; font-size: 12px; padding: 4px 12px; border: 1px solid var(--verde); color: var(--verde); background: var(--fondo); border-radius: 14px; cursor: pointer; }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 12px 0 6px; }
.cta .nota { margin: 0; flex: 1 1 260px; }
.boton.grande { font-size: 16px; padding: 12px 18px; }
.clas thead th, .gr-table thead th { position: sticky; top: 0; z-index: 2; }
.clas thead th:nth-child(-n+2), .gr-table thead th:first-child { z-index: 4; }
tr.fijada > td { position: sticky; z-index: 2; }
tr.fijada > td:first-child { z-index: 3; }
tr.fijada:last-of-type > td, .gr-table tr.fijada + tr:not(.fijada) > td { border-top: 0; }
tr.fijada > td { box-shadow: 0 1px 0 var(--linea); }
.indice { font-size: 14px; color: var(--suave); margin: 4px 0 8px; line-height: 1.9; }
.indice a { color: var(--verde); text-decoration: none; white-space: nowrap; }
.enlace { font-size: 12px; font-weight: 400; color: var(--suave); text-decoration: none; margin-left: 6px; white-space: nowrap; }
.enlace:hover { color: var(--verde); }
[id] { scroll-margin-top: 12px; }
:target { animation: resalta 2s ease-out; }
@keyframes resalta { from { background: #fff3c4; } to { background: transparent; } }
footer { margin: 24px auto; padding: 0 24px; color: var(--suave); font-size: 13px; }
