:root {
  /* Palette */
  --bg-dark: #050505;
  --text-main: #ffffff;
  --text-muted: #9ba0a6;

  /* Glass Base */
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.15);
  --glass-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.7);
  --glass-rim: inset 0 1px 1px rgba(255, 255, 255, 0.25), inset 0 -1px 1px rgba(0, 0, 0, 0.2);

  /* Frosted Components */
  --frosted-bg: rgba(255, 255, 255, 0.08);
  --frosted-border: 1px solid rgba(255, 255, 255, 0.15);
  --frosted-blur: blur(24px) saturate(200%) brightness(1.1);
  --frosted-shadow: var(--glass-rim), 0 6px 16px rgba(0, 0, 0, 0.3);

  /* Depth & Interaction */
  --carved-depth: inset 0 2px 6px rgba(0, 0, 0, 0.7);
  --3d-pop: inset 0 1px 0 rgba(255, 255, 255, 0.4), inset 0 -2px 6px rgba(0, 0, 0, 0.4), 0 8px 20px rgba(0, 0, 0, 0.4);
  
  /* Geometry & Motion */
  --radius-pill: 999px;
  --radius-card: 16px;
  --spring: cubic-bezier(0.175, 0.885, 0.32, 1.15);
  --smooth: cubic-bezier(0.25, 1, 0.5, 1);
}

/* ==========================================================================
   BASE & RESET
   ================================================================          */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  overflow-x: hidden;
  max-width: 100vw;
}

html::-webkit-scrollbar {
  display: 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;
  max-width: 100vw;
}

/* Eliminate 300ms mobile tap delay & unwanted selections */
body, a, button, .card, .chip {
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  outline: none !important;
}

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;
}

/* ==========================================================================
   REUSABLE GLASS & FROSTED COMPONENTS
   ================================================================          */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(40px) saturate(250%) brightness(1.15);
  -webkit-backdrop-filter: blur(40px) saturate(250%) brightness(1.15);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow), var(--glass-rim);
}

.btn-icon, .chip, .source-pill, .dropdown-trigger, .action-btn {
  background: var(--frosted-bg);
  border: var(--frosted-border);
  backdrop-filter: var(--frosted-blur);
  -webkit-backdrop-filter: var(--frosted-blur);
  box-shadow: var(--frosted-shadow);
  color: #fff;
}

/* ==========================================================================
   TOP NAVIGATION
   ================================================================          */
.topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px 48px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.3s var(--spring);
}

.logo-text {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.floating-nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border-radius: var(--radius-pill);
  box-shadow: var(--glass-shadow) !important;
}

.mobile-menu-btn {
  display: none;
  background: transparent;
  color: white;
  border: none;
  cursor: pointer;
}

.floating-nav::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: var(--glass-rim);
  pointer-events: none;
  z-index: 10;
}

.nav-pill {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2), inset 0 2px 0 rgba(255, 255, 255, 1), inset 0 -2px 4px rgba(0, 0, 0, 0.1);
  transform: translate(0, 0);
  transition: transform 0.4s var(--smooth), width 0.4s var(--smooth), height 0.4s var(--smooth);
  pointer-events: none;
  will-change: transform, width, height;
}

.floating-nav.pill-ready .nav-pill {
  opacity: 1;
}

.nav-pill:not(.pill-ready) {
  opacity: 0;
}

.nav-link {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
  transition: color 0.35s var(--smooth);
}

.nav-link.active {
  color: #000;
}

.search-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
  padding: 10px 18px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-pill);
  backdrop-filter: blur(20px) saturate(200%) brightness(1.1);
  -webkit-backdrop-filter: blur(20px) saturate(200%) brightness(1.1);
  box-shadow: var(--carved-depth), var(--glass-rim);
  transition: all 0.4s var(--smooth);
}

.search-wrapper:focus-within {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: var(--carved-depth), 0 0 24px rgba(255, 255, 255, 0.1), var(--glass-rim);
}

