/* ================================================================
   CONECTA TV — Web Player · Design System
   Espelha o APK Android TV (OwnTVShell / Sidebar / TopBar)
   Accent: LARANJA/âmbar  ·  Fundo: near-black navy
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; user-select: none; -webkit-user-select: none; }

:root {
  --bg:            #0a0e14;   /* fundo geral (near-black azulado) */
  --panel:         #0f1520;   /* painéis */
  --panel-2:       #0c121c;   /* painéis mais escuros */
  --card:          #161e2b;   /* cards / linhas */
  --card-hi:       #1c2637;   /* card hover/focus */
  --input:         #1e2c45;   /* inputs preenchidos (azul-marinho) */
  --border:        rgba(255,255,255,0.07);
  --border-hi:     rgba(255,255,255,0.14);

  --accent:        #F5A623;   /* laranja/âmbar (accent do APK) */
  --accent-2:      #FFB93E;
  --accent-dim:    rgba(245,166,35,0.16);
  --accent-line:   rgba(245,166,35,0.45);
  --accent-ink:    #10161f;   /* texto sobre laranja */

  --text:          #f5f7fa;
  --text-dim:      #8a97a8;
  --text-mut:      #5f6b7c;
  --red:           #DC2626;

  --focus:         0 0 0 2px var(--accent), 0 0 18px rgba(245,166,35,0.4);
  --sb-w:          78px;
  --radius:        16px;
}

html, body { width:100vw; height:100vh; overflow:hidden; background:var(--bg); color:var(--text);
  font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; }

::-webkit-scrollbar { width:6px; height:6px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:rgba(255,255,255,0.12); border-radius:6px; }
::-webkit-scrollbar-thumb:hover { background:var(--accent); }

