* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family:
    Inter,
    Segoe UI,
    Arial,
    sans-serif;
  background: linear-gradient(135deg, #eef2f7 0%, #e2eaf2 45%, #dfe9f5 100%);
  background-attachment: fixed;
  color: #26313b;
}
.app-shell {
  min-height: 100vh;
  border-top: 4px solid #8b3ffc;
}
.topbar {
  height: 70px;
  background: #fff;
  border-bottom: 1px solid #e7ebef;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
}
.brand {
  font-size: 20px;
  font-weight: 750;
  color: #15232d;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 9px;
  background: #10232f;
  color: #fff;
  margin-right: 9px;
}
.top-actions {
  display: flex;
  gap: 18px;
  align-items: center;
}
.icon-btn {
  border: 0;
  background: transparent;
  font-size: 19px;
  cursor: pointer;
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #10232f;
  color: white;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
}
.content {
  padding: 24px 30px 40px;
  max-width: 1500px;
  margin: auto;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.08fr 1fr;
  gap: 18px;
}
.panel {
  background: #fff;
  border: 1px solid #e0e5ea;
  border-radius: 4px;
  overflow: hidden;
}
.panel-title {
  height: 40px;
  padding: 11px 15px;
  font-size: 13px;
  font-weight: 750;
  border-bottom: 1px solid #edf0f3;
}
.panel-title span {
  margin-right: 7px;
}
.hero-card {
  height: 158px;
  margin: 12px;
  background: #0d1d27;
  border-radius: 2px;
  color: #fff;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.hero-copy {
  padding: 22px 12px 14px 82px;
  max-width: 64%;
  z-index: 1;
}
.eyebrow {
  font-size: 10px;
  background: #7cc7ff;
  color: #12354c;
  padding: 3px 8px;
  border-radius: 10px;
}
.hero-copy h2 {
  font-size: 17px;
  margin: 8px 0 5px;
}
.hero-copy p {
  font-size: 12px;
  line-height: 1.45;
  color: #d9e3e9;
  margin: 0;
}
.hero-art {
  position: absolute;
  right: 35px;
  bottom: 0;
  width: 105px;
  height: 132px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(135deg, #b9c6c9, #526d77);
  display: grid;
  place-items: center;
  font-size: 48px;
}
.slide-arrow {
  border: 0;
  background: transparent;
  color: #cfd9e2;
  font-size: 30px;
  cursor: pointer;
  z-index: 2;
}
.slider-dots {
  display: flex;
  gap: 7px;
  margin-top: 16px;
}
.slider-dots span {
  width: 22px;
  height: 2px;
  background: #71818b;
}
.slider-dots span.active {
  background: #fff;
}
.highlight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)); /* duas listas verticais */
  gap: 2px 10px;
  padding: 10px 12px;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 182px; /* alinha com o painel "Recentes" (hero card 158px + margens) */
  align-content: start;
  /* Scroll discreto: barra fina, invisível até passar o rato na lista */
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}
.highlight-grid:hover {
  scrollbar-color: #c3ced8 transparent;
}
.highlight-grid::-webkit-scrollbar {
  width: 6px;
}
.highlight-grid::-webkit-scrollbar-track {
  background: transparent;
}
.highlight-grid::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 3px;
}
.highlight-grid:hover::-webkit-scrollbar-thumb {
  background: #c3ced8;
}
.highlight {
  display: flex;
  gap: 10px;
  align-items: center;
  cursor: pointer;
  width: 100%;
  padding: 5px 6px;
  border-radius: 6px;
}
.highlight-grid .mini-icon {
  width: 30px;
  height: 30px;
  font-size: 16px;
}
.mini-icon,
.app-icon {
  display: grid;
  place-items: center;
  border-radius: 5px;
  flex: none;
  background: #eef2f5;
}
.mini-icon {
  width: 39px;
  height: 39px;
  font-size: 21px;
}
.highlight span:last-child {
  font-size: 11px;
  font-weight: 700;
  /* Nome do canal numa linha, com reticências se for longo */
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin: 20px 0 14px;
  flex-wrap: wrap;
}
.tabs {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.tab {
  border: 1px solid #b9c3ca;
  background: #fff;
  padding: 9px 14px;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.tab.active {
  background: #10232f;
  color: #fff;
  border-color: #10232f;
}
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid #dce3e8;
  padding: 8px 12px;
  border-radius: 3px;
  min-width: 220px;
}
.search input {
  border: 0;
  outline: 0;
  width: 100%;
  font-size: 12px;
}
.catalog {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 10px;
  overflow-x: hidden;
}
.app-card {
  background: #fff;
  border: 1px solid #dfe5e9;
  border-radius: 12px;
  min-height: 190px;
  padding: 13px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.badges {
  position: absolute;
  right: 8px;
  top: 8px;
  display: flex;
  gap: 3px;
}
.badge {
  font-size: 8px;
  padding: 3px 5px;
  border-radius: 5px;
  background: #d9f7e8;
  color: #07854b;
}
.badge.hot {
  background: #e3f1ff;
  color: #2673b8;
}
.card-head {
  display: flex;
  gap: 9px;
  align-items: center;
  margin-bottom: 12px;
}
.app-icon {
  width: 31px;
  height: 31px;
  font-size: 19px;
}
.app-name {
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}
.app-desc {
  font-size: 10px;
  line-height: 1.55;
  color: #4e5d67;
  min-height: 58px;
}
.card-btn {
  margin-top: auto;
  border: 0;
  border-radius: 2px;
  padding: 10px 8px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  background: #10232f;
  color: #fff;
}
.card-btn.primary {
  background: #08a765;
}
.card-btn:hover {
  filter: brightness(0.95);
}
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #0008;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop.open {
  display: flex;
}
.modal {
  background: #fff;
  border-radius: 8px;
  max-width: 460px;
  width: 100%;
  padding: 28px;
  position: relative;
  box-shadow: 0 20px 80px #0003;
  max-height: 88vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.modal-close {
  position: absolute;
  right: 12px;
  top: 8px;
  border: 0;
  background: transparent;
  font-size: 28px;
  cursor: pointer;
}
.modal h2 {
  margin: 0 0 10px;
}
.modal p {
  font-size: 13px;
  line-height: 1.6;
  color: #52616b;
}
.modal .card-btn {
  width: 100%;
  margin-top: 10px;
}
@media (max-width: 1200px) {
  .catalog {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-height: calc(100vh - 280px);
  }
}
@media (max-width: 900px) {
  .topbar {
    padding: 0 16px;
  }
  .content {
    padding: 15px;
  }
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .hero-copy {
    padding-left: 35px;
  }
  .hero-art {
    right: 22px;
    width: 85px;
  }
  .catalog {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: calc(100vh - 320px);
  }
  .search {
    width: 100%;
  }
}
@media (max-width: 420px) {
  .catalog {
    grid-template-columns: 1fr;
  }
}

/* ================= Tema escuro (sobreposições) ================= */
body {
  background: linear-gradient(135deg, #101820 0%, #0d1520 45%, #0b1220 100%);
  color: #dfe7ee;
}
body::before {
  background:
    radial-gradient(
      600px 380px at 12% -5%,
      rgba(139, 63, 252, 0.16),
      transparent 70%
    ),
    radial-gradient(
      700px 420px at 92% 8%,
      rgba(8, 167, 101, 0.13),
      transparent 70%
    ),
    radial-gradient(
      650px 500px at 50% 110%,
      rgba(124, 199, 255, 0.08),
      transparent 70%
    );
}
.topbar {
  background: #161f2a;
  border-bottom: 1px solid #232e3c;
}
.brand {
  color: #f0f5f9;
}
.icon-btn {
  color: #cfd9e2;
}
.panel {
  background: #161f2a;
  border-color: #232e3c;
}
.panel-title {
  color: #eef3f7;
  border-bottom-color: #232e3c;
}
.highlight span:last-child {
  color: #eef3f7;
}
.toolbar {
  color: #dfe7ee;
}
.tab {
  background: #1b2531;
  border-color: #31404f;
  color: #cfd9e2;
}
.tab.active {
  background: var(--accent, #08a765);
  border-color: var(--accent, #08a765);
  color: #fff;
}
.search {
  background: #1b2531;
  border-color: #31404f;
}
.search input {
  color: #eef3f7;
}
.app-card {
  background: #1b2531;
  border-color: #31404f;
  border-radius: 12px;
}
.app-card .app-icon {
  color: #9fb2c0;
}
.app-name {
  color: #eef3f7;
}
.app-desc {
  color: #9fb2c0;
}
.card-btn {
  background: #2a3947;
  color: #eef3f7;
}
.card-btn.primary {
  background: var(--accent, #08a765);
  color: #04220f;
}
.badge {
  background: #123c2b;
  color: #7ce3b0;
}
.badge.hot {
  background: #123347;
  color: #7cc7ff;
}
.carousel::-webkit-scrollbar-track {
  background: #161f2a;
}
.carousel::-webkit-scrollbar-thumb {
  background: #31404f;
}
.car-arrow:hover {
  color: var(--accent, #08a765);
}
.car-dots span {
  background: #1b2531;
  border-color: #31404f;
}
.car-dots span.active {
  background: var(--accent, #08a765);
  border-color: var(--accent, #08a765);
}
.modal {
  background: #161f2a;
  color: #dfe7ee;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.6);
}
.modal h2,
.modal h3 {
  color: #f0f5f9;
}
.modal p {
  color: #9fb2c0;
}
.modal-close {
  color: #cfd9e2;
}
.menu-row {
  border-bottom-color: #232e3c;
}
.menu-row small,
.menu-help {
  color: #9fb2c0;
}
.src-btn {
  background: #1b2531;
  border-color: #31404f;
  color: #cfd9e2;
}
.src-btn.primary {
  background: var(--accent, #08a765);
  border-color: var(--accent, #08a765);
  color: #04220f;
}
.swatch.active {
  border-color: #f0f5f9;
}
.modal-backdrop {
  background: rgba(4, 8, 13, 0.72);
}

/* === Lógica IPTV (XPlayer) — adições mínimas, visual existente inalterado === */
.app-icon img,
.mini-icon img {
  max-width: 80%;
  max-height: 80%;
  object-fit: contain;
}
.badge.star {
  cursor: pointer;
  font-size: 10px;
  background: #fff3cd;
  color: #8a6d00;
  padding: 4px 6px;
}
[data-dark] .badge.star {
  background: #3a3320;
  color: #ffd76e;
}
/* Favoritos (lista vertical): variantes do tema escuro */
[data-dark] .highlight-grid:hover {
  scrollbar-color: #3a4c5e transparent;
}
[data-dark] .highlight-grid:hover::-webkit-scrollbar-thumb {
  background: #3a4c5e;
}
.badge.star:hover {
  background: #ffe9a8;
}
.modal.wide {
  max-width: 720px;
}

/* === Modal "Todos os canais" (tela cheia, pesquisa + cartões do carrossel) === */
.modal.tall {
  max-width: 860px !important;
  overflow: visible !important;
  display: flex;
  flex-direction: column;
  height: auto;
  max-height: none !important;
  min-height: 0;
}
.modal.tall .modal-close {
  position: absolute;
  z-index: 5;
  color: #eef3f7;
}
.modal.tall h2,
.modal.tall .allch-search {
  flex: none;
}
.modal.tall #modalContent {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: visible;
}
.modal.tall .allch-grid {
  display: grid;
  max-height: none;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.allch-search {
  margin: 10px 0 12px;
}
.allch-search input {
  width: 100%;
  background: #1b2531;
  border: 1px solid #31404f;
  color: #eef3f7;
  padding: 9px 12px;
  border-radius: 4px;
  font-size: 13px;
  outline: none;
}
.allch-search input:focus {
  border-color: var(--accent, #08a765);
}
.allch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--card-w, 220px), 1fr));
  gap: 12px;
  justify-content: center;
  max-height: none;
  flex: 1;
  min-height: 0;
  overflow: visible;
  padding: 4px 6px 8px;
}
.allch-grid .app-card {
  min-height: 180px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: visible;
}
@media (max-width: 700px) {
  .allch-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}
.ch-video {
  width: 100%;
  aspect-ratio: 16/9;
  background: #0d1d27;
  border-radius: 4px;
  margin: 4px 0 10px;
}
.src-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #edf0f3;
  font-size: 12px;
}
.src-row .grow {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.src-btn {
  border: 1px solid #b9c3ca;
  background: #fff;
  border-radius: 2px;
  padding: 5px 9px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  flex: none;
}
.src-btn.primary {
  background: #08a765;
  color: #fff;
  border-color: #08a765;
}
.src-btn:disabled {
  opacity: 0.45;
  cursor: default;
}
.src-form input {
  width: 100%;
  border: 1px solid #dce3e8;
  padding: 8px 10px;
  border-radius: 3px;
  font-size: 12px;
  margin-bottom: 8px;
}
.hero-art {
  cursor: pointer;
}

/* === Carrossel estilo Netflix (linhas horizontais por categoria) === */
.car-section {
  grid-column: 1/-1;
  background: #fff;
  border: 1px solid #e0e5ea;
  border-radius: 4px;
  overflow: hidden;
}
.car-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 15px;
  font-size: 13px;
  font-weight: 750;
  border-bottom: 1px solid #edf0f3;
}
.car-head small {
  color: #7b8891;
  font-weight: 400;
  font-size: 11px;
}
/* Botão "Todos os canais" — abre o modal em tela cheia */
.car-title {
  appearance: none;
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 4px;
  transition: background 0.15s;
}
.car-title small {
  color: #7b8891;
  font-weight: 400;
  font-size: 11px;
}
.car-title:hover {
  background: var(--accent, #08a765);
  color: #04220f;
}
.car-title:hover small {
  color: #04220f;
}
.car-body {
  position: relative;
}
/* Setas do carrossel - estilo simples (mesmo que .slide-arrow do hero) */
.car-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  border: 0;
  background: rgba(22, 31, 42, 0.7);
  color: #eef3f7;
  font-size: 32px;
  cursor: pointer;
}
.car-arrow:hover {
  background: rgba(255, 255, 255, 0.1);
}
.car-arrow.left {
  left: 10px;
}
.car-arrow.right {
  right: 10px;
}
.car-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 2px 0 13px;
}
.car-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #b9c3ca;
  cursor: pointer;
}
.car-dots span.active {
  background: #10232f;
  border-color: #10232f;
}
.carousel {
  display: grid;
  grid-template-rows: repeat(2, auto);
  grid-auto-flow: column;
  grid-auto-columns: 220px;
  gap: 14px;
  overflow-x: auto;
  padding: 14px 15px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
}
.carousel::-webkit-scrollbar {
  height: 8px;
}
.carousel::-webkit-scrollbar-thumb {
  background: #cdd6dc;
  border-radius: 4px;
}
@media (max-width: 700px) {
  .carousel {
    grid-auto-columns: var(--card-w-m, 180px);
  }
}

/* === Menu (opções do XPlayer) — mesmo estilo dos painéis existentes === */
.carousel {
  grid-auto-columns: var(--card-w, 220px);
}
.menu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid #edf0f3;
  font-size: 13px;
}
.menu-row .grow {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.menu-row small {
  color: #7b8891;
  font-size: 11px;
}
.menu-row h3 {
  margin: 0;
}
.modal h3 {
  margin: 16px 0 4px;
  font-size: 13px;
  color: #15232d;
}
.menu-help {
  font-size: 12px;
  color: #7b8891;
  margin: 6px 0 0;
}
body.modal-open {
  overflow: hidden;
}
.swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  vertical-align: middle;
  margin-left: 4px;
}
.swatch.active {
  border-color: #10232f;
}
/* Cor de destaque definida pelo menu (var --accent; o valor por omissão mantém o verde atual) */
.card-btn.primary {
  background: var(--accent, #08a765);
}
.src-btn.primary {
  background: var(--accent, #08a765);
  border-color: var(--accent, #08a765);
}
.car-dots span.active {
  background: var(--accent, #10232f);
  border-color: var(--accent, #10232f);
}
.badge.star {
  color: var(--accent, #8a6d00);
}
/* Pré-visualização estilo YouTube: vídeo silencioso cobre o cartão no hover */
.card-cover {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  display: block;
}
.card-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(10, 16, 24, 0.25) 0%,
    rgba(10, 16, 24, 0.88) 100%
  );
}
.app-card .card-head,
.app-card .app-desc,
.app-card .card-btn {
  position: relative;
  z-index: 2;
}
.app-card .badges {
  z-index: 4;
}
.card-preview {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: none;
  background: #000;
}
.app-card.previewing .card-preview {
  display: block;
}
.card-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
/* removed */
.app-card.previewing .app-name {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}
.app-card.previewing .card-btn {
  position: relative;
  z-index: 2;
  opacity: 0.9;
}
/* Telinha "Visto recentemente": o canal toca em direto, silenciado, no painel inteiro */
.hero-card > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  background: #000;
}
.hero-shade {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(13, 29, 39, 0.94) 0%,
    rgba(13, 29, 39, 0.6) 55%,
    rgba(13, 29, 39, 0.25) 100%
  );
}
.hero-card.live .hero-art {
  z-index: 3;
}
/* A caixinha do logo fica SEMPRE visível acima do vídeo/backdrop. */
.hero-card .hero-art {
  z-index: 3;
}
.hero-card .hero-art img {
  position: relative;
  z-index: 1;
}
.hero-card .mute-tag {
  position: absolute;
  right: 44px;
  bottom: 10px;
  z-index: 5;
  font-size: 10px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border-radius: 8px;
  padding: 4px 8px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  gap: 4px;
}
.hero-card .mute-tag:hover {
  background: rgba(0, 0, 0, 0.85);
}
.hero-card .mute-tag svg {
  width: 13px;
  height: 13px;
  fill: #fff;
  vertical-align: -2px;
}

/* === Tema escuro — parte 2 (anula as regras claras que ficaram depois do bloco acima) === */
.car-section {
  background: #161f2a;
  border-color: #232e3c;
}
.car-head {
  color: #eef3f7;
  border-bottom-color: #232e3c;
}
.car-head small {
  color: #9fb2c0;
}
.car-arrow:hover {
  color: var(--accent, #08a765);
}
.car-dots span {
  background: #1b2531;
  border-color: #31404f;
}
.car-dots span.active {
  background: var(--accent, #08a765);
  border-color: var(--accent, #08a765);
}
.badge.star {
  background: #3a3320;
  color: #ffd76e;
}
.badge.star:hover {
  background: #4a4028;
}
.src-btn {
  background: #1b2531;
  border-color: #31404f;
  color: #cfd9e2;
}
.src-btn.primary {
  background: var(--accent, #08a765);
  border-color: var(--accent, #08a765);
  color: #04220f;
}
.src-row {
  border-bottom-color: #232e3c;
}
.src-form input {
  background: #1b2531;
  border-color: #31404f;
  color: #eef3f7;
}
.src-form input::placeholder {
  color: #71828f;
}
.search input {
  background: transparent;
}
.modal h2,
.modal h3 {
  color: #f0f5f9;
}
.modal p {
  color: #9fb2c0;
}
.menu-row {
  border-bottom-color: #232e3c;
}
.menu-row small,
.menu-help {
  color: #9fb2c0;
}
.swatch.active {
  border-color: #f0f5f9;
}
.card-btn {
  background: #2a3947;
  color: #eef3f7;
}
.card-btn.primary {
  background: var(--accent, #08a765);
  color: #04220f;
}
/* Alinhamento dos icones SVG inline */
.tab svg,
.icon-btn svg,
.src-btn svg,
.card-btn svg,
.panel-title svg,
.car-title svg,
.modal h2 svg,
.modal h3 svg,
.brand-mark svg {
  vertical-align: -0.15em;
}
.badge.star svg,
.mini-icon svg,
.app-icon svg,
.hero-art svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: currentColor;
}
.tab svg,
.src-btn svg,
.card-btn svg {
  width: 0.95em;
  height: 0.95em;
}
.icon-btn svg {
  width: 18px;
  height: 18px;
}
.panel-title svg,
.car-title svg {
  color: var(--accent, #08a765);
}
.brand-mark svg {
  color: #8b3ffc;
}

/* === CORREÇÃO MODAL TODOS OS CANAIS === */
.allch-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
  gap: 16px !important;
  padding: 20px !important;
  max-height: calc(100vh - 200px) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  background: #0b1220 !important;
  border-radius: 8px !important;
}
.allch-grid .app-card {
  min-height: 200px !important;
  height: 220px !important;
  padding: 0 !important;
  background: #161f2a !important;
  border: 1px solid #2a3a4a !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
}
.allch-grid .card-cover {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;

  object-fit: cover !important;
  z-index: 0 !important;
  background: #0b1220 !important;
}
.allch-grid .card-cover::after {
  content: "" !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;

  background: linear-gradient(
    to top,
    rgba(11, 18, 32, 0.95) 0%,
    rgba(11, 18, 32, 0.3) 50%,
    rgba(11, 18, 32, 0.1) 100%
  ) !important;
  z-index: 1 !important;
}
.allch-grid .card-preview {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;

  object-fit: cover !important;
  z-index: 2 !important;
  opacity: 0 !important;
  transition: opacity 0.3s ease !important;
}
.allch-grid .app-card:hover .card-preview {
  opacity: 1 !important;
}

.allch-grid .app-card.previewing .card-preview {
  opacity: 1 !important;
}
.allch-grid .card-head {
  position: relative !important;
  z-index: 3 !important;
  padding: 16px !important;
  margin-bottom: 0 !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-end !important;

  pointer-events: none !important;
}
.allch-grid .card-head * {
  pointer-events: auto !important;
}
.allch-grid .app-name {
  color: #eef3f7 !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  margin-bottom: 8px !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5) !important;
}
.allch-grid .app-desc {
  color: #9fb2c0 !important;
  font-size: 14px !important;
  min-height: 0 !important;
  padding: 0 16px !important;
  margin-bottom: 12px !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
}
.allch-grid .card-btn {
  pointer-events: auto !important;
  position: relative !important;
  z-index: 4 !important;
  width: calc(100% - 32px) !important;
  margin: 0 16px 16px !important;
  flex: 0 0 auto !important;
}
.allch-grid .badges {
  position: absolute !important;
  top: 12px !important;
  right: 12px !important;
  z-index: 5 !important;
}
.modal.tall {
  max-height: 92vh !important;
  height: auto !important;
  display: flex !important;
  flex-direction: column !important;
}
.modal.tall .modal-content {
  flex: 1 !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}
.allch-search {
  padding: 16px !important;
  border-bottom: 1px solid #2a3a4a !important;
  background: #161f2a !important;
}
.allch-search input {
  width: 100% !important;
  padding: 12px 16px !important;
  background: #0b1220 !important;
  border: 1px solid #31404f !important;
  border-radius: 8px !important;
  color: #eef3f7 !important;
  font-size: 14px !important;
  outline: none !important;
}
.allch-search input::placeholder {
  color: #5a6b7c !important;
}
.allch-search input:focus {
  border-color: var(--accent, #08a765) !important;
}
@media (max-width: 700px) {
  .allch-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
    gap: 12px !important;
    padding: 16px !important;
  }
  .allch-grid .app-card {
    min-height: 200px !important;
    height: 200px !important;
  }
  .allch-grid .app-name {
    font-size: 14px !important;
  }
  .allch-grid .app-desc {
    font-size: 12px !important;
  }
}
.allch-grid::-webkit-scrollbar {
  width: 8px !important;
}
.allch-grid::-webkit-scrollbar-track {
  background: #0b1220 !important;
}
.allch-grid::-webkit-scrollbar-thumb {
  background: #31404f !important;
  border-radius: 4px !important;
}
.allch-grid::-webkit-scrollbar-thumb:hover {
  background: #4a5a6a !important;
}

/* === Carrossel: cartões quadrados com botão Assistir sem quebra === */
.carousel .app-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 220px;
  height: 220px;
  overflow: hidden;
  border-radius: 12px;
  background: #1b2531;
  border: 1px solid #31404f;
}

.carousel .card-cover {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.carousel .card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel .card-preview {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.carousel .app-card:hover .card-preview {
  opacity: 1;
}

.carousel .app-card.previewing .card-preview {
  opacity: 1;
}

.carousel .badges {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
}

.carousel .card-head {
  position: relative;
  z-index: 2;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: auto;
}

.carousel .app-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 16px;
  margin-bottom: 4px;
}

.carousel .app-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

.carousel .app-name {
  font-size: 14px;
  font-weight: 600;
  color: #eef3f7;
  line-height: 1.2;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.carousel .app-desc {
  font-size: 11px;
  color: #9fb2c0;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.carousel .card-btn {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  border: 0;
  border-radius: 0;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 700px) {
  .carousel .app-card {
    min-height: 180px;
    height: 180px;
  }
  .carousel .app-name {
    font-size: 12px;
  }
  .carousel .app-desc {
    font-size: 10px;
  }
  .carousel .card-btn {
    padding: 6px 10px;
    font-size: 12px;
  }
}

/* === Ajustes para telemóvel (Chrome Android) === */
* {
  -webkit-tap-highlight-color: transparent;
}
@media (max-width: 700px) {
  /* O catálogo acompanha o scroll da página (sem scroll interno duplo) */
  .catalog {
    max-height: none !important;
    overflow: visible;
  }
  .topbar {
    height: 58px;
    padding: 0 10px;
  }
  /* Alvos de toque confortáveis (>= 44px) */
  .icon-btn {
    min-width: 44px;
    min-height: 44px;
    display: inline-grid;
    place-items: center;
  }
  .tab {
    padding: 11px 13px;
    font-size: 12px;
  }
  .badge.star {
    font-size: 14px;
    padding: 9px 11px;
  }
  .search {
    min-width: 0;
    width: 100%;
    padding: 11px 12px;
  }
  /* Evita o zoom automático ao focar a pesquisa */
  .search input {
    font-size: 16px;
  }
  /* Modal mais aproveitado em ecrã pequeno */
  .modal-backdrop {
    padding: 8px;
  }
  .modal {
    padding: 18px 12px;
    max-height: 92vh;
  }
  /* Setas do carrossel não fazem sentido em toque (scroll nativo) */
  .car-arrow {
    display: none;
  }
  .slide-arrow {
    display: none;
  }
  .hero-copy {
    padding-left: 20px;
    max-width: 78%;
  }
  .hero-art {
    right: 12px;
    width: 70px;
    height: 100px;
  }
}
@media (max-width: 420px) {
  .avatar {
    display: none;
  }
}

/* Flag icons */
.flag-icon {
  width: 20px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
  vertical-align: -2px;
  display: inline-block;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.flag-fallback {
  font-size: 16px;
  line-height: 1;
}
.country-flag .flag-icon {
  width: 22px;
  height: 16px;
}
.item-flag .flag-icon {
  width: 22px;
  height: 16px;
}
.badge.flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 4px;
  background: rgba(16, 26, 36, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
.badge.flag .flag-icon {
  display: block;
  box-shadow: none;
}

/* ================= Seletor de Países ================= */
.country-selector {
  position: relative;
}
.country-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #202b38;
  border: 1px solid #334455;
  border-radius: 8px;
  padding: 6px 12px;
  color: #eef3f7;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.country-btn:hover {
  background: #283747;
  border-color: #44596e;
}
.country-btn:focus-visible {
  outline: 2px solid var(--accent, #08a765);
}
.country-flag {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}
.item-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  flex-shrink: 0;
  line-height: 1;
}
.country-name {
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.country-caret {
  font-size: 10px;
  opacity: 0.7;
  margin-left: 2px;
  transition: transform 0.2s ease;
}
.country-selector.open .country-caret {
  transform: rotate(180deg);
}

.country-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 290px;
  background: #161f2a;
  border: 1px solid #2a3848;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: countryDropdownFade 0.15s ease-out;
}
.country-dropdown[hidden] {
  display: none !important;
}
@keyframes countryDropdownFade {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.country-search-wrap {
  padding: 10px 12px;
  border-bottom: 1px solid #232e3c;
  background: #121a24;
}
.country-search-input {
  width: 100%;
  padding: 8px 12px;
  background: #1b2634;
  border: 1px solid #314254;
  border-radius: 6px;
  color: #fff;
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
}
.country-search-input:focus {
  border-color: var(--accent, #08a765);
}
.country-list {
  max-height: 340px;
  overflow-y: auto;
  padding: 6px 0;
  scrollbar-width: thin;
}
.country-list::-webkit-scrollbar {
  width: 6px;
}
.country-list::-webkit-scrollbar-thumb {
  background: #2a3848;
  border-radius: 3px;
}
.country-section-title {
  padding: 8px 14px 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #7b8e9f;
  font-weight: 700;
}
.country-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 14px;
  background: transparent;
  border: 0;
  color: #d8e2eb;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease;
  user-select: none;
}
.country-item:hover, .country-item.highlighted {
  background: #223040;
  color: #fff;
}
.country-item.active {
  background: rgba(8, 167, 101, 0.18);
  color: var(--accent, #08a765);
  font-weight: 600;
}
.country-item .item-flag {
  font-size: 16px;
  line-height: 1;
}
.country-item .item-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.country-empty {
  padding: 16px;
  text-align: center;
  color: #7b8e9f;
  font-size: 12px;
}

/* ================= Tela de Bloqueio (Lockscreen) ================= */
.lock-screen {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 25%, #182635 0%, #0a1017 100%);
  padding: 20px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  user-select: none;
}
.lock-card {
  max-width: 410px;
  width: 100%;
  background: rgba(19, 29, 41, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 34px 28px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 35px rgba(8, 167, 101, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: lockFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes lockFadeIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.lock-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
  font-size: 11px;
  font-weight: 600;
  border-radius: 20px;
  margin-bottom: 20px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.lock-header {
  margin-bottom: 24px;
}
.lock-icon {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(8, 167, 101, 0.25), rgba(8, 167, 101, 0.05));
  border: 1px solid rgba(8, 167, 101, 0.35);
  color: var(--accent, #08a765);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px auto;
  box-shadow: 0 8px 20px rgba(8, 167, 101, 0.2);
}
.lock-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: #f1f6fa;
  margin: 0;
  letter-spacing: -0.3px;
}
.lock-header p {
  font-size: 13px;
  color: #92a4b5;
  margin: 0;
  line-height: 1.5;
}
.lock-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}
.lock-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lock-field label {
  font-size: 12px;
  font-weight: 600;
  color: #c7d5e2;
  letter-spacing: 0.2px;
}
.lock-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.lock-input-icon {
  position: absolute;
  left: 12px;
  color: #647788;
  display: flex;
  align-items: center;
  pointer-events: none;
}
.lock-input {
  width: 100%;
  padding: 12px 14px 12px 38px;
  background: #0f1621;
  border: 1px solid #233244;
  border-radius: 10px;
  color: #f1f6fa;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.lock-input:focus {
  border-color: var(--accent, #08a765);
  box-shadow: 0 0 0 3px rgba(8, 167, 101, 0.18);
  background: #121b27;
}
.lock-toggle-pass {
  position: absolute;
  right: 10px;
  background: transparent;
  border: 0;
  color: #647788;
  padding: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  border-radius: 6px;
}
.lock-toggle-pass:hover {
  color: #c7d5e2;
}
.lock-remember-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: -2px;
}
.lock-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #92a4b5;
  cursor: pointer;
}
.lock-checkbox-label input[type="checkbox"] {
  accent-color: var(--accent, #08a765);
  cursor: pointer;
}
.lock-error {
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 8px;
  color: #fca5a5;
  font-size: 12px;
  text-align: center;
  font-weight: 500;
}
.lock-shake {
  animation: lockShake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}
@keyframes lockShake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-3px, 0, 0); }
  40%, 60% { transform: translate3d(3px, 0, 0); }
}
.lock-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px;
  background: var(--accent, #08a765);
  color: #ffffff;
  border: 0;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s, filter 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 14px rgba(8, 167, 101, 0.3);
  margin-top: 4px;
}
.lock-btn:hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 18px rgba(8, 167, 101, 0.4);
}
.lock-btn:active {
  transform: scale(0.98);
}