.search-wrapper input {
  width: 150px;
  background: transparent !important;
  border: none;
  font-size: 14px;
  color: #fff !important;
  transition: width 0.4s var(--spring);
}

.search-wrapper input:focus {
  width: 240px;
}

.search-wrapper input::placeholder {
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
}

/* ==========================================================================
   CINEMATIC HERO & BACKGROUND PIPELINE
   ================================================================          */
.cinematic-hero {
  position: relative;
  height: 80vh;
  min-height: 600px;
  display: flex;
  align-items: flex-end;
  padding: 0 48px 60px 48px;
}

.hero-bg-blur {
  position: fixed;
  inset: -10%;
  width: 120vw;
  height: 120vh;
  background-size: cover;
  background-position: center 20%;
  filter: blur(50px) saturate(150%) brightness(0.4);
  z-index: -3;
  pointer-events: none;
  transform: translate3d(0, 0, 0);
  will-change: transform, opacity;
  backface-visibility: hidden;
  perspective: 1000px;
  transition: opacity 0.8s ease-in-out !important;
}

.hero-bg, .hero-vignette {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 120vh;
  pointer-events: none;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

.hero-bg {
  background-size: cover;
  background-position: center 20%;
  z-index: -2;
  will-change: opacity;
  -webkit-mask-image: linear-gradient(to bottom, black 0%, black 50%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 0%, black 50%, transparent 100%);
  transition: opacity 0.8s ease-in-out !important;
}

.hero-vignette {
  z-index: -1;
  background: 
    linear-gradient(90deg, rgba(5, 5, 5, 0.95) 0%, rgba(5, 5, 5, 0.2) 60%, transparent 100%),
    linear-gradient(180deg, transparent 0%, transparent 30%, rgba(5, 5, 5, 0.8) 80%, rgba(5, 5, 5, 0.95) 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 0%, black 50%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 0%, black 50%, transparent 100%);
}

.hero-content {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 650px;
  z-index: 10;
}

.hero-title {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: clamp(36px, 6vw, 72px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.01em;
  margin-bottom: 16px;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.8), 0 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 28px;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

.hero-synopsis {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 4.8em;
  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);
}

.hero-actions {
  display: flex;
  gap: 14px;
  height: 52px;
}

.hero-dots {
  position: absolute;
  bottom: 60px;
  right: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 15;
}

.hero-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  background-color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2), inset 0 1px 2px rgba(0, 0, 0, 0.5);
  transition: width 0.5s var(--spring), background-color 0.2s var(--smooth), transform 0.4s var(--spring), box-shadow 0.4s var(--spring);
}

.hero-dot::after {
  content: '';
  position: absolute;
  inset: -12px;
}

.hero-dot.active {
  width: 36px;
  background-color: #fff;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.6), 0 2px 6px rgba(0, 0, 0, 0.4), inset 0 2px 0 rgba(255, 255, 255, 1), inset 0 -2px 4px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   BUTTONS & CHIPS
   ================================================================          */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 700;
  transition: transform 0.4s var(--spring), background 0.15s var(--smooth), box-shadow 0.4s var(--spring);
}

.btn-white {
  background: #ffffff;
  color: #000;
  box-shadow: 0 8px 32px rgba(255, 255, 255, 0.2), inset 0 2px 0 rgba(255, 255, 255, 1), inset 0 -4px 10px rgba(0, 0, 0, 0.15);
}

.btn-icon {
  width: 52px;
  height: 52px;
  padding: 0;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s var(--spring), box-shadow 0.4s var(--spring), background 0.15s var(--smooth), border-color 0.15s 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;
}

.chip {
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  transition: transform 0.4s var(--spring), box-shadow 0.4s var(--spring), background 0.15s var(--smooth), border-color 0.15s var(--smooth), color 0.15s var(--smooth);
}

