/* ======================================
   ADVENTURE IPTV - Estilos
   ====================================== */

:root {
  --bg: #1a1a1a;
  --bg2: #242424;
  --bg3: #2e2e2e;
  --bg4: #383838;
  --border: #404040;
  --text: #f0f0f0;
  --text2: #aaa;
  --text3: #666;
  --accent: #4CAF50;
  --accent-dark: #388E3C;
  --accent2: #2196F3;
  --danger: #e53935;
  --card-bg: #242424;
  --sidebar-bg: #1e1e1e;
  --header-bg: #111;
  --label-peach: #f5cba7;
  --label-green: #a9dfbf;
  --label-blue: #aed6f1;
  --label-gray: #d5d8dc;
  --radius: 8px;
  --radius-sm: 4px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

*:focus,
*:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

html {
  height: 100%;
}

body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Segoe UI', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
}

.continue-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 8px 0 16px;
}

.continue-card {
  flex: 0 0 140px;
  width: 140px;
  max-width: 140px;
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.app-body {
  display: flex;
  height: calc(100vh - 50px);
  overflow: hidden;
}

.content-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 20px 20px;
}

.continue-card .card-poster {
  width: 100%;
  aspect-ratio: 2/3;
  position: relative;
}

.continue-card .card-poster .card-poster-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.continue-card-info {
  padding: 8px;
}

.continue-card-name {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.continue-row::-webkit-scrollbar {
  height: 6px;
}

.continue-row::-webkit-scrollbar-track {
  background: var(--bg2);
  border-radius: 3px;
}

.continue-row::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.continue-row::-webkit-scrollbar-thumb:hover {
  background: var(--text3);
}

/* ======================================
   LOGIN PAGE
   ====================================== */

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: radial-gradient(ellipse at center, #1f2b1f 0%, #111 100%);
}

.login-wrapper {
  width: 520px;
  max-width: 95vw;
}

.login-logo {
  text-align: center;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.login-logo .logo-icon {
  font-size: 2rem;
  color: var(--accent);
  text-shadow: 0 0 20px rgba(76, 175, 80, 0.5);
}

.login-logo h1 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 4px;
  color: #fff;
}

.login-logo h1 span {
  color: var(--accent);
}

/* Tabs */
.login-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 0;
  border-bottom: 2px solid var(--border);
}

.tab-btn {
  flex: 1;
  padding: 12px;
  background: var(--bg3);
  border: none;
  color: var(--text2);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  border-radius: var(--radius) var(--radius) 0 0;
  transition: all 0.2s;
}

.tab-btn:hover {
  background: var(--bg4);
  color: var(--text);
}

.tab-btn.active {
  background: var(--bg2);
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  margin-bottom: -2px;
}

/* Tab content */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Form panel */
.form-panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 28px;
}

.form-panel h2 {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: #fff;
  text-align: center;
  margin-bottom: 24px;
  text-transform: uppercase;
}

/* Form rows */
.form-row {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
  gap: 12px;
}

.field-label {
  font-size: 0.8rem;
  font-weight: 600;
}

.form-row input[type="text"],
.form-row input[type="password"] {
  flex: 1;
  padding: 9px 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-row input:focus {
  border-color: var(--accent);
}

.input-group {
  flex: 1;
  display: flex;
  gap: 6px;
}

.input-group input {
  flex: 1;
}

.icon-btn {
  padding: 8px 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: all 0.2s;
}

.icon-btn:hover {
  background: var(--bg4);
  color: var(--text);
}

/* Radio group */
.radio-group {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text);
}

.radio-label input[type="radio"] {
  accent-color: var(--accent);
  cursor: pointer;
}

/* Browse button */
.browse-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: #37474F;
  border: none;
  border-radius: var(--radius);
  color: #fff;
  font-size: 0.85rem;
  cursor: pointer;
  margin: 14px auto;
  transition: background 0.2s;
}

.browse-btn:hover {
  background: #455A64;
}

.file-name-label {
  display: block;
  text-align: center;
  font-size: 0.78rem;
  color: var(--accent);
  min-height: 16px;
  margin-top: -8px;
  margin-bottom: 8px;
}

/* Form actions */
.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s;
}

.action-btn:hover {
  background: var(--bg4);
  border-color: var(--text3);
}

.action-btn.accent {
  background: var(--accent-dark);
  border-color: var(--accent);
  color: #fff;
}

.action-btn.accent:hover {
  background: var(--accent);
}

.add-playlist-btn {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  margin-top: 20px;
  transition: background 0.2s;
}

.add-playlist-btn:hover {
  background: var(--accent-dark);
}

/* ======================================
   MODAL
   ====================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}

.modal.series-modal {
  max-width: 700px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text2);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--bg4);
  color: var(--text);
}

.modal-follow-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg4);
  color: var(--text2);
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.modal-follow-btn:hover {
  background: var(--border);
  color: var(--text);
}

.modal-follow-btn.active {
  background: var(--accent);
  color: #fff;
}

.modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}

.no-profiles {
  color: var(--text3);
  text-align: center;
  padding: 20px 0;
  font-size: 0.85rem;
}

/* Profile list in modal */
.profile-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.profile-item:hover {
  border-color: var(--accent);
  background: var(--bg4);
}

