/* VEMNATV-PLAYER-GRID-4-FAIXAS-V81 */
#app.tv-app{
  --v81-edge:clamp(8px,1.4vw,18px);
  --v81-gap:5px;
  --v81-nav-h:clamp(62px,11vh,78px);
  --v81-carousel-h:clamp(104px,19vh,124px);
  --v81-info-h:clamp(92px,20vh,138px);
  --v81-carousel-bottom:calc(var(--v81-nav-h) + var(--v81-gap));
  --v81-info-bottom:calc(var(--v81-nav-h) + var(--v81-gap) + var(--v81-carousel-h) + var(--v81-gap));
}

/* TOPO — logo esquerda / controles direita */
html body #app.tv-app .topbar{
  position:fixed!important; inset:0 0 auto 0!important;
  width:100%!important; height:68px!important;
  margin:0!important; padding:0!important;
  background:transparent!important; border:0!important; box-shadow:none!important;
  pointer-events:none!important; z-index:50!important;
}
html body #app.tv-app .topbar .brand{
  position:absolute!important; top:12px!important; left:var(--v81-edge)!important;
  margin:0!important; padding:0!important; pointer-events:auto!important;
}
html body #app.tv-app .topbar .top-actions{
  position:absolute!important; top:10px!important; right:var(--v81-edge)!important;
  display:flex!important; align-items:flex-start!important; justify-content:flex-end!important;
  gap:8px!important; margin:0!important; padding:0!important; pointer-events:auto!important;
}

/* LINHA 2 — canal/programa à esquerda + anúncio à direita */
html body #app.tv-app .program-panel,
html body #app.tv-app.show-channel-dock .program-panel,
html body #app.tv-app.show-channel-change .program-panel,
html body #app.tv-app.show-info-layer .program-panel,
html body #app.tv-app.show-bottom-nav .program-panel,
html body #app.tv-app.tv-overlays-visible .program-panel{
  position:fixed!important;
  left:var(--v81-edge)!important; right:var(--v81-edge)!important;
  top:auto!important; bottom:var(--v81-info-bottom)!important;
  width:auto!important;
  height:var(--v81-info-h)!important; min-height:var(--v81-info-h)!important; max-height:var(--v81-info-h)!important;
  margin:0!important; padding:0!important;
  display:grid!important;
  grid-template-columns:minmax(0,46%) minmax(0,46%)!important;
  grid-template-rows:1fr!important;
  justify-content:space-between!important; align-items:stretch!important;
  column-gap:clamp(14px,4vw,56px)!important; row-gap:0!important;
  transform:none!important; translate:none!important; scale:1!important; zoom:1!important;
  z-index:28!important;
}
html body #app.tv-app .program-panel .program-main{
  grid-column:1!important; grid-row:1!important;
  align-self:stretch!important; justify-self:stretch!important;
  width:100%!important; min-width:0!important; max-width:none!important;
  height:100%!important; min-height:0!important; max-height:100%!important;
  margin:0!important;
  transform:none!important; translate:none!important; scale:1!important; zoom:1!important;
  box-sizing:border-box!important;
}
html body #app.tv-app .program-panel #adCard,
html body #app.tv-app .program-panel #sponsorCard,
html body #app.tv-app #adCard,
html body #app.tv-app #sponsorCard{
  grid-column:2!important; grid-row:1!important;
  align-self:stretch!important; justify-self:stretch!important;
  width:100%!important; min-width:0!important; max-width:none!important;
  height:100%!important; min-height:0!important; max-height:100%!important;
  margin:0!important;
  transform:none!important; translate:none!important; scale:1!important; zoom:1!important;
  box-sizing:border-box!important;
}
html body #app.tv-app .program-main .progress,
html body #app.tv-app .program-main .progress-row{max-width:100%!important;}

/* LINHA 3 — carrossel 100% */
html body #app.tv-app #tvView > .channel-dock-wrap,
html body #app.tv-app.show-channel-dock #tvView > .channel-dock-wrap,
html body #app.tv-app.show-channel-change #tvView > .channel-dock-wrap,
html body #app.tv-app.show-info-layer #tvView > .channel-dock-wrap,
html body #app.tv-app.show-bottom-nav #tvView > .channel-dock-wrap,
html body #app.tv-app.tv-overlays-visible #tvView > .channel-dock-wrap{
  position:fixed!important;
  left:0!important; right:0!important; top:auto!important;
  bottom:var(--v81-carousel-bottom)!important;
  width:100vw!important; min-width:100vw!important; max-width:100vw!important;
  height:var(--v81-carousel-h)!important; min-height:var(--v81-carousel-h)!important; max-height:var(--v81-carousel-h)!important;
  margin:0!important;
  border-left:0!important; border-right:0!important; border-radius:0!important;
  transform:none!important; translate:none!important; scale:1!important; zoom:1!important;
  box-sizing:border-box!important; z-index:32!important;
}
html body #app.tv-app #tvView > .channel-dock-wrap::before,
html body #app.tv-app #tvView > .channel-dock-wrap::after{
  content:none!important; display:none!important;
}

/* LINHA 4 — barra de ícones na base */
html body #app.tv-app > .bottom-nav,
html body #app.tv-app .bottom-nav,
html body #app.tv-app #bottomNav,
html body #app.tv-app nav.bottom-nav,
html body #app.tv-app .tv-bottom-nav{
  position:fixed!important;
  left:0!important; right:0!important; bottom:0!important; top:auto!important;
  width:100vw!important; min-width:100vw!important; max-width:100vw!important;
  height:var(--v81-nav-h)!important; min-height:var(--v81-nav-h)!important; max-height:var(--v81-nav-h)!important;
  margin:0!important; border-radius:0!important;
  transform:none!important; translate:none!important; scale:1!important; zoom:1!important;
  box-sizing:border-box!important; z-index:31!important;
}

/* player continua cheio */
html body #app.tv-app #tvView{
  position:fixed!important; inset:0!important;
  width:100vw!important; height:100dvh!important; overflow:hidden!important;
}

/* fallback sem criar um segundo layout */
@media (orientation:portrait){
  #app.tv-app{
    --v81-nav-h:clamp(58px,8vh,70px);
    --v81-carousel-h:clamp(92px,13vh,112px);
    --v81-info-h:clamp(120px,18vh,160px);
  }
  html body #app.tv-app .program-panel,
  html body #app.tv-app.show-channel-dock .program-panel,
  html body #app.tv-app.show-channel-change .program-panel,
  html body #app.tv-app.show-info-layer .program-panel,
  html body #app.tv-app.show-bottom-nav .program-panel,
  html body #app.tv-app.tv-overlays-visible .program-panel{
    grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
    column-gap:10px!important;
  }
}