.chip.active, .source-pill.active {
  background: #ffffff;
  color: #000;
  border-color: #fff;
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(255, 255, 255, 0.25), inset 0 2px 0 rgba(255, 255, 255, 1), inset 0 -3px 8px rgba(0, 0, 0, 0.25);
}

/* ==========================================================================
   CATALOG LAYOUT, SHELVES & CARDS
   ================================================================          */
.layout-container {
  position: relative;
  z-index: 20;
  padding: 0 48px 80px;
  margin-top: -20px;
}

.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
}

.shelf-head {
  margin-bottom: 24px;
}

.shelf-head h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  overflow: visible; /* Prevent clipping */
}

.card, .row-card {
  position: relative;
  z-index: 1;
  cursor: pointer;
  perspective: 1000px;
  overflow: visible; /* Crucial to prevent shadows from clipping */
}

.card-poster, .row-poster {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.65), 0 2px 8px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.01) 100%);
  transform: translateZ(0); 
  transition: transform 0.4s var(--spring), box-shadow 0.4s var(--spring), border-color 0.4s var(--spring);
}

.card-poster {
  aspect-ratio: 2 / 3;
}

.row-poster {
  aspect-ratio: 16 / 9;
}

.card-poster::before, .row-poster::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 5;
  background: linear-gradient(105deg, transparent 20%, rgba(255, 255, 255, 0.15) 25%, transparent 30%);
  transform: translateX(-150%);
  transition: transform 0.6s ease;
  pointer-events: none;
}

.card-poster::after, .row-poster::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 2px 10px rgba(255, 255, 255, 0.15), inset 0 -20px 40px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

.card-poster img, .row-poster img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--smooth), opacity 0.5s ease !important;
}

.fallback {
  position: absolute;
  inset: 0;
  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-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;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.02em;
}

.card-meta-pills .dot {
  font-size: 8px;
  opacity: 0.4;
}

.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;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: var(--frosted-blur);
  -webkit-backdrop-filter: var(--frosted-blur);
  box-shadow: var(--glass-rim), 0 4px 12px rgba(0, 0, 0, 0.3);
  transform: scale(0.8) translateY(-10px);
  transition: transform 0.4s var(--spring), opacity 0.3s var(--smooth), box-shadow 0.4s var(--spring), background 0.15s var(--smooth);
}

/* ==========================================================================
   HORIZONTAL ROWS
   ================================================================          */
.row-shelf {
  margin-bottom: 24px;
}

.row-scroll {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-top: 36px;
  margin-top: -36px;
  padding-bottom: 72px;
  margin-bottom: -48px;
  padding-left: 48px;
  margin-left: -48px;
  padding-right: 48px;
  margin-right: -48px;
  scroll-padding-left: 48px;
  scroll-snap-type: x proximity;
}

.row-scroll::-webkit-scrollbar {
  display: none;
}

.row-card {
  flex: 0 0 min(75vw, 320px);
  scroll-snap-align: start;
}

.row-title-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.7) 20%, rgba(0, 0, 0, 0.2) 50%, transparent 75%);
  pointer-events: none;
  opacity: 0.85;
  transition: opacity 0.4s var(--spring);
}

.row-title {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.01em;
  transform: translateY(8px);
  opacity: 0.8;
  transition: all 0.4s var(--spring);
}

/* ==========================================================================
   TAGS, METADATA & DROPDOWNS
   ================================================================          */
.meta-pill {
  display: flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--frosted-bg);
  border: var(--frosted-border);
  backdrop-filter: var(--frosted-blur);
  -webkit-backdrop-filter: var(--frosted-blur);
  box-shadow: var(--glass-rim), 0 4px 12px rgba(0, 0, 0, 0.3);
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.meta-rating {
  background: rgba(245, 197, 24, 0.12);
  color: #f5c518;
  border-color: rgba(245, 197, 24, 0.3);
}

