    :root{
      --bg:#0b0b0b;
      --panel:#111;
      --accent:#e50914;
      --muted:#9a9a9a;
      --card-radius:12px;
      --smarters-accent:#0ea5e9;
    }
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  background: linear-gradient(180deg, #020202 0%, #071019 60%);
  background-repeat: no-repeat;
  background-attachment: fixed; /* deixa o fundo fixo ao rolar */
  background-size: cover;       /* garante que o degradê preencha toda a tela */
  color: #fff;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
   visibility: hidden;
}

    .hero {
      min-height:100vh;
      display:flex;
      align-items:center;
      justify-content:center;
      text-align:center;
      flex-direction:column;
      gap:24px;
      padding:20px;
    }
    .logo { width:220px; max-width:60%; filter: drop-shadow(0 8px 24px rgba(0,0,0,0.8)); }
    .card-input {
      background: rgba(255,255,255,0.03);
      border-radius: 14px;
      padding:18px;
      width:880px;
      max-width:92%;
      box-shadow: 0 8px 30px rgba(0,0,0,0.6);
      border: 1px solid rgba(255,255,255,0.04);
    }
    .accent-btn{
      background:var(--accent);
      border:none;
      color:#fff;
      padding:12px 22px;
      border-radius:8px;
      font-weight:600;
      box-shadow: 0 6px 18px rgba(233,9,20,0.15);
      cursor:pointer;
      transition: transform 0.1s;
    }
    .accent-btn:hover{ opacity: 0.9; }
    .accent-btn:active{transform:translateY(1px);}
    .accent-btn:disabled{ opacity: 0.5; cursor: not-allowed; }
    
    .app-shell{ min-height:100vh; padding:28px; }
    .top-controls{ display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; flex-wrap:wrap; gap:10px; }
    
    .main-menu{
      display:flex;
      gap:18px;
      justify-content:center;
      margin:18px 0 6px 0;
      flex-wrap:wrap;
    }
    .menu-item{
      padding:10px 22px;
      border-radius:18px;
      background:rgba(255,255,255,0.03);
      border:1px solid rgba(255,255,255,0.03);
      font-weight:700;
      cursor:pointer;
      transition:transform .12s ease, box-shadow .12s ease, background .12s ease;
    }
    .menu-item:hover{ background:rgba(255,255,255,0.06); }
    .menu-item.active{ 
      background: linear-gradient(90deg, rgba(14,165,233,0.14), rgba(233,9,20,0.06)); 
      box-shadow:0 8px 30px rgba(0,0,0,0.6);
      border-color: rgba(233,9,20,0.3);
    }
    
    .grid { 
      display:grid; 
      grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); 
      gap:16px; 
      margin-top:18px; 
    }
    .card-item{
      background:var(--panel);
      border-radius:12px;
      padding:8px;
      overflow:hidden;
      cursor:pointer;
      border: 1px solid rgba(255,255,255,0.03);
      transition: transform .12s ease, box-shadow .12s ease;
    }
    .card-item:hover{ 
      transform: translateY(-6px); 
      box-shadow: 0 10px 30px rgba(0,0,0,0.6); 
    }
    .card-item img{ 
      width:100%; 
      height:100px; 
      object-fit:cover; 
      border-radius:8px; 
      background:#222; 
    }
    .card-title{ 
      font-size:0.92rem; 
      margin-top:8px; 
      font-weight:600; 
      color:#fff;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    
    .player-wrap{
      margin-top:18px;
      background:linear-gradient(180deg, rgba(0,0,0,0.3), rgba(0,0,0,0.5));
      border-radius:12px;
      padding:12px;
      border: 1px solid rgba(255,255,255,0.03);
    }
    video{ 
      width:100%; 
      height:480px; 
      max-height:60vh; 
      background:#000; 
      border-radius:8px; 
    }
    
    .muted { color:var(--muted); font-size:0.9rem; }
    .error-msg { 
      background: rgba(229,9,20,0.2); 
      border: 1px solid rgba(229,9,20,0.4); 
      padding: 12px; 
      border-radius: 8px; 
      margin-top: 10px; 
      color: #ff6b6b; 
    }
    
/* 🔹 Grade de categorias — responsiva e fluida */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 14px;
  margin-top: 12px;
  justify-items: center;
}

