/* ====================================================================
   MEGA TV PRO — Layout 10-foot (safe area, hero cinematográfico,
   grids responsivos). Carregado depois de style.css e tv-nav.css.
   ==================================================================== */

:root {
  --safe-x: clamp(48px, 4.2vw, 112px);   /* margem lateral segura (overscan) */
  --safe-top: clamp(28px, 3.5vh, 56px);
  --safe-bottom: clamp(120px, 16vh, 200px); /* folga p/ última linha nunca colar na borda */
  --card-w: clamp(240px, 16.5vw, 380px);
  --poster-min: clamp(170px, 11.5vw, 260px);
}

/* ---------- Viewport / scroll ---------- */
.pv-main-scroll {
  height: 100vh;
  height: 100dvh;
  scroll-padding: 80px 0 var(--safe-bottom) 0;
}

.pv-view-section {
  min-height: 0;
  padding-bottom: var(--safe-bottom);
}

.focusable { scroll-margin: 100px var(--safe-x) var(--safe-bottom) var(--safe-x); }

/* Degradê no rodapé: indica que existe mais conteúdo abaixo */
.pv-main-scroll::after {
  content: '';
  display: block;
  position: sticky;
  bottom: 0;
  height: 96px;
  margin-top: -96px;
  background: linear-gradient(to bottom, rgba(7, 7, 9, 0), var(--pv-bg) 85%);
  pointer-events: none;
  z-index: 50;
}
.pv-main-scroll:has(#sectionLive.active)::after,
.pv-main-scroll:has(#sectionVod.active)::after,
.pv-main-scroll:has(#sectionSeries.active)::after,
.pv-main-scroll:has(#sectionSeriesDetail.active)::after { display: none; }

/* ---------- HOME: hero cinematográfico ---------- */
.pv-hero-billboard {
  height: clamp(300px, 46vh, 480px);
  min-height: 0;
  max-height: 500px;
  padding: 0 var(--safe-x);
  align-items: flex-end;
  padding-bottom: clamp(20px, 4vh, 40px);
}

.hero-backdrop-img {
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background-position: center 25%;
  background-size: cover;
}

.hero-vignette-left {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right,
    var(--pv-bg) 0%, rgba(7, 7, 9, 0.92) 24%, rgba(7, 7, 9, 0.6) 48%, rgba(7, 7, 9, 0.12) 72%, transparent 100%);
  pointer-events: none;
}

.hero-vignette-bottom {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 45%;
  background: linear-gradient(to top, var(--pv-bg) 0%, rgba(7, 7, 9, 0.7) 45%, transparent 100%);
  pointer-events: none;
}

.hero-content-pane {
  position: relative;
  z-index: 10;
  width: min(46%, 720px);
  min-width: 420px;
}

.hero-badges-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.badge-exclusive {
  font-size: 0.85rem; font-weight: 800; letter-spacing: 2px; color: #fff; text-transform: uppercase;
}
.badge-highlight {
  font-size: 0.8rem; font-weight: 800; color: #fff; background: var(--pv-red);
  padding: 3px 12px; border-radius: var(--radius-pill);
}

.hero-title {
  font-size: clamp(2rem, 3.6vw, 3.6rem);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.9);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-meta-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.hero-meta-row > span {
  font-size: 0.85rem; font-weight: 700; padding: 4px 11px; border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.18);
}

.hero-synopsis {
  font-size: clamp(1rem, 1.15vw, 1.3rem);
  line-height: 1.5;
  color: #D5D7DE;
  margin-bottom: 22px;
  max-width: 640px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-actions-row { display: flex; align-items: center; gap: 16px; }

/* Filtros abaixo do hero, nunca flutuando sobre ele */
.pv-filter-bar {
  position: relative;
  z-index: 5;
  padding: 0 var(--safe-x);
  margin: 22px 0 18px 0;
}

.pv-content-row { padding: 0 var(--safe-x); margin-bottom: 30px; }
.row-heading-wrap { display: flex; align-items: baseline; justify-content: space-between; }
.row-counter { font-size: 0.85rem; color: var(--pv-text-muted); font-weight: 700; }

.row-cards-slider { gap: 22px; padding: 22px 16px 30px 16px; margin: -10px -16px -10px -16px; }
.pv-card-16-9 { width: var(--card-w); background: linear-gradient(145deg, #1c1e2b 0%, #0d0e14 100%); }

/* ---------- AO VIVO, FILMES, SÉRIES E AJUSTES (HUB DE COLUNAS TV) ---------- */
#sectionLive,
#sectionVod,
#sectionSeries,
#sectionSettings {
  padding-bottom: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.live-tv-hub-layout {
  display: grid;
  grid-template-columns: clamp(280px, 19vw, 350px) minmax(0, 1fr) clamp(340px, 24vw, 460px);
  grid-template-rows: minmax(0, 1fr);
  gap: 22px;
  height: 100vh;
  height: 100dvh;
  padding: var(--safe-top) var(--safe-x) var(--safe-top) 24px;
}

.vod-tv-hub-layout {
  display: grid;
  grid-template-columns: clamp(280px, 19vw, 350px) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 22px;
  height: 100vh;
  height: 100dvh;
  padding: var(--safe-top) var(--safe-x) var(--safe-top) 24px;
}

.live-cats-column,
.live-channels-column,
.live-preview-column {
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.live-cats-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 16px 80px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Diferenciação clara entre categoria ATIVA (aberta) e categoria FOCADA (cursor do controle) */
.cat-item.active:not(.focused) {
  background: rgba(229, 9, 20, 0.22) !important;
  color: #FFFFFF !important;
  border-color: rgba(229, 9, 20, 0.55) !important;
  border-left: 5px solid var(--pv-red) !important;
  font-weight: 800;
}

.cat-item.focused,
.cat-item:focus-visible {
  background: var(--pv-red) !important;
  color: #FFFFFF !important;
  border-color: #FFFFFF !important;
  box-shadow: 0 0 0 3px #FFFFFF, 0 8px 24px rgba(0, 0, 0, 0.85) !important;
  transform: scale(1.02);
  z-index: 40;
}

.live-channels-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  grid-template-columns: repeat(auto-fill, minmax(clamp(280px, 19vw, 400px), 1fr));
  grid-auto-rows: 112px;
  align-content: start;
  gap: 18px;
  padding: 20px 20px 100px 20px;
}

.channel-card { height: 112px; min-height: 112px; padding: 14px 20px; gap: 18px; }
.channel-logo-wrap { width: 84px; height: 84px; min-width: 84px; min-height: 84px; }
.channel-card-info h4 {
  font-size: clamp(1.1rem, 1.2vw, 1.4rem);
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Preview: ocupa a altura toda, EPG em destaque */
.live-preview-column { background: linear-gradient(180deg, rgba(24, 24, 34, 0.95), rgba(10, 10, 14, 0.95)); }
.preview-box { padding: 28px; gap: 6px; justify-content: flex-start; }
.preview-logo-holder {
  position: relative; width: 100%; aspect-ratio: 16/9; background: #000;
  border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1); margin-bottom: 14px;
}
.preview-logo-holder img { max-width: 55%; max-height: 70%; object-fit: contain; }
.preview-meta-details { display: none; } /* tags genéricas removidas: só dados reais */
.preview-epg-card { flex: 1; margin-top: 14px; }
.epg-prog-title { font-size: clamp(1.15rem, 1.3vw, 1.5rem); font-weight: 800; line-height: 1.3; }
.epg-prog-desc {
  font-size: 0.98rem; color: #B8BBC6; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden;
}
.btn-watch-large { width: 100%; margin-top: 16px; min-height: 60px; justify-content: center; }

/* ---------- GRADE DE PÔSTERES (FILMES / SÉRIES À DIREITA) ---------- */
.pv-main-scroll,
.row-cards-slider,
.live-cats-scroll,
.live-channels-grid,
.vod-posters-grid,
.seasons-tabs-row,
#searchResultsGrid,
.search-tv-right-pane {
  scroll-behavior: auto !important;
}

.vod-posters-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(175px, 11.5vw, 225px), 1fr));
  grid-auto-rows: max-content;
  align-content: start;
  gap: 24px;
  padding: 22px 24px 110px 24px;
}

.poster-card {
  width: 100%;
  aspect-ratio: 2 / 3;
  min-height: 270px;
  background: linear-gradient(145deg, #1c1e2b 0%, #0d0e14 100%);
}
.poster-card .poster-placeholder-card { position: absolute; inset: 0; }

/* ---------- TELA DE LOADING GLOBAL ---------- */
.app-loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 40%, #1a0508 0%, var(--pv-bg) 65%);
  opacity: 0;
  transition: opacity 0.28s ease;
}
.app-loading-screen.visible { opacity: 1; }
.app-loading-inner { display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; }
.app-loading-brand { font-size: clamp(2.2rem, 3.4vw, 3.6rem); font-weight: 900; letter-spacing: 2px; display: flex; gap: 8px; align-items: baseline; }
.al-mega { color: #fff; }
.al-tv { color: var(--pv-red); }
.al-pro { font-size: 0.4em; letter-spacing: 3px; color: var(--pv-gold); border: 1.5px solid var(--pv-gold); border-radius: 6px; padding: 2px 8px; align-self: center; }
.app-loading-ring {
  width: 64px; height: 64px; border-radius: 50%;
  border: 5px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--pv-red);
  animation: al-spin 0.9s linear infinite;
}
.app-loading-title { font-size: clamp(1.2rem, 1.6vw, 1.7rem); font-weight: 800; }
.app-loading-sub { font-size: 1rem; color: var(--pv-text-muted); min-height: 1.3em; }
@keyframes al-spin { to { transform: rotate(360deg); } }

/* ---------- DETALHES DA SÉRIE & EPISÓDIOS (10-FOOT TV) ---------- */
#sectionSeriesDetail {
  padding-bottom: var(--safe-bottom);
}

.series-hero-banner {
  padding: var(--safe-top) var(--safe-x) 32px var(--safe-x);
  min-height: 400px;
}

.series-seasons-bar {
  padding: 20px var(--safe-x) 12px var(--safe-x);
}

.episodes-grid-wrapper {
  padding: 18px var(--safe-x) var(--safe-bottom) var(--safe-x);
}

.episodes-tv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(320px, 22vw, 440px), 1fr));
  gap: 20px;
}