.profile-item-icon {
  width: 36px;
  height: 36px;
  background: var(--accent-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.profile-item-info {
  flex: 1;
  min-width: 0;
}

.profile-item-name {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-item-type {
  font-size: 0.75rem;
  color: var(--text3);
  margin-top: 2px;
}

.profile-item-del {
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: all 0.2s;
}

.profile-item-del:hover {
  color: var(--danger);
  background: rgba(229, 57, 53, 0.1);
}

/* ======================================
   APP PAGE
   ====================================== */

.app-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 20px;
  height: 56px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: relative;
  z-index: 9000;
  overflow: visible;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.header-logo .logo-icon {
  color: var(--accent);
  font-size: 1.1rem;
}

.header-logo .logo-text {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 2px;
  color: #fff;
}

.header-logo .logo-text strong {
  color: var(--accent);
}

.header-nav {
  display: flex;
  gap: 4px;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: none;
  border: none;
  color: var(--text2);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.nav-btn:hover {
  background: var(--bg3);
  color: var(--text);
}

.nav-btn.active {
  background: var(--bg3);
  color: var(--accent);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
}

.search-box:focus-within {
  outline: none !important;
  box-shadow: none !important;
  border-color: #404040 !important;
}

.search-box svg {
  color: var(--text3);
  flex-shrink: 0;
}

.search-box input {
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.82rem;
  outline: none !important;
  box-shadow: none !important;
  width: 160px;
}

.search-box input:focus,
.search-box input:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

.search-box input::placeholder {
  color: var(--text3);
}

/* Profile menu */
.profile-menu {
  position: relative;
}

.profile-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.profile-btn:hover {
  background: var(--bg4);
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 200px;
  box-shadow: var(--shadow);
  z-index: 9000;
  overflow: hidden;
}

.profile-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.2s;
  text-align: left;
}

.profile-dropdown-item:hover {
  background: var(--bg3);
}

.profile-dropdown-item.active {
  color: var(--accent);
}

.profile-dropdown-item.danger {
  color: var(--danger);
}

.profile-dropdown-item.danger:hover {
  background: rgba(229, 57, 53, 0.1);
}

.profile-dropdown-divider {
  border-bottom: 1px solid var(--border);
  margin: 4px 0;
}

/* App body */
.app-body {
  display: flex;
  height: calc(100vh - 50px);
  overflow: hidden;
}

.sidebar {
  width: 180px;
  background: var(--sidebar-bg);
  overflow-y: auto;
  padding: 12px 0;
}

/* Sidebar */
.sidebar {
  width: 210px;
  min-width: 210px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-title {
  padding: 14px 16px 10px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text3);
  text-transform: uppercase;
  flex-shrink: 0;
}

.sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) var(--bg2);
}

.sidebar-list::-webkit-scrollbar {
  width: 4px;
}

.sidebar-list::-webkit-scrollbar-track {
  background: var(--bg2);
  border-radius: 2px;
}

.sidebar-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.sidebar-list::-webkit-scrollbar-thumb:hover {
  background: var(--text3);
}

.sidebar-item {
  padding: 9px 16px;
  font-size: 0.82rem;
  color: var(--text2);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-item:hover {
  background: var(--bg3);
  color: var(--text);
}

.sidebar-item.active {
  background: rgba(76, 175, 80, 0.1);
  border-left-color: var(--accent);
  color: var(--accent);
}

/* Content area */
.content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
}

.content-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-shrink: 0;
}

.content-header span:first-child {
  font-size: 1rem;
  font-weight: 700;
}

.content-count {
  font-size: 0.75rem;
  color: var(--text3);
  background: var(--bg3);
  padding: 2px 8px;
  border-radius: 10px;
}

/* Content grid */
.content-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-content: start;
  padding-bottom: 16px;
}

.content-grid::-webkit-scrollbar {
  width: 6px;
}

.content-grid::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

/* =============================================
   CARDS — display:block para evitar colapso
   ============================================= */
.card {
  flex-shrink: 0;
  width: 140px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  background: var(--card-bg);
  transition: all 0.2s;
  position: relative;
}

.card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.7);
  z-index: 2;
  position: relative;
}

/*
  .card-poster: container relativo.
  A altura vem do .card-poster-fallback (em fluxo normal).
  A imagem (.card-poster-img) fica absolutamente sobre o fallback.
*/
.card-poster {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 2/3;
  overflow: hidden;
  background: #151625;
}

/* Fallback — SEMPRE renderizado, define a altura do poster */
.card-poster-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 10px;
  width: 100%;
  height: 100%;
  min-height: unset;
  background: linear-gradient(160deg, #252840 0%, #151625 100%);
}

.live-card .card-poster {
  aspect-ratio: 16/9;
}

.live-card .card-poster-fallback {
  height: 100%;
  min-height: unset;
}

.live-card .card-poster-img {
  object-fit: contain;
  background: #0a0a14;
}

.card-poster-fallback svg {
  color: #7788cc;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.card-poster-fallback span {
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.4;
  color: #ccd;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  word-break: break-word;
  max-width: 100%;
}

