:root {
  /* Cinematic Palette */
  --bg-dark: #090a0c;
  --bg-gradient: linear-gradient(180deg, rgba(9,10,12,0) 0%, rgba(9,10,12,1) 90%);
  
  /* Apple-style Frosted Glass */
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-hover: rgba(255, 255, 255, 0.12);
  --glass-border: rgba(255, 255, 255, 0.15);
  --glass-shadow: 0 10px 40px -10px rgba(0,0,0,0.5);
  
  --text-main: #ffffff;
  --text-muted: #9ba0a6;
  
  /* Shapes */
  --radius-pill: 999px;
  --radius-squircle: 24px;
  --radius-card: 16px;
  
  /* Apple Spring Animations */
  --spring: cubic-bezier(0.175, 0.885, 0.32, 1.15);
  --smooth: cubic-bezier(0.25, 1, 0.5, 1);
  --transition: all 0.4s var(--smooth);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* Hide Scrollbar completely */
::-webkit-scrollbar { display: none; }
html { -ms-overflow-style: none; scrollbar-width: none; }

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

body {
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

a, button, .card, .chip { 
  user-select: none; 
  -webkit-user-select: none; 
  outline: none !important; 
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; color: inherit; font-family: inherit; }

input, textarea {
  user-select: text;
  -webkit-user-select: text;
  outline: none;
  font-family: inherit;
}

/* =========================================
   APPLE GLASSMORPHISM
   ========================================= */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

/* =========================================
   TOP NAV: FLOATING PILL
   ========================================= */
.topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 32px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo { display: flex; align-items: center; gap: 8px; transition: transform 0.3s var(--spring); }
.logo:hover { transform: scale(1.05); }
.logo-text { font-weight: 800; font-size: 22px; letter-spacing: -0.02em; }

.floating-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border-radius: var(--radius-pill);
}

.nav-link {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  transition: transform 0.3s var(--spring), background 0.3s var(--smooth), color 0.3s var(--smooth);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.nav-link:hover { 
  color: #ffffff; 
  background: rgba(255, 255, 255, 0.1); 
}

.nav-link:active {
  transform: scale(0.95);
}

.nav-link.active { 
  background: rgba(255, 255, 255, 0.95); 
  color: #000; 
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.search-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
  padding: 10px 18px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-pill);
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

.search-wrapper:focus-within { 
  background: rgba(255,255,255,0.15); 
  border: 1px solid rgba(255,255,255,0.3);
  box-shadow: 0 0 20px rgba(255,255,255,0.1);
}

.search-wrapper input {
  background: transparent !important;
  border: none; 
  color: #fff !important; 
  font-size: 14px; 
  width: 150px;
  transition: width 0.4s var(--spring);
}

.search-wrapper input:focus { 
  width: 240px;
  outline: none;
}

.search-wrapper input::placeholder { 
  color: rgba(255,255,255,0.5); 
  white-space: nowrap;
}

/* =========================================
   CINEMATIC HERO (MEASURED & LOCKED)
   ========================================= */
.cinematic-hero {
  position: relative;
  /* Fixed height structure so it never collapses */
  height: 80vh;
  min-height: 600px;
  display: flex;
  align-items: flex-end; /* Pushes content strictly to the bottom */
  padding: 0 48px 60px 48px; /* Locks the exact distance from the bottom */
  margin-bottom: 0; /* Removes the negative margin that caused overlapping */
  overflow: hidden; 
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 20%;
  z-index: -2;
  transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.hero-vignette {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: 
    linear-gradient(90deg, rgba(9,10,12,0.85) 0%, rgba(9,10,12,0.15) 45%, transparent 100%),
    linear-gradient(180deg, rgba(9,10,12,0) 0%, rgba(9,10,12,0) 60%, rgba(9,10,12,0.6) 85%, var(--bg-dark) 100%);
}

.hero-content {
  max-width: 650px;
  z-index: 10;
  /* Lock the container */
  display: flex;
  flex-direction: column;
  width: 100%;
}

.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(48px, 6vw, 80px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.01em;
  margin-bottom: 16px;
  text-shadow: 0 8px 24px rgba(0,0,0,0.6);
  
  /* EXACT MEASUREMENT: Locks to exactly 2 lines. Never jumps. */
  height: 2.2em; 
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-meta {
  display: flex;
  gap: 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 20px;
  align-items: center;
  /* EXACT MEASUREMENT: Locks the meta row height */
  height: 28px; 
}

.hero-synopsis {
  font-size: 16px;
  line-height: 1.6;
  color: rgba(255,255,255,0.85);
  margin-bottom: 32px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  
  /* EXACT MEASUREMENT: Locks to exactly 3 lines. Never jumps. */
  height: 4.8em; 
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-actions { 
  display: flex; 
  gap: 14px; 
  /* EXACT MEASUREMENT: Locks the button row height */
  height: 52px; 
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  padding: 14px 32px;
  border-radius: var(--radius-pill);
  transition: transform 0.2s var(--spring), background 0.3s var(--smooth), box-shadow 0.3s var(--smooth);
}

.btn-white { 
  background: rgba(255,255,255,0.95); 
  color: #000; 
  box-shadow: 0 8px 20px rgba(255,255,255,0.2);
}
.btn-white:hover { 
  background: #ffffff; 
  transform: scale(1.05); 
  box-shadow: 0 12px 25px rgba(255,255,255,0.3);
}
.btn-white:active { transform: scale(0.95); }

.btn-icon { 
  width: 52px; 
  height: 52px; 
  padding: 0; 
  border-radius: var(--radius-pill); 
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: transform 0.4s var(--spring), box-shadow 0.4s var(--spring), background 0.3s var(--smooth), border-color 0.3s var(--smooth);
}

.btn-icon svg {
  width: 20px;
  height: 20px;
  stroke: #fff;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
  flex-shrink: 0;
}

.btn-icon:hover { 
  background: var(--glass-hover); 
  transform: translateY(-4px) scale(1.1); 
  border-color: rgba(255,255,255,0.3); 
  box-shadow: 0 15px 30px rgba(0,0,0,0.5), 0 0 15px rgba(255,255,255,0.1);
}
.btn-icon:active { transform: scale(0.92); }

@media(max-width:768px) {
  .btn-icon {
    width: 48px;
    height: 48px;
  }
}

/* =========================================
   HERO DOTS (MOVED TO BOTTOM RIGHT)
   ========================================= */
.hero-dots {
  position: absolute;
  /* EXACT POSITIONING: Anchors dots to bottom right */
  bottom: 60px; 
  right: 48px; 
  left: auto;
  transform: none;
  display: flex;
  gap: 8px;
  z-index: 15;
  align-items: center; 
}

.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: width 0.5s var(--spring), background 0.3s var(--smooth), transform 0.4s var(--spring), box-shadow 0.4s var(--spring);
}

.hero-dot:hover { 
  background: rgba(255, 255, 255, 0.85); 
  transform: translateY(-3px) scale(1.2); 
  box-shadow: 0 6px 12px rgba(0,0,0,0.5), 0 0 10px rgba(255,255,255,0.3);
}

.hero-dot:active { transform: scale(0.85); }

.hero-dot.active {
  width: 36px;
  background: #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4), 0 0 16px rgba(255,255,255,0.7);
}

.hero-dot.active:hover { transform: translateY(-2px) scale(1.05); }

/* =========================================
   LAYOUT & GRID (LOCKED SPACING)
   ========================================= */
.layout-container {
  position: relative;
  z-index: 20;
  padding: 0 48px 60px;
  /* EXACT SPACING: Pulls the filter bar up predictably without crashing into buttons */
  margin-top: -20px; 
}

.filters-bar { display: flex; gap: 12px; margin-bottom: 32px; flex-wrap: wrap; }

/* Upgraded Glassy Filter Chips */
.chip {
  font-size: 14px; font-weight: 600; color: rgba(255,255,255,0.7);
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  transition: all 0.4s var(--spring);
}
.chip:hover { 
  color: #fff; 
  background: rgba(255, 255, 255, 0.12); 
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-3px); 
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}
.chip:active { transform: scale(0.95); }
.chip.active { 
  color: #000; 
  background: #fff; 
  border-color: #fff; 
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(255,255,255,0.25); 
}

.shelf-head { margin-bottom: 24px; }
.shelf-head h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.card { cursor: pointer; perspective: 1000px; }
.card-poster {
  aspect-ratio: 2/3;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-card);
  transition: transform 0.4s var(--spring), box-shadow 0.4s var(--spring);
  border: 1px solid rgba(255,255,255,0.05);
}
.card:hover .card-poster { 
  transform: translateY(-8px) scale(1.03); 
  box-shadow: 0 20px 40px rgba(0,0,0,0.6), 0 0 20px rgba(255,255,255,0.08); 
  border-color: rgba(255,255,255,0.2);
}
.card:active .card-poster { transform: scale(0.96); }

.card-poster img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--smooth); }
.card:hover .card-poster img { transform: scale(1.08); }

.fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(0,0,0,0.6) 100%);
  font-family: 'Playfair Display', serif;
  font-size: 40px; font-weight: 800; color: rgba(255, 255, 255, 0.2);
}

.card-save {
  position: absolute; top: 12px; right: 12px;
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; 
  transition: transform 0.4s var(--spring), opacity 0.3s var(--smooth), box-shadow 0.4s var(--spring), background 0.3s var(--smooth);
  transform: scale(0.8) translateY(-10px);
}
.card:hover .card-save, .card-save.saved { opacity: 1; transform: scale(1) translateY(0); }
.card-save:hover { 
  background: rgba(255,255,255,0.25); 
  transform: scale(1.15) translateY(-4px) !important; 
  box-shadow: 0 12px 25px rgba(0,0,0,0.5), 0 0 12px rgba(255,255,255,0.2);
}
.card-save:active { transform: scale(0.9) !important; }

.card-info { padding: 14px 4px 0; }
.card-title { font-size: 15px; font-weight: 700; line-height: 1.3; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta-pills { display: flex; align-items: center; gap: 6px; font-size: 13px; color: rgba(255,255,255,0.5); font-weight: 600; }
.card-meta-pills .dot { font-size: 8px; opacity: 0.4; }

/* =========================================
   FOOTER
   ========================================= */
.site-footer {
  padding: 60px 48px;
  display: flex; flex-direction: column; align-items: center;
  position: relative; z-index: 20;
}
.footer-top { display: flex; align-items: center; gap: 24px; margin-bottom: 24px; }
.footer-brand { display: flex; align-items: center; gap: 8px; color: #fff; }
.footer-brand .logo-text { font-weight: 800; font-size: 24px; letter-spacing: -0.02em; }
.footer-divider { width: 1px; height: 24px; background: rgba(255, 255, 255, 0.15); }
.discord-link { color: #fff; opacity: 0.6; transition: all 0.3s var(--spring); }
.discord-link:hover { opacity: 1; transform: scale(1.1); filter: drop-shadow(0 0 8px rgba(255,255,255,0.5)); }
.footer-disclaimer { color: rgba(255,255,255,0.4); font-size: 13px; text-align: center; max-width: 600px; line-height: 1.6; }


/* =========================================
   APPLE TV INSPIRED UI (MODAL & DROPDOWNS)
   ========================================= */
.meta-pill {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  padding: 6px 14px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 700; color: #fff;
  letter-spacing: 0.05em; text-transform: uppercase;
  display: flex; align-items: center;
}
.meta-rating { background: rgba(245, 197, 24, 0.15); color: #f5c518; border-color: rgba(245, 197, 24, 0.3); box-shadow: 0 0 10px rgba(245, 197, 24, 0.1); }
.meta-type { background: rgba(10, 132, 255, 0.2); border-color: rgba(10, 132, 255, 0.4); box-shadow: 0 0 10px rgba(10, 132, 255, 0.15); }

.card-badge {
  position: absolute; top: 12px; left: 12px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  color: #fff; font-size: 10px; font-weight: 800;
  padding: 6px 10px; border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.2);
  letter-spacing: 0.05em; box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.card-badge.tv { background: rgba(10, 132, 255, 0.4); border-color: rgba(10, 132, 255, 0.6); }

/* Custom Dropdowns (Glassy) */
.tv-controls { display: flex; align-items: center; gap: 12px; }
.custom-dropdown { position: relative; display: inline-block; }
.dropdown-trigger {
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  color: #fff; border: 1px solid rgba(255,255,255,0.15);
  padding: 10px 40px 10px 20px; border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 700; cursor: pointer;
  transition: all 0.3s var(--smooth); user-select: none; position: relative;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.dropdown-trigger::after {
  content: ''; position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid rgba(255,255,255,0.7);
  transition: transform 0.4s var(--spring);
}
.custom-dropdown.open .dropdown-trigger::after { transform: translateY(-50%) rotate(180deg); }
.dropdown-trigger:hover, .custom-dropdown.open .dropdown-trigger { background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.4); }
.dropdown-trigger:active { transform: scale(0.95); }

.dropdown-menu {
  position: absolute; bottom: calc(100% + 12px); left: 0; min-width: 160px; max-height: 280px;
  overflow-y: auto; 
  background: rgba(20, 20, 20, 0.65); 
  backdrop-filter: blur(40px) saturate(200%); -webkit-backdrop-filter: blur(40px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 16px; padding: 8px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.05);
  opacity: 0; visibility: hidden; transform: translateY(15px) scale(0.95);
  transition: opacity 0.3s var(--smooth), transform 0.4s var(--spring), visibility 0.3s;
  z-index: 1000; transform-origin: bottom left;
}
.custom-dropdown.open .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.dropdown-menu::-webkit-scrollbar { width: 4px; display: block; }
.dropdown-menu::-webkit-scrollbar-track { background: transparent; margin: 8px; }
.dropdown-menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 10px; }

.dropdown-item {
  padding: 10px 16px; font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.7);
  cursor: pointer; border-radius: 10px; transition: all 0.2s; white-space: nowrap; margin-bottom: 2px;
}
.dropdown-item:hover { background: rgba(255, 255, 255, 0.15); color: #fff; transform: scale(1.02); }
.dropdown-item.selected { background: rgba(255, 255, 255, 0.95); color: #000; font-weight: 700; box-shadow: 0 4px 10px rgba(255,255,255,0.2); }

/* =========================================
   THEATER MODE PLAYER MODAL
   ========================================= */
.overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.6); 
  backdrop-filter: blur(30px) saturate(150%); -webkit-backdrop-filter: blur(30px) saturate(150%);
  display: flex; align-items: center; justify-content: center; 
  padding: 3vh 3vw; 
  opacity: 0; pointer-events: none; transition: opacity 0.4s var(--smooth);
}
.overlay.show { opacity: 1; pointer-events: auto; }

.sleek-modal {
  background: #000 !important;
  border: 1px solid rgba(255,255,255,0.15) !important;
  border-radius: 20px !important; 
  width: 100%; height: 100%; max-width: 1600px !important;
  display: flex; flex-direction: column; overflow: visible; 
  box-shadow: 0 40px 100px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.05);
  
  /* The Apple Pop-in Animation */
  transform: scale(0.95) translateY(20px);
  transition: transform 0.5s var(--spring);
}
.overlay.show .sleek-modal { transform: scale(1) translateY(0); }

.player-box { 
  position: relative; width: 100%; flex-grow: 1; min-height: 0; 
  background: #000; border-radius: 20px 20px 0 0; overflow: hidden;
}
.player-box iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,0.5); font-weight: 600; font-size: 15px; }

