:root {
  --bg: #07070b;
  --bg-elev: #111118;
  --ink: #f5f2ea;
  --muted: #9b968c;
  --amber: #e8a317;
  --amber-ink: #1a1204;
  --line: rgba(255, 255, 255, 0.08);
  --focus: #e8a317;
  --danger: #ff6b6b;
  --safe-x: max(1rem, env(safe-area-inset-left), 3vw);
  --safe-r: max(1rem, env(safe-area-inset-right), 3vw);
  --safe-b: max(1rem, env(safe-area-inset-bottom));
}

* { box-sizing: border-box; }

/* Scrollbar premium (lateral + listas) */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(232, 163, 23, 0.5) rgba(255, 255, 255, 0.05);
}
*::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
*::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
  margin: 4px;
}
*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(232, 163, 23, 0.65), rgba(232, 163, 23, 0.28));
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(232, 163, 23, 0.85), rgba(232, 163, 23, 0.45));
  background-clip: padding-box;
}
*::-webkit-scrollbar-corner {
  background: transparent;
}

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
  color: var(--ink);
  font-family: Manrope, "Segoe UI", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
#app {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
#app-header.app-chrome {
  flex: 0 0 auto;
  position: relative;
  z-index: 30;
  width: 100%;
  background: linear-gradient(180deg, rgba(7, 7, 11, 0.99), rgba(7, 7, 11, 0.94));
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.65rem;
}
#app-header[hidden] { display: none !important; }
#app-body {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  width: 100%;
}
.logo-home {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.logo-home:hover span { filter: brightness(1.1); }

.screen {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: 100%;
  overflow: hidden; /* página nunca rola — só zonas internas */
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 600px at 10% -20%, rgba(232, 163, 23, 0.16), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(60, 70, 160, 0.14), transparent 50%),
    var(--bg);
}

.screen[hidden] { display: none !important; }

/* Telas de formulário / pairing: scroll interno se precisar */
.screen#screen-onboard,
.screen#screen-mac,
.screen#screen-qr,
.screen#screen-code,
.screen#screen-browse,
.screen.profiles-screen {
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.splash {
  display: grid;
  place-items: center;
}
.splash-logo, .logo-sm {
  font-family: Syne, Manrope, sans-serif;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.splash-logo { font-size: clamp(2.8rem, 7vw, 5rem); }
.splash-logo span, .logo-sm span { color: var(--amber); margin-left: 0.18em; }
.splash-mark p {
  margin: 0.7rem 0 0;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-align: center;
}
.app-legal {
  margin: 1.4rem 0 0 !important;
  font-size: 0.72rem !important;
  letter-spacing: 0.06em !important;
  color: rgba(155, 150, 140, 0.85) !important;
  text-align: center;
}
.app-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 1.25rem var(--safe-x) calc(1rem + var(--safe-b));
  margin-top: 0.5rem;
  border-top: 1px solid var(--line);
  color: rgba(155, 150, 140, 0.9);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}
.app-footer span:first-child {
  color: var(--amber);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.4rem var(--safe-x) 0.8rem;
  position: sticky;
  top: 0;
  z-index: 5;
  background: linear-gradient(180deg, rgba(7, 7, 11, 0.95), rgba(7, 7, 11, 0));
}
.logo-sm { font-size: 1.35rem; }
.subbar {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem var(--safe-x);
  flex: 0 0 auto;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 7, 11, 0.55);
}
.subbar strong {
  font-family: Syne, Manrope, sans-serif;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.surface-badge {
  margin-left: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  color: var(--amber);
  border: 1px solid rgba(232, 163, 23, 0.4);
  background: rgba(232, 163, 23, 0.12);
}
body.is-web {
  cursor: default;
}
body.is-web .option:hover,
body.is-web .card:hover,
body.is-web .nav-btn:hover,
body.is-web .btn:hover {
  filter: brightness(1.08);
}
.home-bar {
  flex: 0 0 auto;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.65rem 0.85rem;
  padding-right: var(--safe-r);
  position: relative;
  z-index: 16;
  background: linear-gradient(180deg, rgba(7, 7, 11, 0.98), rgba(7, 7, 11, 0.92));
}
/* Menus + lupa juntos; perfil fica à direita */
.home-nav-cluster {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}
.nav {
  display: flex;
  gap: 0.35rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  max-width: 100%;
  flex: 1 1 auto;
  min-width: 0;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.nav::-webkit-scrollbar { display: none; }
.nav-search-btn {
  margin-left: 0;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.06);
  color: var(--ink);
  border-radius: 999px;
  width: 2.4rem;
  height: 2.4rem;
  font-size: 1rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.nav-search-btn:hover {
  border-color: rgba(232, 163, 23, 0.45);
  color: var(--amber);
}
.profile-chip {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.05);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
}
.profile-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--amber);
}
.nav-btn, .back, .btn, .group-chip {
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink);
  background: transparent;
}
.nav-btn {
  padding: 0.65rem 1rem;
  color: var(--muted);
}
.nav-btn.is-active {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--amber);
}

