:root {
  --bg-primary: #050505;
  --bg-secondary: #0a0a0c;
  --bg-card: #121214;
  --bg-card-hover: #1c1c1f;
  --bg-glass: rgba(10, 10, 12, 0.65);
  --bg-glass-heavy: rgba(5, 5, 5, 0.85);

  --accent-primary: #3b82f6;
  --accent-primary-hover: #60a5fa;
  --accent-ai-1: #ff2a85;
  --accent-ai-2: #8a2be2;
  --accent-ai-3: #4169e1;
  --accent-gold: #f59e0b;
  --accent-success: #10b981;
  --accent-danger: #ef4444;

  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #52525b;

  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-card: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(255, 255, 255, 0.15);

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', var(--font-sans);

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.8);
  --shadow-ai: 0 0 32px rgba(138, 43, 226, 0.3);

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  
  --transition-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Navbar ─────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 68px;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 1000;
  transition: background 0.3s ease;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
}

.brand-logo-img {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #ffffff;
}

.brand-tag {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-primary);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-item {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-item:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.jelly-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-danger);
  display: inline-block;
}

.jelly-status-dot.online {
  background: var(--accent-success);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  padding: 0.45rem 2rem 0.45rem 2.2rem;
  width: 240px;
  transition: all 0.25s ease;
}

.search-box input:focus {
  outline: none;
  width: 320px;
  border-color: var(--accent-primary);
  background: var(--bg-card);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.search-clear-btn {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  padding: 3px 10px 3px 4px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}

.user-profile-badge:hover {
  background: var(--bg-card);
  border-color: var(--border-card);
}

.user-avatar-img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--accent-primary);
}

.user-profile-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.appletv-btn {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--accent-primary);
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-sans);
  font-size: 0.825rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.appletv-btn svg {
  width: 15px;
  height: 15px;
}

.appletv-btn:hover {
  background: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.4);
}

.settings-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.settings-btn svg {
  width: 18px;
  height: 18px;
}

.settings-btn:hover {
  color: #ffffff;
  border-color: var(--border-card);
  background: var(--bg-card);
}

/* ── Main View ───────────────────────────────────────────── */
.main-view {
  margin-top: 68px;
  flex: 1;
}

/* ── Hero Banner ─────────────────────────────────────────── */
.hero-section {
  position: relative;
  min-height: 68vh;
  max-height: 720px;
  display: flex;
  align-items: flex-end;
  padding: 4rem 3rem;
  overflow: hidden;
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  filter: brightness(0.65);
  transition: background-image 0.6s ease-in-out;
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, var(--bg-primary) 0%, rgba(10, 12, 16, 0.4) 60%, rgba(10, 12, 16, 0.8) 100%),
              linear-gradient(90deg, var(--bg-primary) 0%, rgba(10, 12, 16, 0.2) 60%, transparent 100%);
}

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

.hero-branding-watermark {
  position: absolute;
  right: 5%;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  opacity: 0.14;
  filter: drop-shadow(0 0 30px rgba(99, 102, 241, 0.6));
  z-index: 1;
}

.hero-watermark-logo {
  width: min(340px, 35vw);
  height: min(340px, 35vw);
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(255, 255, 255, 0.4);
}

.hero-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(99, 102, 241, 0.25) 100%);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.45);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 2.85rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  flex-wrap: wrap;
}

.hero-rating {
  color: var(--accent-gold);
}

.hero-year {
  color: var(--text-secondary);
}

.hero-quality {
  background: rgba(255, 255, 255, 0.15);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.hero-brand-pill {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.hero-overview {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0 1.4rem;
  min-height: 48px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  transition: all 0.3s var(--transition-spring);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.96);
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.35);
  border-color: rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
  background: var(--accent-primary-hover);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.45);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: var(--border-card);
}

.btn-grab {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
}

.btn-grab:hover {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.btn-grab.downloading {
  background: #4b5563;
  cursor: wait;
  box-shadow: none;
}

/* ── Genre Filter Bar ────────────────────────────────────── */
.genre-filter-container {
  padding: 1rem 2.5rem 0.5rem;
  overflow-x: auto;
}

.genre-filter-scroll {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: none;
}

.genre-filter-scroll::-webkit-scrollbar {
  display: none;
}

.genre-pill {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.genre-pill:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-card);
}

.genre-pill.active {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.4);
}

.load-more-wrapper {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
}