/* Imagem — overlay absoluta sobre o fallback */
.card-poster-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}

.card-poster-img.loaded {
  opacity: 1;
}

/* Overlay de play no hover */
.card-poster-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 5;
}

.card-poster:hover .card-poster-overlay {
  opacity: 1;
}

.card-play-btn {
  width: 46px;
  height: 46px;
  background: rgba(76, 175, 80, 0.92);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

/* Badge AO VIVO */
.card-live-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--danger);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 2px 6px;
  border-radius: 3px;
  z-index: 10;
}

/* Info abaixo do poster */
.card-info {
  padding: 7px 8px 9px;
  background: #1a1a22;
}

.card-name {
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #f0f0f0;
  line-height: 1.35;
}

.card-meta {
  font-size: 0.7rem;
  color: #888;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Loading & Error states */
.loading-state,
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 60px 20px;
  color: var(--text3);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.retry-btn {
  padding: 8px 20px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  font-size: 0.82rem;
  transition: all 0.2s;
}

.retry-btn:hover {
  background: var(--bg4);
  border-color: var(--accent);
  color: var(--accent);
}

/* ======================================
   VIDEO PLAYER MODAL
   ====================================== */

.player-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.player-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
}

.player-container {
  position: relative;
  z-index: 1;
  background: #000;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 960px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

.player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #111;
  border-bottom: 1px solid var(--border);
}

.player-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.player-info img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.player-title {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 400px;
}

.player-subtitle {
  font-size: 0.75rem;
  color: var(--text3);
  margin-top: 2px;
}

.player-close {
  background: none;
  border: none;
  color: var(--text2);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  flex-shrink: 0;
}

.player-close:hover {
  background: var(--bg3);
  color: var(--text);
}

.player-hdr-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text2);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  padding: 3px 7px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  flex-shrink: 0;
}

.player-hdr-btn:hover {
  background: var(--bg3);
  color: var(--text);
}

.player-hdr-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

#video-player.hdr-fix {
  filter: brightness(2.2) saturate(0.9) contrast(0.85);
}

.player-wrapper {
  position: relative;
  aspect-ratio: 16/9;
  background: #000;
  max-height: 70vh;
  outline: none;
}

.player-next-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
}

.player-next-btn:hover {
  background: rgba(0, 0, 0, 0.9);
}

.player-wrapper:hover .player-next-btn {
  opacity: 1;
}

/* Skip Intro — posicionado sobre a barra de controles nativa, ao lado do contador de tempo */
.skip-intro-wrap {
  position: absolute;
  bottom: 40px;
  left: 160px;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: opacity 0.2s;
}

.skip-intro-btn {
  background: rgba(30, 30, 30, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 3px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
  line-height: 1.4;
}

.skip-intro-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: #fff;
}

.skip-intro-set-btn {
  background: rgba(30, 30, 30, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 3px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.72rem;
  padding: 3px 7px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
  line-height: 1.4;
}

.skip-intro-set-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.65);
}

/* Botão de fullscreen no header */
.player-fullscreen-btn {
  background: none;
  border: none;
  color: var(--text2);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}

.player-fullscreen-btn:hover {
  background: var(--bg3);
  color: var(--text);
}

/* Botão fechar mobile — sobreposto ao vídeo, visível sempre */
.player-mobile-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 30;
  width: 36px;
  height: 36px;
  background: rgba(0, 0, 0, 0.55);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(4px);
  opacity: 1;
  transition: opacity 0.3s;
}

/* Botão fullscreen overlay — posicionado sobre o botão nativo removido */
.player-fs-overlay-btn {
  position: absolute;
  bottom: 27px;
  right: 52px;
  z-index: 20;
  background: transparent;
  border: none;
  outline: none !important;
  box-shadow: none !important;
  color: #fff;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  padding: 0;
}

.player-fs-overlay-btn:focus,
.player-fs-overlay-btn:focus-visible,
.player-fs-overlay-btn:focus-within {
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
}

.player-fs-overlay-btn:hover svg {
  transform: scale(1.15);
}

.player-fs-overlay-btn svg {
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.8));
  transition: transform 0.15s;
  display: block;
}

/* Live TV: esconde barra de progresso e tempo nos controles nativos */
.player-wrapper.is-live video::-webkit-media-controls-timeline {
  display: none !important;
}

.player-wrapper.is-live video::-webkit-media-controls-current-time-display {
  display: none !important;
}

.player-wrapper.is-live video::-webkit-media-controls-time-remaining-display {
  display: none !important;
}

.player-wrapper.is-live .player-fs-overlay-btn {
  bottom: 2px;
}

.player-wrapper.is-live #player-next-btn {
  display: none !important;
}

/* Reposiciona e redimensiona o botão nos controles maiores do fullscreen — desktop */
.player-wrapper:fullscreen .player-fs-overlay-btn,
.player-wrapper:-webkit-full-screen .player-fs-overlay-btn {
  bottom: 27px;
  right: 88px;
  width: 48px;
  height: 58px;
}