.group-nav {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.2rem var(--safe-x) 0.9rem;
  scrollbar-width: thin;
}
.group-chip {
  flex: 0 0 auto;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
  white-space: nowrap;
}
.group-chip.is-active {
  background: rgba(232, 163, 23, 0.18);
  border-color: rgba(232, 163, 23, 0.45);
  color: var(--amber);
}

.row h2 {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.row-badge, .card-tag {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 0.22rem 0.48rem;
  border-radius: 6px;
}
.row-badge.live, .card-tag.live {
  background: #c43a3a;
  color: #fff;
}
.row-badge.vod, .card-tag.vod {
  background: #c48a12;
  color: #1a1204;
}
.row-badge.uhd, .card-tag.uhd {
  background: #6b4fd8;
  color: #fff;
}
.row-badge.series, .card-tag.series {
  background: #2f7fd4;
  color: #fff;
}
.row-badge.kids, .card-tag.kids {
  background: #2f9d5b;
  color: #fff;
}
.row-badge.adult, .card-tag.adult {
  background: #c23a55;
  color: #fff;
}
.nav-btn.nav-adult {
  color: #ff8fa3;
}
.nav-btn.nav-kids {
  color: #5eead4;
  font-weight: 800;
}
.nav-btn.nav-kids.is-active {
  color: #99f6e4;
  box-shadow: inset 0 -2px 0 #2dd4bf;
}
.cat-dropdown-title-kids,
#cat-dropdown-title.is-kids {
  color: #5eead4;
}
.group-chip.is-4k {
  border-color: rgba(160, 130, 255, 0.45);
  color: #cbb6ff;
}
.group-chip.is-4k.is-active {
  background: rgba(120, 90, 255, 0.22);
  border-color: rgba(180, 150, 255, 0.65);
  color: #e6deff;
}
.card-4k {
  box-shadow: inset 0 0 0 1px rgba(160, 130, 255, 0.25);
}
.card-tag {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  z-index: 3;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}
.section-empty {
  padding: 2rem var(--safe-x);
  color: var(--muted);
}
.back {
  padding: 0.55rem 0.85rem;
  background: rgba(255, 255, 255, 0.06);
}
.btn {
  background: var(--amber);
  color: var(--amber-ink);
  padding: 0.85rem 1.35rem;
}

.focusable:focus, .focusable.is-focused {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.onboard {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem var(--safe-x) 1.5rem;
  width: 100%;
  box-sizing: border-box;
}
.onboard-center {
  width: min(1080px, 100%);
  text-align: center;
  margin: auto 0;
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  width: min(100%, 22rem);
  margin: 0.5rem auto 0;
  text-align: left;
}
.login-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.72);
}
.login-field input {
  width: 100%;
  border-radius: 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  padding: 0.75rem 0.9rem;
  font-size: 1rem;
}
.login-form .btn {
  margin-top: 0.35rem;
  width: 100%;
}
.pair-panel {
  padding: 1rem var(--safe-x) 3rem;
  max-width: 1400px;
}
.pair-panel.pair-centered {
  margin: auto;
  width: min(520px, 100%);
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.5rem var(--safe-x) 2.5rem;
  min-height: 100%;
  box-sizing: border-box;
  justify-content: center;
}
.pair-panel.pair-centered .lead,
.pair-panel.pair-centered .status {
  margin-left: auto;
  margin-right: auto;
}
.pair-panel.pair-centered .pair-back {
  align-self: flex-start;
  margin-bottom: 0.75rem;
}
.pair-panel.pair-centered .api-hint {
  text-align: left;
  width: 100%;
}
.screen#screen-qr,
.screen#screen-code,
.screen#screen-mac {
  display: flex;
  flex-direction: column;
}
.onboard h1, .pair-panel h1 {
  font-family: Syne, Manrope, sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}