/* ── Catalog Rows & Grids ────────────────────────────────── */
.catalog-section {
  padding: 1.5rem 2.5rem;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

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

.media-row-wrapper {
  position: relative;
  display: block;
}

.media-row-scroll {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-card-hover) transparent;
}

.shelf-arrow {
  position: absolute;
  top: calc(50% - 1.5rem);
  z-index: 15;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(13, 17, 23, 0.88);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.7);
}

.shelf-arrow svg {
  width: 22px;
  height: 22px;
}

.media-row-wrapper:hover .shelf-arrow {
  opacity: 0.9;
  pointer-events: auto;
}

.shelf-arrow:hover {
  opacity: 1 !important;
  background: var(--accent-primary, #6366f1);
  border-color: #818cf8;
  transform: scale(1.1);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.6);
}

.shelf-arrow-left {
  left: -16px;
}

.shelf-arrow-right {
  right: -16px;
}

@media (max-width: 768px) {
  .shelf-arrow {
    display: none !important;
  }
}

.media-row-scroll::-webkit-scrollbar {
  height: 6px;
}

.media-row-scroll::-webkit-scrollbar-thumb {
  background: var(--bg-card-hover);
  border-radius: var(--radius-full);
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.5rem;
}

/* ── Media Card ──────────────────────────────────────────── */
.media-card {
  position: relative;
  flex: 0 0 180px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  border: 1px solid var(--border-subtle);
}

.media-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: var(--shadow-md);
  border-color: var(--border-card);
}

.card-poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  background: var(--bg-secondary);
  display: block;
}

.card-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  color: var(--accent-gold);
}

.card-info {
  padding: 0.75rem 0.65rem;
}

.card-title {
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.25rem;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Shimmering Skeleton Loader ──────────────────────────── */
.media-card.skeleton {
  pointer-events: none;
  border-color: rgba(255, 255, 255, 0.05);
}

.media-card.skeleton .skeleton-poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  background: linear-gradient(90deg, #131722 0%, #1e2436 50%, #131722 100%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
}

.media-card.skeleton .skeleton-info {
  padding: 0.75rem 0.65rem;
}

.media-card.skeleton .skeleton-line {
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(90deg, #131722 0%, #1e2436 50%, #131722 100%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  margin-bottom: 6px;
}

.media-card.skeleton .skeleton-line.short {
  width: 60%;
  height: 10px;
  margin-bottom: 0;
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Player Streaming Telemetry ──────────────────────────── */
.player-telemetry-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 4px;
  padding: 2px 8px;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

@media (max-width: 768px) {
  .player-telemetry-badge {
    display: none;
  }
}

/* ── Amway Quick Search ──────────────────────────────────── */
.amway-search-box {
  position: relative;
  max-width: 480px;
  width: 100%;
  margin: 1.25rem 0 1.5rem 0;
  display: flex;
  align-items: center;
}

.amway-search-box input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.6rem;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(52, 211, 153, 0.4);
  border-radius: 9999px;
  color: #ffffff;
  font-size: 0.9rem;
  font-family: inherit;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 15px rgba(52, 211, 153, 0.15);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.amway-search-box input:focus {
  outline: none;
  border-color: #34d399;
  box-shadow: 0 0 20px rgba(52, 211, 153, 0.4);
}

.amway-search-box .search-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  stroke: #34d399;
  pointer-events: none;
}

/* ── Modals & Overlays ────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease;
}

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

/* ── Player Modal ────────────────────────────────────────── */
.player-wrapper {
  background: #000000;
  width: 95vw;
  max-width: 1300px;
  height: 90vh;
  max-height: 850px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-subtle);
}

.player-header {
  height: 56px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.player-title-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.player-badge {
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--accent-primary);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
}

.player-title {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
}

.player-episode-info {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.player-controls-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.source-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.source-dropdown, .season-dropdown {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  cursor: pointer;
}

.player-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.player-back-btn svg {
  width: 16px;
  height: 16px;
  stroke: var(--accent-primary);
}

.player-back-btn:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
  transform: translateX(-2px);
}

.player-back-btn:hover svg {
  stroke: #fff;
}

.player-floating-back {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 10000;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(13, 16, 23, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  transition: all 0.2s ease;
  opacity: 0.85;
}

.player-floating-back svg {
  width: 16px;
  height: 16px;
  stroke: var(--accent-primary);
}

.player-floating-back:hover {
  opacity: 1;
  transform: scale(1.05);
  background: rgba(30, 41, 59, 0.95);
  border-color: var(--accent-primary);
}

.player-close-btn, .details-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
  padding: 0 0.5rem;
  transition: color 0.2s;
}

.player-close-btn:hover, .details-close-btn:hover {
  color: #ffffff;
}

.player-viewport {
  flex: 1;
  background: #000;
  position: relative;
}

.video-frame {
  width: 100%;
  height: 100%;
  border: none;
}

/* ── AniSkip Interactive Button ─────────────────────────── */
.aniskip-btn {
  position: absolute;
  bottom: 30px;
  right: 30px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid rgba(56, 189, 248, 0.6);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 9999px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8), 0 0 20px rgba(56, 189, 248, 0.35);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  animation: aniskip-pulse 2s infinite;
}

