/* ==== base / TV ==== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  width: 1920px; height: 1080px;
  background: #101014; color: #f4f4f6;
  font-family: Arial, "Segoe UI", sans-serif;
  overflow: hidden;
}
[hidden] { display: none !important; }

/* margem de segurança de overscan (~5%) */
#grid-view, #player-view { width: 100%; height: 100%; }

/* ==== topo ==== */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 48px 96px 24px;
}
.logo { font-size: 52px; font-weight: bold; color: #1DB954; }
.hint { font-size: 26px; color: #9a9aa2; }

/* botões do topo (shuffle, lupa) */
.top-controls { display: flex; gap: 20px; margin-left: auto; margin-right: 24px; }
.topbtn {
  font-size: 40px; width: 76px; height: 76px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: #1c1c22; color: #f4f4f6;
  border: 4px solid transparent; outline: none;
}
.topbtn.focused { border-color: #1DB954; transform: scale(1.08); }

/* barra de busca */
.search-bar {
  flex: 1; display: flex; align-items: center; gap: 18px;
  margin: 0 40px; background: #1c1c22; border-radius: 16px;
  padding: 10px 24px; border: 4px solid #1DB954;
}
.lupa-ico { font-size: 34px; }
.search-input {
  flex: 1; background: transparent; border: 0; outline: none;
  color: #f4f4f6; font-size: 38px; padding: 8px 0;
}
.search-count { font-size: 26px; color: #9a9aa2; white-space: nowrap; }

/* ==== grade ==== */
.grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 36px;
  padding: 12px 96px 96px;
  height: calc(100vh - 140px);
  overflow-y: auto;
  overflow-x: hidden;
  align-content: start;
  grid-auto-rows: 316px;                 /* altura fixa da linha = card quadrado (não colapsa) */
  scroll-behavior: smooth;
}
/* esconde a barra de rolagem (TV não tem mouse) */
.grid::-webkit-scrollbar { width: 0; height: 0; }

.card {
  background: #1c1c22;
  border-radius: 18px;
  overflow: hidden;
  border: 6px solid transparent;
  transition: transform .12s ease, border-color .12s ease;
  display: grid;
  grid-template-rows: 1fr 78px;          /* miniatura em cima, faixa do título embaixo */
}
.card .thumb {
  width: 100%; height: 100%; min-height: 0;
  object-fit: cover;                     /* corta o 16:9 no centro, sem tarja */
  object-position: center;
  display: block;
  background: #000;
}
.card .title {
  font-size: 23px; line-height: 1.2;
  padding: 12px 16px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;                 /* no máximo 2 linhas */
  -webkit-box-orient: vertical;
}
/* item em foco (D-pad) */
.card.focused {
  border-color: #1DB954;
  transform: scale(1.06);
  box-shadow: 0 12px 40px rgba(0,0,0,.6);
}

.empty {
  text-align: center; font-size: 40px; color: #9a9aa2;
  margin-top: 200px; line-height: 1.6;
}

/* ==== player ==== */
#player-view { position: relative; background: #000; }
#player, #player iframe {
  position: absolute; top: 0; left: 0;
  width: 1920px; height: 1080px; border: 0;
}
/* camada transparente por cima do iframe: segura o foco no app,
   pra que as teclas do controle (Voltar/OK/setas) cheguem no nosso código */
#player-catch {
  position: absolute; inset: 0; z-index: 5;
  background: transparent; outline: none;
}
.player-bar { z-index: 6; }
.player-status { z-index: 7; }
.player-bar {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 28px 96px;
  background: linear-gradient(transparent, rgba(0,0,0,.85));
  transition: opacity .3s ease;
}
.player-bar.hidden-bar { opacity: 0; }
.player-title { font-size: 34px; font-weight: bold; }
.player-help { font-size: 24px; color: #c8c8ce; }

.player-status {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 48px; background: rgba(0,0,0,.7);
  padding: 24px 48px; border-radius: 16px;
}