.onboard .lead {
  margin-left: auto;
  margin-right: auto;
}
.lead {
  color: var(--muted);
  max-width: 48ch;
  line-height: 1.5;
  margin: 0 0 1.8rem;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.15rem;
  width: 100%;
  text-align: left;
}
/* Web player: só QR + código */
body.is-web .option-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 720px;
  margin: 0 auto;
}
body.is-web .opt-mac {
  display: none !important;
}
.option {
  text-align: left;
  padding: 1.75rem 1.6rem 1.65rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(165deg, rgba(232, 163, 23, 0.12) 0%, transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  color: inherit;
  display: grid;
  gap: 0.65rem;
  min-height: 248px;
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.option:hover,
.option:focus-visible {
  border-color: rgba(232, 163, 23, 0.55);
  transform: translateY(-2px);
  box-shadow:
    0 22px 48px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(232, 163, 23, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.option strong {
  font-family: Syne, Manrope, sans-serif;
  font-size: 1.55rem;
  letter-spacing: -0.02em;
}
.option span:last-child {
  color: var(--muted);
  line-height: 1.5;
  font-size: 1rem;
  margin-top: auto;
}
.opt-kicker {
  color: var(--amber);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.onboard-legal {
  flex: 0 0 auto;
  width: min(720px, 100%);
  margin-top: 2rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.55;
}
.onboard-legal p {
  margin: 0 0 0.45rem;
}
.onboard-legal p:first-child {
  color: rgba(255, 255, 255, 0.72);
  font-weight: 700;
  font-size: 0.82rem;
}
.onboard-legal strong {
  color: rgba(255, 255, 255, 0.78);
  font-weight: 700;
}

.mac-box, .code-huge {
  display: inline-block;
  margin: 0.5rem 0 1rem;
  padding: 1rem 1.4rem;
  border-radius: 14px;
  background: rgba(232, 163, 23, 0.1);
  border: 1px solid rgba(232, 163, 23, 0.35);
  color: var(--amber);
  font-family: Syne, Manrope, sans-serif;
  font-weight: 800;
  letter-spacing: 0.18em;
  font-size: clamp(1.6rem, 3.5vw, 2.6rem);
}
.code-huge.xl { font-size: clamp(2.4rem, 6vw, 4.5rem); letter-spacing: 0.28em; }
.status { color: var(--muted); }
.api-hint {
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: 12px;
  background: var(--bg-elev);
  color: #cfc8b8;
  white-space: pre-wrap;
  font-size: 0.85rem;
  max-width: 720px;
  overflow: auto;
}

.qr-wrap {
  background: #fff;
  padding: 1.1rem;
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  margin: 0.35rem 0 1rem;
}
.qr-wrap img {
  display: block;
  width: min(280px, 70vw);
  height: auto;
}
.pair-centered .code-huge {
  margin: 0.25rem 0 0.75rem;
}

.hero {
  position: relative;
  min-height: 0;
  /* Banner alto o suficiente para o poster/capa não ficar cortado */
  height: clamp(280px, 44vh, 520px);
  margin: 0.35rem var(--safe-x) 0;
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  background:
    linear-gradient(90deg, rgba(7, 7, 11, 0.92) 18%, rgba(7, 7, 11, 0.45) 55%, rgba(7, 7, 11, 0.15) 78%, transparent),
    linear-gradient(0deg, rgba(7, 7, 11, 0.75) 0%, transparent 42%),
    radial-gradient(circle at 70% 40%, rgba(232, 163, 23, 0.22), transparent 45%),
    linear-gradient(135deg, #1a1520, #0d1520 55%, #1c1208);
  background-size: cover;
  background-position: center 20%;
  flex: 0 0 auto;
}
.hero-copy {
  position: relative;
  z-index: 1;
  padding: 1.5rem 1.6rem 1.6rem;
  max-width: 42rem;
  width: 100%;
}
.hero-kicker {
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 800;
  margin: 0 0 0.35rem;
}
.hero-copy h1 {
  font-family: Syne, Manrope, sans-serif;
  font-size: clamp(1.45rem, 3.2vw, 2.45rem);
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
#hero-meta { color: var(--muted); margin: 0 0 0.75rem; font-size: 0.9rem; }
.hero-actions { display: flex; gap: 0.65rem; flex-wrap: wrap; }

.rows {
  padding: 1rem 0 calc(1.5rem + var(--safe-b));
}
.row {
  margin-bottom: 1.4rem;
}
.row h2 {
  margin: 0 0 0.75rem;
  padding: 0 var(--safe-x);
  font-size: 1.15rem;
  font-weight: 800;
}
.rail {
  display: flex;
  gap: 0.85rem;
  overflow-x: auto;
  padding: 0.35rem var(--safe-x) 0.8rem;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }

.card {
  flex: 0 0 auto;
  width: 150px;
  border: 0;
  padding: 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-elev);
  color: inherit;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
/* Quadro padrão: conteúdo sempre centralizado (todo o site) */
.card-art {
  position: relative;
  overflow: hidden;
  background: #0e0e14;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Espaço no topo para a etiqueta não cobrir a imagem */
  padding: 1.55rem 0.35rem 0.45rem;
  font-family: Syne, Manrope, sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.55);
}
/* Canais: quadrado */
.card-live {
  width: 150px;
}
.card-live .card-art,
.card-art.logo-art {
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
}
/* VOD: retangular */
.card-poster {
  width: 150px;
}
.card-poster .card-art,
.card-poster .poster-art {
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 2 / 3;
  height: auto;
}
/* Logo/poster inteiro, centrado, sem corte — abaixo da etiqueta */
.card-art img {
  position: relative;
  z-index: 1;
  width: auto;
  height: auto;
  max-width: 88%;
  max-height: 88%;
  object-fit: contain;
  object-position: center center;
  margin: auto;
  padding: 0;
  background: transparent;
  display: block;
  pointer-events: none;
}
.card-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.card-body {
  flex: 0 0 auto;
  min-height: 3.6rem;
  padding: 0.7rem 0.8rem 0.9rem;
  display: grid;
  gap: 0.15rem;
  background: var(--bg-elev);
  position: relative;
  z-index: 1;
}
.card-body strong {
  display: block;
  font-size: 0.95rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-body span {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.empty {
  min-height: 60vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.7rem;
  text-align: center;
  color: var(--muted);
}
.empty h2 { color: var(--ink); margin: 0; }

.player {
  background: #000;
  overflow: hidden !important;
  z-index: 30;
  padding: 0;
  height: 100%;
  max-height: 100dvh;
}
.watch-layout {
  display: grid;
  /* Lateral larga o bastante p/ 4–5 colunas; player à direita */
  grid-template-columns: minmax(320px, 48vw) minmax(0, 1fr);
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  background: #000;
}
.watch-side {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  background: #0c0c12;
  border-right: 1px solid var(--line);
  z-index: 2;
}
.watch-side-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.7rem;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
  background: #0c0c12;
  z-index: 1;
}
.watch-side-head strong {
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Grelha 4–5 colunas — MESMOS cards da home (arte + infos abaixo) */
.watch-thumbs {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.55rem 0.35rem 0.55rem 0.55rem;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.55rem 0.45rem;
  align-content: start;
  align-items: start; /* evita cortar o card-body na grelha */
  grid-auto-rows: max-content;
  -webkit-overflow-scrolling: touch;
}
.watch-thumbs::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
}
.watch-thumbs .card {
  width: 100% !important;
  max-width: none;
  height: auto !important;
  min-height: 0;
  align-self: start;
  display: flex !important;
  flex-direction: column !important;
  border: 1px solid transparent;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-elev);
}
.watch-thumbs .card.is-active {
  border-color: rgba(232, 163, 23, 0.65);
  box-shadow: 0 0 0 1px rgba(232, 163, 23, 0.35);
}
.watch-thumbs .card-art {
  flex: 0 0 auto !important;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Infos sempre iguais à home — nunca esconder */
.watch-thumbs .card-body {
  display: grid !important;
  visibility: visible !important;
  opacity: 1 !important;
  flex: 0 0 auto !important;
  height: auto !important;
  min-height: 3.2rem !important;
  padding: 0.55rem 0.55rem 0.65rem !important;
  gap: 0.12rem;
  background: var(--bg-elev) !important;
  position: relative;
  z-index: 2;
}
.watch-thumbs .card-body strong {
  display: block !important;
  font-size: 0.78rem !important;
  color: var(--ink) !important;
  line-height: 1.25;
}
.watch-thumbs .card-body span {
  display: block !important;
  font-size: 0.68rem !important;
  color: var(--muted) !important;
}
.watch-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  height: 100%;
  background: #000;
  overflow: hidden;
}
.watch-stage:fullscreen,
.watch-stage.is-fs {
  width: 100vw;
  height: 100vh;
  background: #000;
}
#video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #000;
  object-fit: contain;
  object-position: center;
  z-index: 1;
  cursor: pointer;
  /* Camada GPU — escala mais limpa em tela cheia / painel */
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
/* Nitidez opcional (não cria 4K — só melhora a apresentação) */
#video.hq-enhance {
  filter: contrast(1.07) saturate(1.06) brightness(1.02);
}
.watch-stage:fullscreen #video,
.watch-stage.is-fs #video {
  width: 100%;
  height: 100%;
}
.player-ui {
  position: absolute;
  inset: 0 0 auto 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem var(--safe-x);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.75), transparent);
  opacity: 1;
  transition: opacity 0.25s ease;
  z-index: 3;
}
.player-ui.is-hidden { opacity: 0; pointer-events: none; }
.player-meta { display: grid; gap: 0.15rem; flex: 1; min-width: 0; }
.player-meta strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-meta span { color: var(--muted); font-size: 0.9rem; }
.player-actions { margin-left: auto; display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; }
.pip-btn {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
  border-radius: 10px;
  padding: 0.55rem 0.9rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.pip-btn.is-on {
  background: rgba(232, 163, 23, 0.22);
  border-color: rgba(232, 163, 23, 0.55);
  color: var(--amber);
}
.pip-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.player-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.8rem;
  background: rgba(0, 0, 0, 0.45);
}
.player-overlay[hidden] { display: none !important; }
.play-big {
  font-size: 1.25rem;
  padding: 1rem 1.8rem;
  border-radius: 999px;
}
.player-status {
  margin: 0;
  color: #f5f2ea;
  text-align: center;
  max-width: 28rem;
}
.player-status.is-error { color: #ff8e8e; }

body.is-web #video { z-index: 1; }
body.is-web .player-ui {
  transition: opacity 0.35s ease, transform 0.35s ease;
}
body.is-web .player-ui.is-hidden {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}

/* Perfis */
.profiles-screen {
  display: grid;
  place-items: center;
  padding: 2rem var(--safe-x) calc(2rem + var(--safe-b));
}
.profiles-wrap {
  width: min(920px, 100%);
  text-align: center;
}
.profiles-brand { font-size: 1.4rem; margin-bottom: 1.2rem; }
.profiles-wrap h1 {
  font-family: Syne, Manrope, sans-serif;
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  margin: 0 0 1.6rem;
}
.profiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-bottom: 1.4rem;
}
.profile-card {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  display: grid;
  gap: 0.55rem;
  justify-items: center;
  padding: 0.5rem;
  font: inherit;
}
.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-family: Syne, Manrope, sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}
.profile-avatar.add-av {
  background: rgba(255,255,255,0.08);
  border: 2px dashed rgba(255,255,255,0.25);
  color: var(--muted);
}
.profile-del {
  font-size: 0.75rem;
  color: #ff8e8e;
}
.profiles-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin-top: 0.25rem;
}
.profiles-wrap .app-legal {
  margin-top: 1.6rem !important;
}