.aniskip-btn svg {
  width: 18px;
  height: 18px;
  fill: #38bdf8;
}

.aniskip-btn:hover {
  transform: scale(1.06);
  background: #0284c7;
  border-color: #7dd3fc;
  box-shadow: 0 0 28px rgba(56, 189, 248, 0.6);
}

@keyframes aniskip-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

/* ── Professional Subtitle Rendering ─────────────────────────── */
::cue {
  color: #fff;
  background-color: transparent;
  text-shadow: 
    0px 0px 4px #000, 
    0px 0px 4px #000, 
    0px 0px 4px #000,
    -1px -1px 0 #000, 
    1px -1px 0 #000, 
    -1px 1px 0 #000, 
    1px 1px 0 #000,
    0 4px 6px rgba(0,0,0,0.8);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.4;
}

video::-webkit-media-text-track-display {
  padding: 0 10%;
  text-align: center;
}

.subtitle-octopus-container {
  /* Let Octopus handle its own styles, just ensure it's on top of video-frame/native-player but under UI */
  z-index: 15;
}

.sub-sync-group {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 4px;
}

.sub-sync-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.sub-sync-btn:hover {
  background: rgba(56, 189, 248, 0.25);
  color: #38bdf8;
  border-color: #38bdf8;
}

@media (max-width: 768px) {
  .aniskip-btn {
    bottom: 20px;
    right: 20px;
    padding: 8px 14px;
    font-size: 0.85rem;
  }
}

/* ── TV Episode Drawer ───────────────────────────────────── */
.episode-drawer {
  height: 140px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding: 0.75rem 1.25rem;
  display: flex;
  flex-direction: column;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.episode-list {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  flex: 1;
  padding-bottom: 4px;
}

.episode-pill {
  flex: 0 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.episode-pill:hover {
  color: #fff;
  background: var(--bg-card-hover);
}

.episode-pill.active {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
}

/* ── Details Card ────────────────────────────────────────── */
.details-card {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  max-width: 820px;
  width: 90vw;
  max-height: 88vh;
  overflow-y: auto;
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-lg);
}

.details-close-btn {
  position: absolute;
  top: 12px;
  right: 16px;
  z-index: 10;
}

.details-backdrop {
  height: 220px;
  background-size: cover;
  background-position: center;
  position: relative;
  filter: brightness(0.6);
}

.details-body {
  position: relative;
  display: flex;
  gap: 1.75rem;
  padding: 1.5rem 2rem 2.5rem;
  margin-top: -80px;
}

.details-poster-wrap {
  flex: 0 0 160px;
  z-index: 2;
}

.details-poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-card);
}

.details-info {
  flex: 1;
}

.details-badges {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}

.badge-rating { background: rgba(245, 158, 11, 0.2); color: var(--accent-gold); }
.badge-year { background: rgba(255, 255, 255, 0.1); color: var(--text-secondary); }
.badge-type { background: rgba(59, 130, 246, 0.2); color: var(--accent-primary); }

