/* =====================================================================
   Robot Soccer MARE · Tema visual (sobrio, oscuro, acentos dorados)
   ===================================================================== */

/* ---------- Fuentes locales WOFF2 (ADR 0024) ---------- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fuentes/inter.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Barlow Condensed';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fuentes/barlow-condensed-500.woff2') format('woff2');
}

@font-face {
  font-family: 'Barlow Condensed';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fuentes/barlow-condensed-600.woff2') format('woff2');
}

@font-face {
  font-family: 'Barlow Condensed';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fuentes/barlow-condensed-700.woff2') format('woff2');
}

:root {
  /* Paleta MARE LAB: azul marino + cian, amarillo y naranja del logo */
  --bg: #040A1C;
  --bg-2: #071029;
  --panel: #0B1634;
  --panel-2: #101E42;
  --panel-3: #16274F;
  --line: #1A2A52;
  --line-2: #243766;
  --text: #EEF2FA;
  --text-2: #B8C3DA;
  --muted: #7F8BA8;
  --navy: #021E5F;
  --cyan: #03A8E0;
  --yellow: #FDCE02;
  --orange: #E64F20;
  --gold: #FDCE02;          /* acento principal (amarillo MARE) */
  --gold-2: #FFE066;
  --gold-soft: rgba(253, 206, 2, .12);
  --live: #E64F20;
  --pos: #41CF8F;
  --neg: #F07A6A;
  --info: #03A8E0;
  --radius: 14px;
  --shadow: 0 18px 40px rgba(0, 0, 0, .45);
  --f-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --f-num: 'Barlow Condensed', 'Inter', system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 480px at 88% -12%, rgba(3, 168, 224, .10), transparent 60%),
    radial-gradient(900px 420px at -10% 0%, rgba(253, 206, 2, .05), transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  font: 14px/1.45 var(--f-ui);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--text); }
[hidden] { display: none !important; }
.num { font-family: var(--f-num); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
::selection { background: rgba(253, 206, 2, .35); }

/* ---------- Barra superior ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 20px;
  padding: 10px 24px;
  background: rgba(7, 9, 13, .86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, var(--cyan) 0 33.33%, var(--yellow) 33.33% 66.66%, var(--orange) 66.66% 100%);
  opacity: .85;
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; min-width: 0; }
.brand-logo { height: 44px; width: auto; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; border-left: 1px solid var(--line-2); padding-left: 14px; min-width: 0; }
.brand-text strong { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.brand-text span { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabs { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  background: none; border: 0; padding: 9px 14px; border-radius: 999px;
  color: var(--text-2); font-weight: 500; white-space: nowrap; transition: background .15s, color .15s;
}
.tabs button:hover { background: var(--panel-2); color: var(--text); }
.tabs button.active { background: var(--gold-soft); color: var(--gold-2); box-shadow: inset 0 0 0 1px rgba(253, 206, 2, .35); }
.conn { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.conn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.conn.live .dot { background: var(--pos); box-shadow: 0 0 0 4px rgba(65, 207, 143, .15); }
.conn.reconnecting .dot { background: var(--gold); animation: pulse 1s infinite; }
.conn.local .dot { background: var(--info); }

@media (max-width: 980px) {
  .topbar { flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
  .tabs { order: 3; width: 100%; margin-left: 0; }
  .conn { margin-left: auto; }
}

/* ---------- Ticker ---------- */
.ticker {
  display: flex; gap: 10px; overflow-x: auto; padding: 10px 24px;
  border-bottom: 1px solid var(--line); background: var(--bg-2); scrollbar-width: none;
}
.ticker::-webkit-scrollbar { display: none; }
.tk {
  flex: 0 0 auto; display: flex; align-items: center; gap: 10px;
  padding: 6px 12px; border-radius: 9px; background: var(--panel); border: 1px solid var(--line); font-size: 12px;
}
.tk b { font: 700 15px var(--f-num); letter-spacing: .02em; }
.tk .lbl { color: var(--muted); }
@media (max-width: 980px) { .ticker { padding: 10px 16px; } }

/* ---------- Estructura ---------- */
.wrap { max-width: 1400px; margin: 0 auto; padding: 24px; }
@media (max-width: 640px) { .wrap { padding: 16px; } }
.view { display: none; }
.view.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 50% { opacity: .25; } }

.layout-3 { display: grid; grid-template-columns: 230px minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (max-width: 1220px) {
  .layout-3 { grid-template-columns: minmax(0, 1fr) 310px; }
  .layout-3 > .side-left { grid-column: 1 / -1; }
}
@media (max-width: 880px) { .layout-3 { grid-template-columns: minmax(0, 1fr); } }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.card-h h3 { margin: 0; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); font-weight: 600; }
.card-b { padding: 14px 16px; }
.link { background: none; border: 0; color: var(--gold); font-size: 12px; padding: 0; }
.link:hover { color: var(--gold-2); text-decoration: underline; }
.empty { color: var(--muted); font-size: 13px; padding: 10px 0; }

.page-h { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-h h1 { margin: 2px 0 0; font: 600 32px/1.05 var(--f-num); letter-spacing: .02em; }
.page-h p { margin: 6px 0 0; color: var(--muted); max-width: 640px; }
.eyebrow { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); font-weight: 600; }