/* 🔹 Cards — fixos, mas adaptáveis */
.category-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.03);
  transition: transform 0.2s, box-shadow 0.2s;
  max-width: 160px;
  width: 100%;
}

/* 🔹 Imagem da categoria — redimensiona de forma proporcional */
.category-card img {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  object-fit: cover;
  background: #222;
}

/* 🔹 Texto abaixo da imagem */
.category-card .cat-name {
  font-size: 0.9rem;
  color: #fff;
  margin-top: 6px;
  line-height: 1.3;
}

/* 🔹 Ajuste automático conforme a tela */
@media (max-width: 768px) {
  .categories-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  }

  .category-card {
    max-width: 130px;
    padding: 8px;
  }
}

@media (max-width: 480px) {
  .categories-grid {
    grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
    gap: 10px;
  }

  .category-card {
    max-width: 110px;
    padding: 6px;
  }

  .category-card img {
    border-radius: 6px;
  }

  .category-card .cat-name {
    font-size: 0.8rem;
  }
}

.category-card span {
  margin-top: 6px;
  font-size: 0.9rem;
  color: #fff;
  text-align: center;
  word-break: break-word;
}

.category-card:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}



    .category-card:hover{
      transform: translateY(-4px);
      box-shadow: 0 8px 20px rgba(0,0,0,0.5);
      background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
    }
    
    .recent-row{ 
      display:flex; 
      gap:12px; 
      overflow-x:auto; 
      padding:8px 0; 
      margin-top:12px; 
    }
    .recent-row::-webkit-scrollbar{ height:8px; }
    .recent-row::-webkit-scrollbar-track{ background:rgba(255,255,255,0.05); border-radius:4px; }
    .recent-row::-webkit-scrollbar-thumb{ background:rgba(255,255,255,0.2); border-radius:4px; }
    .recent-card{ min-width:160px; max-width:220px; }
    
    .modal-overlay{ 
      position:fixed; 
      inset:0; 
      background:rgba(0,0,0,0.85); 
      display:flex; 
      align-items:center; 
      justify-content:center; 
      z-index:1050;
      backdrop-filter: blur(4px);
    }
    .player-modal{ 
      background:var(--panel); 
      border-radius:12px; 
      width:90%; 
      max-width:980px; 
      padding:20px; 
      border:1px solid rgba(255,255,255,0.08); 
      box-shadow: 0 20px 60px rgba(0,0,0,0.8);
    }
    
    .to-top{ 
      position:fixed; 
      right:18px; 
      bottom:18px; 
      z-index:2000; 
      width:48px; 
      height:48px; 
      border-radius:50%; 
      display:flex; 
      align-items:center; 
      justify-content:center; 
      background:rgba(0,0,0,0.6); 
      border:1px solid rgba(255,255,255,0.06); 
      cursor:pointer;
      transition: transform 0.2s, opacity 0.3s;
      opacity: 0;
      pointer-events: none;
    }
    .to-top:not(.hidden){ 
      opacity: 1;
      pointer-events: all;
    }
    .to-top:hover{ transform: translateY(-4px); }
    .to-top.hidden{ opacity: 0; pointer-events: none; }
    
    /* ✅ TELA DE CARREGAMENTO - CORRIGIDA */
    .loading-screen {
	  visibility: visible !important;
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-color: rgba(0, 0, 0, 0.98);
      display: flex;
      justify-content: center;
      align-items: center;
      z-index: 9999;
      opacity: 1;
      transition: opacity 0.5s ease-out;
    }
    .loading-screen.fade-out {
      opacity: 0;
      pointer-events: none;
    }
    
    /* Spinner (círculo giratório) */
    .spinner {
      width: 50px;
      height: 50px;
      border: 5px solid rgba(255, 255, 255, 0.2);
      border-top: 5px solid #e50914;
      border-radius: 50%;
      animation: spin 1s linear infinite;
    }

    @keyframes spin {
      from { transform: rotate(0deg); }
      to { transform: rotate(360deg); }
    }
    
    .fade-in {
      animation: fadeIn 0.3s ease-in;
    }

    @keyframes fadeIn {
      from { opacity: 0; }
      to { opacity: 1; }
    }
    
    @media (max-width:768px){ 
      .category-card{ min-height:70px; }
      .top-controls{ flex-direction:column; align-items:stretch; }
      .grid{ grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
    }
	
#categoriesGrid,
#gridContainer {
  transition: opacity 0.35s ease;
}