.details-title {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.details-tagline {
  font-style: italic;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

.details-overview {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.details-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.genre-tag {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.details-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.subhead {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.cast-row {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.cast-chip {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-secondary);
  padding: 4px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.cast-photo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.cast-name {
  font-size: 0.8rem;
  font-weight: 600;
}

/* ── Settings Card ───────────────────────────────────────── */
.settings-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 480px;
  max-width: 90vw;
  padding: 1.75rem;
  border: 1px solid var(--border-card);
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.settings-content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.setting-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.setting-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.setting-group input, .setting-group select {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
}

.setting-group input:focus, .setting-group select:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.settings-actions {
  margin-top: 0.5rem;
  display: flex;
  justify-content: flex-end;
}

/* ── Progress Bar on Cards ───────────────────────────────── */
.card-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  z-index: 5;
}

.card-progress-fill {
  height: 100%;
  background: var(--accent-primary);
  box-shadow: 0 0 8px var(--accent-primary);
  transition: width 0.3s ease;
}

/* ── Ambient Backlight Glow ──────────────────────────────── */
.player-ambient-glow {
  position: absolute;
  inset: -40px;
  background: radial-gradient(circle at center, rgba(59, 130, 246, 0.25) 0%, rgba(245, 158, 11, 0.15) 50%, transparent 80%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
  transition: all 0.8s ease;
}

.player-tool-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.player-tool-btn svg {
  width: 14px;
  height: 14px;
  color: var(--accent-gold);
}

.player-tool-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
}

/* ── Sort Controls ───────────────────────────────────────── */
.sort-control-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.sort-dropdown {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.sort-dropdown:focus {
  outline: none;
  border-color: var(--accent-primary);
}

/* ── Trailer Modal ───────────────────────────────────────── */
.trailer-wrapper {
  background: #000;
  border-radius: var(--radius-lg);
  width: 90vw;
  max-width: 960px;
  height: 80vh;
  max-height: 560px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
}

.trailer-header {
  height: 50px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.trailer-header h3 {
  font-size: 1rem;
  font-weight: 700;
}

.trailer-viewport {
  flex: 1;
}

.trailer-frame {
  width: 100%;
  height: 100%;
  border: none;
}

/* ── Filmography Modal ───────────────────────────────────── */
.filmography-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 90vw;
  max-width: 920px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 1.75rem;
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-lg);
}

.filmography-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.filmography-header h3 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
}

/* ── Keyboard Shortcuts Modal ────────────────────────────── */
.shortcuts-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 480px;
  max-width: 90vw;
  padding: 1.75rem;
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-lg);
}

.shortcuts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.shortcuts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.shortcut-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

kbd {
  background: var(--bg-secondary);
  border: 1px solid var(--border-card);
  border-radius: 4px;
  padding: 2px 8px;
  font-family: monospace;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-primary);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.4);
}

/* ── Toast Notifications ─────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  z-index: 3000;
  pointer-events: none;
}

.toast-item {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: slideToast 0.25s ease-out;
  pointer-events: auto;
}

@keyframes slideToast {
  from { transform: translateX(40px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ── Apple TV Modal ──────────────────────────────────────── */
.appletv-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 580px;
  max-width: 92vw;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.75rem;
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-lg);
}

.appletv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.appletv-header-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.appletv-header-icon {
  width: 24px;
  height: 24px;
  color: var(--accent-primary);
}

.appletv-content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.appletv-option-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.appletv-option-card:hover {
  border-color: var(--accent-primary);
  background: rgba(30, 41, 59, 0.7);
}

.appletv-option-badge {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--accent-gold);
}

.appletv-option-card h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
}