.episode-card-tv {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(28, 30, 43, 0.92) 0%, rgba(13, 14, 20, 0.96) 100%);
  border: 2px solid rgba(255, 255, 255, 0.08);
  min-height: 118px;
  overflow: hidden;
}

.ep-thumb-wrap {
  position: relative;
  width: 164px;
  min-width: 164px;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #070709;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.ep-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ep-badge-num {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(7, 7, 9, 0.88);
  color: var(--pv-gold);
  font-size: 0.78rem;
  font-weight: 900;
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid rgba(245, 197, 24, 0.35);
  letter-spacing: 0.5px;
}

.ep-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.32);
  color: #fff;
  font-size: 1.35rem;
  opacity: 0.85;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.episode-card-tv.focused .ep-play-overlay,
.episode-card-tv:focus .ep-play-overlay {
  opacity: 1;
  background: rgba(229, 9, 20, 0.45);
}

.ep-info-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.ep-card-title {
  font-size: clamp(1rem, 1.1vw, 1.25rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ep-card-duration {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--pv-text-sub);
  background: rgba(255, 255, 255, 0.08);
  padding: 3px 10px;
  border-radius: 6px;
}

/* ---------- MODAL DE DETALHES DO FILME (10-FOOT TV) ---------- */
.modal-dialog {
  position: relative;
  width: min(980px, 88vw);
  padding: 40px;
  border-radius: 22px;
  background: linear-gradient(155deg, #171822 0%, #0b0c12 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.88);
}

.modal-close-btn.focusable,
.modal-close-btn {
  position: absolute !important;
  top: 24px;
  right: 24px;
  width: auto;
  min-height: 48px;
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 20;
}

.modal-movie-layout {
  display: flex;
  gap: 36px;
  align-items: flex-start;
}

.modal-poster {
  width: 240px;
  min-width: 240px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 14px;
  background: #070709;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
}

.modal-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

#modalMovieTitle {
  font-size: clamp(1.8rem, 2.5vw, 2.6rem);
  font-weight: 900;
  line-height: 1.15;
  padding-right: 150px;
  margin-bottom: 14px;
}

.modal-plot {
  font-size: 1.08rem;
  line-height: 1.6;
  color: #D0D3DF;
  margin-bottom: 28px;
  max-height: 180px;
  overflow-y: auto;
}

/* ====================================================================
   AJUSTE DE ALTURA HERO PARA TELAS <= 800px / 720p (1280x720, 1366x768)
   Garante que o primeiro carrossel de conteúdo seja visível sem rolar a tela
   ==================================================================== */
@media (max-height: 800px) {
  .pv-hero-billboard {
    height: clamp(230px, 40vh, 310px) !important;
    min-height: 0 !important;
    max-height: 320px !important;
    padding-bottom: 14px !important;
  }
  .hero-content-pane {
    max-width: 520px !important;
    min-width: 300px !important;
  }
  .hero-badges-row {
    margin-bottom: 6px !important;
    gap: 8px !important;
  }
  .hero-title {
    font-size: clamp(1.4rem, 2.6vw, 1.85rem) !important;
    margin-bottom: 6px !important;
  }
  .hero-meta-row {
    margin-bottom: 6px !important;
    gap: 6px !important;
  }
  .hero-synopsis {
    -webkit-line-clamp: 2 !important;
    font-size: 0.86rem !important;
    margin-bottom: 10px !important;
    line-height: 1.35 !important;
  }
  .hero-actions-row {
    gap: 10px !important;
  }
  .btn-hero-action {
    height: 38px !important;
    padding: 0 16px !important;
    font-size: 0.88rem !important;
  }
  .pv-filter-bar {
    margin: 12px 0 10px 0 !important;
  }
  .pv-content-row {
    margin-bottom: 20px !important;
  }
}

/* ====================================================================
   MODAL DE CONTROLE PARENTAL (+18 / PIN NUMÉRICO DE 4 DÍGITOS)
   ==================================================================== */
.pin-modal-dialog {
  width: min(440px, 90vw);
  padding: clamp(20px, 3vh, 32px) clamp(22px, 3vw, 34px);
  border-radius: 22px;
  background: linear-gradient(155deg, #181a26 0%, #0b0c12 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(12px, 1.8vh, 18px);
}

.pin-modal-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.pin-lock-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(229, 9, 20, 0.16);
  border: 1.5px solid rgba(229, 9, 20, 0.45);
  color: #E50914;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

#pinModalTitle {
  font-size: clamp(1.25rem, 1.8vw, 1.55rem);
  font-weight: 900;
  color: #FFFFFF;
}

#pinModalSubtitle {
  font-size: clamp(0.82rem, 1.1vw, 0.94rem);
  color: #A0A5B5;
  max-width: 340px;
  line-height: 1.35;
}

