:root {
  --navy: #0F1B2D;
  --bg: #E8EEF7;
  --text: #0F1B2D;
  --blue: #3B82F6;
  --amber: #F59E0B;
  --card: #ffffff;
  --muted: #5b6b82;
  --line: #d3dcea;
}
/* La web ya gestiona su tema claro/oscuro: se avisa al móvil para que no oscurezca por su cuenta el tablero ni las imágenes */
:root { color-scheme: light dark; }
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B1422;
    --text: #E8EEF7;
    --card: #14233a;
    --muted: #93a4bd;
    --line: #22344f;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: var(--blue); }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }

.site-header { position: sticky; top: 0; z-index: 10; background: var(--navy); }
.bar { display: flex; justify-content: space-between; align-items: center; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; }
.brand img { height: 46px; width: auto; display: block; }
.brand { color: #E8EEF7; font-weight: 600; font-size: 1.15rem; text-decoration: none; }
.site-header nav { display: flex; gap: 16px; flex-wrap: wrap; }
.site-header nav a { color: #E8EEF7; text-decoration: none; font-size: .95rem; opacity: .85; }
.site-header nav a:hover { opacity: 1; color: var(--amber); }

.hero { background: var(--navy); color: #E8EEF7; padding: 64px 0 72px; }
.hero-home { padding: 56px 0 64px; }
.hero-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; }
.hero-home h1 { font-size: clamp(1.9rem, 5vw, 3rem); line-height: 1.15; }
.hero-home h1 em { font-style: normal; color: var(--amber); }
.eyebrow { display: inline-block; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--blue); margin-bottom: 10px; font-weight: 600; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-outline { background: transparent; border: 1px solid #4a6288; color: #E8EEF7; }
.btn-outline:hover { background: rgba(255,255,255,.08); }
.board { display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr); aspect-ratio: 1; max-width: 380px; width: 100%; margin-left: auto; border-radius: 4px; overflow: hidden; border: 2px solid #3d4a2c; }
.board i { position: relative; display: block; font-style: normal; }
.board .l { background: #eeeed2; }
.board .d { background: #769656; }
.board i img { width: 100%; height: 100%; display: block; user-select: none; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: -28px; position: relative; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; text-align: center; }
.stat strong { display: block; font-size: 1.9rem; line-height: 1.1; color: var(--blue); }
.stat span { font-size: .85rem; color: var(--muted); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.section-head h2 { margin: 0; }
.dot { display: inline-block; width: 10px; height: 10px; background: #dc2626; border-radius: 50%; margin-right: 6px; }
.news-grid .featured { grid-column: span 2; }
.news-grid .featured img { height: 220px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.puzzle iframe { width: 100%; aspect-ratio: 10 / 11; border: 0; border-radius: 12px; background: #fff; }
.events li.next { border-color: var(--blue); }
.join { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; background: var(--navy); color: #E8EEF7; border-radius: 16px; padding: 28px; }
.join h2 { margin: 0 0 4px; }
.join p { margin: 0; opacity: .85; }
.av { width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #E8EEF7; font-size: .72rem; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; flex: none; }
.av img, .avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar { overflow: hidden; }
.jug { display: flex; align-items: center; gap: 10px; }
.flag { vertical-align: -2px; margin-right: 6px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(128, 128, 128, .35); }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); margin: 4px 0; }
.chk input { width: 16px; height: 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; margin: 14px 0 8px; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: .78rem; color: var(--muted); flex: 1 1 130px; max-width: 210px; }
.filters label[hidden] { display: none; }
.filters input, .filters select { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: .95rem; }
.filters .btn { border: 0; cursor: pointer; }
.pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin: 14px 0; }
.btn-ghost:disabled { opacity: .45; cursor: default; }
.elo-table td a { text-decoration: none; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-top: 10px; }
.theme { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; color: var(--text); text-decoration: none; font-weight: 500; }
.theme:hover { border-color: var(--blue); }
.theme .pc { width: 44px; height: 44px; border-radius: 8px; background: #769656; display: flex; align-items: center; justify-content: center; flex: none; }
.theme .pc img { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.search { display: flex; gap: 10px; margin: 16px 0 8px; flex-wrap: wrap; }
.search input { flex: 1 1 280px; padding: 10px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: 1rem; }
.search button { border: 0; cursor: pointer; }
.embed { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.embed iframe { display: block; width: 100%; height: 720px; border: 0; }
.panel[hidden] { display: none; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.elo-table { width: 100%; border-collapse: collapse; min-width: 560px; }
.elo-table th, .elo-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.elo-table tbody tr:last-child td { border-bottom: 0; }
.elo-table th { white-space: nowrap; font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.elo-table th small { display: block; text-transform: none; letter-spacing: 0; font-weight: 400; }
.elo-table .ac { text-align: center; width: 52px; }
.ojo { background: none; border: 0; color: var(--blue); cursor: pointer; padding: 5px 7px; border-radius: 8px; line-height: 0; }
.ojo:hover { background: rgba(59, 130, 246, .16); }
.ico-ojo { width: 20px; height: 20px; }
#stats-dlg { width: min(980px, 95vw); height: min(90vh, 920px); padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--text); overflow: hidden; }
#stats-dlg[open] { display: flex; flex-direction: column; }
#stats-dlg::backdrop { background: rgba(0, 0, 0, .62); }
.dlg-head { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); flex: none; }
.dlg-info { flex: 1; min-width: 0; }
.dlg-info h3 { margin: 0; font-size: 1.15rem; }
.dlg-head .av-lg, .av-lg { width: 60px; height: 60px; font-size: 1.05rem; }
.dlg-tabs { margin: 10px 16px 0; flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chips span { background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: .82rem; }
#stats-cargando { margin: 8px 16px 0; flex: none; }
#stats-frame { flex: 1; width: 100%; border: 0; background: #fff; margin-top: 8px; }
.ico-th { width: 17px; height: 17px; vertical-align: -4px; margin-right: 6px; }
.elo-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.elo-table .pos { width: 40px; color: var(--muted); font-weight: 600; }
.elo-table td.elo { color: var(--amber); font-weight: 700; font-size: 1.05rem; }
.hero-small { padding: 40px 0 44px; }
.site-header nav a[aria-current="page"] { color: var(--amber); opacity: 1; }
.hero h1 { font-size: clamp(2rem, 6vw, 3.2rem); margin: 0 0 8px; }
.hero p { font-size: 1.1rem; opacity: .85; margin: 0 0 24px; max-width: 520px; }
.btn { display: inline-block; background: var(--blue); color: #fff; padding: 10px 20px; border-radius: 8px; text-decoration: none; font-weight: 500; }
.btn:hover { background: #2563eb; }

.section { padding-top: 48px; }
.section h2 { margin: 0 0 16px; font-size: 1.5rem; }
.section h3 { margin: 28px 0 12px; font-size: 1.05rem; color: var(--muted); font-weight: 500; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.card img { width: 100%; height: 150px; object-fit: cover; background: var(--line); }
.card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card h4 { margin: 0; font-size: 1rem; line-height: 1.3; }
.card p { margin: 0; font-size: .9rem; color: var(--muted); }
.card .meta { font-size: .8rem; color: var(--muted); }
.card a.more { margin-top: auto; font-size: .9rem; font-weight: 500; text-decoration: none; }
.card a.more:hover { text-decoration: underline; }
.card a.stretch { color: inherit; text-decoration: none; }

.viewer { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 20px; }
.viewer-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.viewer-bar strong { flex: 1 1 200px; }
.viewer-bar select { flex: 2 1 240px; max-width: 100%; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.viewer iframe { width: 100%; height: 480px; border: 0; border-radius: 8px; background: #fff; }
.btn-ghost { background: none; border: 1px solid var(--line); color: var(--text); padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.btn-ghost:hover { border-color: var(--blue); }
.card button.more { margin-top: auto; align-self: flex-start; background: var(--blue); color: #fff; border: 0; padding: 7px 14px; border-radius: 8px; font-weight: 500; cursor: pointer; }
.card button.more:hover { background: #2563eb; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.ico { width: 18px; height: 18px; flex: none; display: block; }
.ico-flag { width: 22px; height: 15px; }
.tabs button, .search .btn { display: inline-flex; align-items: center; gap: 8px; }
.tabs button { background: var(--card); color: var(--text); border: 1px solid var(--line); padding: 6px 14px; border-radius: 999px; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.stream { position: relative; padding-top: 56.25%; background: #000; border-radius: 12px; overflow: hidden; }
.stream iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.small { font-size: .85rem; }
.badge { align-self: flex-start; font-size: .7rem; font-weight: 600; letter-spacing: .04em; padding: 2px 8px; border-radius: 4px; background: var(--blue); color: #fff; }
.badge.live { background: #dc2626; }
.badge.soon { background: var(--amber); color: #0F1B2D; }

.events { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.events li { display: flex; gap: 16px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.events a.stretch { color: inherit; text-decoration: none; }
.events a.stretch:hover { color: var(--blue); }
.events .date { min-width: 64px; text-align: center; font-weight: 600; color: var(--blue); line-height: 1.2; }
.events .date small { display: block; font-weight: 400; color: var(--muted); }

.player { text-align: center; padding: 20px 16px; }
.avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--navy); color: #E8EEF7; display: flex; align-items: center; justify-content: center; font-weight: 600; margin: 0 auto 10px; }
.player .elo { color: var(--amber); font-weight: 600; }

@media (max-width: 720px) {
  .hero-grid, .two-col { grid-template-columns: 1fr; }
  .board { margin: 0 auto; max-width: 300px; }
  .news-grid .featured { grid-column: auto; }
  .stats { gap: 8px; }
  .stat strong { font-size: 1.5rem; }
  .site-header nav { gap: 10px; }
}
.site-footer { margin-top: 64px; background: var(--navy); color: #E8EEF7; padding: 24px 0; font-size: .85rem; opacity: .9; }
.site-footer p { margin: 0; }

/* Entrenador de problemas (tactica.html) */
.ent-cats { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.ent-cats .cat { cursor: pointer; border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 999px; padding: 6px 14px; font-size: .95rem; }
.ent-cats .cat small { color: var(--muted); margin-left: 4px; font-size: .8rem; }
.ent-cats .cat[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.ent-cats .cat[aria-pressed="true"] small { color: #dbeafe; }
.ent { display: grid; grid-template-columns: minmax(280px, 520px) 1fr; gap: 24px; align-items: start; }
.ent-board { display: grid; border-radius: 0; grid-template-columns: repeat(8, 1fr); width: 100%; aspect-ratio: 1; overflow: hidden; user-select: none; touch-action: manipulation; }
.ent-board .sq { position: relative; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.ent-board .lt { background: #f0d9b5; }
.ent-board .dk { background: #b58863; }
.ent-board .sq img { width: 90%; height: 90%; pointer-events: none; }
.ent-board .last { box-shadow: inset 0 0 0 100px rgba(155, 199, 0, .41); }
.ent-board .sel { box-shadow: inset 0 0 0 100px rgba(20, 85, 30, .5); }
.ent-board .chk { box-shadow: inset 0 0 0 100px rgba(220, 38, 38, .5); }
.ent-board .dest::after { content: ""; position: absolute; width: 28%; height: 28%; border-radius: 50%; background: rgba(15, 27, 45, .35); }
.ent-msg { font-size: 1.1rem; font-weight: 600; margin: 10px 0; min-height: 1.5em; }
.ent-msg.bien { color: #16a34a; }
.ent-msg.mal { color: #dc2626; }
.ent-btns { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.ent-btns .btn-ghost, .ent-btns .btn { cursor: pointer; border: 1px solid var(--line); }
.ent-btns .btn[hidden] { display: none; }
@media (max-width: 760px) { .ent { grid-template-columns: 1fr; } }
.ent-board { grid-template-rows: repeat(8, 1fr); }
.ent-board .sq { min-width: 0; min-height: 0; }
.ent-board .co { position: absolute; font-style: normal; font-size: .7rem; font-weight: 600; line-height: 1; pointer-events: none; }
.ent-board .co.r { top: 3px; left: 4px; }
.ent-board .co.f { bottom: 3px; right: 4px; }
.ent-board .lt .co { color: #b58863; }
.ent-board .dk .co { color: #f0d9b5; }
.ent-btns .btn-ghost:disabled { opacity: .45; cursor: default; }
.ent-board { touch-action: none; }
.ent-board .sq img { cursor: grab; }
.ent-drag { position: fixed; z-index: 50; pointer-events: none; transform: translate(-50%, -50%); filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .4)); }
.ent-board .mate img { transform: rotate(90deg); }
.theme .tn { display: flex; flex-direction: column; gap: 2px; }
.theme .cnt { color: var(--muted); font-weight: 400; font-size: .8rem; }
.ent-col { min-width: 0; }
.ent-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.ent-head h3 { margin: 0; font-size: 1.15rem; }
.ent-reloj { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--muted); }
.theme[aria-current="true"] { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.ent-msg.bien { font-size: 1.5rem; }
.ent-pct { font-size: .95rem; line-height: 1.6; margin: 6px 0; }
.ent-titulo { display: inline-flex; border: 0; padding: 0; background: none; cursor: default; }
.ent-titulo:hover { border: 0; }
.ent-titulo .tn { font-size: 1.05rem; font-weight: 600; }
.ent-pct { font-variant-numeric: tabular-nums; font-size: 1.1rem; font-weight: 600; margin: 8px 0; }
.ent-head { height: 44px; margin-bottom: 8px; align-items: center; }
.ent-nivel { width: 100%; max-width: 260px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: .95rem; }
.ent-side { margin-top: 52px; }
@media (max-width: 760px) { .ent-side { margin-top: 0; } }
.ent-side .ent-nivel { display: block; margin-bottom: 8px; }
.ent-result { border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 14px 16px; margin: 10px 0; max-width: 360px; }
.ent-result h4 { margin: 0 0 6px; }
.ent-result p { margin: 4px 0; }
.ent-result .big { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.ent-result .dots { display: flex; flex-wrap: wrap; gap: 4px; margin: 10px 0; }
.ent-result .dots i { width: 10px; height: 10px; border-radius: 50%; display: block; }
.ent-result .dots .ok { background: #16a34a; }
.ent-result .dots .ko { background: #dc2626; }
.ent-bwrap { display: grid; grid-template-columns: 18px 1fr; grid-template-rows: auto 18px; }
.ent-ranks { display: grid; grid-template-rows: repeat(8, 1fr); grid-column: 1; grid-row: 1; }
.ent-board { grid-column: 2; grid-row: 1; }
.ent-files { display: grid; grid-template-columns: repeat(8, 1fr); grid-column: 2; grid-row: 2; }
.ent-ranks span, .ent-files span { display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 600; color: var(--muted); }
.ent-board .co { display: none; }
.ent-msg .fig { height: 1.15em; width: auto; vertical-align: -.22em; background: #f0d9b5; border-radius: 4px; margin-right: 2px; }
.ent-reloj[hidden] { display: none; }
.grupos { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.grupo { cursor: pointer; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 999px; padding: 7px 14px; font-size: .95rem; font-weight: 600; }
.grupo small { color: var(--muted); font-weight: 400; font-size: .8rem; }
.grupo[aria-expanded="true"] { border-color: var(--blue); }
.grupo .chev { width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .15s; }
.grupo[aria-expanded="true"] .chev { transform: rotate(-135deg) translateY(-2px); }
#temas .tg { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin: 0 0 14px; }
#temas .theme { padding: 6px 10px; gap: 10px; }
#temas .theme .pc { width: 34px; height: 34px; }
#temas .theme .pc img { width: 24px; height: 24px; }
#temas .theme .tn { font-size: .95rem; }
.ent-titulo .pc { width: 44px; height: 44px; }
.ent-titulo .pc img { width: 32px; height: 32px; }
#temas .tg[hidden] { display: none; }
.ico { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; margin-right: 6px; flex: none; }
.ico.der { margin: 0 0 0 6px; }
.ent-btns button, .ent-cancel button, .ent-result .ent-btns button { display: inline-flex; align-items: center; cursor: pointer; }
.grupo .gi { width: 20px; height: 20px; }
/* Columna de la derecha: llega hasta el borde inferior del tablero y Cancelar queda abajo */
.ent { align-items: stretch; }
.ent-side { display: flex; flex-direction: column; margin-bottom: 18px; }
.ent-cancel { margin-top: auto; padding-top: 12px; }
.ent-cancel button { border: 1px solid var(--line); }
.ent-cancel button[hidden] { display: none; }
@media (max-width: 760px) { .ent-side { margin-bottom: 0; } }
.ent-cancel button:disabled { opacity: .45; cursor: default; }
.ent-copiar { display: inline-flex; align-items: center; cursor: pointer; border: 1px solid var(--line); margin: 4px 0; }
.ent-copiar:disabled { opacity: .45; cursor: default; }
.toast { position: fixed; left: 50%; top: 0; transform: translate(-50%, 6px); background: var(--navy); color: #E8EEF7; border: 1px solid var(--blue); padding: 8px 16px; border-radius: 10px; font-weight: 600; font-size: .95rem; white-space: nowrap; box-shadow: 0 6px 24px rgba(0, 0, 0, .35); opacity: 0; transition: opacity .2s, transform .2s; z-index: 100; pointer-events: none; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast[hidden] { display: none; }
.ent-copiar, .ent-cancel button { align-self: flex-start; }

/* Visor en vivo propio: tablero + barra Stockfish + relojes */
.lv { display: flex; gap: 12px; align-items: stretch; flex-wrap: wrap; }
.lv-col { flex: 0 1 420px; min-width: 260px; }
.lv-bar { flex: 0 0 26px; display: flex; }
.lv-evalbar { position: relative; width: 26px; background: #262421; border-radius: 4px; overflow: hidden; border: 1px solid var(--line); min-height: 300px; }
.lv-evalw { position: absolute; left: 0; right: 0; bottom: 0; height: 50%; background: #f0f0f0; transition: height .4s; }
.lv-evalbar span { position: absolute; left: 0; right: 0; font-size: 10px; font-weight: 700; text-align: center; color: #888; top: 3px; }
.lv-evalbar.wh span { top: auto; bottom: 3px; color: #333; }
.lv-player { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px; font-size: 13px; background: #262421; color: #bababa; }
.lv-clk { font-family: ui-monospace, Consolas, monospace; font-weight: 700; font-size: 17px; letter-spacing: .5px; color: #9a9a9a; background: #1c1b19; border-radius: 4px; padding: 2px 8px; }
.lv-clk.run { color: #fff; background: #3692e7; box-shadow: 0 0 0 2px rgba(54,146,231,.35); }
.lv-nav { display: flex; gap: 6px; margin-top: 6px; }
.lv-nav button { flex: 1; padding: 6px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); cursor: pointer; font-size: 16px; }
.lv-moves { flex: 1 1 220px; max-height: 480px; overflow: auto; display: block; align-content: start; font-size: 15px; line-height: 1.9; padding: 4px 8px; color: #d8dde6; }
.lv-moves span { padding: 4px 8px; cursor: pointer; border-radius: 4px; }
.lv-moves .n { color: var(--muted, #888); cursor: default; }
.lv-moves .cur { background: #3a6ea5; color: #fff; }
.lv-board { aspect-ratio: 1; border-radius: 4px; }
.lv-board { grid-template-rows: repeat(8, 1fr); }
.lv-board .sq { min-width: 0; min-height: 0; cursor: default; }
.lv-player small { color: #999; font-size: 12px; } .lv-player .ttl { font-style: normal; font-weight: 700; color: #e8a33d; }
.lv-board .sq { position: relative; } .lv-board .sq b { position: absolute; font-size: 10px; font-weight: 600; line-height: 1; pointer-events: none; }
.lv-board .rk { right: 3px; top: 3px; } .lv-board .fl { left: 3px; bottom: 2px; }
.lv-board .lt b { color: #b58863; } .lv-board .dk b { color: #f0d9b5; }
.lv-nav button { background: #262421; border-color: #262421; color: #bababa; }
.hero-live { grid-template-columns: 1.4fr 1fr; }
.hero-live .board { max-width: 280px; border-radius: 10px; border: 0; box-shadow: 0 14px 40px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.08); transform: rotate(2deg); }
.hero-live .eyebrow { color: #ef4444; }
.hero-live .eyebrow::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: #ef4444; animation: lvpulse 1.4s infinite; }
@keyframes lvpulse { 50% { opacity: .25; } }
@media (max-width: 720px) { .hero-live .board { transform: none; max-width: 240px; } }
.lv-result { grid-column: 1 / -1; margin-top: 8px; padding: 10px 8px; text-align: center; border-top: 1px solid var(--line); }
.lv-result strong { display: block; font-size: 20px; } .lv-result span { color: #9aa8bd; font-size: 13px; }
.lv-score { margin-left: 8px; padding: 1px 7px; border-radius: 4px; background: #3a3936; color: #fff; font-size: 13px; }
.lv-row { display: flex; gap: 6px; align-items: stretch; }
.lv-row .lv-board { flex: 1 1 auto; width: auto; min-width: 0; }
.lv-row .lv-bar { flex: 0 0 22px; }
.lv-row .lv-evalbar { min-height: 0; width: 22px; }
.lv-clk { min-width: 84px; text-align: center; box-sizing: border-box; }
.lv-moves span { display: inline-block; padding: 1px 5px; margin: 0 1px; }
.lv-moves .n { padding-right: 1px; margin-left: 4px; }
.lv-moves .fg { font-family: "Segoe UI Symbol", "DejaVu Sans", "Noto Sans Symbols 2", sans-serif; font-weight: 400; font-size: 1.1em; margin-right: 1px; color: inherit; width: auto; height: auto; vertical-align: baseline; }
.lv-moves .lv-result { display: block; margin-top: 10px; padding: 10px 8px; }
.lv-result span { cursor: default !important; }
.lv-moves .pr { white-space: nowrap; padding: 0; margin: 0; cursor: default; }
.lv-board { position: relative; }
.lv-board .lv-arrow { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; filter: drop-shadow(0 0 1px rgba(0,0,0,.5)); }
.lv-lines { background: #1f1e1c; color: #c8ccd4; font-size: 13px; line-height: 1.5; margin-top: 2px; }
.lv-lines .ln { padding: 5px 8px; border-bottom: 1px solid #33322f; }
.lv-lines .ln b { color: #8b8f98; margin-right: 2px; } .lv-lines .ln em { font-style: normal; font-weight: 700; color: #e8eaee; }
.lv-lines .fg { font-family: "Segoe UI Symbol", "DejaVu Sans", sans-serif; font-weight: 400; }
.lv-lines .ln.muted { color: #8b8f98; }
.lv-evalbar span { display: none; }
.lv-lines .ln { white-space: nowrap; overflow: hidden; }
.lv-an { margin-top: 2px; }
.lv-anhead { display: flex; justify-content: space-between; align-items: center; background: #262421; color: #bababa; font-size: 12px; font-weight: 700; padding: 4px 8px; border-bottom: 1px solid #33322f; }
.lv-anctl button { width: 24px; height: 22px; margin-left: 4px; border: 0; border-radius: 4px; background: #3a3936; color: #e6e6e6; font-size: 15px; line-height: 1; cursor: pointer; }
.lv-anctl button:hover:not(:disabled) { background: #4a4946; } .lv-anctl button:disabled { opacity: .35; cursor: default; }
.lv-anname { display: inline-flex; align-items: center; gap: 6px; background: #2f4a2f; color: #d8f0d8; border: 1px solid #4f8a4f; border-radius: 4px; padding: 2px 8px; white-space: nowrap; }
.lv-dot { width: 8px; height: 8px; border-radius: 50%; background: #3cc64a; } .lv-dot.off { background: #777; }
.lv-stats { flex: 1; padding: 0 8px; font-weight: 400; color: #9aa0aa; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-anctl { display: inline-flex; align-items: center; } .lv-nl { margin: 0 4px 0 6px; min-width: 10px; text-align: center; color: #e6e6e6; }
.lv-sw { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; cursor: pointer; }
.lv-sw input { display: none; } .lv-sw i { width: 30px; height: 16px; border-radius: 8px; background: #555; position: relative; transition: background .2s; }
.lv-sw i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: left .2s; }
.lv-sw input:checked + i { background: #3cc64a; } .lv-sw input:checked + i::after { left: 16px; }
.lv-board .sq { cursor: default; }
.lv-board .sq img { cursor: grab; }
.lv-board .sq.from { box-shadow: inset 0 0 0 100px rgba(20, 85, 30, .5); }
.lv-board .sq.dest::after { content: ""; position: absolute; width: 28%; height: 28%; border-radius: 50%; background: rgba(20, 85, 30, .45); pointer-events: none; }
.lv-ghost { position: fixed; z-index: 1000; pointer-events: none; cursor: grabbing; filter: drop-shadow(0 4px 6px rgba(0,0,0,.45)); }
.lv-moves .lv-var { display: block; margin: 4px 0 4px 14px; padding: 2px 6px; border-left: 3px solid #4a6a4f; }
.lv-var .vt { width: 20px; height: 20px; padding: 0; margin-right: 6px; line-height: 1; border: 1px solid #5a6a5d; border-radius: 3px; background: #1f2a22; color: #cfe8d0; cursor: pointer; vertical-align: middle; }
.lv-var span.cur { background: rgba(80, 160, 100, .4); color: #fff; }

/* Lista de jugadas en pastillas */
.lv-moves { display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; line-height: 1.2; padding: 8px; font-size: 14px; }
.lv-moves .pr { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px; margin: 0; background: #22324a; border-radius: 8px; white-space: nowrap; cursor: default; }
.lv-moves .pr .n { padding: 0 4px 0 2px; margin: 0; color: #7f8da3; font-size: 12px; font-weight: 700; }
.lv-moves .pr > span[data-p] { padding: 3px 6px; margin: 0; border-radius: 5px; color: #eef2f7; font-weight: 700; cursor: pointer; }
.lv-moves .pr > span[data-p]:hover { background: rgba(255, 255, 255, .12); }
.lv-moves .pr > span[data-p].cur { background: #1b9ce0; color: #fff; }
.lv-moves .rp { padding: 6px 14px; margin: 0; border-radius: 999px; background: #1b9ce0; color: #fff; font-weight: 700; cursor: default; }
.lv-moves .lv-var { flex: 1 1 100%; margin: 0 0 0 14px; }
/* Todas las parejas con el mismo ancho: rejilla de columnas fijas */
.lv-moves { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 6px; }
.lv-moves .pr { display: grid; grid-template-columns: 30px 1fr 1fr; align-items: center; justify-items: start; width: auto; box-sizing: border-box; }
.lv-moves .pr.ct > span[data-p] { grid-column: 3; }
.lv-moves .lv-var { grid-column: 1 / -1; }
.lv-moves .rp { justify-self: start; }
/* Contenedor de la lista con el botón de disposición */
.lv-mvwrap { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; max-height: 480px; }
.lv-mvwrap .lv-moves { flex: 1 1 auto; max-height: none; }
.lv-mvbar { display: flex; justify-content: flex-end; padding: 0 2px 4px; }
.lv-layout { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 26px; padding: 0; border: 0; border-radius: 6px; background: #22324a; color: #cfd8e6; cursor: pointer; }
.lv-layout:hover { background: #2d4261; }
.lv-moves.one { grid-template-columns: 1fr; }
.lv-moves, .lv-moves * { user-select: none; -webkit-user-select: none; }
.lv-moves .pr > span[data-p], .lv-moves .pr > span[data-p] *, .lv-var span[data-v], .lv-var span[data-v] * { cursor: pointer; }
/* Miniaturas de las primeras partidas */
.lv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.lv-grid[hidden], .lv[hidden] { display: none; }
.th { display: flex; gap: 5px; padding: 8px; border: 2px solid transparent; border-radius: 10px; background: #262421; cursor: pointer; }
.th:hover { border-color: #3692e7; }
.th-bar { flex: 0 0 12px; position: relative; background: #262421; border: 1px solid #3a3936; border-radius: 3px; overflow: hidden; }
.th-w { position: absolute; left: 0; right: 0; bottom: 0; height: 50%; background: #f0f0f0; transition: height .4s; }
.th-board { flex: 1 1 auto; min-width: 0; aspect-ratio: 1; width: auto; grid-template-rows: repeat(8, 1fr); border-radius: 3px; }
.th-board .sq { cursor: pointer; min-width: 0; min-height: 0; }
.th-board .sq img { width: 94%; height: 94%; }
.lv-thumbs[hidden] { display: none; }
.lv-thumbs { margin-bottom: 14px; }
.th.sel { border-color: #3692e7; }
/* Tarjeta independiente al frente (doble clic en una miniatura) */
.lv-modal { position: fixed; z-index: 900; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(1100px, 94vw); max-height: 92vh; overflow: auto; margin: 0; box-shadow: 0 24px 70px rgba(0, 0, 0, .65); }
.lv-modal[hidden], #lv-backdrop[hidden] { display: none; }
#lv-backdrop { position: fixed; inset: 0; z-index: 890; background: rgba(4, 9, 20, .6); }
.lv-modal .viewer-bar { cursor: move; user-select: none; }
.lv-modal .viewer-bar select, .lv-modal .viewer-bar button { cursor: pointer; }
/* Miniaturas completas: nombres, relojes, tablero y barra */
.lv-grid { grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 13px; }
.th { flex-direction: column; align-items: stretch; gap: 5px; text-align: left; font: inherit; }
.th-row { display: flex; gap: 5px; }
.th-p { display: flex; justify-content: space-between; align-items: center; gap: 7px; font-size: 11.5px; color: #bababa; }
.th-p .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-p .ttl { font-style: normal; font-weight: 700; color: #e8a33d; }
.th-p .ck { flex: none; font-family: ui-monospace, Consolas, monospace; font-weight: 700; font-size: 12.5px; color: #9a9a9a; background: #1c1b19; border-radius: 3px; padding: 1px 6px; }
.th-p .ck.run { background: #3692e7; color: #fff; }
/* Pastillas de jugadas más pequeñas */
.lv-moves { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 4px; padding: 6px; font-size: 12.5px; }
.lv-moves.one { grid-template-columns: 1fr; }
.lv-moves .pr { grid-template-columns: 22px 1fr 1fr; padding: 2px 4px; border-radius: 6px; gap: 2px; }
.lv-moves .pr .n { padding: 0 2px; font-size: 10.5px; }
.lv-moves .pr > span[data-p] { padding: 2px 4px; border-radius: 4px; }
.lv-moves .rp { padding: 4px 11px; font-size: 12px; }
.lv-moves .lv-var { font-size: 12.5px; }
.lv-moves .fg { font-size: 1em; font-variant-emoji: text; }
.th-board { position: relative; }
.th-board .th-arrow { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; filter: drop-shadow(0 0 1px rgba(0,0,0,.5)); }
.th { user-select: none; -webkit-user-select: none; }
.th.dragging { background: rgba(54, 146, 231, .10); outline: 2px dashed #3692e7; outline-offset: -2px; border-radius: 10px; }
.th.dragging > * { visibility: hidden; }
.th.th-ghost { position: fixed; z-index: 1100; margin: 0; pointer-events: none; opacity: .92; box-shadow: 0 14px 40px rgba(0,0,0,.6); border-color: #3692e7; transform: rotate(1.5deg); }
.card a.btn-view { margin-top: auto; align-self: flex-start; background: var(--blue); color: #fff; padding: 7px 14px; border-radius: 8px; font-weight: 500; text-decoration: none; }
.card a.btn-view:hover { background: #2563eb; text-decoration: none; }
.lv-tt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lv-info { font-size: .78rem; font-weight: 400; color: #9fb0c8; }
.lv-info:empty { display: none; }
.lv-tt { flex: 1 1 200px; }
.lv-tt strong { flex: none; }
#viewer-more { flex: 0 1 480px; }
.lv-addrow { display: flex; gap: 10px; align-items: center; margin: 0 0 10px; }
.lv-addrow select { padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.th { position: relative; }
.th-del { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; display: none; align-items: center; justify-content: center; border-radius: 6px; background: rgba(20, 20, 20, .85); color: #e5484d; cursor: pointer; z-index: 2; }
.th:hover .th-del { display: flex; }
.th-del:hover { background: #e5484d; color: #fff; }
.wrap.wide { max-width: none; width: 100%; padding-left: 24px; padding-right: 24px; }
#viewer-more { flex: 0 1 427px; }
.lv-addrow { justify-content: flex-end; }
.lv-addrow { justify-content: space-between; margin-bottom: 14px; }
.lv-addrow .lv-tt { margin-right: auto; }
.lv-addrow .lv-tt strong { font-size: 1.05rem; }
.lv-addrow { align-items: flex-end; margin-bottom: 6px; }
.lv-addrow select, .lv-addrow button { margin-bottom: 0; }
#viewer-add { display: inline-flex; align-items: center; gap: 6px; }
.th-eye { flex: 0 0 24px; align-self: flex-start; display: flex; align-items: center; justify-content: center; height: 24px; border-radius: 6px; color: #9a9a9a; cursor: pointer; }
.th-eye:hover { background: #3a3936; color: #fff; }
.lv-fbd { position: fixed; inset: 0; z-index: 1200; background: rgba(4, 9, 20, .65); }
.lv-fide { position: fixed; z-index: 1210; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, 94vw); max-height: 92vh; overflow: auto; background: #162039; border: 1px solid #2a3654; border-radius: 12px; box-shadow: 0 24px 70px rgba(0, 0, 0, .65); }
.lv-fbd[hidden], .lv-fide[hidden] { display: none; }
.lv-fhead { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-bottom: 1px solid #2a3654; font-size: .85rem; color: #9fb0c8; }
.lv-ftab { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: .92rem; }
.lv-ftab th { text-align: left; font-weight: 400; color: #9fb0c8; padding: 9px 16px; }
.lv-ftab td { text-align: center; padding: 9px 8px; }
.lv-ftab tr + tr { border-top: 1px solid #2a3654; }
.lv-ftab td.c { padding: 16px 8px 10px; }
.lv-ftab td.c b { display: block; }
.lv-ftab td.c small { color: #9fb0c8; font-size: .75rem; }
.lv-ph { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 8px; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 1.3rem; overflow: hidden; background: #1d4ed8; color: #dbeafe; }
.lv-ph.c1 { background: #6d28d9; color: #ede9fe; }
.lv-ph img { width: 100%; height: 100%; object-fit: cover; }
.lv-ftab .win { color: #4ade80; font-weight: 600; }
.lv-ftab .win small { font-size: .72rem; }
.lv-ftab a { color: #60a5fa; font-size: .85rem; }
.lv-ffoot { margin: 0; padding: 10px 16px; font-size: .78rem; color: #9fb0c8; border-top: 1px solid #2a3654; }
.th-p .th-eye { flex: 0 0 22px; margin-left: auto; align-self: center; height: 22px; visibility: hidden; }
.th:hover .th-p .th-eye { visibility: visible; }
.th-p .th-eye + .ck { margin-left: 0; }
#viewer-games { flex: 0 1 320px; }
.lv-moves .ev { font-style: normal; font-size: .72em; font-weight: 700; margin-left: 5px; padding: 0 4px; border-radius: 4px; }
.lv-moves .ev.bad { background: #5b1f22; color: #ff8b8f; }
.lv-moves .ev.good { background: #1d4a2c; color: #7ee2a0; }
.lv-eyebtn { flex: none; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid #2a3654; background: transparent; color: #cfd8e6; cursor: pointer; padding: 0; }
.lv-eyebtn:hover { background: #22324a; color: #fff; }
.lv-modal .viewer-bar strong { flex: 1 1 auto; }
#lv-fbd { z-index: 1200; } 
.lv-modal { width: min(800px, 94vw); }
.lv-modal .lv-moves { max-height: 560px; }
.lv-ftab td.a0 { background: rgba(37, 99, 235, .10); }
.lv-ftab td.a1 { background: rgba(124, 58, 237, .12); }
.lv-ftab td.c { background: none; }
.lv-ftab tr.rt td { padding: 11px 14px 9px; }
.lv-ftab tr.big td > span, .lv-ftab tr.big td > .win { font-size: 1.35rem; font-weight: 600; }
.lv-ftab .bar { display: block; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .08); margin-top: 6px; overflow: hidden; }
.lv-ftab .bar i { display: block; height: 100%; border-radius: 3px; }
.lv-ftab .bar .b0 { background: #3b82f6; }
.lv-ftab .bar .b1 { background: #8b5cf6; }
.lv-ftab .win { color: #4ade80; }
.lv-ftab th { background: rgba(255, 255, 255, .03); }
.lv-fver { padding: 12px 16px; text-align: center; font-size: .9rem; background: rgba(74, 222, 128, .08); color: #bbf7d0; border-top: 1px solid #2a3654; }
.lv-fhead { background: rgba(255, 255, 255, .04); }
.lv-ph { box-shadow: 0 0 0 3px rgba(255, 255, 255, .12); }
.lv-fide, .lv-fide * { user-select: none; -webkit-user-select: none; }
.lv-fide img { -webkit-user-drag: none; }
.lv-ftab th { white-space: nowrap; }
.lv-ftab th .lv-i { vertical-align: -3px; margin-right: 8px; color: #7f95b8; }
.lv-flag { width: 20px; height: 14px; object-fit: cover; border-radius: 2px; vertical-align: -2px; margin-right: 6px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .15); }
.lv-ftab td b { font-weight: 600; letter-spacing: .04em; }
.lv-flag { width: 30px; height: 20px; object-fit: contain; border-radius: 3px; margin-right: 8px; vertical-align: -5px; }
.lv-addrow { flex-wrap: wrap; }
.lv-addrow .btn-ghost { display: inline-flex; align-items: center; gap: 6px; }
#viewer-round { padding: 6px 8px; border-radius: 8px; border: 1px solid #2a3654; background: var(--bg); color: var(--text); }
.lv-fide.wide { width: min(780px, 95vw); }
.lv-ptab { width: 100%; border-collapse: collapse; font-size: .9rem; }
.lv-ptab th { color: #9fb0c8; font-weight: 400; font-size: .78rem; padding: 8px 8px; text-align: center; background: rgba(255, 255, 255, .03); }
.lv-ptab td { padding: 8px; text-align: center; border-top: 1px solid #2a3654; }
.lv-ptab .l { text-align: left; }
.lv-ptab small { color: #9fb0c8; }
.lv-ptab .fd { margin-left: 6px; color: #9fb0c8; font-size: .78rem; white-space: nowrap; }
.lv-ptab .fd .lv-flag { width: 20px; height: 14px; margin-right: 4px; vertical-align: -2px; }
.lv-ptab .ttl { font-style: normal; font-weight: 700; color: #e8a33d; }
.lv-ptab.pairs tr[data-g] { cursor: pointer; }
.lv-ptab.pairs tr[data-g]:hover td { background: rgba(59, 130, 246, .12); }
.lv-ptab .rs { font-weight: 600; white-space: nowrap; }
.liveDot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #4ade80; animation: lvpulse 1.4s infinite; }
@keyframes lvpulse { 50% { opacity: .35; } }
.lv-toast { position: fixed; z-index: 1300; left: 50%; bottom: 28px; transform: translateX(-50%); background: #1d4ed8; color: #fff; padding: 12px 20px; border-radius: 10px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); font-size: .95rem; max-width: 92vw; }
.lv-toast[hidden] { display: none; }
.th.fin { animation: lvfin 1s ease-in-out 8; border-color: #4ade80; }
@keyframes lvfin { 50% { box-shadow: 0 0 0 4px rgba(74, 222, 128, .55); } }
.lv-voice { margin-left: auto; width: 40px; height: 40px; }
.lv-thumbs { position: relative; }
.lv-thumbs .lv-voice { position: absolute; top: 12px; right: 12px; margin: 0; z-index: 2; width: 36px; height: 36px; }
.lv-thumbs .lv-addrow .lv-tt { padding-right: 46px; }
.lv-vpop { position: absolute; z-index: 5; top: 52px; right: 12px; width: 290px; background: #162039; border: 1px solid #2a3654; border-radius: 12px; padding: 12px 14px; box-shadow: 0 16px 50px rgba(0, 0, 0, .6); display: flex; flex-direction: column; gap: 12px; font-size: .9rem; }
.lv-vpop[hidden] { display: none; }
.lv-vpop .vp-row { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.lv-vpop .vp-vol { display: flex; align-items: center; gap: 10px; }
.lv-vpop .vp-vol input { flex: 1; min-width: 0; }
.lv-vpop .vp-vol b { min-width: 44px; text-align: right; font-weight: 600; }
.lv-vpop .btn-ghost { align-self: flex-start; }
.lv-thumbs .lv-voice { width: 48px; height: 48px; top: 10px; right: 10px; }
.lv-thumbs .lv-voice svg { width: 28px; height: 28px; }
.lv-thumbs .lv-addrow .lv-tt { padding-right: 60px; }
.lv-vpop { top: 64px; right: 10px; }
.th { touch-action: manipulation; }
@media (hover: none), (pointer: coarse) {
  .th-del { display: flex; width: 36px; height: 36px; top: 6px; right: 6px; }
  .th-p .th-eye { visibility: visible; flex: 0 0 36px; width: 36px; height: 36px; }
  .th-del svg, .th-p .th-eye svg { width: 22px; height: 22px; }
  .th > .th-p:first-child { padding-right: 42px; }
  .th-eye, .th-del { -webkit-tap-highlight-color: transparent; }
  .lv-eyebtn, .lv-addrow .btn-ghost, #viewer-round, #viewer-more { min-height: 40px; }
}
.th-p .nm { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-p .mt { flex: none; display: inline-flex; align-items: center; gap: 6px; margin-right: auto; margin-left: 6px; }
.th-p .mt .el { color: #8fa3bf; font-size: 11px; }
.th-p .th-eye { margin-left: 0; }
.lv-addrow .lv-tt { flex: 1 0 auto; max-width: 100%; }
@media (min-width: 760px) { .lv-addrow .lv-tt strong, .lv-addrow .lv-tt .lv-info { white-space: nowrap; } }
.lv-addrow .lv-tt strong { overflow-wrap: anywhere; }
.lv-addrow { justify-content: flex-start; }
.lv-addrow .lv-tt { flex: 1 0 100%; margin-right: 0; }
.lv-addrow .lv-tools { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#lv-closebig { display: inline-flex; align-items: center; gap: 6px; }
.lv-nav { gap: 8px; margin-top: 10px; }
.lv-nav button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; border-radius: 10px; border: 1px solid #343a4a; background: linear-gradient(#2c303c, #232733); color: #cdd6e6; font-weight: 600; font-size: 14px; letter-spacing: .02em; transition: background .15s, border-color .15s, transform .08s; }
.lv-nav button:hover { background: linear-gradient(#364059, #2a3248); border-color: #4a6cb3; color: #fff; }
.lv-nav button:active { transform: scale(.97); }
#lv-prev, #lv-next { flex: 0 0 64px; }
#lv-live { flex: 1; }
.lv-livedot { width: 9px; height: 9px; border-radius: 50%; background: #6b7280; }
#lv-live.on { background: linear-gradient(#2a6fd6, #1f56ad); border-color: #5b9bf0; color: #fff; }
#lv-live.on .lv-livedot { background: #4ade80; box-shadow: 0 0 0 0 rgba(74, 222, 128, .6); animation: lvdot 1.6s infinite; }
@keyframes lvdot { 70% { box-shadow: 0 0 0 7px rgba(74, 222, 128, 0); } 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); } }
.tsearch { margin: 0 0 22px; }
.tsearch-l { display: block; font-weight: 600; margin-bottom: 8px; }
.tsearch-row { display: flex; gap: 10px; max-width: 640px; }
.tsearch-row input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font-size: 1rem; }
.tsearch-row input:focus { outline: 2px solid #3b82f6; outline-offset: 1px; }
.tsearch-row .btn-ghost, #tsearch-more { display: inline-flex; align-items: center; gap: 6px; }
#tsearch-msg { margin: 10px 0 0; }
#tsearch-res { margin-top: 12px; }
#tsearch-more { margin-top: 12px; }
#tsearch-more[hidden], #tsearch-msg[hidden] { display: none; }
.badge.done { background: #3a3f4b; color: #cfd6e4; }
.lv-fide.wide:has(.stand) { width: min(640px, 95vw); }
.lv-ptab.stand { table-layout: fixed; }
.lv-ptab.stand .c-n { width: 40px; } .lv-ptab.stand .c-f { width: 92px; } .lv-ptab.stand .c-e { width: 60px; }
.lv-ptab.stand .c-s { width: 52px; } .lv-ptab.stand .c-g { width: 52px; } .lv-ptab.stand .c-r { width: 60px; }
.lv-ptab.stand td { padding: 7px 6px; }
.lv-ptab.stand td.l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-ptab.stand td.fd { text-align: left; white-space: nowrap; color: #9fb0c8; font-size: .82rem; }
.lv-ptab.stand td.fd .lv-flag { width: 22px; height: 15px; margin-right: 6px; vertical-align: -3px; }
.live-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--card, #162039); color: var(--text); cursor: pointer; padding: 0; }
.iconbtn:hover { border-color: #3b82f6; color: #fff; background: #1d3a6e; }
.iconbtn:disabled { cursor: progress; opacity: .8; }
.iconbtn.spin svg { animation: lvspin .9s linear infinite; }
@keyframes lvspin { to { transform: rotate(360deg); } }
.live-count { font-size: inherit; font-weight: inherit; margin-left: 14px; color: var(--muted, #9fb0c8); }
#viewer, #viewer * { caret-color: transparent; }
#viewer button, #viewer select { -webkit-user-select: none; user-select: none; cursor: pointer; }
.lv-flag.nf { width: 18px; height: 12px; margin-right: 5px; vertical-align: -1px; object-fit: cover; box-shadow: 0 0 0 1px rgba(255, 255, 255, .15); }

/* Vista previa de una jugada (al pasar el ratón por la lista) */
.lv-hv { position: fixed; z-index: 1250; width: 300px; background: #101a2e; color: #d8dde6; border: 1.5px solid #3a6ea5; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.55); padding: 10px 12px 9px; pointer-events: none; }
.lv-hv[hidden] { display: none; }
.lv-hv .hv-h { font-weight: 700; font-size: 13.5px; line-height: 1.3; color: #8fb8ee; margin-bottom: 7px; }
.lv-hv .hv-row { display: flex; gap: 6px; }
.lv-hv .hv-eb { position: relative; flex: none; width: 13px; background: #403d39; border-radius: 3px; overflow: hidden; }
.lv-hv .hv-ew { position: absolute; left: 0; right: 0; bottom: 0; height: 50%; background: #f0f0ea; transition: height .25s; }
.lv-hv .hv-b { display: grid; grid-template-columns: repeat(8, 1fr); flex: 1 1 auto; min-width: 0; aspect-ratio: 1; border-radius: 3px; overflow: hidden; }
.lv-hv .hv-b i { position: relative; display: block; }
.lv-hv .hv-b i.lt { background: #f0d9b5; } .lv-hv .hv-b i.dk { background: #b58863; }
.lv-hv .hv-b { position: relative; }
.lv-hv .hv-b i.last { box-shadow: inset 0 0 0 100px rgba(155, 199, 0, .41); }
.lv-hv .hv-a { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.lv-hv .hv-b img { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }
.lv-hv .hv-c { text-align: center; font-size: 13px; margin-top: 7px; color: #c3cad6; }
.lv-hv .hv-c .fg { font-family: "Segoe UI Symbol", "DejaVu Sans", "Noto Sans Symbols 2", sans-serif; font-weight: 400; }
.lv-hv .hv-f { text-align: center; font-size: 11.5px; margin-top: 5px; color: #8fb8ee; font-weight: 600; }
@media (hover: none) { .lv-hv { display: none !important; } }

/* Menú desplegable «Entrenamiento» */
.site-header nav .menu { position: relative; }
.site-header nav .menu-b { display: inline-flex; align-items: center; gap: 5px; background: none; border: 0; padding: 0; color: #E8EEF7; font: inherit; font-size: .95rem; opacity: .85; cursor: pointer; }
.site-header nav .menu-b:hover, .site-header nav .menu.open .menu-b { opacity: 1; color: var(--amber); }
.site-header nav .menu-b[aria-current] { color: var(--amber); opacity: 1; }
.site-header nav .menu-l { display: none; position: absolute; top: 100%; left: -10px; min-width: 210px; padding: 8px; background: var(--navy); border: 1px solid #2a3654; border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.45); z-index: 30; flex-direction: column; gap: 2px; }
.site-header nav .menu:hover .menu-l, .site-header nav .menu.open .menu-l, .site-header nav .menu:focus-within .menu-l { display: flex; }
.site-header nav .menu-l a { padding: 8px 12px; border-radius: 7px; opacity: .9; white-space: nowrap; }
.site-header nav .menu-l a:hover { background: #1b2a45; }
.site-header nav .menu-l a { display: flex; align-items: center; gap: 10px; }
.site-header nav .mi { flex: none; color: #8fa3bf; transition: color .15s; }
.site-header nav .menu-l a:hover .mi, .site-header nav .menu-l a[aria-current] .mi { color: var(--amber); }
.site-header nav .mi.mb { width: 15px; height: 15px; }
.board i.last::after { content: ""; position: absolute; inset: 0; background: rgba(255, 235, 0, .38); pointer-events: none; }
/* Submenú «Finales» (se abre a la derecha) */
.site-header nav .sub { position: relative; }
.site-header nav .sub-t { display: flex; align-items: center; gap: 10px; }
.site-header nav .sub-t .sc { margin-left: auto; opacity: .7; }
.site-header nav .sub-l { display: none; position: absolute; right: 100%; top: -8px; min-width: 250px; padding: 8px; background: var(--navy); border: 1px solid #2a3654; border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.45); flex-direction: column; gap: 2px; }
.site-header nav .sub:hover .sub-l, .site-header nav .sub:focus-within .sub-l, .site-header nav .sub.open .sub-l { display: flex; }
.site-header nav .sub-l a { padding: 8px 12px; border-radius: 7px; white-space: nowrap; }
.site-header nav .sub-l a:hover { background: #1b2a45; }
@media (max-width: 720px) { .site-header nav .sub-l { position: static; box-shadow: none; border: 0; padding: 0 0 0 18px; min-width: 0; } }
.site-header nav .sub-l a { display: flex; align-items: center; gap: 9px; }
.site-header nav .sub-l .pi { flex: none; width: 25px; height: 25px; object-fit: contain; }
.site-header nav .sub-l .pi + .pi { margin-left: -11px; }

/* Sección de vídeos */
.vd { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.vd-player { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; box-shadow: 0 8px 28px rgba(0,0,0,.35); }
.vd-player iframe, .vd-poster { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vd-poster { padding: 0; background: #000; cursor: pointer; display: block; }
.vd-poster img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .92; transition: opacity .15s; }
.vd-poster:hover img { opacity: 1; }
.vd-play { position: absolute; left: 50%; top: 50%; width: 68px; height: 68px; margin: -34px 0 0 -34px; border-radius: 50%; background: rgba(15,27,45,.85); color: #fff; display: flex; align-items: center; justify-content: center; border: 2px solid rgba(255,255,255,.8); }
.vd-poster:hover .vd-play { background: var(--blue); }
.vd-title { font-size: 1.15rem; margin: 14px 0 8px; line-height: 1.3; }
.vd-list { display: flex; flex-direction: column; gap: 8px; max-height: 640px; overflow: auto; padding-right: 4px; }
.vd-item { display: flex; gap: 10px; align-items: center; text-align: left; padding: 6px; border-radius: 10px; border: 1px solid var(--line); background: var(--card, #fff); color: inherit; font: inherit; cursor: pointer; }
.vd-item:hover { border-color: var(--blue); }
.vd-item.on { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue) inset; }
.vd-th { flex: none; width: 118px; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: #111; }
.vd-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vd-tx { font-size: .86rem; line-height: 1.3; }
@media (max-width: 900px) { .vd { grid-template-columns: 1fr; } .vd-list { max-height: none; } }
.vd-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.vd-q { width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card, #fff); color: inherit; font: inherit; }
.vd-item[hidden] { display: none; }
.vd-shield { position: absolute; inset: 0 0 44px 0; cursor: pointer; }
.vd-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 12px; background: linear-gradient(transparent, rgba(0,0,0,.75)); color: #fff; opacity: 0; transition: opacity .2s; }
.vd-player:hover .vd-bar, .vd-player.paused .vd-bar, .vd-bar:focus-within { opacity: 1; }
.vd-bar button { background: none; border: 0; color: #fff; padding: 4px; cursor: pointer; display: inline-flex; border-radius: 6px; }
.vd-bar button:hover { background: rgba(255,255,255,.18); }
.vd-tm { font-size: .8rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vd-prog { flex: 1; height: 6px; background: rgba(255,255,255,.3); border-radius: 3px; cursor: pointer; position: relative; }
.vd-prog::before { content: ""; position: absolute; inset: -8px 0; }
.vd-prog i { display: block; height: 100%; width: 0; background: #e5484d; border-radius: 3px; }
.vd-player:fullscreen { border-radius: 0; background: #000; }
.vd-player:fullscreen iframe { position: absolute; }

/* Información del torneo al pasar el ratón por su tarjeta */
.tour-tip { position: fixed; z-index: 1300; width: 290px; background: #101a2e; color: #d8dde6; border: 1.5px solid #3a6ea5; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.55); padding: 11px 13px 10px; pointer-events: none; font-size: 13px; line-height: 1.4; }
.tour-tip[hidden] { display: none; }
.tour-tip .tp-h { font-weight: 700; font-size: 13.5px; color: #8fb8ee; margin-bottom: 7px; }
.tour-tip div b { display: inline-block; min-width: 98px; color: #9fb0c8; font-weight: 600; vertical-align: top; }
.tour-tip div span { display: inline-block; max-width: 150px; }
.tour-tip .tp-none { color: #9fb0c8; }
@media (hover: none) { .tour-tip { display: none; } }

/* Ficha FIDE del jugador (ventana del ojo en ELO) */
.ficha { flex: 1; overflow: auto; padding: 14px 22px 22px; }
.ficha[hidden], #stats-frame[hidden] { display: none; }
.ficha h3 { margin: 0; font-size: 1.35rem; color: #4da3ff; }
.ficha h4 { margin: 22px 0 10px; font-size: 1.05rem; color: #4da3ff; }
.ficha .fhead { display: flex; gap: 22px; margin-top: 14px; align-items: flex-start; flex-wrap: wrap; }
.ficha .fimg { flex: none; }
.ficha .fphoto { display: block; width: 170px; height: 210px; object-fit: cover; border: 1px solid var(--line); border-radius: 4px; background: var(--line); }
.ficha .av-xl { width: 170px; height: 210px; border-radius: 4px; font-size: 2.4rem; display: flex; align-items: center; justify-content: center; }
.ficha .av-xl img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }
.ficha dl { display: grid; grid-template-columns: max-content 1fr; gap: 9px 28px; margin: 0; align-content: start; }
.ficha dt { color: #4da3ff; font-weight: 600; }
.ficha dd { margin: 0; display: flex; align-items: center; gap: 6px; }
.ficha .fcard { background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px 8px; margin-bottom: 12px; }
.ficha .fcard h5 { margin: 0 0 8px; font-size: .95rem; font-weight: 600; }
.ficha .fb { margin-bottom: 10px; font-size: .9rem; }
.ficha .fb > span { display: block; margin-bottom: 3px; color: var(--muted); }
.ficha .fbar { display: flex; height: 26px; border-radius: 3px; overflow: hidden; }
.ficha .fbar i { font-style: normal; font-size: .82rem; font-weight: 600; color: #fff; display: flex; align-items: center; justify-content: center; min-width: 22px; }
.ficha .fbar .w { background: #0f5fae; }
.ficha .fbar .d { background: #a9abb3; }
.ficha .fbar .l { background: #454c57; }

/* Ficha más compacta */
#stats-dlg { width: min(640px, 95vw); height: min(82vh, 640px); }
#stats-dlg .dlg-head { padding: 10px 16px; }
.ficha { padding: 10px 16px 16px; font-size: .9rem; }
.ficha h3 { font-size: 1.15rem; }
.ficha h4 { margin: 14px 0 8px; font-size: .95rem; }
.ficha .fhead { gap: 16px; margin-top: 8px; }
.ficha .fphoto, .ficha .av-xl { width: 110px; height: 136px; }
.ficha .av-xl { font-size: 1.8rem; }
.ficha dl { gap: 4px 18px; }
.ficha .fcards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ficha .fcard { margin: 0; padding: 8px 10px 4px; }
.ficha .fcard h5 { margin-bottom: 5px; font-size: .88rem; }
.ficha .fb { margin-bottom: 6px; font-size: .8rem; }
.ficha .fbar { height: 20px; }
.ficha .fbar i { font-size: .72rem; min-width: 16px; }
@media (max-width: 520px) { .ficha .fcards { grid-template-columns: 1fr; } }

.ficha .fsep { height: 14px; }

/* La X de la ficha, arriba a la derecha */
#stats-dlg .dlg-head { justify-content: space-between; }
#stats-dlg .dlg-head h3 { margin: 0; }
#stats-dlg #stats-cerrar { margin-left: auto; }

/* Cabecera en el móvil: el menú puede ocupar varias líneas sin pisar el contenido */
@media (max-width: 720px) {
  .bar { height: auto; min-height: 64px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; row-gap: 6px; }
  .site-header nav { row-gap: 6px; }
}