.appletv-option-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.copy-url-group {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.copy-url-group input {
  flex: 1;
  background: var(--bg-primary);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: monospace;
  font-size: 0.8rem;
  padding: 0.5rem 0.75rem;
}

.copy-url-group input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

/* ── AI Cinema Concierge (Ollama GPU) ────────────────────── */
.ai-concierge-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(10, 10, 14, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0 1rem;
  min-height: 44px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.3s var(--transition-spring);
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.ai-concierge-btn::before {
  content: '';
  position: absolute;
  top: -2px; left: -2px; right: -2px; bottom: -2px;
  background: linear-gradient(90deg, var(--accent-ai-1), var(--accent-ai-2), var(--accent-ai-3), var(--accent-ai-1));
  background-size: 300% 300%;
  z-index: -1;
  border-radius: 9999px;
  animation: aiGlow 4s linear infinite;
  opacity: 0.5;
  transition: opacity 0.3s;
}

@keyframes aiGlow {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

.ai-concierge-btn::after {
  content: '';
  position: absolute;
  inset: 1px;
  background: #0a0a0c;
  border-radius: 9999px;
  z-index: -1;
}

.ai-concierge-btn svg {
  width: 18px;
  height: 18px;
  stroke: url(#ai-grad) #d8b4fe;
}

.ai-concierge-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-ai);
}

.ai-concierge-btn:hover::before {
  opacity: 1;
}

.ai-concierge-btn:active {
  transform: scale(0.95);
}

.ai-concierge-card {
  max-width: 860px;
  width: 92%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: #11141d;
  border: 1px solid rgba(168, 85, 247, 0.3);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(147, 51, 234, 0.15);
}

.ai-concierge-body {
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.ai-vibe-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ai-preset-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.ai-preset-chip:hover {
  background: rgba(168, 85, 247, 0.2);
  border-color: rgba(168, 85, 247, 0.5);
  color: #f3e8ff;
  transform: translateY(-1px);
}

.ai-input-group {
  display: flex;
  gap: 0.6rem;
}

.ai-input-group input {
  flex: 1;
  background: #0d1017;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  color: #fff;
  font-size: 0.95rem;
}

.ai-input-group input:focus {
  outline: none;
  border-color: #a855f7;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
}

.ai-status-indicator {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  background: rgba(168, 85, 247, 0.1);
  border-radius: var(--radius-md);
  border: 1px solid rgba(168, 85, 247, 0.2);
  color: #d8b4fe;
  font-size: 0.85rem;
}

.ai-pulsing-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #a855f7;
  animation: pulse-glow 1.4s infinite;
}

@keyframes pulse-glow {
  0%, 100% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.3); opacity: 1; filter: drop-shadow(0 0 6px #c084fc); }
}

.ai-thought-drawer {
  background: rgba(168, 85, 247, 0.08);
  border: 1px dashed rgba(168, 85, 247, 0.35);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
  font-family: var(--font-mono, monospace);
  font-size: 0.8rem;
  color: #d8b4fe;
  line-height: 1.6;
  white-space: pre-wrap;
  max-height: 220px;
  overflow-y: auto;
}

.ai-thought-drawer::before {
  content: '🧠 DeepSeek-R1 Neural Chain-of-Thought:';
  display: block;
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  color: #c084fc;
}

.ai-summary-banner {
  font-size: 0.92rem;
  color: #e9d5ff;
  line-height: 1.5;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* ── Amway Education & Knowledge Hub ────────────────────── */
.amway-hero-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(59, 130, 246, 0.12)), #0d1117;
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.amway-hero-badge {
  display: inline-block;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 9999px;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.amway-hero-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.6rem;
  letter-spacing: -0.02em;
}

.amway-hero-desc {
  font-size: 0.95rem;
  color: #cbd5e1;
  max-width: 720px;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.amway-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.amway-pill {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.amway-pill:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
  transform: translateY(-1px);
}

.amway-pill.active {
  background: linear-gradient(135deg, #10b981, #059669);
  border-color: #10b981;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.amway-shelf-block {
  margin-bottom: 2.25rem;
}

/* ── Media Stack Health Dashboard ────────────────────────── */
.stack-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  color: #fff;
  transition: all 0.2s ease;
}
.stack-pill.online {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.4);
  color: #86efac;
}
.stack-pill.offline {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

/* ── Mobile Bottom Navigation Bar (Frosted Glass) ────────── */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(65px + env(safe-area-inset-bottom, 0px));
  background: var(--bg-glass-heavy);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-top: 1px solid var(--border-subtle);
  z-index: 9000;
  padding: 0 0.5rem;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 8px 0;
  cursor: pointer;
  transition: all 0.3s var(--transition-spring);
  -webkit-tap-highlight-color: transparent;
  min-height: 48px;
}

.mobile-nav-item:active {
  transform: scale(0.92);
}

.mobile-nav-item svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  transition: stroke 0.3s var(--transition-spring);
}

.mobile-nav-item.active {
  color: var(--accent-primary);
}

.mobile-nav-item.active svg {
  stroke: var(--accent-primary);
  stroke-width: 2.5;
}

#mobile-ai-trigger {
  position: relative;
}

#mobile-ai-trigger span:first-child {
  filter: drop-shadow(0 0 8px rgba(138, 43, 226, 0.8));
  animation: pulseAi 3s infinite alternate;
}

@keyframes pulseAi {
  0% { transform: scale(1); filter: drop-shadow(0 0 6px rgba(138, 43, 226, 0.5)); }
  100% { transform: scale(1.15); filter: drop-shadow(0 0 12px rgba(138, 43, 226, 0.9)); }
}

