:root {
  --bg-root: #09090b;
  --bg-surface: #121215;
  --bg-elevated: #1a1a1f;
  --accent: #7c5cff;
  --accent-hover: #9277ff;
  --text-primary: #f4f4f6;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.18);
  --success: #22c55e;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --sidebar-w: 84px;
  --topbar-h: 66px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body, input, select, button, textarea {
  font-family: 'Urbanist', -apple-system, BlinkMacSystemFont, sans-serif;
}

html, body {
  width: 100%;
  height: 100%;
  background: var(--bg-root);
  color: var(--text-primary);
  overflow: hidden;
  user-select: none;
}

.material-symbols-rounded {
  font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24;
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

.material-symbols-rounded.filled {
  font-variation-settings: 'FILL' 1, 'wght' 600, 'GRAD' 0, 'opsz' 24;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.hidden {
  display: none !important;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas:
    "topbar topbar"
    "sidebar main";
  width: 100vw;
  height: 100vh;
}

/* TOPBAR */
.topbar {
  grid-area: topbar;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 22px;
  background: #09090b;
  border-bottom: 1px solid var(--border);
  z-index: 40;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  flex-shrink: 0;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-logo .material-symbols-rounded {
  font-size: 24px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1.05;
}

.brand-badge {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
}

.search-wrap {
  position: relative;
  flex: 1;
  max-width: 560px;
}

.search-wrap input {
  width: 100%;
  height: 42px;
  padding: 0 38px 0 42px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  color: var(--text-primary);
  font-size: 0.94rem;
  font-weight: 500;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.search-wrap input:focus {
  outline: none;
  border-color: var(--border-strong);
  background: var(--bg-elevated);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 19px;
  color: var(--text-secondary);
  pointer-events: none;
}

.clear-search-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: 99px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.pill-btn:hover {
  border-color: var(--border-strong);
  background: var(--bg-elevated);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
}

.icon-btn:hover {
  color: #fff;
  border-color: var(--border-strong);
  background: var(--bg-elevated);
}

/* SIDEBAR */
.sidebar {
  grid-area: sidebar;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 8px;
  gap: 8px;
  background: #09090b;
  border-right: 1px solid var(--border);
  z-index: 30;
}

.nav-item {
  width: 68px;
  height: 62px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}

.nav-item .material-symbols-rounded {
  font-size: 22px;
}

.nav-item:hover {
  color: #fff;
  background: var(--bg-surface);
}

.nav-item.active {
  color: #fff;
  background: var(--bg-elevated);
  border-color: var(--border-strong);
}

.nav-item.active .material-symbols-rounded {
  font-variation-settings: 'FILL' 1, 'wght' 600, 'GRAD' 0, 'opsz' 24;
  color: #fff;
}

/* MAIN CONTENT */
.main-content {
  grid-area: main;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 0 60px;
  scroll-behavior: smooth;
}

.view-section {
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* HERO BANNER — Clean image with pure black fade only */
.hero-banner {
  position: relative;
  min-height: 380px;
  margin: 18px 26px 10px;
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 34px 36px;
  border: 1px solid var(--border);
  background: #050506;
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 20%;
  transition: transform 6s ease;
}

.hero-banner:hover .hero-backdrop {
  transform: scale(1.02);
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.62) 45%, rgba(0, 0, 0, 0.05) 100%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0) 60%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 580px;
}

.hero-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(18, 18, 21, 0.9);
  border: 1px solid var(--border);
  color: #fff;
}

.badge-tag.accent {
  background: #fff;
  color: #09090b;
  border-color: #fff;
}

.badge-tag.imdb {
  background: rgba(18, 18, 21, 0.92);
  color: #facc15;
  border-color: rgba(250, 204, 21, 0.35);
}

.hero-logo-wrap img {
  max-height: 74px;
  max-width: 310px;
  object-fit: contain;
  margin-bottom: 10px;
}

.hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.12;
  margin-bottom: 10px;
}

.hero-synopsis {
  font-size: 0.95rem;
  line-height: 1.55;
  color: #d4d4d8;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* BUTTONS — Solid clean matte buttons (no gradients) */
.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 22px;
  border-radius: 99px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: #ffffff;
  color: #09090b;
}

.btn-primary:hover {
  background: #e4e4e7;
}

.btn-secondary {
  background: rgba(18, 18, 21, 0.88);
  color: #fff;
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--bg-elevated);
  border-color: rgba(255, 255, 255, 0.32);
}

.btn-sm {
  height: 36px;
  padding: 0 15px;
  font-size: 0.84rem;
}

/* BOARD ROWS */
.board-rows {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 16px 26px;
}

.catalog-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.row-title {
  font-size: 1.18rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.row-count {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 99px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

.row-see-all {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.row-see-all:hover {
  color: #fff;
}

.row-scroller {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 4px 2px 12px;
  scroll-snap-type: x proximity;
}

/* POSTER CARD — 100% clean poster artwork without gradient overlays */
.poster-card {
  flex: 0 0 168px;
  width: 168px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  scroll-snap-align: start;
  position: relative;
}

.poster-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.poster-card:hover .poster-thumb-wrap {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.35);
}

.poster-img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.poster-fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px;
  text-align: center;
  background: #141418;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.poster-hover-play {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: rgba(0, 0, 0, 0.52);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.poster-card:hover .poster-hover-play {
  opacity: 1;
}

.play-circle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #ffffff;
  color: #09090b;
  display: flex;
  align-items: center;
  justify-content: center;
}

.poster-top-badge {
  position: absolute;
  z-index: 2;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(9, 9, 11, 0.88);
  color: #f4f4f6;
  border: 1px solid rgba(255,255,255,0.12);
}

.poster-rating-badge {
  position: absolute;
  z-index: 2;
  top: 8px;
  right: 8px;
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 800;
  background: rgba(9, 9, 11, 0.9);
  color: #facc15;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.poster-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.poster-meta {
  font-size: 0.76rem;
  color: var(--text-secondary);
}

/* CONTINUE WATCHING CARDS */
.continue-card {
  flex: 0 0 270px;
  width: 270px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.continue-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
}

.continue-thumb {
  position: relative;
  height: 138px;
  background-size: cover;
  background-position: center;
  background-color: #16161a;
  display: flex;
  align-items: center;
  justify-content: center;
}

.continue-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.15) 65%);
}

