:root {
  --bg: #0e1130; --bg2: #151a44; --panel: #1a2052; --panel2: #232a66; --line: #2f377a;
  --text: #eef0ff; --muted: #9aa1d4; --accent: #3ad6ff; --live: #ff2e4d; --ok: #38d98a; --warn: #ffb648;
  --gold: #f2c14e; --silver: #c9d1e3; --bronze: #d08a52;
  --disp: 'Saira Condensed', 'Arial Narrow', system-ui, sans-serif;
  --body: 'Saira', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --r: 14px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); font-size: 15px; }
body { min-height: 100dvh; overscroll-behavior-y: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Estructura ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  background: linear-gradient(180deg, var(--bg) 70%, rgba(14,17,48,0)); }
.brand { font-family: var(--disp); font-weight: 800; font-size: 24px; letter-spacing: .01em; line-height: 1; }
.brand small { display: block; font-family: var(--body); font-weight: 500; font-size: 12px; color: var(--muted); letter-spacing: 0; margin-top: 3px; }
.sync-dot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.sync-dot.on { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
main { padding: 4px 14px 96px; max-width: 760px; margin: 0 auto; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--bg2); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs.five { grid-template-columns: repeat(5, 1fr); }
.tab { background: none; border: 0; padding: 10px 2px 9px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--muted); font-size: 12px; font-weight: 600; }
.tab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab.on { color: var(--text); }
.tab.on svg { stroke: var(--accent); }
@media (min-width: 900px) {
  .tabs { position: sticky; top: 58px; bottom: auto; max-width: 760px; margin: 0 auto 8px; border: 1px solid var(--line); border-radius: var(--r); }
  main { padding-bottom: 40px; }
}
h2 { font-family: var(--disp); font-weight: 800; font-size: 28px; margin: 14px 2px 12px; line-height: 1; }
h3 { font-family: var(--disp); font-weight: 700; font-size: 20px; margin: 18px 2px 10px; color: var(--muted); }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--r); }
.bar { display: flex; gap: 8px; align-items: center; margin: 0 0 12px; flex-wrap: wrap; }
.bar > .grow { flex: 1; }
select, input[type=text], input[type=password], input[type=number], input[type=datetime-local] {
  background: var(--panel); border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px; max-width: 100%; }