/* ---------- Navegación de fases ---------- */
.phase-nav { padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.phase-nav button {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%;
  background: none; border: 0; padding: 10px 12px; border-radius: 9px; color: var(--text-2); text-align: left;
}
.phase-nav button:hover { background: var(--panel-2); }
.phase-nav button.active { background: var(--panel-3); color: var(--text); box-shadow: inset 2px 0 0 var(--gold); }
.count { font-size: 11px; color: var(--muted); background: var(--bg-2); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.count.live { color: #fff; background: var(--live); }
.count:empty { display: none; }
@media (max-width: 1220px) {
  .phase-nav { flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .phase-nav button { width: auto; flex: 0 0 auto; }
  .phase-nav button.active { box-shadow: inset 0 -2px 0 var(--gold); }
}

/* ---------- Insignias de equipo y chips ---------- */
.tb {
  --tc: #888;
  display: inline-grid; place-items: center; flex: 0 0 auto;
  min-width: 38px; height: 24px; padding: 0 7px; border-radius: 7px;
  font: 700 11px/1 var(--f-ui); letter-spacing: .06em;
  color: var(--tc);
  background: color-mix(in srgb, var(--tc) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--tc) 45%, transparent);
}
.tb.sm { min-width: 34px; height: 20px; font-size: 10px; border-radius: 6px; }
.tb.lg { min-width: 68px; height: 68px; border-radius: 18px; font-size: 19px; }
.tb-empty { --tc: #5A687B; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: .03em; white-space: nowrap;
  background: var(--panel-3); color: var(--text-2);
}
.chip.live { background: rgba(230, 79, 32, .14); color: #FF9A7A; }
.chip.live i { width: 6px; height: 6px; border-radius: 50%; background: var(--live); animation: pulse 1.2s infinite; }
.chip.live.paused i { animation: none; opacity: .5; }
.chip.fin { background: var(--panel-3); color: var(--muted); }
.chip.pre { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--muted); }
.chip.gold { background: var(--gold-soft); color: var(--gold-2); }
.chip b.over, .over { color: var(--live); }

.evc {
  display: inline-block; padding: 2px 7px; border-radius: 5px; font-size: 10px; font-weight: 700;
  letter-spacing: .05em; background: var(--panel-3); color: var(--text-2); white-space: nowrap;
}
.ev-goal, .ev-pen_goal { background: rgba(65, 207, 143, .14); color: #7FE2B4; }
.ev-sp_goal { background: var(--gold-soft); color: var(--gold-2); }
.xtra { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .04em; padding: 1px 6px; border-radius: 5px; white-space: nowrap; }
.xtra.pen { background: rgba(3, 168, 224, .14); color: #7FD3F2; }
.xtra.sp { background: var(--gold-soft); color: var(--gold-2); }
.ev-adj { background: rgba(3, 168, 224, .13); color: #7FD3F2; }

/* ---------- Partido destacado ---------- */
.feature { overflow: hidden; position: relative; }
.feature::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(120deg,
    color-mix(in srgb, var(--hc, #444) 16%, transparent), transparent 38%,
    transparent 62%, color-mix(in srgb, var(--ac, #444) 16%, transparent));
}
.feature > * { position: relative; }
.feature-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 20px 0; }
.phase-tag { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.scoreboard { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 18px 20px 22px; }
.sb-team { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; min-width: 0; }
.sb-team strong { font-size: 17px; font-weight: 600; }
.sb-team small { color: var(--muted); font-size: 12px; }
.sb-mid { text-align: center; min-width: 170px; }
.sb-score { font: 700 68px/1 var(--f-num); letter-spacing: .02em; }
.sb-score span { color: var(--muted); margin: 0 10px; font-weight: 500; }
.sb-sp { color: var(--gold-2); font: 600 15px var(--f-num); letter-spacing: .08em; margin-top: 4px; }
.sb-clock { margin-top: 8px; color: var(--text-2); font: 600 16px var(--f-num); letter-spacing: .06em; }
.progress { height: 4px; background: var(--panel-3); border-radius: 4px; overflow: hidden; margin: 10px auto 0; max-width: 170px; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--gold-2)); transition: width .5s linear; }
@media (max-width: 640px) {
  .scoreboard { gap: 8px; padding: 16px 12px 20px; }
  .sb-score { font-size: 46px; }
  .sb-mid { min-width: 0; }
  .sb-team strong { font-size: 14px; }
  .tb.lg { min-width: 52px; height: 52px; font-size: 15px; border-radius: 14px; }
}

.markets { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; padding: 0 20px 18px; }
.market h5 { margin: 0 0 8px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
@media (max-width: 640px) { .markets { grid-template-columns: 1fr; padding: 0 14px 16px; } }

.odds { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.odd {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 9px 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px;
  font-size: 12px; color: var(--text-2); transition: border-color .15s, background .15s; min-width: 0;
}
.odd span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.odd b { font: 700 17px var(--f-num); color: var(--gold-2); }
button.odd:hover { border-color: rgba(253, 206, 2, .55); background: var(--panel-3); }
.odd.sel { background: linear-gradient(180deg, var(--gold-2), var(--gold)); border-color: transparent; color: #061335; }
.odd.sel b { color: #061335; }
.odd.off { opacity: .4; }
.odd.done b { color: var(--muted); }
.odd.won { border-color: rgba(65, 207, 143, .55); }
.odd.won b { color: var(--pos); }

.timeline { border-top: 1px solid var(--line); padding: 12px 20px 16px; display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow: auto; }
.timeline h5 { margin: 0 0 6px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.tl { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13px; padding: 5px 0; }
.tl time { font: 600 13px var(--f-num); color: var(--muted); letter-spacing: .04em; }
.tl-main { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.tl-main small { color: var(--muted); }
.tl > b { font: 700 14px var(--f-num); }

.champion-banner {
  display: flex; align-items: center; gap: 16px; padding: 18px 20px;
  background: linear-gradient(120deg, rgba(253, 206, 2, .18), rgba(253, 206, 2, .03));
  border-color: rgba(253, 206, 2, .4);
}
.champion-banner .trophy { width: 44px; height: 44px; color: var(--gold-2); flex: 0 0 auto; }
.champion-banner h2 { margin: 0; font: 600 26px/1.1 var(--f-num); }
.champion-banner p { margin: 2px 0 0; color: var(--text-2); font-size: 13px; }

/* ---------- Lista de partidos ---------- */
.group-h { display: flex; align-items: baseline; gap: 12px; margin: 24px 0 10px; }
.group-h span { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-2); font-weight: 600; }
.group-h em { font-style: normal; font-size: 12px; color: var(--muted); }
.group-h::after { content: ''; flex: 1; height: 1px; background: var(--line); align-self: center; }
.mlist { overflow: hidden; }
.mrow { display: grid; grid-template-columns: 130px minmax(0, 1fr) 280px; gap: 16px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.mlist .mrow:last-child { border-bottom: 0; }
.mrow:hover { background: var(--panel-2); }
.mrow-meta { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.mrow-meta small { color: var(--muted); font-size: 11px; }
.mt { display: flex; align-items: center; gap: 10px; padding: 3px 0; }
.mt .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt .nm em { font-style: normal; color: var(--muted); }
.mt > b { font: 700 19px var(--f-num); min-width: 24px; text-align: right; }
.mt sup { color: var(--gold); font-size: 11px; margin-left: 2px; }
.mt.win .nm { font-weight: 600; }
.mt.lose { opacity: .5; }
@media (max-width: 720px) and (min-height: 501px), (max-width: 720px) and (orientation: portrait) {
  .mrow { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .mrow-meta { flex-direction: row; align-items: center; }
}

/* ---------- Mini tablas laterales ---------- */
.mini { padding: 6px 8px 10px; }
.mini-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; cursor: pointer; }
.mini-row:hover { background: var(--panel-2); }
.mini-row .who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mini-row .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-row > b { font: 700 16px var(--f-num); }
.rank { font: 700 15px var(--f-num); color: var(--muted); }
.rank.r1 { color: var(--gold-2); }
.rank.r2 { color: #C9D1DB; }
.rank.r3 { color: #C98E5C; }
.out-row { display: grid; grid-template-columns: minmax(0, 1fr) 54px 64px; align-items: center; gap: 10px; padding: 7px 8px; }
.out-row .who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.out-row .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.out-row .pct { font: 600 13px var(--f-num); color: var(--muted); text-align: right; }
.out-row .odd { padding: 5px 8px; justify-content: center; }
.out-row .odd b { font-size: 15px; }

/* ---------- Cupón ---------- */
.slip-item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line-2); font-size: 12px; }
.slip-item strong { display: block; font-size: 13px; }
.slip-item small { color: var(--muted); }
.slip-item .x { background: none; border: 0; color: var(--muted); font-size: 16px; padding: 0 4px; }
.slip-item .x:hover { color: var(--text); }
.slip-total { display: flex; justify-content: space-between; align-items: center; padding-top: 12px; }
.slip-total b { font: 700 22px var(--f-num); color: var(--gold-2); }
.slip-note { font-size: 11px; color: var(--muted); margin: 8px 0 0; }
.res { font-size: 11px; font-weight: 700; }
.res.ok { color: var(--pos); }
.res.ko { color: var(--neg); }
.res.wait { color: var(--muted); }

/* ---------- Tablas ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar .grow { flex: 1; }
.input, .select {
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 9px; padding: 9px 12px;
  outline: none; min-width: 0; transition: border-color .15s;
}
.input:focus, .select:focus { border-color: var(--gold); }
.select option { background: var(--panel); }
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line-2); border-radius: 999px; padding: 3px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 6px 13px; border-radius: 999px; color: var(--text-2); font-size: 12px; font-weight: 500; }
.seg button.active { background: var(--gold-soft); color: var(--gold-2); }

.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted);
  font-weight: 600; padding: 12px; border-bottom: 1px solid var(--line); white-space: nowrap; user-select: none;
}
.tbl th[data-sort] { cursor: pointer; }
.tbl th[data-sort]:hover { color: var(--text-2); }
.tbl th.sorted { color: var(--gold-2); }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr { cursor: default; }
.tbl tbody tr[data-player] { cursor: pointer; }
.tbl tbody tr:hover td { background: var(--panel-2); }
.tbl .c { text-align: center; }
.tbl .r { text-align: right; }
.tbl td.num, .tbl td .num { font-size: 15px; font-weight: 600; }
.pcell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pcell small { display: block; color: var(--muted); font-size: 11px; }
.pnum { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--panel-3); font: 700 14px var(--f-num); color: var(--text-2); flex: 0 0 auto; }
.xpcell { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.xpcell .track { width: 90px; height: 6px; background: var(--panel-3); border-radius: 6px; overflow: hidden; }
.xpcell .track i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--gold), var(--gold-2)); }
.xpcell b { font: 700 17px var(--f-num); min-width: 34px; text-align: right; }
@media (max-width: 640px) { .xpcell .track { display: none; } }

/* ---------- Podio ---------- */
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.pod { padding: 18px; display: flex; align-items: center; gap: 14px; cursor: pointer; position: relative; overflow: hidden; }
.pod .place { font: 700 46px/1 var(--f-num); color: var(--muted); }
.pod.p1 { border-color: rgba(253, 206, 2, .45); background: linear-gradient(140deg, rgba(253, 206, 2, .14), var(--panel) 60%); }
.pod.p1 .place { color: var(--gold-2); }
.pod.p2 .place { color: #C9D1DB; }
.pod.p3 .place { color: #C98E5C; }
.pod .who { min-width: 0; flex: 1; }
.pod .who strong { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod .who small { color: var(--muted); font-size: 12px; }
.pod .goals { text-align: right; }
.pod .goals b { display: block; font: 700 34px/1 var(--f-num); }
.pod .goals small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
@media (max-width: 760px) { .podium { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Llaves (diagrama completo) ---------- */
.bracket-scroll { overflow-x: auto; padding-bottom: 6px; }
.bk-card { padding: 18px 18px 14px; }
.fb { display: grid; grid-template-columns: minmax(250px, 1.15fr) repeat(3, minmax(200px, 1fr)) minmax(290px, 1.2fr); gap: 0 44px; min-width: 1320px; }
.fb-col { position: relative; min-width: 0; }
.fb-col h4 { margin: 0 0 12px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; text-align: center; }
.fb-body { height: 540px; display: flex; flex-direction: column; position: relative; }
.c-ent .fb-body { justify-content: space-around; }
.c-ent::after { content: ''; position: absolute; top: 30px; bottom: 0; right: -23px; border-right: 1px dashed var(--line-2); }
.c-win .fb-body { justify-content: center; }
.pair { flex: 1; display: flex; flex-direction: column; justify-content: space-around; position: relative; }
.cn { position: absolute; right: -22px; width: 22px; height: 25%; border: 2px solid var(--line-2); border-left: 0; pointer-events: none; }
.cn-top { top: 25%; border-bottom: 0; border-radius: 0 10px 0 0; }
.cn-bot { top: 50%; border-top: 0; border-radius: 0 0 10px 0; }
.cn.on { border-color: var(--gold); z-index: 1; }
.c-sf .bm::before, .c-f .final-slot .bm::before, .final-slot .bm::after, .win-slot::before {
  content: ''; position: absolute; top: 50%; width: 22px; border-top: 2px solid var(--line-2);
}
.c-sf .bm::before, .c-f .final-slot .bm::before, .win-slot::before { left: -24px; }
.final-slot .bm::after { right: -24px; }
.c-sf .bm.sim::before, .final-slot.on .bm::before, .final-slot.on .bm::after, .win-slot.on::before { border-color: var(--gold); }
.win-slot.set::before { border-color: rgba(253, 206, 2, .55); }
.bm { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; transition: opacity .2s; }
.bm.live { border-color: rgba(230, 79, 32, .45); box-shadow: 0 0 0 3px rgba(230, 79, 32, .08); }
.bm.dim { opacity: .38; }
.bm.sim { border: 2px solid var(--gold); padding: 9px 11px; background: linear-gradient(180deg, rgba(253, 206, 2, .12), var(--panel)); box-shadow: 0 0 0 3px rgba(253, 206, 2, .1), 0 8px 22px rgba(253, 206, 2, .08); }
.bm-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 11px; color: var(--muted); letter-spacing: .04em; }
.bm-head > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 22px; align-items: center; gap: 7px; padding: 4px 0; min-height: 28px; }
.bm-x { display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; }
.bm-x:empty { display: none; }
.bm-row .bm-x .xtra { padding: 1px 5px; }
.bm-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.bm-name em { font-style: normal; color: var(--muted); font-size: 12px; }
.bm-sc { font: 700 18px var(--f-num); min-width: 0; text-align: right; grid-column: 4; }
.bm-row.win .bm-name { font-weight: 600; color: var(--text); }
.bm-row.win .bm-sc { color: var(--gold-2); }
.bm-row.lose { opacity: .45; }
.bm-row.sim-row .bm-name { font-weight: 700; color: var(--gold-2); }
.bm-row.ghost .bm-name { flex: 0 1 70%; height: 10px; border-radius: 6px; background: repeating-linear-gradient(90deg, var(--line-2) 0 6px, transparent 6px 11px); opacity: .7; }
.sim-check .star { width: 15px; height: 15px; color: var(--gold-2); display: block; }
.final-slot { flex: 1; display: flex; flex-direction: column; justify-content: center; position: relative; }
.final-slot .bm:not(.sim) { border-color: rgba(253, 206, 2, .35); }
.third-slot { position: absolute; left: 0; right: 0; bottom: 0; }
.third-slot h5 { margin: 0 0 8px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; text-align: center; }
.fb.is-sim .third-slot h5 { opacity: .5; }
.win-slot { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: stretch; }
.win-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; min-width: 0;
  padding: 14px 10px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line-2);
}
.win-card > svg { width: 26px; height: 26px; color: var(--line-2); }
.win-card small { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.win-card > b { font: 600 17px/1.1 var(--f-num); overflow-wrap: anywhere; }
.win-card > span:last-child:not(.tb):not(.av) { font-size: 11px; color: var(--muted); }
.win-card.set { border-color: rgba(253, 206, 2, .5); }
.win-card.set > svg { color: var(--gold-2); }
.win-card.sim { border: 2px solid var(--gold); background: linear-gradient(180deg, rgba(253, 206, 2, .18), var(--panel-2)); box-shadow: 0 0 0 4px rgba(253, 206, 2, .1), 0 10px 30px rgba(253, 206, 2, .14); }
.win-card.sim > svg, .win-card.sim small, .win-card.sim > b { color: var(--gold-2); }
.win-card.sim .av { border-color: var(--gold); }
.bk-note { display: flex; gap: 10px; align-items: flex-start; margin: 14px 2px 0; font-size: 13px; color: var(--text-2); }
.bk-note .star { width: 18px; height: 18px; color: var(--muted); flex: 0 0 auto; margin-top: 1px; }
.bk-note.sim .star { color: var(--gold-2); }
.section-h { display: flex; align-items: baseline; gap: 12px; margin: 26px 0 12px; }
.section-h h3 { margin: 0; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-2); font-weight: 600; }
.section-h small { color: var(--muted); }

/* ---------- Equipos ---------- */
.grid-teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.team-card .card-h { justify-content: flex-start; gap: 14px; }
.team-card .card-h strong { font-size: 16px; display: block; }
.team-card .card-h small { color: var(--muted); font-size: 12px; }
.team-stats { display: grid; grid-template-columns: repeat(5, 1fr); border-bottom: 1px solid var(--line); }
.team-stats div { padding: 10px 6px; text-align: center; border-right: 1px solid var(--line); }
.team-stats div:last-child { border-right: 0; }
.team-stats b { display: block; font: 700 19px var(--f-num); }
.team-stats small { color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.roster-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 16px; cursor: pointer; }
.roster-row:hover { background: var(--panel-2); }
.roster-row strong { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.roster-row small { color: var(--muted); font-size: 11px; }
.roster-row > b { font: 700 16px var(--f-num); }
.team-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

/* ---------- Reglas ---------- */
.rules-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.rules-wide { grid-column: 1 / -1; }
.xp-rule { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.xp-rule:last-child { border-bottom: 0; }
.xp-rule b { font: 700 22px var(--f-num); }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; }
.steps li { position: relative; padding: 0 0 14px 40px; counter-increment: s; color: var(--text-2); }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: -2px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; background: var(--gold-soft); color: var(--gold-2); font: 700 13px var(--f-num);
}
.steps li strong { color: var(--text); display: block; }

/* ---------- Panel lateral (detalle jugador) ---------- */
.drawer { position: fixed; inset: 0; z-index: 60; display: none; }
.drawer.open { display: block; }
.drawer .scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); animation: fade .2s; }
.drawer .panel {
  position: absolute; right: 0; top: 0; bottom: 0; width: min(460px, 100%);
  background: var(--bg-2); border-left: 1px solid var(--line); overflow: auto; animation: slide .22s ease;
}
@keyframes slide { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.dw-head { padding: 22px; border-bottom: 1px solid var(--line); display: flex; gap: 16px; align-items: center; }
.dw-head h2 { margin: 0; font: 600 26px/1.1 var(--f-num); }
.dw-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.dw-close { margin-left: auto; align-self: flex-start; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 9px; width: 34px; height: 34px; font-size: 18px; }
.dw-xp { padding: 18px 22px; display: flex; align-items: baseline; gap: 10px; border-bottom: 1px solid var(--line); }
.dw-xp b { font: 700 54px/1 var(--f-num); color: var(--gold-2); }
.dw-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border-bottom: 1px solid var(--line); }
.dw-grid div { background: var(--bg-2); padding: 12px; text-align: center; }
.dw-grid b { display: block; font: 700 20px var(--f-num); }
.dw-grid small { color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.dw-hist { padding: 16px 22px 30px; }
.dw-hist h4 { margin: 0 0 10px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.hist-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.hist-row small { color: var(--muted); font-size: 11px; display: block; margin-top: 3px; }
.hist-row > b { font: 700 17px var(--f-num); }

/* ---------- Avisos ---------- */
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; width: max-content; max-width: calc(100% - 32px); }
.toast { padding: 11px 16px; border-radius: 11px; background: var(--panel-3); border: 1px solid var(--line-2); box-shadow: var(--shadow); font-size: 13px; animation: fade .2s; transition: opacity .3s; }
.toast.ok { border-color: rgba(65, 207, 143, .5); }
.toast.err { border-color: rgba(239, 111, 111, .6); color: #FFC1C1; }
.toast.out { opacity: 0; }

/* =====================================================================
   Panel de organizadores
   ===================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 15px; border-radius: 9px; border: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--text); font-weight: 500; font-size: 13px; white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--panel-3); }
.btn.primary { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #061335; border-color: transparent; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: #FFA3A3; border-color: rgba(239, 111, 111, .4); background: rgba(239, 111, 111, .07); }
.btn.danger:hover { background: rgba(239, 111, 111, .14); }
.btn.ghost { background: none; }
.btn.sm { padding: 6px 11px; font-size: 12px; }
.btn.lg { padding: 12px 20px; font-size: 14px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

.admin-shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: calc(100vh - 61px); }
.admin-nav {
  border-right: 1px solid var(--line); padding: 18px 12px; background: var(--bg-2);
  display: flex; flex-direction: column; gap: 2px; position: sticky; top: 61px; height: calc(100vh - 61px);
}
.admin-nav .nav-label { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); padding: 8px 12px; }
.admin-nav button {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; background: none; border: 0;
  padding: 10px 12px; border-radius: 9px; color: var(--text-2); text-align: left; white-space: nowrap;
}
.admin-nav button:hover { background: var(--panel-2); }
.admin-nav button.active { background: var(--gold-soft); color: var(--gold-2); }
.admin-nav .spacer { flex: 1; }
.admin-nav .viewer-link { font-size: 12px; color: var(--muted); padding: 10px 12px; text-decoration: none; border-top: 1px solid var(--line); }
.admin-nav .viewer-link:hover { color: var(--gold-2); }
.admin-main { padding: 26px; min-width: 0; }
@media (max-width: 900px) {
  .admin-shell { grid-template-columns: minmax(0, 1fr); }
  .admin-nav { position: static; height: auto; flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; }
  .admin-nav .nav-label, .admin-nav .spacer, .admin-nav .viewer-link { display: none; }
  .admin-main { padding: 16px; }
}

.control { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1150px) { .control { grid-template-columns: minmax(0, 1fr); } }
.ml-group h6 { margin: 12px 8px 6px; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.ml-group:first-child h6 { margin-top: 4px; }
.mi {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%;
  background: none; border: 1px solid transparent; border-radius: 10px; padding: 9px 10px; text-align: left;
}
.mi:hover { background: var(--panel-2); }
.mi.active { border-color: rgba(253, 206, 2, .5); background: var(--gold-soft); }
.mi-l { display: flex; flex-direction: column; min-width: 0; }
.mi-l b { font-weight: 600; font-size: 13px; }
.mi-l span { font-size: 12px; color: var(--muted); }
.mi-r .num { font-weight: 700; font-size: 15px; }
@media (max-width: 1150px) {
  .match-picker .card-b { display: flex; gap: 10px; overflow-x: auto; }
  .ml-group { flex: 0 0 auto; }
  .mi { width: 190px; }
}

.ctl-head { overflow: hidden; }
.ctl-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 0 20px 14px; }
.ctl-hint { margin: 0; padding: 0 20px 18px; color: var(--muted); font-size: 12px; text-align: center; }
.bigclock { font: 700 30px var(--f-num); letter-spacing: .04em; }
.teams-ctl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
@media (max-width: 1300px) { .teams-ctl { grid-template-columns: minmax(0, 1fr); } }
.prow { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.prow:last-child { border-bottom: 0; }
.prow .acts { display: flex; flex-wrap: wrap; gap: 6px; }
.xb {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 8px;
  border: 1px solid var(--line-2); background: var(--panel-2); font-size: 12px; font-weight: 600; color: var(--text-2);
  transition: border-color .15s, background .15s, transform .08s;
}
.xb em { font-style: normal; font: 700 13px var(--f-num); }
.xb.plus em { color: var(--pos); }
.xb.minus em { color: var(--neg); }
.xb.plus:hover:not(:disabled) { border-color: rgba(65, 207, 143, .6); background: rgba(65, 207, 143, .07); }
.xb.minus:hover:not(:disabled) { border-color: rgba(239, 111, 111, .6); background: rgba(239, 111, 111, .07); }
.xb.adj em { color: var(--info); }
.xb.adj:hover { border-color: rgba(3, 168, 224, .6); }
.xb:active:not(:disabled) { transform: scale(.97); }
.xb:disabled { opacity: .32; cursor: not-allowed; }
.log-row { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.log-row:last-child { border-bottom: 0; }
.log-row time { font: 600 13px var(--f-num); color: var(--muted); }
.log-row > b { font: 700 15px var(--f-num); }
.undo { background: none; border: 1px solid var(--line-2); color: var(--muted); border-radius: 7px; padding: 4px 9px; font-size: 11px; }
/* jugada anulada con «Deshacer»: sigue visible pero no cuenta */
.voided { opacity: .55; }
.voided .pcell > span, .voided .tl-main > span { text-decoration: line-through; }
.undo:hover { color: #FFA3A3; border-color: rgba(239, 111, 111, .5); }
.empty-state { padding: 40px 24px; text-align: center; }
.empty-state h3 { margin: 0 0 6px; font: 600 22px var(--f-num); }
.empty-state p { margin: 0; color: var(--muted); }

/* Formularios */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
input[type=color] { width: 100%; height: 40px; padding: 3px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--panel); cursor: pointer; }
.team-edit { display: flex; flex-direction: column; }
.team-edit.dirty { border-color: rgba(253, 206, 2, .55); }
.te-head { display: flex; align-items: center; gap: 14px; padding: 16px; border-bottom: 1px solid var(--line); }
.te-head b { display: block; font-size: 15px; }
.te-head small { color: var(--muted); font-size: 12px; }
.te-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.te-grid { display: grid; grid-template-columns: minmax(0, 1fr) 84px 60px; gap: 10px; }
.pl-head, .pl-edit { display: grid; grid-template-columns: 44px 54px minmax(0, 1fr) 28px; gap: 8px; align-items: center; }
.pl-head { margin-top: 6px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.pl-edit .input, .pl-edit .select { padding: 8px 10px; }
.te-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); margin-top: auto; }
.dirty-note { font-size: 12px; color: var(--gold); visibility: hidden; }
.team-edit.dirty .dirty-note { visibility: visible; }
.pair-edit { display: grid; grid-template-columns: 110px minmax(0, 1fr) 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; }
.pair-edit .vs { text-align: center; color: var(--muted); font-size: 12px; }
.pair-edit.locked { opacity: .65; }
@media (max-width: 700px) {
  .pair-edit { grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr); }
  .pair-edit > b { grid-column: 1 / -1; }
  .pair-edit > .chip { grid-column: 1 / -1; justify-self: start; }
}
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .two-col { grid-template-columns: minmax(0, 1fr); } }
.actions-row { display: flex; flex-wrap: wrap; gap: 10px; }
.kv { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8px 14px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-all; }
.kv code { background: var(--panel-3); padding: 2px 6px; border-radius: 6px; font-size: 12px; }
.banner-pending { display: none; margin-bottom: 14px; padding: 10px 14px; border-radius: 10px; background: var(--gold-soft); color: var(--gold-2); font-size: 13px; }
.banner-pending.show { display: block; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .card { width: min(410px, 100%); padding: 30px; }
.login img { height: 92px; margin-bottom: 18px; }
.login h1 { margin: 0 0 4px; font: 600 28px var(--f-num); }
.login p { margin: 0 0 20px; color: var(--muted); font-size: 13px; }
.login form { display: flex; flex-direction: column; gap: 12px; }
.login .err { color: var(--neg); font-size: 13px; min-height: 18px; }

/* Diálogo */
dialog {
  background: var(--panel); color: var(--text); border: 1px solid var(--line-2); border-radius: 16px;
  padding: 0; width: min(430px, calc(100% - 32px)); box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(0, 0, 0, .65); }
.dlg { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.dlg h3 { margin: 0; font: 600 22px var(--f-num); }
.dlg p { margin: -8px 0 0; color: var(--muted); font-size: 13px; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.quick button { flex: 1; padding: 8px 0; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel-2); font: 700 15px var(--f-num); }
.quick button:hover { border-color: var(--gold); }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* Tabla de jugadores dentro de la tarjeta de equipo */
.roster { width: 100%; border-collapse: collapse; font-size: 13px; }
.roster th { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 10px 6px 6px; text-align: center; }
.roster th:first-child, .roster td:first-child { text-align: left; padding-left: 16px; }
.roster th:last-child, .roster td:last-child { text-align: right; padding-right: 16px; }
.roster td { padding: 8px 6px; text-align: center; border-top: 1px solid var(--line); font-family: var(--f-num); font-size: 15px; font-weight: 600; }
.roster td:first-child { font-family: var(--f-ui); font-size: 13px; font-weight: 500; }
.roster tbody tr { cursor: pointer; }
.roster tbody tr:hover td { background: var(--panel-2); }
.roster td:first-child .pnum { margin-right: 8px; width: 24px; height: 24px; font-size: 13px; vertical-align: middle; }
.roster .z { color: var(--muted); font-weight: 500; }
.sp-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; padding: 0 20px 14px; color: var(--text-2); font-size: 13px; }
.sp-box .retry { font: 600 13px var(--f-num); letter-spacing: .06em; color: var(--muted); }

/* =====================================================================
   Cuentas de visitantes y predicciones
   ===================================================================== */
.coin {
  display: inline-block; width: 16px; height: 16px; border-radius: 50%; flex: 0 0 auto; vertical-align: -3px;
  background: radial-gradient(circle at 35% 30%, #FFF1A8, var(--yellow) 45%, #C99A00 100%);
  box-shadow: inset 0 0 0 1.5px rgba(120, 85, 0, .55);
}
.account { display: flex; align-items: center; gap: 8px; }
.acct {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--line-2); font-size: 12px; color: var(--text-2);
}
.acct b { font-size: 16px; color: var(--gold-2); }
.acct span { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct:hover { border-color: rgba(253, 206, 2, .5); }
@media (max-width: 980px) { .account { margin-left: auto; } .acct span { display: none; } }

.predbar {
  display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
  padding: 9px 24px; font-size: 13px; color: var(--text-2); border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(3, 168, 224, .10), rgba(253, 206, 2, .06), rgba(230, 79, 32, .08));
}
.predbar b { color: var(--gold-2); font-size: 16px; letter-spacing: .04em; }
.predbar.is-closed { background: var(--bg-2); color: var(--muted); }
.pb-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.pb-dot.open { background: var(--pos); box-shadow: 0 0 0 4px rgba(65, 207, 143, .15); animation: pulse 1.6s infinite; }

.pick { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pick .odds { grid-auto-columns: 1fr; }
.pick-team { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text); }
.pick-note { color: var(--muted); font-size: 11px; display: flex; align-items: center; gap: 5px; }
.pick-note .coin { width: 12px; height: 12px; vertical-align: -2px; }
.pick.off span { display: block; padding: 10px 12px; border-radius: 9px; background: var(--bg-2); border: 1px dashed var(--line-2); color: var(--muted); font-size: 12px; text-align: center; }
.pick.mine { padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2); gap: 3px; }
.pick.mine .pick-k { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.pick.mine .pick-v { display: flex; align-items: center; gap: 8px; }
.pick.mine .pick-v small { color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.pick.mine .pick-v .coin { width: 12px; height: 12px; }
.pick.mine .pick-s { font-size: 12px; color: var(--text-2); }
.pick.mine.won { border-color: rgba(65, 207, 143, .55); background: rgba(65, 207, 143, .07); }
.pick.mine.won .pick-s { color: var(--pos); font-weight: 600; }
.pick.mine.lost { opacity: .7; }
.pick.mine.lost .pick-s { color: var(--neg); }
.pick.mine.pending { border-color: rgba(253, 206, 2, .4); }

.wallet-cta { margin: 0 0 12px; color: var(--text-2); font-size: 13px; }
.wallet-main { display: flex; align-items: center; gap: 10px; }
.wallet-main .coin { width: 26px; height: 26px; }
.wallet-main b { font-size: 38px; line-height: 1; color: var(--gold-2); }
.wallet-main span { color: var(--muted); font-size: 12px; }
.wallet-main.big b { font-size: 52px; }
.wallet-main.big .coin { width: 34px; height: 34px; }
.wallet-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.wallet-grid > div { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.wallet-grid b { display: block; font-size: 18px; }
.wallet-grid small { color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.wallet-hero { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 22px; flex-wrap: wrap;
  background: linear-gradient(120deg, rgba(3, 168, 224, .12), var(--panel) 45%, rgba(253, 206, 2, .08)); }
.wallet-hero h2 { margin: 4px 0 6px; font: 600 30px/1.05 var(--f-num); }
.wallet-hero p { margin: 0; color: var(--text-2); max-width: 520px; }
.wallet-hero .wallet-grid { grid-template-columns: repeat(4, auto); margin: 0; align-items: center; }
.wallet-hero .wallet-grid > div:last-child { background: none; border: 0; }
@media (max-width: 760px) { .wallet-hero .wallet-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; } }
.layout-2 { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
@media (max-width: 980px) { .layout-2 { grid-template-columns: minmax(0, 1fr); } }
.mini-row.me { background: var(--gold-soft); }
.mini-row .who small { margin-left: 6px; }
.how p { color: var(--text-2); font-size: 13px; margin: 12px 0 0; }
.how .xp-rule b { display: inline-flex; align-items: center; gap: 6px; font-size: 18px; }
.chip.st-pending { background: var(--gold-soft); color: var(--gold-2); }
.chip.st-won { background: rgba(65, 207, 143, .14); color: #7FE2B4; }
.chip.st-lost { background: rgba(240, 122, 106, .14); color: #FFB0A3; }
.chip.st-void { background: var(--panel-3); color: var(--muted); }

.bet-match { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.bet-pick { display: flex; align-items: center; gap: 14px; margin: 12px 0; }
.bet-pick small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.bet-pick strong { display: block; font: 600 24px/1.1 var(--f-num); }
.bet-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.bet-grid > div { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.bet-grid small { display: block; color: var(--muted); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.bet-grid b { display: inline-flex; align-items: center; gap: 5px; font-size: 20px; }
#betBody p { font-size: 12px; margin: 6px 0 0; }

/* Panel de organizadores: temporizador de predicciones */
.timer-big { font: 700 44px/1 var(--f-num); letter-spacing: .04em; color: var(--gold-2); }
.timer-state { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-2); }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.inline-form .field { min-width: 140px; }

/* Transmisión de YouTube */
.live-video { overflow: hidden; }
.live-video .card-h h3 { display: flex; align-items: center; }
.yt-frame { position: relative; aspect-ratio: 16 / 9; background: #000; }
.yt-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-note { margin: 0; padding: 10px 16px; font-size: 12px; color: var(--muted); }

/* Insignias con logo (ITM, UNIMINUTO…) */
.tb.has-logo {
  display: inline-flex; align-items: center; justify-content: center; overflow: hidden;
  width: 46px; height: 26px; padding: 2px 3px; background: #fff; border-color: color-mix(in srgb, var(--tc) 70%, #fff);
}
.tb.sm.has-logo { width: 42px; height: 24px; }
.tb.lg.has-logo { width: 68px; height: 68px; padding: 7px; }
.tb.has-logo img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
@media (max-width: 640px) { .tb.lg.has-logo { width: 52px; } }

/* XP por fase en cada partido y acceso a pronósticos */
.xpinfo { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.xpinfo b { color: var(--text-2); }
.xpinfo > b { font-size: 13px; color: var(--text); }
.promo {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; margin-top: 12px;
  padding: 12px 14px; border-radius: 10px; border: 1px solid rgba(253, 206, 2, .45); background: var(--gold-soft);
  color: var(--text-2); font-size: 13px; text-align: left;
}
.promo > b { color: var(--gold-2); white-space: nowrap; }
.promo:hover { background: rgba(253, 206, 2, .2); }
.market-list .out-row.big { grid-template-columns: minmax(0, 1fr) 48px 74px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.market-list .out-row.big:last-child { border-bottom: 0; }
.market-list .odd { justify-content: center; padding: 7px 8px; }
.market-list .odd:disabled { opacity: .45; cursor: not-allowed; }
.market-list .odd.sel:disabled { opacity: 1; }
/* Pronósticos: toda la fila se puede tocar */
.market-list .out-row.pickable { cursor: pointer; border-radius: 8px; transition: background .15s, box-shadow .15s; }
.market-list .out-row.pickable:hover, .market-list .out-row.pickable:focus-visible { background: var(--panel-2); box-shadow: inset 0 0 0 1px rgba(253, 206, 2, .45); outline: none; }
.market-list .out-row.pickable:hover .odd, .market-list .out-row.pickable:focus-visible .odd { border-color: rgba(253, 206, 2, .7); background: var(--panel-3); }
.market-list .out-row.pickable:active { transform: scale(.995); }
.market-list .odd.dis { opacity: .45; }
.market-list .odd.sel.dis { opacity: 1; }
.market-list.scroll { max-height: 470px; overflow-y: auto; }
.out-row .who small { font-size: 11px; }

/* Código QR para el público */
.qr-box { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 14px 0; }
.qr-box #qrImg { width: 260px; height: 260px; background: #fff; border-radius: 12px; padding: 0; overflow: hidden; }
.qr-box #qrImg svg, #qrFullImg svg { width: 100%; height: 100%; display: block; }
.qr-box code { font-size: 12px; word-break: break-all; text-align: center; color: var(--text-2); }
.qr-full { position: fixed; inset: 0; z-index: 100; background: #fff; display: grid; place-items: center; padding: 20px; }
.qr-full-in { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; color: #021E5F; }
.qr-full .qr-logo { height: 90px; }
.qr-full h2 { margin: 0; font: 700 34px/1.1 var(--f-num); }
.qr-full p { margin: 0; font-size: 18px; color: #233042; }
#qrFullImg { width: min(62vh, 80vw); height: min(62vh, 80vw); }
.qr-full code { font-size: 18px; color: #021E5F; word-break: break-all; }

.qr-hint { margin: 10px 0 0; padding: 9px 12px; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--line-2); font-size: 12.5px; color: var(--text-2); }

/* =====================================================================
   Patrocinadores: carrusel (siempre visible) y sección fija del pie
   ===================================================================== */
.sponsors {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px;
  padding: 8px 24px; background: linear-gradient(180deg, #0A1533, #08112A); border-bottom: 1px solid var(--line);
}
.sp-label { display: flex; flex-direction: column; line-height: 1.15; padding-right: 16px; border-right: 1px solid var(--line-2); }
.sp-label span { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.sp-label small { font-size: 11px; color: var(--muted); }
.sp-viewport {
  overflow: hidden; min-width: 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}
.sp-track { display: flex; width: max-content; will-change: transform; }
.sp-item {
  flex: 0 0 auto; width: 300px; margin-right: 16px; display: grid; grid-template-columns: 158px minmax(0, 1fr);
  align-items: center; gap: 14px; padding: 6px 14px 6px 6px; border-radius: 14px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line-2);
  text-decoration: none; color: var(--text); transition: border-color .15s, transform .15s;
}
a.sp-item:hover { border-color: rgba(253, 206, 2, .6); }
/* Tarjeta del logo: fondo del color de la marca y logo centrado en ambos ejes */
.sp-logo {
  flex: 0 0 auto; width: 158px; height: 56px; padding: 8px 14px; border-radius: 10px; overflow: hidden;
  display: grid; place-items: center; background: var(--sp-bg, #fff);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), 0 2px 10px rgba(0, 0, 0, .28);
}
.sp-logo img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: center; user-select: none; }
.sp-logo b { color: #021E5F; font-size: 12px; line-height: 1.15; text-align: center; }
.sp-name { font-size: 13px; font-weight: 600; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sp-none { width: auto; color: var(--muted); padding: 14px; }
.sp-speed { display: flex; align-items: center; gap: 6px; padding-left: 14px; border-left: 1px solid var(--line-2); }
.sp-speed button {
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--panel-2);
  font: 700 17px/1 var(--f-ui); display: grid; place-items: center; padding: 0;
}
.sp-speed button:hover:not(:disabled) { border-color: var(--gold); color: var(--gold-2); }
.sp-speed button:disabled { opacity: .35; cursor: default; }
.sp-speed span { min-width: 34px; text-align: center; font: 700 15px var(--f-num); color: var(--gold-2); }
@media (max-width: 720px) and (min-height: 501px), (max-width: 720px) and (orientation: portrait) {
  .sponsors { padding: 8px 12px; gap: 10px; grid-template-columns: minmax(0, 1fr) auto; }
  .sp-label { display: none; }
  .sp-item { width: 244px; grid-template-columns: 124px minmax(0, 1fr); gap: 10px; padding: 5px 10px 5px 5px; margin-right: 12px; }
  .sp-logo { width: 124px; height: 48px; padding: 7px 10px; }
  .sp-name { font-size: 12px; }
  .sp-speed { padding-left: 8px; gap: 4px; }
  .sp-speed button { width: 28px; height: 28px; }
}
.sp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.sp-grid .sp-item { width: auto; margin: 0; padding: 12px; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 10px; background: #071029; }
.sp-grid .sp-logo { width: 100%; height: 86px; padding: 14px 26px; }
.sp-grid .sp-name { text-align: center; }

/* En la portada las llaves ya muestran todos los marcadores: se oculta la cinta */
body[data-view="home"] .ticker { display: none; }

/* =====================================================================
   Portada de visitantes: llaves → listas → en vivo
   ===================================================================== */
.home-sec { margin-bottom: 36px; }
.sec-h { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.sec-h h2 { margin: 2px 0 0; font: 600 30px/1.05 var(--f-num); letter-spacing: .02em; }
.sec-h p { margin: 6px 0 0; color: var(--muted); max-width: 640px; font-size: 13px; }
.live-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1050px) { .live-grid { grid-template-columns: minmax(0, 1fr); } }
.yt-empty { display: grid; place-items: center; text-align: center; background: radial-gradient(500px 240px at 50% 40%, #0E1B3E, #050A18); }
.yt-empty > div { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 20px; color: var(--muted); font-size: 13px; }
.yt-empty svg { width: 56px; height: 56px; color: #FF3D3D; opacity: .85; }
.yt-empty b { color: var(--text); font-size: 15px; }

.acct.big { padding: 9px 16px 9px 12px; font-size: 13px; }
.acct.big b { font-size: 24px; }
.acct.big span { max-width: none; }

.mk-card .card-h h3 { display: flex; align-items: center; gap: 8px; }
.mk-card .card-h h3 svg { width: 16px; height: 16px; color: var(--gold); }
.mk-card .card-h h3 small { text-transform: none; letter-spacing: 0; font-weight: 500; }
.mk-closed { margin: 0 0 10px; font-size: 13px; }
.chg { display: inline-flex; align-items: center; gap: 5px; color: var(--gold-2); font-size: 12px; }
.chg .coin { width: 13px; height: 13px; }
.out-row.mine { background: var(--gold-soft); border-radius: 8px; }
.out-row .pub { display: block; font-size: 10.5px; color: #7FD3F2; margin-top: 1px; }
.odd .tr { font-style: normal; font-size: 9px; margin-right: 4px; }
.odd .tr.dn { color: var(--neg); }
.odd .tr.up { color: var(--pos); }
.odd.sel .tr { color: #061335; }

.notice {
  display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; padding: 14px 18px;
  border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--panel);
}
.notice > b, .notice-h b { font-size: 15px; color: var(--text); }
.notice > span, .notice-h span { color: var(--text-2); font-size: 13px; }
.notice-h { display: flex; flex-direction: column; gap: 4px; }
.notice.info { border-color: rgba(3, 168, 224, .45); background: linear-gradient(120deg, rgba(3, 168, 224, .10), var(--panel) 60%); }
.notice.warn { border-color: rgba(253, 206, 2, .55); background: linear-gradient(120deg, rgba(253, 206, 2, .14), var(--panel) 60%); }
.notice.good { border-color: rgba(65, 207, 143, .5); background: linear-gradient(120deg, rgba(65, 207, 143, .12), var(--panel) 60%); }
.track { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 760px) { .track { grid-template-columns: minmax(0, 1fr); } }
.track li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); font-size: 13px; color: var(--text-2); }
.track li small { display: block; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.track li em { display: block; font-style: normal; color: var(--gold-2); font-size: 12px; margin-top: 4px; }
.track .ic { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.track li.ok .ic { background: rgba(65, 207, 143, .18); color: var(--pos); }
.track li.ko .ic { background: rgba(240, 122, 106, .18); color: var(--neg); }

.bet-change { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: center; margin: 12px 0; }
.bet-change > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); min-width: 0; font-size: 13px; }
.bet-change .from { opacity: .6; }
.bet-change .from > span { text-decoration: line-through; }
.bet-change .to { border-color: var(--gold); }
.bet-change small { width: 100%; color: var(--muted); font-size: 11px; }
.bet-change .arrow { color: var(--gold-2); font-size: 20px; }
.pick-c { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.pick-c .coin { width: 12px; height: 12px; }

/* ---------- Fotos de jugadores ---------- */
.av {
  --tc: #5A687B; position: relative; display: inline-grid; place-items: center; flex: 0 0 auto; overflow: hidden;
  width: 40px; height: 40px; border-radius: 50%;
  background: color-mix(in srgb, var(--tc) 22%, var(--panel-3));
  border: 2px solid color-mix(in srgb, var(--tc) 65%, transparent);
  color: color-mix(in srgb, var(--tc) 55%, #fff);
}
.av img { display: block; width: 100%; height: 100%; object-fit: cover; }
.av-empty .person { position: absolute; width: 80%; height: 80%; bottom: -10%; opacity: .32; }
.av-empty b { position: relative; font: 700 15px var(--f-num); text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.av.xs { width: 24px; height: 24px; border-width: 1.5px; }
.av.xs b { font-size: 11px; }
.av.sm { width: 30px; height: 30px; }
.av.sm b { font-size: 12px; }
.av.lg { width: 64px; height: 64px; }
.av.lg b { font-size: 22px; }
.av.xl { width: 84px; height: 84px; border-width: 3px; }
.av.xl b { font-size: 28px; }
.av.fill { width: 100%; height: 100%; border-radius: 0; border: 0; }
.av.fill b { font-size: 46px; }
.av.fill .person { width: 72%; height: 72%; bottom: -6%; }
.rcell { display: inline-flex; align-items: center; gap: 8px; }
.pod .av { width: 46px; height: 46px; }

/* ---------- Sección Jugadores (tarjetas) ---------- */
.squad-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 16px; }
.pcard {
  --tc: #888; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  cursor: pointer; transition: transform .15s, border-color .15s, box-shadow .15s;
}
.pcard:hover, .pcard:focus-visible { transform: translateY(-3px); border-color: color-mix(in srgb, var(--tc) 70%, var(--line)); box-shadow: var(--shadow); outline: none; }
.pc-photo { position: relative; aspect-ratio: 1 / 1; background: color-mix(in srgb, var(--tc) 18%, var(--panel-2)); border-bottom: 3px solid var(--tc); }
.pc-rank, .pc-num { position: absolute; top: 8px; padding: 2px 8px; border-radius: 999px; font: 700 13px var(--f-num); background: rgba(4, 10, 28, .78); }
.pc-rank { left: 8px; color: var(--gold-2); }
.pc-num { right: 8px; color: var(--text-2); }
.pc-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 7px; }
.pc-body strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-team { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); min-width: 0; }
.pc-team > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-xp { display: flex; align-items: baseline; gap: 6px; }
.pc-xp b { font-size: 30px; line-height: 1; color: var(--gold-2); }
.pc-xp small { font-size: 11px; letter-spacing: .12em; color: var(--muted); font-weight: 600; }
@media (max-width: 480px) { .squad-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .av.fill b { font-size: 34px; } }

/* Jugadores agrupados por equipo: equipo a la izquierda, sus 4 jugadores a la derecha */
.squad-list { display: flex; flex-direction: column; gap: 18px; }
.squad-team {
  --tc: #888; display: grid; grid-template-columns: 250px minmax(0, 1fr); overflow: hidden;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.st-side {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 24px 18px 20px; text-align: center; border-right: 1px solid var(--line);
  background: linear-gradient(160deg, color-mix(in srgb, var(--tc) 30%, var(--panel-2)), var(--panel) 78%);
}
.st-side::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--tc); }
.st-side .tb.lg { width: 88px; height: 88px; min-width: 88px; border-radius: 20px; font-size: 24px; }
.st-side .tb.lg.has-logo { padding: 9px; }
.st-side h3 { margin: 4px 0 0; font: 600 24px/1.1 var(--f-num); letter-spacing: .02em; }
.st-rank { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.st-xp { display: flex; flex-direction: column; align-items: center; margin-top: 6px; }
.st-xp b { font-size: 48px; line-height: 1; color: var(--gold-2); }
.st-xp small { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-top: 4px; }
.st-meta { display: flex; gap: 12px; font-size: 12px; color: var(--muted); }
.st-meta b { color: var(--text-2); font: 700 14px var(--f-num); }
.st-players { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; padding: 16px; align-content: center; }
.st-players .pc-body { padding: 10px 12px 12px; gap: 4px; }
.st-players .pc-xp b { font-size: 26px; }
@media (max-width: 900px) {
  .squad-team { grid-template-columns: minmax(0, 1fr); }
  .st-side { border-right: 0; border-bottom: 1px solid var(--line); padding: 18px 16px; }
  .st-side::before { top: 0; bottom: auto; right: 0; width: auto; height: 4px; }
}
@media (max-width: 560px) {
  .st-players { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px; }
  .st-xp b { font-size: 40px; }
}

/* =====================================================================
   Pie de página oficial (fondo más oscuro)
   ===================================================================== */
.site-foot { margin-top: 40px; background: #020714; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.sf-in { max-width: 1400px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.sf-sponsors { background: #030A1D; border-bottom: 1px solid var(--line); padding: 26px 0; }
.sf-h { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.sf-h span { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.sf-main { display: grid; grid-template-columns: 1.4fr repeat(4, minmax(0, 1fr)); gap: 28px; padding-top: 30px; padding-bottom: 30px; }
@media (max-width: 1100px) { .sf-main { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sf-brand { grid-column: 1 / -1; } }
@media (max-width: 560px) { .sf-main { grid-template-columns: minmax(0, 1fr); } }
.sf-brand img { height: 52px; margin-bottom: 12px; display: block; }
.sf-brand p { margin: 0 0 12px; line-height: 1.55; max-width: 380px; }
.sf-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.sf-badge { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 11px; color: var(--text-2); }
.sf-col h4 { margin: 0 0 12px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-2); font-weight: 600; }
.sf-col a { display: block; color: var(--muted); text-decoration: none; padding: 4px 0; }
.sf-col a:hover { color: var(--gold-2); }
.sf-col p { margin: 0; line-height: 1.55; font-size: 12.5px; }
.sf-bottom { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 16px; padding-bottom: 26px; border-top: 1px solid var(--line); font-size: 12px; }
.sf-tags { display: flex; gap: 14px; flex-wrap: wrap; }
.sf-tags span::before { content: '\25CF'; color: var(--gold); font-size: 8px; margin-right: 6px; vertical-align: 2px; }
@media (max-width: 640px) { .sf-in { padding-left: 16px; padding-right: 16px; } }

/* =====================================================================
   Panel de organizadores: imágenes y patrocinadores
   ===================================================================== */
.te-logo { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.up-btn { position: relative; overflow: hidden; }
.up-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ph-up { position: relative; display: inline-grid; cursor: pointer; width: 40px; height: 40px; }
.ph-up .av { width: 40px; height: 40px; }
.ph-up input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.ph-up::after {
  content: '+'; position: absolute; right: -3px; bottom: -3px; width: 17px; height: 17px; border-radius: 50%;
  background: var(--gold); color: #061335; font: 700 13px/17px var(--f-ui); text-align: center; pointer-events: none;
}
.ph-up.has::after { content: '\270E'; font-size: 10px; }
.ph-up.busy { opacity: .45; pointer-events: none; }
.ph-rm { width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--line-2); background: none; color: var(--muted); padding: 0; font-size: 15px; line-height: 1; }
.ph-rm:hover { color: #FFA3A3; border-color: rgba(239, 111, 111, .5); }
.ph-rm.off { visibility: hidden; }
.spon-row { display: grid; grid-template-columns: 124px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.spon-row:last-child { border-bottom: 0; }
.spon-row .sp-logo { width: 124px; height: 52px; padding: 7px 12px; }
.spon-row strong { display: block; font-size: 14px; }
.spon-row small { color: var(--muted); word-break: break-all; font-size: 12px; }
.spon-row .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) { .spon-row { grid-template-columns: 90px minmax(0, 1fr); } .spon-row .sp-logo { width: 90px; height: 48px; } .spon-row .acts { grid-column: 1 / -1; justify-content: flex-start; } }
.logo-pick { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.logo-pick .sp-logo { width: 176px; height: 66px; }
.sp-bg-field input[type=color] { width: 58px; }
.logo-pick .sp-logo .muted { color: #7F8BA8; font-size: 11px; }
.admin-sponsors { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; grid-template-columns: minmax(0, 1fr) auto; }
.admin-sponsors .sp-label { display: none; }

/* =====================================================================
   Cabecera fija de visitantes: menú + patrocinadores + barra de estado
   ===================================================================== */
.site-head { position: sticky; top: 0; z-index: 40; box-shadow: 0 10px 24px rgba(0, 0, 0, .35); }
.site-head .topbar { position: relative; top: auto; background: rgba(5, 9, 22, .97); }
.site-head .predbar { background-color: var(--bg-2); }
.predbar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; gap: 0; padding: 0; }
.pb-l, .pb-r { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 8px 18px; text-align: center; min-width: 0; }
.pb-r { border-left: 1px solid var(--line-2); color: var(--text-2); }
.pb-r b { color: var(--gold-2); font-size: 14px; letter-spacing: .02em; }
.pb-dot.stage { background: var(--cyan); box-shadow: 0 0 0 4px rgba(3, 168, 224, .15); }
.pb-dot.live { background: var(--live); box-shadow: 0 0 0 4px rgba(230, 79, 32, .18); animation: pulse 1.2s infinite; }
.pb-dot.fin { background: var(--gold); }
@media (max-width: 720px) and (min-height: 501px), (max-width: 720px) and (orientation: portrait) {
  .pb-l, .pb-r { padding: 6px 8px; gap: 6px; font-size: 11.5px; line-height: 1.3; }
  .pb-l .btn { padding: 4px 9px; font-size: 11px; }
  .predbar b { font-size: 13px; }
  .sponsors { padding: 6px 12px; }
  .sp-logo { height: 42px; }
}
body[data-view="home"] .ticker { display: none; }

/* Filtro del MVP por el equipo marcado */
.mvp-filter { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 4px 10px; padding: 8px 10px; border-radius: 10px;
  background: var(--gold-soft); border: 1px solid rgba(253, 206, 2, .35); font-size: 13px; color: var(--text-2); }
.mvp-filter b { color: var(--gold-2); }
.mvp-filter .link { margin-left: auto; }
.mvp-filter.hint { background: var(--bg-2); border-color: var(--line); color: var(--muted); font-size: 12px; }
.market-list .out-row.focus { box-shadow: inset 3px 0 0 var(--gold); background: rgba(253, 206, 2, .06); border-radius: 8px; }
.mvp-rest {
  display: flex; align-items: center; justify-content: space-between; width: 100%; margin: 8px 0 4px; padding: 10px 12px;
  border-radius: 10px; border: 1px dashed var(--line-2); background: var(--bg-2); color: var(--text-2); font-weight: 600; font-size: 13px;
}
.mvp-rest small { color: var(--muted); font-weight: 500; }
.mvp-rest:hover { border-color: rgba(253, 206, 2, .55); color: var(--text); }
.mvp-rest i { font-style: normal; transition: transform .2s; }
.mvp-rest.open i { transform: rotate(180deg); }
.mvp-rest-list { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; animation: fade .2s ease; }

/* =====================================================================
   Llaves sobre el estadio MARE (portada y pestaña Llaves)
   ===================================================================== */
.bk-card { position: relative; overflow: hidden; isolation: isolate; background: #0B2312; border-color: rgba(255, 255, 255, .14); }
.bk-card::before, .bk-card::after { content: ''; position: absolute; z-index: -1; pointer-events: none; }
/* los lados se rellenan con la misma cancha difuminada */
.bk-card::before { inset: -40px; background: url("../assets/estadio-mare.webp") center / cover no-repeat; filter: blur(22px) saturate(1.1) brightness(.55); }
/* el estadio completo, centrado, con una capa oscura para que se lean los recuadros */
.bk-card::after {
  inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(4, 10, 28, .42), rgba(4, 10, 28, .72) 78%),
    url("../assets/estadio-mare.webp") center / contain no-repeat;
}
.bk-card .fb-col h4, .bk-card .third-slot h5 { color: #E6EDF7; text-shadow: 0 1px 3px rgba(0, 0, 0, .85); }
.bk-card .bm:not(.sim) { background: rgba(9, 18, 44, .9); border-color: rgba(255, 255, 255, .14); backdrop-filter: blur(4px); }
.bk-card .bm.sim { background: linear-gradient(180deg, rgba(60, 50, 4, .92), rgba(9, 18, 44, .92)); }
.bk-card .win-card:not(.sim) { background: rgba(9, 18, 44, .9); backdrop-filter: blur(4px); }
.bk-card .cn, .bk-card .c-sf .bm::before, .bk-card .c-f .final-slot .bm::before, .bk-card .final-slot .bm::after, .bk-card .win-slot::before { border-color: rgba(255, 255, 255, .55); }
.bk-card .cn.on, .bk-card .c-sf .bm.sim::before, .bk-card .final-slot.on .bm::before, .bk-card .final-slot.on .bm::after, .bk-card .win-slot.on::before { border-color: var(--gold); }
.bk-card .c-ent::after { border-color: rgba(255, 255, 255, .35); }
.bk-card .bk-note { color: #E6EDF7; text-shadow: 0 1px 2px rgba(0, 0, 0, .8); }
.bk-card .bracket-scroll { scrollbar-color: rgba(255, 255, 255, .35) transparent; }
/* en la simulación, los recuadros que no son del camino se atenúan sin volverse transparentes */
.bk-card .bm.dim { opacity: 1; }
.bk-card .bm.dim > * { opacity: .38; }
.bk-card .fb.is-sim .third-slot .bm > * { opacity: .38; }
.pb-l .pb-dot + span { max-width: calc(100% - 20px); }
.pb-short { display: none; }
@media (max-width: 720px) and (min-height: 501px), (max-width: 720px) and (orientation: portrait) {
  .pb-long { display: none; }
  .pb-short { display: inline; }
  .pb-l .btn { display: none; }
  .pb-l, .pb-r { padding: 7px 8px; flex-wrap: nowrap; white-space: nowrap; }
  .pb-l .pb-dot + span { max-width: none; overflow: hidden; text-overflow: ellipsis; }
  .site-head .topbar { padding: 6px 12px; gap: 6px 10px; }
  .site-head .brand-logo { height: 34px; }
  .site-head .brand-text strong { font-size: 10px; }
  .site-head .brand-text span { font-size: 12px; }
  .site-head .conn span:last-child { display: none; }
  .site-head .tabs button { padding: 6px 11px; }
  .site-head .acct { padding: 4px 10px 4px 6px; }
  .sponsors { padding: 5px 10px; }
  .sp-item { padding: 4px 8px 4px 4px; }
  .sp-logo { height: 38px; padding: 5px 8px; }
  .sp-speed button { width: 26px; height: 26px; font-size: 15px; }
}

/* =====================================================================
   CELULAR (solo pantallas pequeñas: la versión de PC no cambia)
   ===================================================================== */
@media (max-width: 720px) and (min-height: 501px), (max-width: 720px) and (orientation: portrait) {
  /* --- Cabecera fija: marca y cuenta en una línea, menú debajo --- */
  .site-head .topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 6px 10px; padding: 8px 12px 6px; }
  .site-head .brand { min-width: 0; gap: 10px; }
  .site-head .brand-text { padding-left: 10px; }
  .site-head .brand-text span { max-width: 100%; }
  .site-head .brand { grid-row: 1; grid-column: 1; }
  .site-head .account { grid-row: 1; grid-column: 2; margin-left: 0; gap: 6px; }
  .site-head .conn { grid-row: 1; grid-column: 3; }
  .site-head .tabs { grid-row: 2; }
  .site-head .account .btn { padding: 6px 10px; font-size: 12px; }
  .site-head .account [data-auth="login"] { display: none; }   /* «Iniciar sesión» sigue en la ventana de cuenta */
  .site-head .conn { margin-left: 0; }
  .site-head .tabs { grid-column: 1 / -1; order: 0; margin: 2px -12px 0; padding: 0 12px; width: auto; }

  /* --- Barra de estado: dos mitades de una línea, sin montarse --- */
  .predbar { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .pb-l, .pb-r { justify-content: flex-start; overflow: hidden; padding: 7px 10px; }
  .pb-l > span:not(.pb-dot), .pb-r > span:not(.pb-dot) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pb-r b { font-size: 12.5px; }

  /* --- Secciones --- */
  .wrap { padding: 14px 14px 0; }
  .home-sec { margin-bottom: 28px; }
  .sec-h { margin-bottom: 12px; }
  .sec-h h2 { font-size: 26px; }
  .sec-h > div:last-child:not(:first-child) { width: 100%; }
  .sec-h .actions-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .sec-h .actions-row .btn { white-space: normal; text-align: center; line-height: 1.2; padding: 10px 8px; }
  .sec-h .acct.big { width: 100%; justify-content: center; }
  .sec-h #bkMode { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .page-h h1 { font-size: 27px; }

  /* --- Llaves en vertical: ronda por ronda, sin deslizar de lado --- */
  .bk-card { padding: 14px 12px; }
  .bk-card::after { background: linear-gradient(rgba(4, 10, 28, .62), rgba(4, 10, 28, .78)), url("../assets/estadio-mare.webp") center / cover no-repeat; }
  .bracket-scroll { overflow: visible; padding-bottom: 0; }
  .fb { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
  .fb-col h4 {
    display: flex; align-items: center; gap: 10px; text-align: left; margin: 0 0 10px; font-size: 12px; color: var(--gold-2);
  }
  .fb-col h4::after { content: ''; flex: 1; height: 1px; background: rgba(255, 255, 255, .22); }
  .fb-body, .c-ent .fb-body, .c-win .fb-body { height: auto; display: flex; flex-direction: column; gap: 10px; justify-content: flex-start; }
  .pair { flex: none; gap: 10px; justify-content: flex-start; }
  .cn, .c-ent::after, .win-slot::before,
  .c-sf .bm::before, .c-f .final-slot .bm::before, .final-slot .bm::after { display: none; }
  .final-slot { flex: none; }
  .third-slot { position: static; margin-top: 6px; }
  .third-slot h5 { text-align: left; margin-bottom: 8px; }
  .win-slot { gap: 10px; }
  .win-card { padding: 14px 8px; }
  .bm { padding: 10px 12px; }
  .bm-row { min-height: 30px; }
  .bk-note { margin-top: 16px; }

  /* --- Listas de pronóstico --- */
  .mk-card .card-h { flex-wrap: wrap; row-gap: 4px; }
  .market-list .out-row.big { grid-template-columns: minmax(0, 1fr) 40px 70px; gap: 8px; padding: 9px 4px; }
  .market-list.scroll { max-height: 420px; }
  .notice { padding: 12px 14px; }

  /* --- En vivo --- */
  .live-video .card-h { flex-wrap: wrap; row-gap: 6px; }
  .live-video .card-h h3 { font-size: 11px; }
  .feature-top { flex-wrap: wrap; row-gap: 6px; }
  .timeline { padding: 10px 14px 14px; }

  /* --- Pronósticos (pestaña) --- */
  .wallet-hero { padding: 18px 16px; }
  .wallet-hero h2 { font-size: 25px; }
  .wallet-hero > .actions-row { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .wallet-hero > div:last-child { width: 100%; }

  /* --- Barras de búsqueda y filtros --- */
  .toolbar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .toolbar .input.grow, .toolbar .select { grid-column: 1 / -1; width: 100%; }
  .toolbar .seg { grid-column: 1 / -1; justify-self: start; }
  .page-h > .seg { width: 100%; }

  /* --- Jugadores por equipo: el equipo en una franja compacta --- */
  .st-side {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "logo rank xp" "logo name xp" "logo chip xp" "logo meta xp";
    justify-items: start; align-items: center; text-align: left; gap: 2px 14px; padding: 14px 16px;
  }
  .st-side .tb.lg { grid-area: logo; width: 62px; height: 62px; min-width: 62px; border-radius: 16px; font-size: 18px; }
  .st-side h3 { grid-area: name; margin: 0; font-size: 21px; }
  .st-side .chip { grid-area: chip; }
  .st-side .st-meta { grid-area: meta; }
  .st-side .st-xp { grid-area: xp; margin: 0; align-items: flex-end; }
  .st-side .st-xp b { font-size: 36px; }
  .st-side .st-xp small { font-size: 9px; text-align: right; max-width: 70px; }
  .st-rank { grid-area: rank; font-size: 10px; }

  /* --- Tablas: el equipo se ve con su insignia --- */
  #pTable td:nth-child(3) .pcell > span:not(.tb), #scTable td:nth-child(3) .pcell > span:not(.tb) { display: none; }
  .tbl th, .tbl td { padding: 10px 8px; }
  .podium .pod { padding: 14px 16px; }

  /* --- Equipos y reglas --- */
  .grid-teams { grid-template-columns: minmax(0, 1fr); }
  .rules-grid { grid-template-columns: minmax(0, 1fr); }
  #xpRules .tbl th, #xpRules .tbl td { padding: 9px 4px; white-space: normal; font-size: 12px; line-height: 1.2; }
  #xpRules .tbl th { font-size: 9.5px; letter-spacing: .03em; }
  #xpRules .tbl td.num { font-size: 14px; }
  #xpRules .tbl td:first-child { padding-left: 2px; }

  /* --- Detalle del jugador --- */
  .dw-head { padding: 18px 16px; gap: 12px; }
  .dw-hist { padding: 14px 16px 26px; }

  /* --- Pie: patrocinadores de a dos --- */
  .site-foot { margin-top: 28px; }
  .sf-sponsors { padding: 20px 0; }
  .sp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .sp-grid .sp-item { padding: 8px; gap: 8px; }
  .sp-grid .sp-logo { height: 58px; padding: 9px 10px; }
  .sp-grid .sp-name { font-size: 12px; }
  .sf-main { gap: 22px; padding-top: 24px; padding-bottom: 22px; }
  .sf-bottom { flex-direction: column; align-items: flex-start; }
  .sf-main { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sf-main .sf-brand, .sf-main > div.sf-col { grid-column: 1 / -1; }
}
@media (max-width: 380px) {
  .site-head .brand-text strong { display: none; }
  .market-list .out-row.big .pct { display: none; }
  .market-list .out-row.big { grid-template-columns: minmax(0, 1fr) 70px; }
}

/* ===== Base sólida: penal fallado, historial y cuentas de organizadores ===== */
.ev-pen_miss { background: rgba(240, 122, 106, .14); color: var(--neg); }
.xb.miss em { color: var(--text-3, #9aa6c4); }
.xb.miss:hover:not(:disabled) { border-color: rgba(240, 122, 106, .6); background: rgba(240, 122, 106, .07); }
.sb-sp small { font-size: .78em; opacity: .75; font-weight: 500; }
.who { font-size: 13px; color: var(--text-2, #c7d0e6); white-space: nowrap; margin: 0 4px 0 10px; }
.login form { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.login .login-help { margin: 4px 0 0; font-size: 12px; text-align: center; }
.login .setup-note { margin: 0; font-size: 13px; line-height: 1.5; background: rgba(253, 206, 2, .08);
  border: 1px solid rgba(253, 206, 2, .35); border-radius: 10px; padding: 10px 12px; }
.tbl.hist td { vertical-align: top; }
.tbl .nowrap, .nowrap { white-space: nowrap; }
.h-ico { display: inline-block; width: 1.4em; text-align: center; }
.tbl tr.off td { opacity: .55; }
.tbl tr.h-match-undo td, .tbl tr.h-match-reset td, .tbl tr.h-data-resetResults td, .tbl tr.h-data-resetAll td { color: #f3b2a8; }
@media (max-width: 720px) and (min-height: 501px), (max-width: 720px) and (orientation: portrait) { .who { display: none; } }
.login form[hidden], .card[hidden] { display: none; }

/* =====================================================================
   Selector de idioma (web de visitantes): compacto, bandera + código
   ===================================================================== */
.lang { position: relative; flex: none; }
.lang-btn {
  display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 9px 0 7px; border-radius: 9px;
  border: 1px solid var(--line-2); background: linear-gradient(180deg, #14234D, #0B1636); color: var(--text);
  cursor: pointer; white-space: nowrap; transition: border-color .15s, box-shadow .15s;
}
.lang-btn:hover, .lang.open .lang-btn { border-color: rgba(253, 206, 2, .65); box-shadow: 0 0 0 3px rgba(253, 206, 2, .12); }
.lang-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.lang-flag { display: inline-flex; flex: none; }
.lang-flag svg { width: 22px; height: 15px; display: block; border-radius: 3px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .28); }
.lang-txt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1; gap: 2px; }
.lang-word { font-size: 8.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.lang-code { font: 700 14px var(--f-num); letter-spacing: .05em; color: var(--gold-2); }
/* en PC el botón de idioma necesita su espacio: separaciones algo menores para que quepan todas las pestañas */
@media (min-width: 981px) and (max-width: 1500px) {
  .site-head .topbar { gap: 12px; padding-left: 18px; padding-right: 18px; }
  .site-head .tabs button { padding: 9px 11px; }
  .site-head .brand { gap: 10px; }
  .site-head .brand-text { padding-left: 10px; }
}
/* si falta espacio, se recorta primero el nombre del torneo (con «…») y no las pestañas */
@media (min-width: 981px) {
  .site-head .brand { flex: 0 50 auto; min-width: 44px; }
  .site-head .tabs { flex: 0 1 auto; }
}
@media (min-width: 1200px) { .site-head .tabs { flex-shrink: 0; } }
.lang-caret { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid var(--muted); transition: transform .15s; }
.lang.open .lang-caret { transform: rotate(180deg); }
.lang-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 70; min-width: 196px; margin: 0; padding: 6px; list-style: none;
  background: #0B1636; border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 18px 40px rgba(0, 0, 0, .55);
  animation: fade .15s ease;
}
.lang-menu li + li { margin-top: 2px; }
.lang-menu button {
  display: grid; grid-template-columns: 24px 40px minmax(0, 1fr) 14px; align-items: center; gap: 8px; width: 100%;
  padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); text-align: left; cursor: pointer;
}
.lang-menu button:hover, .lang-menu button:focus-visible { background: var(--panel-2); outline: none; }
.lang-menu button[aria-selected="true"] { background: var(--gold-soft); box-shadow: inset 0 0 0 1px rgba(253, 206, 2, .35); }
.lang-menu b { font: 700 13px var(--f-num); letter-spacing: .05em; color: var(--gold-2); }
.lang-name { font-size: 12.5px; color: var(--text-2); }
.lang-check { font-style: normal; font-size: 12px; color: var(--gold-2); }
/* en el celular vertical el botón muestra bandera y código (la palabra queda para lectores de pantalla) */
@media (max-width: 720px) and (min-height: 501px), (max-width: 720px) and (orientation: portrait) {
  .lang-word { display: none; }
  .lang-btn { height: 30px; padding: 0 7px 0 6px; gap: 6px; }
  .site-head .topbar { grid-template-columns: minmax(0, 1fr) auto auto auto; }
  .site-head .lang { grid-row: 1; grid-column: 2; }
  .site-head .account { grid-column: 3; }
  .site-head .conn { grid-column: 4; }
  .site-head .tabs { grid-column: 1 / -1; }
  .lang-menu { left: auto; right: 0; }
}

/* =====================================================================
   CELULAR EN HORIZONTAL (pantallas bajas y apaisadas). La versión de PC no cambia.
   Se ve casi igual que en PC: menú arriba, contenido en columnas, y una cabecera
   delgada para que quede espacio para el torneo.
   ===================================================================== */
@media (orientation: landscape) and (max-height: 500px) {
  /* --- Cabecera: marca, idioma, cuenta y conexión en una línea; pestañas debajo --- */
  .site-head .topbar {
    display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center;
    gap: 2px 10px; padding: 5px 14px 3px; flex-wrap: nowrap;
  }
  .site-head .brand { grid-row: 1; grid-column: 1; min-width: 0; gap: 8px; }
  .site-head .brand-logo { height: 28px; }
  .site-head .brand-text { padding-left: 8px; }
  .site-head .brand-text strong { font-size: 9.5px; letter-spacing: .12em; }
  .site-head .brand-text span { font-size: 11.5px; }
  .site-head .lang { grid-row: 1; grid-column: 2; }
  .site-head .lang-btn { height: 28px; padding: 0 8px 0 6px; gap: 6px; }
  .site-head .lang-flag svg { width: 20px; height: 14px; }
  .site-head .lang-word { font-size: 7.5px; }
  .site-head .lang-code { font-size: 13px; }
  .lang-menu { left: auto; right: 0; }
  .lang-menu button { padding: 6px 10px; }
  .site-head .account { grid-row: 1; grid-column: 3; margin-left: 0; gap: 6px; }
  .site-head .account .btn { padding: 4px 10px; font-size: 12px; min-height: 0; }
  .site-head .acct { padding: 3px 10px 3px 5px; }
  .site-head .conn { grid-row: 1; grid-column: 4; margin-left: 0; }
  .site-head .conn span:last-child { display: none; }
  .site-head .tabs { grid-row: 2; grid-column: 1 / -1; order: 0; width: auto; margin: 1px -14px 0; padding: 0 10px; justify-content: center; }
  .site-head .tabs button { padding: 5px 11px; font-size: 13px; }

  /* --- Patrocinadores: la misma cinta, más baja --- */
  .sponsors { padding: 3px 14px; gap: 10px; grid-template-columns: auto minmax(0, 1fr) auto; }
  .sp-label { display: flex; padding-right: 10px; }
  .sp-label span { font-size: 9px; }
  .sp-label small { font-size: 9.5px; }
  .sp-item { width: 196px; grid-template-columns: 84px minmax(0, 1fr); gap: 8px; padding: 3px 8px 3px 3px; margin-right: 10px; border-radius: 10px; }
  .sp-logo { width: 84px; height: 30px; padding: 4px 8px; border-radius: 7px; }
  .sp-name { font-size: 11px; -webkit-line-clamp: 1; }
  .sp-speed { padding-left: 8px; gap: 4px; }
  .sp-speed button { width: 22px; height: 22px; font-size: 14px; }
  .sp-speed span { min-width: 26px; font-size: 13px; }

  /* --- Barra de estado: una sola línea por lado --- */
  .pb-l, .pb-r { padding: 3px 12px; gap: 8px; flex-wrap: nowrap; white-space: nowrap; justify-content: center; font-size: 12px; line-height: 1.25; }
  .pb-l > span:not(.pb-dot), .pb-r > span:not(.pb-dot) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pb-l .pb-long { display: none; }
  .pb-l .pb-short { display: inline; }
  .pb-l .btn { display: inline-flex; padding: 2px 9px; font-size: 11px; min-height: 0; flex: none; }
  .predbar b { font-size: 13px; }
  .pb-dot { width: 7px; height: 7px; }

  /* Al bajar, la cinta de patrocinadores y la barra de estado se recogen (vuelven al subir).
     La cabecera queda fija y su espacio reservado no cambia: el contenido nunca salta. */
  body.public .site-head { position: fixed; top: 0; left: 0; right: 0; }
  body.public { padding-top: var(--head-h, 144px); }
  .site-head .sponsors, .site-head .predbar { transition: transform .22s ease, opacity .18s ease; }
  body.head-min .site-head .sponsors, body.head-min .site-head .predbar { display: none; }

  /* --- Contenido: columnas como en PC --- */
  .wrap { padding: 14px 16px 0; }
  .home-sec { margin-bottom: 26px; }
  .sec-h, .page-h { margin-bottom: 12px; }
  .sec-h h2 { font-size: 24px; }
  .page-h h1 { font-size: 26px; }
  .two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .live-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 12px; }
  .layout-2 { grid-template-columns: minmax(0, 1fr) 250px; gap: 14px; }
  .podium { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .grid-teams { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
  .rules-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
  .market-list.scroll { max-height: 250px; }
  .market-list .out-row.big { padding: 7px 4px; }
  .mk-card .card-h { flex-wrap: wrap; row-gap: 2px; }
  .feature-top { flex-wrap: wrap; row-gap: 4px; }
  .live-video .card-h { flex-wrap: wrap; row-gap: 4px; }

  /* --- Ventanas y detalle del jugador: caben en la pantalla baja --- */
  dialog { max-height: calc(100vh - 16px); overflow: auto; }
  .drawer .panel { max-height: 100vh; overflow: auto; }
}
/* horizontal muy angosto (640–700 px): pestañas y marca un poco más compactas */
@media (orientation: landscape) and (max-height: 500px) and (max-width: 700px) {
  .site-head .brand-text strong { display: none; }
  .site-head .tabs { justify-content: flex-start; }
  .site-head .tabs button { padding: 5px 9px; font-size: 12.5px; }
  .site-head .account [data-auth="login"] { display: none; }
  .layout-2 { grid-template-columns: minmax(0, 1fr); }
  .sp-label { display: none; }
}
@media (orientation: landscape) and (max-height: 500px) {
  /* Pronósticos: las dos listas a todo el ancho y el ranking debajo, para que se lean los nombres */
  #predictBox .layout-2 { grid-template-columns: minmax(0, 1fr); }
  #predictBox .layout-2 > aside { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
  /* Jugadores: como en PC, el equipo a la izquierda y sus 4 jugadores a la derecha */
  .squad-team { grid-template-columns: 168px minmax(0, 1fr); }
  .st-side { border-right: 1px solid var(--line); border-bottom: 0; padding: 12px 10px; gap: 4px; }
  .st-side::before { top: 0; bottom: 0; left: 0; right: auto; width: 4px; height: auto; }
  .st-side .tb.lg { width: 56px; height: 56px; min-width: 56px; border-radius: 14px; font-size: 17px; }
  .st-side h3 { font-size: 19px; }
  .st-xp { margin-top: 2px; }
  .st-xp b { font-size: 32px; }
  .st-xp small { font-size: 8.5px; }
  .st-players { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 10px; }
  .st-players .pc-body { padding: 7px 9px 9px; }
  .st-players .pc-xp b { font-size: 21px; }
}
@media (orientation: landscape) and (max-height: 500px) and (max-width: 760px) {
  /* listas de pronóstico angostas: el nombre tiene prioridad sobre el porcentaje */
  .market-list .out-row.big { grid-template-columns: minmax(0, 1fr) 66px; gap: 6px; }
  .market-list .out-row.big .pct { display: none; }
}
@media (max-width: 430px) and (orientation: portrait) {
  .site-head .brand-text strong { display: none; }   /* deja espacio al botón de idioma */
}