.meta-type {
  background: rgba(10, 132, 255, 0.15);
  border-color: rgba(10, 132, 255, 0.3);
}

.card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: var(--frosted-blur);
  -webkit-backdrop-filter: var(--frosted-blur);
  box-shadow: var(--glass-rim), 0 4px 10px rgba(0, 0, 0, 0.3);
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.05em;
}

.card-badge.tv {
  background: rgba(10, 132, 255, 0.25);
  border-color: rgba(10, 132, 255, 0.4);
}

.tv-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.custom-dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-trigger {
  position: relative;
  padding: 10px 40px 10px 20px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: all 0.3s var(--smooth);
}

.dropdown-trigger::after {
  content: '';
  position: absolute;
  right: 16px;
  top: 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);
  transform: translateY(-50%);
  transition: transform 0.4s var(--spring);
}

.custom-dropdown.open .dropdown-trigger::after {
  transform: translateY(-50%) rotate(180deg);
}

.dropdown-menu {
  position: fixed;
  min-width: 160px;
  max-height: 280px;
  overflow-y: auto;
  padding: 8px;
  border-radius: 16px;
  background: rgba(20, 20, 20, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(40px) saturate(250%) brightness(1.15);
  -webkit-backdrop-filter: blur(40px) saturate(250%) brightness(1.15);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), var(--glass-rim);
  opacity: 0;
  visibility: hidden;
  transform: translateY(15px) scale(0.95);
  transition: opacity 0.3s var(--smooth), transform 0.4s var(--spring), visibility 0s linear 0.4s;
  z-index: 2000;
}

.dropdown-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  transition: opacity 0.3s var(--smooth), transform 0.4s var(--spring), visibility 0s linear 0s;
}

.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;
  margin-bottom: 2px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
}

.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);
}

/* ==========================================================================
   VISION-OS PLAYER MODAL
   ================================================================          */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vh 4vw;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(40px) saturate(150%);
  -webkit-backdrop-filter: blur(40px) saturate(150%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s var(--smooth);
}

.overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.sleek-modal {
  width: 100%;
  height: 100%;
  max-width: 1600px !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: rgba(40, 40, 45, 0.35) !important;
  backdrop-filter: blur(80px) saturate(250%) brightness(1.2) !important;
  -webkit-backdrop-filter: blur(80px) saturate(250%) brightness(1.2) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 28px !important;
  box-shadow: 0 50px 100px rgba(0, 0, 0, 0.8), inset 0 1px 1px rgba(255, 255, 255, 0.3), inset 0 0 40px rgba(255, 255, 255, 0.05) !important;
  transform: scale(0.95) translateY(20px);
  opacity: 0;
  transition: transform 0.6s var(--spring), opacity 0.4s var(--smooth);
}

.overlay.show .sleek-modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.player-box {
  position: relative;
  width: 100%;
  flex-grow: 1;
  min-height: 0;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 28px 28px 0 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  z-index: 10;
}

.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;
  font-size: 15px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  animation: fadePulse 2s infinite ease-in-out;
}

.sleek-bottom-bar {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  padding: 36px 48px;
  background: transparent;
  z-index: 5;
}

.bar-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
}

.bar-info {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bar-info .modal-title {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-family: 'Playfair Display', serif;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.01em;
  color: #fff;
  margin: 0;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.bar-info .modal-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.bar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.action-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s var(--spring), box-shadow 0.4s var(--spring), background 0.15s var(--smooth), border-color 0.15s var(--smooth);
}

.action-btn svg {
  width: 22px;
  height: 22px;
}

.close-btn {
  background: rgba(255, 59, 48, 0.15);
  border-color: rgba(255, 59, 48, 0.3);
  color: #ff3b30;
}

.bar-controls-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.source-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.source-pill {
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  transition: transform 0.4s var(--spring), box-shadow 0.4s var(--spring), background 0.15s var(--smooth), border-color 0.15s var(--smooth), color 0.15s var(--smooth);
}

/* ==========================================================================
   ALERTS, TOASTS & FOOTER
   ================================================================          */
.zoid-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  max-width: min(420px, calc(100vw - 32px));
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(20, 20, 20, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(30px) saturate(250%) brightness(1.15);
  -webkit-backdrop-filter: blur(30px) saturate(250%) brightness(1.15);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), var(--glass-rim);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: #fff;
  z-index: 5000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--smooth), transform 0.4s var(--spring);
}

