/* argedrez24 — estilo */
:root { --fondo: #f6f4ef; --superficie: #fff; --texto: #1f1d1a; --tenue: #75706a; --borde: #e6e1d8; --primario: #2f6f4f;
  --oro: #c99a18; --ganan: #f4f2ec; --tablas: #a8a39a; --pierden: #36332e; --radio: 14px; --velo: rgba(255, 255, 255, .82); }
:root[data-theme="oscuro"] { --fondo: #171614; --superficie: #211f1c; --texto: #ece8e1; --tenue: #a39d94; --borde: #34312c; --primario: #5fae84;
  --ganan: #e9e5dc; --tablas: #8c877e; --pierden: #4a4640; --velo: rgba(33, 31, 28, .85); color-scheme: dark; }
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--fondo); color: var(--texto); }
a { color: var(--primario); }
h1 { font-size: 1.6rem; margin: .4rem 0; } h2 { font-size: 1.1rem; margin: 0; } h3 { margin: .2rem 0; font-size: 1.15rem; } h4 { margin: 1rem 0 .4rem; font-size: .95rem; }
.tenue { color: var(--tenue); } .pequeno { font-size: .85rem; } .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.contenedor { max-width: 1200px; margin: 0 auto; padding: 1rem 16px 6rem; } .estrecho { max-width: 560px; }
button { font: inherit; cursor: pointer; }

/* cabecera */
.cabecera { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem 16px; background: var(--superficie);
  border-bottom: 1px solid var(--borde); position: sticky; top: 0; z-index: 20; flex-wrap: wrap; }
.logo { text-decoration: none; color: var(--texto); font-size: 1.25rem; }
.cabecera nav { display: flex; gap: .3rem; flex-wrap: wrap; }
.cabecera nav a { text-decoration: none; color: var(--texto); padding: .35rem .7rem; border-radius: 999px; }
.cabecera nav a.activo, .cabecera nav a:hover { background: var(--fondo); }
.sello-premium { color: var(--oro); font-weight: 700; padding: .35rem .7rem; }
.b-tema { border: 1px solid var(--borde); background: var(--fondo); color: var(--texto); border-radius: 999px; width: 36px; height: 36px; cursor: pointer; font-size: 1rem; }
#sel-idioma { font: inherit; font-size: .88rem; padding: .3rem .4rem; border-radius: 10px; border: 1px solid var(--borde); background: var(--fondo); color: var(--texto); max-width: 150px; }
.cabecera nav { align-items: center; }
[dir=rtl] .partida-jug span:nth-child(3) { text-align: left; }

