:root {
  --bg: #0a0b0e;
  --panel: #111318;
  --panel-2: #181b22;
  --line: #242833;
  --line-soft: #171a20;
  --text: #eceef3;
  --muted: #8a909c;
  --muted-2: #5d6370;
  --accent: #ffb000;
  --live: #ff3b30;
  --label: #0d0f13;
  --L: 34px;
  --gap: 10px;
  --row: 60px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; background: var(--bg); color: var(--text); font: 15px/1.35 var(--sans); -webkit-font-smoothing: antialiased; }
body { overflow: hidden; -webkit-tap-highlight-color: transparent; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
svg { display: block; }

.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; letter-spacing: -.04em; }
.brand.big { font-size: 34px; justify-content: center; margin-bottom: 8px; }
.mark { width: 1.18em; height: 1em; fill: currentColor; color: var(--accent); }
.brand b { color: var(--accent); }

/* login */
.login { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; background: radial-gradient(ellipse at 50% 0%, #1a1d26, var(--bg) 60%); }
.login-card { width: min(340px, 100%); display: grid; gap: 12px; }
.login-card input { height: 48px; padding: 0 16px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); outline: none; font-size: 16px; }
.login-card input:focus { border-color: var(--accent); }
.login-card button { height: 48px; border-radius: 12px; background: var(--accent); color: #141414; font-weight: 700; }
.login-err { min-height: 20px; color: var(--live); font-size: 14px; text-align: center; }

/* estructura */
.app { display: grid; grid-template-columns: minmax(0, 1fr) 380px; grid-template-rows: 56px minmax(0, 1fr); height: 100vh; height: 100dvh; }
.bar { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 0 14px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #101218, var(--bg)); }
.layouts { display: flex; gap: 4px; margin-left: auto; padding: 3px; border: 1px solid var(--line); border-radius: 10px; }
.layouts button { width: 40px; height: 30px; display: grid; place-items: center; border-radius: 7px; color: var(--muted); }
.layouts button svg { width: 22px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.layouts button.on { color: var(--accent); background: var(--panel-2); }
.layouts button:disabled { opacity: .3; cursor: default; }
.tools { display: flex; align-items: center; gap: 6px; }
.meter { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; font: 600 13px var(--mono); color: var(--muted); }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 14px; }
.bars i { width: 4px; height: 40%; border-radius: 1px; background: #343944; }
.bars i:nth-child(2) { height: 70%; }
.bars i:nth-child(n+3) { height: 100%; }
.bars i.on { background: var(--accent); }
.meter.full .bars i.on { background: var(--live); }
.meter.full b { color: var(--live); }
.icon { width: 36px; height: 32px; display: grid; place-items: center; border-radius: 8px; color: var(--muted); }
.icon:hover, .layouts button:hover { color: var(--text); }
.icon.on { color: var(--accent); }
.icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* muro de pantallas */
.stage, .mando { grid-column: 1; grid-row: 2; }
.guide { grid-column: 2; grid-row: 2; }
.stage { position: relative; container-type: size; display: flex; align-items: center; justify-content: center; padding: 14px; overflow: hidden; min-width: 0; }
.wall { display: grid; gap: var(--gap); width: min(100cqw, calc((100cqh - var(--L)) * 1.7778)); align-items: start; }
.stage[data-n="2"] .wall { grid-template-columns: 1fr 1fr; width: min(100cqw, calc((100cqh - var(--L)) * 3.5556 + var(--gap))); }
.stage[data-n="3"] .wall { grid-template-columns: 2fr 1fr; width: min(100cqw, calc((100cqh - 2 * var(--L) - var(--gap)) * 2.6667 + var(--gap))); }
.stage[data-n="3"] .wall { align-items: stretch; }
.stage[data-n="3"] .slot:first-child { grid-row: span 2; }
.stage[data-n="3"] .slot:first-child .screen { flex: 1; aspect-ratio: auto; }
.stage[data-n="4"] .wall { grid-template-columns: 1fr 1fr; width: min(100cqw, calc((100cqh - 2 * var(--L) - var(--gap)) * 1.7778 + var(--gap))); }

.slot { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--label); }
.slot.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.screen { position: relative; aspect-ratio: 16 / 9; background: #000; cursor: pointer; overflow: hidden; }
.screen video, .still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.idle { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 12px; text-align: center; color: var(--muted); font-size: 14px; background: radial-gradient(ellipse at 50% 40%, #161922, #050608 70%); }
.idle img { max-width: 28%; max-height: 38%; object-fit: contain; }
.slot.playing .idle { display: none; }
.slot.loading .idle img { animation: pulse 1.2s ease-in-out infinite; }
.slot.error .idle .msg { color: #ff8a80; }
.spin { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; border: 3px solid rgba(255, 255, 255, .15); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; display: none; }
.slot.buffering .spin { display: block; animation: spin .8s linear infinite, appear .2s .5s both; }
.stats { position: absolute; left: 8px; top: 8px; padding: 8px 10px; border-radius: 8px; background: rgba(0, 0, 0, .74); font: 11.5px/1.5 var(--mono); color: #d7dbe3; pointer-events: none; display: none; }
.show-stats .stats:not(:empty) { display: block; }
.tap { position: absolute; right: 10px; bottom: 10px; padding: 6px 10px; border-radius: 8px; background: rgba(0, 0, 0, .7); font-size: 13px; display: none; }
.slot.blocked .tap { display: block; }

.label { position: relative; height: var(--L); display: flex; align-items: center; gap: 8px; padding: 0 4px 0 10px; border-top: 1px solid var(--line); font-size: 13px; }
.tally { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #343944; }
.slot.onair .tally { background: var(--live); box-shadow: 0 0 8px var(--live); animation: onair 1.8s ease-in-out infinite; }
@keyframes onair { 50% { box-shadow: 0 0 2px var(--live); opacity: .65; } }
.sn { flex: none; padding: 2px 5px; border: 1px solid var(--line); border-radius: 4px; font: 600 11px/1.2 var(--mono); color: var(--muted); }
.slot.active .sn { color: #141414; background: var(--accent); border-color: var(--accent); }
.cn { flex: none; max-width: 46%; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q { flex: none; padding: 2px 4px; border: 1px solid var(--line); border-radius: 4px; font: 600 10px/1.2 var(--mono); color: var(--muted); }
.q:empty { display: none; }
.now { flex: 1; min-width: 0; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.label button { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; color: var(--muted); }
.label button:hover { color: var(--text); background: var(--panel-2); }
.label button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.prog { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--accent); opacity: .8; }
.slot.empty .b-mute, .slot.empty .b-full, .slot.empty .b-pip { visibility: hidden; }
.b-alt { display: none; }
.slot.has-alt:not(.vod) .b-alt { display: grid; }

.stage:fullscreen { padding: 0; background: #000; }
.stage:fullscreen .slot { border-radius: 0; }
.screen:fullscreen { aspect-ratio: auto; }

/* guía */
.guide { display: flex; flex-direction: column; min-height: 0; background: var(--panel); border-left: 1px solid var(--line); }
.tabs { display: flex; padding: 3px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.tabs button { flex: 1; height: 32px; border-radius: 7px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.tabs button.on { background: var(--accent); color: #141414; }
.vod-only { display: none; }
.guide[data-tab="movie"] .vod-only, .guide[data-tab="series"] .vod-only { display: inline-block; }
.guide[data-tab="movie"] .scopes button:not(.vod-only), .guide[data-tab="series"] .scopes button:not(.vod-only) { display: none; }
.guide[data-tab="movie"] .scopes select, .guide[data-tab="series"] .scopes select { flex: 1 1 0; }
.row.vrow .logo { width: 34px; height: 48px; border-radius: 6px; }
.row.vrow .logo img { inset: 0; width: 100%; height: 100%; object-fit: cover; }
.row.vrow .fav { visibility: hidden; }
.row.vrow .num { font-size: 11px; }
.vdetail { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 14px 20px; }
.vd-back { height: 30px; padding: 0 12px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.vd-hero { position: relative; display: flex; justify-content: center; margin: 12px 0; padding: 14px; border-radius: 12px; background: #000 center / cover no-repeat; }
.vd-hero img { height: 220px; border-radius: 8px; box-shadow: 0 8px 30px rgba(0, 0, 0, .6); }
.vdetail h3 { font-size: 20px; line-height: 1.2; }
.vd-meta { margin-top: 6px; font-size: 13px; color: var(--accent); }
.vd-plot { margin-top: 10px; font-size: 14px; line-height: 1.5; color: #cfd3db; }
.vd-cast { margin-top: 8px; font-size: 12px; color: var(--muted); }
.vd-actions { margin-top: 14px; }
.vd-play { height: 40px; padding: 0 16px; margin: 0 8px 8px 0; border-radius: 10px; background: var(--accent); color: #141414; font-weight: 700; }
.vd-play.alt { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }
.vd-warn { font-size: 12px; color: var(--muted); }
.vd-seasons { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.vd-seasons button { height: 30px; padding: 0 12px; border-radius: 15px; background: var(--panel-2); border: 1px solid var(--line); font-size: 13px; }
.vd-seasons button.on { background: var(--accent); color: #141414; border-color: var(--accent); font-weight: 650; }
.vd-ep { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; margin-bottom: 6px; border-radius: 10px; background: var(--panel-2); text-align: left; }
.vd-ep:hover { box-shadow: inset 0 0 0 1px var(--accent); }
.vd-ep b { flex: none; width: 36px; font: 700 12px var(--mono); color: var(--muted); }
.vd-ep span { flex: 1; min-width: 0; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vd-ep i { font-style: normal; font: 600 11px var(--mono); color: var(--accent); }
.filters { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 12px; border-bottom: 1px solid var(--line); }
.search { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.search:focus-within { border-color: var(--accent); }
.search svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.search input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: none; font-size: 16px; }
.search input::-webkit-search-cancel-button { filter: invert(.6); }
.scopes { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.scopes button, .scopes select { height: 34px; padding: 0 12px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); font-size: 13.5px; white-space: nowrap; }
.scopes button.on { background: var(--accent); border-color: var(--accent); color: #141414; font-weight: 650; }
.scopes select { flex: 1 1 100%; width: 0; min-width: 0; appearance: none; padding-right: 28px; text-overflow: ellipsis;
  background: var(--panel-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238a909c' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 10px center / 11px; }
.scopes select.on { border-color: var(--accent); color: var(--accent); }
.count { font-size: 12px; color: var(--muted-2); }
.countbar { display: flex; align-items: center; gap: 8px; min-width: 0; }
.countbar .count { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid-btn { flex: none; display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); font-size: 12.5px; font-weight: 600; }
.grid-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.grid-btn:hover, .grid-btn.on { border-color: var(--accent); color: var(--accent); }
.guide[data-tab="movie"] .grid-btn, .guide[data-tab="series"] .grid-btn { display: none; }
.scopes button:hover:not(.on) { border-color: #353a47; }

.list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.spacer { position: relative; }
.row { position: absolute; top: 0; left: 0; right: 0; height: var(--row); display: flex; align-items: center; gap: 10px; padding: 0 4px 0 10px; border-bottom: 1px solid var(--line-soft); cursor: pointer; transition: background .12s; }
.row:hover { background: var(--panel-2); }
.row.playing { box-shadow: inset 3px 0 var(--accent); background: #1a1810; }
.num { flex: none; width: 40px; text-align: right; font: 12px var(--mono); color: var(--muted-2); }
.logo { flex: none; position: relative; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 9px; background: #1d2028; overflow: hidden; }
.logo b { font-size: 12px; font-weight: 700; color: var(--muted); }
.logo img { position: absolute; inset: 3px; width: calc(100% - 6px); height: calc(100% - 6px); object-fit: contain; }
.txt { flex: 1; min-width: 0; }
.t1, .t2 { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t1 { font-size: 14.5px; font-weight: 550; }
.t2 { font-size: 12px; color: var(--muted); }
.on-air { flex: none; font: 700 11px var(--mono); color: var(--accent); }
.qb { flex: none; padding: 1px 4px; border: 1px solid var(--line); border-radius: 4px; font: 600 10px/1.2 var(--mono); color: var(--muted); }
.qb:empty { display: none; }
.row.now .t2 { color: #b9bec9; }
.row.now .t2::before { content: '▸ '; color: var(--accent); }
.rp { position: absolute; left: 112px; right: 48px; bottom: -1px; height: 3px; width: 0; border-radius: 2px; background: var(--accent); opacity: .65; pointer-events: none; }
.fav { flex: none; width: 36px; height: 36px; font-size: 18px; color: var(--muted-2); }
.fav.is { color: var(--accent); }
.empty-list { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 14px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px; background: #262a35; box-shadow: 0 8px 30px rgba(0, 0, 0, .5); font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 10; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.act { pointer-events: auto; cursor: pointer; }
.toast b { margin-left: 14px; padding: 4px 12px; border-radius: 8px; background: var(--accent); color: #141414; }

/* centro deportivo */
.sports { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 12px 16px; }
.sp-chips { position: sticky; top: 0; z-index: 1; display: flex; gap: 6px; padding: 10px 0; background: var(--panel); overflow-x: auto; scrollbar-width: none; }
.sp-chips::-webkit-scrollbar { display: none; }
.sp-chip { flex: none; height: 30px; padding: 0 12px; border-radius: 15px; border: 1px solid var(--line); background: var(--panel-2); font-size: 13px; color: var(--muted); }
.sp-chip.on { color: #141414; background: var(--accent); border-color: var(--accent); font-weight: 650; }
.sports h4 { margin: 12px 2px 8px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); }
.game { padding: 10px 12px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); cursor: pointer; }
.game:hover { border-color: #3a3f4c; }
.game.in { border-left: 3px solid var(--live); }
.game.follow { box-shadow: inset 0 0 0 1px rgba(255, 176, 0, .45); }
.game.post { opacity: .6; }
.game.nochan { cursor: default; }
.g-top { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.g-tag { padding: 1px 5px; border-radius: 4px; background: #262a35; font: 700 10.5px/1.4 var(--mono); color: var(--text); }
.game.in .g-tag { background: var(--live); color: #fff; }
.g-lg { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-when { font: 600 12px var(--mono); color: var(--text); }
.game.in .g-when { color: var(--live); }
.g-bell { width: 28px; height: 24px; font-size: 14px; filter: grayscale(1); opacity: .6; }
.game.follow .g-bell { filter: none; opacity: 1; }
.g-team { display: flex; align-items: center; gap: 10px; margin-top: 7px; }
.g-logo { flex: none; width: 24px; height: 24px; display: grid; place-items: center; }
.g-logo img { max-width: 24px; max-height: 24px; }
.g-name { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-sc { font: 700 17px var(--mono); }
.g-ch { margin-top: 8px; font-size: 12.5px; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-ch i { font-style: normal; color: var(--muted-2); }
.g-no { color: var(--muted-2); }

/* marcador sobre la pantalla y festejo de gol */
.bug { position: absolute; right: 10px; top: 10px; display: flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 8px;
  background: rgba(8, 9, 12, .82); font: 600 13px var(--mono); pointer-events: none; }
.bug b { font-weight: 800; }
.bg-tag { padding: 1px 5px; border-radius: 4px; background: var(--live); color: #fff; font-size: 10.5px; }
.bg-time { color: var(--accent); }
.cheer { position: absolute; left: 0; right: 0; bottom: 0; display: none; align-items: center; gap: 14px; padding: 14px 16px;
  background: linear-gradient(0deg, rgba(0, 0, 0, .85), transparent); }
.cheer b { font-size: clamp(22px, 5cqw, 44px); font-weight: 900; color: var(--accent); letter-spacing: -.02em; animation: pop .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.cheer span { flex: 1; min-width: 0; font: 700 15px var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cheer button { flex: none; height: 32px; padding: 0 12px; border-radius: 8px; background: rgba(255, 255, 255, .14); font-size: 13px; font-weight: 600; }
.cheer button:hover { background: var(--accent); color: #141414; }
.slot.goal .cheer { display: flex; }
.tsbar { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: none; gap: 6px; padding: 5px; border-radius: 12px; background: rgba(8, 9, 12, .82); white-space: nowrap; }
.tsbar button { height: 32px; padding: 0 12px; border-radius: 8px; font: 600 13px var(--mono); color: var(--text); }
.tsbar button:hover { background: rgba(255, 255, 255, .12); }
.tsbar .ts-live { color: var(--live); }
.slot.shifted .ts-live { color: var(--accent); }
.slot:not(.empty) .screen:hover .tsbar, .slot.active.paused .tsbar, .slot.shifted .tsbar, .slot.paused .tsbar { display: flex; }
.slot.goal .tsbar, .slot.vod .tsbar { display: none !important; }
.tsbar { width: min(94%, 620px); }
.ts-line { flex: 1; position: relative; min-width: 60px; height: 32px; cursor: pointer; }
.ts-line::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 2px; background: rgba(255, 255, 255, .18); }
.ts-fill { position: absolute; left: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 2px; background: var(--accent); width: 0; }
.ts-pos { position: absolute; left: 100%; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px rgba(0, 0, 0, .45); pointer-events: none; }
.slot.paused .ts-pos { background: var(--accent); }
.ts-tick { position: absolute; top: 50%; width: 2px; height: 10px; margin: -5px 0 0 -1px; background: rgba(255, 255, 255, .6); }
.ts-tip { position: absolute; bottom: 100%; transform: translateX(-50%); margin-bottom: 4px; padding: 3px 7px; border-radius: 6px; background: #000; font: 600 11px var(--mono); white-space: nowrap; pointer-events: none; display: none; }
.ts-line:hover .ts-tip:not(:empty) { display: block; }
.ts-clip { font-size: 16px; }
.stage[data-n="2"] .tsbar { width: min(96%, 460px); }
.stage[data-n="3"] .slot:not(:first-child) .tsbar, .stage[data-n="4"] .tsbar { width: auto; }
.stage[data-n="3"] .slot:not(:first-child) .ts-line, .stage[data-n="3"] .slot:not(:first-child) .ts-clip,
.stage[data-n="4"] .ts-line, .stage[data-n="4"] .ts-clip { display: none; }
.slot.paused .still { filter: brightness(.6); }
.stage[data-n="3"] .slot:not(:first-child) .tsbar button, .stage[data-n="2"] .tsbar button, .stage[data-n="4"] .tsbar button { padding: 0 7px; font-size: 11.5px; height: 26px; }
.slot.goal { border-color: var(--accent); animation: flash 1.2s ease-out 3; }
.screen { container-type: inline-size; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
@keyframes flash { 0% { box-shadow: 0 0 0 3px var(--accent), 0 0 40px rgba(255, 176, 0, .7); } 100% { box-shadow: 0 0 0 1px var(--accent); } }

/* menú flotante (señales, clips, teclas) */
.menu { position: fixed; z-index: 20; min-width: 230px; max-width: 360px; max-height: 70vh; overflow-y: auto; padding: 6px; border-radius: 12px; background: #1c1f27; border: 1px solid var(--line); box-shadow: 0 12px 40px rgba(0, 0, 0, .6); }
.menu h5 { padding: 6px 10px 4px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); }
.menu button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px; border-radius: 8px; text-align: left; font-size: 13.5px; }
.menu button:hover { background: var(--panel-2); }
.menu button.on { color: var(--accent); }
.menu button span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu button i { flex: none; font: 600 10.5px var(--mono); font-style: normal; color: var(--muted); }

/* cinta de marcadores */
.ticker { position: absolute; left: 0; right: 0; bottom: 0; height: 30px; overflow: hidden; z-index: 2; background: rgba(8, 9, 12, .92); border-top: 1px solid var(--line); font: 600 13px var(--mono); }
.tk { position: absolute; left: 0; top: 0; height: 100%; display: flex; align-items: center; white-space: nowrap; animation: tk var(--tk, 40s) linear infinite; }
.ticker:hover .tk { animation-play-state: paused; }
.tk span { padding: 0 28px; cursor: pointer; }
.tk span:hover { color: var(--accent); }
.tk b { color: var(--accent); margin-right: 8px; }
.tk em { font-style: normal; color: var(--live); margin-left: 8px; }
.stage.has-ticker { padding-bottom: 44px; }
@keyframes tk { to { transform: translateX(-50%); } }

/* mando */
.mando { display: flex; flex-direction: column; gap: 14px; padding: 16px; overflow-y: auto; min-width: 0; }
.app.remote .stage, .app.remote .tabs { display: none; }
.md-head { font-size: 13px; color: var(--muted); }
.md-hint { font-size: 14px; line-height: 1.5; color: var(--text); }
.md-screens { display: grid; gap: 8px; }
.md-slot { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); text-align: left; }
.md-slot.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.md-slot b { flex: none; padding: 2px 6px; border: 1px solid var(--line); border-radius: 4px; font: 600 11px/1.2 var(--mono); color: var(--muted); }
.md-slot.on b { color: #141414; background: var(--accent); border-color: var(--accent); }
.md-slot span { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.md-slot i { font: 600 11px var(--mono); font-style: normal; color: var(--muted); }
.md-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.md-pad button { height: 56px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); font-size: 15px; font-weight: 600; }
.md-pad button:active { background: var(--accent); color: #141414; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes appear { from { opacity: 0; } }

/* pantalla vacía: "¿Qué vemos?" */
.home { position: absolute; inset: 0; display: none; overflow-y: auto; padding: clamp(10px, 3cqw, 28px); cursor: default;
  background: radial-gradient(ellipse at 15% 0%, #1c202b, #07080b 70%); scrollbar-width: thin; }
.slot.empty.has-home .home { display: block; }
.slot.empty.has-home .idle { display: none; }
.h-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: clamp(8px, 2cqw, 18px); }
.h-head b { font-size: clamp(16px, 3.2cqw, 30px); font-weight: 800; letter-spacing: -.02em; }
.h-head span { font-size: 12px; color: var(--muted); }
.h-sec { margin-bottom: clamp(10px, 2.4cqw, 22px); animation: appear .3s both; }
.h-sec h5 { margin-bottom: 8px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); }
.h-live h5 { color: var(--live); }
.h-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.hc { position: relative; display: flex; align-items: center; gap: 10px; min-width: 0; height: 58px; padding: 0 12px 0 8px; border-radius: 12px; overflow: hidden; text-align: left;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .07); transition: background .15s, border-color .15s, transform .15s; }
.hc:hover { background: rgba(255, 176, 0, .08); border-color: rgba(255, 176, 0, .55); transform: translateY(-1px); }
.hc-logo { flex: none; position: relative; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 9px; background: #1d2028; overflow: hidden; }
.hc-logo b { font-size: 12px; font-weight: 700; color: var(--muted); }
.hc-logo img { position: absolute; inset: 3px; width: calc(100% - 6px); height: calc(100% - 6px); object-fit: contain; }
.hc-logo img ~ b { display: none; }
.hc-t { flex: 1; min-width: 0; }
.hc-t b, .hc-t i { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hc-t b { font-size: 13.5px; font-weight: 650; }
.hc-t i { margin-top: 2px; font-style: normal; font-size: 12px; color: var(--muted); }
.hc u { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .06); }
.hc u em { display: block; height: 100%; background: var(--accent); }
.hc-tag { flex: none; padding: 3px 6px; border-radius: 6px; background: var(--live); color: #fff; font: 700 11px var(--mono); }
.hg .hc-t b em { font-style: normal; font-family: var(--mono); color: var(--accent); }
@container (max-width: 440px) {
  .h-fav, .h-head span { display: none; }
  .h-row { grid-template-columns: 1fr 1fr; gap: 6px; }
  .hc { height: 46px; gap: 7px; padding: 0 8px 0 6px; }
  .hc .hc-logo { width: 30px; height: 30px; }
  .hc-t b { font-size: 12px; }
  .hc-t i { font-size: 11px; }
}

/* ficha del canal al pasar el mouse */
.peek { position: fixed; z-index: 15; width: 340px; padding: 14px; border-radius: 16px; background: rgba(24, 27, 34, .97); border: 1px solid #2c303b;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .6); backdrop-filter: blur(8px); animation: peekin .16s ease-out; }
@keyframes peekin { from { opacity: 0; transform: translateX(8px); } }
.pk-head { display: flex; align-items: center; gap: 10px; }
.pk-head .hc-logo { width: 48px; height: 48px; }
.pk-id { flex: 1; min-width: 0; }
.pk-id b, .pk-id i { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk-id b { font-size: 16px; }
.pk-id i { font-style: normal; font-size: 12px; color: var(--muted); }
.pk-on { flex: none; padding: 3px 7px; border-radius: 6px; background: var(--accent); color: #141414; font: 700 11px var(--mono); }
.pk-now { margin-top: 12px; }
.pk-live { display: inline-block; margin-bottom: 5px; padding: 1px 6px; border-radius: 4px; background: var(--live); color: #fff; font: 700 10px var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.pk-now > b { display: block; font-size: 17px; line-height: 1.25; }
.pk-time { margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.pk-bar { height: 4px; margin-top: 8px; border-radius: 2px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.pk-bar i { display: block; height: 100%; background: var(--accent); }
.pk-desc { margin-top: 10px; font-size: 13px; line-height: 1.45; color: #b9bec9; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.pk-none { font-size: 13px; color: var(--muted); }
.pk-next { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.pk-next h5 { margin-bottom: 6px; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); }
.pk-next div { display: flex; gap: 10px; padding: 2px 0; font-size: 13px; }
.pk-next div b { flex: none; width: 44px; font: 600 12px var(--mono); color: var(--accent); }
.pk-next div span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #cfd3db; }
.pk-acts { display: flex; gap: 6px; margin-top: 14px; }
.pk-acts button { height: 36px; padding: 0 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); font-size: 13px; font-weight: 600; white-space: nowrap; }
.pk-acts button:hover:not(:disabled) { border-color: var(--accent); }
.pk-acts button:disabled { opacity: .4; cursor: default; }
.pk-acts .pk-main { flex: 1; background: var(--accent); border-color: var(--accent); color: #141414; }
.pk-acts .pk-fav { width: 36px; padding: 0; font-size: 16px; color: var(--muted-2); }
.pk-acts .pk-fav.is { color: var(--accent); }
.sk { display: block; height: 14px; margin: 6px 0; border-radius: 6px; background: linear-gradient(90deg, #1d2028 25%, #2a2e38 50%, #1d2028 75%); background-size: 200% 100%; animation: sk 1.2s linear infinite; }
.sk.short { width: 60%; }
@keyframes sk { to { background-position: -200% 0; } }

/* guía en cuadrícula */
.epg { grid-column: 1; grid-row: 2; z-index: 5; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); animation: appear .15s; }
.epg-top { flex: none; display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 10px 0 18px; border-bottom: 1px solid var(--line); }
.epg-ttl { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; white-space: nowrap; overflow: hidden; }
.epg-ttl b { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 18px; font-weight: 750; }
.epg-ttl span { font-size: 12.5px; color: var(--muted); }
.epg-now { height: 32px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); font-size: 13px; font-weight: 600; }
.epg-now:hover { border-color: var(--accent); color: var(--accent); }
.epg-body { position: relative; flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.epg-head { position: sticky; top: 0; z-index: 4; height: 38px; background: #0d0f13; border-bottom: 1px solid var(--line); }
.eh-corner { position: sticky; left: 0; z-index: 2; height: 100%; display: flex; align-items: center; padding: 0 14px; background: #0d0f13; border-right: 1px solid var(--line); font-size: 12px; color: var(--muted); white-space: nowrap; }
.eh-t { position: absolute; top: 0; height: 100%; display: flex; align-items: center; padding-left: 8px; border-left: 1px solid var(--line); font: 600 12px var(--mono); color: var(--muted); }
.eh-now { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--live); }
.epg-rows { position: relative; }
.er { position: absolute; left: 0; right: 0; height: 62px; border-bottom: 1px solid var(--line-soft); }
.ec { position: sticky; left: 0; z-index: 2; height: 100%; display: flex; align-items: center; gap: 10px; padding: 0 12px 0 6px; background: var(--panel); border-right: 1px solid var(--line); text-align: left; }
.ec:hover { background: var(--panel-2); }
.er.on .ec { box-shadow: inset 3px 0 var(--accent); }
.ec-n { flex: none; width: 34px; text-align: right; font: 11px var(--mono); color: var(--muted-2); }
.ec .hc-logo { width: 38px; height: 38px; }
.ec-t { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ec em { flex: none; font: 700 11px var(--mono); font-style: normal; color: var(--accent); }
.ep { position: absolute; top: 5px; bottom: 5px; display: flex; flex-direction: column; justify-content: center; padding: 0 10px; border-radius: 9px; overflow: hidden; text-align: left;
  background: var(--panel-2); border: 1px solid var(--line); transition: border-color .12s, background .12s; }
.ep:hover { border-color: var(--accent); background: #22252e; }
.ep b, .ep i { position: relative; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep b { font-size: 13px; font-weight: 600; }
.ep i { font-style: normal; font-size: 11.5px; color: var(--muted); }
.ep.past { opacity: .45; }
.ep.live { background: #221d10; border-color: rgba(255, 176, 0, .45); }
.ep.live i { color: var(--accent); }
.ep u { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255, 176, 0, .13); }
.ep.none { right: 6px; background: none; border-style: dashed; cursor: default; }
.ep.none:hover { border-color: var(--line); background: none; }
.ep.none .sk { width: 40%; }
.er-now { position: absolute; top: 0; bottom: 0; z-index: 1; width: 2px; margin-left: -1px; background: var(--live); box-shadow: 0 0 10px rgba(255, 59, 48, .5); pointer-events: none; }
.epg-empty { padding: 40px; text-align: center; color: var(--muted); }

/* celular */
@media (max-width: 820px) {
  :root { --L: 32px; --gap: 6px; }
  .app { display: flex; flex-direction: column; }
  .bar { flex: none; height: 50px; gap: 8px; padding: 0 10px; }
  .brand { font-size: 18px; }
  .layouts button { width: 34px; }
  .meter { padding: 0 8px; }
  #b-out, #b-stats, #b-ticker, #b-full { display: none; }
  .brand > span { display: none; }
  .bar { overflow-x: auto; scrollbar-width: none; }
  .bar::-webkit-scrollbar { display: none; }
  .epg { position: fixed; inset: 0; z-index: 30; }
  .peek { display: none !important; }
  .ec { gap: 6px; padding: 0 8px 0 4px; }
  .ec-n { display: none; }
  .ec .hc-logo { width: 30px; height: 30px; }
  .mando { flex: none; padding: 12px; gap: 10px; }
  .stage { flex: none; container-type: inline-size; padding: 8px; }
  .wall, .stage[data-n] .wall { width: 100%; }
  .stage[data-n="3"] .wall { grid-template-columns: 1fr 1fr; }
  .stage[data-n="3"] .slot:first-child { grid-row: auto; grid-column: span 2; }
  .stage[data-n="3"] .slot:first-child .screen { flex: none; aspect-ratio: 16 / 9; }
  .stage[data-n="2"] .cn, .stage[data-n="3"] .slot:not(:first-child) .cn { max-width: 100%; flex: 1; }
  .stage[data-n="2"] .now, .stage[data-n="3"] .slot:not(:first-child) .now,
  .stage[data-n="2"] .q, .stage[data-n="3"] .slot:not(:first-child) .q { display: none; }
  .stage[data-n="2"] .stats, .stage[data-n="3"] .slot:not(:first-child) .stats { font-size: 9.5px; padding: 4px 6px; left: 4px; top: 4px; }
  .stage[data-n="2"] .label button:not(.b-close), .stage[data-n="3"] .slot:not(:first-child) .label button:not(.b-close) { display: none; }
  .guide { flex: 1; border-left: 0; border-top: 1px solid var(--line); }
  .stage[data-n="2"] .bug, .stage[data-n="3"] .slot:not(:first-child) .bug { font-size: 10px; padding: 3px 6px; gap: 5px; right: 4px; top: 4px; }
  .stage[data-n="2"] .cheer button, .stage[data-n="3"] .slot:not(:first-child) .cheer button { display: none; }
  .scopes button { padding: 0 10px; }
  .filters { padding: 8px 10px; gap: 7px; }
  .stage[data-n="1"] .wall { width: min(100%, calc((26dvh - var(--L)) * 1.7778)); }
  .scopes { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .scopes::-webkit-scrollbar { display: none; }
  .search { height: 38px; }
}