.pin-dots-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 4px 0;
}

.pin-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.32);
  transition: all 0.15s ease;
}

.pin-dot.filled {
  background: #E50914;
  border-color: #FFFFFF;
  box-shadow: 0 0 12px rgba(229, 9, 20, 0.8);
  transform: scale(1.12);
}

.pin-error-msg {
  font-size: 0.88rem;
  font-weight: 700;
  color: #FF5252;
  background: rgba(255, 82, 82, 0.12);
  border: 1px solid rgba(255, 82, 82, 0.35);
  padding: 6px 14px;
  border-radius: 8px;
}

.pin-keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(8px, 1.2vh, 12px);
  width: 100%;
}

.pin-key {
  min-height: clamp(44px, 6.2vh, 56px);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 1.5vw, 1.35rem);
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s ease;
}

.pin-key-action,
.pin-key-cancel {
  font-size: clamp(0.82rem, 1vw, 0.95rem);
  font-weight: 700;
  color: #D0D3DF;
}

.pin-key.focused,
.pin-key:focus-visible {
  background: #E50914 !important;
  color: #FFFFFF !important;
  border-color: #FFFFFF !important;
  box-shadow: 0 0 0 3px #FFFFFF, 0 8px 22px rgba(229, 9, 20, 0.65) !important;
  transform: scale(1.05);
  z-index: 10;
}

