/* ═════════════════════════════════════════════════════════════
   StreamHub — interface "10-foot" (TV / console / desktop)
   - 1rem escala com a largura da tela (1920px → 16px, 4K → 32px)
   - Foco sempre visível (anel + leve zoom)
   - Sem CSS grid / aspect-ratio (compatível com navegadores de TV)
   ═════════════════════════════════════════════════════════════ */

:root {
  --bg:      #07090f;
  --bg2:     #0c1018;
  --bg3:     #111826;
  --card:    #0f1520;
  --card-h:  #161f32;
  --border:  #1c2740;
  --accent:  #e8392a;
  --accent2: #ff7b5e;
  --text:    #dce4f0;
  --muted:   #6b7f9e;
  --live:    #22c55e;
  --focus:   #ffffff;
  --r:       .7rem;
  --font-d:  'Bebas Neue', Impact, 'Arial Narrow', sans-serif;
  --font-b:  'Outfit', 'Segoe UI', Roboto, Arial, sans-serif;
  --scale:   1;
  --sidenav: 5.5rem;
}
html[data-scale="small"] { --scale: .85; }
html[data-scale="large"] { --scale: 1.2; }

html { font-size: calc(16px * var(--scale)); }
@media (min-width: 1280px) { html { font-size: calc(100vw / 120 * var(--scale)); } }
@media (min-width: 3000px) { html { font-size: calc(100vw / 120 * var(--scale)); } }

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; background: var(--bg); }
body {
  font-family: var(--font-b); color: var(--text); font-size: 1rem; line-height: 1.4;
  -webkit-font-smoothing: antialiased; -webkit-user-select: none; user-select: none;
}
body.kbd { cursor: none; }
body.kbd * { cursor: none !important; }
a { color: inherit; text-decoration: none; }
img { display: block; }
::-webkit-scrollbar { width: 0; height: 0; }
input, button { font-family: inherit; }
.focusable { outline: none; }

/* ─── Layout ─── */
#app { display: flex; height: 100%; width: 100%; position: relative; }
body.no-chrome #sidenav { display: none; }
.main {
  flex: 1 1 auto; min-width: 0; height: 100%; overflow-y: auto; overflow-x: hidden;
  padding: 2.2rem 3rem 3rem; position: relative;
}
body.no-chrome .main { padding: 0; }
.main.page-live, .main.page-movies, .main.page-series { overflow: hidden; padding: 0; }
.main.page-movie, .main.page-series-detail { padding: 0; }