/* árbol */
.arbol { display: grid; grid-template-columns: minmax(280px, 520px) 1fr; gap: 1.2rem; align-items: start; }
@media (max-width: 860px) { .arbol { grid-template-columns: 1fr; } }
.tablero { width: 100%; aspect-ratio: 1; border-radius: 8px; overflow: hidden; }
.botones { display: flex; gap: .4rem; margin: .6rem 0; }
.botones button { flex: 1; padding: .5rem; border: 1px solid var(--borde); border-radius: 10px; background: var(--superficie); color: var(--texto); font-size: 1.05rem; }
.historial { font-size: .9rem; line-height: 1.8; } .historial span { margin-right: .15rem; }
.panel { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); padding: .9rem 1rem; margin-bottom: 1rem; }
.panel-cab { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; margin-bottom: .5rem; flex-wrap: wrap; }
.pie-panel { margin: .5rem 0 0; font-size: .82rem; }
.tabla-jugadas, .tabla-jugadores, .tabla-ficha { width: 100%; border-collapse: collapse; }
.tabla-jugadas th, .tabla-jugadores th { text-align: start; font-size: .78rem; color: var(--tenue); font-weight: 600; padding: .2rem .4rem; }
.tabla-jugadas td, .tabla-jugadores td { padding: .35rem .4rem; border-top: 1px solid var(--borde); }
.tabla-jugadas tr[data-uci], .tabla-jugadores tr[data-slug] { cursor: pointer; } .tabla-jugadas tr[data-uci]:hover, .tabla-jugadores tr[data-slug]:hover { background: var(--fondo); }
.tabla-jugadas th.num, .tabla-jugadores th.num { text-align: right; }
.tabla-jugadas td.san { font-weight: 700; width: 4.5rem; } .tabla-jugadas td.num small { display: block; color: var(--tenue); font-size: .72rem; }
.barra-res { display: flex; height: 18px; border-radius: 5px; overflow: hidden; font-size: .68rem; line-height: 18px; min-width: 120px; border: 1px solid var(--borde); }
.barra-res span { text-align: center; overflow: hidden; white-space: nowrap; }
.barra-res .g { background: var(--ganan); color: #222; } .barra-res .t { background: var(--tablas); color: #fff; } .barra-res .p { background: var(--pierden); color: #fff; }
.carga { padding: .8rem 1rem; background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); margin-bottom: 1rem; }
.barra-carga { height: 6px; background: var(--borde); border-radius: 99px; margin-top: .5rem; overflow: hidden; }
.barra-carga span { display: block; height: 100%; width: 0; background: var(--primario); transition: width .2s; }
.lista-partidas { list-style: none; margin: 0; padding: 0; }
.lista-partidas li { display: flex; gap: .4rem; border-top: 1px solid var(--borde); padding: .3rem 0; }
.partida-jug { flex: 1; min-width: 0; font: inherit; overflow-wrap: anywhere; display: grid; grid-template-columns: 1fr auto 1fr; gap: .2rem .5rem; text-align: left; background: none; border: 0; color: var(--texto); padding: .3rem; border-radius: 8px; }
.partida-jug:hover { background: var(--fondo); } .partida-jug .res { font-weight: 700; } .partida-jug span:nth-child(3) { text-align: right; }
.partida-jug small { grid-column: 1 / -1; }
.btn-pgn { border: 1px solid var(--borde); background: var(--superficie); color: var(--texto); border-radius: 8px; font-size: .78rem; padding: 0 .55rem; white-space: nowrap; }