.pin-modal-footer {
  width: 100%;
  margin-top: 2px;
}

.btn-pin-change {
  width: 100%;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  color: #B8BCC8;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-pin-change.focused,
.btn-pin-change:focus-visible {
  background: rgba(255, 255, 255, 0.2) !important;
  color: #FFFFFF !important;
  border-color: #FFFFFF !important;
  box-shadow: 0 0 0 3px #FFFFFF !important;
}

/* ---------- INDICADOR DE CATEGORIA BLOQUEADA (+18) ---------- */
.cat-lock-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  margin-left: 6px;
  opacity: 0.9;
}

/* ---------- BOTÃO MINHA LISTA ATIVO ---------- */
.btn-mylist-active {
  background: rgba(245, 197, 24, 0.18) !important;
  border-color: rgba(245, 197, 24, 0.65) !important;
  color: #F5C518 !important;
}

/* ---------- BARRA DE PROGRESSO DE RETOMADA (RESUME PLAYBACK) ---------- */
.card-progress-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 5px;
  background: rgba(255, 255, 255, 0.22);
  overflow: hidden;
  z-index: 6;
}

.card-progress-fill {
  height: 100%;
  background: #E50914;
  box-shadow: 0 0 8px rgba(229, 9, 20, 0.9);
}

.ep-resume-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.76rem;
  font-weight: 800;
  color: #FFFFFF;
  background: rgba(229, 9, 20, 0.85);
  padding: 2px 8px;
  border-radius: 5px;
  margin-left: 6px;
}