.sb-ic { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.sb-ic.sm { width:16px; height:16px; }
.tb-ic { width:15px; height:15px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }

/* ================================================================
   APP SHELL
   ================================================================ */
.app-shell { display:flex; width:100vw; height:100vh; overflow:hidden; }

/* ── SIDEBAR (rail estreito só ícones) ── */
.sidebar {
  width: var(--sb-w); min-width: var(--sb-w);
  background: var(--panel-2);
  border-right: 1px solid var(--border);
  display:flex; flex-direction:column; align-items:center;
  padding: 14px 0 16px; gap:10px; flex-shrink:0; z-index:30;
}
.sb-logo { width:46px; height:46px; border-radius:14px; overflow:hidden; border:1px solid var(--border-hi);
  background: rgba(255,255,255,0.03); display:flex; align-items:center; justify-content:center; margin-bottom:8px; }
.sb-logo img { width:100%; height:100%; object-fit:contain; padding:5px; }

.sb-items { flex:1; display:flex; flex-direction:column; gap:8px; align-items:center; }
.sb-foot { display:flex; flex-direction:column; gap:12px; align-items:center; }

.sb-item {
  width:46px; height:46px; border-radius:14px;
  display:flex; align-items:center; justify-content:center;
  background:transparent; border:1px solid transparent; color:var(--text-dim);
  cursor:pointer; outline:none; transition:all .15s ease;
}
.sb-item:hover:not(.active) { background:var(--card); color:var(--text); }
.sb-item:focus { box-shadow:var(--focus); color:var(--text); background:var(--card-hi); }
.sb-item.active { background:var(--accent); color:var(--accent-ink); border-color:var(--accent); }
.sb-item.active .sb-ic { stroke-width:2.2; }

.sb-fab {
  width:52px; height:52px; border-radius:16px; border:none; cursor:pointer; outline:none;
  background: linear-gradient(145deg, var(--accent-2), var(--accent));
  color:var(--accent-ink); display:flex; align-items:center; justify-content:center;
  box-shadow: 0 6px 18px rgba(245,166,35,0.4); transition:all .15s ease;
}
.sb-fab:hover, .sb-fab:focus { transform:scale(1.06); box-shadow:0 8px 26px rgba(245,166,35,0.55); }
.sb-ic-fab { width:24px; height:24px; fill:currentColor; }

/* ── MAIN ── */
.main { flex:1; display:flex; flex-direction:column; overflow:hidden; min-width:0; }

/* TOPBAR */
.topbar { height:64px; min-height:64px; display:flex; align-items:center; justify-content:space-between;
  padding:0 18px; gap:12px; flex-shrink:0; }
.tb-left, .tb-right { display:flex; align-items:center; gap:10px; min-width:0; }
.tb-left { overflow:hidden; }

.tb-pill { display:inline-flex; align-items:center; gap:7px; height:38px; padding:0 16px; border-radius:999px;
  font-size:14px; font-weight:600; white-space:nowrap; border:1px solid var(--border);
  background:var(--panel); color:var(--text-dim); cursor:pointer; outline:none; transition:all .14s ease; }
.tb-pill.tb-section { background:var(--accent); color:var(--accent-ink); border-color:var(--accent); font-weight:800; cursor:default; }
.tb-ghost:hover, .tb-ghost:focus { color:var(--text); border-color:var(--border-hi); box-shadow:var(--focus); }
.tb-last { background:rgba(245,166,35,0.10); border-color:var(--accent-line); color:var(--accent-2); max-width:280px; }
.tb-last span { overflow:hidden; text-overflow:ellipsis; }
.tb-last:focus { box-shadow:var(--focus); }
.tb-info { cursor:default; color:var(--text-dim); }
.tb-info#tb-source { color:var(--text); }

/* STAGE */
.stage { flex:1; overflow:hidden; display:flex; position:relative; padding:0 14px 14px; }
.screen { display:none; flex:1; min-width:0; overflow:hidden; }
.screen.active { display:flex; }

/* ================================================================
   HOME
   ================================================================ */
#s-home { flex-direction:column; overflow-y:auto; }
.home-hub { display:flex; gap:16px; padding:6px 4px; }
.hub-card {
  flex:1; min-width:0; background:var(--panel); border:1px solid var(--border); border-radius:var(--radius);
  padding:26px 28px; display:flex; align-items:center; gap:20px; cursor:pointer; outline:none;
  transition:all .16s ease; position:relative;
}
.hub-card:hover { background:var(--card); border-color:var(--border-hi); }
.hub-card:focus { box-shadow:var(--focus); border-color:var(--accent); background:var(--card); }
.hub-ic { width:58px; height:58px; border-radius:14px; background:var(--card); border:1px solid var(--border);
  display:flex; align-items:center; justify-content:center; flex-shrink:0; color:var(--text); }
.hub-ic .sb-ic { width:28px; height:28px; }
.hub-body { display:flex; flex-direction:column; gap:4px; min-width:0; }
.hub-titlerow { display:flex; align-items:center; gap:8px; }
.hub-title { font-size:22px; font-weight:800; color:var(--text); letter-spacing:.3px; }
.hub-badge { font-size:10px; font-weight:800; padding:2px 7px; border-radius:6px; letter-spacing:.5px;
  background:var(--accent-dim); color:var(--accent); border:1px solid var(--accent-line); }
.hub-sub { font-size:13px; color:var(--text-dim); }
.home-brand { flex:1; display:flex; align-items:center; justify-content:center; opacity:.9; }
.home-brand img { height:120px; max-width:40%; object-fit:contain; }

/* ================================================================
   TV AO VIVO (2 painéis)
   ================================================================ */
.panel { background:var(--panel); border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; }
.live { gap:14px; padding:4px; }
.live-list { flex:1; min-width:0; display:flex; flex-direction:column; position:relative; }
.live-preview { width:420px; min-width:340px; display:flex; flex-direction:column; padding:16px; gap:14px; }

.live-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 16px 6px; }
.live-toolbar2 { display:flex; align-items:center; gap:10px; padding:6px 16px 12px; border-bottom:1px solid var(--border); }
.live-total { font-size:13px; color:var(--text-dim); font-weight:600; white-space:nowrap; }

.dropdown { display:inline-flex; align-items:center; gap:8px; height:44px; padding:0 16px; border-radius:12px;
  background:var(--card); border:1px solid var(--border); color:var(--text-dim); font-size:14px; font-weight:600;
  cursor:pointer; outline:none; transition:all .14s ease; }
.dropdown b { color:var(--text); font-weight:700; }
.dropdown:hover, .dropdown:focus { border-color:var(--accent-line); box-shadow:var(--focus); color:var(--text); }
.dd-caret { color:var(--text-dim); font-size:12px; }

.search-box { display:flex; align-items:center; gap:10px; height:44px; padding:0 14px; border-radius:12px;
  background:var(--input); border:1px solid transparent; color:var(--text-dim); transition:all .14s ease; }
.search-box.sm { height:40px; }
.search-box.grow { flex:1; min-width:120px; }
.search-box.big { height:56px; border-radius:14px; }
.search-box:focus-within { border-color:var(--accent); box-shadow:0 0 0 2px rgba(245,166,35,0.25); }
.search-box input { flex:1; background:transparent; border:none; outline:none; color:var(--text); font-size:15px;
  user-select:text; -webkit-user-select:text; }
.search-box input::placeholder { color:var(--text-mut); }

