:root {
  --bg: #f4f1e8;
  --card: #fffdf7;
  --ink: #1b1d1a;
  --muted: #6b6e66;
  --line: #ddd7c7;
  --line-2: #ebe6d8;
  --accent: #c8102e;
  --accent-ink: #fff;
  --hit: #1d7f47;
  --hit-bg: #d5eedd;
  --miss: #b83226;
  --miss-bg: #f5d9d3;
  --live: #c98a00;
  --live-bg: #fbedc7;
  --pend-bg: #efebdf;
  --b1: #2f6fb3;
  --bx: #8a8f84;
  --b2: #c26a1d;
  --radius: 12px;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111411;
    --card: #181c18;
    --ink: #ebeae3;
    --muted: #979b91;
    --line: #2d332d;
    --line-2: #232823;
    --accent: #e0334d;
    --hit: #5fd08d;
    --hit-bg: #16382a;
    --miss: #f08070;
    --miss-bg: #3e1e1a;
    --live: #f0b429;
    --live-bg: #3a2f10;
    --pend-bg: #1f241f;
    --b1: #6aa5e6;
    --bx: #9aa094;
    --b2: #e69a55;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 var(--sans);
  font-variant-numeric: tabular-nums;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h2 { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; font-weight: 650; }

/* ---------- cabecera ---------- */
.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.top-in { max-width: 1320px; margin: 0 auto; padding: 10px 16px 6px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.marca { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo {
  font: 700 13px/1 var(--mono); background: var(--accent); color: var(--accent-ink);
  padding: 9px 7px; border-radius: 9px; letter-spacing: .02em; flex: none;
}
.pena { font-weight: 750; font-size: 16px; line-height: 1.1; }
#selJornada {
  border: 0; background: transparent; padding: 0; color: var(--muted); font-size: 13px; max-width: 58vw;
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: right 2px top 55%, right -3px top 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 14px;
}
.estado-conexion { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.punto { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.estado-conexion.ok .punto { background: var(--hit); box-shadow: 0 0 0 0 var(--hit); animation: latido 2s infinite; }
.estado-conexion.ko .punto { background: var(--miss); }
.estado-conexion.ok.pausa .punto { background: var(--live); animation: none; }
.estado-conexion.pausa { color: var(--live); font-weight: 600; }
.warn { color: var(--live); font-weight: 600; }
@keyframes latido { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--hit) 60%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.tabs { max-width: 1320px; margin: 0 auto; display: flex; gap: 2px; padding: 0 10px; overflow-x: auto; scrollbar-width: none; }
.tabs button {
  border: 0; background: none; padding: 9px 10px 10px; color: var(--muted); font-weight: 600; font-size: 14px;
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }

.vista { max-width: 1320px; margin: 0 auto; padding: 16px 16px 80px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.vacio { text-align: center; padding: 48px 16px; color: var(--muted); }

/* ---------- resumen ---------- */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; min-width: 0; }
.kpi .lbl { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi .val { font-size: 30px; font-weight: 750; line-height: 1.15; letter-spacing: -.01em; margin-top: 2px; }
.kpi .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.kpi.destacado { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.kpi.destacado .lbl, .kpi.destacado .sub { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.val .de { font-size: 16px; font-weight: 600; opacity: .55; }
@media (max-width: 760px) { .kpi .val { font-size: 26px; } }

/* partidos en juego: ¿qué pasa si…? */
.envivo { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 0 14px; }
.vivo-card { border-color: color-mix(in srgb, var(--live) 60%, var(--line)); box-shadow: inset 4px 0 0 var(--live); padding: 12px 14px 8px 18px; }
.vivo-cab { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.vivo-est { font: 700 12px var(--mono); color: var(--live); white-space: nowrap; }
.vivo-nom { flex: 1; min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vivo-gol { font: 750 22px var(--mono); }
.escen th, .escen td { padding: 5px 6px; }
.escen td:first-child small { color: var(--muted); font-size: 11.5px; }
.escen .sgn { display: inline-grid; place-items: center; width: 24px; height: 22px; border-radius: 5px; font: 700 13px var(--mono); background: var(--pend-bg); }
.escen tr.actual td { font-weight: 700; background: var(--live-bg); }
.escen tr.actual .sgn { background: var(--live); color: #1b1d1a; }
.escen tr:not(.premio) td { color: var(--muted); }

.grid-2 { display: grid; grid-template-columns: 1.1fr 1fr; gap: 14px; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }

table.tabla { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabla th { text-align: right; font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.tabla td { text-align: right; padding: 7px 8px; border-bottom: 1px solid var(--line-2); }
.tabla th:first-child, .tabla td:first-child { text-align: left; }
.tabla tr.premio td:first-child { font-weight: 700; }
.tabla tr.cero td { color: var(--muted); }
.tabla .tiene { font-weight: 750; }
.cat { display: inline-flex; align-items: center; gap: 6px; }
.cat i { width: 8px; height: 8px; border-radius: 2px; background: var(--line); display: inline-block; }
.premio .cat i { background: var(--accent); }
.barra-dist { height: 6px; background: var(--line-2); border-radius: 3px; overflow: hidden; min-width: 50px; }
.barra-dist span { display: block; height: 100%; background: var(--ink); opacity: .75; }

.aviso { background: var(--live-bg); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; margin-bottom: 14px; }

/* ---------- partidos ---------- */
.partidos { display: grid; gap: 8px; }
.partido {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px;
  display: grid; grid-template-columns: 26px 1fr auto; gap: 4px 12px; align-items: center;
}
.partido.jugando { border-color: color-mix(in srgb, var(--live) 70%, var(--line)); box-shadow: inset 3px 0 0 var(--live); }
.partido .num { font: 700 13px var(--mono); color: var(--muted); }
.partido .nom { font-weight: 650; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.partido .det { grid-column: 2 / 4; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12.5px; color: var(--muted); align-items: center; }
.res { display: flex; align-items: center; gap: 8px; }
.marcador { font: 700 15px var(--mono); }
.chip {
  font: 750 15px/1 var(--mono); min-width: 32px; height: 32px; padding: 0 6px; border-radius: 8px; display: inline-grid; place-items: center;
  background: var(--pend-bg); color: var(--muted);
}
.chip.ok { background: var(--ink); color: var(--bg); }
.chip.live { background: var(--live-bg); color: var(--live); outline: 2px solid color-mix(in srgb, var(--live) 50%, transparent); }
.badge { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 6px; border-radius: 5px; margin-left: 6px; vertical-align: 2px; }
.badge.jugando { background: var(--live-bg); color: var(--live); }
.badge.final { background: var(--pend-bg); color: var(--muted); }
.reparto { display: flex; height: 6px; width: 120px; border-radius: 3px; overflow: hidden; background: var(--line-2); }
.reparto span { display: block; height: 100%; opacity: .35; }
.reparto span.on { opacity: 1; }
.r1 { background: var(--b1); } .rx { background: var(--bx); } .r2 { background: var(--b2); }
.cuenta b { color: var(--ink); font-weight: 650; }
.cuenta .s { font-family: var(--mono); font-weight: 700; margin-right: 2px; }
.cuenta .s.on { color: var(--hit); }

.edit { grid-column: 1 / 4; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 8px; margin-top: 4px; border-top: 1px dashed var(--line); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg button { border: 0; background: var(--card); padding: 7px 12px; font-weight: 700; font-family: var(--mono); min-width: 40px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--ink); color: var(--bg); }
.seg.estado button { font-family: var(--sans); font-weight: 600; font-size: 13px; }
.seg.estado button.on.jugando { background: var(--live); color: #1b1d1a; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.stepper button { border: 0; background: var(--card); width: 34px; height: 34px; font-weight: 700; font-size: 17px; }
.stepper span { min-width: 26px; text-align: center; font: 700 15px var(--mono); }
.goles { display: inline-flex; align-items: center; gap: 6px; }
.p15sel { display: inline-flex; gap: 6px; align-items: center; }
.p15sel select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); font-family: var(--mono); font-weight: 700; }

.flash { animation: flash 2.2s ease-out; }
@keyframes flash { 0% { background: var(--live-bg); } 100% { background: var(--card); } }

/* ---------- columnas ---------- */
.filtros { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.filtros label { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.filtros select, .filtros input[type=search] { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.matriz-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
table.matriz { border-collapse: separate; border-spacing: 0; font: 700 13px var(--mono); width: 100%; }
.matriz th, .matriz td { padding: 0; text-align: center; height: 28px; min-width: 26px; border-bottom: 1px solid var(--line-2); }
.matriz thead th { position: sticky; top: 0; background: var(--card); color: var(--muted); font-size: 11px; font-weight: 600; z-index: 1; }
.matriz thead tr.resfila th { color: var(--ink); font-size: 13px; font-weight: 750; border-bottom: 1px solid var(--line); height: 30px; }
.matriz thead tr.resfila th.live { color: var(--live); }
.matriz .ncol { text-align: left; padding: 0 10px; color: var(--muted); font-weight: 600; min-width: 54px; position: sticky; left: 0; background: var(--card); white-space: nowrap; }
.matriz .ncol small { font-family: var(--sans); font-weight: 500; margin-left: 4px; }
.matriz td.s span { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 5px; }
.matriz td.s.h span { background: var(--hit-bg); color: var(--hit); }
.matriz td.s.m span { background: var(--miss-bg); color: var(--miss); }
.matriz td.s.h.lv span, .matriz td.s.m.lv span { outline: 1.5px dashed var(--live); outline-offset: -1px; }
.matriz td.s.p span { color: var(--ink); }
.matriz .sep { border-left: 1px solid var(--line); }
.matriz .ac b { display: inline-block; min-width: 24px; padding: 2px 4px; border-radius: 6px; text-align: center; margin-right: 8px; color: var(--ink); }
.ac.c10 b { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.ac.c11 b { background: color-mix(in srgb, var(--accent) 35%, transparent); }
.ac.c12 b, .ac.c13 b, .ac.c14 b { background: var(--accent); color: var(--accent-ink); }
.matriz tr.lider .ncol { color: var(--ink); }
.matriz tbody tr:hover td { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.matriz .grupo td { border-left: 0; }
.matriz .b4 { border-right: 1px solid var(--line); }

/* ---------- ajustes ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px 12px; }
.campo { display: grid; gap: 4px; }
.campo span { font-size: 12px; color: var(--muted); font-weight: 600; }
.campo input, .campo select, textarea, .tpartidos input {
  border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 8px 10px; width: 100%; min-width: 0;
}
textarea { font-family: var(--mono); font-size: 13px; line-height: 1.5; resize: vertical; }
.tpartidos { width: 100%; border-collapse: collapse; }
.tpartidos th { font-size: 12px; color: var(--muted); text-align: left; padding: 4px; font-weight: 600; }
.tpartidos td { padding: 3px 4px; }
.tpartidos td:first-child { font: 700 12px var(--mono); color: var(--muted); width: 34px; }
.tpartidos .pc { width: 64px; text-align: right; }
.botones { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.btn { border: 1px solid var(--line); background: var(--card); border-radius: 9px; padding: 9px 14px; font-weight: 650; }
.btn.prim { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.peligro { color: var(--miss); }
.btn:disabled { opacity: .5; cursor: default; }
.rol { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: var(--pend-bg); }
.rol.admin { background: var(--ink); color: var(--bg); }
.rol.editor { background: var(--live-bg); color: var(--live); }
.err { color: var(--miss); font-size: 13px; }
.okmsg { color: var(--hit); font-size: 13px; }
details summary { cursor: pointer; font-weight: 650; }

/* ---------- toasts ---------- */
.toasts { position: fixed; bottom: calc(16px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 50; width: min(420px, calc(100% - 32px)); }
.toast { background: var(--ink); color: var(--bg); padding: 11px 14px; border-radius: 10px; font-size: 14px; box-shadow: 0 6px 24px rgba(0,0,0,.25); animation: entra .25s ease-out; }
.toast b { font-family: var(--mono); }
@keyframes entra { from { transform: translateY(10px); opacity: 0; } }

.tabla td.nw { white-space: nowrap; }
@media (max-width: 600px) {
  .estado-conexion .cnt { display: none; }
  .partido .nom { white-space: normal; }
  .col-barra, .col-acert { display: none; }
  .matriz { font-size: 12px; }
  .tabla { font-size: 13px; }
  .tabla th, .tabla td { padding: 6px 4px; }
  .card { padding: 14px 12px; }
  .matriz th, .matriz td { min-width: 20px; }
  .matriz td.s span { width: 18px; height: 20px; border-radius: 4px; }
  .matriz .ncol { padding: 0 6px; min-width: 0; }
  .matriz .ncol small { display: none; }
  .matriz .ac b { margin-right: 4px; }
}

/* ---------- directo: partidos + columnas en vertical ---------- */
.directo { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
@media (max-width: 1000px) { .directo { grid-template-columns: minmax(0, 1fr); } }
.directo aside .card { margin-bottom: 14px; }
.directo aside .tabla th, .directo aside .tabla td { padding: 6px 4px; }
.directo aside .tabla td.nw { font-size: 12.5px; white-space: nowrap; }
.tablero-card { padding: 14px 0 10px; }
.tablero-cab { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 0 14px 10px; }
.tablero-cab h2 { margin: 0; }
.controles { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 13px; }
.controles select { border: 1px solid var(--line); border-radius: 7px; padding: 3px 6px; background: var(--bg); margin-left: 4px; }
.controles input { accent-color: var(--accent); vertical-align: -2px; }
.tablero-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-top: 1px solid var(--line); }

table.tablero { border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tablero th, .tablero td { padding: 0; height: 28px; border-bottom: 1px solid var(--line-2); }
.tablero tr.b4 > * { border-bottom: 2px solid var(--line); }
.tablero tbody tr:hover > * { background-color: color-mix(in srgb, var(--ink) 5%, var(--card)); }

/* columna fija con los partidos */
.tablero .pt { position: sticky; left: 0; z-index: 2; background: var(--card); border-right: 1px solid var(--line); text-align: left; font-weight: 400; }
.tablero .pt > div { display: flex; align-items: center; gap: 6px; width: 400px; padding: 0 8px 0 12px; }
.tablero .pt .num { width: 18px; flex: none; color: var(--muted); font-size: 12px; text-align: right; }
.tablero .pt .nom { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; font-size: 13px; }
.tablero .pt .gol { width: 34px; flex: none; text-align: center; font: 700 13px var(--mono); }
.tablero .pt .cober { display: flex; gap: 2px; flex: none; width: 72px; justify-content: center; font-size: 11px; color: var(--muted); }
.tablero .pt .sg { width: 24px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 5px; font: 700 13px var(--mono); }
.tablero .pt .sg.ok { background: var(--ink); color: var(--bg); }
.tablero .pt .sg.live { background: var(--live-bg); color: var(--live); outline: 2px solid color-mix(in srgb, var(--live) 50%, transparent); }
.tablero thead .pt, .tablero tfoot .pt { color: var(--muted); font-size: 12px; }
.tablero thead .pt .nom, .tablero tfoot .pt .nom { font-weight: 600; font-size: 12px; color: var(--muted); }
.cob {
  width: 22px; height: 20px; display: grid; place-items: center; border-radius: 4px; font: 600 10.5px var(--mono); color: var(--ink);
  background: var(--pend-bg);
}
.cob.cero { color: var(--muted); }
.cob.h { background: var(--hit-bg); color: var(--hit); font-weight: 800; }
.cob.m { background: var(--miss-bg); color: var(--miss); font-weight: 800; }
.cob.p { outline: 2px solid var(--ink); outline-offset: -2px; font-weight: 800; }
.cob.lv { box-shadow: inset 0 -3px 0 var(--live); }
.cob.res { outline: 2px solid var(--ink); outline-offset: -1px; font-weight: 800; }
.cob-p15 { font-size: 11px; color: var(--muted); }
.vivo { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--live); margin-right: 5px; vertical-align: 1px; animation: parpadeo 1.4s infinite; }
@keyframes parpadeo { 50% { opacity: .25; } }
.tablero tr.jugando .pt { box-shadow: inset 3px 0 0 var(--live); }
.tablero tr.fila-p15 > * { border-top: 2px solid var(--line); }

/* celdas de las columnas */
.tablero th.ch { min-width: 26px; font-size: 11px; font-weight: 600; color: var(--muted); text-align: center; padding: 0 1px; }
.tablero td.c { width: 26px; min-width: 26px; text-align: center; font: 700 13px var(--mono); border-left: 1px solid var(--line-2); }
/* los aciertos son la norma: sin fondo, para que los fallos y el partido en juego destaquen */
.c.h { color: color-mix(in srgb, var(--hit) 75%, var(--card)); }
.c.m { color: var(--miss); font-weight: 800; }
.c.p { color: var(--ink); font-weight: 500; }
.tablero td.c.lv { box-shadow: inset 0 -3px 0 var(--live); }
.tablero tr.jugando td.c { background: var(--live-bg); }
.tablero tr.jugando td.c.h { color: var(--hit); }
.tablero tr.jugando .pt { background: color-mix(in srgb, var(--live-bg) 55%, var(--card)); }
.c.p15 { font-size: 11px; }
/* pleno al 15: casi siempre se falla, así que el fallo va neutro y el acierto destaca */
.tablero tr.fila-p15 td.c.m { background: none; color: var(--muted); font-weight: 500; }
.tablero tr.fila-p15 td.c.h { background: var(--hit-bg); color: var(--hit); }
.tablero .fuera { opacity: .32; }
.tablero .gs { border-left: 2px solid var(--muted) !important; }
.tablero thead tr.tot > * { height: 30px; border-bottom: 2px solid var(--line); }
.tablero thead tr.tot td { text-align: center; font: 750 14px var(--mono); border-left: 1px solid var(--line-2); }
.tablero thead tr.tot .nom { color: var(--ink) !important; font-weight: 700 !important; }
.tablero thead tr.tot td.premio { color: var(--accent); }
.tablero tbody tr.flash > * { animation: flash 2.2s ease-out; }

.leyenda { margin: 10px 14px 0; line-height: 2; }
.leyenda .c { display: inline-block; width: 20px; height: 20px; line-height: 20px; text-align: center; border-radius: 4px; font: 700 12px var(--mono); margin: 0 3px 0 8px; vertical-align: middle; }
.leyenda .c:first-child { margin-left: 0; }
.leyenda .c.p, .leyenda .c.h { border: 1px solid var(--line); }
.leyenda .c.lv { box-shadow: inset 0 -3px 0 var(--live); background: var(--live-bg); color: var(--hit); }

.total-premio { display: flex; justify-content: space-between; align-items: baseline; margin-top: 12px; padding-top: 10px; border-top: 2px solid var(--line); }
.total-premio b { font-size: 22px; }
.total-premio small { color: var(--muted); }
details.card summary { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

@media (max-width: 640px) {
  .tablero .pt > div { width: 190px; gap: 4px; padding: 0 6px 0 8px; }
  .tablero .pt .cober { display: none; }
  .tablero .pt .num { width: 16px; }
  .tablero .pt .gol { width: 28px; font-size: 12px; }
  .tablero td.c, .tablero th.ch { min-width: 24px; width: 24px; }
}

/* marcador en directo y gestión */
/* resultado o, si aún no hay, día y hora en dos líneas; el minuto va junto al nombre */
.tablero .pt .gol { width: 40px; }
.tablero .pt .gol.lv { color: var(--live); }
.tablero .pt .gol small { display: block; font: 500 10px/1.1 var(--sans); color: var(--muted); white-space: nowrap; }
.tablero .pt .min { font: 700 11px var(--mono); color: var(--live); margin-right: 5px; }
.vista.gestion { padding-top: 0; }
.vista.gestion .card { margin-bottom: 0; }
.fila-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.fila-form input { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--bg); max-width: 200px; }
.gestion-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.gestion-grid .small { margin-top: 6px; }
.campo input[type="file"] { border: 0; padding: 4px 0; background: none; }
@media (max-width: 640px) {
  .gestion-grid { grid-template-columns: 1fr; }
  .tablero .pt .gol { width: 40px; }
  .tablero .pt .gol small { font-size: 9.5px; }
}
#vista { padding-bottom: 0; }
.vista.gestion { padding-bottom: 60px; }
@media (max-width: 640px) {
  .tablero tbody .pt .nom { display: grid; grid-template-columns: auto 1fr; white-space: normal; font-size: 11.5px; line-height: 1.1; }
  .tablero tbody .pt .nom .enjuego { grid-row: span 2; align-self: center; display: flex; flex-direction: column; align-items: center; }
  .tablero tbody .pt .nom .enjuego .min { margin: 1px 4px 0 0; font-size: 10px; }
  .tablero tbody .pt .nom .eq { grid-column: -2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tablero tbody .pt .nom .sep { display: none; }
  .tablero th, .tablero td { height: 32px; }
}

/* peña como en Losilla: 1 · X · 2 siempre; apagado el signo que no lleva nadie, relleno el resultado */
.tablero .pt .cober { gap: 3px; width: 78px; }
.cob { width: 22px; height: 22px; font: 700 12.5px var(--mono); color: var(--ink); background: none; box-shadow: inset 0 0 0 1px var(--line); }
.cob.cero { color: color-mix(in srgb, var(--muted) 45%, var(--card)); box-shadow: inset 0 0 0 1px var(--line-2); font-weight: 500; }
.cob.res { background: var(--ink); color: var(--bg); box-shadow: none; outline: 0; }
.cob.res.lv { background: var(--live); color: #1b1d1a; }
.cob.res.nadie { background: var(--miss); color: #fff; }
.tablero .pt .cober-tit { font-size: 12px; font-weight: 600; color: var(--muted); }

/* tres indicadores: mejor columna, partidos y apuestas jugadas */
.kpis { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 600px) {
  .kpis { gap: 8px; }
  .kpi { padding: 10px; }
  .kpi .val { font-size: 22px; }
  .val .de { font-size: 13px; }
}

/* tarjeta del partido en juego cuando el máximo no depende del resultado */
.escen-nota { margin: 0 0 4px; }
.escen-nota b { color: var(--ink); }

/* leyenda desplegable junto a los controles */
.leyenda-d { position: relative; }
.leyenda-d summary { list-style: none; cursor: pointer; color: var(--muted); font-size: 13px; white-space: nowrap; }
.leyenda-d summary::-webkit-details-marker { display: none; }
.leyenda-d[open] summary { color: var(--ink); }
.leyenda-d .leyenda {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; margin: 0; width: min(380px, calc(100vw - 48px));
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  box-shadow: 0 6px 24px rgba(0,0,0,.12);
}
@media (max-width: 640px) { .leyenda-d .leyenda { right: auto; left: 0; } }

/* el signo del resultado ya va relleno en la Peña: la casilla aparte sólo hace falta en el móvil, donde la Peña no se ve */
@media (min-width: 641px) { .tablero .pt .sg { display: none; } }