/* ── Responsive Mobile Touchscreen Engine ─────────────────── */
@media (max-width: 768px), (pointer: coarse) {
  body {
    padding-bottom: 70px;
  }

  .navbar {
    padding: 0 1rem;
    height: 58px;
  }
  .nav-left { gap: 1rem; }
  .nav-links { display: none; }
  
  .mobile-bottom-nav {
    display: flex;
    justify-content: space-around;
  }

  .hero-section {
    padding: 2rem 1.25rem;
    min-height: 45vh;
  }
  .hero-title { font-size: 1.75rem; }
  .hero-actions { flex-wrap: wrap; gap: 0.5rem; }
  .catalog-section { padding: 1rem; }
  
  .media-card {
    flex: 0 0 140px;
  }

  /* Compact Sleek Mobile Player Header */
  .player-wrapper {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
    max-width: 100vw;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: #000;
  }

  .player-header {
    height: 56px;
    min-height: 56px;
    padding: 0 max(0.6rem, env(safe-area-inset-right)) 0 max(0.6rem, env(safe-area-inset-left));
    background: rgba(5, 5, 5, 0.95);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    flex-wrap: nowrap;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: env(safe-area-inset-top, 0);
  }

  .player-title-info {
    flex: 1 1 auto;
    min-width: 0;
    gap: 0.4rem;
  }

  .player-back-btn {
    padding: 0 0.8rem;
    min-height: 44px;
    font-size: 0.85rem;
  }

  .player-title {
    font-size: 0.85rem;
    max-width: 110px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .player-episode-info {
    display: none;
  }

  .player-controls-right {
    flex: 0 0 auto;
    gap: 0.3rem;
    flex-wrap: nowrap;
  }

  .source-selector label {
    display: none;
  }

  .source-dropdown, .season-dropdown {
    max-width: 110px;
    font-size: 0.72rem;
    padding: 3px 6px;
  }

  .player-tool-btn {
    padding: 4px 6px;
    font-size: 0.72rem;
  }

  .player-tool-btn span {
    display: none;
  }

  /* Hide bottom nav completely when player is active */
  body.player-active .mobile-bottom-nav {
    display: none !important;
  }
  body.player-active {
    padding-bottom: 0 !important;
    overflow: hidden !important;
  }

  .player-fullscreen-btn {
    background: rgba(99, 102, 241, 0.25) !important;
    border: 1px solid rgba(99, 102, 241, 0.5) !important;
    color: #a5b4fc !important;
  }

  .player-viewport {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    position: relative;
    padding-bottom: max(22px, env(safe-area-inset-bottom));
  }

  .details-body {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .details-poster-wrap { flex: 0 0 160px; }
  .details-badges, .details-genres, .details-actions { justify-content: center; flex-wrap: wrap; }
  .shortcuts-grid { grid-template-columns: 1fr; }
  .ai-concierge-btn span { display: none; }
}

/* ═══════════════════════════════════════════════════════════════
   CINEMATIC INTRO SPLASH — INTRICATE BROKEN SCREEN & 3D REVEAL
   ═══════════════════════════════════════════════════════════════ */
.intro-splash-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: transparent;
  pointer-events: auto;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.intro-splash-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Stage 1 & 2: Glass Fracture & CRT Distortion Overlay */
.intro-glitch-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

.glass-crack-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.95)) drop-shadow(0 0 20px rgba(99, 102, 241, 0.85));
}

.glass-crack-svg.cracking {
  opacity: 1;
}

.crack-core-glow {
  opacity: 0;
  filter: blur(10px);
}