.zoid-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.site-footer {
  position: relative;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 48px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.6) 100%);
}

.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-size: 24px;
  font-weight: 800;
  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);
}

.footer-disclaimer {
  max-width: 600px;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
}

/* ==========================================================================
   ANIMATIONS & KEYFRAMES
   ================================================================          */
@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); }
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

@keyframes fadePulse {
  0%, 100% { opacity: 0.4; transform: scale(0.98); }
  50% { opacity: 1; transform: scale(1); }
}

.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; }

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 100px 20px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  animation: fadePulse 2s infinite ease-in-out;
}

.spinner {
  opacity: 0.8;
  animation: spin 1.5s linear infinite;
}

/* ==========================================================================
   MOBILE RESPONSIVENESS
   ================================================================          */
@media (max-width: 768px) {
  .topbar {
    padding: 14px 20px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 10, 14, 0.72);
    backdrop-filter: blur(36px) saturate(220%) brightness(1.15);
    -webkit-backdrop-filter: blur(36px) saturate(220%) brightness(1.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.2), inset 0 -1px 0 rgba(255, 255, 255, 0.08);
    transform: translateZ(0);
  }
  
  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.04) 100%);
    backdrop-filter: blur(24px) saturate(200%) brightness(1.15);
    -webkit-backdrop-filter: blur(24px) saturate(200%) brightness(1.15);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35), inset 0 -1px 1px rgba(0, 0, 0, 0.2), 0 4px 16px rgba(0, 0, 0, 0.35);
    color: #fff;
    cursor: pointer;
    transition: transform 0.3s var(--spring), background 0.2s var(--smooth), box-shadow 0.3s var(--spring), border-color 0.2s var(--smooth);
  }
  
  .mobile-menu-btn:active, .mobile-menu-btn.active {
    transform: scale(0.92);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.12) 100%);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5), 0 0 20px rgba(255, 255, 255, 0.25);
  }

  .mobile-menu-btn svg {
    width: 20px;
    height: 20px;
    stroke: #fff;
    transition: transform 0.3s var(--spring);
  }

  .floating-nav {
    display: flex;
    position: absolute;
    top: calc(100% + 12px);
    left: 16px;
    right: 16px;
    width: auto;
    flex-direction: column;
    align-items: flex-start;
    padding: 18px;
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.03) 100%), rgba(14, 14, 18, 0.75);
    backdrop-filter: blur(40px) saturate(250%) brightness(1.15);
    -webkit-backdrop-filter: blur(40px) saturate(250%) brightness(1.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--glass-shadow), inset 0 1px 2px rgba(255, 255, 255, 0.35), inset 0 -1px 2px rgba(0, 0, 0, 0.3);
    transform: translateZ(0);
    
    /* Smooth Dropdown Animation */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-14px) scale(0.96);
    transform-origin: top right;
    transition: opacity 0.35s var(--smooth), transform 0.45s var(--spring), visibility 0s linear 0.35s;
  }

  .floating-nav.mobile-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    transition: opacity 0.35s var(--smooth), transform 0.45s var(--spring), visibility 0s linear 0s;
  }
  
  .nav-pill {
    display: none !important;
  }
  
  .nav-link {
    width: 100%;
    padding: 12px 18px;
    font-size: 15px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    border-radius: var(--radius-pill);
    transition: background 0.2s var(--smooth), color 0.2s var(--smooth), transform 0.2s var(--spring);
  }
  
  .nav-link:active {
    transform: scale(0.97);
  }
  
  .nav-link.active {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.08) 100%);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3), 0 4px 15px rgba(0, 0, 0, 0.2);
  }
  
  .search-wrapper {
    width: 100%;
    margin: 10px 0 0 0;
    padding: 10px 18px;
    justify-content: flex-start;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px) saturate(200%);
    -webkit-backdrop-filter: blur(20px) saturate(200%);
    box-shadow: var(--carved-depth), inset 0 1px 1px rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-pill);
  }
  
  .search-wrapper input {
    width: 100%;
  }

  .cinematic-hero {
    height: auto;
    min-height: 85vh;
    padding: 120px 20px 80px 20px;
  }
  
  .hero-title {
    font-size: clamp(36px, 10vw, 56px);
  }
  
  .hero-meta {
    flex-wrap: wrap;
    height: auto;
    gap: 10px;
    margin-bottom: 16px;
  }
  
  .hero-synopsis {
    -webkit-line-clamp: 4;
    height: auto;
    font-size: 14px;
    margin-bottom: 24px;
  }
  
  .hero-actions {
    flex-wrap: wrap;
    height: auto;
    gap: 12px;
  }
  
  .btn {
    padding: 12px 24px;
    font-size: 14px;
  }
  
  .btn-icon {
    width: 48px;
    height: 48px;
  }

  .hero-dots {
    bottom: 24px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }

  .layout-container {
    padding: 0 20px 40px;
    margin-top: 20px;
  }
  
  .filters-bar {
    gap: 8px;
    margin-bottom: 24px;
  }
  
  .chip {
    padding: 8px 16px;
    font-size: 13px;
  }

  .card-save {
    opacity: 1 !important;
    transform: scale(1) translateY(0) !important;
  }

  .row-scroll {
    gap: 12px;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-top: 24px;
    margin-top: -24px;
    padding-bottom: 48px;
    margin-bottom: -32px;
    padding-left: 20px;
    margin-left: -20px;
    padding-right: 20px;
    margin-right: -20px;
    scroll-padding-left: 20px;
    scroll-snap-type: x proximity;
  }

  .row-scroll::-webkit-scrollbar {
    display: none;
  }
  
  .row-card {
    flex: 0 0 min(80vw, 320px);
    scroll-snap-align: start;
    touch-action: pan-x pan-y;
  } 

  .overlay {
    padding: 16px;
  }
  
  .sleek-modal {
    border-radius: 24px !important;
    transform: scale(1) translateY(100%);
    overflow-y: auto;
    overflow-x: hidden;
  }
  
  .overlay.show .sleek-modal {
    transform: scale(1) translateY(0);
  }
  
  .player-box {
    aspect-ratio: 16/9;
    min-height: auto;
    border-radius: 24px 24px 0 0;
    box-shadow: none;
    flex-shrink: 0;
  }
  
  .sleek-bottom-bar {
    padding: 24px;
    flex-shrink: 0;
    overflow: visible;
  }
  
  .bar-main-row {
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
  }
  
  .bar-info .modal-title {
    font-size: 28px;
  }
  
  .bar-actions {
    width: 100%;
    justify-content: flex-start;
  }
  
  .bar-controls-row {
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
    margin-top: 20px;
    padding-top: 20px;
  }
  
  .tv-controls {
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
  }
  
  .source-pills {
    justify-content: flex-start;
    gap: 8px;
  }
  
  .source-pill {
    padding: 8px 16px;
    font-size: 12px;
  }
}