/* ─── Menu lateral (expande ao receber foco) ─── */
#sidenav {
  flex: 0 0 var(--sidenav); width: var(--sidenav); height: 100%;
  background: var(--bg2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: relative; z-index: 40;
  transition: width .18s ease, flex-basis .18s ease;
}
#sidenav.expanded { width: 15rem; flex-basis: 15rem; box-shadow: 1rem 0 3rem rgba(0,0,0,.5); }
.sn-logo {
  font-family: var(--font-d); font-size: 1.9rem; letter-spacing: .1rem; padding: 1.4rem 0 1.2rem;
  text-align: center; white-space: nowrap; overflow: hidden; border-bottom: 1px solid var(--border);
}
.sn-logo em, .logo em, .boot-logo em { color: var(--accent); font-style: normal; }
.sn-logo-full { display: none; }
#sidenav.expanded .sn-logo { text-align: left; padding-left: 1.4rem; }
#sidenav.expanded .sn-logo-short { display: none; }
#sidenav.expanded .sn-logo-full { display: inline; }
.sn-items { display: flex; flex-direction: column; padding: .8rem .6rem; gap: .25rem; flex: 1; }
.sn-item, .sn-user {
  display: flex; align-items: center; gap: .9rem; padding: .8rem .95rem; border-radius: .6rem;
  color: var(--muted); font-size: 1.05rem; font-weight: 500; white-space: nowrap; overflow: hidden;
  transition: background .12s, color .12s, transform .12s;
}
.sn-icon { font-size: 1.35rem; width: 1.6rem; text-align: center; flex: 0 0 1.6rem; }
.sn-label { opacity: 0; transition: opacity .15s; }
#sidenav.expanded .sn-label { opacity: 1; }
.sn-item.on { color: var(--accent2); background: rgba(232,57,42,.12); }
.sn-item.focused { background: var(--focus); color: #000; transform: scale(1.03); }
.sn-bottom { margin: .6rem; border-top: 1px solid var(--border); padding-top: .6rem; }
.sn-user { font-size: .9rem; padding: .6rem .95rem; }
.sn-logout { color: #ff8874; }
.sn-logout .sn-icon { font-size: 1.3rem; }

/* ─── Botões / chips / inputs ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  background: rgba(255,255,255,.07); border: 2px solid transparent; color: var(--text);
  border-radius: .6rem; padding: .7rem 1.3rem; font-size: 1rem; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: transform .12s, background .12s, color .12s;
}
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 .5rem 1.5rem rgba(232,57,42,.3); }
.btn.big { padding: .95rem 1.8rem; font-size: 1.1rem; }
.btn.sm { padding: .45rem .9rem; font-size: .85rem; }
.btn.danger { color: #ff8874; }
.btn.on { color: #f87171; }
.btn.focused { background: var(--focus); color: #000; border-color: var(--focus); transform: scale(1.06); box-shadow: 0 .6rem 2rem rgba(0,0,0,.6); }
.btn.primary.focused { background: #fff; color: var(--accent); }
.nav-disabled { opacity: .4; }
.chip {
  display: inline-block; padding: .4rem 1rem; border-radius: 99px; background: rgba(255,255,255,.06);
  border: 2px solid transparent; font-size: .9rem; font-weight: 600; color: var(--muted);
}
.chip.on { color: var(--accent2); border-color: rgba(232,57,42,.5); }
.chip.focused { background: var(--focus); color: #000; }
.input {
  width: 100%; background: rgba(255,255,255,.05); border: 2px solid var(--border); border-radius: .6rem;
  padding: .9rem 1.1rem; color: var(--text); font-size: 1.05rem; outline: none; transition: border-color .15s, background .15s;
}
.input.focused { border-color: var(--focus); background: rgba(255,255,255,.1); }
.input:focus { border-color: var(--accent); background: rgba(232,57,42,.06); }
.input::placeholder { color: var(--muted); }
.label { display: block; font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 1rem 0 .4rem; }
.tag { display: inline-block; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15); border-radius: .4rem; padding: .3rem .8rem; font-size: .85rem; margin: 0 .5rem .5rem 0; }
.badge { font-family: var(--font-b); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; background: rgba(232,57,42,.15); border: 1px solid rgba(232,57,42,.3); color: #ff8874; padding: .2rem .6rem; border-radius: .3rem; vertical-align: middle; }

/* ─── Títulos / estados ─── */
.page-title { font-family: var(--font-d); font-size: 2.4rem; letter-spacing: .05em; font-weight: 400; line-height: 1; }
.page-count { color: var(--muted); font-size: .9rem; margin-left: 1rem; }
.loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; padding: 4rem; color: var(--muted); }
.spinner { width: 2.4rem; height: 2.4rem; border: .2rem solid rgba(255,255,255,.12); border-top-color: var(--accent); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; padding: 4rem 2rem; color: var(--muted); font-size: 1.05rem; width: 100%; }
.empty-icon { font-size: 3rem; margin-bottom: .8rem; opacity: .4; }

/* ─── Imagem com fallback ─── */
.img { position: relative; width: 100%; height: 100%; background: var(--bg3); overflow: hidden; }
.img img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .25s; }
.img.loaded img { opacity: 1; }
.img-fb { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--muted); font-family: var(--font-d); font-size: 2.2rem; opacity: .6; }