.glass-crack-svg.cracking .crack-core-glow {
  animation: core-impact-burst 2.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes core-impact-burst {
  0% { transform: scale(0.2); opacity: 0; }
  15% { transform: scale(1.4); opacity: 1; filter: blur(4px); }
  60% { transform: scale(1.1); opacity: 0.7; }
  100% { transform: scale(1); opacity: 0.4; }
}

.crack-ring {
  fill: none;
  stroke: rgba(255, 255, 255, 0.75);
  stroke-width: 1.4;
  stroke-dasharray: 800;
  stroke-dashoffset: 800;
  opacity: 0;
  filter: url(#crack-glow);
}

.glass-crack-svg.cracking .crack-ring.r1 { animation: ring-expand 1.4s 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.glass-crack-svg.cracking .crack-ring.r2 { animation: ring-expand 1.8s 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.glass-crack-svg.cracking .crack-ring.r3 { animation: ring-expand 2.2s 1.0s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

@keyframes ring-expand {
  0% { stroke-dashoffset: 800; opacity: 0; transform: scale(0.7); }
  20% { opacity: 0.9; }
  100% { stroke-dashoffset: 0; opacity: 0.45; transform: scale(1); }
}

.crack-line {
  fill: none;
  stroke: #ffffff;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 2400;
  stroke-dashoffset: 2400;
  filter: url(#crack-glow);
}

.crack-line.c-primary {
  stroke-width: 3.2;
}

.crack-line.c-secondary {
  stroke-width: 2.2;
  stroke: rgba(230, 240, 255, 0.95);
}

.crack-line.c-hairline {
  stroke-width: 1.2;
  stroke: rgba(165, 180, 252, 0.85);
}

.glass-crack-svg.cracking .crack-line.c-primary {
  animation: draw-crack-line 1.2s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}

.glass-crack-svg.cracking .crack-line.c-secondary {
  animation: draw-crack-line 1.5s 0.4s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}

.glass-crack-svg.cracking .crack-line.c-hairline {
  animation: draw-crack-line 1.8s 0.9s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}

.crack-shard {
  fill: rgba(255, 255, 255, 0.06);
  stroke: rgba(255, 255, 255, 0.6);
  stroke-width: 1.4;
  opacity: 0;
}

.glass-crack-svg.cracking .crack-shard {
  animation: shard-refract 1.4s 0.7s ease-out forwards;
}

@keyframes draw-crack-line {
  0% { stroke-dashoffset: 2400; }
  100% { stroke-dashoffset: 0; }
}

@keyframes shard-refract {
  0% { opacity: 0; transform: scale(0.96); }
  40% { opacity: 0.85; fill: rgba(255, 255, 255, 0.35); }
  100% { opacity: 0.25; fill: rgba(255, 255, 255, 0.08); }
}

.crt-scanline-overlay {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.18) 0px, rgba(0, 0, 0, 0.18) 2px, transparent 2px, transparent 4px);
  pointer-events: none;
  opacity: 0;
}

body.intro-shaking .crt-scanline-overlay {
  opacity: 0.8;
  animation: scanline-flicker 0.15s infinite;
}

@keyframes scanline-flicker {
  0% { transform: translateY(0); }
  50% { transform: translateY(2px); }
  100% { transform: translateY(-1px); }
}

/* Screen Cracking & Ferocious Shake / Scroll Distortion (iOS GPU Safe) */
body.intro-shaking #main-app-container {
  animation: violent-screen-tear 2.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) infinite;
  will-change: transform, opacity;
  transform: translateZ(0);
}

@keyframes violent-screen-tear {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  8% { transform: translate3d(-14px, -16px, 0) rotate(-1.5deg) scale(1.02); }
  16% { transform: translate3d(16px, 12px, 0) rotate(1.2deg); }
  24% { transform: translate3d(-20px, 20px, 0) scale(0.98); }
  32% { transform: translate3d(22px, -18px, 0) rotate(-1.8deg) scale(1.03); }
  40% { transform: translate3d(-18px, -40px, 0) scale(1.05); }
  48% { transform: translate3d(20px, 50px, 0) rotate(2deg); }
  56% { transform: translate3d(-25px, -70px, 0) scale(1.08); }
  64% { transform: translate3d(22px, 100px, 0) scale(1.12); }
  72% { transform: translate3d(-18px, -140px, 0) scale(1.16); opacity: 0.75; }
  80% { transform: translate3d(15px, 180px, 0) scale(1.2); opacity: 0.45; }
  88% { transform: translate3d(-8px, -240px, 0) scale(1.24); opacity: 0.2; }
  100% { transform: translate3d(0, -320px, 0) scale(1.28); opacity: 0; }
}

/* Stage 3: Deep Cosmic Black Void & Nebula Pulse */
.intro-reveal-stage {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, #0a0e1c 0%, #030409 60%, #000000 100%);
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  pointer-events: none;
  perspective: 1400px;
}

.intro-reveal-stage.active {
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.45s ease-in;
}

.intro-nebula-pulse {
  position: absolute;
  width: min(95vw, 850px);
  height: min(95vw, 850px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.22) 0%, rgba(99, 102, 241, 0.28) 35%, rgba(168, 85, 247, 0.15) 60%, rgba(0, 0, 0, 0) 80%);
  filter: blur(60px);
  animation: nebula-spin 12s linear infinite;
}

@keyframes nebula-spin {
  0% { transform: rotate(0deg) scale(0.9); }
  50% { transform: rotate(180deg) scale(1.15); }
  100% { transform: rotate(360deg) scale(0.9); }
}

.intro-particles-glow {
  position: absolute;
  width: min(75vw, 550px);
  height: min(75vw, 550px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.35) 0%, rgba(99, 102, 241, 0.4) 40%, rgba(0, 0, 0, 0) 70%);
  filter: blur(40px);
  animation: core-pulse 3s infinite alternate;
}