/* Home: cabeçalho fixo + conteúdo com scroll interno (página nunca rola) */
.home {
  position: relative;
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
}
#home-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.25rem;
}
/* Dropdown de categorias: overlay (não empurra nem corta a página) */
.cat-dropdown {
  position: absolute;
  left: var(--safe-x);
  top: 4.6rem;
  z-index: 20;
  width: min(720px, calc(100% - 2 * var(--safe-x)));
  max-width: min(720px, calc(100% - 2 * var(--safe-x)));
  max-height: min(62dvh, calc(100dvh - 6rem));
  display: flex;
  flex-direction: column;
  background: #12121a;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}
.cat-dropdown[hidden] { display: none !important; }
.cat-dropdown-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  flex: 0 0 auto;
}
.cat-dropdown-close {
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
}
.cat-dropdown-tools {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 0.55rem;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.cat-tool {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}
.cat-tool span {
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.cat-input {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  color: var(--ink);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  font: inherit;
  font-size: 0.9rem;
  outline: none;
}
.cat-input:focus {
  border-color: rgba(232, 163, 23, 0.55);
}
select.cat-input {
  cursor: pointer;
}
.cat-dropdown-list {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.45rem;
  display: grid;
  gap: 0.4rem;
  flex: 1 1 auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}
.cat-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: inherit;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  font: inherit;
  cursor: pointer;
  min-height: 56px;
}
.cat-item strong { display: block; font-size: 1rem; }
.cat-item span { color: var(--muted); font-size: 0.82rem; }
.cat-item.is-4k { border-color: rgba(160, 130, 255, 0.4); }
.cat-chevron { font-size: 1.4rem; color: var(--muted); }

.browse-hint {
  margin: 0 var(--safe-x) 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

/* Grid posters / canais — mesma grelha em todos os aparelhos */
.poster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.85rem;
  padding: 0.5rem var(--safe-x) 1rem;
}
.poster-grid .card {
  width: 100%;
}
.poster-grid.grid-live {
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
}
.rail .card-live,
.rail .card-poster {
  width: 150px;
}
/* Nunca forçar 2:3 em canais — sobrescreve regras antigas */
.rail .card-live .card-art,
.rail-posters .card-live .card-art,
.watch-thumbs .card-live .card-art,
.poster-grid .card-live .card-art {
  aspect-ratio: 1 / 1 !important;
}
.rail .card-poster .card-art,
.rail-posters .card-poster .card-art,
.watch-thumbs .card-poster .card-art,
.poster-grid .card-poster .card-art {
  aspect-ratio: 2 / 3 !important;
}
.watch-thumbs .card-art img,
.poster-grid .card-art img,
.rail .card-art img {
  max-width: 82%;
  max-height: 82%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center center;
}
.has-trailer {
  display: inline-block;
  margin-top: 0.2rem;
  font-size: 0.7rem;
  color: var(--amber);
  font-weight: 800;
}
.card-seen {
  position: absolute;
  right: 0.4rem;
  bottom: 0.4rem;
  z-index: 2;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #1db954;
  color: #041208;
  font-size: 0.78rem;
  font-weight: 900;
  box-shadow: 0 2px 8px rgba(0,0,0,0.45);
}
.card-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  height: 4px;
  background: rgba(0,0,0,0.55);
}
.card-progress i {
  display: block;
  height: 100%;
  background: var(--amber, #e8a317);
}

/* Modal continuar / do início */
.resume-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.78);
  display: grid;
  place-items: center;
  padding: 1rem;
}
.resume-modal[hidden] { display: none !important; }
.resume-card {
  width: min(420px, 100%);
  background: #14141e;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.35rem 1.25rem 1.25rem;
  position: relative;
  box-shadow: 0 24px 60px rgba(0,0,0,0.55);
}
.resume-kicker {
  margin: 0 0 0.35rem;
  color: var(--amber, #e8a317);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.resume-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.25rem;
  line-height: 1.25;
}
.resume-meta {
  margin: 0 0 1.15rem;
  color: var(--muted);
  font-size: 0.92rem;
}
.resume-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}
.resume-actions .btn { flex: 1 1 140px; }
.load-more {
  display: block;
  margin: 0 auto calc(1.5rem + var(--safe-b));
}