/* ==========================================================================
   HOVER INTERACTIONS (DESKTOP ONLY)
   ================================================================          */
@media (hover: hover) and (pointer: fine) {
  .logo:hover {
    transform: scale(1.05);
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
  }
  
  .nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: var(--glass-rim);
  }
  
  .btn-white:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 32px rgba(255, 255, 255, 0.3), 0 0 15px rgba(255, 255, 255, 0.2), inset 0 2px 0 rgba(255, 255, 255, 1), inset 0 -4px 10px rgba(0, 0, 0, 0.2);
  }
  
  .btn-icon:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-4px) scale(1.1);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: var(--3d-pop), 0 0 15px rgba(255, 255, 255, 0.15);
  }
  
  .hero-dot:hover {
    background-color: 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), inset 0 1px 0 rgba(255, 255, 255, 1);
  }
  
  .hero-dot.active:hover {
    transform: translateY(-2px) scale(1.05);
  }
  
  .chip:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
    box-shadow: var(--3d-pop);
  }
  
  .card:hover, .row-card:hover {
    z-index: 10;
  }
  
  .card:hover .card-poster, .row-card:hover .row-poster {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 20px 40px -4px rgba(0, 0, 0, 0.8), 0 0 20px rgba(255, 255, 255, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
  }
  
  .card:hover .card-poster img, .row-card:hover .row-poster img {
    transform: scale(1.05);
  }
  
  .card:hover .card-poster::before, .row-card:hover .row-poster::before {
    transform: translateX(150%);
  }

  .card:hover .card-save {
    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: var(--3d-pop), 0 0 12px rgba(255, 255, 255, 0.2);
  }
  
  .row-card:hover .row-title-overlay {
    opacity: 1;
  }
  
  .row-card:hover .row-title {
    transform: translateY(0);
    opacity: 1;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.8);
  }
  
  .dropdown-trigger:hover, .custom-dropdown.open .dropdown-trigger {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: var(--3d-pop);
  }
  
  .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    transform: scale(1.02);
  }
  
  .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: var(--3d-pop), 0 0 15px rgba(255, 255, 255, 0.15);
  }
  
  .close-btn:hover {
    background: #ff3b30 !important;
    color: white !important;
    border-color: #ff3b30 !important;
    box-shadow: 0 12px 24px rgba(255, 59, 48, 0.4), var(--glass-rim) !important;
  }
  
  .source-pill:hover:not(.active) {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: var(--3d-pop);
  }
  
  .discord-link:hover {
    opacity: 1;
    transform: scale(1.1);
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.5));
  }
}