.btn-pill { display:inline-flex; align-items:center; gap:8px; height:44px; padding:0 16px; border-radius:12px;
  background:var(--card); border:1px solid var(--border); color:var(--text); font-size:14px; font-weight:600;
  cursor:pointer; outline:none; white-space:nowrap; transition:all .14s ease; }
.btn-pill:hover, .btn-pill:focus { border-color:var(--accent-line); box-shadow:var(--focus); }
.btn-pill.accent { background:var(--accent); color:var(--accent-ink); border-color:var(--accent); font-weight:700; }
.btn-pill.accent:hover, .btn-pill.accent:focus { filter:brightness(1.05); box-shadow:var(--focus); }

/* Popover de categorias */
.live-cats-pop, .vod-cats-pop {
  position:absolute; z-index:20; background:var(--card); border:1px solid var(--border-hi); border-radius:12px;
  padding:6px; max-height:60%; overflow-y:auto; box-shadow:0 18px 40px rgba(0,0,0,.6); min-width:260px;
}
.live-cats-pop { top:64px; left:16px; }
.vod-cats-pop { top:120px; left:0; }
.cat-opt { padding:10px 14px; border-radius:8px; font-size:13px; color:var(--text-dim); cursor:pointer;
  display:flex; justify-content:space-between; gap:12px; outline:none; }
.cat-opt:hover, .cat-opt:focus { background:var(--card-hi); color:var(--text); }
.cat-opt.sel { background:var(--accent-dim); color:var(--accent); font-weight:700; }
.cat-opt .cnt { font-size:11px; color:var(--text-mut); }

/* Lista de canais */
.chan-list { flex:1; overflow-y:auto; padding:8px; display:flex; flex-direction:column; gap:4px; }
.chan-row { display:flex; align-items:center; gap:14px; padding:10px 12px; border-radius:12px;
  background:transparent; border:1px solid transparent; cursor:pointer; outline:none; transition:all .13s ease; }
.chan-row:hover { background:var(--card); }
.chan-row:focus, .chan-row.sel { background:var(--card-hi); border-color:var(--accent-line); box-shadow:var(--focus); }
.chan-num { width:26px; text-align:center; font-size:15px; font-weight:700; color:var(--text-dim); flex-shrink:0; }
.chan-logo { width:52px; height:38px; border-radius:8px; background:var(--panel-2); border:1px solid var(--border);
  object-fit:contain; padding:4px; flex-shrink:0; }