/* Busca global */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(0, 0, 0, 0.72);
  display: grid;
  place-items: start center;
  padding: max(1rem, env(safe-area-inset-top)) 1rem 1rem;
  overflow: auto;
}
.search-modal[hidden] { display: none !important; }
.search-card {
  width: min(960px, 100%);
  max-height: min(88dvh, 900px);
  background: #12121a;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  overflow: hidden;
}
.search-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.search-input {
  font-size: 1.05rem !important;
  padding: 0.75rem 0.9rem !important;
}
.search-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}
/* Mesmo card padrão da home (makeCard) — largura fixa como nos rails */
.search-results {
  overflow: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 0.85rem;
  padding: 0.35rem 0 0.5rem;
  flex: 1 1 auto;
  min-height: 120px;
}
.search-results .card-live,
.search-results .card-poster {
  width: 150px;
}
.search-results .card-live .card-art {
  aspect-ratio: 1 / 1 !important;
}
.search-results .card-poster .card-art {
  aspect-ratio: 2 / 3 !important;
}

/* Trailer modal */
.trailer-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0,0,0,0.72);
  display: grid;
  place-items: center;
  padding: 1rem;
}
.trailer-modal[hidden] { display: none !important; }
.trailer-card {
  width: min(920px, 100%);
  background: #12121a;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
  position: relative;
}
.trailer-close {
  position: absolute;
  top: 0.6rem;
  right: 0.7rem;
  border: 0;
  background: rgba(255,255,255,0.1);
  color: #fff;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  cursor: pointer;
}
.trailer-frame {
  margin-top: 0.5rem;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
}
.trailer-frame iframe,
.trailer-frame video {
  width: 100%;
  height: 100%;
  border: 0;
}