.player-wrapper.is-live:fullscreen .player-fs-overlay-btn,
.player-wrapper.is-live:-webkit-full-screen .player-fs-overlay-btn {
  bottom: 2px;
  right: 88px;
}

.player-wrapper:fullscreen .player-fs-overlay-btn svg,
.player-wrapper:-webkit-full-screen .player-fs-overlay-btn svg {
  width: 32px;
  height: 32px;
}


/* Título em tela cheia */
.player-fs-title {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 25;
  padding: 18px 24px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.75) 0%, transparent 100%);
  font-size: 2.1rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.player-wrapper:fullscreen .player-fs-title,
.player-wrapper:-webkit-full-screen .player-fs-title {
  display: block;
}

/* Fullscreen no wrapper (preserva botão de próximo episódio) */
.player-wrapper:fullscreen,
.player-wrapper:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  max-height: 100vh;
  aspect-ratio: unset;
  background: #000;
}

.player-wrapper:fullscreen #video-player,
.player-wrapper:-webkit-full-screen #video-player {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#video-player {
  width: 100%;
  height: 100%;
  display: block;
  outline: none;
}

.player-loading {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-error {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--text2);
}

#player-error-msg {
  max-width: 380px;
  text-align: center;
  line-height: 1.4;
}

/* ======================================
   SERIES MODAL
   ====================================== */

.seasons-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.season-tab {
  padding: 6px 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text2);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s;
}

.season-tab:hover {
  border-color: var(--accent);
  color: var(--text);
}

.season-tab.active {
  background: var(--accent-dark);
  border-color: var(--accent);
  color: #fff;
}

.episodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.episode-item {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.episode-item:hover {
  border-color: var(--accent);
  background: var(--bg4);
}

.episode-num {
  font-size: 0.7rem;
  color: var(--text3);
  margin-bottom: 4px;
}

.episode-title {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.episode-meta {
  font-size: 0.7rem;
  color: var(--text3);
  margin-top: 3px;
}

/* ======================================
   PLAYER — barra de progresso abaixo do vídeo
   ====================================== */

.player-progress-bar {
  height: 4px;
  background: #333;
  position: relative;
}

.player-progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 1s linear;
  width: 0%;
}

/* ======================================
   BOTÃO DE FAVORITO no card
   ====================================== */

.fav-btn {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 10;
  width: 28px;
  height: 28px;
  background: rgba(0, 0, 0, 0.65);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #aaa;
  opacity: 0;
  transition: opacity 0.2s, color 0.2s, background 0.2s;
  padding: 0;
  flex-shrink: 0;
}

.card:hover .fav-btn,
.fav-btn.active {
  opacity: 1;
}

.fav-btn.active {
  color: #e53935;
  background: rgba(0, 0, 0, 0.75);
}

.fav-btn:hover {
  background: rgba(0, 0, 0, 0.9);
  color: #fff;
}

.fav-btn.active:hover {
  color: #ef9a9a;
}

.follow-btn {
  position: absolute;
  top: 6px;
  left: 40px;
  z-index: 10;
  width: 28px;
  height: 28px;
  background: rgba(0, 0, 0, 0.65);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #aaa;
  opacity: 0;
  transition: opacity 0.2s, color 0.2s, background 0.2s;
  padding: 0;
  flex-shrink: 0;
}

.card:hover .follow-btn,
.follow-btn.active {
  opacity: 1;
}

.follow-btn.active {
  color: var(--accent);
  background: rgba(0, 0, 0, 0.75);
}

.follow-btn:hover {
  background: rgba(0, 0, 0, 0.9);
  color: #fff;
}

.follow-btn.has-new-ep {
  opacity: 1;
}

.follow-btn.has-new-ep::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff3b30;
  border: 1.5px solid #1a1a1a;
}

/* ======================================
   BARRA DE PROGRESSO no card (continuar assistindo)
   ====================================== */

.card-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.15);
  z-index: 8;
}

.card-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}

.card-continue-badge {
  position: absolute;
  bottom: 6px;
  left: 6px;
  background: rgba(0, 0, 0, 0.75);
  color: #ccc;
  font-size: 0.62rem;
  padding: 2px 6px;
  border-radius: 3px;
  z-index: 9;
  white-space: nowrap;
}

.card-fav-overlay {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 10;
}

.card-fav-overlay .fav-btn {
  position: absolute;
  top: 4px;
  left: 36px;
  z-index: 10;
  width: 28px;
  height: 28px;
  background: rgba(0, 0, 0, 0.65);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #aaa;
  opacity: 0;
  transition: opacity 0.2s, color 0.2s, background 0.2s;
  padding: 0;
}

.continue-card:hover .card-fav-overlay .fav-btn,
.card-fav-overlay .fav-btn.active,
.history-item .card-fav-overlay .fav-btn {
  opacity: 1;
}

.card-fav-overlay .fav-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}

.card-fav-overlay .fav-btn.active {
  color: #e91e63;
}

.card-fav-overlay .follow-btn {
  position: absolute;
  top: 4px;
  left: 68px;
  z-index: 10;
  width: 28px;
  height: 28px;
  background: rgba(0, 0, 0, 0.65);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #aaa;
  opacity: 0;
  transition: opacity 0.2s, color 0.2s, background 0.2s;
  padding: 0;
}

