/* ==========================================================================
   FLIX TV v2 — design tokens
   Base escura de propósito (ambiente de TV/sala escura, mesma lógica usada
   por Globoplay/Premiere/Netflix) + vermelho Flix como acento primário,
   âmbar como acento de "ao vivo". Assinatura visual: o NÚMERO do canal em
   tipografia gigante — é assim que o brasileiro navega em TV a cabo/IPTV
   ("muda pro 106"), não por capa de pôster (que nem existe pra canal linear).
   ========================================================================== */

:root {
  --ink: #0a0c0f;
  --ink-raise: #101319;
  --panel: #15181f;
  --panel-hover: #1c2029;
  --line: #242832;
  --line-soft: #1a1d24;

  --flix-red: #e63946;
  --flix-red-dim: #7a1620;
  --flix-red-glow: rgba(230, 57, 70, 0.35);
  --amber: #f2b134;
  --amber-dim: #6b4c14;

  --ink-text: #f2f3f5;
  --ink-soft: #9aa3af;
  --ink-faint: #5b626d;

  --danger: #ff5a5f;
  --ok: #3ecf8e;

  --radius: 10px;
  --radius-sm: 6px;

  --font-display: 'Barlow Condensed', sans-serif;
  --font-body: 'IBM Plex Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--ink-text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow: hidden; /* so a sidebar e o main-area rolam, nunca a pagina toda */
}
#app { height: 100%; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }
a { color: inherit; }

/* foco bem grosso e com brilho — pensado pra ser visto de longe (sofa),
 * navegando com controle remoto/D-pad, nao so com mouse/teclado */
:focus-visible {
  outline: 3px solid var(--flix-red);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--flix-red-glow);
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

.hidden { display: none !important; }

/* ===== MODO TV (Android TV / smart TV) — GPU fraca =====
 * Blur/backdrop-filter e sombras grandes travam a renderizacao da TV, e
 * animacoes/transicoes deixam a navegacao com lag. No modo TV desligamos tudo
 * isso: a interface fica instantanea. O layout/cores continuam iguais. */
html.tv-mode *, html.tv-mode *::before, html.tv-mode *::after {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
  filter: none !important;
  animation-duration: 0.001s !important;
  animation-delay: 0s !important;
  transition-duration: 0.001s !important;
  transition-delay: 0s !important;
}
/* overlays que dependiam do blur pra escurecer o fundo ganham fundo solido */
html.tv-mode .menu-fab { background: rgba(10,12,15,0.95) !important; }

/* FOCO visível no controle remoto — sem isto o usuário não vê onde está */
html.tv-mode :focus { outline: 3px solid var(--flix-red) !important; outline-offset: 2px; }
html.tv-mode .side-ch-row:focus, html.tv-mode .drawer-item:focus, html.tv-mode .tile:focus,
html.tv-mode .vod-card:focus, html.tv-mode .home-card:focus, html.tv-mode .home-thumb:focus,
html.tv-mode .home-logo-item:focus, html.tv-mode .home-radio:focus, html.tv-mode .home-more:focus,
html.tv-mode .guia-block:focus, html.tv-mode .guia-chip:focus, html.tv-mode .side-cat-head:focus,
html.tv-mode .pi-action:focus, html.tv-mode .epg-row:focus {
  outline: 3px solid var(--flix-red) !important; outline-offset: 2px; border-radius: 8px;
}
/* toast do botão Voltar */
#tv-toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%);
  background: rgba(0,0,0,0.9); color: #fff; padding: 12px 24px; border-radius: 999px;
  font-size: 16px; font-weight: 600; z-index: 99999; opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
}
#tv-toast.show { opacity: 1; }

/* Player NATIVO (Android): o vídeo é o TextureView ATRÁS da WebView. Enquanto
   toca, a página fica transparente na área do vídeo pra ele aparecer; os
   controles/overlays continuam por cima. Fora do player, tudo volta ao normal. */
html.native-playing, html.native-playing body,
html.native-playing .shell2, html.native-playing .main-area,
html.native-playing #main-area, html.native-playing .player-embed,
html.native-playing .vod-hero { background: transparent !important; }
html.native-playing #video, html.native-playing #gp-video { visibility: hidden !important; }

/* Guia de Programação no modo TV — timeline ~40-50% menor (fonte/blocos/logo
   grandes demais pra assistir de longe). Layout igual, só compacto. */
/* o bloco é absoluto com top/bottom + padding + gap: na TV isso não sobrava
   altura e CORTAVA o texto. Aqui a conta fecha (linha 66px → ~48px de conteúdo
   pra ~30px de texto), sem apertar a leitura de longe. */
html.tv-mode .guia-row-track { height: 66px; }
html.tv-mode .guia-block { top: 5px; bottom: 5px; padding: 4px 8px; gap: 2px; border-radius: 6px; }
html.tv-mode .gb-title { font-size: 11.5px; line-height: 1.2; }
html.tv-mode .gb-meta { font-size: 9px; line-height: 1.1; gap: 4px; }
html.tv-mode .gb-bar { height: 2px; margin-top: 1px; }
/* a coluna do logo tinha altura FIXA de 100px enquanto a linha do EPG ficou
   66px na TV — era isso que desalinhava logo/nome do conteúdo. */
html.tv-mode .guia-row-logo { height: 66px; padding: 4px 6px; gap: 2px; }
html.tv-mode .guia-row-logo img { max-width: 40px; max-height: 26px; }
html.tv-mode .guia-row-logo .gnum { font-size: 9px; top: 5px; left: 6px; }
html.tv-mode .guia-row-logo .gname { font-size: 9px; }
html.tv-mode .guia-ruler { height: 24px; }
html.tv-mode .guia-tick, html.tv-mode .guia-today { font-size: 9.5px; }
html.tv-mode .guia-loading, html.tv-mode .guia-empty { font-size: 10px; }
html.tv-mode .guia-select { font-size: 13px; padding: 6px 10px; }
/* Busca por nome de canal SAI na TV (digitar no controle é ruim e abria o
   teclado da TV). Vale pra Guia e pro painel "Canais" do rodapé. */
html.tv-mode #guia-search,
html.tv-mode #channels-search,
html.tv-mode .guia-controls .panel-search,
html.tv-mode #channels-panel .panel-search { display: none !important; }

/* Na TV não faz sentido: MAXIMIZAR (o vídeo já é tela cheia) nem VOLUME/MUDO
   (é no controle da TV). Some com eles no rodapé — do canal ao vivo e do VOD. */
html.tv-mode #btn-fullscreen,
html.tv-mode .pi-volume-group,
html.tv-mode #btn-mute,
html.tv-mode .pi-volume,
html.tv-mode #volume-slider { display: none !important; }
/* Play/Pause só desaparece no canal AO VIVO (lá não serve). No VOD ele FICA —
   é preciso pra dar play/pausar o filme. */
html.tv-mode #player-embed #btn-playpause,
html.tv-mode #player-embed #btn-center-playpause { display: none !important; }
/* seta de "voltar" da tela sai na TV: estava embolada com o ☰ e o controle já
   tem o botão Voltar fazendo esse papel */
html.tv-mode .player-back { display: none !important; }
/* qual canal está selecionado na Guia: realça a LINHA e o logo do canal focado */
html.tv-mode .guia-row:focus-within { background: rgba(230,57,70,0.10); }
html.tv-mode .guia-row:focus-within .guia-row-logo {
  background: rgba(230,57,70,0.22); box-shadow: inset 3px 0 0 var(--flix-red);
}
html.tv-mode .guia-block:focus, html.tv-mode .guia-chip:focus, html.tv-mode .guia-empty-click:focus {
  outline: 3px solid var(--flix-red) !important; outline-offset: -1px;
  background: rgba(230,57,70,0.28) !important; z-index: 5;
}

/* -------------------------------------------------------------------- */
/* LOGIN                                                                  */
/* -------------------------------------------------------------------- */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 24px;
  background:
    radial-gradient(680px 420px at 50% -10%, var(--flix-red-glow), transparent 70%),
    var(--ink);
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 40px 32px 32px;
  position: relative;
  z-index: 1;
  animation: rise 0.6s var(--ease) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.login-logo {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
  margin-bottom: 6px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 34px;
  letter-spacing: 0.01em;
}
.login-logo span:first-child { color: var(--ink-text); }
.login-logo span:last-child { color: var(--flix-red); }

.login-title {
  text-align: center; margin: 6px 0 4px;
  font-family: var(--font-display); font-weight: 800; font-size: 26px; color: #fff;
}
.login-sub {
  text-align: center;
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.5;
  margin: 0 0 24px;
}
.field-hint { margin: 7px 0 0; font-size: 12px; color: var(--ink-faint); letter-spacing: normal; text-transform: none; }

