/* Telão — folha única. Sem CSS grid, sem variáveis CSS, sem calc aninhado:
   roda em Chrome 38 (webOS 3) e Tizen 2.4. Tudo em rem; app.js ajusta o rem
   conforme a largura real da TV (base 1920×1080 = 10px). */

* { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 10px; }

body {
  background: #0A0F1E;
  color: #EDF1F7;
  font-family: "Roboto", "Tizen Sans", "LG Smart UI", Arial, sans-serif;
  font-size: 2.2rem;
  line-height: 1.35;
  overflow: hidden;
  width: 100%;
  height: 100%;
  position: fixed;
  -webkit-user-select: none;
  user-select: none;
}

img { border: 0; }
input, button { font-family: inherit; color: inherit; }

.oculto { display: none !important; }
.invisivel { visibility: hidden; }

/* ---------- estrutura de tela ---------- */

#app, #camada-player, #camada-dialogo {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
}
#camada-player { background: #000; z-index: 20; }
#camada-dialogo { background: rgba(4, 7, 16, 0.82); z-index: 30; }

.tela {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  padding: 4.5rem 6rem;
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-orient: vertical; -webkit-flex-direction: column; flex-direction: column;
}
.tela.sem-padding { padding: 0; }

.linha { display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-align: center; -webkit-align-items: center; align-items: center; }
.coluna { display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-orient: vertical; -webkit-flex-direction: column; flex-direction: column; }
.cresce { -webkit-box-flex: 1; -webkit-flex: 1 1 auto; flex: 1 1 auto; min-height: 0; min-width: 0; }
.espaco { -webkit-box-flex: 1; -webkit-flex: 1 1 auto; flex: 1 1 auto; }

/* ---------- cabeçalho ---------- */