/* ---------- SPACERS DE VIRTUALIZAÇÃO DE GRADE (DOM WINDOWING) ---------- */
.virtual-spacer-top,
.virtual-spacer-bottom {
  grid-column: 1 / -1;
  width: 100%;
  pointer-events: none;
  margin: 0;
  padding: 0;
}

/* ---------- BANNER DE PRÓXIMO EPISÓDIO AUTOMÁTICO NO PLAYER ---------- */
.player-next-ep-banner {
  position: absolute;
  right: clamp(24px, 4vw, 48px);
  bottom: clamp(110px, 15vh, 150px);
  z-index: 85;
  width: min(420px, 88vw);
  padding: 18px 22px;
  border-radius: 16px;
  background: rgba(14, 15, 22, 0.95);
  border: 2px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.next-ep-banner-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.next-ep-tag {
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 1px;
  color: #F5C518;
  text-transform: uppercase;
}

#nextEpBannerTitle {
  font-size: 1.05rem;
  font-weight: 800;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.next-ep-banner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-next-ep-now,
.btn-next-ep-dismiss {
  flex: 1;
  min-height: 42px;
  padding: 8px 14px;
  font-size: 0.9rem;
  border-radius: 10px;
}

/* ---------- SIDEBAR COMPACTA PARA 720P COM 6 BOTÕES + LOGOUT ---------- */
.sidebar-nav {
  gap: clamp(8px, 1.3vh, 14px) !important;
}

.side-btn {
  height: clamp(46px, 5.8vh, 54px) !important;
  min-height: clamp(46px, 5.8vh, 54px) !important;
}

/* ---------- CENTRAL DE CONFIGURAÇÕES (ESTILO IBO 2 NÍVEIS + IDENTIDADE MEGA TV) ---------- */
#sectionSettings.active {
  display: block;
}

.settings-ibo-stage {
  height: 100vh;
  width: 100%;
  padding: clamp(24px, 4vh, 44px) clamp(28px, 4vw, 60px);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 82% 12%, rgba(229, 9, 20, 0.11) 0%, rgba(15, 23, 30, 0) 52%),
    var(--pv-bg);
}

/* Toast curto "Salvo" no topo direito */
.settings-saved-toast {
  position: fixed;
  top: 26px;
  right: 40px;
  z-index: 1200;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-radius: 999px;
  background: rgba(15, 23, 30, 0.96);
  border: 1.5px solid rgba(0, 230, 118, 0.65);
  color: #00E676;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.75);
  pointer-events: none;
}

.settings-saved-toast .toast-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #00E676;
  box-shadow: 0 0 10px #00E676;
}

/* Cabeçalhos Nível 1 e Nível 2 */
.settings-stage-header {
  margin-bottom: clamp(18px, 3vh, 32px);
}

.settings-stage-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.4vw, 2.25rem);
  font-weight: 900;
  color: #FFFFFF;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.settings-stage-sub {
  font-size: clamp(0.88rem, 1.05vw, 1rem);
  color: var(--pv-text-muted);
  margin-top: 4px;
}

/* ---------- NÍVEL 1: HUB DE BLOCOS (GRADE 3x2) ---------- */
.settings-hub-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  max-width: 1160px;
  width: 100%;
}

.settings-hub-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 24px);
  width: 100%;
}

.settings-hub-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  min-height: clamp(142px, 22vh, 196px);
  padding: clamp(18px, 2.6vh, 26px) clamp(20px, 2.2vw, 28px);
  border-radius: 16px;
  background: linear-gradient(155deg, rgba(27, 37, 48, 0.95) 0%, rgba(15, 21, 29, 0.98) 100%);
  border: 2px solid rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.settings-hub-tile:hover {
  border-color: rgba(255, 255, 255, 0.26);
  background: linear-gradient(155deg, rgba(34, 46, 60, 0.98) 0%, rgba(19, 26, 36, 0.99) 100%);
}