.chan-txt { min-width:0; display:flex; flex-direction:column; gap:2px; }
.chan-name { font-size:15px; font-weight:600; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.chan-sub { font-size:12px; color:var(--text-dim); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* Preview pane */
.prev-thumb { position:relative; width:100%; padding-top:56.25%; /* 16:9 */ border-radius:12px; overflow:hidden;
  background:linear-gradient(160deg, var(--card) 0%, var(--panel-2) 100%); border:1px solid var(--border); }
.prev-thumb img { position:absolute; top:50%; left:50%; transform:translate(-50%,-50%);
  max-width:55%; max-height:55%; object-fit:contain; opacity:.95; }
.prev-badges { position:absolute; top:10px; left:10px; display:flex; gap:6px; }
.pb { font-size:10px; font-weight:800; padding:3px 8px; border-radius:6px; background:rgba(0,0,0,.55);
  color:#fff; border:1px solid rgba(255,255,255,.15); letter-spacing:.4px; }
.prev-name { font-size:22px; font-weight:800; color:var(--text); text-align:center; }
.prev-tags { display:flex; gap:8px; justify-content:center; flex-wrap:wrap; }
.prev-tag { font-size:11px; font-weight:600; padding:4px 10px; border-radius:999px; background:var(--card); border:1px solid var(--border); color:var(--text-dim); }
.prev-tag.dot::before { content:"●"; color:var(--accent); margin-right:6px; font-size:9px; }
.prev-now { margin-top:4px; }
.prev-now-label { font-size:12px; font-weight:800; color:var(--accent); letter-spacing:.8px; }
.prev-now-title { font-size:15px; font-weight:600; color:var(--text); margin:4px 0 8px; }
.prev-now-bar { height:5px; border-radius:3px; background:var(--card); overflow:hidden; }
.prev-now-bar span { display:block; height:100%; width:35%; background:var(--accent); border-radius:3px; }
.prev-play { margin-top:auto; }

/* ================================================================
   FILMES / SÉRIES (filtros + grid de pôsteres)
   ================================================================ */
.vod { flex-direction:column; overflow:hidden; position:relative; }
.vod-head { padding:6px 4px 12px; display:flex; flex-direction:column; gap:12px; flex-shrink:0; }
.vod-title { font-size:26px; font-weight:800; color:var(--text); }
.vod-title span { font-size:15px; font-weight:600; color:var(--text-dim); margin-left:8px; }
.vod-filters { display:flex; align-items:center; gap:10px; }

/* grid-auto-rows FIXO: sem isso, com muitos itens as linhas "auto" colapsam
   (card vira 2px) e o overflow:hidden corta o pôster virando risquinho. */
.poster-grid { flex:1; overflow-y:auto; display:grid; gap:14px; padding:4px 4px 10px; align-content:start;
  grid-template-columns:repeat(auto-fill, minmax(150px, 1fr)); grid-auto-rows:300px; }

.poster-card { position:relative; border-radius:12px; overflow:hidden; cursor:pointer; outline:none;
  background:var(--card); border:1px solid var(--border); transition:transform .16s cubic-bezier(.2,0,0,1), box-shadow .16s, border-color .16s; }
.poster-card:hover { border-color:var(--accent-line); }
.poster-card:focus { border-color:var(--accent); box-shadow:var(--focus); transform:scale(1.05); z-index:5; }
/* altura FIXA (px) — dimensiona a linha do grid sem colapsar em escala.
   Nada de padding-top%/aspect-ratio aqui (colapsa em grid com muitas linhas). */
.poster-thumb { position:relative; width:100%; height:255px;
  background:linear-gradient(180deg, var(--card-hi), var(--panel-2)); overflow:hidden; }
.poster-thumb > img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.poster-ph { position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  font-size:26px; font-weight:800; color:var(--accent); opacity:.5; }
.poster-name { padding:8px 8px 9px; font-size:12px; font-weight:600; color:var(--text); text-align:center;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.poster-card:focus .poster-name { color:var(--accent); }
.rating-badge { position:absolute; top:8px; left:8px; display:flex; align-items:center; gap:3px;
  font-size:11px; font-weight:800; padding:3px 7px; border-radius:8px; background:rgba(0,0,0,.6);
  color:#fff; border:1px solid rgba(255,255,255,.14); }
.rating-badge .st { color:var(--accent); }
.badge-live { position:absolute; top:8px; right:8px; font-size:9px; font-weight:800; padding:2px 6px;
  border-radius:5px; background:var(--red); color:#fff; letter-spacing:.4px; }
.badge-type { position:absolute; top:8px; left:8px; font-size:9px; font-weight:800; padding:2px 6px;
  border-radius:5px; background:var(--accent); color:var(--accent-ink); letter-spacing:.4px; }

/* ================================================================
   PESQUISA
   ================================================================ */
#s-search { flex-direction:column; overflow:hidden; }
.search-screen { flex:1; display:flex; flex-direction:column; gap:16px; overflow:hidden; padding:6px 4px; }
.scr-title { font-size:30px; font-weight:800; color:var(--text); }
.goto-label { font-size:12px; font-weight:800; color:var(--accent); letter-spacing:1px; }
.goto-row { display:flex; gap:10px; flex-wrap:wrap; }
.search-screen .poster-grid { margin-top:4px; }

/* ================================================================
   CONFIGURAÇÕES (2 painéis: grupos + detalhe)
   ================================================================ */
.settings { flex-direction:column; overflow:hidden; }
.set-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; padding:6px 4px 14px; flex-shrink:0; }
.set-sub { font-size:13px; color:var(--text-dim); margin-top:4px; }
.set-body { flex:1; display:flex; gap:14px; overflow:hidden; padding-bottom:2px; }
.set-groups { width:360px; min-width:300px; overflow-y:auto; padding:14px; display:flex; flex-direction:column; gap:8px; }
.set-detail { flex:1; overflow-y:auto; padding:22px 24px; }

.set-groups-hd { font-size:11px; font-weight:800; color:var(--text-mut); letter-spacing:1.2px; text-transform:uppercase; padding:2px 6px 6px; }
.set-group { display:flex; align-items:center; gap:14px; padding:14px 16px; border-radius:14px; cursor:pointer; outline:none;
  background:var(--card); border:1px solid var(--border); transition:all .14s ease; }
.set-group:hover { background:var(--card-hi); }
.set-group:focus, .set-group.sel { border-color:var(--accent); box-shadow:var(--focus); background:var(--card-hi); }
.set-group-ic { width:40px; height:40px; border-radius:12px; background:var(--panel-2); border:1px solid var(--border);
  display:flex; align-items:center; justify-content:center; color:var(--accent); flex-shrink:0; }
.set-group-ic .sb-ic { width:20px; height:20px; }
.set-group-tx { flex:1; min-width:0; }
.set-group-name { font-size:16px; font-weight:700; color:var(--text); }
.set-group-sub { font-size:12px; color:var(--text-dim); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.set-group-cnt { font-size:12px; font-weight:700; color:var(--accent); background:var(--accent-dim);
  border:1px solid var(--accent-line); border-radius:999px; padding:2px 10px; flex-shrink:0; }

.set-detail-title { font-size:22px; font-weight:800; color:var(--text); }
.set-detail-sub { font-size:13px; color:var(--text-dim); margin:4px 0 18px; }
.set-row { display:flex; align-items:center; gap:14px; padding:14px 4px; border-bottom:1px solid var(--border); cursor:pointer; outline:none; border-radius:8px; }
.set-row:focus, .set-row:hover { background:var(--card); }
.set-row-ic { width:40px; height:40px; border-radius:12px; background:var(--panel-2); border:1px solid var(--border);
  display:flex; align-items:center; justify-content:center; color:var(--text-dim); flex-shrink:0; }
.set-row-tx { flex:1; min-width:0; }
.set-row-name { font-size:15px; font-weight:700; color:var(--text); }
.set-row-sub { font-size:12px; color:var(--text-dim); }
.set-row-val { font-size:13px; font-weight:700; color:var(--accent); }
.set-back { display:inline-flex; align-items:center; gap:10px; font-size:22px; font-weight:800; color:var(--text);
  background:transparent; border:none; cursor:pointer; outline:none; margin-bottom:16px; }
.set-back:focus { color:var(--accent); }
.set-back .sb-ic { width:24px; height:24px; }

/* Toggle / seções DNS */
.set-section-label { font-size:12px; font-weight:800; color:var(--text-mut); letter-spacing:1px; text-transform:uppercase; margin:18px 0 10px; }
.set-section-label.accent { color:var(--accent); font-size:16px; text-transform:none; letter-spacing:0; }
.toggle-row { display:flex; align-items:center; gap:14px; padding:14px; background:var(--card); border:1px solid var(--border); border-radius:14px; }
.toggle-ic { width:44px; height:44px; border-radius:12px; background:rgba(220,60,60,.14); border:1px solid rgba(220,60,60,.3);
  display:flex; align-items:center; justify-content:center; color:#e57373; flex-shrink:0; }
.toggle-tx { flex:1; min-width:0; }
.toggle-name { font-size:16px; font-weight:700; color:var(--text); }
.toggle-sub { font-size:12px; color:var(--text-dim); }
.toggle-btn { font-size:13px; font-weight:800; padding:8px 16px; border-radius:999px; cursor:pointer; outline:none;
  background:var(--accent); color:var(--accent-ink); border:1px solid var(--accent); }
.toggle-btn.off { background:var(--card); color:var(--text-dim); border-color:var(--border); }
.toggle-btn:focus { box-shadow:var(--focus); }
.chip-row { display:flex; gap:10px; flex-wrap:wrap; margin-bottom:6px; }
.set-input { width:100%; background:var(--input); border:1px solid var(--border); border-radius:12px; padding:12px 14px;
  color:var(--text); font-size:14px; outline:none; user-select:text; -webkit-user-select:text; margin-top:6px; }
.set-input:focus { border-color:var(--accent); box-shadow:0 0 0 2px rgba(245,166,35,.2); }
.set-note { font-size:12px; color:var(--text-mut); margin-top:10px; line-height:1.5; }

/* ================================================================
   DETALHES (Filme/Série)
   ================================================================ */
.details-overlay { position:fixed; inset:0; z-index:150; display:flex; background:rgba(10,14,20,.9); backdrop-filter:blur(8px); }
.details-overlay.hidden { display:none; }
.details-backdrop { position:absolute; inset:0; background-size:cover; background-position:center; opacity:.14; filter:blur(10px); }
.details-panel { position:relative; z-index:1; display:flex; width:100%; max-width:1100px; margin:auto; padding:40px; gap:40px; }
.details-poster-wrap { width:260px; min-width:260px; border-radius:16px; overflow:hidden; background:var(--card); border:1px solid var(--border); align-self:flex-start; }
.details-poster { width:100%; display:block; object-fit:cover; }
.details-info { flex:1; display:flex; flex-direction:column; gap:16px; padding-top:8px; overflow-y:auto; }
.details-type-badge { display:inline-block; background:var(--accent-dim); border:1px solid var(--accent); color:var(--accent);
  font-size:11px; font-weight:800; padding:3px 10px; border-radius:6px; letter-spacing:.8px; align-self:flex-start; }
.details-title { font-size:32px; font-weight:800; color:var(--text); line-height:1.1; }
.details-meta { font-size:14px; color:var(--text-dim); }
.details-plot { font-size:15px; color:var(--text-dim); line-height:1.6; max-height:170px; overflow-y:auto; }
.details-actions { display:flex; gap:12px; flex-wrap:wrap; margin-top:4px; }
.episodes-section { margin-top:8px; }
.episodes-section-title { font-size:13px; font-weight:800; color:var(--text-mut); text-transform:uppercase; letter-spacing:.8px; margin-bottom:10px; }
.episodes-grid { display:flex; flex-direction:column; gap:6px; max-height:230px; overflow-y:auto; }
.episode-item { display:flex; align-items:center; gap:12px; padding:11px 14px; background:var(--card); border:1px solid var(--border);
  border-radius:10px; cursor:pointer; outline:none; transition:all .14s ease; }
.episode-item:focus, .episode-item:hover { border-color:var(--accent); background:var(--card-hi); }
.episode-num { font-size:13px; color:var(--accent); }
.episode-title { font-size:13px; color:var(--text); flex:1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* ================================================================
   BOTÕES
   ================================================================ */
.btn-primary { background:linear-gradient(145deg, var(--accent-2), var(--accent)); border:2px solid transparent;
  color:var(--accent-ink); padding:14px 28px; border-radius:999px; font-size:15px; font-weight:800; cursor:pointer;
  outline:none; transition:all .16s ease; letter-spacing:.3px; }
.btn-primary:focus, .btn-primary:hover { box-shadow:0 0 26px rgba(245,166,35,.5); transform:scale(1.02); }
.btn-primary:disabled { opacity:.6; transform:none; cursor:not-allowed; }
.btn-secondary { background:var(--card); border:2px solid var(--border-hi); color:var(--text); padding:14px 26px;
  border-radius:999px; font-size:15px; font-weight:700; cursor:pointer; outline:none; transition:all .16s ease; }
.btn-secondary:focus, .btn-secondary:hover { border-color:var(--accent-line); background:var(--card-hi); }

/* ================================================================
   PLAYER FULLSCREEN
   ================================================================ */
.player-container { position:fixed; inset:0; background:#000; z-index:100; display:none; }
.player-container.active { display:block; }
#video-element { width:100%; height:100%; object-fit:contain; background:#000; }

/* spinner + erro */
.pl-spinner { position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); z-index:2; display:none; }
.pl-spinner.show { display:block; }
.pl-error { position:absolute; inset:0; z-index:4; display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:16px; background:rgba(0,0,0,.82); text-align:center; padding:40px; }
.pl-error-ic { font-size:52px; }
.pl-error-msg { font-size:18px; color:var(--text); max-width:520px; }
.pl-error-actions { display:flex; gap:12px; }

/* UI de controles */
.pl-ui { position:absolute; inset:0; z-index:3; opacity:1; transition:opacity .3s ease; }
.pl-ui.hidden { opacity:0; pointer-events:none; }
.pl-ic { width:24px; height:24px; fill:none; stroke:#fff; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.pl-ic-big { width:46px; height:46px; fill:#0c0f14; }

.pl-top { position:absolute; top:0; left:0; right:0; display:flex; align-items:center; gap:16px; padding:26px 40px;
  background:linear-gradient(to bottom, rgba(0,0,0,.85), transparent); }
.pl-logo { width:52px; height:52px; object-fit:contain; background:rgba(255,255,255,.08); border-radius:10px; padding:5px; border:1px solid rgba(255,255,255,.12); }
.pl-title-wrap { flex:1; min-width:0; }
.pl-title { font-size:24px; font-weight:800; color:#fff; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pl-subtitle { font-size:14px; color:rgba(255,255,255,.7); margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pl-live-badge { background:var(--red); color:#fff; padding:6px 14px; border-radius:999px; font-weight:800; font-size:13px; letter-spacing:.5px; flex-shrink:0; }

.pl-bigplay { position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); width:88px; height:88px; border-radius:50%;
  background:rgba(245,166,35,.94); border:none; cursor:pointer; outline:none; display:flex; align-items:center; justify-content:center;
  box-shadow:0 8px 30px rgba(0,0,0,.5); transition:transform .15s ease; }
.pl-bigplay:hover, .pl-bigplay:focus { transform:translate(-50%,-50%) scale(1.08); }
.pl-bigplay.hidden { display:none; }

.pl-bottom { position:absolute; left:0; right:0; bottom:0; padding:20px 40px 26px;
  background:linear-gradient(to top, rgba(0,0,0,.9), transparent); display:flex; flex-direction:column; gap:10px; }
.pl-seek { display:flex; align-items:center; gap:14px; }
.pl-seek.hidden { display:none; }
.pl-time { font-size:13px; color:rgba(255,255,255,.85); font-variant-numeric:tabular-nums; min-width:48px; text-align:center; }

.pl-progress, .pl-volume { -webkit-appearance:none; appearance:none; height:6px; border-radius:3px; outline:none; cursor:pointer;
  background:rgba(255,255,255,.25); }
.pl-progress { flex:1; }
.pl-volume { width:110px; }
.pl-progress::-webkit-slider-thumb, .pl-volume::-webkit-slider-thumb { -webkit-appearance:none; width:16px; height:16px; border-radius:50%; background:var(--accent); cursor:pointer; border:2px solid #fff; }
.pl-progress::-moz-range-thumb, .pl-volume::-moz-range-thumb { width:16px; height:16px; border-radius:50%; background:var(--accent); cursor:pointer; border:2px solid #fff; }
.pl-progress:focus, .pl-volume:focus { box-shadow:0 0 0 3px rgba(245,166,35,.5); }

.pl-controls { display:flex; align-items:center; gap:10px; }
.pl-spacer { flex:1; }
.pl-btn { width:44px; height:44px; border-radius:12px; background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.12);
  display:flex; align-items:center; justify-content:center; cursor:pointer; outline:none; color:#fff; transition:all .14s ease; }
.pl-btn:hover, .pl-btn:focus { background:rgba(245,166,35,.85); border-color:var(--accent); box-shadow:0 0 0 2px rgba(245,166,35,.5); }
.pl-btn:hover .pl-ic, .pl-btn:focus .pl-ic { stroke:#0c0f14; }
.pl-btn-text { width:auto; padding:0 14px; font-size:13px; font-weight:700; }

/* menu de faixas/qualidade */
.pl-menu { position:absolute; right:40px; bottom:110px; z-index:5; background:rgba(18,24,34,.98); border:1px solid var(--border-hi);
  border-radius:12px; padding:8px; min-width:220px; box-shadow:0 18px 50px rgba(0,0,0,.6); max-height:50%; overflow-y:auto; }
.pl-menu-hd { font-size:11px; font-weight:800; color:var(--text-mut); letter-spacing:1px; text-transform:uppercase; padding:8px 12px 4px; }
.pl-menu-item { padding:10px 12px; border-radius:8px; font-size:14px; color:var(--text); cursor:pointer; outline:none; display:flex; justify-content:space-between; gap:10px; }
.pl-menu-item:hover, .pl-menu-item:focus { background:var(--card-hi); }
.pl-menu-item.sel { color:var(--accent); font-weight:700; }
.pl-menu-item.sel::after { content:"✓"; }

/* ================================================================
   LOGIN
   ================================================================ */
.modal-overlay { position:fixed; inset:0; background:rgba(8,11,17,.97); display:flex; align-items:center; justify-content:center; z-index:200; }
.modal-overlay.hidden { display:none; }
.login-card { width:640px; max-width:92vw; background:transparent; padding:20px; display:flex; flex-direction:column; gap:16px; }
.login-title { font-size:34px; font-weight:800; text-align:center; color:var(--text); }
.login-subtitle { font-size:14px; color:var(--text-dim); text-align:center; margin-top:-6px; }
.login-input-group { display:flex; flex-direction:column; gap:8px; margin-top:6px; }
.login-input-group label { font-size:14px; font-weight:700; color:var(--text-dim); }
.login-input { background:var(--input); border:1px solid transparent; border-radius:12px; padding:16px 18px; color:var(--text);
  font-size:17px; outline:none; transition:all .16s ease; width:100%; user-select:text; -webkit-user-select:text; }
.login-input:focus { border-color:var(--accent); box-shadow:0 0 0 3px rgba(245,166,35,.2); }
.login-pass-wrap { position:relative; display:flex; align-items:center; }
.login-show { position:absolute; right:14px; background:transparent; border:none; color:var(--text-dim); font-size:14px;
  font-weight:600; cursor:pointer; outline:none; }
.login-show:focus, .login-show:hover { color:var(--accent); }
.login-actions { display:flex; gap:14px; margin-top:10px; }
.login-actions .btn-secondary { flex:0 0 auto; }
.login-actions .btn-primary { margin-left:auto; }
.login-status { text-align:center; font-size:13px; color:var(--text-dim); min-height:16px; }

/* ================================================================
   SYNC OVERLAY (Importando catálogo… / Tudo pronto!)
   ================================================================ */
.sync-overlay { position:fixed; inset:0; background:var(--bg); display:flex; align-items:center; justify-content:center; z-index:180; }
.sync-overlay.hidden { display:none; }
.sync-inner { display:flex; flex-direction:column; align-items:center; gap:12px; text-align:center; padding:40px; }
.sync-title { font-size:22px; font-weight:700; color:var(--text); margin-top:8px; }
.sync-count { font-size:38px; font-weight:800; color:var(--accent); }
.sync-sub { font-size:14px; color:var(--text-dim); }
.sync-actions { display:flex; gap:14px; margin-top:14px; }

/* ================================================================
   EMPTY / LOADER
   ================================================================ */
.empty-state { grid-column:1/-1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px;
  padding:50px; color:var(--text-dim); text-align:center; min-height:200px; }
.empty-ic { font-size:44px; opacity:.25; }
.loader { width:44px; height:44px; border:4px solid rgba(245,166,35,.18); border-top-color:var(--accent); border-radius:50%; animation:spin .8s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
.grid-loading { grid-column:1/-1; display:flex; align-items:center; justify-content:center; padding:60px; }

/* ================================================================
   RESPONSIVO — celular / telas estreitas
   ================================================================ */
@media (max-width: 820px) {
  :root { --sb-w: 58px; }
  .sb-logo { width:38px; height:38px; border-radius:11px; }
  .sb-item { width:40px; height:40px; border-radius:11px; }
  .sb-ic { width:20px; height:20px; }
  .sb-fab { width:44px; height:44px; }

  .topbar { height:56px; min-height:56px; padding:0 10px; gap:8px; }
  .tb-pill { height:34px; padding:0 12px; font-size:13px; }
  #tb-weather, #tb-source { display:none; }          /* economiza espaço */
  .tb-last { max-width:150px; }

  .stage { padding:0 8px 8px; }

  /* Home: cards empilhados */
  .home-hub { flex-direction:column; gap:10px; }
  .hub-card { padding:18px 18px; }
  .hub-title { font-size:18px; }
  .home-brand img { height:70px; max-width:60%; }

  /* TV ao vivo: só a lista (preview escondido); toca ao tocar no canal */
  .live { flex-direction:column; }
  .live-preview { display:none; }
  .live-toolbar, .live-toolbar2 { flex-wrap:wrap; }

  /* Filmes/Séries: grade menor + filtros quebram linha */
  .vod-title { font-size:20px; }
  .vod-title span { display:block; font-size:12px; margin:2px 0 0; }
  .vod-filters { flex-wrap:wrap; gap:8px; }
  .vod-filters .search-box.grow { order:5; flex-basis:100%; }
  .poster-grid { grid-template-columns:repeat(auto-fill, minmax(110px, 1fr)) !important; grid-auto-rows:210px !important; gap:10px; }
  .poster-thumb { height:165px !important; }
  .poster-name { font-size:11px; }

  /* Pesquisa */
  .scr-title { font-size:22px; }

  /* Configurações: 2 painéis empilhados */
  .set-head { flex-direction:column; align-items:stretch; gap:10px; }
  .set-body { flex-direction:column; overflow-y:auto; }
  .set-groups { width:100%; min-width:0; }
  .set-detail { width:100%; }

  /* Detalhes: pôster em cima, coluna */
  .details-panel { flex-direction:column; padding:20px; gap:20px; overflow-y:auto; }
  .details-poster-wrap { width:150px; min-width:150px; align-self:center; }
  .details-title { font-size:24px; }

  /* Player: controles compactos + alvos de toque */
  .pl-top { padding:16px 16px; gap:10px; }
  .pl-title { font-size:18px; }
  .pl-subtitle { font-size:12px; }
  .pl-bottom { padding:14px 14px 18px; }
  .pl-controls { gap:8px; flex-wrap:wrap; }
  .pl-volume { width:80px; }
  .pl-btn { width:42px; height:42px; }
  .pl-bigplay { width:72px; height:72px; }
}

@media (max-width: 480px) {
  .poster-grid { grid-template-columns:repeat(auto-fill, minmax(96px, 1fr)) !important; grid-auto-rows:180px !important; }
  .poster-thumb { height:135px !important; }
  .tb-pill.tb-ghost { padding:0 10px; }
  .pl-audio, .pl-subs, .pl-quality { display:none !important; } /* menu de faixas fica no gesto; espaço no cel */
  .pl-volume, #pl-mute { display:none; }                        /* no cel, volume é físico */
}

/* Toque: realça card ao pressionar (sem depender de foco) */
@media (hover: none) {
  .poster-card:active { border-color:var(--accent); transform:scale(.98); }
  .chan-row:active, .hub-card:active, .btn-pill:active { background:var(--card-hi); }
}