.cabecalho {
  -webkit-flex: 0 0 auto; flex: 0 0 auto;
  margin-bottom: 3rem;
}
.cabecalho .titulo { font-size: 4.2rem; font-weight: 700; letter-spacing: -0.02em; }
.cabecalho .sub { font-size: 2rem; color: #94A3B8; margin-top: 0.4rem; }
.marca { font-size: 3.2rem; font-weight: 700; }
.marca b { color: #FFB020; }
.relogio { font-size: 2.4rem; color: #94A3B8; margin-left: auto; }

/* ---------- foco (regra de ouro da TV: foco enorme e óbvio) ---------- */

.foco {
  outline: none;
  -webkit-transition: -webkit-transform 120ms ease, background-color 120ms ease;
  transition: transform 120ms ease, background-color 120ms ease;
}
.foco:focus, .foco.focado {
  outline: none;
  box-shadow: 0 0 0 0.5rem #FFB020, 0 1.2rem 3rem rgba(0, 0, 0, 0.55);
  -webkit-transform: scale(1.04);
  transform: scale(1.04);
  z-index: 2;
}

/* ---------- botões e campos ---------- */

.botao {
  display: inline-block;
  background: #16203A;
  border: 0.2rem solid #24304F;
  border-radius: 1rem;
  padding: 1.4rem 3rem;
  font-size: 2.4rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.botao.principal { background: #FFB020; border-color: #FFB020; color: #16110A; font-weight: 700; }
.botao.discreto { background: transparent; border-color: #2C3A5C; color: #C6D0E0; }
.botao:focus, .botao.focado { background: #FFB020; border-color: #FFB020; color: #16110A; }
.botao.principal:focus { background: #FFC658; }

.campo { margin-bottom: 2.4rem; }
.campo label { display: block; font-size: 1.9rem; color: #94A3B8; margin-bottom: 0.8rem; }
.campo input {
  display: block;
  width: 100%;
  background: #101A31;
  border: 0.2rem solid #2C3A5C;
  border-radius: 1rem;
  padding: 1.4rem 1.8rem;
  font-size: 2.4rem;
}
.campo input:focus, .campo input.focado {
  border-color: #FFB020;
  box-shadow: 0 0 0 0.3rem rgba(255, 176, 32, 0.35);
  background: #16203A;
}
.campo .dica { font-size: 1.7rem; color: #64748B; margin-top: 0.6rem; }

.abas { margin-bottom: 2.6rem; }
.abas .aba {
  padding: 1rem 2.4rem; margin-right: 1.2rem; border-radius: 999rem;
  background: #16203A; border: 0.2rem solid #24304F; font-size: 2.1rem; cursor: pointer;
}
.abas .aba.ativa { background: #23304F; border-color: #FFB020; color: #FFB020; }

/* ---------- mensagens ---------- */

.aviso {
  background: rgba(255, 176, 32, 0.1);
  border-left: 0.5rem solid #FFB020;
  padding: 1.6rem 2rem;
  border-radius: 0.6rem;
  font-size: 1.9rem;
  color: #D9E1EE;
}
.erro { color: #FF8A8A; font-size: 2rem; margin: 1.2rem 0; }
.sucesso { color: #7CE0A6; font-size: 2rem; margin: 1.2rem 0; }
.apagado { color: #94A3B8; }
.centro { text-align: center; }

.carregando {
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-align: center; -webkit-align-items: center; align-items: center;
  -webkit-box-pack: center; -webkit-justify-content: center; justify-content: center;
  height: 100%; font-size: 2.6rem; color: #94A3B8;
}
.girando {
  width: 4rem; height: 4rem; margin-right: 1.6rem;
  border: 0.4rem solid #24304F; border-top-color: #FFB020; border-radius: 50%;
  -webkit-animation: gira 900ms linear infinite;
  animation: gira 900ms linear infinite;
}
@-webkit-keyframes gira { to { -webkit-transform: rotate(360deg); } }
@keyframes gira { to { transform: rotate(360deg); } }

/* ---------- home ---------- */

.home-cartoes { -webkit-flex-wrap: wrap; flex-wrap: wrap; }
.cartao {
  width: 38rem; height: 22rem;
  margin: 0 2.4rem 2.4rem 0;
  padding: 2.6rem;
  border-radius: 1.6rem;
  background: #16203A;
  border: 0.2rem solid #24304F;
  cursor: pointer;
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-orient: vertical; -webkit-flex-direction: column; flex-direction: column;
  -webkit-box-pack: end; -webkit-justify-content: flex-end; justify-content: flex-end;
}
.cartao .icone { font-size: 5rem; line-height: 1; margin-bottom: auto; }
.cartao .nome { font-size: 3.2rem; font-weight: 600; }
.cartao .sub { font-size: 1.9rem; color: #94A3B8; margin-top: 0.4rem; }
.cartao:focus, .cartao.focado { background: #23304F; border-color: #FFB020; }

.faixa-info {
  -webkit-flex: 0 0 auto; flex: 0 0 auto;
  margin-top: auto; padding-top: 2rem;
  font-size: 1.8rem; color: #64748B;
}

/* ---------- listas com painel de categorias ---------- */

.painel-duplo { -webkit-box-flex: 1; -webkit-flex: 1 1 auto; flex: 1 1 auto; min-height: 0;
  -webkit-box-align: stretch; -webkit-align-items: stretch; align-items: stretch; }

.categorias {
  width: 40rem; -webkit-flex: 0 0 40rem; flex: 0 0 40rem;
  overflow-y: auto; overflow-x: hidden;
  padding-right: 1.6rem;
}
.categoria {
  padding: 1.3rem 1.8rem;
  margin-bottom: 0.8rem;
  border-radius: 0.9rem;
  background: #101A31;
  border: 0.2rem solid transparent;
  font-size: 2.1rem;
  cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.categoria.selecionada { background: #23304F; color: #FFB020; }
.categoria:focus, .categoria.focado { background: #FFB020; color: #16110A; }

.conteudo { padding-left: 3rem; overflow-y: auto; overflow-x: hidden; }

/* canais */
.canal {
  padding: 1.2rem 1.6rem;
  margin-bottom: 0.8rem;
  border-radius: 0.9rem;
  background: #101A31;
  cursor: pointer;
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-align: center; -webkit-align-items: center; align-items: center;
}
.canal .num { width: 6rem; -webkit-flex: 0 0 6rem; flex: 0 0 6rem; color: #64748B; font-size: 1.9rem; }
.canal .logo {
  width: 7rem; height: 4.4rem; -webkit-flex: 0 0 7rem; flex: 0 0 7rem;
  margin-right: 1.6rem; background: #0A0F1E; border-radius: 0.4rem;
  object-fit: contain;
}
.canal .nome { font-size: 2.2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.canal .epg { font-size: 1.7rem; color: #94A3B8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.canal .estrela { margin-left: auto; padding-left: 1.6rem; color: #FFB020; font-size: 2.2rem; }
.canal:focus, .canal.focado { background: #23304F; }

/* grade de pôsteres */
.grade { -webkit-flex-wrap: wrap; flex-wrap: wrap; display: -webkit-box; display: -webkit-flex; display: flex; }
.poster {
  width: 22rem; margin: 0 2rem 2.4rem 0;
  cursor: pointer;
}
.poster .capa {
  width: 22rem; height: 33rem;
  background: #101A31 no-repeat center center;
  background-size: cover;
  border-radius: 1rem;
  overflow: hidden;
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-align: center; -webkit-align-items: center; align-items: center;
  -webkit-box-pack: center; -webkit-justify-content: center; justify-content: center;
  color: #32405F; font-size: 4rem;
}
.poster .rotulo {
  margin-top: 0.9rem; font-size: 1.8rem; line-height: 1.25;
  height: 4.6rem; overflow: hidden;
}
.poster .meta { font-size: 1.6rem; color: #64748B; }
.poster:focus .capa, .poster.focado .capa { box-shadow: 0 0 0 0.4rem #FFB020; }

/* ---------- detalhe (filme / série) ---------- */

.detalhe { position: relative; }
.detalhe .fundo {
  position: absolute; top: 0; left: 0; right: 0; height: 62%;
  background: no-repeat center top; background-size: cover;
  opacity: 0.35;
}
.detalhe .gradiente {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: -webkit-linear-gradient(top, rgba(10,15,30,0.45) 0%, rgba(10,15,30,0.95) 55%, #0A0F1E 100%);
  background: linear-gradient(to bottom, rgba(10,15,30,0.45) 0%, rgba(10,15,30,0.95) 55%, #0A0F1E 100%);
}
.detalhe .miolo { position: relative; z-index: 1; }
.detalhe .capa-grande { width: 26rem; height: 39rem; border-radius: 1.2rem; background: #101A31 no-repeat center; background-size: cover; -webkit-flex: 0 0 26rem; flex: 0 0 26rem; }
.detalhe h1 { font-size: 4.6rem; line-height: 1.1; margin-bottom: 1rem; }
.detalhe .ficha { color: #94A3B8; font-size: 2rem; margin-bottom: 1.6rem; }
.detalhe .sinopse { font-size: 2.1rem; color: #C6D0E0; max-height: 13rem; overflow: hidden; margin-bottom: 2.4rem; }

.episodio {
  padding: 1.4rem 1.8rem; margin-bottom: 1rem; border-radius: 0.9rem;
  background: #101A31; cursor: pointer;
}
.episodio .titulo { font-size: 2.1rem; }
.episodio .sub { font-size: 1.7rem; color: #94A3B8; }
.episodio:focus, .episodio.focado { background: #23304F; }

/* ---------- ativação ---------- */

.codigo-grande {
  font-size: 12rem; font-weight: 700; letter-spacing: 1.2rem;
  color: #FFB020; line-height: 1.1;
  margin: 1.6rem 0 1rem 0;
}
.caixa-codigo {
  border: 0.3rem dashed #2C3A5C; border-radius: 1.6rem;
  padding: 2.4rem 4rem; display: inline-block; text-align: center;
}

/* ---------- player ---------- */

#video-tela { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: #000; }

.player-osd {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 6rem 6rem 4rem 6rem;
  background: -webkit-linear-gradient(top, rgba(0,0,0,0) 0%, rgba(0,0,0,0.85) 60%);
  background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.85) 60%);
}
.player-osd .canal-nome { font-size: 4rem; font-weight: 600; }
.player-osd .prog { font-size: 2.2rem; color: #C6D0E0; margin-top: 0.6rem; }
.player-osd .dica { font-size: 1.8rem; color: #94A3B8; margin-top: 1.6rem; }

.barra { height: 0.8rem; background: rgba(255,255,255,0.25); border-radius: 999rem; margin: 2rem 0 1rem 0; }
.barra .cheio { height: 100%; background: #FFB020; border-radius: 999rem; width: 0; }
.tempos { display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-pack: justify; -webkit-justify-content: space-between; justify-content: space-between;
  font-size: 2rem; color: #C6D0E0; }

.lista-lateral {
  position: absolute; top: 0; right: 0; bottom: 0; width: 52rem;
  background: rgba(8, 12, 24, 0.94);
  padding: 3rem 2.4rem;
  overflow-y: auto;
}
.aviso-player {
  position: absolute; top: 50%; left: 0; right: 0; text-align: center;
  font-size: 2.8rem; color: #EDF1F7;
}

/* ---------- diálogo ---------- */

.dialogo {
  position: absolute; top: 50%; left: 50%;
  -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);
  width: 84rem; max-width: 90%;
  background: #101A31; border: 0.2rem solid #2C3A5C; border-radius: 1.6rem;
  padding: 4rem;
}
.dialogo h2 { font-size: 3.4rem; margin-bottom: 1.6rem; }
.dialogo p { font-size: 2.2rem; color: #C6D0E0; margin-bottom: 2.4rem; }
.dialogo .acoes .botao { margin-right: 1.6rem; }

/* ---------- termos ---------- */

.termos p { font-size: 2.1rem; color: #C6D0E0; margin-bottom: 1.8rem; max-width: 130rem; }

/* ---------- rolagem (TV não tem barra visível bonita) ---------- */
::-webkit-scrollbar { width: 0.8rem; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #24304F; border-radius: 999rem; }

/* ---------- webplayer (navegador): a mesma tela, mas centrada e em cartão ---------- */

body.modo-web { cursor: default; }
body.modo-web .tela { max-width: 176rem; margin: 0 auto; left: 0; right: 0; }

body.modo-web .tela-entrar {
  -webkit-box-pack: center; -webkit-justify-content: center; justify-content: center;
  -webkit-box-align: center; -webkit-align-items: center; align-items: center;
}
body.modo-web .tela-entrar > * { width: 80rem; max-width: 100%; }
body.modo-web .tela-entrar .cabecalho { margin-bottom: 2rem; }
body.modo-web .tela-entrar .cresce {
  -webkit-box-flex: 0; -webkit-flex: 0 0 auto; flex: 0 0 auto;
  background: #101A31; border: 0.2rem solid #24304F; border-radius: 1.6rem;
  padding: 3.6rem 3.6rem 2.4rem 3.6rem;
}
body.modo-web .tela-entrar .aviso { margin-top: 2.4rem; }

/* barra do navegador: Voltar + marca; as telas descem para não ficar embaixo dela */
.barra-web {
  position: fixed; top: 0; left: 0; right: 0; height: 7rem; z-index: 10;
  background: #070B16; border-bottom: 0.2rem solid #1B2640;
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-align: center; -webkit-align-items: center; align-items: center;
  padding: 0 4rem;
}
.barra-web .botao { padding: 0.9rem 2rem; font-size: 2rem; margin-right: 3rem; }
.barra-web .marca { font-size: 2.8rem; }
.barra-web .dica-teclas { margin-left: auto; font-size: 1.7rem; color: #64748B; }
body.modo-web .tela { top: 7rem; padding-top: 3rem; }
body.modo-web .tela-entrar { top: 0; }
body.modo-web #camada-player { z-index: 20; }
.osd-voltar { position: absolute; top: -5rem; left: 6rem; padding: 0.9rem 2rem; font-size: 2rem; }
.player-osd { position: absolute; }
body.modo-web .player-osd { padding-top: 8rem; }
.osd-voltar .botao { padding: 0.9rem 2rem; font-size: 2rem; }