.settings-hub-tile.focused,
.settings-hub-tile:focus-visible {
  transform: scale(1.04);
  border-color: #FFFFFF !important;
  background: linear-gradient(145deg, rgba(229, 9, 20, 0.22) 0%, rgba(27, 37, 48, 0.98) 78%) !important;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.85), 0 0 22px rgba(229, 9, 20, 0.35) !important;
  z-index: 10;
  outline: none;
}

.hub-tile-icon-wrap {
  width: clamp(46px, 6vh, 56px);
  height: clamp(46px, 6vh, 56px);
  border-radius: 14px;
  background: rgba(229, 9, 20, 0.14);
  border: 1.5px solid rgba(229, 9, 20, 0.35);
  color: #FF4D57;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.settings-hub-tile.focused .hub-tile-icon-wrap,
.settings-hub-tile:focus-visible .hub-tile-icon-wrap {
  background: var(--pv-red);
  border-color: #FFFFFF;
  color: #FFFFFF;
  box-shadow: 0 6px 18px rgba(229, 9, 20, 0.5);
}

.hub-tile-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  margin-top: 14px;
}

.hub-tile-title {
  font-family: var(--font-display);
  font-size: clamp(1.14rem, 1.45vw, 1.38rem);
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: -0.01em;
}

.hub-tile-status {
  font-size: clamp(0.85rem, 1vw, 0.96rem);
  font-weight: 600;
  color: #9DA8B8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-hub-tile.focused .hub-tile-status {
  color: #FFFFFF;
}

/* ---------- NÍVEL 2: DENTRO DA SEÇÃO (GRADE 2 COLUNAS DE BLOCOS) ---------- */
.settings-detail-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  max-width: 1160px;
  width: 100%;
  min-height: 0;
}

.settings-detail-topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: clamp(16px, 2.5vh, 26px);
}

.btn-settings-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 12px;
  background: rgba(27, 37, 48, 0.92);
  border: 2px solid rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
  font-family: var(--font-display);
  font-size: 0.94rem;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn-settings-back:hover {
  border-color: rgba(255, 255, 255, 0.35);
}

.btn-settings-back.focused,
.btn-settings-back:focus-visible {
  transform: scale(1.04);
  background: var(--pv-red) !important;
  border-color: #FFFFFF !important;
  box-shadow: 0 8px 24px rgba(229, 9, 20, 0.45) !important;
  outline: none;
}

.settings-detail-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Faixa superior compacta na seção Conta */
.settings-account-banner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: clamp(14px, 2vh, 20px) 24px;
  margin-bottom: 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(229, 9, 20, 0.14) 0%, rgba(27, 37, 48, 0.95) 100%);
  border: 1.5px solid rgba(229, 9, 20, 0.35);
}

.account-stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.account-stat-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9DA8B8;
}

.account-stat-val {
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.2vw, 1.18rem);
  font-weight: 800;
  color: #FFFFFF;
}

.account-stat-val.stat-ok {
  color: #00E676;
}

/* Grade 2 colunas de blocos de opção */
.settings-blocks-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, 1.8vw, 20px);
  padding: 4px 4px 60px 4px;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: auto !important;
}

.settings-option-block {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: clamp(84px, 12vh, 108px);
  padding: clamp(14px, 2vh, 20px) clamp(18px, 2vw, 24px);
  border-radius: 14px;
  background: linear-gradient(155deg, rgba(27, 37, 48, 0.95) 0%, rgba(15, 21, 29, 0.98) 100%);
  border: 2px solid rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  text-align: left;
  cursor: pointer;
  transition: transform 0.16s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.settings-option-block:hover {
  border-color: rgba(255, 255, 255, 0.26);
  background: linear-gradient(155deg, rgba(34, 46, 60, 0.98) 0%, rgba(19, 26, 36, 0.99) 100%);
}

.settings-option-block.focused,
.settings-option-block:focus-visible {
  transform: scale(1.03);
  border-color: #FFFFFF !important;
  background: linear-gradient(145deg, rgba(229, 9, 20, 0.2) 0%, rgba(27, 37, 48, 0.98) 80%) !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.85), 0 0 18px rgba(229, 9, 20, 0.32) !important;
  z-index: 8;
  outline: none;
}

