:root {
  --bg: #0f1115; --bg2: #171a21; --bg3: #20242d; --line: #2a2f3a;
  --fg: #e8eaed; --muted: #9aa1ad; --accent: #ff7a45; --accent2: #ffa36e; --ok: #4cc38a; --err: #ff6b6b;
  --radius: 10px; --top: 60px; --mbar: 0px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body.has-mbar { --mbar: 76px; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--err); min-height: 1.2em; margin: 0; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(circle at 30% 20%, #2a1b14 0, var(--bg) 60%); }
.login-card { width: min(360px, 100%); display: grid; gap: 12px; background: var(--bg2); padding: 28px;
  border-radius: 16px; border: 1px solid var(--line); }
.login-card input, .field { background: var(--bg3); border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; outline: none; }
.login-card input:focus, .field:focus { border-color: var(--accent); }

/* ---------- top bar ---------- */
.top { position: sticky; top: 0; z-index: 20; height: var(--top); display: flex; align-items: center; gap: 22px;
  padding: 0 24px; background: rgba(15,17,21,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 18px; letter-spacing: .2px; }
.brand.big { font-size: 26px; justify-content: center; }
.logo { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent);
  color: var(--bg); font-size: 13px; padding-left: 2px; }
.nav { display: flex; gap: 4px; }
.nav a { padding: 7px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; }
.nav a:hover { color: var(--fg); background: var(--bg3); }
.nav a.on { color: var(--fg); background: var(--bg3); }
.search { margin-left: auto; }
.search input { width: 260px; background: var(--bg3); border: 1px solid var(--line); border-radius: 20px; padding: 7px 14px; outline: none; }
.search input:focus { border-color: var(--accent); }
.user { position: relative; }
.menu { position: absolute; right: 0; top: 44px; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px;
  min-width: 200px; padding: 6px; display: grid; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.menu a, .menu button { text-align: left; padding: 9px 10px; border-radius: 6px; background: none; border: 0; cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--bg3); }
.menu-head { padding: 8px 10px; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.tabbar { display: none; }

/* ---------- barra lateral ---------- */
:root { --side: 236px; }
.side { position: fixed; left: 0; top: 0; bottom: var(--mbar); width: var(--side); z-index: 30; background: var(--bg2);
  border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 14px 10px; overflow-y: auto; }
.side .brand { padding: 4px 10px 14px; }
.side-nav { display: grid; gap: 2px; flex: 1; align-content: start; }
.side-nav a, .side-foot a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--muted); font-weight: 500; }
.side-nav a:hover, .side-foot a:hover { background: var(--bg3); color: var(--fg); }
.side-nav a.on, .side-foot a.on { background: var(--bg3); color: var(--fg); box-shadow: inset 3px 0 0 var(--accent); }
.side-nav .ico { width: 20px; text-align: center; }
.side-nav .cnt { margin-left: auto; font-size: 12px; color: var(--muted); background: var(--bg); padding: 1px 7px; border-radius: 10px; font-variant-numeric: tabular-nums; }
.side-nav .sub { display: grid; gap: 1px; margin: 0 0 6px 30px; }
.side-nav .sub a { padding: 5px 10px; font-size: 13.5px; }
.side-nav .sub a .cnt { background: none; padding: 0; }
.side-nav .more-toggle { font-size: 12.5px; color: var(--muted); cursor: pointer; padding: 4px 10px; background: none; border: 0; text-align: left; }
.side-nav .sec { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 14px 10px 4px; opacity: .8; }
.side-foot { border-top: 1px solid var(--line); padding-top: 8px; display: grid; gap: 2px; }
.side-back { display: none; }
.menu-btn { display: none; }
.top { margin-left: var(--side); }
.top .search { margin-left: 0; flex: 1; max-width: 560px; }
.top .search input { width: 100%; }
.user { margin-left: auto; }

main { padding: 20px 24px calc(40px + var(--mbar)); max-width: 1800px; margin: 0 0 0 var(--side); }

/* ---------- inicio: estadísticas ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 6px 0 8px; }
.stat { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 16px; cursor: pointer; transition: border-color .15s; }
.stat:hover { border-color: var(--accent); }
.stat .k { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; font-size: 14px; }
.stat .v { font-size: 34px; font-weight: 800; line-height: 1.1; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.stat .d { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.bars { display: grid; gap: 6px; }
.bars a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; font-size: 13px; }
.bars a span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bars a span:nth-child(2) { color: var(--muted); font-variant-numeric: tabular-nums; }
.bars a i { grid-column: 1 / -1; height: 5px; border-radius: 3px; background: var(--bg3); overflow: hidden; }
.bars a i b { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.bars a:hover span:first-child { color: var(--accent); }
.home-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 14px 0 0; }
.sec-ctl { display: inline-flex; gap: 4px; margin-left: auto; }
.sec-ctl button { background: var(--bg3); border: 1px solid var(--line); border-radius: 6px; width: 30px; height: 28px; cursor: pointer; }
.sec-ctl button:disabled { opacity: .35; cursor: default; }
.home-group.off { opacity: .45; }
.home-group h2.group-title { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); border-top: 1px solid var(--line);
  padding-top: 18px; margin-top: 28px; }

/* ---------- TV en vivo ---------- */
.live-layout { display: grid; grid-template-columns: 240px 1fr; gap: 18px; align-items: start; }
.live-groups { position: sticky; top: calc(var(--top) + 12px); max-height: calc(100vh - var(--top) - var(--mbar) - 40px); overflow: auto;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 6px; }
.live-groups a { display: flex; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: 6px; font-size: 14px; color: var(--muted); }
.live-groups a:hover { background: var(--bg3); color: var(--fg); }
.live-groups a.on { background: var(--accent); color: #1a0f0a; font-weight: 600; }
.chans { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.chan { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 10px; background: var(--bg2);
  border: 1px solid var(--line); border-radius: 10px; cursor: pointer; min-width: 0; }
.chan:hover { border-color: var(--accent); }
.chan .lg { width: 64px; height: 40px; border-radius: 6px; background: #fff1; display: grid; place-items: center; overflow: hidden; font-weight: 800; color: var(--muted); }
.chan .lg img { max-width: 100%; max-height: 100%; object-fit: contain; }
.chan .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chan .np { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chan .np i { display: block; height: 3px; background: var(--bg3); border-radius: 2px; margin-top: 4px; overflow: hidden; }
.chan .np i b { display: block; height: 100%; background: var(--accent); }
.chan .fav { background: none; border: 0; font-size: 18px; cursor: pointer; color: var(--muted); }
.chan .fav.on { color: #ffcf40; }
.live-badge { background: #e5383b; color: #fff; font-weight: 800; font-size: 11px; padding: 2px 7px; border-radius: 4px; letter-spacing: .05em; }
.player.is-live .p-seek input { visibility: hidden; }
.player.is-live #pDur { display: none; }
/* login: elementos de la ventana retro (ocultos fuera del tema retro) */
.win-title, .lcd-box { display: none; }
.credit { text-align: center; color: var(--muted); font-size: 13px; margin: 4px 0 0; }

/* usuarios y actividad */
.login-card textarea { background: var(--bg3); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; color: var(--fg); font: inherit; resize: vertical; }
.small { font-size: 12.5px; } .nowrap { white-space: nowrap; }
.pending-box { border: 1px solid var(--accent); background: rgba(255,122,69,.08); border-radius: 10px; padding: 12px; margin-bottom: 14px; display: grid; gap: 10px; }
.pend { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid var(--line); }
.pend .note { font-style: italic; margin-top: 4px; }
.acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.table-wrap { overflow-x: auto; }
.utable { width: 100%; border-collapse: collapse; font-size: 14px; }
.utable th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12.5px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.utable td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.utable.act td:nth-child(4) { word-break: break-word; }
.act-login_fail td, .act-blocked td { color: var(--err); }
.online-dot { color: var(--ok); font-size: 12px; }
.pend-badge { background: var(--accent) !important; color: #1a0f0a !important; font-weight: 700; }
.stat.alert { border-color: var(--err); }
.stat .list > div { padding: 5px 8px; gap: 10px; }
details summary { cursor: pointer; margin: 10px 0 4px; }

/* separación equipo / IPTV */
.home-sec { margin-top: 10px; }
.home-sec + .home-sec { margin-top: 34px; }
h2.sec-head { font-size: 22px; margin: 18px 0 10px; padding-bottom: 8px; border-bottom: 2px solid var(--line); }
.src-tag { position: absolute; top: 6px; left: 6px; z-index: 2; font-size: 10px; font-weight: 800; letter-spacing: .05em; padding: 2px 6px;
  border-radius: 4px; background: #2563ebdd; color: #fff; }
.src-tag.inline { position: static; display: inline-block; }
.plot { max-width: 760px; color: var(--fg); opacity: .9; line-height: 1.55; }
.ep-plot { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.src-list > div { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 10px 12px; background: var(--bg3); border-radius: 8px; margin-bottom: 6px; }
.tabs-mini { display: flex; gap: 6px; margin: 10px 0; }

/* ---------- botones ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg3); cursor: pointer; font-weight: 600; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #1a0f0a; }
.btn.primary:hover { background: var(--accent2); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.icon-btn { background: none; border: 0; cursor: pointer; font-size: 18px; width: 38px; height: 38px; border-radius: 50%;
  display: inline-grid; place-items: center; color: var(--fg); }
.icon-btn:hover { background: rgba(255,255,255,.1); }
.icon-btn.big { font-size: 24px; width: 50px; height: 50px; }
.icon-btn.huge { font-size: 34px; width: 76px; height: 76px; background: rgba(0,0,0,.35); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 18px; }
.chip { padding: 6px 13px; border-radius: 18px; background: var(--bg3); border: 1px solid var(--line); cursor: pointer; font-size: 14px; white-space: nowrap; }
.chip.on { background: var(--accent); color: #1a0f0a; border-color: var(--accent); font-weight: 600; }
.chip small { opacity: .7; margin-left: 4px; }

/* ---------- secciones y grillas ---------- */
h1 { font-size: 26px; margin: 4px 0 14px; }
h2 { font-size: 19px; margin: 26px 0 12px; display: flex; align-items: center; gap: 10px; }
h2 a.more { font-size: 13px; color: var(--muted); font-weight: 500; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.toolbar select { background: var(--bg3); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px 14px; }
.grid.wide { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.row { display: grid; grid-auto-flow: column; grid-auto-columns: 150px; gap: 14px; overflow-x: auto; padding-bottom: 8px;
  scroll-snap-type: x proximity; scrollbar-width: thin; }
.row.wide { grid-auto-columns: 260px; }
.row > * { scroll-snap-align: start; }
.card { cursor: pointer; min-width: 0; }
.card .art { position: relative; aspect-ratio: 2/3; border-radius: var(--radius); overflow: hidden; background: var(--bg3);
  border: 1px solid var(--line); transition: transform .15s, border-color .15s; }
.card.sq .art { aspect-ratio: 1; }
.card.wide .art { aspect-ratio: 16/9; }
.card:hover .art { transform: translateY(-3px); border-color: var(--accent); }
.art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.art .ph { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 10px; font-weight: 700;
  font-size: 15px; color: var(--muted); background: linear-gradient(135deg, #252a35, #191c23); }
.art .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(0,0,0,.6); }
.art .bar i { display: block; height: 100%; background: var(--accent); }
.art .tick { position: absolute; top: 6px; right: 6px; background: var(--ok); color: #062; width: 22px; height: 22px;
  border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.art .play-ov { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.35); opacity: 0;
  transition: opacity .15s; font-size: 34px; }
.card:hover .play-ov { opacity: 1; }
.card .t { margin-top: 7px; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .s { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- detalle ---------- */
.hero { position: relative; display: grid; grid-template-columns: 240px 1fr; gap: 28px; padding: 20px 0 10px; }
.hero .poster { aspect-ratio: 2/3; border-radius: 12px; overflow: hidden; background: var(--bg3); border: 1px solid var(--line); position: relative; }
.hero .poster img { width: 100%; height: 100%; object-fit: cover; }
.poster .art { aspect-ratio: auto; height: 100%; border: 0; border-radius: 0; }
.hero.sq { grid-template-columns: 220px 1fr; } .hero.sq .poster { aspect-ratio: 1; }
.hero h1 { font-size: 34px; margin: 6px 0; }
.meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); margin-bottom: 16px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0; }
.tech { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 14px; color: var(--muted); margin-top: 18px; }
.tech b { color: var(--fg); font-weight: 500; }
.backdrop { position: fixed; inset: 0; z-index: -1; background-size: cover; background-position: center; filter: blur(40px) brightness(.25); transform: scale(1.2); }

.eps { display: grid; gap: 8px; }
.ep { display: grid; grid-template-columns: 200px 1fr auto; gap: 16px; align-items: center; padding: 8px; border-radius: 10px; cursor: pointer; }
.ep:hover { background: var(--bg2); }
.ep .art { aspect-ratio: 16/9; border-radius: 8px; }
.ep .num { color: var(--muted); font-size: 13px; }
.ep .tt { font-weight: 600; }
.season-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin: 14px 0; }

.tracks { width: 100%; border-collapse: collapse; }
.tracks td { padding: 9px 8px; border-bottom: 1px solid var(--line); }
.tracks tr { cursor: pointer; }
.tracks tr:hover td { background: var(--bg2); }
.tracks tr.on td { color: var(--accent); }
.tracks .n { width: 40px; color: var(--muted); text-align: right; }
.tracks .d { width: 70px; color: var(--muted); text-align: right; }
.tracks .ar { color: var(--muted); }

.panel { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 18px; }
.panel h3 { margin: 0 0 12px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; }
.kv code, code { background: var(--bg3); padding: 2px 7px; border-radius: 5px; font-size: 14px; user-select: all; }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.list { display: grid; gap: 6px; }
.list > div { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; background: var(--bg3); border-radius: 8px; }
.ok { color: var(--ok); } .warn { color: var(--accent2); }
.empty { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- reproductor ---------- */
.player { position: fixed; inset: 0; z-index: 100; background: #000; }
.player video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.subtext { position: absolute; left: 5%; right: 5%; bottom: 12%; text-align: center; pointer-events: none; font-size: clamp(18px, 2.6vw, 34px);
  font-weight: 600; line-height: 1.3; text-shadow: 0 0 4px #000, 0 2px 3px #000, 0 0 10px #000; transition: bottom .2s; white-space: pre-line; }
.player.ui .subtext { bottom: 22%; }
.p-ui { position: absolute; inset: 0; display: grid; grid-template-rows: auto 1fr auto; opacity: 0; transition: opacity .25s;
  background: linear-gradient(rgba(0,0,0,.7), transparent 22%, transparent 70%, rgba(0,0,0,.85)); }
.player.ui .p-ui { opacity: 1; }
.player:not(.ui) { cursor: none; }
.p-top { display: flex; align-items: center; gap: 14px; padding: 16px 20px; }
.p-title { flex: 1; min-width: 0; } .p-title > div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#pTitle { font-size: 19px; font-weight: 700; }
.badge { font-size: 12px; padding: 3px 9px; border-radius: 12px; background: rgba(255,255,255,.12); color: var(--muted); white-space: nowrap; }
.p-center { display: flex; align-items: center; justify-content: center; gap: 40px; }
.p-bottom { padding: 10px 22px 22px; }
.p-seek { display: flex; align-items: center; gap: 12px; font-variant-numeric: tabular-nums; font-size: 14px; }
.p-seek input, .m-seek input { flex: 1; }
input[type=range] { accent-color: var(--accent); cursor: pointer; }
.p-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.p-opts { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.p-opts select { background: rgba(30,30,30,.9); border: 1px solid #444; border-radius: 6px; padding: 4px 6px; color: var(--fg); max-width: 200px; margin-left: 4px; }
#pVol { width: 100px; }
.spinner { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px; border: 4px solid rgba(255,255,255,.2);
  border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; pointer-events: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.next-card { position: absolute; right: 24px; bottom: 120px; background: rgba(20,20,20,.95); border: 1px solid #333; border-radius: 12px;
  padding: 16px; width: 300px; z-index: 3; }
.next-card .actions { margin: 10px 0 0; }

/* ---------- barra de música ---------- */
.mbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; height: 76px; display: grid;
  grid-template-columns: 56px minmax(120px, 260px) auto 1fr auto; align-items: center; gap: 14px; padding: 0 18px;
  background: rgba(23,26,33,.97); border-top: 1px solid var(--line); backdrop-filter: blur(10px); }
.mbar img { width: 56px; height: 56px; border-radius: 6px; object-fit: cover; background: var(--bg3); }
.m-info { min-width: 0; } .m-info > div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
#mTitle { font-weight: 600; }
.m-ctl { display: flex; align-items: center; }
.m-seek { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.m-extra { display: flex; align-items: center; gap: 4px; } #mVol { width: 90px; }
#mShuffle.on { color: var(--accent); background: rgba(255,122,69,.15); }
.queue { position: fixed; right: 12px; bottom: 86px; z-index: 51; width: min(380px, calc(100vw - 24px)); max-height: 60vh; overflow: auto;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.6); }
.queue div { padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue div:hover { background: var(--bg3); } .queue div.on { color: var(--accent); }

.modal { position: fixed; inset: 0; z-index: 150; background: rgba(0,0,0,.7); display: grid; place-items: center; padding: 16px; }
.modal-card { width: min(980px, 100%); max-height: 90vh; overflow: auto; background: var(--bg2); border: 1px solid var(--line);
  border-radius: 14px; padding: 18px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { margin: 0; }
.lib-group { border-top: 1px solid var(--line); padding: 12px 0; display: grid; gap: 8px; }
.lib-head { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.lib-row { display: flex; gap: 8px; align-items: center; }
.lib-row .field { flex: 1; min-width: 0; }
.lib-group > .btn { justify-self: start; }
.lib-empty { font-size: 14px; }
.fp { width: min(560px, 100%); }
.fp-path { margin: 12px 0 8px; padding: 8px 10px; background: var(--bg3); border-radius: 8px; font-family: ui-monospace, Consolas, monospace; font-size: 14px; word-break: break-all; }
.fp-list { max-height: 50vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.fp-list > div { padding: 9px 12px; cursor: pointer; border-bottom: 1px solid var(--line); }
.fp-list > div:hover { background: var(--bg3); }
.ap-grid { margin-top: 10px; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.toast { position: fixed; left: 50%; bottom: calc(24px + var(--mbar)); transform: translateX(-50%); z-index: 200; background: var(--bg3);
  border: 1px solid var(--line); padding: 10px 18px; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.5); }

/* ---------- móvil ---------- */
@media (max-width: 820px) {
  :root { --top: 54px; }
  body { --tab: 58px; }
  body.has-mbar { --mbar: 64px; }
  .top { padding: 0 12px; gap: 8px; margin-left: 0; }
  .menu-btn { display: inline-grid; }
  .top .search { max-width: none; }
  .side { transform: translateX(-100%); transition: transform .2s; bottom: 0; z-index: 60; width: min(280px, 85vw); }
  body.side-open .side { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.6); }
  body.side-open .side-back { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.5); }
  main { margin-left: 0; }
  .live-layout { grid-template-columns: 1fr; }
  .live-groups { position: static; max-height: none; display: flex; overflow-x: auto; padding: 4px; gap: 4px; }
  .live-groups a { white-space: nowrap; }
  .stat .v { font-size: 28px; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: calc(58px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom); background: rgba(15,17,21,.97); border-top: 1px solid var(--line); }
  .tabbar a { flex: 1; display: grid; place-items: center; align-content: center; font-size: 11px; color: var(--muted); gap: 1px; }
  .tabbar a span { font-size: 19px; line-height: 1; }
  .tabbar a.on { color: var(--accent); }
  main { padding: 14px 16px calc(80px + var(--mbar)); }
  .grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 14px 10px; }
  .grid.wide { grid-template-columns: 1fr 1fr; }
  .row { grid-auto-columns: 112px; gap: 10px; } .row.wide { grid-auto-columns: 220px; }
  .hero, .hero.sq { grid-template-columns: 120px 1fr; gap: 16px; }
  .hero h1 { font-size: 22px; }
  .ep { grid-template-columns: 130px 1fr; gap: 10px; } .ep > :last-child { display: none; }
  .mbar { bottom: calc(58px + env(safe-area-inset-bottom)); height: 64px; grid-template-columns: 46px 1fr auto; gap: 10px; padding: 0 10px; }
  .mbar img { width: 46px; height: 46px; }
  .m-seek, .m-extra input, #mQueueBtn { display: none; }
  .m-extra { display: flex; } #mShuffle { display: none; }
  .mbar .m-extra { position: absolute; top: -1px; right: 0; height: 0; overflow: visible; }
  #mClose { position: absolute; right: 4px; top: -40px; width: 30px; height: 30px; font-size: 14px; background: var(--bg2); }
  .queue { bottom: calc(130px + env(safe-area-inset-bottom)); }
  .p-center { gap: 24px; } .icon-btn.huge { width: 64px; height: 64px; font-size: 28px; }
  .p-opts select { max-width: 120px; } #pVol { display: none; }
  .toast { bottom: calc(80px + var(--mbar)); }
}