/* ─── Cards de pôster ─── */
.card {
  position: relative; width: 11rem; flex: 0 0 11rem; background: var(--card); border: 2px solid transparent;
  border-radius: var(--r); overflow: hidden; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s;
}
.card.focused { transform: scale(1.09); border-color: var(--focus); box-shadow: 0 1rem 2.5rem rgba(0,0,0,.7), 0 0 0 .15rem rgba(255,255,255,.4); z-index: 3; }
.card-poster { position: relative; width: 100%; padding-top: 150%; background: var(--bg3); }
.card-poster > .img { position: absolute; left: 0; top: 0; }
.card-body { padding: .6rem .7rem .7rem; }
.card-name { font-size: .9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { font-size: .78rem; color: var(--muted); min-height: 1.1em; }
.card.focused .card-name { color: #fff; }
.card-progress { position: absolute; left: 0; right: 0; bottom: 0; height: .3rem; background: rgba(255,255,255,.15); z-index: 2; }
.card-progress-fill { height: 100%; background: var(--accent); }
.card-fav { position: absolute; top: .5rem; right: .5rem; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: rgba(248,113,113,.95); color: #fff; font-size: .85rem; display: flex; align-items: center; justify-content: center; z-index: 2; }
.card-rating { position: absolute; top: .5rem; left: .5rem; background: rgba(0,0,0,.7); color: #fbbf24; font-size: .72rem; font-weight: 700; padding: .15rem .45rem; border-radius: .3rem; z-index: 2; }
.card-live { width: 13rem; flex-basis: 13rem; }
.card-thumb { position: relative; width: 100%; padding-top: 56%; background: var(--bg3); }
.card-thumb > .img { position: absolute; left: 0; top: 0; }
.card-thumb img { object-fit: contain !important; padding: 1rem; }

/* ─── Fileiras horizontais ─── */
.row { margin-bottom: 1.8rem; }
.row-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .7rem; padding-right: 1rem; }
.row-title { font-family: var(--font-d); font-size: 1.6rem; letter-spacing: .04em; font-weight: 400; }
.row-more { font-size: .9rem; color: var(--muted); padding: .35rem .8rem; border-radius: .5rem; border: 2px solid transparent; }
.row-more.focused { background: var(--focus); color: #000; }
.row-track {
  display: flex; gap: 1rem; overflow-x: hidden; overflow-y: visible; padding: .8rem 1rem .9rem .6rem; margin: -.6rem 0 -.6rem -.6rem;
  scroll-behavior: auto; white-space: nowrap;
}
.row-empty { color: var(--muted); font-size: .95rem; padding: 1rem 0; }
.home-rows { padding-top: .5rem; }

/* ─── Hero (início) ─── */
.hero {
  display: flex; align-items: center; justify-content: space-between; gap: 2rem;
  background: linear-gradient(135deg, rgba(232,57,42,.14), rgba(15,21,32,.9)); border: 1px solid rgba(232,57,42,.18);
  border-radius: 1rem; padding: 1.8rem 2.2rem; margin-bottom: 2.2rem; position: relative; overflow: hidden;
}
.hero-hi { font-size: .95rem; color: var(--muted); }
.hero-name { font-family: var(--font-d); font-size: 2.6rem; letter-spacing: .05em; line-height: 1; margin: .2rem 0; }
.hero-sub { font-size: .9rem; color: var(--muted); }
.hero-sub strong { color: var(--text); }
.hero-actions { display: flex; gap: .8rem; flex-wrap: wrap; justify-content: flex-end; }

/* ─── Navegação (categorias + grade) ─── */
.browse-layout, .live-layout { display: flex; height: 100%; }
.browse-cats, .live-cats { flex: 0 0 17rem; width: 17rem; height: 100%; background: var(--bg2); border-right: 1px solid var(--border); overflow: hidden; display: flex; flex-direction: column; }
.cat-list { flex: 1; overflow-y: auto; padding: .8rem .6rem 3rem; }
.cat-item {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .7rem .9rem; border-radius: .55rem;
  color: var(--muted); font-size: .95rem; font-weight: 500; border: 2px solid transparent; margin-bottom: .15rem;
}
.cat-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-extra { font-size: .75rem; opacity: .8; flex: 0 0 auto; }
.cat-item.on { color: var(--text); background: rgba(232,57,42,.12); box-shadow: inset .25rem 0 0 var(--accent); }
.cat-item.focused { background: var(--focus); color: #000; transform: scale(1.02); }
.browse-main { flex: 1; min-width: 0; height: 100%; overflow-y: auto; padding: 1.8rem 2.2rem 4rem; }
.browse-head { display: flex; align-items: baseline; margin-bottom: 1.2rem; }
.grid { display: flex; flex-wrap: wrap; gap: 1.1rem; padding: .6rem .4rem 1rem; }
.grid .card { width: 11.5rem; flex-basis: 11.5rem; }
.grid-loading { width: 100%; display: flex; justify-content: center; padding: 1.5rem; }

/* ─── Ao vivo ─── */
.live-center { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; height: 100%; }
.live-head { display: flex; align-items: baseline; gap: 1rem; padding: 1.2rem 1.6rem .6rem; }
.live-head-title { font-family: var(--font-d); font-size: 1.8rem; letter-spacing: .04em; }
.live-head-count { color: var(--muted); font-size: .85rem; }
.live-chs { flex: 1; overflow-y: auto; padding: .4rem 1.2rem 3rem; }
.ch-list { display: flex; flex-direction: column; gap: .2rem; }
.ch-row {
  display: flex; align-items: center; gap: .9rem; padding: .5rem .8rem; border-radius: .6rem; border: 2px solid transparent;
  transition: background .1s, transform .1s;
}
.ch-num { width: 2.4rem; flex: 0 0 2.4rem; color: var(--muted); font-size: .85rem; text-align: right; font-variant-numeric: tabular-nums; }
.ch-logo { width: 3.4rem; height: 3.4rem; flex: 0 0 3.4rem; border-radius: .5rem; overflow: hidden; background: #fff; }
.ch-logo .img { background: #fff; }
.ch-logo img { object-fit: contain !important; padding: .2rem; }
.ch-logo .img-fb { color: #333; font-size: 1.3rem; }
.ch-name { flex: 1; font-size: 1rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-fav { color: #f87171; font-size: 1rem; }
.ch-row.playing { background: rgba(232,57,42,.12); box-shadow: inset .25rem 0 0 var(--accent); }
.ch-row.playing .ch-name::after { content: ' ● AO VIVO'; color: var(--accent2); font-size: .7rem; letter-spacing: .08em; }
.ch-row.focused { background: var(--focus); color: #000; transform: scale(1.015); }
.ch-row.focused .ch-num { color: #333; }
.live-side { flex: 0 0 34%; width: 34%; height: 100%; display: flex; flex-direction: column; gap: .8rem; padding: 1.2rem 1.4rem 1.2rem .4rem; }
.live-preview { position: relative; width: 100%; padding-top: 56.25%; background: #000; border-radius: .8rem; border: 1px solid var(--border); overflow: hidden; }
.live-preview-empty { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; color: var(--muted); font-size: .95rem; }
.live-preview-empty .big { font-size: 2.6rem; opacity: .4; }
.live-actions { display: flex; gap: .6rem; }
.live-actions .btn { flex: 1; }
.live-epg { flex: 1; overflow-y: auto; background: var(--bg2); border: 1px solid var(--border); border-radius: .8rem; padding: .9rem 1rem; }
.live-epg-empty { color: var(--muted); font-size: .9rem; text-align: center; padding: 1rem 0; }
.epg-item { padding: .55rem 0; border-bottom: 1px dashed rgba(255,255,255,.07); }
.epg-item:last-child { border-bottom: 0; }
.epg-head { display: flex; align-items: center; gap: .6rem; font-size: .75rem; margin-bottom: .25rem; }
.epg-tag { background: var(--card); color: var(--muted); padding: .12rem .5rem; border-radius: .3rem; letter-spacing: .06em; font-weight: 700; }
.epg-item.now .epg-tag { background: var(--accent); color: #fff; }
.epg-time { color: var(--muted); font-variant-numeric: tabular-nums; }
.epg-title { font-size: .95rem; font-weight: 600; line-height: 1.3; }
.epg-desc { font-size: .8rem; color: var(--muted); margin-top: .3rem; max-height: 4.2em; overflow: hidden; }
.epg-bar { height: .25rem; background: rgba(255,255,255,.1); border-radius: 99px; margin-top: .4rem; overflow: hidden; }
.epg-fill { height: 100%; background: var(--accent); }

/* ─── Detalhes ─── */
.detail { position: relative; min-height: 100%; }
.detail-bg { position: absolute; left: 0; top: 0; right: 0; height: 100vh; background-size: cover; background-position: center top; filter: blur(2px) brightness(.5); transform: scale(1.04); }
.detail-overlay { position: absolute; left: 0; top: 0; right: 0; height: 100vh; background: linear-gradient(90deg, rgba(7,9,15,.97) 0%, rgba(7,9,15,.7) 55%, rgba(7,9,15,.35) 100%), linear-gradient(180deg, rgba(7,9,15,.3) 0%, rgba(7,9,15,.98) 100%); }
.detail-content { position: relative; z-index: 2; display: flex; gap: 2.6rem; padding: 3.2rem 3.5rem 2.5rem; align-items: flex-start; }
.detail-poster { flex: 0 0 15rem; width: 15rem; border-radius: .9rem; overflow: hidden; box-shadow: 0 2rem 4rem rgba(0,0,0,.6); position: relative; padding-top: 22.5rem; background: var(--card); }
.detail-poster .img { position: absolute; left: 0; top: 0; }
.detail-info { flex: 1; min-width: 0; }
.detail-title { font-family: var(--font-d); font-size: 3rem; letter-spacing: .04em; line-height: 1.05; font-weight: 400; margin-bottom: .8rem; text-shadow: 0 .2rem .8rem rgba(0,0,0,.6); }
.detail-meta { display: flex; align-items: center; gap: .6rem; font-size: 1rem; color: rgba(255,255,255,.85); margin-bottom: .9rem; }
.detail-meta .dot { opacity: .5; }
.detail-genres { margin-bottom: .8rem; }
.detail-plot { font-size: 1.02rem; line-height: 1.55; color: rgba(255,255,255,.88); max-width: 50rem; margin-bottom: 1.6rem; max-height: 9.5em; overflow: hidden; }
.detail-actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.detail-extra { font-size: .9rem; color: rgba(255,255,255,.8); margin-bottom: .3rem; }
.detail-extra .lbl { color: var(--muted); font-weight: 600; }
.detail-episodes { position: relative; z-index: 2; padding: 0 3.5rem 4rem; }
.season-tabs { display: flex; gap: .6rem; overflow-x: hidden; padding: .6rem 1rem .6rem .2rem; margin-bottom: .6rem; border-bottom: 1px solid var(--border); }
.season-tab { flex: 0 0 auto; padding: .55rem 1.1rem; border-radius: .5rem; background: rgba(255,255,255,.06); color: var(--muted); font-weight: 600; font-size: .95rem; border: 2px solid transparent; white-space: nowrap; }
.season-tab.on { color: var(--accent2); background: rgba(232,57,42,.14); }
.season-tab.focused { background: var(--focus); color: #000; }
.episodes { display: flex; flex-direction: column; gap: .3rem; }
.ep-row { display: flex; align-items: center; gap: 1rem; padding: .6rem .8rem; border-radius: .7rem; border: 2px solid transparent; background: rgba(255,255,255,.03); }
.ep-row.focused { background: var(--focus); color: #000; transform: scale(1.01); }
.ep-num { font-family: var(--font-d); font-size: 1.6rem; color: var(--muted); width: 2.4rem; text-align: center; flex: 0 0 2.4rem; }
.ep-row.focused .ep-num { color: #333; }
.ep-thumb { position: relative; width: 9rem; flex: 0 0 9rem; padding-top: 5rem; border-radius: .5rem; overflow: hidden; background: var(--bg3); }
.ep-thumb .img { position: absolute; left: 0; top: 0; }
.ep-text { flex: 1; min-width: 0; }
.ep-title { font-size: 1rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-meta { font-size: .8rem; color: var(--muted); }
.ep-row.focused .ep-meta, .ep-row.focused .ep-plot { color: #444; }
.ep-plot { font-size: .8rem; color: var(--muted); margin-top: .2rem; max-height: 2.6em; overflow: hidden; }
.ep-play { width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: .9rem; flex: 0 0 2.4rem; }

/* ─── Busca ─── */
.search-box { margin-bottom: 1.6rem; }
.search-box .page-title { margin-bottom: 1rem; }
.search-input { max-width: 40rem; font-size: 1.2rem; padding: 1rem 1.3rem; }
.search-hint { color: var(--muted); font-size: .8rem; margin-top: .5rem; }
.search-empty { color: var(--muted); padding: 2rem 0; }

/* ─── Ajustes ─── */
.set-section { margin: 1.6rem 0 0; max-width: 60rem; }
.set-head { font-family: var(--font-d); font-size: 1.4rem; letter-spacing: .05em; color: var(--muted); font-weight: 400; margin-bottom: .6rem; }
.set-rows { background: var(--bg2); border: 1px solid var(--border); border-radius: .9rem; overflow: hidden; }
.set-row { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--border); border-left: 3px solid transparent; }
.set-row:last-child { border-bottom: 0; }
.set-row.focused { background: var(--focus); color: #000; }
.set-row.focused .set-sub { color: #444; }
.set-icon { font-size: 1.4rem; width: 2rem; text-align: center; flex: 0 0 2rem; }
.set-text { flex: 1; min-width: 0; }
.set-title { font-size: 1.02rem; font-weight: 600; }
.set-sub { font-size: .82rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-arrow { color: var(--muted); font-size: 1.4rem; }
.set-choices { display: flex; gap: .5rem; }
.set-version { color: var(--muted); font-size: .75rem; margin: 2rem 0 3rem; }

/* ─── Admin ─── */
.admin { max-width: 62rem; }
.admin-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.2rem; }
.admin-msg { display: none; padding: .8rem 1.1rem; border-radius: .6rem; font-size: .95rem; margin-bottom: 1rem; }
.admin-msg.show { display: block; }
.admin-msg.ok { background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.3); color: #4ade80; }
.admin-msg.err { background: rgba(232,57,42,.12); border: 1px solid rgba(232,57,42,.3); color: #f87171; }
.srv-list { margin-bottom: 1.6rem; }
.srv-item { display: flex; align-items: center; gap: 1rem; padding: .9rem 1.1rem; background: var(--bg2); border: 1px solid var(--border); border-radius: .8rem; margin-bottom: .6rem; }
.srv-dot { width: .7rem; height: .7rem; border-radius: 50%; background: var(--live); box-shadow: 0 0 .6rem rgba(34,197,94,.6); flex: 0 0 .7rem; }
.srv-info { flex: 1; min-width: 0; }
.srv-name { font-weight: 600; }
.srv-url { font-size: .82rem; color: var(--muted); font-family: monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srv-actions { display: flex; gap: .5rem; }
.srv-empty { text-align: center; padding: 2rem; color: var(--muted); border: 2px dashed var(--border); border-radius: .8rem; }
.srv-empty .big { font-size: 2.4rem; opacity: .4; margin-bottom: .5rem; }
.srv-default { font-size: .8rem; margin-top: .6rem; }
.admin-form { display: flex; gap: .8rem; align-items: center; margin-bottom: 1.6rem; flex-wrap: wrap; }
.admin-form .input { flex: 1 1 14rem; width: auto; }
.admin-cache { color: var(--muted); font-size: .85rem; }
.admin-help { color: var(--muted); font-size: .9rem; line-height: 1.8; margin-top: 1rem; }

/* ─── Login ─── */
.login-wrap { position: relative; height: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.login-wrap::before { content: ''; position: absolute; left: 0; top: 0; right: 0; bottom: 0; background: radial-gradient(ellipse 80% 60% at 15% 10%, rgba(232,57,42,.12) 0%, transparent 60%), radial-gradient(ellipse 60% 50% at 85% 90%, rgba(30,50,100,.18) 0%, transparent 60%); }
.login-bg-text { position: absolute; font-family: var(--font-d); font-size: 28vw; color: rgba(255,255,255,.02); letter-spacing: -.1em; top: 50%; left: 50%; transform: translate(-50%, -50%); white-space: nowrap; }
.login-box { position: relative; width: 100%; max-width: 28rem; background: rgba(12,16,24,.94); border: 1px solid var(--border); border-radius: 1.2rem; padding: 2.6rem 2.6rem 2.2rem; box-shadow: 0 2.5rem 5rem rgba(0,0,0,.6); animation: rise .5s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(1.5rem); } to { opacity: 1; transform: translateY(0); } }
.logo { font-family: var(--font-d); font-size: 3rem; letter-spacing: .1em; line-height: 1; }
.login-sub { color: var(--muted); font-size: .9rem; margin: .3rem 0 1.4rem; }
.accent-line { height: 2px; width: 2.5rem; background: var(--accent); border-radius: 1px; margin-bottom: .6rem; box-shadow: 0 0 .8rem rgba(232,57,42,.5); }
.login-box .btn.big { width: 100%; margin-top: 1.4rem; font-family: var(--font-d); font-size: 1.4rem; letter-spacing: .15em; }
.login-error { min-height: 1.4em; color: #f87171; font-size: .9rem; margin-top: .9rem; text-align: center; }
.login-note { color: var(--muted); font-size: .75rem; text-align: center; margin-top: 1rem; }

/* ─── Camadas (modais, PIN, player) ─── */
#layers { position: fixed; left: 0; top: 0; width: 0; height: 0; z-index: 100; }
.layer { position: fixed; left: 0; top: 0; right: 0; bottom: 0; }
.modal-layer { display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.82); animation: fade .15s ease; z-index: 200; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { width: 92%; max-width: 30rem; background: var(--card); border: 1px solid var(--border); border-radius: 1.2rem; padding: 2rem 2rem 1.6rem; text-align: center; box-shadow: 0 2rem 5rem rgba(0,0,0,.7); animation: pop .2s ease; }
@keyframes pop { from { transform: scale(.94); } to { transform: scale(1); } }
.modal-icon { font-size: 2.4rem; margin-bottom: .4rem; }
.modal-title { font-family: var(--font-d); font-size: 1.8rem; letter-spacing: .05em; margin-bottom: .4rem; }
.modal-text { color: var(--muted); font-size: .95rem; margin-bottom: 1.4rem; white-space: pre-line; }
.modal-btns { display: flex; gap: .7rem; justify-content: center; flex-wrap: wrap; }
.modal-form { text-align: left; margin-bottom: 1.4rem; }
.modal-form .label { margin-top: .8rem; }
.modal-form .input { font-size: .95rem; padding: .7rem .9rem; }
.modal-btns .btn { min-width: 8rem; }
.pin-dots { display: flex; gap: .9rem; justify-content: center; margin: .4rem 0 1.2rem; }
.pin-dot { width: 1.1rem; height: 1.1rem; border-radius: 50%; border: 2px solid var(--border); background: rgba(255,255,255,.05); }
.pin-dot.on { background: var(--accent); border-color: var(--accent); }
.pin-pad { display: flex; flex-wrap: wrap; width: 15rem; margin: 0 auto; gap: .5rem; }
.pin-key { width: 4.6rem; height: 3.4rem; flex: 0 0 4.6rem; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.06); border: 2px solid transparent; border-radius: .6rem; font-size: 1.3rem; font-weight: 600; }
.pin-key.pin-cancel { font-size: .75rem; color: var(--muted); }
.pin-key.focused { background: var(--focus); color: #000; transform: scale(1.06); }
.pin-error { color: #f87171; font-size: .85rem; min-height: 1.4em; margin-top: .8rem; }
.pin-box.shake { animation: shake .35s ease; }
@keyframes shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-.5rem); } 40% { transform: translateX(.5rem); } 60% { transform: translateX(-.35rem); } 80% { transform: translateX(.35rem); } }

/* ─── Player ─── */
.player { display: none; background: #000; z-index: 150; overflow: hidden; }
.player.open { display: block; }
.player.mini { border-radius: .8rem; border: 1px solid var(--border); z-index: 30; }
.player.mini.ui { z-index: 30; }
.player video { width: 100%; height: 100%; display: block; background: #000; object-fit: contain; }
.pl-loading { display: none; position: absolute; left: 0; top: 0; right: 0; bottom: 0; align-items: center; justify-content: center; flex-direction: column; gap: .8rem; background: rgba(0,0,0,.55); color: rgba(255,255,255,.7); font-size: .95rem; pointer-events: none; }
.pl-loading.show { display: flex; }
.player.mini .pl-loading { font-size: .8rem; }
.pl-error { display: none; position: absolute; left: 0; top: 0; right: 0; bottom: 0; align-items: center; justify-content: center; flex-direction: column; gap: .5rem; background: rgba(0,0,0,.85); color: #f87171; font-size: 1.05rem; text-align: center; padding: 1rem; }
.pl-error.show { display: flex; }
.pl-error-icon { font-size: 2.4rem; }
.pl-error-sub { color: var(--muted); font-size: .8rem; }
.pl-mini-hint { display: none; position: absolute; right: .6rem; bottom: .6rem; background: rgba(0,0,0,.6); color: #fff; font-size: .7rem; padding: .25rem .6rem; border-radius: .3rem; }
.player.mini .pl-mini-hint { display: block; }
.pl-ui { position: absolute; left: 0; top: 0; right: 0; bottom: 0; opacity: 0; pointer-events: none; transition: opacity .2s; }
.pl-ui.show { opacity: 1; pointer-events: auto; }
.player.mini .pl-ui { display: none; }
.pl-top { position: absolute; left: 0; top: 0; right: 0; padding: 1.6rem 2.4rem; display: flex; align-items: flex-start; justify-content: space-between; background: linear-gradient(180deg, rgba(0,0,0,.8), transparent); }
.pl-title { font-family: var(--font-d); font-size: 2rem; letter-spacing: .04em; line-height: 1.05; text-shadow: 0 .1rem .5rem rgba(0,0,0,.8); }
.pl-sub { color: rgba(255,255,255,.75); font-size: .95rem; margin-top: .2rem; }
.pl-top-tags { display: flex; align-items: center; gap: .5rem; }
.pl-live-tag { background: var(--accent); color: #fff; font-size: .75rem; font-weight: 700; letter-spacing: .1em; padding: .35rem .7rem; border-radius: .3rem; display: flex; align-items: center; gap: .4rem; }
.pl-live-tag::before { content: ''; width: .5rem; height: .5rem; background: #fff; border-radius: 50%; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
.pl-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.6rem 2.4rem 1.8rem; background: linear-gradient(0deg, rgba(0,0,0,.88), transparent); }
.pl-info { position: absolute; left: 50%; bottom: 9rem; transform: translateX(-50%); background: rgba(0,0,0,.7); padding: .5rem 1.2rem; border-radius: .5rem; font-size: 1.1rem; font-weight: 600; opacity: 0; transition: opacity .15s; }
.pl-info.show { opacity: 1; }
.pl-seek { position: relative; height: .5rem; background: rgba(255,255,255,.2); border-radius: 99px; margin-bottom: .9rem; border: 2px solid transparent; box-sizing: content-box; }
.pl-seek.focused { background: rgba(255,255,255,.3); border-color: var(--focus); }
.pl-seek-buf { position: absolute; left: 0; top: 0; height: 100%; background: rgba(255,255,255,.25); border-radius: 99px; }
.pl-seek-fill { position: absolute; left: 0; top: 0; height: 100%; background: var(--accent); border-radius: 99px; }
.pl-seek-knob { position: absolute; top: 50%; width: 1.2rem; height: 1.2rem; margin: -.6rem 0 0 -.6rem; border-radius: 50%; background: #fff; opacity: 0; transition: opacity .15s; left: 0; }
.pl-seek.focused .pl-seek-knob { opacity: 1; }
.pl-seek-fill + .pl-seek-knob { left: 0; }
.pl-bar { display: flex; align-items: center; gap: 1rem; }
.pl-time { font-variant-numeric: tabular-nums; font-size: 1rem; color: rgba(255,255,255,.85); min-width: 9rem; }
.pl-btns { display: flex; gap: .6rem; flex-wrap: wrap; flex: 1; justify-content: flex-end; }
.pl-btn { min-width: 3rem; height: 3rem; padding: 0 .9rem; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,.12); border: 2px solid transparent; border-radius: .6rem; font-size: 1.1rem; font-weight: 600; }
.pl-btn.focused { background: var(--focus); color: #000; transform: scale(1.08); }
.pl-epg { margin-top: 1rem; display: flex; flex-direction: column; gap: .4rem; }
.pl-epg-item { display: flex; align-items: center; gap: .8rem; font-size: .95rem; color: rgba(255,255,255,.8); flex-wrap: wrap; }
.pl-epg-item.now { color: #fff; font-weight: 600; }
.pl-epg-tag { font-size: .7rem; letter-spacing: .08em; background: rgba(255,255,255,.15); padding: .15rem .5rem; border-radius: .3rem; }
.pl-epg-item.now .pl-epg-tag { background: var(--accent); }
.pl-epg-time { color: rgba(255,255,255,.6); font-variant-numeric: tabular-nums; }
.pl-epg-title { flex: 1; min-width: 10rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-epg-bar { width: 100%; height: .25rem; background: rgba(255,255,255,.15); border-radius: 99px; overflow: hidden; }
.pl-epg-fill { height: 100%; background: var(--accent); }

/* ─── Boot / Toast ─── */
.boot { display: none; position: fixed; left: 0; top: 0; right: 0; bottom: 0; z-index: 500; background: var(--bg); align-items: center; justify-content: center; flex-direction: column; gap: 1.2rem; }
.boot.show { display: flex; }
.boot-logo { font-family: var(--font-d); font-size: 4rem; letter-spacing: .12em; }
.boot-msg { font-size: 1.2rem; }
.boot-sub { color: var(--muted); font-size: .9rem; }
#toast { position: fixed; left: 50%; bottom: 2.4rem; transform: translate(-50%, 1rem); z-index: 600; background: rgba(15,21,32,.96); border: 1px solid var(--border); border-radius: .7rem; padding: .8rem 1.4rem; font-size: 1rem; box-shadow: 0 .8rem 2rem rgba(0,0,0,.6); opacity: 0; transition: all .25s ease; pointer-events: none; max-width: 80%; text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ─── Telas estreitas (celular / tablet em pé) ─── */
@media (max-width: 900px) {
  html { font-size: calc(14px * var(--scale)); }
  .main { padding: 1.2rem 1rem 3rem; }
  #sidenav { flex-basis: 4rem; width: 4rem; }
  .browse-cats, .live-cats { flex-basis: 9rem; width: 9rem; }
  .cat-item { padding: .6rem .6rem; font-size: .85rem; }
  .live-side { display: none; }
  .live-head { padding: .8rem 1rem .4rem; }
  .live-head-title { font-size: 1.3rem; }
  .live-chs { padding: .2rem .6rem 3rem; }
  .ch-num { display: none; }
  .ch-row { gap: .6rem; padding: .4rem .5rem; }
  .ch-logo { width: 2.6rem; height: 2.6rem; flex-basis: 2.6rem; }
  .ch-name { font-size: .9rem; }
  .browse-main { padding: 1rem; }
  .card { width: 8.5rem; flex-basis: 8.5rem; }
  .grid .card { width: 8.5rem; flex-basis: 8.5rem; }
  .hero { flex-direction: column; align-items: flex-start; }
  .detail-content { flex-direction: column; align-items: center; text-align: center; padding: 2rem 1.2rem 1rem; }
  .detail-poster { width: 10rem; flex-basis: auto; padding-top: 15rem; }
  .detail-actions { justify-content: center; }
  .detail-episodes { padding: 0 1rem 3rem; }
  .pl-top, .pl-bottom { padding: 1rem; }
  .pl-title { font-size: 1.4rem; }
}