.settings-option-block.block-danger {
  border-color: rgba(229, 9, 20, 0.42);
  background: linear-gradient(155deg, rgba(44, 16, 22, 0.92) 0%, rgba(20, 12, 16, 0.98) 100%);
}

.settings-option-block.block-danger.focused,
.settings-option-block.block-danger:focus-visible {
  border-color: #FFFFFF !important;
  background: linear-gradient(145deg, rgba(229, 9, 20, 0.42) 0%, rgba(44, 16, 22, 0.98) 100%) !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.9), 0 0 24px rgba(229, 9, 20, 0.55) !important;
}

.opt-block-main {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  flex: 1;
}

.opt-block-title,
.settings-row-title {
  font-family: var(--font-display);
  font-size: clamp(0.98rem, 1.2vw, 1.14rem);
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: -0.01em;
}

.opt-block-value,
.settings-value-pill {
  font-size: clamp(0.86rem, 1vw, 0.96rem);
  font-weight: 700;
  color: #9DA8B8;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.opt-block-value.pill-on,
.opt-block-value.val-on {
  color: #00E676;
}

.opt-block-value.val-accent {
  color: #E2E8F0;
}

.opt-block-value.pill-warn,
.opt-block-value.val-warn {
  color: #F5C518;
}

.opt-block-value.pill-danger,
.opt-block-value.val-danger {
  color: #FF6B6B;
}

.opt-block-indicator {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Indicador Toggle (Switch / Bolinha IBO) */
.opt-toggle-track {
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  position: relative;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.opt-toggle-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #9DA8B8;
  position: absolute;
  top: 2.5px;
  left: 3px;
  transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.18s ease, box-shadow 0.18s ease;
}

.opt-toggle-track.is-on {
  background: rgba(0, 230, 118, 0.22);
  border-color: #00E676;
}

.opt-toggle-track.is-on .opt-toggle-thumb {
  transform: translateX(20px);
  background: #00E676;
  box-shadow: 0 0 10px rgba(0, 230, 118, 0.8);
}

/* Indicador Select (▾) e Ação */
.opt-select-caret,
.opt-action-arrow {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 1rem;
  font-weight: 800;
}

.settings-option-block.focused .opt-select-caret,
.settings-option-block.focused .opt-action-arrow {
  background: rgba(229, 9, 20, 0.35);
  border-color: rgba(255, 255, 255, 0.6);
}

/* ---------- MODAL DE SELEÇÃO / CONFIRMAÇÃO DE CONFIGURAÇÕES ---------- */
.settings-action-dialog {
  width: min(460px, 90vw);
  padding: 28px;
  border-radius: 18px;
  background: linear-gradient(160deg, #1B2530 0%, #0F171E 100%);
  border: 2px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.92);
  text-align: left;
}

.settings-action-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

.settings-modal-opt {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.settings-modal-opt.is-selected {
  border-color: rgba(229, 9, 20, 0.65);
  background: rgba(229, 9, 20, 0.16);
}

.settings-modal-opt.opt-danger {
  color: #FF6B6B;
  border-color: rgba(229, 9, 20, 0.45);
  background: rgba(229, 9, 20, 0.14);
}

.settings-modal-opt.focused,
.settings-modal-opt:focus-visible {
  transform: scale(1.02);
  border-color: #FFFFFF !important;
  background: var(--pv-red) !important;
  color: #FFFFFF !important;
  box-shadow: 0 8px 22px rgba(229, 9, 20, 0.45) !important;
  outline: none;
}

/* MODO LEVE PARA TV BOX (SEM BLUR PESADO — MAIS FPS) */
body.tv-low-spec *,
body.tv-low-spec .pv-sidebar,
body.tv-low-spec .modal-backdrop,
body.tv-low-spec .player-osd-overlay {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* OTIMIZAÇÃO GLOBAL DE DESEMPENHO PARA SMART TV (ZERO BLUR, RENDERING RÁPIDO) */
.live-cats-scroll,
.live-channels-grid,
.vod-posters-grid,
.search-results-grid,
.row-cards-slider {
  will-change: scroll-position;
  contain: layout;
}

.search-channel-card,
.poster-card,
.pv-card {
  contain: content;
}

/* Teclado Virtual Ultra Rápido (Zero Latência no D-Pad) */
.search-osk-container,
.tvk-modal-keys-holder {
  contain: content;
}