/* banner de instalar o app (PWA) — aparece pra quem ainda não instalou */
.install-banner {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 60;
  display: flex; align-items: center; gap: 12px;
  background: rgba(21,24,31,0.97); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px;
  box-shadow: 0 12px 32px -8px rgba(0,0,0,0.6);
  animation: ib-rise 0.35s var(--ease) both;
}
@keyframes ib-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.install-banner .ib-logo { height: 30px; flex: none; }
.install-banner .ib-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.install-banner .ib-text b { font-size: 14px; color: #fff; }
.install-banner .ib-text span { font-size: 12px; color: var(--ink-soft); line-height: 1.35; }
.install-banner .ib-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.ib-btn {
  background: transparent; border: 1px solid var(--line); color: var(--ink-soft);
  border-radius: 999px; padding: 9px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.ib-btn svg { width: 18px; height: 18px; }
.ib-btn.primary { background: var(--flix-red); border-color: var(--flix-red); color: #fff; }
.ib-btn.primary:hover { background: #d92d3a; }
@media (min-width: 640px) { .install-banner { left: auto; right: 20px; bottom: 20px; max-width: 420px; } }

.field {
  margin-bottom: 16px;
}
.field label {
  display: block;
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.field input {
  width: 100%;
  background: var(--ink-raise);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  color: var(--ink-text);
  font-size: 16px;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  transition: border-color 0.15s var(--ease);
}
.field input::placeholder { color: var(--ink-faint); font-family: var(--font-body); letter-spacing: normal; }
.field input:focus { border-color: var(--flix-red); outline: none; }

/* campo de senha com botao de mostrar/ocultar (olhinho) */
.field-pass { position: relative; }
.field-pass input { padding-right: 48px; }
.pass-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border: none; background: transparent; color: var(--ink-soft);
  display: flex; align-items: center; justify-content: center; cursor: pointer; border-radius: var(--radius-sm);
}
.pass-toggle:hover { color: var(--ink-text); }
.pass-toggle svg { width: 20px; height: 20px; }

.login-forgot {
  background: none; border: none; color: var(--ink-soft); font-size: 13px; cursor: pointer;
  padding: 4px; margin: 12px auto 0; display: block; text-decoration: underline;
}
.login-forgot:hover { color: var(--flix-red); }

.btn-primary {
  width: 100%;
  background: var(--flix-red);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s var(--ease), background 0.15s var(--ease);
  margin-top: 6px;
}
.btn-primary:hover { background: #d92d3a; }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.55; cursor: default; }

.login-error {
  background: rgba(255, 90, 95, 0.12);
  border: 1px solid rgba(255, 90, 95, 0.35);
  color: var(--danger);
  font-size: 13px;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 16px;
}

.login-foot {
  text-align: center;
  margin-top: 24px;
  font-size: 12px;
  color: var(--ink-faint);
}

/* -------------------------------------------------------------------- */
/* GUIA DE CANAIS                                                         */
/* -------------------------------------------------------------------- */
/* sem cabecalho fixo — so um botao flutuante pra abrir o menu. a marca,
 * o perfil e o "Sair" moraram pro topo do proprio menu lateral. */
.menu-fab {
  position: fixed; top: 10px; left: 10px; z-index: 45;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(10, 12, 15, 0.75); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.14); color: var(--ink-text); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.35s var(--ease), background 0.15s var(--ease);
}
.menu-fab:hover { background: rgba(20, 23, 28, 0.9); }
.menu-fab svg { width: 18px; height: 18px; }
.menu-fab.idle { opacity: 0; pointer-events: none; }

.sidebar2-head {
  position: relative; display: flex; align-items: center; justify-content: flex-end;
  padding: 18px 18px 14px; border-bottom: 1px solid var(--line-soft);
}
.sidebar2-head img { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.sidebar2-profile {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--line-soft);
  font-size: 14px; color: var(--ink-soft); cursor: pointer;
  transition: background 0.15s var(--ease);
}
.sidebar2-profile:hover { background: var(--panel); }
.profile-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.profile-name { font-size: 15px; font-weight: 600; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-hint { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--ink-faint); }
.profile-hint svg { width: 13px; height: 13px; }
.sidebar2-profile .avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: var(--flix-red-dim); color: var(--ink-text);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 16px;
}
.btn-ghost {
  background: transparent; border: 1px solid var(--line);
  color: var(--ink-soft); border-radius: var(--radius-sm);
  padding: 8px 14px; font-size: 13px; cursor: pointer;
  transition: all 0.15s var(--ease);
}
.btn-ghost:hover { border-color: var(--ink-soft); color: var(--ink-text); }

.icon-btn {
  background: transparent; border: none; color: var(--ink-text);
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; border-radius: var(--radius-sm); flex: none;
  transition: background 0.15s var(--ease);
}
.icon-btn:hover { background: var(--panel-hover); }
.icon-btn svg { width: 20px; height: 20px; }

.section-title {
  /* fica na MESMA linha do botao flutuante do menu (que e fixo no canto
   * superior esquerdo) — o padding lateral de 66px garante que o titulo
   * centralizado nunca passe por baixo do botao. */
  min-height: 58px; padding: 6px 66px 6px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 21px;
  color: var(--ink-text); text-align: center; line-height: 1.2;
}
.section-title .count { color: var(--ink-faint); font-family: var(--font-mono); font-size: 14px; font-weight: 400; margin-left: 8px; }

/* ---- layout: barra lateral em overlay (SEMPRE, nao fica fixa nem em
   telas largas) + area de conteudo ocupando 100% — fecha ao escolher
   canal/geral/streaming/guia, reabre pelo hamburguer -------------------- */
.shell2 { height: 100%; min-height: 0; position: relative; overflow: hidden; }
.shell2-body { display: flex; height: 100%; min-height: 0; position: relative; overflow: hidden; }

/* modo player: o botao de menu some sozinho por inatividade pra o canal
 * ocupar a tela inteira — nas outras telas ele fica sempre visivel. */

.sidebar2 {
  width: 440px; max-width: 86vw;
  background: var(--ink-raise); border-right: 1px solid var(--line);
  overflow-y: auto;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 46;
  transform: translateX(-100%);
  transition: transform 0.28s var(--ease);
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.sidebar2.open { transform: translateX(0); }
.sidebar2::-webkit-scrollbar { width: 8px; }
.sidebar2::-webkit-scrollbar-track { background: transparent; }
.sidebar2::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
.sidebar2::-webkit-scrollbar-thumb:hover { background: var(--ink-faint); }

.sidebar2-scrim {
  position: fixed; inset: 0; z-index: 44;
  background: rgba(0,0,0,0.55); opacity: 0; pointer-events: none;
  transition: opacity 0.25s var(--ease);
}
.sidebar2-scrim.open { opacity: 1; pointer-events: auto; }
.shell2:has(.sidebar2.open) .menu-fab { opacity: 0; pointer-events: none; }

.main-area { flex: 1; min-width: 0; min-height: 0; width: 100%; display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; }
/* CRITICO: numa coluna flex os filhos encolhem por padrao quando o
 * conteudo total passa da altura da tela — era isso que "cortava" as
 * pills de categoria, o titulo e as fileiras (em vez de a pagina rolar).
 * Nenhum filho direto do main-area pode encolher; quem rola e o main-area. */
.main-area > * { flex: none; }
/* excecoes: esses SIM devem esticar/rolar por dentro pra ocupar a tela */
.main-area > .player-embed,
.main-area > .guia-scroll,
.main-area > .vod-detail { flex: 1; min-height: 0; }

.side-cat-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 22px 13px 40px; cursor: pointer;
  font-size: 18px; color: var(--ink-soft);
  transition: all 0.15s var(--ease);
}
.side-cat-head .cat-emoji { font-size: 17px; line-height: 1; flex: none; width: 20px; text-align: center; }
.side-cat-head:hover { color: var(--ink-text); background: var(--panel); }
.side-cat-head .chev { margin-left: auto; transition: transform 0.2s var(--ease); color: var(--ink-faint); flex: none; }
.side-cat-head .chev svg { width: 16px; height: 16px; }
.side-cat-head .chev.open { transform: rotate(90deg); }

/* altura de abertura calculada via JS (scrollHeight) em vez de um teto
 * fixo — categorias grandes nao podem ficar cortadas nem travar o scroll */
/* accordion via CSS grid (0fr/1fr) em vez de max-height medido por JS —
 * se auto-ajusta ao conteudo real a qualquer momento (categoria enorme,
 * ou EPG que chega depois e deixa a linha mais alta), sem nunca cortar. */
.side-chlist {
  display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.35s var(--ease);
  background: rgba(0,0,0,0.18);
}
.side-chlist.open { grid-template-rows: 1fr; }
.side-chlist .schl-inner { overflow: hidden; min-height: 0; }

.side-ch-row {
  display: flex; gap: 13px; align-items: flex-start;
  padding: 13px 22px 13px 40px; cursor: pointer;
  border-left: 2px solid transparent;
  transition: background 0.15s var(--ease);
}
.side-ch-row:hover { background: var(--panel); }
.side-ch-row.active { border-left-color: var(--flix-red); background: var(--panel); }
.side-ch-row .logo {
  width: 46px; height: 46px; flex: none; border-radius: 8px;
  background: var(--ink); display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.side-ch-row .logo img { max-width: 36px; max-height: 32px; }
.side-ch-row .logo .fb { font-size: 8px; color: var(--ink-soft); text-align: center; padding: 2px; }
.side-ch-row .info { flex: 1; min-width: 0; padding-top: 1px; }
.side-ch-row .name { font-size: 15px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-ch-row .now { font-size: 13.5px; color: var(--ink-soft); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-ch-row .time { font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint); margin-top: 3px; }
.side-ch-row .bar { height: 3px; background: var(--line); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.side-ch-row .bar .fill { height: 100%; background: var(--flix-red); }

/* --------------------------------------------------------- Streaming/VOD
 * pôster real buscado no TMDB pelo título (a API da Flix não fornece capa
 * nenhuma — confirmado). Enquanto carrega/se o TMDB não achar o título, o
 * card cai pro visual estilizado (gradiente + monograma), nunca uma foto
 * fabricada. */
/* fileira de categorias — nunca tinha CSS nenhum (por isso saia cru/feio) */
.category-rail {
  display: flex; gap: 10px; overflow-x: auto; padding: 4px 28px 22px;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.pill {
  flex: none; background: var(--panel); border: 1px solid var(--line); color: var(--ink-soft);
  padding: 9px 18px; border-radius: 999px; font-family: var(--font-body); font-size: 13.5px; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: all 0.15s var(--ease);
}
.pill:hover { border-color: var(--ink-faint); color: var(--ink-text); }
.pill.active { background: var(--flix-red); border-color: var(--flix-red); color: #fff; }

.vod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 24px 18px; padding: 8px 28px 56px; }
.vod-card { cursor: pointer; display: flex; flex-direction: column; gap: 8px; }
.vod-poster {
  position: relative; aspect-ratio: 2 / 3; border-radius: 10px; overflow: hidden;
  box-shadow: 0 6px 16px -6px rgba(0,0,0,0.55);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.vod-poster::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background-image: repeating-linear-gradient(135deg, rgba(255,255,255,0.06) 0 2px, transparent 2px 26px);
  mix-blend-mode: overlay;
}
.vod-poster.has-image::before { display: none; }
.vod-poster-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0;
  opacity: 0; animation: vod-poster-fadein 0.35s var(--ease) forwards;
}
@keyframes vod-poster-fadein { to { opacity: 1; } }
.vod-initial {
  position: absolute; top: -0.12em; left: 50%; transform: translateX(-50%);
  font-family: var(--font-display); font-weight: 800; font-size: 6.6rem; line-height: 1;
  color: rgba(255,255,255,0.16); letter-spacing: -0.02em; user-select: none;
}
.vod-poster.has-image .vod-initial { display: none; }
.vod-card:hover .vod-poster { transform: translateY(-6px) scale(1.045); box-shadow: 0 18px 34px -8px rgba(0,0,0,0.6); z-index: 3; }
.vod-badge-top { position: absolute; top: 8px; right: 8px; z-index: 2; }
.vod-play-btn {
  position: absolute; top: 40%; left: 50%; margin: 0; width: 50px; height: 50px; border-radius: 50%;
  background: rgba(10,12,15,0.6); backdrop-filter: blur(2px); border: 2px solid rgba(255,255,255,0.85); color: #fff;
  display: flex; align-items: center; justify-content: center; z-index: 2; cursor: pointer;
  transform: translate(-50%, -50%) scale(0.7); opacity: 0;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.vod-play-btn svg { width: 20px; height: 20px; margin-left: 3px; }
.vod-card:hover .vod-play-btn { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.vod-title-line {
  font-family: var(--font-display); font-weight: 700; font-size: 14.5px; line-height: 1.25;
  color: var(--ink-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vod-sub {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.02em; color: var(--ink-faint);
  padding: 0 2px; min-height: 1.2em;
}
.tmdb-attribution { padding: 4px 28px 32px; font-size: 11px; color: var(--ink-faint); }
.tmdb-attribution a { color: var(--ink-soft); }

/* --------------------------------------------------- pagina de detalhes VOD
 * video tocando embutido (nao mais tela cheia de cara) + sinopse completa,
 * elenco e opções reais de player (play/pausa/parar/volume/dublagem quando
 * o stream tiver mais de 1 faixa/tela cheia). */
.vod-detail { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; }
.vod-hero {
  position: relative; width: 100%; aspect-ratio: 16/9; max-height: 62vh; background: #000; flex: none;
}
.vod-hero video { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; background: #000; }
/* ARTE DO FILME: fica atrás, do meio pra cima, e se dissolve na sinopse.
 * Enquanto o filme não começa o <video> fica invisível pra não tapar a arte. */
.vod-hero-art {
  position: absolute; inset: 0; z-index: 0; opacity: 0;
  background-size: cover; background-position: center 18%; background-repeat: no-repeat;
  transition: opacity 0.35s var(--ease);
}
.vod-hero.has-art .vod-hero-art { opacity: 1; }
.vod-hero-art::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, var(--ink) 0%, rgba(10,12,15,0.82) 20%, rgba(10,12,15,0.35) 55%, rgba(10,12,15,0.1) 100%);
}
.vod-hero.has-art:not(.playing) video { opacity: 0; }
.vod-hero.playing .vod-hero-art { opacity: 0; }

.vod-hero-top { position: absolute; top: 0; left: 0; padding: 16px; z-index: 3; transition: opacity 0.25s ease; }
.vod-hero-top.idle { opacity: 0; pointer-events: none; }
.vod-hero-controls {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  display: flex; flex-direction: column; gap: 8px; padding: 14px 20px;
  background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
  transition: opacity 0.25s ease;
}
.vod-hero-controls.idle { opacity: 0; pointer-events: none; }
.vod-btn-row { display: flex; align-items: center; gap: 10px; }
.vod-hero-controls .spacer { flex: 1; }

/* barra de progresso do filme */
.vod-seek-row { display: flex; align-items: center; gap: 10px; }
.vod-time { font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft); min-width: 46px; text-align: center; }
.vod-seek {
  flex: 1; height: 6px; border-radius: 999px; background: rgba(255,255,255,0.22);
  cursor: pointer; position: relative;
}
.vod-seek-fill { height: 100%; border-radius: 999px; background: var(--flix-red); width: 0; }
.vod-seek:focus-visible, .vod-seek:focus { outline: 3px solid var(--flix-red); outline-offset: 5px; }

/* ASSISTINDO: o vídeo toma a tela e a sinopse sai da frente */
.vod-detail.watching { overflow: hidden; }
.vod-detail.watching .vod-detail-body { display: none; }
.vod-detail.watching .vod-hero { max-height: none; aspect-ratio: auto; flex: 1; min-height: 0; }
.vod-audio-tracks { display: flex; gap: 6px; }
.audio-track-btn {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.2); color: #e4e6e9;
  padding: 8px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: all 0.15s var(--ease);
}
.audio-track-btn.active { background: var(--flix-red); border-color: var(--flix-red); color: #fff; }
.player-back {
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.25); color: #fff;
  width: 42px; height: 42px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s var(--ease);
}
.player-back svg { width: 18px; height: 18px; }
.player-back:hover { background: rgba(255,255,255,0.2); }

.vod-detail-body { padding: 24px 32px 48px; max-width: 900px; }
.vod-detail-title { margin: 0 0 12px; font-family: var(--font-display); font-weight: 800; font-size: clamp(24px, 3vw, 34px); color: #fff; }
.vod-detail-badges {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px;
  font-family: var(--font-mono); font-size: 13px; color: var(--ink-soft);
}
.vod-detail-synopsis { font-size: 15px; line-height: 1.65; color: var(--ink-text); margin: 0 0 18px; }
.vod-detail-meta { font-size: 13.5px; color: var(--ink-soft); line-height: 1.7; }
.vod-detail-meta b { color: var(--ink-text); font-weight: 600; }

/* ------------------------------------- classificação indicativa (selo) --
 * usado no Guia de programação e nos cards de Streaming. Cores seguem a
 * convenção oficial de faixa etária brasileira. */
.gb-rating {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 4px; flex: none;
  font-family: var(--font-mono); font-weight: 700; font-size: 11px; line-height: 1;
  color: #0a0c0f;
}
.gb-rating.rating-l { background: #2fbf82; }
.gb-rating.rating-10 { background: #4d8fe6; color: #fff; }
.gb-rating.rating-12 { background: #f2c94c; }
.gb-rating.rating-14 { background: #f2994c; }
.gb-rating.rating-16 { background: #e6544d; color: #fff; }
.gb-rating.rating-18 { background: #1a1a1a; color: #ff5a5f; border: 1px solid #ff5a5f; }

/* -------------------------------------------------- Guia de programação
 * grade estilo timeline: coluna de logos fixa + trilhas horizontais com
 * blocos de programa posicionados em pixel-por-minuto. */
.guia-preview {
  display: flex; gap: 20px; padding: 16px 24px; margin: 0 28px 18px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
/* mini-player de verdade (video ao vivo mudo) com a logo do canal como
 * selo no canto — igual referencia MULT */
.gp-thumb {
  position: relative; width: 336px; height: 192px; flex: none; border-radius: 8px; overflow: hidden;
  background: var(--ink); display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: transform 0.15s var(--ease);
}
.gp-thumb:hover { transform: scale(1.03); }
.gp-locked {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  width: 100%; height: 100%; padding: 12px; text-align: center; font-size: 30px; color: #fff;
  background: repeating-linear-gradient(45deg, #1a1114, #1a1114 10px, #241419 10px, #241419 20px);
}
.gp-locked span { font-size: 14px; font-weight: 700; }
.gp-locked small { font-size: 11px; color: var(--ink-soft); font-weight: 400; }
.gp-thumb video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gp-thumb img { max-width: 78%; max-height: 68%; object-fit: contain; }
.gp-thumb-logo {
  position: absolute; left: 10px; bottom: 10px; width: 48px; height: 48px; border-radius: 8px;
  background: rgba(10,12,15,0.75); display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.gp-thumb-logo img { max-width: 36px; max-height: 32px; }
.gp-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; justify-content: center; }
.gp-badges { display: flex; align-items: center; gap: 10px; min-height: 22px; }
.gp-watch-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--flix-red); color: #fff; border: none; border-radius: 999px;
  font-size: 12.5px; font-weight: 700; padding: 6px 14px 6px 12px; cursor: pointer;
  transition: background 0.15s var(--ease);
}
.gp-watch-btn svg { width: 13px; height: 13px; }
.gp-watch-btn:hover { background: #d92d3a; }
.gp-title { font-family: var(--font-display); font-weight: 700; font-size: 24px; color: #fff; line-height: 1.15; }
.gp-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-soft); }
.gp-time { color: var(--ink-text); }
.gp-chan { color: var(--ink-faint); }
.gp-desc { font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; max-width: 900px; }

.guia-controls { display: flex; align-items: center; gap: 12px; padding: 0 28px 14px; flex-wrap: wrap; }
.guia-controls .panel-search { margin: 0; max-width: 280px; flex: 1; min-width: 160px; }
.guia-select {
  background: var(--panel); border: 1px solid var(--line); color: var(--ink-text);
  border-radius: var(--radius-sm); padding: 9px 14px; font-family: var(--font-body); font-size: 16px;
  cursor: pointer;
}
.guia-select:focus { outline: none; border-color: var(--flix-red); }

/* paginador de janela de horário — texto claro em vez de setas soltas
 * flutuando sobre a régua (onde colidiam com os horários) */
.guia-pager { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.guia-pager-btn {
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel); border: 1px solid var(--line); color: var(--ink-text);
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.guia-pager-btn:hover { background: var(--flix-red); border-color: var(--flix-red); color: #fff; }
.guia-pager-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.guia-pager-btn:disabled:hover { background: var(--panel); border-color: var(--line); color: var(--ink-text); }
.guia-pager-btn svg { width: 15px; height: 15px; }

.guia-scroll { position: relative; flex: 1; min-height: 0; overflow: auto; margin: 0 28px 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--ink-raise); cursor: grab; }
.guia-scroll.dragging { cursor: grabbing; user-select: none; }

.guia-ruler { position: sticky; top: 0; z-index: 4; height: 36px; background: var(--panel); border-bottom: 1px solid var(--line); }
.guia-today {
  position: absolute; left: 0; top: 0; width: 176px; height: 100%; z-index: 5;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-weight: 700; font-size: 11px; letter-spacing: 0.08em; color: var(--ink-faint);
  background: var(--panel); border-right: 1px solid var(--line);
}
.guia-ruler-inner { position: relative; height: 100%; }
.guia-tick {
  position: absolute; top: 0; height: 100%; display: flex; align-items: center;
  padding-left: 10px; font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft);
  border-left: 1px solid var(--line-soft);
}

/* filha do .guia-grid (nao do .guia-scroll) de proposito: assim a altura
 * (top:0;bottom:0) acompanha TODAS as linhas de canal, nao so a parte
 * visivel na tela — a linha atravessa a pagina inteira do EPG. */
.guia-nowmark {
  position: absolute; top: 0; bottom: 0; width: 4px; z-index: 6;
  background: var(--flix-red); box-shadow: 0 0 14px var(--flix-red-glow); pointer-events: none;
}
.guia-nowmark .flag {
  position: sticky; top: 6px; display: inline-block; transform: translateX(-50%);
  background: var(--flix-red); color: #fff; font-family: var(--font-mono); font-weight: 700;
  font-size: 9.5px; letter-spacing: 0.06em; padding: 3px 6px; border-radius: 4px; white-space: nowrap;
}

.guia-grid { position: relative; }
.guia-row { display: flex; border-bottom: 1px solid var(--line-soft); }
/* pisca rapido pra achar de relance a linha do canal que vc estava
 * assistindo, ao entrar no guia vindo do player */
.guia-row.focus-flash .guia-row-logo { animation: guia-focus-flash-logo 1.6s ease-out; }
.guia-row.focus-flash .guia-row-track { animation: guia-focus-flash-track 1.6s ease-out; }
@keyframes guia-focus-flash-logo {
  0%, 40% { background: rgba(230, 57, 70, 0.5); }
  100% { background: var(--panel); }
}
@keyframes guia-focus-flash-track {
  0%, 40% { background: rgba(230, 57, 70, 0.28); }
  100% { background: transparent; }
}
.guia-row-logo {
  position: sticky; left: 0; z-index: 2; flex: none; height: 100px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 10px 8px;
  background: var(--panel); border-right: 1px solid var(--line); text-align: center;
}
.guia-row-logo .gnum { position: absolute; top: 8px; left: 10px; font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-faint); }
.guia-row-logo img { max-width: 72px; max-height: 46px; object-fit: contain; }
.guia-row-logo .fallback { font-size: 10.5px; color: var(--ink-soft); line-height: 1.2; font-weight: 600; }
.guia-row-logo .gname { font-size: 11px; color: var(--ink-soft); line-height: 1.2; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guia-row-track { position: relative; height: 100px; flex: none; }
.guia-loading, .guia-empty { position: absolute; inset: 0; display: flex; align-items: center; padding-left: 16px; font-size: 13px; color: var(--ink-faint); }
.guia-empty-click { cursor: pointer; transition: background 0.15s var(--ease), color 0.15s var(--ease); }
.guia-empty-click:hover { background: var(--panel-hover); color: var(--ink-text); }

.guia-block {
  position: absolute; top: 8px; bottom: 8px; overflow: hidden;
  background: var(--panel-hover); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; justify-content: center; gap: 6px;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.15s var(--ease);
}
.guia-block:hover { background: var(--line); border-color: var(--ink-faint); transform: translateY(-1px); }
.guia-block.now { background: rgba(230, 57, 70, 0.16); border-color: var(--flix-red); }
.gb-title { font-family: var(--font-body); font-weight: 600; font-size: 14px; color: #fff; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gb-meta { display: flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gb-dot { color: var(--ink-faint); }
.guia-block.now .gb-meta { color: #f0a9ae; }
.gb-bar { height: 3px; background: rgba(255,255,255,0.16); border-radius: 2px; overflow: hidden; margin-top: 2px; }
.gb-bar .fill { height: 100%; background: var(--flix-red); }

/* --------------------------------------------------------------- mobile
 * abaixo de 720px a grade em pixels vira uma lista vertical: canal em
 * cima, "agora" + próximos como cartões — sem timeline pra arrastar. */
@media (max-width: 720px) {
  .guia-preview { flex-direction: column; margin: 0 14px 16px; }
  .gp-thumb { width: 100%; height: auto; aspect-ratio: 16/9; }
  .guia-controls { padding: 0 14px 12px; }
  .guia-scroll { margin: 0 14px 16px; overflow: visible; }
  .guia-scroll.is-mobile { background: none; border: none; }
  .guia-scroll.is-mobile .guia-grid { display: flex; flex-direction: column; gap: 14px; }
  .guia-scroll.is-mobile .guia-row {
    flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--ink-raise); overflow: hidden; border-bottom: 1px solid var(--line);
  }
  .guia-scroll.is-mobile .guia-row-logo {
    position: static; flex-direction: row; justify-content: flex-start; height: auto;
    padding: 12px 14px; border-right: none; border-bottom: 1px solid var(--line); background: var(--panel);
  }
  .guia-scroll.is-mobile .guia-row-logo .gnum { position: static; margin-right: 4px; }
  .guia-scroll.is-mobile .guia-row-logo img { max-width: 40px; max-height: 32px; }
  .guia-scroll.is-mobile .guia-row-logo .gname { font-size: 14px; font-weight: 600; color: #fff; white-space: normal; }
  .guia-scroll.is-mobile .guia-row-track { height: auto; display: flex; flex-direction: column; padding: 10px; gap: 8px; }
  .guia-chip {
    border-radius: 8px; padding: 10px 12px; background: var(--panel-hover); border: 1px solid var(--line);
    display: flex; flex-direction: column; gap: 5px; cursor: pointer;
  }
  .guia-chip.now { background: rgba(230, 57, 70, 0.16); border-color: var(--flix-red); }
  .guia-chip .gb-title { white-space: normal; font-size: 14.5px; }
  .guia-chip .gb-meta { white-space: normal; }
  .guia-chip.now .gb-meta { color: #f0a9ae; }
}

/* ---- menu lateral (drawer) ------------------------------------------ */
.drawer-scrim {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  z-index: 39; opacity: 0; pointer-events: none;
  transition: opacity 0.25s var(--ease);
}
.drawer-scrim.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed; top: 0; left: 0; bottom: 0; width: 300px; max-width: 84vw;
  background: var(--ink-raise); border-right: 1px solid var(--line);
  z-index: 40; transform: translateX(-100%);
  transition: transform 0.28s var(--ease);
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }

.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 16px 14px 22px; border-bottom: 1px solid var(--line-soft);
}
.drawer-head .brand { font-family: var(--font-display); font-weight: 800; font-size: 20px; }
.drawer-head .brand span { color: var(--flix-red); }

.drawer-body { flex: 1; overflow-y: auto; padding: 8px 0 24px; }

.drawer-item {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 22px; cursor: pointer; user-select: none;
  color: var(--ink-text); font-size: 19px; font-weight: 500;
  transition: background 0.15s var(--ease);
}
.drawer-item svg { width: 21px; height: 21px; flex: none; color: var(--ink-soft); }
.drawer-item:hover { background: var(--panel); }
.drawer-item.active { background: var(--flix-red-dim); color: #fff; }
.drawer-item.active svg { color: #fff; }
.drawer-item .chev { margin-left: auto; transition: transform 0.2s var(--ease); color: var(--ink-faint); }
.drawer-item .chev.open { transform: rotate(90deg); }

/* mostra/esconde direto (sem animar altura) — e so o wrapper das
 * categorias, nao precisa do efeito de slide, e assim nunca corta nada
 * independente de quantas categorias/canais existirem */
.drawer-sub { display: none; }
.drawer-sub.open { display: block; }

.cat-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 22px 10px 40px; cursor: pointer;
  font-size: 14px; color: var(--ink-soft);
  border-left: 2px solid transparent;
  transition: all 0.15s var(--ease);
}
.cat-item .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); flex: none; }
.cat-item:hover { color: var(--ink-text); }
.cat-item.active { color: #fff; border-left-color: var(--flix-red); background: var(--panel); }
.cat-item.active .dot { background: var(--flix-red); }

/* ---- EPG (guia de programação) ---------------------------------------- */
.epg-list { padding: 10px 28px 48px; display: flex; flex-direction: column; gap: 8px; }

.epg-row {
  display: flex; align-items: center; gap: 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px; cursor: pointer;
  transition: border-color 0.15s var(--ease), transform 0.15s var(--ease);
}
.epg-row:hover { border-color: var(--flix-red); transform: translateX(2px); }

.epg-num { font-family: var(--font-display); font-weight: 800; font-size: 22px; color: var(--ink-faint); width: 36px; text-align: center; flex: none; }
.epg-logo { width: 69px; height: 69px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--ink-raise); border-radius: var(--radius-sm); }
.epg-logo img { max-width: 51px; max-height: 45px; }
.epg-logo .fallback { font-size: 9px; color: var(--ink-soft); text-align: center; padding: 4px; }

.epg-info { flex: 1; min-width: 0; }
.epg-title { font-size: 16px; font-weight: 600; color: var(--ink-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.epg-time { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }
.epg-bar { height: 3px; background: var(--line); border-radius: 2px; margin-top: 7px; overflow: hidden; }
.epg-bar .fill { height: 100%; background: var(--flix-red); }
.epg-skel { color: var(--ink-faint); font-size: 12px; font-style: italic; }

/* ------------------------------------------------------------------ Início
 * carrosseis horizontais estilo Netflix/MULT, com a paleta da Flix TV. */
/* ---------------------------------------------- banner grande (Prime-style)
 * imagem widescreen real do titulo + degrade + titulo/nota/sinopse/botoes */
.home-hero {
  position: relative; width: 100%; aspect-ratio: 16 / 7; max-height: 60vh;
  min-height: 260px; overflow: hidden; background: var(--ink-raise);
  display: flex; align-items: flex-end;
}
.home-hero-img {
  position: absolute; inset: 0; background-size: cover; background-position: center 20%;
  transition: opacity 0.5s var(--ease);
}
.home-hero-shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to top, var(--ink) 2%, rgba(10,12,15,0.55) 38%, rgba(10,12,15,0.1) 70%),
    linear-gradient(to right, rgba(10,12,15,0.9) 0%, rgba(10,12,15,0.35) 55%, transparent 85%);
}
.home-hero-content {
  position: relative; z-index: 1; padding: 0 28px 30px; max-width: 640px;
  display: flex; flex-direction: column; gap: 10px;
}
.home-hero-title {
  margin: 0; font-family: var(--font-display); font-weight: 800;
  font-size: clamp(26px, 4vw, 46px); line-height: 1.05; color: #fff;
  text-shadow: 0 2px 16px rgba(0,0,0,0.6);
}
.home-hero-meta {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-mono); font-size: 13px; color: #d7dade;
}
.home-hero-meta .hero-score { color: var(--amber); font-weight: 700; }
.home-hero-desc {
  margin: 0; font-size: 14px; line-height: 1.55; color: #d7dade;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  text-shadow: 0 1px 8px rgba(0,0,0,0.5);
}
.home-hero-actions { display: flex; gap: 10px; margin-top: 4px; flex-wrap: wrap; }
.hero-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.28); color: #fff;
  padding: 11px 20px; border-radius: 6px; font-size: 14px; font-weight: 700; cursor: pointer;
  transition: all 0.15s var(--ease);
}
.hero-btn svg { width: 15px; height: 15px; }
.hero-btn:hover { background: rgba(255,255,255,0.24); }
.hero-btn.primary { background: var(--flix-red); border-color: var(--flix-red); }
.hero-btn.primary:hover { background: #d92d3a; }
.home-hero-dots {
  position: absolute; z-index: 2; bottom: 12px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 7px;
}
.hero-dot {
  width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,0.35);
  cursor: pointer; transition: all 0.2s var(--ease);
}
.hero-dot.active { background: #fff; width: 20px; border-radius: 4px; }

/* atalhos no topo da Início, estilo as pills do Prime */
.home-nav-pills { display: flex; gap: 10px; overflow-x: auto; padding: 18px 28px 20px; scrollbar-width: none; }
.home-nav-pills::-webkit-scrollbar { display: none; }

.home-row { margin-bottom: 30px; }
.home-row-title {
  font-family: var(--font-display); font-weight: 700; font-size: 20px; color: var(--ink-text);
  padding: 0 28px 14px;
}
.home-carousel {
  display: flex; gap: 14px; overflow-x: auto; padding: 4px 28px 8px;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}

/* --- CARTÃO de assistido recentemente: marca grande, nome + número --- */
.home-card {
  flex: none; width: 186px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 14px;
  transition: border-color 0.15s var(--ease), transform 0.15s var(--ease);
}
.home-card:hover, .home-card:focus { border-color: var(--flix-red); transform: translateY(-2px); }
.home-card-logo { height: 62px; display: flex; align-items: center; justify-content: center; }
.home-card-logo img { max-width: 78%; max-height: 100%; object-fit: contain; }
.home-card-logo .fallback { font-size: 12px; color: var(--ink-soft); text-align: center; }
.home-card-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.home-card-name {
  font-size: 13px; font-weight: 600; color: var(--ink-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.home-card:hover .home-card-name, .home-card:focus .home-card-name { color: var(--flix-red); }
.home-card-tag { flex: none; font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-faint); }

/* --- PAINEL da categoria: as marcas soltas dentro de uma caixa --- */
.home-panel {
  margin: 0 28px; background: var(--ink-raise); border: 1px solid var(--line-soft);
  border-radius: 14px; padding: 22px 8px 20px;
}
.home-panel .home-carousel { padding: 0 16px; gap: 26px; }
.home-logo-item {
  flex: none; width: 94px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.home-logo-item .logo { width: 100%; height: 54px; display: flex; align-items: center; justify-content: center; }
.home-logo-item .logo img {
  max-width: 100%; max-height: 100%; object-fit: contain;
  transition: transform 0.15s var(--ease);
}
.home-logo-item:hover .logo img, .home-logo-item:focus .logo img { transform: scale(1.09); }
.home-logo-item .logo .fallback { font-size: 11px; color: var(--ink-soft); text-align: center; }
.home-logo-item .nome {
  max-width: 100%; font-size: 12.5px; color: var(--ink-soft); text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.home-logo-item:hover .nome, .home-logo-item:focus .nome { color: #fff; }

/* --- RÁDIO: cartão horizontal --- */
.home-radio {
  flex: none; min-width: 212px; cursor: pointer;
  display: flex; align-items: center; gap: 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px 12px 12px;
  transition: border-color 0.15s var(--ease);
}
.home-radio:hover, .home-radio:focus { border-color: var(--flix-red); }
.home-radio .logo {
  flex: none; width: 46px; height: 46px; border-radius: 8px; background: var(--ink);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.home-radio .logo img { max-width: 84%; max-height: 84%; object-fit: contain; }
.home-radio .logo .fallback { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.home-radio .txt { min-width: 0; }
.home-radio .txt .n {
  font-size: 13px; font-weight: 700; color: var(--ink-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.home-radio .txt .s { font-size: 11.5px; color: var(--ink-faint); margin-top: 2px; }

/* --- MINIATURA 16:9 do filme --- */
.home-thumb { flex: none; width: 232px; cursor: pointer; display: flex; flex-direction: column; gap: 9px; }
.home-thumb .art {
  position: relative; aspect-ratio: 16/9; border-radius: 8px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s var(--ease);
}
.home-thumb:hover .art, .home-thumb:focus .art { transform: translateY(-3px); }
.home-thumb .art .ini {
  font-family: var(--font-display); font-size: 40px; font-weight: 800; color: rgba(255,255,255,0.35);
}
.home-thumb .art.has-image .ini { display: none; }
.home-thumb-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.home-thumb-title {
  font-size: 13.5px; font-weight: 600; color: var(--ink-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.home-thumb-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--ink-faint);
}

/* --- VER MAIS: cartão com seta, acende no foco --- */
.home-more {
  flex: none; align-self: stretch; min-width: 104px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; color: var(--ink-soft);
  transition: all 0.15s var(--ease);
}
.home-more:hover, .home-more:focus {
  border-color: var(--flix-red); color: #fff; background: rgba(230, 57, 70, 0.14);
}
.home-more svg { width: 20px; height: 20px; }
.home-more span { font-size: 12.5px; font-weight: 600; }
.home-panel .home-more { background: var(--panel); min-width: 94px; }

.channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  padding: 8px 28px 48px;
}

.tile {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  aspect-ratio: 1 / 1;
  cursor: pointer;
  overflow: hidden;
  display: flex; flex-direction: column;
  animation: fadein 0.5s var(--ease) both;
  transition: transform 0.15s var(--ease), border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.tile:hover, .tile:focus-visible {
  transform: translateY(-3px);
  border-color: var(--flix-red);
  box-shadow: 0 10px 24px -8px var(--flix-red-glow);
}

.tile .num {
  position: absolute; top: 6px; left: 10px;
  font-family: var(--font-display); font-weight: 800;
  font-size: 26px; line-height: 1;
  color: var(--ink-faint);
  z-index: 1;
}
.tile:hover .num { color: var(--flix-red); }

.tile .logo-wrap {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 30px 16px 8px;
}
.tile .logo-wrap img { max-height: 56px; width: auto; margin: 0 auto; }
.tile .logo-wrap .fallback {
  font-family: var(--font-body); font-weight: 600; font-size: 12px;
  color: var(--ink-soft); text-align: center; line-height: 1.3;
}

.tile .live-row {
  display: flex; align-items: center; gap: 6px;
  padding: 0 10px 10px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.04em;
  color: var(--ink-faint);
}
.tile .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ink-faint);
}
.tile.is-live .dot {
  background: var(--amber);
  animation: pulse 1.6s ease-in-out infinite;
}
.tile.is-live .live-row { color: var(--amber); }
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(242,177,52,0.5); }
  50% { opacity: 0.55; box-shadow: 0 0 0 4px rgba(242,177,52,0); }
}

.empty-state, .loading-state {
  padding: 80px 28px; text-align: center; color: var(--ink-soft);
}
.loading-state .spinner {
  width: 28px; height: 28px; margin: 0 auto 16px;
  border: 3px solid var(--line); border-top-color: var(--flix-red);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* -------------------------------------------------------------------- */
/* PLAYER                                                                 */
/* -------------------------------------------------------------------- */
/* embutido dentro de #main-area (ao lado da barra lateral, nao mais
 * um overlay de tela cheia) — a sidebar continua visivel/usavel junto */
.player-embed {
  position: relative; flex: 1; min-height: 0; background: #000; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.player-embed video { width: 100%; height: 100%; object-fit: contain; background: #000; }

.player-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end;
  opacity: 1; transition: opacity 0.3s var(--ease);
  background: linear-gradient(to bottom, rgba(0,0,0,0.65) 0%, transparent 18%, transparent 75%, rgba(0,0,0,0.75) 100%);
  pointer-events: none;
}
.player-overlay.idle { opacity: 0; }
.player-overlay * { pointer-events: auto; }

/* botao central de play/pause, aparece com o resto do overlay */
.player-center-btn {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 78px; height: 78px; border-radius: 50%;
  background: rgba(0,0,0,0.4); border: 2px solid rgba(255,255,255,0.25); color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.15s var(--ease), transform 0.15s var(--ease);
}
.player-center-btn svg { width: 30px; height: 30px; }
.player-center-btn:hover { background: rgba(0,0,0,0.55); transform: translate(-50%, -50%) scale(1.06); }

.player-info {
  padding: 28px 40px 34px;
  display: flex; flex-direction: column; gap: 14px;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.5) 60%, transparent 100%);
}

.pi-channel {
  display: flex; align-items: center; gap: 12px;
  font-size: 16px; color: #e4e6e9; font-weight: 500;
}
.pi-channel .logo { width: 102px; height: 102px; object-fit: contain; border-radius: 10px; background: rgba(255,255,255,0.08); padding: 6px; }
.pi-channel .num {
  color: #fff; font-weight: 800; font-family: var(--font-display); letter-spacing: 0.02em; font-size: 54px;
  /* sombra dupla (contorno escuro + halo) — mantem legivel mesmo se o
   * video atras tiver fundo claro naquele instante */
  text-shadow: 0 0 3px rgba(0,0,0,0.9), 0 0 14px rgba(0,0,0,0.85), 0 2px 6px rgba(0,0,0,0.9);
}
.pi-channel .sep { color: var(--ink-faint); }

.pi-title {
  font-family: var(--font-display); font-weight: 800; font-size: clamp(24px, min(5.2vw, 7vh), 54px);
  color: #fff; line-height: 1.03; text-wrap: balance;
  text-shadow: 0 2px 18px rgba(0,0,0,0.5);
}

.pi-badges { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.badge-live {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--flix-red); color: #fff; font-size: 14px; font-weight: 700;
  letter-spacing: 0.05em; padding: 7px 16px; border-radius: 999px;
}
.badge-live .dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: pulse 1.6s ease-in-out infinite; }
.badge-rating {
  background: var(--amber); color: #201400; font-weight: 800; font-size: 15px;
  width: 30px; height: 30px; border-radius: 6px; display: flex; align-items: center; justify-content: center;
}
.pi-endtime { font-size: 16px; color: #e4e6e9; }
.pi-clock { font-family: var(--font-mono); font-size: 14px; color: var(--ink-soft); letter-spacing: 0.02em; }
.pi-viewers {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600;
  color: #fff; background: rgba(255,255,255,0.12); padding: 4px 10px; border-radius: 999px;
}
.pi-viewers::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--flix-red); }

.pi-progress { display: flex; align-items: center; gap: 12px; max-width: 900px; }
.pi-time { font-family: var(--font-mono); font-size: 15px; color: var(--ink-text); flex: none; }
.pi-time .lbl { color: var(--ink-soft); margin-left: 4px; }
.pi-bar { flex: 1; height: 5px; background: rgba(255,255,255,0.18); border-radius: 3px; overflow: hidden; }
.pi-bar .fill { height: 100%; background: var(--flix-red); transition: width 1s linear; }

.pi-next { font-size: 14.5px; color: var(--ink-soft); text-shadow: 0 1px 4px rgba(0,0,0,0.6); }

.pi-actions { display: flex; align-items: center; gap: 12px; margin-top: 4px; flex-wrap: wrap; }
.pi-volume-group { display: inline-flex; align-items: center; gap: 10px; }
.pi-action {
  display: inline-flex; align-items: center; gap: 9px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.18);
  color: #fff; font-size: 16px; font-weight: 600;
  padding: 12px 20px; border-radius: 999px; cursor: pointer;
  transition: all 0.15s var(--ease);
}
.pi-action svg { width: 17px; height: 17px; }
.pi-action:hover { background: rgba(255,255,255,0.16); transform: translateY(-1px); }
.pi-action.primary { background: var(--flix-red); border-color: var(--flix-red); }
.pi-action.primary:hover { background: #d92d3a; }
.pi-action.icon-only { padding: 12px; }

/* controle de volume ao lado do botao de mudo — trilha estilizada com o
 * preenchimento (--pct) acompanhando o nivel atual */
.pi-volume {
  -webkit-appearance: none; appearance: none; width: 90px; height: 4px; cursor: pointer;
  --pct: 100%;
  background: linear-gradient(to right, #fff 0%, #fff var(--pct), rgba(255,255,255,0.22) var(--pct), rgba(255,255,255,0.22) 100%);
  border-radius: 3px; outline: none;
}
.pi-volume::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 13px; height: 13px; border-radius: 50%;
  background: #fff; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.pi-volume::-moz-range-thumb {
  width: 13px; height: 13px; border-radius: 50%; background: #fff; border: none; cursor: pointer;
}
.pi-volume::-moz-range-track { background: transparent; }

/* modal GRANDE de programacao — abre por cima do player, com o video
 * ainda visivel (desfocado) por baixo do vidro, em vez de tarja lateral */
.guide-modal-scrim {
  position: fixed; inset: 0; z-index: 45;
  background: rgba(6,7,9,0.55); backdrop-filter: blur(22px) saturate(1.1);
  opacity: 0; pointer-events: none; transition: opacity 0.25s var(--ease);
  display: flex; align-items: center; justify-content: center; padding: 5vh 4vw;
}
.guide-modal-scrim.open { opacity: 1; pointer-events: auto; }

.guide-modal {
  width: min(980px, 100%); height: min(760px, 100%);
  background: rgba(17,20,26,0.92); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px; box-shadow: 0 40px 90px -20px rgba(0,0,0,0.6);
  display: flex; flex-direction: column; overflow: hidden;
  transform: scale(0.96) translateY(10px); transition: transform 0.28s var(--ease);
}
.guide-modal-scrim.open .guide-modal { transform: scale(1) translateY(0); }

.guide-modal-head {
  display: flex; align-items: center; gap: 16px;
  padding: 26px 32px; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.guide-modal-head .logo { width: 48px; height: 48px; object-fit: contain; border-radius: 8px; background: rgba(255,255,255,0.06); padding: 4px; }
.guide-modal-head .titles { flex: 1; min-width: 0; }
.guide-modal-head .eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; color: var(--flix-red); text-transform: uppercase; }
.guide-modal-head h2 { margin: 2px 0 0; font-family: var(--font-display); font-weight: 800; font-size: 26px; color: #fff; }

.guide-modal-body { flex: 1; overflow-y: auto; padding: 10px 20px 28px; }

/* ------------------------------------------------------------ Senha parental */
.parental-modal { width: min(420px, 100%); height: auto; }
.parental-form { display: flex; flex-direction: column; gap: 16px; padding: 24px 28px 32px; }
.parental-form label { display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; color: var(--ink-soft); }
.parental-form input {
  background: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--ink-text); padding: 12px 14px; font-size: 16px; letter-spacing: 0.1em;
}
.parental-form input:focus { outline: none; border-color: var(--flix-red); }
.parental-hint { font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; margin: 0; }
.forgot-body { padding: 22px 28px 30px; display: flex; flex-direction: column; gap: 14px; }
.forgot-lead { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--ink-text); }
.forgot-sub { margin: 0; font-size: 13px; line-height: 1.5; color: var(--ink-soft); }
.forgot-note {
  margin-top: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--ink); font-size: 12.5px; line-height: 1.55; color: var(--ink-soft);
}
.forgot-note b { color: var(--ink-text); }
.forgot-note a { color: var(--flix-red); }
.forgot-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 12px; font-size: 13.5px; line-height: 1.55; color: var(--ink-soft); }
.forgot-list b { color: var(--ink-text); }
.forgot-body .btn-primary { margin-top: 4px; }
.fp-label { display: flex; flex-direction: column; gap: 7px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); }
.fp-input {
  background: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--ink-text); padding: 12px 14px; font-size: 16px; font-family: var(--font-mono); letter-spacing: 0.04em;
}
.fp-input:focus { outline: none; border-color: var(--flix-red); }
.forgot-body .login-forgot { margin: 0 auto; }
.parental-msg { font-size: 13.5px; padding: 10px 12px; border-radius: var(--radius-sm); }
.parental-msg.ok { background: rgba(62,207,142,0.12); color: var(--ok); }
.parental-msg.error { background: rgba(230,57,70,0.12); color: var(--danger); }
.parental-form .pi-action { justify-content: center; width: 100%; }

.gm-prog {
  display: flex; gap: 20px; padding: 18px 14px; border-radius: 12px; margin-bottom: 4px;
  border-left: 3px solid transparent; cursor: default;
}
.gm-prog.now { background: rgba(230,57,70,0.1); border-left-color: var(--flix-red); }
.gm-time { font-family: var(--font-mono); font-size: 13px; color: var(--ink-soft); width: 92px; flex: none; padding-top: 3px; }
.gm-body { flex: 1; min-width: 0; }
.gm-body .n { font-size: 17px; font-weight: 700; color: #fff; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gm-body .d { font-size: 13.5px; color: var(--ink-soft); margin-top: 5px; line-height: 1.5; }
.gm-bar { height: 3px; background: rgba(255,255,255,0.14); border-radius: 2px; margin-top: 10px; overflow: hidden; max-width: 320px; }
.gm-bar .fill { height: 100%; background: var(--flix-red); }
.gm-now-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: 10px; color: var(--amber);
  border: 1px solid var(--amber-dim); border-radius: 5px; padding: 2px 7px;
}
.gm-now-tag .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--amber); animation: pulse 1.6s ease-in-out infinite; }

.guide-panel {
  position: absolute; right: 0; top: 0; bottom: 0; width: 360px; max-width: 88vw;
  background: rgba(10,12,15,0.92); backdrop-filter: blur(14px);
  border-left: 1px solid var(--line); z-index: 5;
  transform: translateX(100%); transition: transform 0.28s var(--ease);
  display: flex; flex-direction: column;
}
.guide-panel.open { transform: translateX(0); }
.guide-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 18px 14px; border-bottom: 1px solid var(--line-soft);
  font-family: var(--font-display); font-weight: 700; font-size: 18px;
}
.guide-panel-body { flex: 1; overflow-y: auto; padding: 8px 14px 24px; display: flex; flex-direction: column; gap: 8px; }

.panel-search {
  margin: 12px 14px 0;
  background: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-sm);
  /* 16px é obrigatório: abaixo disso o Safari do iPhone dá zoom automático
     ao focar o campo e "quebra" o layout. Não reduzir. */
  color: var(--ink-text); padding: 10px 12px; font-size: 16px;
}
.panel-search:focus { outline: none; border-color: var(--flix-red); }

.panel-catcycle {
  display: flex; align-items: center; justify-content: space-between;
  margin: 12px 14px 0; padding: 8px 6px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.panel-catcycle span { font-size: 13px; font-weight: 600; }
.panel-catcycle button { background: transparent; border: none; color: var(--ink-soft); cursor: pointer; padding: 4px 8px; }
.panel-catcycle button svg { width: 16px; height: 16px; }
.panel-catcycle button:hover { color: #fff; }
.rot180 { display: inline-flex; transform: rotate(180deg); }

.epg-row.active { border-color: var(--flix-red); background: rgba(230,57,70,0.08); }
.guide-prog {
  padding: 12px 10px; border-radius: var(--radius-sm); margin-bottom: 4px;
  border-left: 3px solid transparent;
}
.guide-prog.now { background: var(--panel); border-left-color: var(--flix-red); }
.guide-prog .t { font-family: var(--font-mono); font-size: 11px; color: var(--ink-soft); }
.guide-prog .n { font-size: 14px; font-weight: 600; margin: 3px 0 2px; }
.guide-prog .d { font-size: 12px; color: var(--ink-soft); line-height: 1.4; }
.guide-prog .now-tag {
  display: inline-block; font-family: var(--font-mono); font-size: 9px; color: var(--amber);
  border: 1px solid var(--amber-dim); border-radius: 4px; padding: 1px 5px; margin-left: 6px; vertical-align: middle;
}

.player-error {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; text-align: center;
  background: var(--ink); padding: 24px;
}
.player-error h3 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 22px; }
.player-error p { margin: 0; color: var(--ink-soft); font-size: 14px; max-width: 320px; }

@media (max-width: 640px) {
  .menu-fab { top: 8px; left: 8px; width: 34px; height: 34px; }
  .channel-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; padding-left: 14px; padding-right: 14px; }
  .tile .num { font-size: 18px; }
  .tile .logo-wrap img { max-height: 34px; }
  .vod-detail-body { padding: 18px 16px 36px; }
  .vod-hero-controls { padding: 10px 12px; gap: 6px; }
  .vod-btn-row { flex-wrap: wrap; }
  .audio-track-btn { padding: 6px 10px; font-size: 11px; }

  .section-title { min-height: 50px; padding: 4px 54px; font-size: 16.5px; }
  .home-row-title { padding: 0 14px 8px; font-size: 15px; }
  .home-carousel { padding: 4px 14px 14px; gap: 10px; }
  .home-card { width: 150px; padding: 12px; gap: 10px; }
  .home-card-logo { height: 50px; }
  .home-thumb { width: 190px; }
  .home-panel { margin: 0 14px; padding: 16px 4px 14px; }
  .home-panel .home-carousel { padding: 0 10px; gap: 18px; }
  .home-logo-item { width: 78px; gap: 10px; }
  .home-logo-item .logo { height: 44px; }
  .home-radio { min-width: 186px; padding: 10px 12px; }
  .home-more { min-width: 84px; }
  .home-more span { font-size: 11.5px; }

  /* banner grande: mais alto (retrato) e texto centralizado embaixo,
   * igual os apps de streaming fazem no celular */
  .home-hero { aspect-ratio: 4 / 5; max-height: 62vh; min-height: 340px; align-items: flex-end; }
  .home-hero-shade {
    background: linear-gradient(to top, var(--ink) 4%, rgba(10,12,15,0.55) 45%, rgba(10,12,15,0.15) 100%);
  }
  .home-hero-content { padding: 0 16px 26px; max-width: 100%; gap: 8px; text-align: center; align-items: center; }
  .home-hero-title { font-size: 26px; }
  .home-hero-desc { -webkit-line-clamp: 2; font-size: 13px; }
  .home-hero-actions { justify-content: center; }
  .hero-btn { padding: 10px 16px; font-size: 13px; }
  .home-nav-pills { padding: 14px 14px 16px; gap: 8px; }

  /* fileira de categorias: nada de altura cortando os botoes (era o bug
   * do print — o texto das pills aparecia metade cortado) */
  .category-rail { padding: 6px 14px 16px; gap: 8px; }
  .pill { padding: 8px 14px; font-size: 12.5px; }

  /* 3 colunas em vez de 2 gigantes */
  .vod-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 16px 10px; padding: 4px 14px 36px; }
  .vod-title-line { font-size: 12px; }
  .vod-sub { font-size: 10px; }

  .guia-preview { margin: 0 14px 12px; padding: 10px; gap: 12px; }
  .gp-title { font-size: 18px; }
  .gp-desc { font-size: 12.5px; max-width: 100%; }
  .gp-meta { font-size: 11.5px; }
  /* no celular a info não pode empurrar largura: tudo quebra e nada estoura */
  .gp-info { width: 100%; min-width: 0; }
  .gp-meta { flex-wrap: wrap; }
  .gp-chan { white-space: normal; word-break: break-word; }
  .gp-desc, .gp-title { overflow-wrap: anywhere; }
  /* os cartões da lista mobile (agora/próximos) respeitam a largura da tela */
  .guia-chip { max-width: 100%; }
  .guia-chip .gb-title, .guia-chip .gb-meta { white-space: normal; overflow-wrap: anywhere; }
  .guia-scroll.is-mobile .guia-row-track { min-width: 0; max-width: 100%; }

  /* paineis laterais viram tela cheia de verdade no celular */
  .guide-panel { position: fixed; inset: 0; width: 100%; max-width: 100%; z-index: 48; }
  .guide-modal-scrim { padding: 0; }
  .guide-modal, .guide-modal-scrim .guide-modal { width: 100%; max-width: 100%; height: 100%; border-radius: 0; }
  .guide-modal-head { padding: 16px; }
  .guide-modal-head h2 { font-size: 19px; }
  .parental-modal { height: auto; max-height: 100%; }
}

/* ---------------------------------------- celular em pé (retrato)
 * o player deixa de ser "video centralizado com texto sobreposto" e vira
 * o layout de app de video: VIDEO NO TOPO e as informacoes/controles
 * empilhados abaixo. Era o bug do print — o titulo ficava escrito em cima
 * do video e os botoes num vazio preto embaixo. */
@media (max-width: 760px) and (orientation: portrait) {
  .player-embed { display: block; overflow-y: auto; overflow-x: hidden; background: var(--ink); }
  .player-embed video { width: 100%; height: auto; aspect-ratio: 16 / 9; display: block; }

  .player-overlay {
    position: static; inset: auto; background: none;
    opacity: 1; pointer-events: auto; display: block;
  }
  /* nao esconde as infos por inatividade — aqui elas nao tampam o video */
  .player-overlay.idle { opacity: 1; pointer-events: auto; }
  .player-center-btn { display: none; }

  .player-info {
    padding: 16px 16px 28px; background: none; gap: 12px;
  }
  .pi-channel { gap: 10px; }
  .pi-channel .logo { width: 40px; height: 40px; padding: 3px; border-radius: 8px; }
  .pi-channel .num { font-size: 19px; text-shadow: none; }
  .pi-title { font-size: 22px; text-shadow: none; }
  .pi-badges { gap: 8px; }
  .badge-live { font-size: 12px; padding: 5px 12px; }
  .pi-endtime { font-size: 13.5px; }
  .pi-time { font-size: 12.5px; }
  .pi-next { font-size: 12.5px; text-shadow: none; }
  /* controles no celular: linha 1 = Programação + Canais centralizados;
   * linha 2 = Mudo + barra de volume. Play (sempre tocando) e Maximizar
   * ficam ocultos. */
  .pi-actions { gap: 10px; justify-content: center; }
  .pi-action { padding: 10px 16px; font-size: 13.5px; }
  #btn-playpause, #btn-fullscreen { display: none; }
  .pi-volume-group {
    flex-basis: 100%; justify-content: center; gap: 12px; margin-top: 2px;
  }
  /* iOS: sem a barra de volume, o botao Mudo entra na MESMA linha de
     Programacao/Canais em vez de boiar sozinho numa linha propria. */
  .pi-volume-group.vol-solo { flex-basis: auto; margin-top: 0; }
  .pi-volume-group .pi-action.icon-only { padding: 10px; }
  .pi-volume { width: 160px; }

  /* o menu flutuante nao pode tampar o video no topo */
  .menu-fab { background: rgba(10,12,15,0.85); }
}

/* EM TELA CHEIA (fullscreen) — FORA de qualquer media query, porque ao
 * entrar em fullscreen a tela gira pra landscape e os media queries de
 * portrait deixam de valer. Aqui o video cobre a tela inteira e as infos
 * viram sobreposicao no rodape (player de app), em vez do video pequeno no
 * topo com o rodape empilhado embaixo (bug reportado). */
.player-embed:fullscreen { display: flex; align-items: center; justify-content: center; overflow: hidden; }
.player-embed:-webkit-full-screen { display: flex; align-items: center; justify-content: center; overflow: hidden; }
.player-embed:fullscreen video, .player-embed:-webkit-full-screen video {
  width: 100%; height: 100%; aspect-ratio: auto; object-fit: contain;
}
.player-embed:fullscreen .player-overlay, .player-embed:-webkit-full-screen .player-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 30%);
}
.player-embed:fullscreen .player-overlay.idle { opacity: 0; }
.player-embed:fullscreen .player-center-btn { display: flex; }

/* ------------------------------------- celular deitado (paisagem)
 * tela baixa: o video ocupa tudo e as infos voltam a ser sobreposicao,
 * mas bem mais compactas pra caber. */
@media (max-height: 500px) and (orientation: landscape) {
  .section-title { min-height: 44px; padding: 2px 52px; font-size: 15px; }
  .player-info { padding: 10px 16px 12px; gap: 6px; }
  .pi-channel .logo { width: 34px; height: 34px; }
  .pi-channel .num { font-size: 17px; }
  .pi-title { font-size: 18px; }
  .pi-badges { gap: 7px; }
  .pi-next { display: none; }
  .pi-action { padding: 7px 12px; font-size: 12.5px; }
  .pi-action.icon-only { padding: 7px; }
  .guia-preview { display: none; }
}


/* ===== Guia na TV: categorias em PÍLULAS (modelo SKY+) =====
   O dropdown prendia a navegação vertical entre o mini player e a grade.
   Aqui as categorias já ficam abertas numa fileira: ←/→ escolhe, ↓ desce
   direto pra grade. */
.guia-cats {
  display: flex; gap: 8px; overflow-x: auto; flex: 1; min-width: 0;
  scrollbar-width: none; padding: 2px 0;
}
.guia-cats::-webkit-scrollbar { display: none; }
.guia-cat-pill {
  flex: none; padding: 6px 14px; border-radius: 999px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); color: var(--ink-soft);
  font-family: var(--font-body); font-size: 13px; font-weight: 600; white-space: nowrap;
}
.guia-cat-pill.active { background: #fff; border-color: #fff; color: #0a0c0f; }
html.tv-mode .guia-cat-pill:focus {
  outline: 3px solid var(--flix-red) !important; outline-offset: 2px;
}

/* ===== Data/hora do SERVIDOR — fixo no topo à direita ===== */
#flix-clock {
  position: fixed; top: 10px; right: 16px; z-index: 60; pointer-events: none;
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.02em; color: #fff;
  background: rgba(0,0,0,0.5); padding: 5px 12px; border-radius: 999px;
}