#categoriesGrid {
  opacity: 1;
}

#gridContainer {
  opacity: 0;
  display: none;
}

.fade-in {
  opacity: 0;
  animation: fadeIn 0.4s ease forwards;
}

.fade-out {
  animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

.menu-item.active {
  color: var(--accent);
  font-weight: 600;
  border-bottom: 2px solid var(--accent);
}

.last-watched {
  margin: 12px 0 20px;
}
.last-watched .recent-card {
  display: inline-block;
  margin-right: 10px;
  background: #111;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s;
}
.last-watched .recent-card:hover {
  transform: scale(1.05);
}

.horizontal-scroll {
  display: flex;
  overflow-x: auto;
  gap: 12px;
  padding: 8px 0;
  scroll-behavior: smooth;
}
.horizontal-scroll::-webkit-scrollbar {
  height: 8px;
}
.horizontal-scroll::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 4px;
}
.history-card {
  flex: 0 0 auto;
  width: 140px;
  cursor: pointer;
  text-align: center;
}
.history-card img {
  width: 100%;
  border-radius: 8px;
  object-fit: cover;
}
.history-card .card-title {
  font-size: 0.8rem;
  margin-top: 4px;
  color: #ccc;
}

/* Modal do Chat - segue o padrão do playerModal */
.chat-modal {
  background: var(--panel);
  border-radius: 12px;
  width: 90%;
  max-width: 720px;
  padding: 20px;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
  position: relative;
}

.chat-modal iframe {
  width: 100%;
  height: 500px;
  border: none;
  border-radius: 8px;
  background: var(--panel);
}

.chat-modal .close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(229,9,20,0.8);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 10;
}

.chat-modal .close-btn:hover {
  background: var(--accent);
}

/* === TELAS PEQUENAS (até 400px) === */
@media (max-width: 400px) {
  .chat-modal {
    width: 98%;
    padding: 10px;
  }
  
  .chat-modal iframe {
    height: 320px;
    border-radius: 6px;
  }
}

/* === CELULARES MUITO PEQUENOS (até 350px) === */
@media (max-width: 350px) {
  .chat-modal {
    width: 98%;
    padding: 10px;
  }
  
  .chat-modal iframe {
    height: 300px;
    border-radius: 6px;
  }
  
  .chat-modal .close-btn {
    width: 26px;
    height: 26px;
    font-size: 14px;
  }
}

/* === MICROTELAS (até 320px) === */
@media (max-width: 320px) {
  .chat-modal {
    width: 98%;
    padding: 8px;
  }
  
  .chat-modal iframe {
    height: 280px;
    border-radius: 5px;
  }
  
  .chat-modal .close-btn {
    width: 24px;
    height: 24px;
    font-size: 13px;
    top: 6px;
    right: 6px;
  }
}

/* === GRANDES TELAS (mínimo 1200px) === */
@media (min-width: 1200px) {
  .chat-modal {
    max-width: 820px;
    padding: 24px;
  }
  
  .chat-modal iframe {
    height: 550px;
  }
  
  .chat-modal .close-btn {
    width: 36px;
    height: 36px;
    font-size: 20px;
  }
}

/* === TELAS ULTRAWIDE (mínimo 1600px) === */
@media (min-width: 1600px) {
  .chat-modal {
    max-width: 900px;
    padding: 26px;
  }
  
  .chat-modal iframe {
    height: 600px;
  }
}

/* === MONITORES 4K (mínimo 1920px) === */
@media (min-width: 1920px) {
  .chat-modal {
    max-width: 1000px;
    padding: 30px;
  }
  
  .chat-modal iframe {
    height: 650px;
  }
  
  .chat-modal .close-btn {
    width: 40px;
    height: 40px;
    font-size: 22px;
  }
}

/* === BOTÕES TOPO - PADRÃO (desktop) === */
.top-buttons {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0;
  scrollbar-width: none;
}
.top-buttons::-webkit-scrollbar {
  display: none;
}