@media (max-width: 1100px) {
  .option-grid,
  body.is-web .option-grid { grid-template-columns: 1fr; max-width: 420px; margin: 0 auto; }
  .option { min-height: 0; }
  .pair-panel.pair-centered { justify-content: flex-start; padding-top: 1.25rem; }
  .onboard { justify-content: flex-start; padding-top: 2rem; }
}

/* Mobile / tablet */
@media (max-width: 820px) {
  :root { --safe-x: max(0.85rem, env(safe-area-inset-left)); }
  .topbar {
    padding-top: max(0.8rem, env(safe-area-inset-top));
    gap: 0.6rem;
  }
  .home-bar { align-items: center; }
  .logo-sm { font-size: 1.1rem; }
  .nav-btn { padding: 0.55rem 0.7rem; font-size: 0.88rem; }
  .profile-chip { margin-left: auto; }
  .hero {
    height: clamp(220px, 38vh, 360px);
    margin: 0.25rem var(--safe-x) 0;
    border-radius: 14px;
  }
  .hero-copy { padding: 1.1rem 1.1rem 1.2rem; }
  .hero-copy h1 { font-size: 1.25rem; }
  .cat-dropdown {
    top: 5.8rem;
    max-height: min(55dvh, calc(100dvh - 7rem));
  }
  .cat-dropdown-tools {
    grid-template-columns: 1fr;
  }
  .search-results .card-live,
  .search-results .card-poster,
  .rail .card-live,
  .rail .card-poster,
  .card-live,
  .card-poster { width: 130px; }
  .poster-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 0.65rem;
  }
  .profiles-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-avatar { width: 84px; height: 84px; }
  .pip-btn#player-pip { display: none; } /* PiP limitado no mobile */
  .player-ui { padding: 0.9rem var(--safe-x); }
  .watch-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(38vh, 1fr) minmax(180px, 40vh);
    height: 100%;
    max-height: 100dvh;
    overflow: hidden;
  }
  .watch-stage { order: 1; min-height: 0; height: 100%; }
  .watch-side {
    order: 2;
    min-height: 0;
    max-height: none;
    height: 100%;
    border-right: 0;
    border-top: 1px solid var(--line);
  }
  .watch-thumbs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .cat-dropdown {
    max-height: min(62dvh, calc(100dvh - 6.5rem));
    max-width: none;
  }
}

@media (max-width: 1100px) and (min-width: 821px) {
  .watch-layout {
    grid-template-columns: minmax(300px, 52vw) minmax(0, 1fr);
  }
  .watch-thumbs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .option { min-height: 0; }
  .code-huge.xl { font-size: 2rem; letter-spacing: 0.16em; }
  .poster-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .watch-thumbs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.35rem;
    padding: 0.35rem;
  }
}