select { padding-right: 30px; }
.btn { border: 1.5px solid var(--line); background: var(--panel2); border-radius: 10px; padding: 10px 14px; min-height: 44px; font-weight: 700; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #06122a; }
.btn.danger { background: transparent; border-color: #6e2a3c; color: #ff8fa3; }
.btn.small { min-height: 36px; padding: 6px 10px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: var(--panel2); color: var(--muted); }
.chip.live { background: var(--live); color: #fff; }
.chip.ok { background: rgba(56,217,138,.15); color: var(--ok); }
.chip.warn { background: rgba(255,182,72,.15); color: var(--warn); }

/* ---------- Logos ---------- */
.logo { --s: 40px; width: var(--s); height: var(--s); border-radius: 50%; flex: none; display: grid; place-items: center; overflow: hidden;
  background: var(--tc, #3f7fe5); box-shadow: 0 0 0 2px rgba(0,0,0,.35); font-family: var(--disp); font-weight: 800; font-size: calc(var(--s) * .42); color: #fff; }
.logo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Tarjetas de partido ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.mcard { display: flex; flex-direction: column; align-items: stretch; gap: 6px; background: none; border: 0; padding: 0; text-align: center; }
.mcard .live-tag { align-self: center; font-family: var(--disp); font-weight: 800; font-size: 15px; color: var(--live); letter-spacing: .08em; height: 18px; line-height: 18px; }
.mcard .live-tag.blink { animation: blink 1s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }
.mbox { position: relative; border-radius: var(--r); padding: 18px 10px 14px; overflow: hidden;
  background: radial-gradient(120% 90% at 0% 50%, color-mix(in srgb, var(--hc) 38%, transparent), transparent 60%),
              radial-gradient(120% 90% at 100% 50%, color-mix(in srgb, var(--ac) 38%, transparent), transparent 60%), var(--panel);
  border: 1.5px solid var(--line); }
.mcard.is-live .mbox { border-color: var(--live); }
.mvs { display: flex; align-items: center; justify-content: center; gap: 10px; }
.mvs .logo { --s: 54px; transition: --s .3s; }
.mcard.is-live .mvs .logo { --s: 38px; }
.mvs b { font-family: var(--disp); font-weight: 800; font-size: 22px; font-style: italic; color: var(--muted); }
.mnames { display: flex; justify-content: space-between; gap: 6px; margin-top: 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.mnames span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mscore { font-family: var(--disp); font-weight: 800; font-size: 30px; line-height: 1; margin-top: 8px; font-variant-numeric: tabular-nums; }
.mclock { font-family: var(--disp); font-weight: 700; font-size: 15px; color: var(--live); font-variant-numeric: tabular-nums; }
.mclock.gold { color: var(--gold); }
.mtime { font-family: var(--disp); font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
.mdate { font-size: 12px; color: var(--muted); margin-top: -4px; }

/* ---------- Listas ---------- */
.list { display: flex; flex-direction: column; gap: 8px; max-height: calc(100dvh - 230px); overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding-right: 2px; overscroll-behavior: contain; }
.day { font-family: var(--disp); font-weight: 700; color: var(--muted); font-size: 15px; margin: 10px 2px 2px; position: sticky; top: 0; background: var(--bg); padding: 4px 0; z-index: 1; }
.row { display: grid; grid-template-columns: 52px 1fr auto 1fr; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px; text-align: left; width: 100%; }
button.row:active { background: var(--panel2); }
.row .when { font-family: var(--disp); font-weight: 700; font-size: 16px; color: var(--muted); font-variant-numeric: tabular-nums; }
.row .side { display: flex; align-items: center; gap: 8px; min-width: 0; }
.row .side.r { flex-direction: row-reverse; text-align: right; }
.row .side > span:not(.logo) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.row .logo { --s: 28px; }
.row .mid { font-family: var(--disp); font-weight: 800; font-size: 20px; min-width: 56px; text-align: center; font-variant-numeric: tabular-nums; }
.row .mid.hide { color: var(--muted); font-size: 14px; letter-spacing: .1em; }
.row .mid small { display: block; font-size: 11px; color: var(--gold); font-weight: 700; letter-spacing: 0; }
.row.win-h .side.l span, .row.win-a .side.r span { color: #fff; }
.row.win-h .side.r span, .row.win-a .side.l span { color: var(--muted); font-weight: 500; }

/* ---------- Clasificación ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--r); border: 1px solid var(--line); }
table.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; min-width: 520px; }
.tbl th { font-family: var(--disp); font-weight: 700; font-size: 14px; color: var(--muted); padding: 10px 6px; text-align: center; background: var(--bg2); }
.tbl td { padding: 9px 6px; text-align: center; border-top: 1px solid var(--line); }
.tbl .tm { text-align: left; }
.tbl .tm div { display: flex; align-items: center; gap: 8px; font-weight: 600; white-space: nowrap; }
.tbl .logo { --s: 26px; }
.tbl .pts { font-family: var(--disp); font-weight: 800; font-size: 18px; }
.tbl .pos b { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; font-family: var(--disp); font-weight: 800; }
.tbl tr.p1 .pos b { background: var(--gold); color: #2a1d00; }
.tbl tr.p2 .pos b { background: var(--silver); color: #1b2030; }
.tbl tr.p3 .pos b { background: var(--bronze); color: #2a1300; }
.tbl tr.p1 { background: rgba(242,193,78,.08); }
.tbl tr.p2 { background: rgba(201,209,227,.06); }
.tbl tr.p3 { background: rgba(208,138,82,.07); }
.tbl .dg.pos-v { color: var(--ok); } .tbl .dg.neg-v { color: #ff8fa3; }

/* ---------- Reproductor ---------- */
.watch { position: fixed; inset: 0; z-index: 50; background: #0b0f26; display: flex; flex-direction: column; }
.watch-top { display: flex; align-items: center; gap: 10px; padding: 8px 10px; padding-top: max(8px, env(safe-area-inset-top)); }
.watch-top .btn { min-height: 38px; }
.watch-top .t { font-family: var(--disp); font-weight: 700; font-size: 17px; flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.watch-body { flex: 1; min-height: 0; display: flex; }
.viewer { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.bug { display: grid; grid-template-columns: 1fr auto 1fr; height: 58px; flex: none; }
.bug-team { display: flex; align-items: center; gap: 8px; padding: 0 10px; background: var(--tc); min-width: 0;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.25); }
.bug-team.away { justify-content: flex-end; }
.bug-team.home { justify-content: flex-start; }
.bug-name { font-family: var(--disp); font-weight: 700; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0;
  text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.bug-team.away .bug-name { text-align: right; }
.bug-score { font-family: var(--disp); font-weight: 800; font-size: 34px; font-variant-numeric: tabular-nums; text-shadow: 0 2px 4px rgba(0,0,0,.5); }
.bug-logo { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; flex: none; box-shadow: 0 0 0 2px rgba(0,0,0,.35); background: rgba(0,0,0,.2); }
.bug-logo:empty { display: none; }
.bug-logo img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 420px) { .bug-name { display: none; } }
.bug-clock { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 108px; padding: 0 12px; background: var(--bg2); }
.clk { font-family: var(--disp); font-weight: 800; font-size: 27px; line-height: 1; font-variant-numeric: tabular-nums; }
.clk-sub { font-size: 11px; color: var(--muted); font-weight: 600; min-height: 13px; }
.clk-sub.extra { color: var(--ok); }
.clk-sub:empty { display: none; }
.gsem { display: none; flex-direction: column; align-items: center; gap: 4px; }
.bug-clock.golden .clk, .bug-clock.golden .clk-sub { display: none; }
.bug-clock.golden .gsem { display: flex; }
.gtitle { font-family: var(--disp); font-size: 13px; font-weight: 800; color: var(--gold); line-height: 1; }
.gleds { display: flex; gap: 3px; align-items: center; }
.led { width: var(--ls, 12px); height: var(--ls, 12px); border-radius: 50%; border: 2px solid #4a5268; background: #1c2038; }
.led.gap { margin-left: 7px; }
.led.g.on { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 7px var(--gold); }
.led.b.on { background: #fff; border-color: #fff; box-shadow: 0 0 7px #fff; }
.gbar { width: 96px; height: 4px; border-radius: 2px; background: #2a3050; overflow: hidden; }
.gbar i { display: block; height: 100%; width: 100%; }
.stage { position: relative; flex: 1; min-height: 0; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.v-live { position: absolute; top: 10px; right: 10px; z-index: 3; background: var(--live); color: #fff; font-family: var(--disp); font-weight: 800;
  padding: 2px 10px; border-radius: 6px; letter-spacing: .08em; animation: blink 1s steps(2, start) infinite; }
.v-extra { display: none; position: absolute; top: 10px; left: 10px; z-index: 3; padding: 6px 10px; border-radius: 8px; background: rgba(11,15,38,.85);
  border: 1.5px solid var(--ok); font-size: 13px; font-weight: 700; }
.v-extra.show { display: block; }
.v-replay { display: none; position: absolute; top: 8px; left: 10px; z-index: 3; font-size: 26px; animation: blink 0.8s steps(2, start) infinite; }
.v-replay.show { display: block; }
@keyframes pulse { 50% { opacity: .35; transform: scale(.9); } }
.v-cd { display: none; position: absolute; left: 50%; top: 27%; transform: translate(-50%, -50%); font-family: var(--disp); font-weight: 800;
  font-size: clamp(72px, 24vw, 140px); line-height: 1; text-shadow: 0 2px 14px rgba(0,0,0,.65); pointer-events: none; }
.v-cd.show { display: block; }
.v-flash { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.9); font-family: var(--disp); font-weight: 800;
  font-size: clamp(28px, 8vw, 54px); padding: 10px 22px; border-radius: 12px; background: rgba(11,15,38,.82); opacity: 0; pointer-events: none;
  transition: opacity .15s, transform .15s; white-space: pre-line; text-align: center; line-height: 1.1; max-width: 92%; }
.v-flash.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.v-final { display: none; position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); text-align: center; padding: 14px 28px;
  border-radius: 14px; background: rgba(11,15,38,.86); pointer-events: none; }
.v-final.show { display: block; }
.v-final .ft { font-family: var(--disp); font-weight: 800; font-size: clamp(54px, 18vw, 104px); line-height: 1; letter-spacing: .04em; }
.v-final .fs { font-family: var(--disp); font-weight: 700; font-size: clamp(18px, 5vw, 28px); color: var(--muted); margin-top: 6px; }
.v-wait { display: none; position: absolute; inset: 0; z-index: 4; place-items: center; font-family: var(--disp); font-weight: 700; font-size: 22px;
  background: rgba(11,15,38,.7); }
.v-wait.show { display: grid; }
.v-sound { position: absolute; bottom: 10px; right: 10px; z-index: 5; width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.6);
  background: rgba(11,15,38,.6); font-size: 18px; line-height: 1; }
.vctl { display: flex; align-items: center; gap: 10px; padding: 10px 12px; padding-bottom: max(10px, env(safe-area-inset-bottom)); background: var(--bg2); }
.vctl input[type=range] { flex: 1; accent-color: var(--accent); height: 28px; }
.vbtn { width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--panel2); display: grid; place-items: center; padding: 0; }
.vbtn svg { width: 18px; height: 18px; fill: currentColor; }
.vspeed { width: auto; border-radius: 10px; padding: 0 10px; font-family: var(--disp); font-weight: 800; }
.vtime { font-family: var(--disp); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; }

/* ---------- Admin ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.login form { width: min(100%, 360px); display: flex; flex-direction: column; gap: 14px; }
.login h1 { font-family: var(--disp); font-weight: 800; font-size: 36px; margin: 0 0 6px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); }
.field input { width: 100%; }
.field .err { font-size: 12px; color: #ff8fa3; min-height: 15px; }
.field input.bad { border-color: #8a3348; }
.msg { font-size: 13px; color: #ff8fa3; min-height: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-bottom: 14px; }
.card > h3:first-child { margin-top: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 480px) { .grid2 { grid-template-columns: 1fr; } }
.swrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.swrow:last-child { border-bottom: 0; }
.sw { appearance: none; -webkit-appearance: none; flex: none; width: 48px; height: 28px; border-radius: 14px; background: #343c7a; position: relative; margin: 0; transition: background .15s; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #e8ebff; transition: transform .15s; }
.sw:checked { background: var(--ok); }
.sw:checked::after { transform: translateX(20px); }
.srow { padding: 9px 0; }
.shead { display: flex; justify-content: space-between; margin-bottom: 4px; }
.shead output { font-family: var(--disp); font-weight: 800; font-size: 17px; }
.srow input[type=range] { width: 100%; accent-color: var(--accent); height: 28px; touch-action: pan-y; }
.info { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-left: 6px; border-radius: 50%; border: 1.5px solid currentColor;
  background: none; color: var(--muted); font: italic 700 12px/1 Georgia, serif; padding: 0; vertical-align: middle; }
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(5,7,20,.7); display: flex; align-items: flex-end; justify-content: center; }
.modal-card { width: min(100%, 560px); max-height: 92dvh; overflow-y: auto; background: var(--bg2); border: 1px solid var(--line);
  border-radius: 18px 18px 0 0; padding: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
@media (min-width: 640px) { .modal { align-items: center; } .modal-card { border-radius: 18px; } }
.modal-card h3 { margin-top: 0; color: var(--text); }
.actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
.icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 8px; max-height: 220px; overflow-y: auto; }
.icons button { aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--line); background: var(--panel2); padding: 0; overflow: hidden; }
.icons button.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.icons img { width: 100%; height: 100%; object-fit: cover; }
.trow { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.trow:last-child { border-bottom: 0; }
.trow .name { flex: 1; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.swatch { width: 18px; height: 18px; border-radius: 5px; background: var(--tc); flex: none; }
.amatch { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.amatch:last-child { border-bottom: 0; }
.amatch .t { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.amatch .s { font-size: 12px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.amatch .a { grid-row: 1 / 3; grid-column: 2; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.checks label { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 10px; background: var(--panel2); font-size: 14px; }
.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 70; background: var(--panel2); border: 1px solid var(--line);
  padding: 10px 16px; border-radius: 10px; font-weight: 600; box-shadow: 0 6px 24px rgba(0,0,0,.4); max-width: 90%; }
.toast.err { border-color: #8a3348; color: #ffb3c0; }
input[type=color] { width: 56px; height: 44px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--panel); padding: 4px; }
.note { font-size: 13px; color: var(--muted); line-height: 1.45; margin: 6px 2px; }
.mscore, .mclock { display: block; }
a.btn { color: var(--text); text-decoration: none; white-space: nowrap; display: inline-flex; align-items: center; }
.login-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--panel); color: var(--text); flex: none; }
.login-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

/* ---------- Logos: inicial debajo por si la imagen no carga ---------- */
.logo { position: relative; }
.logo img { position: absolute; inset: 0; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* ---------- Estadísticas ---------- */
.stat-filters { position: sticky; top: 58px; z-index: 5; background: var(--bg); padding: 4px 0 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat-filters select { width: 100%; min-width: 0; }
.rk-block { margin-bottom: 22px; scroll-margin-top: 130px; }
.rk-group { font-size: 15px; letter-spacing: .02em; margin: 26px 2px 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.rk-group:first-child { margin-top: 6px; }
.schips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
.schips::-webkit-scrollbar { display: none; }
.schip { flex: none; border: 1.5px solid var(--line); background: var(--panel); border-radius: 99px; padding: 8px 14px; font-weight: 600; font-size: 14px; white-space: nowrap; }
.schip.on { background: var(--accent); border-color: var(--accent); color: #06122a; }
.rk-head { display: flex; flex-direction: column; gap: 2px; margin: 4px 2px 12px; }
.rk-head b { font-family: var(--disp); font-weight: 800; font-size: 24px; line-height: 1.1; }
.rk-head span { color: var(--muted); font-size: 13px; }
ol.rk { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rk li { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.rk-pos { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--panel2); font-family: var(--disp); font-weight: 800; }
.rk li.p1 .rk-pos { background: var(--gold); color: #2a1d00; }
.rk li.p2 .rk-pos { background: var(--silver); color: #1b2030; }
.rk li.p3 .rk-pos { background: var(--bronze); color: #2a1300; }
.rk li.p1 { border-color: rgba(242,193,78,.5); }
.rk-name { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-name i { color: var(--muted); font-style: normal; font-weight: 500; }
.rk-name small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.rk-val { font-family: var(--disp); font-weight: 800; font-size: 24px; font-variant-numeric: tabular-nums; text-align: right; line-height: 1; }
.rk-val small { display: block; font-family: var(--body); font-size: 11px; font-weight: 600; color: var(--muted); }
.pair { display: flex; flex: none; }
.pair .logo + .logo { margin-left: -8px; }
.rk-more { display: block; margin: 12px auto 0; background: none; border: 0; color: var(--accent); font-weight: 700; padding: 10px; }

/* ---------- H2H ---------- */
.h2h { position: fixed; inset: 0; z-index: 45; background: var(--bg); overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 40px; }
.h2h .watch-top { position: sticky; top: 0; z-index: 2; background: var(--bg); }
#h2hBody { max-width: 680px; margin: 0 auto; padding: 0 14px; }
.h2h-hero { position: relative; overflow: hidden; border-radius: 18px; padding: 18px 12px 20px; text-align: center; border: 1.5px solid var(--line);
  background: radial-gradient(90% 120% at 0% 40%, color-mix(in srgb, var(--hc) 45%, transparent), transparent 62%),
              radial-gradient(90% 120% at 100% 40%, color-mix(in srgb, var(--ac) 45%, transparent), transparent 62%), var(--panel); }
.hh-meta { font-size: 13px; color: var(--muted); font-weight: 600; }
.hh-teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; margin: 14px 0 10px; }
.hh-team { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.hh-team .logo { box-shadow: 0 0 0 3px rgba(255,255,255,.12), 0 10px 30px rgba(0,0,0,.45); }
.hh-team b { font-family: var(--disp); font-weight: 800; font-size: 22px; line-height: 1.05; max-width: 100%; overflow-wrap: anywhere; }
.hh-team > span:not(.logo) { font-size: 13px; color: var(--muted); font-weight: 600; }
.hh-vs { font-family: var(--disp); font-weight: 800; font-style: italic; font-size: 40px; color: #fff; text-shadow: 0 0 18px rgba(58,214,255,.55); }
.hh-cd { font-family: var(--disp); font-weight: 800; font-size: 40px; font-variant-numeric: tabular-nums; line-height: 1; margin-top: 6px; }
.hh-date { color: var(--muted); font-size: 13px; margin-top: 6px; text-transform: capitalize; }
.h2h-sec { margin-top: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.h2h-sec h3 { margin: 0 0 12px; color: var(--text); }
.h2h-rec { display: grid; grid-template-columns: 1fr auto 1fr; text-align: center; gap: 8px; }
.h2h-rec b { display: block; font-family: var(--disp); font-weight: 800; font-size: 40px; line-height: 1; }
.h2h-rec span { font-size: 12px; color: var(--muted); font-weight: 600; }
.h2h-split { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 2px; margin: 12px 0 14px; }
.cmp { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 4px 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.cmp:first-of-type { border-top: 0; }
.cv { font-family: var(--disp); font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; color: var(--muted); }
.cv.r { text-align: right; }
.cv.best { color: var(--text); font-weight: 800; }
.cl { font-size: 12px; color: var(--muted); font-weight: 600; text-align: center; }
.cb { height: 5px; background: #262c5e; border-radius: 3px; overflow: hidden; display: flex; justify-content: flex-end; grid-column: 1 / 2; }
.cb.r { grid-column: 3 / 4; justify-content: flex-start; }
.cb i { display: block; height: 100%; opacity: .45; border-radius: 3px; }
.cb i.best { opacity: 1; }
.hl { display: grid; grid-template-columns: 54px 1fr auto 1fr; align-items: center; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line); }
.hl:first-of-type { border-top: 0; }
.hl-d { font-size: 12px; color: var(--muted); }
.hl-t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hl-t.r { text-align: right; }
.hl b { font-family: var(--disp); font-weight: 800; font-size: 20px; text-align: center; min-width: 54px; }
.hl b small { display: block; font-size: 10px; color: var(--gold); }
.h2h-form { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-bottom: 8px; }
.h2h-form > span { font-size: 12px; color: var(--muted); font-weight: 600; }
.h2h-form > div { display: flex; gap: 4px; }
.h2h-form > div.r { justify-content: flex-end; }
.f { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; font-style: normal; font-family: var(--disp); font-weight: 800; font-size: 14px; }
.f.W { background: var(--ok); color: #04210f; } .f.D { background: #5a628f; color: #fff; } .f.L { background: #e2465d; color: #fff; }
@media (max-width: 420px) { .tabs.five .tab { font-size: 10.5px; } .hh-vs { font-size: 30px; } }

/* ---------- Almacenamiento (admin) ---------- */
.tabs.six { grid-template-columns: repeat(6, 1fr); }
.tabs.six .tab { font-size: 10.5px; }
.sto-num { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sto-num b { font-family: var(--disp); font-weight: 800; font-size: 34px; line-height: 1; }
.sto-num span { color: var(--muted); font-weight: 600; }
.sto-bar { height: 10px; border-radius: 5px; background: #262c5e; overflow: hidden; margin: 10px 0 4px; }
.sto-bar i { display: block; height: 100%; border-radius: 5px; }
.sto-actions { margin-bottom: 6px; }
.sto-all { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.sto-list { max-height: 60dvh; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.sto-row { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-top: 1px solid var(--line); }
.sto-row:first-child { border-top: 0; }
.sto-row input { width: 20px; height: 20px; flex: none; accent-color: var(--accent); }
.sto-row.locked { opacity: .55; }
.sto-info { flex: 1; min-width: 0; }
.sto-info b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sto-info small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sto-size { font-family: var(--disp); font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }

/* resultado ganado por gol de oro */
.row .mid.gold, .hl b.gold, .amatch b.gold { color: var(--gold); text-shadow: 0 0 12px rgba(242,193,78,.35); }

/* ---------- Listas a página completa (sin scroll interno) ---------- */
.list { max-height: none; overflow: visible; }
.day { top: 58px; }
#cards .cards { margin-bottom: 6px; }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.filters select, .filters .btn { width: 100%; min-width: 0; }
.datef { display: flex; gap: 6px; min-width: 0; }
.datef input { flex: 1; min-width: 0; width: 100%; color-scheme: dark; }
.datef .btn { flex: none; width: 44px; padding: 0; }

/* ---------- Filas de partido: un equipo por línea, nombres completos ---------- */
.mrow { display: grid; grid-template-columns: 50px 1fr auto; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
button.mrow:active { background: var(--panel2); }
.mrow .when { font-family: var(--disp); font-weight: 700; font-size: 16px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mrow .teams { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tline { display: flex; align-items: center; gap: 9px; min-width: 0; }
.tline .nm { flex: 1; min-width: 0; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.tline .sc { font-family: var(--disp); font-weight: 800; font-size: 21px; min-width: 22px; text-align: right; font-variant-numeric: tabular-nums; }
.mrow.win-h .tline.a .nm, .mrow.win-h .tline.a .sc, .mrow.win-a .tline.h .nm, .mrow.win-a .tline.h .sc { color: var(--muted); font-weight: 500; }
.mrow.gold .sc { color: var(--gold); text-shadow: 0 0 12px rgba(242,193,78,.35); }

/* nombres completos en tarjetas, rankings y previa */
.mnames span { white-space: normal; overflow-wrap: anywhere; line-height: 1.2; }
.rk-name { white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }
.hl-t { white-space: normal; overflow-wrap: anywhere; line-height: 1.2; }

/* vista previa del campo (admin) */
.pv-box { height: min(64dvh, 560px); display: flex; border-radius: 12px; overflow: hidden; margin: 6px 0 4px; }
.mrow.gold .tline .sc { color: var(--gold); }

/* campo de fecha con el mismo aspecto que los selectores */
.datebtn { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 6px;
  background: var(--panel); border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px; cursor: pointer; }
.datebtn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.datebtn svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
.datebtn input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; cursor: pointer; }
.datebtn input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

/* forma reciente: un equipo por fila para que quepa en el móvil */
.h2h-frow { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.h2h-frow .fn { flex: 1; min-width: 0; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.h2h-frow .fb { display: flex; gap: 4px; flex: none; }
.h2h-frow + .cmp { margin-top: 6px; border-top: 1px solid var(--line); }

/* móvil en horizontal: barra superior y marcador compactos para que el campo se vea más grande */
@media (orientation: landscape) and (max-height: 560px) {
  .watch-top { padding: 4px 10px; padding-top: max(4px, env(safe-area-inset-top)); gap: 8px; }
  .watch-top .btn { min-height: 28px; padding: 2px 10px; font-size: 12px; }
  .watch-top .t { font-size: 14px; }
  .bug { height: 34px; }
  .bug-team { gap: 6px; padding: 0 8px; }
  .bug-name { font-size: 14px; display: block; }
  .bug-score { font-size: 22px; }
  .bug-logo { width: 22px; height: 22px; }
  .bug-clock { min-width: 84px; padding: 0 8px; flex-direction: row; gap: 6px; }
  .clk { font-size: 19px; }
  .clk-sub { font-size: 10px; min-height: 0; }
  .gsem { flex-direction: row; gap: 6px; }
  .gtitle { font-size: 11px; }
  .gbar { width: 50px; }
  .led { --ls: 8px !important; border-width: 1.5px; }
  .v-live { top: 6px; right: 6px; font-size: 13px; padding: 1px 8px; }
  .v-replay { top: 4px; left: 6px; font-size: 20px; }
  .v-extra { top: 6px; left: 6px; font-size: 12px; padding: 4px 8px; }
  .v-sound { width: 34px; height: 34px; font-size: 15px; bottom: 6px; right: 6px; }
  .vctl { padding: 4px 10px; padding-bottom: max(4px, env(safe-area-inset-bottom)); gap: 8px; }
  .vbtn { width: 34px; height: 34px; }
  .v-cd { font-size: clamp(56px, 18vh, 110px); }
  .v-flash { font-size: clamp(22px, 9vh, 44px); }
  .v-final .ft { font-size: clamp(40px, 16vh, 84px); }
}

/* ---------- Vestuario (dentro del partido) ---------- */
.v-room { position: absolute; bottom: 58px; right: 10px; z-index: 6; width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.55);
  background: rgba(11,15,38,.7); display: grid; place-items: center; padding: 0; }
.v-room svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 1.7; stroke-linejoin: round; }
.v-roompanel { position: absolute; inset: 0; z-index: 8; background: rgba(11,15,38,.97); overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px; }
.rp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.rp-head b { font-family: var(--disp); font-weight: 800; font-size: 22px; }
.rp-teams { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .rp-teams { grid-template-columns: 1fr; } }
.rp-team h4, .rp-goals h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-family: var(--disp); font-size: 17px; }
.rp-logo { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; flex: none; }
.rp-pl { display: grid; grid-template-columns: 28px 1fr 64px; align-items: center; gap: 8px; width: 100%; text-align: left; background: none; border: 0;
  border-bottom: 1px solid var(--line); padding: 6px 2px; }
.rp-pl[data-pid]:active { background: var(--panel2); }
.rp-num { width: 28px; height: 28px; display: block; }
.rp-name { font-weight: 600; font-size: 14px; line-height: 1.2; overflow-wrap: anywhere; }
.rp-g { font-size: 11px; letter-spacing: -2px; }
.rp-sta { height: 6px; border-radius: 3px; background: #262c5e; overflow: hidden; }
.rp-sta i { display: block; height: 100%; border-radius: 3px; transition: width .4s; }
.rp-goals { margin-top: 14px; }
.rp-goal { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.rp-goal small { display: block; color: var(--muted); font-size: 12px; }
.rp-goal em { color: #ff8fa3; font-style: normal; font-size: 12px; }
.rp-min { font-family: var(--disp); font-weight: 700; color: var(--muted); min-width: 66px; font-variant-numeric: tabular-nums; }
.rp-dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }
@media (orientation: landscape) and (max-height: 560px) { .v-room { width: 32px; height: 32px; bottom: 46px; right: 6px; } }

/* ---------- Jugadores: modal, radar y alineaciones ---------- */
.pl-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.pl-head img { width: 64px; height: 64px; flex: none; }
.pl-head b { display: block; font-family: var(--disp); font-weight: 800; font-size: 26px; line-height: 1.05; }
.pl-head span { color: var(--muted); font-size: 13px; font-weight: 600; }
.pl-ovr { margin-left: auto; text-align: center; flex: none; }
.pl-ovr b { font-family: var(--disp); font-weight: 800; font-size: 34px; line-height: 1; color: var(--accent); }
.pl-ovr small { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
.radar { width: 100%; max-width: 330px; display: block; margin: 0 auto; }
.radar text { font-family: var(--body); font-size: 11px; font-weight: 600; fill: var(--muted); }
.radar text.v { fill: var(--text); font-family: var(--disp); font-weight: 800; font-size: 12px; }
.attr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; margin: 6px 0 4px; }
.attr-grid div { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.attr-grid b { font-family: var(--disp); font-weight: 800; }
.season-tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; margin-top: 4px; }
.season-tbl th { font-family: var(--disp); font-size: 13px; color: var(--muted); padding: 6px 4px; text-align: center; }
.season-tbl td { padding: 7px 4px; text-align: center; border-top: 1px solid var(--line); }
.season-tbl td:first-child, .season-tbl th:first-child { text-align: left; }
.lineups { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lu-col h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 15px; overflow-wrap: anywhere; }
.lu-pl { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; text-align: left; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.lu-pl img { width: 26px; height: 26px; flex: none; }
.lu-pl span { overflow-wrap: anywhere; line-height: 1.2; }
.lu-pl[data-pid]:active { background: var(--panel2); }
.seg { display: inline-flex; background: var(--panel); border: 1.5px solid var(--line); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { border: 0; background: none; padding: 8px 14px; border-radius: 8px; font-weight: 700; color: var(--muted); }
.seg button.on { background: var(--accent); color: #06122a; }
.rk .rk-num { width: 30px; height: 30px; flex: none; }
.pl-modal { position: fixed; inset: 0; z-index: 80; background: rgba(5,7,20,.72); display: flex; align-items: flex-end; justify-content: center; }
.pl-card { width: min(100%, 560px); max-height: 92dvh; overflow-y: auto; background: var(--bg2); border: 1px solid var(--line); border-radius: 18px 18px 0 0;
  padding: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
@media (min-width: 640px) { .pl-modal { align-items: center; } .pl-card { border-radius: 18px; } }
.kit { display: flex; gap: 14px; align-items: center; margin-top: 10px; }
.kit canvas { width: 96px; height: 96px; flex: none; }
.kit-f { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.kit-f .bar { gap: 10px; }
.rk li[data-pid] { cursor: pointer; }
.rk li[data-pid]:active { background: var(--panel2); }
.tm-btn { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 0; font-weight: 600; white-space: nowrap; text-align: left; }
.hh-team { background: none; border: 0; padding: 0; color: inherit; }
.tform { display: flex; gap: 4px; flex-wrap: wrap; }
.tstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tstats div { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px; text-align: center; }
.tstats b { display: block; font-family: var(--disp); font-weight: 800; font-size: 22px; line-height: 1.1; }
.tstats span { font-size: 11px; color: var(--muted); font-weight: 600; }
.tm-scroll { max-height: 320px; overflow-y: auto; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; gap: 8px; overscroll-behavior: contain; }
.pl-head .logo { --s: 64px; }
.lu-meta { display: flex; gap: 6px; flex-wrap: wrap; margin: -2px 0 6px; }
.cmp-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin-bottom: 6px; }
.cmp-side { display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: 0; text-align: center; min-width: 0; }
.cmp-side img { width: 72px; height: 72px; }
.cmp-side b { font-family: var(--disp); font-weight: 800; font-size: 20px; line-height: 1.1; overflow-wrap: anywhere; }
.cmp-side span { font-size: 12px; color: var(--muted); font-weight: 600; }
.cmp-vs { font-family: var(--disp); font-weight: 800; font-style: italic; font-size: 28px; color: var(--muted); }
.cmp2 { display: grid; grid-template-columns: 70px 1fr 70px; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line); }
.cmp2 span { text-align: center; font-size: 13px; color: var(--muted); font-weight: 600; }
.cmp2 b { font-family: var(--disp); font-weight: 800; font-size: 20px; text-align: center; border-radius: 8px; padding: 3px 0; font-variant-numeric: tabular-nums; }
.cmp2 b.up { color: #062b16; background: var(--ok); }
.cmp2 b.down { color: #fff; background: #e2465d; }
.cmp2 b.eq { color: var(--text); background: #4a5172; }
.rk li[data-team], .rk li[data-pair] { cursor: pointer; }
.rk li[data-team]:active, .rk li[data-pair]:active { background: var(--panel2); }
.v-goals { position: absolute; bottom: 106px; right: 10px; z-index: 6; width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.55);
  background: rgba(11,15,38,.7); display: grid; place-items: center; padding: 0; font-size: 19px; line-height: 1; }
.rp-goal.gg { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; color: inherit; }
.rp-goal.gg:active { background: var(--panel2); }
.gg-sc { font-family: var(--disp); font-weight: 800; font-size: 18px; flex: none; }
@media (orientation: landscape) and (max-height: 560px) { .v-goals { width: 32px; height: 32px; bottom: 86px; right: 6px; font-size: 15px; } }

.tabs.seven { grid-template-columns: repeat(7, 1fr); }
.tabs.seven .tab { font-size: 9.5px; }

.srvstate { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.srvstate span { font-size: 12px; color: var(--muted); font-weight: 600; }
.srvstate b { font-size: 14px; text-align: right; }