.top-buttons .btn {
  flex: 0 0 auto;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 4px 10px;
  min-width: 90px;
  max-width: 110px;
  text-align: center;
  transition: all 0.2s ease;
}

/* === TABLETS (até 992px) === */
@media (max-width: 992px) {
  .top-buttons .btn {
    font-size: 0.78rem;
    padding: 3px 8px;
    min-width: 80px;
    max-width: 95px;
  }
}

/* === CELULARES (até 768px) === */
@media (max-width: 768px) {
  .top-buttons {
    justify-content: flex-end;
    gap: 5px;
  }
  .top-buttons .btn {
    font-size: 0.75rem;
    padding: 3px 6px;
    min-width: 70px;
    max-width: 85px;
  }
}

/* === TELAS PEQUENAS (até 480px) === */
@media (max-width: 480px) {
  .top-buttons {
    justify-content: flex-start;
    gap: 4px;
  }
  .top-buttons .btn {
    font-size: 0.60rem;
    padding: 2px 5px;
    min-width: 60px;
    max-width: 75px;
  }
}

/* === CELULARES MENORES (até 400px) === */
@media (max-width: 400px) {
  .top-buttons {
    justify-content: flex-start;
    gap: 3.5px;
  }
  .top-buttons .btn {
    font-size: 0.55rem;
    padding: 2px 5px;
    min-width: 50px;
    max-width: 65px;
  }
}

/* === TELAS MUITO PEQUENAS (até 350px) === */
@media (max-width: 350px) {
  .top-buttons {
    justify-content: flex-start;
    gap: 3px;
  }
  .top-buttons .btn {
    font-size: 0.50rem;
    padding: 2px 4px;
    min-width: 40px;
    max-width: 55px;
  }
}

/* === MICROTELAS (até 320px) === */
@media (max-width: 320px) {
  .top-buttons {
    justify-content: flex-start;
    gap: 2px;
  }
  .top-buttons .btn {
    font-size: 0.45rem;
    padding: 1.5px 4px;
    min-width: 30px;
    max-width: 45px;
  }
}

  #lastWatchedRow .recent-list img {
    width: 140px !important;
    height: auto !important;
  }
}

/* === GRANDES TELAS (mínimo 1200px) === */
@media (min-width: 1200px) {
  .hero {
    gap: 32px;
    padding: 40px;
  }

  .logo {
    width: 260px;
    max-width: none;
  }

  .card-input {
    width: 980px;
    padding: 24px;
    border-radius: 16px;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
  }

  .card-item img {
    height: 140px;
  }

  .category-card {
    max-width: 180px;
    padding: 16px;
  }

  video {
    height: 600px;
    max-height: 70vh;
  }

  .chat-modal iframe {
    height: 600px;
  }

  .top-buttons .btn {
    font-size: 0.9rem;
    padding: 5px 12px;
    min-width: 100px;
    max-width: 130px;
  }
}

/* === TELAS ULTRAWIDE (mínimo 1600px) === */
@media (min-width: 1600px) {
  .app-shell {
    max-width: 1500px;
    margin: 0 auto;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 22px;
  }

  .card-item img {
    height: 160px;
  }

  .category-card {
    max-width: 200px;
    padding: 18px;
  }

  .category-card .cat-name {
    font-size: 1rem;
  }

  .hero {
    padding: 60px;
  }
}

/* === MONITORES 4K (mínimo 1920px) === */
@media (min-width: 1920px) {
  body {
    font-size: 1.05rem;
  }

  .app-shell {
    max-width: 1800px;
    margin: 0 auto;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 26px;
  }

  .card-item img {
    height: 200px;
  }

  .category-card {
    max-width: 230px;
    padding: 20px;
  }

  .category-card .cat-name {
    font-size: 1.1rem;
  }

  .player-modal,
  .chat-modal {
    max-width: 1100px;
  }

  video {
    height: 720px;
    max-height: 75vh;
  }

  .logo {
    width: 320px;
  }

  .top-buttons .btn {
    font-size: 1rem;
    padding: 6px 14px;
    min-width: 120px;
    max-width: 150px;
  }
}

    .ad-container {
        position: relative;
        width: 320px;
        height: 50px;
        margin: 0 auto;
    }
    
    .ad-item {
        display: none;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
    
    .ad-item.active {
        display: block;
    }
	