@keyframes core-pulse {
  0% { transform: scale(0.8); opacity: 0.4; }
  100% { transform: scale(1.3); opacity: 0.9; }
}

.intro-laser-rings {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.laser-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.3);
  opacity: 0;
}

.intro-reveal-stage.zooming .laser-ring.lr-1 {
  width: 220px;
  height: 220px;
  animation: laser-pulse 2.2s 0.2s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

.intro-reveal-stage.zooming .laser-ring.lr-2 {
  width: 360px;
  height: 360px;
  border-color: rgba(99, 102, 241, 0.35);
  animation: laser-pulse 2.6s 0.6s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

.intro-reveal-stage.zooming .laser-ring.lr-3 {
  width: 520px;
  height: 520px;
  border-color: rgba(168, 85, 247, 0.3);
  animation: laser-pulse 3.0s 1.0s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

@keyframes laser-pulse {
  0% { transform: scale(0.5); opacity: 0; }
  40% { opacity: 0.75; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* Stage 4: Zooming 3D Hero Logo & Text Reveal */
.intro-logo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  z-index: 25;
  padding: 0 1.5rem;
  max-width: 850px;
  transform: scale(0) translateZ(-600px);
  opacity: 0;
}

.intro-reveal-stage.zooming .intro-logo-container {
  animation: logo-surge-3d 2.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes logo-surge-3d {
  0% {
    transform: scale(0.08) translateZ(-800px) rotate(-18deg);
    opacity: 0;
    filter: blur(30px) brightness(2.5);
  }
  60% {
    transform: scale(1.1) translateZ(40px) rotate(1deg);
    opacity: 1;
    filter: blur(0px) brightness(1.2);
  }
  100% {
    transform: scale(1) translateZ(0);
    opacity: 1;
    filter: drop-shadow(0 0 40px rgba(99, 102, 241, 0.9)) drop-shadow(0 0 85px rgba(168, 85, 247, 0.6));
  }
}

.intro-logo-frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: clamp(1.2rem, 3.5vw, 1.8rem);
}

.intro-logo-frame::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #38bdf8, #6366f1, #a855f7);
  animation: spin-frame 6s linear infinite;
  filter: blur(8px);
  opacity: 0.85;
}

@keyframes spin-frame {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.intro-hero-logo {
  position: relative;
  width: clamp(100px, 18vw, 156px);
  height: clamp(100px, 18vw, 156px);
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #ffffff;
  box-shadow: 0 0 45px rgba(99, 102, 241, 0.95), 0 0 95px rgba(168, 85, 247, 0.7);
}

.intro-pill-badge {
  display: inline-block;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.5);
  color: #a5b4fc;
  font-size: clamp(0.7rem, 2vw, 0.8rem);
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 4px 14px;
  border-radius: 9999px;
  margin-bottom: 0.85rem;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.35);
}

.intro-welcome-title {
  font-family: var(--font-heading);
  font-size: clamp(1.85rem, 5.5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  background: linear-gradient(135deg, #ffffff 20%, #c7d2fe 60%, #e9d5ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.6rem;
  text-shadow: 0 4px 35px rgba(99, 102, 241, 0.55);
}

.intro-broken-subtitle {
  font-size: clamp(1rem, 3.4vw, 1.55rem);
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: 0 0 25px rgba(56, 189, 248, 0.95), 0 0 50px rgba(99, 102, 241, 0.7);
  margin-bottom: 1.4rem;
}

.intro-pulse-bar {
  width: 90px;
  height: 4px;
  background: linear-gradient(90deg, #38bdf8, #818cf8, #c084fc);
  border-radius: 9999px;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.95);
  animation: pulse-width 1.4s infinite alternate;
}

@keyframes pulse-width {
  0% { width: 45px; opacity: 0.5; }
  100% { width: 160px; opacity: 1; }
}

.intro-skip-btn {
  position: absolute;
  top: max(1.25rem, env(safe-area-inset-top));
  right: max(1.25rem, env(safe-area-inset-right));
  z-index: 100;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  padding: 0.5rem 1.1rem;
  border-radius: 9999px;
  font-size: clamp(0.72rem, 2vw, 0.82rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
}

.intro-skip-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: #ffffff;
  transform: scale(1.06);
}

@media (max-width: 768px) {
  .intro-welcome-title { font-size: clamp(1.65rem, 6.2vw, 2.2rem); }
  .intro-broken-subtitle { font-size: clamp(0.95rem, 4vw, 1.25rem); }
}