.continue-card:hover .card-fav-overlay .follow-btn,
.card-fav-overlay .follow-btn.active,
.card-fav-overlay .follow-btn.has-new-ep {
  opacity: 1;
}

.card-fav-overlay .follow-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}

.card-fav-overlay .follow-btn.active {
  color: var(--accent);
}

.card-fav-overlay .episodes-btn {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 10;
  width: 28px;
  height: 28px;
  background: rgba(0, 0, 0, 0.65);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #aaa;
  opacity: 0;
  transition: opacity 0.2s, color 0.2s, background 0.2s;
  padding: 0;
}

.continue-card:hover .card-fav-overlay .episodes-btn {
  opacity: 1;
}

.card-fav-overlay .episodes-btn:hover {
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
}

/* ======================================
   SEÇÃO "CONTINUAR ASSISTINDO"
   ====================================== */

.section-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.section-row-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
}

.section-row-link {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.78rem;
  cursor: pointer;
  padding: 0;
}

.section-row-link:hover {
  text-decoration: underline;
}

.section-divider {
  border-bottom: 1px solid var(--border);
  margin: 14px 0;
}

.continue-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 6px;
}

.continue-row::-webkit-scrollbar {
  height: 4px;
}

.continue-card {
  flex: 0 0 140px;
  width: 140px;
  max-width: 140px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.continue-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.continue-card .card-poster-fallback {
  min-height: 160px;
}

.continue-card-info {
  padding: 6px 8px 8px;
}

.continue-card-name {
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #f0f0f0;
}

.continue-card-sub {
  font-size: 0.65rem;
  color: #888;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.next-ep-sub:empty {
  display: none;
}

.next-ep-hint {
  color: #4caf50;
  font-weight: 600;
}

.continue-card-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 15;
  width: 22px;
  height: 22px;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  border-radius: 50%;
  color: #ccc;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
  padding: 0;
}

.continue-card:hover .continue-card-remove {
  opacity: 1;
}

.continue-card-remove:hover {
  background: rgba(229, 57, 53, 0.9);
  color: #fff;
}

/* ======================================
   TOAST DE RETOMADA (resume)
   ====================================== */

.resume-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e1e1e;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7);
  z-index: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 280px;
}

.resume-toast-text {
  font-size: 0.88rem;
  color: var(--text);
}

.resume-toast-text strong {
  color: var(--accent);
}

.resume-toast-btns {
  display: flex;
  gap: 10px;
}

.resume-toast-btns button {
  padding: 7px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  transition: background 0.2s;
}

.resume-toast-btns button:hover {
  background: var(--accent-dark);
}

.resume-toast-btns button.secondary {
  background: var(--bg4);
  color: var(--text2);
}

.resume-toast-btns button.secondary:hover {
  background: var(--border);
}

.resume-toast-bar {
  width: 100%;
  height: 2px;
  background: var(--border);
  border-radius: 1px;
  position: relative;
  overflow: hidden;
}

.resume-toast-bar::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: var(--accent);
  animation: toastCountdown 5s linear forwards;
}

@keyframes toastCountdown {
  from {
    width: 100%;
  }

  to {
    width: 0%;
  }
}

/* ======================================
   STACK DE TOASTS: EPISÓDIO NOVO
   ====================================== */

.new-ep-toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 601;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  max-width: 340px;
}

.new-ep-toast {
  background: #1e1e1e;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: newEpToastIn 0.25s ease-out;
  cursor: pointer;
}

.new-ep-toast.closing {
  animation: newEpToastOut 0.2s ease-in forwards;
}

.new-ep-toast-thumb {
  width: 40px;
  height: 56px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.new-ep-toast-body {
  flex: 1;
  min-width: 0;
}

.new-ep-toast-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.new-ep-toast-sub {
  font-size: 0.74rem;
  color: var(--text3);
}

.new-ep-toast-close {
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  font-size: 1rem;
  padding: 2px 6px;
  flex-shrink: 0;
}

.new-ep-toast-close:hover {
  color: var(--text);
}

@keyframes newEpToastIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes newEpToastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(40px); }
}

/* ======================================
   MODAL: NOVOS EPISÓDIOS
   ====================================== */

.new-ep-modal-thumb-lg {
  width: 140px;
  height: 198px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  background: #1a1a1a;
}

/* ======================================
   HISTORY
   ====================================== */

.history-item {
  display: flex;
  flex-direction: column;
  width: 130px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  overflow: hidden;
}

.history-item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.history-item .card-poster-fallback {
  min-height: 180px;
}

.history-item-info {
  padding: 8px;
  flex: 1;
  min-width: 0;
}

.history-item-name {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item-meta {
  font-size: 0.72rem;
  color: #888;
  margin-top: 2px;
}

.history-clear-btn {
  padding: 6px 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--danger);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  margin-left: auto;
  flex-shrink: 0;
  z-index: 100;
  position: relative;
}

.history-clear-btn:hover {
  background: rgba(229, 57, 53, 0.1);
}