/* ==========================================================================
   INSTANT FEEDBACK ACTIVE STATES
   ================================================================          */
.nav-link:active,
.btn-white:active,
.btn-icon:active,
.hero-dot:active,
.chip:active,
.card:active .card-poster,
.card-save:active,
.row-card:active .row-poster,
.dropdown-trigger:active,
.action-btn:active,
.source-pill:active {
  transition-duration: 0.1s !important;
  transform: scale(0.92) !important;
}

/* ==========================================================================
   SMOOTH CARD LOADING — Skeleton Shimmer & Image Fades
   ================================================================          */

/* Keep overflow visible so shadows and scale aren't clipped */
.grid, .card, .row-card {
  overflow: visible;
}

@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}

.card-poster.skeleton,
.row-poster.skeleton {
  background: linear-gradient(
    100deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(255, 255, 255, 0.04) 30%,
    rgba(255, 255, 255, 0.10) 50%,
    rgba(255, 255, 255, 0.04) 70%,
    rgba(255, 255, 255, 0.04) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
}

.card-poster.loaded,
.row-poster.loaded {
  background: none;
  animation: none;
}

.card-poster img,
.row-poster img {
  opacity: 0;
  transition: opacity 0.45s ease, transform 0.6s var(--smooth) !important;
  will-change: opacity, transform;
}

.card-poster img.img-loaded,
.row-poster img.img-loaded {
  opacity: 1;
}

.card.card-animate,
.row-card.card-animate {
  opacity: 0;
  transform: translateY(22px) scale(0.97);
}

.card.card-visible,
.row-card.card-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