.continue-thumb .play-circle {
  position: relative;
  z-index: 2;
  width: 42px;
  height: 42px;
}

.continue-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  z-index: 3;
}

.continue-progress-fill {
  height: 100%;
  background: #ffffff;
}

.continue-body {
  padding: 10px 12px;
}

.continue-series {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.continue-ep {
  font-size: 0.76rem;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* DISCOVER / GRID VIEW */
.discover-header, .folders-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 24px 26px 16px;
}

.section-heading {
  font-size: 1.48rem;
  font-weight: 800;
}

.section-subtitle {
  font-size: 0.86rem;
  color: var(--text-secondary);
  margin-top: 3px;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-pill {
  height: 34px;
  padding: 0 14px;
  border-radius: 99px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}

.filter-pill.active, .filter-pill:hover {
  background: #ffffff;
  color: #09090b;
  border-color: #ffffff;
}

.stremio-select, .stremio-input, .stremio-input-sm {
  height: 38px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 0.88rem;
}

.stremio-input {
  width: 100%;
  height: 42px;
}

.stremio-input-sm {
  height: 34px;
  font-size: 0.82rem;
  width: 210px;
}

.poster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 20px 16px;
  padding: 10px 26px 40px;
}

.poster-grid .poster-card {
  width: 100%;
  flex: none;
}

.continue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  padding: 0 26px;
}

.continue-grid .continue-card {
  width: 100%;
}

/* FOLDERS EXPLORER */
.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 26px 16px;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.crumb-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.crumb-btn:hover, .crumb-btn.active {
  color: #fff;
  background: var(--bg-elevated);
}

.crumb-sep {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.folder-explorer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 12px;
  padding: 0 26px 40px;
}

.drive-item-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.16s ease;
}

.drive-item-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-elevated);
  transform: translateY(-2px);
}

.drive-item-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--bg-elevated);
  color: #fff;
}

.drive-item-info {
  flex: 1;
  min-width: 0;
}

.drive-item-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drive-item-sub {
  font-size: 0.76rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* STREMIO DETAIL MODAL / DRAWER — Pure black fade only */
.detail-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: #050506;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.2s ease;
}

.detail-backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.42;
}

.detail-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 5, 6, 0.96) 0%, rgba(5, 5, 6, 0.78) 45%, rgba(5, 5, 6, 0.94) 100%),
    linear-gradient(0deg, rgba(5, 5, 6, 0.98) 0%, rgba(5, 5, 6, 0.25) 65%);
}