/* ======================================
   SCROLLBAR GLOBAL
   ====================================== */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text3);
}

/* ======================================
   VOD DETAIL MODAL
   ====================================== */

.modal.vod-detail-modal {
  max-width: 760px;
  max-height: none;
  background: transparent;
  overflow: visible;
  box-shadow: none;
  border: none;
  position: relative;
}

.vod-detail-backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  filter: blur(18px) brightness(0.25);
  z-index: 0;
}

.vod-detail-content {
  position: relative;
  z-index: 1;
  background: rgba(13, 13, 13, 0.88);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  width: 100%;
}

.vod-detail-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  padding: 0;
}

.vod-detail-hero {
  display: flex;
  gap: 24px;
  padding: 24px;
  position: relative;
  z-index: 1;
}

.vod-detail-poster {
  width: 130px;
  min-width: 130px;
  height: 190px;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  background: var(--bg3);
}

.vod-detail-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vod-detail-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
  color: #fff;
}

.vod-detail-meta {
  font-size: 0.78rem;
  color: #aaa;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.vod-detail-meta .meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #555;
  display: inline-block;
}

.vod-detail-synopsis {
  font-size: 0.82rem;
  color: #ccc;
  line-height: 1.65;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.vod-detail-extra {
  font-size: 0.78rem;
  color: #888;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.vod-detail-extra span strong {
  color: #bbb;
  font-weight: 600;
}

.vod-detail-play-btn {
  margin-top: auto;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  border: none;
  color: #fff;
  padding: 10px 22px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
  letter-spacing: 0.3px;
}

.vod-detail-play-btn:hover {
  opacity: 0.85;
}

@media (max-width: 520px) {
  .vod-detail-hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .vod-detail-poster {
    width: 100px;
    min-width: 100px;
    height: 148px;
  }

  .vod-detail-play-btn {
    align-self: center;
  }

  .vod-detail-meta {
    justify-content: center;
  }
}

/* ======================================
   SIDEBAR SEARCH (visível só no mobile)
   ====================================== */

.sidebar-search-wrap {
  display: none;
  flex-shrink: 0;
}

/* ======================================
   BOTÃO HAMBURGUER (mobile sidebar)
   ====================================== */

.sidebar-toggle-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text2);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.sidebar-toggle-btn:hover {
  background: var(--bg3);
  color: var(--text);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 149;
}

/* ======================================
   RESPONSIVE — TABLET GRANDE (≤ 1280px)
   ====================================== */

@media (max-width: 1280px) {
  .card {
    width: 130px;
  }

  .content-grid {
    gap: 10px;
  }
}

/* ======================================
   RESPONSIVE — TABLET (≤ 1024px)
   ====================================== */

@media (max-width: 1024px) {

  .app-header {
    gap: 10px;
    padding: 0 14px;
  }

  .search-box input {
    width: 110px;
  }

  .sidebar {
    width: 180px;
    min-width: 180px;
  }

  .card {
    width: 120px;
  }

  .episodes-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}

/* ======================================
   RESPONSIVE — TABLET PEQUENO / CELULAR LANDSCAPE (≤ 860px)
   ====================================== */

@media (max-width: 1200px) {

  /* Sidebar vira gaveta */
  .sidebar-toggle-btn {
    display: flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 260px;
    min-width: 260px;
    height: 100vh;
    z-index: 150;
    transition: left 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    padding-top: 56px;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
  }

  .sidebar.open {
    left: 0;
  }

  .sidebar-overlay.visible {
    display: block;
  }

  /* Header compacto */
  .app-header {
    gap: 8px;
    padding: 0 12px;
    height: 52px;
  }

  .app-body {
    height: calc(100vh - 52px);
  }

  .header-logo .logo-text {
    font-size: 0.75rem;
    letter-spacing: 1px;
  }

  /* Nav: ícone + label pequeno empilhados */
  .header-nav .nav-btn {
    font-size: 9px;
    padding: 4px 8px;
    gap: 2px;
    flex-direction: column;
    height: 52px;
    border-radius: 0;
  }

  .header-nav .nav-btn svg {
    width: 18px;
    height: 18px;
  }

  /* Busca menor */
  .search-box {
    padding: 6px 10px;
  }

  .search-box input {
    width: 100px;
    font-size: 0.78rem;
  }

  /* Profile: só ícone */
  .profile-btn #profile-name-display,
  .profile-btn svg:last-child {
    display: none;
  }

  /* Conteúdo */
  .content-area {
    padding: 12px 12px 16px;
  }

  .card {
    width: 120px;
  }

  .content-grid {
    gap: 8px;
  }

  /* Botão fullscreen no header: maior e mais visível no mobile */
  .player-fullscreen-btn {
    width: 40px;
    height: 40px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
  }

  .player-fullscreen-btn svg {
    width: 22px;
    height: 22px;
  }

  /* No mobile usa o fullscreen nativo do browser — esconde o nosso overlay */
  .player-fs-overlay-btn {
    display: none !important;
  }


  /* Player — tela inteira, vídeo preenche o espaço disponível */
  .player-modal {
    padding: 0;
    background: #000;
    align-items: stretch;
    justify-content: stretch;
  }

  .player-overlay {
    display: none;
  }

  .player-container {
    border-radius: 0;
    border: none;
    box-shadow: none;
    width: 100%;
    max-width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  /* Header do player fica em cima, tamanho fixo */
  .player-header {
    flex-shrink: 0;
    padding: 8px 12px;
    background: #111;
  }

  /* Barra de progresso fica embaixo do vídeo */
  .player-progress-bar {
    flex-shrink: 0;
  }

  /* Wrapper preenche todo o espaço restante */
  .player-wrapper {
    flex: 1;
    min-height: 0;
    width: 100%;
    height: 0;
    max-height: none;
    aspect-ratio: unset;
    background: #000;
    overflow: hidden;
  }

  .player-wrapper #video-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
  }

  .player-title {
    max-width: 65vw;
    font-size: 0.82rem;
  }

  /* Modais */
  .modal.series-modal {
    max-width: 100%;
    max-height: 92vh;
    border-radius: var(--radius) var(--radius) 0 0;
    margin-top: auto;
  }

  #settings-modal .modal {
    max-height: 95vh;
    border-radius: var(--radius) var(--radius) 0 0;
  }

  .episodes-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
  }

  /* Toast */
  .resume-toast {
    width: calc(100% - 32px);
    min-width: unset;
    bottom: 16px;
  }

  /* Continue row */
  .continue-card {
    flex: 0 0 110px;
    width: 110px;
    max-width: 110px;
  }
}