/* fichas de jugadores */
.zona-fichas { margin-top: 1.5rem; scroll-margin-top: 70px; }
.fichas-titulo { margin-bottom: .8rem; font-size: 1.15rem; }
.fichas { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 760px) { .fichas { grid-template-columns: 1fr; } }
.ficha { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); padding: 1rem; overflow: hidden; }
.ficha-sola { margin-bottom: 1rem; scroll-margin-top: 70px; }
.chip-color { display: inline-block; font-size: .75rem; font-weight: 700; padding: .1rem .6rem; border-radius: 999px; border: 1px solid var(--borde); }
.chip-color.negras { background: #2b2925; color: #fff; }
.chip-oro { background: var(--oro); color: #fff; font-size: .72rem; font-weight: 800; padding: .05rem .4rem; border-radius: 6px; vertical-align: 2px; }
.ficha-cab h3 a { color: var(--texto); text-decoration: none; }
.elos { display: flex; gap: 1.2rem; margin: .4rem 0; } .elos b { display: block; font-size: 1.35rem; } .elos small, .dato small { color: var(--tenue); font-size: .75rem; }
.ficha-resumen { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin: .6rem 0; }
.dato b { display: block; font-size: 1.15rem; }
.tabla-ficha td { padding: .25rem .2rem; vertical-align: top; } .tabla-ficha td:first-child { width: 42%; font-size: .9rem; }
.anios { display: flex; align-items: flex-end; gap: 4px; height: 70px; } .anios span { flex: 1; background: var(--primario); border-radius: 3px 3px 0 0; opacity: .8; }
.anios-eje { display: flex; justify-content: space-between; font-size: .75rem; color: var(--tenue); }
.lista-ficha { margin: 0; padding-left: 1.1rem; }

/* zona Premium: se va desenfocando al bajar */
.zona-premium { position: relative; --desenfoque: 0px; }
.zona-premium:not(.abierta) .contenido-premium { filter: blur(max(3px, var(--desenfoque))); user-select: none; pointer-events: none; transition: filter .15s; }
.velo { position: absolute; left: 0; right: 0; bottom: 0; top: 1.5rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem;
  text-align: center; padding: 1rem; background: linear-gradient(to bottom, transparent, var(--velo) 30%); }
.velo > span { color: var(--tenue); font-size: .9rem; max-width: 30ch; }
.boton-premium { display: inline-block; background: linear-gradient(135deg, #e0b324, #c48a0e); color: #1d1500; font-weight: 800; text-decoration: none;
  padding: .7rem 1.2rem; border-radius: 999px; border: 0; box-shadow: 0 4px 14px rgba(200, 140, 10, .35); }
.boton-premium.grande { display: block; width: 100%; text-align: center; font-size: 1.05rem; padding: .9rem 1.2rem; }
.barra-premium { position: fixed; left: 50%; bottom: 14px; transform: translate(-50%, 140%); z-index: 30; display: flex; gap: .8rem; align-items: center;
  background: var(--superficie); border: 1px solid var(--borde); border-radius: 999px; padding: .4rem .4rem .4rem 1rem; box-shadow: 0 8px 30px rgba(0,0,0,.18);
  transition: transform .3s; max-width: calc(100% - 32px); }
.barra-premium.visible { transform: translate(-50%, 0); }
@media (max-width: 560px) { .barra-premium > span { display: none; } }

/* jugadores */
.buscador { width: 100%; font: inherit; font-size: 1.05rem; padding: .8rem 1rem; border-radius: var(--radio); border: 1px solid var(--borde); background: var(--superficie); color: var(--texto); }
.tabla-scroll { overflow-x: auto; }
#zona-lista .velo { top: 0; position: absolute; }
#zona-lista { min-height: 220px; }

/* premium / entrar */
.plan { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); padding: 1.4rem; text-align: center; margin-top: 1rem; }
.precio b { font-size: 2.4rem; } .ventajas { text-align: left; list-style: none; padding: 0; line-height: 1.9; }
.ok { color: var(--primario); font-weight: 700; } .error { color: #c62828; min-height: 1.2em; } :root[data-theme="oscuro"] .error { color: #ff7b72; }
.pestanas { display: flex; gap: .4rem; margin: 1rem 0 .6rem; }
.pestanas button { flex: 1; padding: .6rem; border-radius: 10px; border: 1px solid var(--borde); background: var(--superficie); color: var(--texto); }
.pestanas button.activo { background: var(--primario); color: #fff; border-color: var(--primario); }
.formulario label { display: block; margin-bottom: .7rem; font-weight: 600; }
.formulario input { display: block; width: 100%; margin-top: .25rem; font: inherit; padding: .6rem .7rem; border-radius: 10px; border: 1px solid var(--borde); background: var(--fondo); color: var(--texto); }
.aviso { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); background: var(--texto); color: var(--fondo); padding: .6rem 1rem; border-radius: 10px; z-index: 60; max-width: calc(100% - 32px); }
.tabla-jugadores a.enlace-jugador { color: var(--texto); text-decoration: none; }

/* tablero: casillas clásicas (chessground no trae imagen de tablero) */
cg-board { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%208%208%22%20shape-rendering%3D%22crispEdges%22%3E%3Crect%20width%3D%228%22%20height%3D%228%22%20fill%3D%22%23f0d9b5%22/%3E%3Crect%20x%3D%221%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%23b58863%22/%3E%3Crect%20x%3D%223%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%23b58863%22/%3E%3Crect%20x%3D%225%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%23b58863%22/%3E%3Crect%20x%3D%227%22%20y%3D%220%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%23b58863%22/%3E%3Crect%20x%3D%220%22%20y%3D%221%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%23b58863%22/%3E%3Crect%20x%3D%222%22%20y%3D%221%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%23b58863%22/%3E%3Crect%20x%3D%224%22%20y%3D%221%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%23b58863%22/%3E%3Crect%20x%3D%226%22%20y%3D%221%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%23b58863%22/%3E%3Crect%20x%3D%221%22%20y%3D%222%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%23b58863%22/%3E%3Crect%20x%3D%223%22%20y%3D%222%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%23b58863%22/%3E%3Crect%20x%3D%225%22%20y%3D%222%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%23b58863%22/%3E%3Crect%20x%3D%227%22%20y%3D%222%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%23b58863%22/%3E%3Crect%20x%3D%220%22%20y%3D%223%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%23b58863%22/%3E%3Crect%20x%3D%222%22%20y%3D%223%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%23b58863%22/%3E%3Crect%20x%3D%224%22%20y%3D%223%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%23b58863%22/%3E%3Crect%20x%3D%226%22%20y%3D%223%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%23b58863%22/%3E%3Crect%20x%3D%221%22%20y%3D%224%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%23b58863%22/%3E%3Crect%20x%3D%223%22%20y%3D%224%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%23b58863%22/%3E%3Crect%20x%3D%225%22%20y%3D%224%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%23b58863%22/%3E%3Crect%20x%3D%227%22%20y%3D%224%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%23b58863%22/%3E%3Crect%20x%3D%220%22%20y%3D%225%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%23b58863%22/%3E%3Crect%20x%3D%222%22%20y%3D%225%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%23b58863%22/%3E%3Crect%20x%3D%224%22%20y%3D%225%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%23b58863%22/%3E%3Crect%20x%3D%226%22%20y%3D%225%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%23b58863%22/%3E%3Crect%20x%3D%221%22%20y%3D%226%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%23b58863%22/%3E%3Crect%20x%3D%223%22%20y%3D%226%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%23b58863%22/%3E%3Crect%20x%3D%225%22%20y%3D%226%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%23b58863%22/%3E%3Crect%20x%3D%227%22%20y%3D%226%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%23b58863%22/%3E%3Crect%20x%3D%220%22%20y%3D%227%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%23b58863%22/%3E%3Crect%20x%3D%222%22%20y%3D%227%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%23b58863%22/%3E%3Crect%20x%3D%224%22%20y%3D%227%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%23b58863%22/%3E%3Crect%20x%3D%226%22%20y%3D%227%22%20width%3D%221%22%20height%3D%221%22%20fill%3D%22%23b58863%22/%3E%3C/svg%3E"); background-size: cover; }
.cg-wrap coords { color: #7a5c3e; font-weight: 700; } .cg-wrap coords.ranks coord:nth-child(odd), .cg-wrap coords.files coord:nth-child(even) { color: #f0d9b5; }
cg-board square.last-move { background-color: rgba(155, 199, 0, .41); } cg-board square.move-dest { background: radial-gradient(rgba(20, 85, 30, .5) 22%, transparent 0); }
cg-board square.oc.move-dest { background: radial-gradient(transparent 0%, transparent 80%, rgba(20, 85, 0, .3) 80%); } cg-board square.selected { background-color: rgba(20, 85, 30, .5); }
cg-board square.check { background: radial-gradient(ellipse at center, rgba(255, 0, 0, 1) 0%, rgba(231, 0, 0, 1) 25%, rgba(169, 0, 0, 0) 89%, rgba(158, 0, 0, 0) 100%); }

/* navegadores sin aspect-ratio (Safari 14, Chrome < 88): tablero cuadrado igualmente */
@supports not (aspect-ratio: 1 / 1) { .tablero { height: 0; padding-bottom: 100%; } }
/* aviso para navegadores demasiado antiguos (Internet Explorer, Chrome < 85…) */
.aviso-viejo { background: #b3261e; color: #fff; padding: .8rem 16px; text-align: center; font-weight: 600; }
.aviso-viejo a { color: #fff; }

/* móvil: la cabecera ocupa dos filas → no fija, para no quitar pantalla al bajar */
@media (max-width: 560px) { .cabecera { position: static; } }

/* Partidas vistas (columna izquierda del Árbol) + análisis */
.panel-vistas { margin-top: 1rem; }
.lista-vistas { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow: auto; }
.lista-vistas li { display: flex; justify-content: space-between; gap: .5rem; align-items: center; padding: .35rem 0; border-top: 1px solid var(--borde); cursor: pointer; font-size: .9rem; }
.lista-vistas li:hover { background: var(--fondo); }
.lista-vistas .v-ok { color: var(--primario); font-weight: 700; white-space: nowrap; } .lista-vistas .v-proc { color: var(--oro); }
#analisis { margin-top: 1.2rem; }

/* ---- ajustes ---- */
[hidden] { display: none !important; }
button:disabled { opacity: .6; cursor: default; }
:focus-visible { outline: 2px solid var(--primario); outline-offset: 2px; }
.chip-color { margin-bottom: .3rem; background: #fff; color: #222; }
.pestanas button, .botones button, .btn-pgn { cursor: pointer; } .botones button:hover, .btn-pgn:hover { background: var(--fondo); }
.fichas:empty, .fichas-titulo:empty { display: none; }

/* lista de jugadores: las dos tablas (clara y Premium) con las mismas columnas */
.tabla-jugadores { table-layout: fixed; }
.tabla-jugadores th:nth-child(1), .tabla-jugadores td:nth-child(1) { width: 3rem; }
.tabla-jugadores th:nth-child(3), .tabla-jugadores td:nth-child(3) { width: 4.5rem; }
.tabla-jugadores th:nth-child(4), .tabla-jugadores td:nth-child(4) { width: 4.5rem; }
.tabla-jugadores th:nth-child(5), .tabla-jugadores td:nth-child(5) { width: 5.5rem; }
.tabla-jugadores th:nth-child(6), .tabla-jugadores td:nth-child(6) { width: 32%; }
.tabla-jugadores td:nth-child(2) { overflow-wrap: anywhere; }
.tabla-jugadores .barra-res { min-width: 0; }
.tabla-jugadores td { vertical-align: middle; }
@media (max-width: 620px) {
  .tabla-jugadores th:nth-child(1), .tabla-jugadores td:nth-child(1), .tabla-jugadores th:nth-child(3), .tabla-jugadores td:nth-child(3) { display: none; }
  .tabla-jugadores th:nth-child(4), .tabla-jugadores td:nth-child(4) { width: 3.2rem; }
  .tabla-jugadores th:nth-child(5), .tabla-jugadores td:nth-child(5) { width: 3.6rem; }
  .tabla-jugadores th:nth-child(6), .tabla-jugadores td:nth-child(6) { width: 30%; }
  .tabla-jugadores th, .tabla-jugadores td { padding-left: .25rem; padding-right: .25rem; }
  .tabla-jugadas td.san { width: 3.4rem; } .tabla-jugadas .barra-res { min-width: 90px; }
  .panel { padding: .8rem .7rem; }
  .ficha-resumen { gap: .4rem; } .elos { gap: .9rem; flex-wrap: wrap; }
  .barra-premium { padding: .3rem; } .barra-premium .boton-premium { padding: .55rem 1rem; font-size: .9rem; white-space: nowrap; }
}

/* panel del análisis del motor (sus colores día / noche los pone analisis.min.js): a todo el ancho */
main .a24-panel, .visor .a24-panel { max-width: none; border-radius: var(--radio); font-size: 15px; }

/* visor de una partida (pop-up): tablero, jugadas completas, descarga y análisis */
body.visor-abierto { overflow: hidden; }
.visor-fondo { position: fixed; inset: 0; top: 0; left: 0; right: 0; bottom: 0; z-index: 50; background: rgba(0, 0, 0, .55); display: flex; align-items: flex-start; justify-content: center;
  padding: 1rem; overflow-y: auto; }
.visor { background: var(--fondo); color: var(--texto); border: 1px solid var(--borde); border-radius: var(--radio); width: 100%; max-width: 960px; margin: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.visor-cab { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: .9rem 1rem; border-bottom: 1px solid var(--borde);
  background: var(--superficie); border-radius: var(--radio) var(--radio) 0 0; }
.visor-cab h2 { font-size: 1.1rem; overflow-wrap: anywhere; } .visor-cab p { margin: .15rem 0 0; font-size: .88rem; }
.visor-x { flex: none; width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--borde); background: var(--fondo); color: var(--texto); font-size: 1.1rem; }
.visor-x:hover { background: var(--borde); }
.visor-cuerpo { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 1rem; padding: 1rem; }
.visor-lado { display: flex; flex-direction: column; gap: .7rem; min-height: 0; }
.visor-jugadas { flex: 1 1 0; min-height: 180px; overflow-y: auto; background: var(--superficie); border: 1px solid var(--borde); border-radius: 10px; padding: .6rem .7rem;
  line-height: 1.9; font-size: .95rem; position: relative; }
.visor-jugadas b { color: var(--tenue); font-weight: 600; margin-left: .25rem; }
.visor-jugadas .mv { cursor: pointer; padding: .1rem .3rem; border-radius: 6px; white-space: nowrap; }
.visor-jugadas .mv:hover { background: var(--fondo); }
.visor-jugadas .mv.actual { background: var(--primario); color: #fff; }
.visor-jugadas .res { font-weight: 700; margin-left: .4rem; }
.visor-descargar { display: block; width: 100%; text-align: center; }
.visor-analisis { padding: 0 1rem 1rem; }
.visor .botones { margin-bottom: 0; }
@media (max-width: 760px) {
  .visor-fondo { padding: 0; } .visor { border-radius: 0; border: 0; min-height: 100%; } .visor-cab { border-radius: 0; position: sticky; top: 0; z-index: 2; }
  .visor-cuerpo { grid-template-columns: minmax(0, 1fr); padding: .7rem; } .visor-jugadas { flex: none; max-height: 190px; min-height: 0; }
  .visor-analisis { padding: 0 .7rem .7rem; }
}

/* colores del tablero (🎨): cada «skin» cambia las casillas claras y oscuras; se guarda en el navegador */
:root { --cas-c: #f0d9b5; --cas-o: #b58863; }
:root[data-tablero="verde"] { --cas-c: #eeeed2; --cas-o: #769656; }
:root[data-tablero="azul"] { --cas-c: #dee3e6; --cas-o: #8ca2ad; }
:root[data-tablero="gris"] { --cas-c: #e4e4e4; --cas-o: #8f8f8f; }
:root[data-tablero="morado"] { --cas-c: #e9e0f3; --cas-o: #8e6bb0; }
:root[data-tablero="rosa"] { --cas-c: #fbe4ea; --cas-o: #d5778f; }
:root[data-tablero="oceano"] { --cas-c: #cfe7f5; --cas-o: #3f7fb0; }
:root[data-tablero="bosque"] { --cas-c: #e3e8c8; --cas-o: #4f7a4a; }
:root[data-tablero="arena"] { --cas-c: #f6ecd2; --cas-o: #d0a15c; }
:root[data-tablero="nogal"] { --cas-c: #dcc3a0; --cas-o: #7a4f33; }
:root[data-tablero="noche"] { --cas-c: #8b93a1; --cas-o: #3d4656; }
:root[data-tablero="coral"] { --cas-c: #fde6d8; --cas-o: #e07b5d; }
@supports (background: conic-gradient(red, blue)) {
  cg-board { background-image: conic-gradient(var(--cas-o) 25%, var(--cas-c) 0 50%, var(--cas-o) 0 75%, var(--cas-c) 0); background-size: 25% 25%; }
  .cg-wrap coords { color: var(--cas-o); } .cg-wrap coords.ranks coord:nth-child(odd), .cg-wrap coords.files coord:nth-child(even) { color: var(--cas-c); }
}
.botones { position: relative; flex-wrap: wrap; } .botones button { min-width: 44px; }
.menu-colores { position: absolute; z-index: 45; left: 0; right: 0; top: calc(100% + 6px); background: var(--superficie); border: 1px solid var(--borde); border-radius: 12px;
  padding: .6rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: .45rem; }
.botones .menu-colores button { flex: none; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: .4rem .3rem; font-size: .78rem;
  border: 2px solid transparent; border-radius: 10px; background: none; color: var(--texto); }
.botones .menu-colores button:hover { background: var(--fondo); } .botones .menu-colores button.activo { border-color: var(--primario); }
.menu-colores i { display: block; width: 44px; height: 44px; border-radius: 6px; border: 1px solid var(--borde);
  background: conic-gradient(var(--o) 25%, var(--c) 0 50%, var(--o) 0 75%, var(--c) 0); background-size: 100% 100%; background-color: var(--o); }

/* partidas más vistas */
.ayudando { display: flex; flex-wrap: wrap; gap: .6rem; margin: .8rem 0 1rem; }
.ayudando > div { flex: 1 1 140px; background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); padding: .7rem .9rem; }
.ayudando b { display: block; font-size: 1.4rem; } .ayudando > div > span { color: var(--tenue); font-size: .82rem; }
.punto-vivo { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; background: #2fb36d; margin-right: .35rem; box-shadow: 0 0 0 0 rgba(47, 179, 109, .6); animation: latir 2s infinite; }
@keyframes latir { 70% { box-shadow: 0 0 0 .5rem rgba(47, 179, 109, 0); } 100% { box-shadow: 0 0 0 0 rgba(47, 179, 109, 0); } }
.tabla-vistas { width: 100%; border-collapse: collapse; }
.tabla-vistas th { text-align: start; font-size: .78rem; color: var(--tenue); font-weight: 600; padding: .2rem .4rem; }
.tabla-vistas td { padding: .5rem .4rem; border-top: 1px solid var(--borde); vertical-align: middle; }
.tabla-vistas tr[data-game] { cursor: pointer; } .tabla-vistas tr[data-game]:hover { background: var(--fondo); }
.tabla-vistas .partida b { overflow-wrap: anywhere; }
.estado-an { white-space: nowrap; font-size: .88rem; } .estado-an.listo { color: var(--primario); font-weight: 700; } .estado-an.proc { color: var(--oro); font-weight: 600; }
.mini-barra { display: block; height: 4px; border-radius: 99px; background: var(--borde); margin-top: .25rem; overflow: hidden; min-width: 60px; }
.mini-barra i { display: block; height: 100%; background: var(--oro); }
@media (max-width: 620px) { .tabla-vistas .col-vistas, .tabla-vistas th:first-child, .tabla-vistas td:first-child { display: none; } }

/* Franjas de Elo del Árbol (Todos · 2200–2400 · …) junto a «🌳 Jugadas» */
.franjas[hidden] { display: none; }
.franjas { display: flex; flex-wrap: wrap; gap: .3rem; margin-right: auto; }
.franja { border: 1px solid var(--borde); background: var(--superficie); color: var(--texto); border-radius: 999px; font-size: .76rem;
  font-weight: 600; padding: .15rem .6rem; cursor: pointer; font-variant-numeric: tabular-nums; line-height: 1.5; }
.franja:hover { border-color: var(--primario); }
.franja.activa { background: var(--primario); border-color: var(--primario); color: #fff; }

/* Banderas de federación y Elo de rápidas / blitz bajo el clásico */
.bandera { font-family: "Twemoji Country Flags", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.elos-fila { display: block; font-size: .72rem; color: var(--tenue); white-space: nowrap; font-weight: 400; }

/* ⬇ Descargar todas sus partidas (PGN) */
.btn-todas-pgn { display: block; width: 100%; margin: .6rem 0 .2rem; padding: .5rem .8rem; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--borde); background: var(--superficie); color: var(--texto); font-weight: 600; text-align: center; }
.btn-todas-pgn:hover { border-color: var(--primario); }
.btn-todas-pgn small { color: var(--primario); font-weight: 700; margin-left: .3rem; }
.btn-todas-pgn:disabled { opacity: .6; cursor: default; }

/* Ventana «🔒 Solo para Premium» */
.modal-premium { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .55); display: flex; align-items: center;
  justify-content: center; padding: 16px; }
.modal-caja { position: relative; background: var(--superficie); color: var(--texto); border: 1px solid var(--borde); border-radius: 16px;
  padding: 1.4rem 1.3rem 1.1rem; max-width: 420px; width: 100%; text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.modal-caja h3 { margin: 0 0 .5rem; font-size: 1.25rem; }
.modal-caja p { margin: .4rem 0 .9rem; }
.modal-caja .boton-premium { display: inline-block; }
.modal-cerrar { position: absolute; top: .5rem; right: .6rem; border: 0; background: none; color: var(--tenue); font-size: 1.1rem;
  cursor: pointer; padding: .2rem .4rem; border-radius: 8px; }
.modal-cerrar:hover { color: var(--texto); }