.detail-back-btn {
  position: relative;
  z-index: 3;
  align-self: flex-start;
  margin: 20px 26px 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border-radius: 99px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  color: #fff;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
}

.detail-layout {
  position: relative;
  z-index: 3;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(300px, 440px) 1fr;
  gap: 32px;
  padding: 20px 28px 28px;
  min-height: 0;
}

.detail-meta-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  overflow-y: auto;
  padding-right: 8px;
}

.detail-logo-area img {
  max-height: 92px;
  max-width: 320px;
  object-fit: contain;
}

.detail-title {
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1.12;
}

.detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-synopsis {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #d4d4d8;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.detail-episodes-col {
  background: rgba(15, 15, 18, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.episodes-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: #121215;
}

.season-selector-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.episodes-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.episode-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.16s ease;
}

.episode-row:hover {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
}

.episode-row.watched {
  opacity: 0.72;
}

.ep-num-badge {
  min-width: 48px;
  height: 38px;
  padding: 0 10px;
  border-radius: 9px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: #fff;
  font-weight: 800;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ep-info {
  flex: 1;
  min-width: 0;
}

.ep-title {
  font-size: 0.94rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ep-sub {
  font-size: 0.76rem;
  color: var(--text-secondary);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ep-play-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ffffff;
  color: #09090b;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* VIDEO PLAYER MODAL */
.player-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: #000;
  display: flex;
  flex-direction: column;
}

.player-topbar {
  height: 60px;
  padding: 0 20px;
  background: #09090b;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  z-index: 5;
}

.player-back-btn, .player-mode-btn, .player-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 99px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.player-back-btn:hover, .player-mode-btn:hover, .player-nav-btn:hover {
  background: var(--bg-elevated);
}

.player-title-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
  flex: 1;
}

.player-series-name {
  font-size: 0.76rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.player-episode-name {
  font-size: 0.96rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.player-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.player-stage {
  position: relative;
  flex: 1;
  width: 100%;
  height: calc(100vh - 60px);
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stremio-video, .drive-embed-frame {
  width: 100%;
  height: 100%;
  border: none;
  outline: none;
  background: #000;
}

.up-next-toast {
  position: absolute;
  right: 28px;
  bottom: 84px;
  background: #121215;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 10;
  min-width: 280px;
}

.up-next-text span {
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.up-next-text p {
  font-size: 0.94rem;
  font-weight: 700;
  color: #fff;
  margin-top: 3px;
}

.up-next-btns {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* SETTINGS */
.settings-container {
  max-width: 760px;
  padding: 24px 26px 50px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.settings-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.settings-card h3 {
  font-size: 1.04rem;
  margin-bottom: 6px;
}

.settings-help {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.input-row, .oauth-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.input-row .stremio-input {
  flex: 1;
  min-width: 220px;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.form-grid label span, .custom-modal-box label span {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 5px;
  font-weight: 600;
}

.badge-pill {
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(34, 197, 94, 0.14);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

/* CUSTOM COVER MODAL */
.custom-modal {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(0, 0, 0, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.custom-modal-box {
  width: 100%;
  max-width: 460px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 22px;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
}

/* MOBILE & APK RESPONSIVE LAYOUT */
@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: var(--topbar-h) 1fr 64px;
    grid-template-areas:
      "topbar"
      "main"
      "sidebar";
  }

  .topbar {
    padding: 0 12px;
    gap: 10px;
  }

  .brand-text, .pill-label {
    display: none;
  }

  .sidebar {
    flex-direction: row;
    justify-content: space-around;
    padding: 4px 6px;
    border-right: none;
    border-top: 1px solid var(--border);
  }

  .nav-item {
    width: auto;
    flex: 1;
    height: 54px;
    font-size: 0.68rem;
  }

  .hero-banner {
    min-height: 310px;
    margin: 12px 14px 6px;
    padding: 22px 20px;
  }

  .hero-title {
    font-size: 1.55rem;
  }

  .board-rows {
    padding: 12px 14px;
  }

  .poster-card {
    flex: 0 0 136px;
    width: 136px;
  }

  .poster-grid {
    grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
    padding: 10px 14px 30px;
    gap: 16px 12px;
  }

  .detail-layout {
    grid-template-columns: 1fr;
    overflow-y: auto;
    padding: 14px 16px 30px;
    gap: 18px;
  }

  .detail-meta-col {
    overflow: visible;
  }

  .detail-episodes-col {
    min-height: 420px;
  }

  .player-topbar {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 12px;
  }
}