/* data/hora do servidor acompanha o rodapé: some junto após os 6s e volta
   quando há interação no controle */
#flix-clock { transition: opacity 0.25s ease; }
#flix-clock.idle { opacity: 0; }

/* --- VOD na TV: barra de progresso e tempos maiores (leitura a 3 metros) --- */
html.tv-mode .vod-seek { height: 9px; }
html.tv-mode .vod-time { font-size: 15px; min-width: 62px; }
html.tv-mode .vod-hero-controls { padding: 18px 28px; gap: 12px; }

/* ---- Continuar de onde parou: pergunta no Play + progresso nas capas ---- */
.resume-modal { max-width: 560px; }
.resume-modal .guide-modal-head { border-bottom: none; padding-bottom: 4px; }
.resume-actions { display: flex; flex-direction: column; gap: 10px; padding: 4px 22px 24px; }
.resume-actions .pi-action {
  justify-content: center; gap: 10px; padding: 14px 18px; font-size: 15px; font-weight: 600;
}
.resume-actions .pi-action svg { width: 18px; height: 18px; }
html.tv-mode .resume-modal { max-width: 640px; }
html.tv-mode .resume-actions .pi-action { padding: 18px 22px; font-size: 18px; }

/* quanto já assistiu, no pé da capa */
.vod-tile-prog {
  position: absolute; left: 0; right: 0; bottom: 0; height: 4px; z-index: 2;
  background: rgba(255,255,255,0.25);
}
.vod-tile-prog > div { height: 100%; background: var(--flix-red); }
.vod-title-sub { font-size: 11.5px; color: var(--ink-faint); margin-top: 2px; }
html.tv-mode .vod-tile-prog { height: 6px; }
html.tv-mode .vod-title-sub { font-size: 14px; }

/* ---- Início na TV: tudo maior, pra ler a 3 metros ---- */
html.tv-mode .home-row-title { font-size: 25px; padding-bottom: 16px; }
html.tv-mode .home-card { width: 232px; }
html.tv-mode .home-card-logo { height: 80px; }
html.tv-mode .home-card-name { font-size: 16px; }
html.tv-mode .home-card-tag { font-size: 14px; }
html.tv-mode .home-panel .home-carousel { gap: 34px; }
html.tv-mode .home-logo-item { width: 124px; }
html.tv-mode .home-logo-item .logo { height: 70px; }
html.tv-mode .home-logo-item .nome { font-size: 15px; }
html.tv-mode .home-radio { min-width: 268px; }
html.tv-mode .home-radio .logo { width: 58px; height: 58px; }
html.tv-mode .home-radio .txt .n { font-size: 16px; }
html.tv-mode .home-radio .txt .s { font-size: 14px; }
html.tv-mode .home-thumb { width: 304px; }
html.tv-mode .home-thumb-title { font-size: 17px; }
html.tv-mode .home-thumb-meta { font-size: 14px; }
html.tv-mode .home-more { min-width: 132px; }
html.tv-mode .home-more span { font-size: 15px; }