/* ======================================
   RESPONSIVE — CELULAR PORTRAIT (≤ 600px)
   ====================================== */

@media (max-width: 700px) {

  /* Logo: só ícone */
  .header-logo .logo-text {
    display: none;
  }

  .app-header {
    padding: 0 10px;
    gap: 6px;
    height: 48px;
  }

  .app-body {
    height: calc(100vh - 48px);
  }

  /* Busca fica no header, compacta */
  .header-right .search-box {
    display: flex;
    flex: 1;
    min-width: 0;
    max-width: 160px;
    padding: 5px 8px;
  }

  .header-right .search-box input {
    width: 100%;
    min-width: 0;
    font-size: 0.78rem;
  }

  .sidebar-search-wrap {
    display: none;
  }

  .sidebar {
    padding-top: 0;
  }

  /* Grid 2 colunas */
  .content-area {
    padding: 10px 10px 14px;
  }

  .content-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    flex-wrap: unset;
  }

  .card {
    width: 100%;
  }

  /* Player — herda flex:1 do bloco 860px, só ajusta padding */
  .player-header {
    padding: 8px 12px;
  }

  .player-title {
    font-size: 0.78rem;
    max-width: 60vw;
  }

  /* VOD detail */
  .vod-detail-hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 16px;
    gap: 16px;
  }

  .vod-detail-poster {
    width: 90px;
    min-width: 90px;
    height: 132px;
  }

  .vod-detail-play-btn {
    align-self: center;
  }

  .vod-detail-meta {
    justify-content: center;
  }

  .vod-detail-title {
    font-size: 1.05rem;
  }

  /* Episodes */
  .episodes-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* Continue row */
  .continue-card {
    flex: 0 0 95px;
    width: 95px;
    max-width: 95px;
  }

  /* History */
  .history-clear-btn {
    font-size: 0.68rem;
    padding: 5px 8px;
  }
}

/* ======================================
   RESPONSIVE — LOGIN PAGE MOBILE
   ====================================== */

@media (max-width: 700px) {
  .login-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 0 !important;
    min-height: 100vh;
    padding: 28px 20px !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: none !important;
  }

  .form-panel {
    padding: 20px 16px;
  }

  .form-row {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .field-label {
    width: auto;
    min-width: unset;
    text-align: left;
  }

  .input-group {
    flex-direction: row;
  }
}

/* ======================================
   TOUCH: área de toque e remoção de hover
   ====================================== */

@media (pointer: coarse) {
  .nav-btn {
    min-height: 40px;
  }

  .sidebar-item {
    padding: 12px 16px;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .card:hover {
    transform: none;
    box-shadow: none;
  }

  .card:active {
    transform: scale(0.97);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  }

  .card-poster:hover .card-poster-overlay {
    opacity: 0;
  }

  .card-poster:active .card-poster-overlay {
    opacity: 1;
  }

  .fav-btn {
    opacity: 1;
  }

  .continue-card-remove {
    opacity: 1;
  }

  .continue-card:hover {
    transform: none;
  }

  .continue-card:active {
    transform: scale(0.97);
  }

  .player-next-btn {
    opacity: 1;
  }

  .resume-toast-btns button {
    padding: 10px 24px;
    min-height: 44px;
  }

  .season-tab {
    min-height: 40px;
    padding: 8px 16px;
  }

  .episode-item {
    padding: 13px 14px;
  }
}

/* ======================================
   LANDSCAPE MOBILE (altura < 500px)
   ====================================== */

@media (max-height: 500px) and (orientation: landscape) {
  .player-fs-overlay-btn {
    display: none !important;
  }

  /* Player ocupa tela toda sem header visível */
  .player-modal {
    padding: 0;
    background: #000;
    align-items: stretch;
    justify-content: stretch;
  }

  .player-overlay {
    display: none;
  }

  .player-container {
    width: 100%;
    max-width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 0;
    border: none;
    box-shadow: none;
    overflow: hidden;
  }

  /* Header bem compacto em landscape */
  .player-header {
    flex-shrink: 0;
    padding: 4px 10px;
    min-height: unset;
    background: #111;
  }

  .player-header .player-title {
    font-size: 0.72rem;
  }

  .player-progress-bar {
    flex-shrink: 0;
  }

  .player-wrapper {
    flex: 1;
    min-height: 0;
    width: 100%;
    height: 0;
    max-height: none;
    aspect-ratio: unset;
    background: #000;
    overflow: hidden;
  }

  .player-wrapper #video-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
  }

  /* App body landscape */
  .app-header {
    height: 44px;
    padding: 0 10px;
  }

  .app-body {
    height: calc(100vh - 44px);
    height: calc(100dvh - 44px);
  }
}