/* Frosted Player Controls Bar */
.sleek-bottom-bar {
  display: flex; flex-direction: column; flex-shrink: 0; 
  padding: 24px 36px;
  background: rgba(20, 20, 22, 0.7); 
  backdrop-filter: blur(40px) saturate(200%); -webkit-backdrop-filter: blur(40px) saturate(200%);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0 0 20px 20px; z-index: 5;
}

.bar-main-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; width: 100%; }
.bar-info { display: flex; flex-direction: column; gap: 10px; }
.bar-info .modal-title { 
  font-size: 26px; font-weight: 800; margin: 0; color: #fff; 
  letter-spacing: -0.01em; line-height: 1.2;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.bar-info .modal-meta { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; align-items: center; }

.bar-actions { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }

.action-btn {
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  color: #fff; 
  transition: transform 0.4s var(--spring), box-shadow 0.4s var(--spring), background 0.3s var(--smooth), border-color 0.3s var(--smooth);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.action-btn:hover { 
  background: rgba(255,255,255,0.25); 
  transform: translateY(-4px) scale(1.12); 
  border-color: rgba(255,255,255,0.4); 
  box-shadow: 0 15px 30px rgba(0,0,0,0.5), 0 0 15px rgba(255,255,255,0.15); 
}
.action-btn:active { transform: scale(0.9); }

.close-btn { background: rgba(255, 59, 48, 0.2); border-color: rgba(255, 59, 48, 0.4); color: #ff3b30; }
.close-btn:hover { 
  background: #ff3b30; color: white; border-color: #ff3b30; 
  box-shadow: 0 15px 30px rgba(255, 59, 48, 0.4), 0 0 15px rgba(255, 59, 48, 0.2); 
}

.bar-controls-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  width: 100%; margin-top: 20px; padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.source-pills { display: flex; gap: 12px; flex-wrap: wrap; }
.source-pill {
  font-size: 13px; font-weight: 700; padding: 10px 20px; border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.6); 
  border: 1px solid rgba(255,255,255,0.15);
  transition: all 0.3s var(--smooth); box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.source-pill.active { background: #fff; color: #000; border-color: #fff; box-shadow: 0 4px 15px rgba(255,255,255,0.3); transform: scale(1.05); }
.source-pill:hover:not(.active) { color: #fff; background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.4); transform: translateY(-2px); }
.source-pill:active { transform: scale(0.95); }

/* =========================================
   HORIZONTAL CATEGORY ROWS
   ========================================= */
.row-shelf { margin-bottom: 24px; }

.row-scroll {
  display: flex; 
  gap: 20px; 
  overflow-x: auto; 
  /* Invisible padding prevents the bouncy hover effect from clipping */
  padding-top: 24px; 
  margin-top: -24px; 
  padding-bottom: 40px; 
  margin-bottom: -16px;
  scroll-snap-type: x mandatory;
}
.row-scroll::-webkit-scrollbar { display: none; }

.row-card {
  flex: 0 0 min(75vw, 320px); /* Cinematic 16:9 wide cards */
  cursor: pointer; 
  perspective: 1000px;
  scroll-snap-align: start;
  position: relative;
  z-index: 1;
}
.row-card:hover { z-index: 10; }

.row-poster {
  aspect-ratio: 16/9;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-card);
  transition: transform 0.4s var(--spring), box-shadow 0.4s var(--spring);
  border: 1px solid rgba(255,255,255,0.05);
  background: #111;
}

.row-card:hover .row-poster {
  transform: translateY(-8px) scale(1.03); 
  box-shadow: 0 20px 40px rgba(0,0,0,0.6), 0 0 20px rgba(255,255,255,0.08); 
  border-color: rgba(255,255,255,0.2);
}
.row-card:active .row-poster { transform: scale(0.96); }

.row-poster img { 
  width: 100%; height: 100%; object-fit: cover; 
  transition: transform 0.6s var(--smooth); 
}
.row-card:hover .row-poster img { transform: scale(1.05); }

/* Animated Text Overlay */
.row-title-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 50px 16px 16px;
  background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
  display: flex; flex-direction: column; justify-content: flex-end;
  pointer-events: none;
  opacity: 0.85; transition: opacity 0.4s var(--spring);
}
.row-card:hover .row-title-overlay { opacity: 1; }

.row-title { 
  font-size: 16px; font-weight: 800; color: #fff; 
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; 
  letter-spacing: 0.01em;
  /* Lift Animation */
  transform: translateY(8px);
  opacity: 0.8;
  transition: all 0.4s var(--spring);
}
.row-card:hover .row-title {
  transform: translateY(0);
  opacity: 1;
  text-shadow: 0 4px 12px rgba(0,0,0,0.8); 
}

/* =========================================
   KEYFRAME ANIMATIONS
   ========================================= */
@keyframes popIn {
  0% { opacity: 0; transform: translateY(30px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes slideUpFade {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Connects to the JS to animate the hero content */
.hero-animate .hero-title { animation: slideUpFade 0.6s var(--spring) both; }
.hero-animate .hero-meta { animation: slideUpFade 0.6s var(--spring) 0.05s both; }
.hero-animate .hero-synopsis { animation: slideUpFade 0.6s var(--spring) 0.1s both; }
.hero-animate .hero-actions { animation: slideUpFade 0.6s var(--spring) 0.15s both; }

@media(max-width:768px) {
  /* =========================================
     MOBILE NAVIGATION FIXES
     ========================================= */
  .topbar { padding: 16px 20px; flex-direction: column; gap: 16px; align-items: flex-start; }
  
  /* Allows the nav pill to be swiped left/right without breaking the screen */
  .floating-nav { width: 100%; overflow-x: auto; padding: 6px; gap: 4px; }
  .nav-link { padding: 8px 12px; font-size: 13px; }
  .search-wrapper { margin-left: auto; padding: 8px 12px; }
  .search-wrapper input { width: 90px; }
  .search-wrapper input:focus { width: 140px; }

  /* =========================================
     MOBILE HERO FIXES (Stops Overlapping)
     ========================================= */
  .cinematic-hero { 
    /* Remove fixed height so content dictates size, preventing spill-over */
    height: auto; 
    min-height: 85vh; 
    /* Extra top padding for the stacked nav, extra bottom padding for the dots */
    padding: 160px 20px 80px 20px; 
    margin-bottom: 0;
  }
  
  /* Unlock the strict heights so text can breathe naturally on small screens */
  .hero-title { 
    font-size: clamp(36px, 10vw, 56px); 
    height: auto; 
    min-height: auto; 
    -webkit-line-clamp: 3; 
    margin-bottom: 12px;
  }
  
  .hero-meta { 
    height: auto; 
    flex-wrap: wrap; 
    gap: 10px; 
    margin-bottom: 16px; 
  }
  
  .hero-synopsis { 
    font-size: 14px; 
    height: auto; 
    min-height: auto; 
    -webkit-line-clamp: 4; 
    margin-bottom: 24px; 
  }

  .hero-actions { 
    height: auto; 
    flex-wrap: wrap; /* Allows buttons to drop to the next line if needed */
    gap: 12px; 
  }
  
  /* Shrink buttons slightly to fit better */
  .btn { padding: 12px 24px; font-size: 14px; }
  .btn-icon { width: 48px; height: 48px; }

  /* Move the dots from the right side back to the center bottom */
  .hero-dots {
    bottom: 24px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }

  /* =========================================
     MOBILE LAYOUT & GRID FIXES
     ========================================= */
  .layout-container { 
    padding: 0 20px 40px; 
    /* REMOVE the negative margin so it stops crashing into the hero */
    margin-top: 20px; 
  }
  
  .filters-bar { gap: 8px; margin-bottom: 24px; }
  .chip { padding: 8px 16px; font-size: 13px; margin-right: 0; }

  /* Adjust horizontal rows for mobile swiping */
  .row-scroll {
    padding-top: 16px; margin-top: -16px;
    padding-bottom: 24px; margin-bottom: 0;
    gap: 12px;
  }
  .row-card { flex: 0 0 85vw; } /* Make row cards take up most of the screen width */

  /* =========================================
     MOBILE MODAL / PLAYER FIXES
     ========================================= */
  .overlay { padding: 0; }
  .sleek-modal { border-radius: 0 !important; border: none !important; transform: scale(1) translateY(100%); }
  .overlay.show .sleek-modal { transform: scale(1) translateY(0); }
  .player-box { border-radius: 0; min-height: 35vh; }
  .player-box iframe { border-radius: 0; }
  
  .sleek-bottom-bar { border-radius: 0; padding: 20px; flex-shrink: 0; overflow-y: auto; }
  .bar-main-row { flex-direction: column; gap: 16px; align-items: flex-start; }
  .bar-actions { width: 100%; justify-content: flex-end; }
  .bar-controls-row { flex-direction: column; align-items: stretch; margin-top: 16px; padding-top: 16px; }
  .tv-controls { justify-content: space-between; flex-wrap: wrap; gap: 12px; }
  .source-pills { justify-content: flex-start; gap: 8px; }
  .source-pill { padding: 8px 16px; font-size: 12px; }
}