/* ======================================
   BANNER PWA — instalar como app
   ====================================== */

#pwa-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 14px;
  background: #1e1e1e;
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 14px 18px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  max-width: 520px;
  width: calc(100% - 32px);
  animation: pwa-slide-up 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pwa-slide-up {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

#pwa-banner-icon {
  flex-shrink: 0;
  color: var(--accent);
  display: flex;
  align-items: center;
}

#pwa-banner-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

#pwa-banner-text strong {
  font-size: 0.9rem;
  color: var(--text);
}

#pwa-banner-text span {
  font-size: 0.78rem;
  color: var(--text2);
  line-height: 1.4;
}

#pwa-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

#pwa-install-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s;
}

#pwa-install-btn:hover {
  opacity: 0.85;
}

#pwa-dismiss-btn {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.2s;
}

#pwa-dismiss-btn:hover {
  color: var(--text);
}

@media (max-width: 600px) {
  #pwa-banner {
    flex-direction: column;
    align-items: flex-start;
    bottom: 16px;
    gap: 10px;
  }

  #pwa-banner-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* ======================================
   ANDROID TV / TELA GRANDE (≥ 1920px)
   ====================================== */

@media (min-width: 1920px) {
  body {
    font-size: 18px;
  }

  .app-header {
    height: 72px;
    padding: 0 40px;
  }

  .app-body {
    height: calc(100vh - 72px);
  }

  .header-logo .logo-text {
    font-size: 1.1rem;
    letter-spacing: 3px;
  }

  .header-logo .logo-icon {
    font-size: 1.4rem;
  }

  .header-nav .nav-btn {
    font-size: 1rem;
    padding: 10px 18px;
    gap: 8px;
  }

  .header-nav .nav-btn svg {
    width: 22px;
    height: 22px;
  }

  .sidebar {
    width: 280px;
    min-width: 280px;
    padding: 20px 0;
  }

  .sidebar-item {
    padding: 14px 24px;
    font-size: 1rem;
  }

  .content-area {
    padding: 24px 32px 32px;
  }

  .content-grid {
    gap: 20px;
  }

  .card {
    width: 180px;
  }

  .card-title {
    font-size: 0.9rem;
  }

  .continue-card {
    flex: 0 0 180px;
    width: 180px;
    max-width: 180px;
  }

  .section-title {
    font-size: 1.3rem;
    margin-bottom: 16px;
  }

  .search-box input {
    width: 220px;
    font-size: 1rem;
  }

  /* Foco visível para navegação com controle remoto */
  :focus-visible {
    outline: 3px solid var(--accent) !important;
    outline-offset: 3px !important;
  }

  .nav-btn:focus-visible,
  .sidebar-item:focus-visible {
    background: var(--bg3);
    outline: 3px solid var(--accent) !important;
  }

  .card:focus-visible {
    outline: 3px solid var(--accent) !important;
    transform: scale(1.06);
    box-shadow: 0 8px 24px rgba(76, 175, 80, 0.4);
  }
}

/* ======================================
   FOCO VISÍVEL (CONTROLE REMOTO / TECLADO)
   Aplica em qualquer tamanho de tela quando
   o usuário navega por teclado (TV / acessibilidade)
   ====================================== */

body.tv-mode :focus {
  outline: 3px solid var(--accent) !important;
  outline-offset: 3px !important;
}

body.tv-mode .card:focus {
  transform: scale(1.08);
  box-shadow: 0 0 0 3px var(--accent), 0 8px 24px rgba(76, 175, 80, 0.4);
  outline: none !important;
  z-index: 2;
}

body.tv-mode .nav-btn:focus,
body.tv-mode .sidebar-item:focus {
  background: var(--bg3);
  outline: 3px solid var(--accent) !important;
}

body.tv-mode .episode-item:focus {
  background: var(--bg3);
  outline: 3px solid var(--accent) !important;
}

body.tv-mode button:focus {
  outline: 3px solid var(--accent) !important;
  outline-offset: 2px !important;
}

/* bottom-nav: sempre oculto — navegação fica no header */
.bottom-nav {
  display: none;
}