/* ============ Reset & base ============ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: #0b0b0f;
  color: #f4f4f5;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, button { font-family: inherit; }
.hidden { display: none !important; }

:root {
  --accent: #e50914;
  --accent-2: #ff2a36;
  --bg: #0b0b0f;
  --bg-2: #15151c;
  --bg-3: #1f1f29;
  --text: #f4f4f5;
  --text-dim: #b3b3bb;
  --text-muted: #7a7a85;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  --nav-h: 68px;
  --bottom-nav-h: 64px;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }

/* ============ Top navigation ============ */
.topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  background: linear-gradient(180deg, rgba(11,11,15,0.96) 0%, rgba(11,11,15,0.8) 60%, rgba(11,11,15,0) 100%);
  transition: background 0.3s ease, backdrop-filter 0.3s ease;
}
.topnav.scrolled {
  background: rgba(11, 11, 15, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  height: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.brand { display: flex; align-items: center; transition: transform 0.2s ease; }
.brand:hover { transform: translateY(-1px); }
.brand-text {
  font-weight: 900;
  letter-spacing: 1.5px;
  font-size: 24px;
  background: linear-gradient(135deg, #ff5760 0%, #e50914 50%, #8b0612 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 30px rgba(229, 9, 20, 0.25);
}
.brand-text.small { font-size: 18px; letter-spacing: 1px; }
.nav-links { display: flex; gap: 24px; flex: 1; }
.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dim);
  position: relative;
  padding: 8px 0;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--text); }
.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}
.nav-actions { display: flex; align-items: center; gap: 12px; }
.search-form {
  display: flex;
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0;
  transition: width 0.3s ease, border-color 0.2s, background 0.2s, padding 0.2s;
  width: 40px;
  overflow: hidden;
}
.search-form.open, .search-form:focus-within {
  width: 280px;
  background: rgba(0, 0, 0, 0.7);
  border-color: rgba(255, 255, 255, 0.25);
  padding: 4px 4px 4px 14px;
}
.search-form input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 14px;
  width: 0;
  opacity: 0;
  transition: opacity 0.2s;
  padding-left: 8px;
  min-width: 0;
}
.search-form.open input, .search-form:focus-within input {
  opacity: 1;
  width: 100%;
}
.search-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  color: var(--text);
  background: transparent;
  transition: color 0.15s ease, opacity 0.15s ease;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.search-toggle:focus,
.search-toggle:active,
.search-toggle:hover { background: transparent; outline: none; }
@media (hover: hover) {
  .search-toggle:hover { opacity: 0.75; }
}
.search-form.open .search-toggle, .search-form:focus-within .search-toggle {
  width: 32px;
  height: 32px;
  color: var(--text);
}
.menu-toggle { display: none; }

/* ============ Mobile drawer ============ */
.mobile-drawer {
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  background: rgba(11, 11, 15, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 99;
  transform: translateY(-10px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.mobile-drawer.open {
  display: flex;
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.mobile-drawer a, .mobile-drawer .link-btn {
  padding: 14px 8px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.mobile-drawer a:last-of-type { border-bottom: none; }
.link-btn { color: var(--accent); font-weight: 500; cursor: pointer; }

/* ============ Bottom nav (mobile) ============ */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottom-nav-h);
  background: rgba(11, 11, 15, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  z-index: 90;
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
  transition: color 0.2s;
}
.bottom-nav a svg { width: 22px; height: 22px; }
.bottom-nav a.active { color: var(--accent); }

/* ============ App container ============ */
.app {
  min-height: 100vh;
  padding-top: var(--nav-h);
  padding-bottom: 80px;
}

/* ============ Hero ============ */
.hero {
  position: relative;
  width: 100%;
  height: min(85vh, 780px);
  min-height: 520px;
  margin-top: calc(-1 * var(--nav-h));
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 18%;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 1.2s ease;
  will-change: transform, opacity;
}
.hero-bg.active {
  opacity: 1;
  animation: kenburns 18s ease-out both;
}
@keyframes kenburns {
  0%   { transform: scale(1.04) translate3d(0, 0, 0); }
  100% { transform: scale(1.13) translate3d(-1.5%, -1%, 0); }
}
.hero-scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(11,11,15,0.4) 0%, rgba(11,11,15,0) 28%, rgba(11,11,15,0.55) 72%, var(--bg) 100%),
    linear-gradient(90deg, rgba(11,11,15,0.94) 0%, rgba(11,11,15,0.55) 48%, rgba(11,11,15,0.15) 100%);
  z-index: 1;
}
.hero-content {
  position: absolute;
  bottom: 100px;
  left: 0; right: 0;
  padding: 0 64px;
  max-width: 720px;
  z-index: 2;
  animation: heroFadeIn 0.8s ease;
}
@keyframes heroFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero-logo {
  max-width: 320px;
  max-height: 160px;
  margin-bottom: 20px;
  filter: drop-shadow(0 4px 20px rgba(0,0,0,0.6));
}
.hero-title {
  font-size: clamp(32px, 5vw, 64px);
  font-weight: 900;
  line-height: 1.05;
  margin: 0 0 16px;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}
.hero-rank {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.hero-rank-num {
  background: linear-gradient(135deg, #ff2a36, #b00710);
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.6px;
  box-shadow: 0 4px 14px rgba(229, 9, 20, 0.4);
}
.hero-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
}
.hero-meta .badge {
  background: rgba(255, 255, 255, 0.15);
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}
.hero-meta .badge-type { background: rgba(229, 9, 20, 0.85); color: #fff; }
.hero-meta .badge-mature {
  border: 1px solid rgba(255,255,255,0.4);
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #fff;
}
.hero-meta .badge-quality {
  border: 1px solid rgba(255,255,255,0.4);
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: #fff;
}
.hero-meta .rating { color: #ffc83d; font-weight: 600; }
.hero-genres {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  font-weight: 500;
  letter-spacing: 0.2px;
}
.hero-genres .sep { color: rgba(255,255,255,0.45); }
.hero-overview {
  font-size: clamp(14px, 1.4vw, 17px);
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.88);
  margin: 0 0 24px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: #fff;
  color: #000;
}
.btn-primary:hover { background: rgba(255, 255, 255, 0.85); box-shadow: 0 6px 24px rgba(255,255,255,0.15); }
.btn-secondary {
  background: rgba(109, 109, 110, 0.6);
  color: #fff;
  backdrop-filter: blur(10px);
}
.btn-secondary:hover { background: rgba(109, 109, 110, 0.8); }
.btn-accent {
  background: var(--accent);
  color: #fff;
}
.btn-accent:hover { background: var(--accent-2); box-shadow: 0 6px 24px rgba(229, 9, 20, 0.4); }
.btn-ghost {
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.5);
  padding: 10px 16px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 22px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-ghost:hover { border-color: #fff; background: rgba(0,0,0,0.7); }
.hero-content { z-index: 2; }

.hero-dots {
  position: absolute;
  bottom: 30px;
  left: 64px;
  display: flex;
  gap: 8px;
  z-index: 3;
}
.hero-dots button {
  width: 30px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.3);
  transition: background 0.2s, width 0.3s;
}
.hero-dots button.active { background: var(--accent); width: 48px; }

/* ============ Sections / rows ============ */
.section {
  padding: 16px 0;
  margin: 0 0 32px;
}
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 64px;
  margin-bottom: 14px;
}
.section-title {
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.2px;
}
.section-link {
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 500;
}
.section-link:hover { color: var(--text); }

.row-wrap {
  position: relative;
  padding: 0 64px;
}
.row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 8px 0 12px;
}
.row::-webkit-scrollbar { display: none; }
.row-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: calc(100% - 16px);
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #fff;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
}
.row-wrap:hover .row-arrow { opacity: 1; }
.row-arrow:hover { background: rgba(0, 0, 0, 0.85); }
.row-arrow.left { left: 16px; border-radius: 0 6px 6px 0; }
.row-arrow.right { right: 16px; border-radius: 6px 0 0 6px; }

/* ============ Cards ============ */
.card {
  flex: 0 0 auto;
  width: clamp(150px, 15vw, 220px);
  scroll-snap-align: start;
  position: relative;
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, z-index 0s 0.3s;
  background: var(--bg-2);
  aspect-ratio: 2 / 3;
}
.card > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card:hover {
  transform: scale(1.08) translateY(-3px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75);
  z-index: 10;
  transition: transform 0.3s ease, box-shadow 0.3s ease, z-index 0s 0s;
}
.card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.6px;
  padding: 2px 6px;
  border-radius: 3px;
  z-index: 3;
  pointer-events: none;
  opacity: 0.95;
}
.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  background: var(--bg-3);
}
.card .card-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
  background: linear-gradient(135deg, var(--bg-2), var(--bg-3));
}
.card-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,0) 35%, rgba(0,0,0,0.45) 60%, rgba(0,0,0,0.92) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.card:hover .card-overlay {
  opacity: 1;
  pointer-events: auto;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.6) 45%, rgba(0,0,0,0.95) 100%);
}
.card-overlay-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  margin-bottom: auto; /* push info to bottom, buttons to top */
  margin-top: 4px;
  margin-left: 4px;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.2s ease 0s, transform 0.2s ease 0s;
}
.card:hover .card-overlay-actions {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.25s ease 0.12s, transform 0.25s ease 0.12s;
}
.card-overlay-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.card-title {
  font-size: 14px;
  font-weight: 700;
  margin: 0;
  line-height: 1.25;
  text-shadow: 0 2px 6px rgba(0,0,0,0.6);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--text-dim);
}
.card-meta .rating { color: #ffc83d; font-weight: 700; }
.card-pill-tiny {
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 3px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--text);
  line-height: 1.5;
}
.card-overlay-genres {
  font-size: 11px;
  color: rgba(255,255,255,0.65);
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.25s ease, opacity 0.2s ease;
}
.card:hover .card-overlay-genres {
  max-height: 16px;
  opacity: 1;
}

/* Action buttons inside the card overlay */
.card-action {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(40, 40, 40, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
  text-decoration: none;
  flex-shrink: 0;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.card-action:hover {
  border-color: #fff;
  background: rgba(0, 0, 0, 0.85);
  transform: scale(1.08);
}
.card-action-play {
  background: #fff;
  border-color: #fff;
  color: #000;
  font-size: 11px;
}
.card-action-play:hover { background: #e6e6e6; color: #000; transform: scale(1.08); }
.card-action.is-active {
  background: #fff;
  border-color: #fff;
  color: #000;
}
.card-rank {
  position: absolute;
  bottom: -8px; left: -10px;
  font-size: 100px;
  font-weight: 900;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 3px rgba(255, 255, 255, 0.85);
  font-family: 'Inter', sans-serif;
  pointer-events: none;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
}

/* "Top 10" style row gives extra width per card */
.row.top10 .card {
  margin-left: 60px;
}
.row.top10 .card:first-child { margin-left: 50px; }


/* Genre pill shortcut bar */
.genre-section {
  padding: 8px 0 8px;
  margin-bottom: 24px;
}
.genre-pills-wrap {
  padding: 0 64px;
  overflow-x: auto;
  scrollbar-width: none;
}
.genre-pills-wrap::-webkit-scrollbar { display: none; }
.genre-pills {
  display: flex;
  gap: 10px;
  padding: 4px 0;
  min-width: max-content;
}
.genre-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}
.genre-pill:hover {
  color: #fff;
  background: linear-gradient(135deg, rgba(229,9,20,0.18), rgba(229,9,20,0.05));
  border-color: rgba(229, 9, 20, 0.5);
  transform: translateY(-1px);
}
.genre-pill-icon {
  font-size: 15px;
  line-height: 1;
  filter: grayscale(0.1);
}

/* Continue Watching cards */
.continue-row {
  align-items: stretch;
}
.continue-card {
  flex: 0 0 auto;
  width: clamp(260px, 22vw, 320px);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-2);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.continue-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.55);
}
.continue-link {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  /* Default placeholder so an entry without artwork still looks intentional
     while we backfill it from TMDB in the background. */
  background-image:
    radial-gradient(120% 80% at 30% 30%, rgba(229, 9, 20, 0.35) 0%, rgba(229, 9, 20, 0) 55%),
    linear-gradient(135deg, #2a1226 0%, #16161f 65%, #0d0d13 100%);
  background-color: var(--bg-3);
  cursor: pointer;
  transition: background-size 0.45s ease;
}
.continue-link.has-bg {
  background-size: cover;
}
.continue-card:hover .continue-link.has-bg {
  background-size: 108%;
}
.continue-link::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,0.92) 100%);
  pointer-events: none;
}
.continue-tag {
  position: absolute;
  top: 10px; left: 10px;
  z-index: 2;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.6px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  border: 1px solid rgba(229, 9, 20, 0.5);
  backdrop-filter: blur(4px);
  text-transform: uppercase;
}
.continue-watched {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 2;
  display: flex;
  align-items: baseline;
  gap: 5px;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.75);
  pointer-events: none;
}
.continue-watched strong {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.2px;
}
.continue-watched span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: rgba(255,255,255,0.78);
  font-weight: 600;
}
.continue-play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #000;
  font-size: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
  transition: transform 0.2s, background 0.2s;
  z-index: 2;
}
.continue-play:hover { transform: translate(-50%, -50%) scale(1.08); background: #fff; }
.continue-remove {
  position: absolute;
  top: 8px; right: 8px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s, transform 0.2s;
}
.continue-card:hover .continue-remove { opacity: 1; }
.continue-remove:hover { background: var(--accent); transform: scale(1.1); }
.continue-progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 6px;
  background: rgba(255, 255, 255, 0.18);
  z-index: 2;
}
.continue-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 10px rgba(229, 9, 20, 0.6);
}
.continue-info { padding: 10px 12px 12px; }
.continue-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.continue-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
}
.continue-meta .continue-ep {
  background: rgba(229, 9, 20, 0.18);
  color: #ff8189;
  border: 1px solid rgba(229, 9, 20, 0.4);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 11px;
}
.continue-meta .rating { color: #ffc83d; font-weight: 600; }

/* ============ Grid (browse all) ============ */
.grid-page { padding: 0 64px 64px; }

/* Hero banner header for grid pages — extends behind the fixed navbar */
.grid-hero {
  position: relative;
  margin: calc(-1 * var(--nav-h)) -64px 32px;
  padding: calc(var(--nav-h) + 56px) 64px 38px;
  border-bottom: 1px solid var(--border);
  background-color: #0d0d13;
  overflow: hidden;
  isolation: isolate;
}
.grid-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--hero-bg, none);
  background-size: cover;
  background-position: center 30%;
  filter: blur(2px) saturate(1.05);
  opacity: 0;
  transition: opacity 0.8s ease;
  z-index: -2;
  transform: scale(1.05);
}
.grid-hero.has-bg::before { opacity: 0.55; }
.grid-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(11,11,15,0.65) 0%, rgba(11,11,15,0.85) 60%, rgba(11,11,15,1) 100%),
    radial-gradient(900px 320px at 8% 30%, rgba(229,9,20,0.18) 0%, transparent 65%);
  z-index: -1;
}
.grid-hero.accent-tv::after {
  background:
    linear-gradient(180deg, rgba(11,11,15,0.65) 0%, rgba(11,11,15,0.85) 60%, rgba(11,11,15,1) 100%),
    radial-gradient(900px 320px at 8% 30%, rgba(99, 102, 241, 0.22) 0%, transparent 65%);
}
.grid-hero.accent-trending::after {
  background:
    linear-gradient(180deg, rgba(11,11,15,0.65) 0%, rgba(11,11,15,0.85) 60%, rgba(11,11,15,1) 100%),
    radial-gradient(900px 320px at 8% 30%, rgba(255, 138, 32, 0.25) 0%, transparent 65%);
}
.grid-hero.accent-gold::after {
  background:
    linear-gradient(180deg, rgba(11,11,15,0.65) 0%, rgba(11,11,15,0.85) 60%, rgba(11,11,15,1) 100%),
    radial-gradient(900px 320px at 8% 30%, rgba(255, 200, 61, 0.22) 0%, transparent 65%);
}
.grid-hero.accent-upcoming::after {
  background:
    linear-gradient(180deg, rgba(11,11,15,0.65) 0%, rgba(11,11,15,0.85) 60%, rgba(11,11,15,1) 100%),
    radial-gradient(900px 320px at 8% 30%, rgba(70, 211, 105, 0.22) 0%, transparent 65%);
}
.grid-hero.accent-live::after {
  background:
    linear-gradient(180deg, rgba(11,11,15,0.65) 0%, rgba(11,11,15,0.85) 60%, rgba(11,11,15,1) 100%),
    radial-gradient(900px 320px at 8% 30%, rgba(229, 9, 20, 0.30) 0%, transparent 65%);
}
.grid-hero-glow {
  position: absolute;
  width: 220px;
  height: 220px;
  right: -40px;
  top: -40px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(229, 9, 20, 0.35) 0%, transparent 65%);
  filter: blur(20px);
  pointer-events: none;
  z-index: -1;
}
.grid-hero.accent-tv .grid-hero-glow { background: radial-gradient(circle, rgba(99, 102, 241, 0.35) 0%, transparent 65%); }
.grid-hero.accent-trending .grid-hero-glow { background: radial-gradient(circle, rgba(255, 138, 32, 0.4) 0%, transparent 65%); }
.grid-hero.accent-gold .grid-hero-glow { background: radial-gradient(circle, rgba(255, 200, 61, 0.4) 0%, transparent 65%); }
.grid-hero.accent-upcoming .grid-hero-glow { background: radial-gradient(circle, rgba(70, 211, 105, 0.4) 0%, transparent 65%); }
.grid-hero.accent-live .grid-hero-glow { background: radial-gradient(circle, rgba(229, 9, 20, 0.45) 0%, transparent 65%); }
.grid-hero-inner {
  max-width: 900px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.grid-hero-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}
.grid-hero.accent-tv .grid-hero-eyebrow { color: #818cf8; }
.grid-hero.accent-trending .grid-hero-eyebrow { color: #ffa654; }
.grid-hero.accent-gold .grid-hero-eyebrow { color: #ffc83d; }
.grid-hero.accent-upcoming .grid-hero-eyebrow { color: #46d369; }
.grid-hero.accent-live .grid-hero-eyebrow {
  color: #ff5760;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.grid-hero.accent-live .grid-hero-eyebrow::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff5760;
  box-shadow: 0 0 0 3px rgba(255, 87, 96, 0.25);
  animation: pulse-dot 1.6s ease-out infinite;
}
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(255, 87, 96, 0.55); }
  100% { box-shadow: 0 0 0 8px rgba(255, 87, 96, 0); }
}
.grid-hero-title {
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 900;
  letter-spacing: -1px;
  margin: 0;
  line-height: 1.05;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.6);
}
.grid-hero-sub {
  font-size: clamp(14px, 1.4vw, 17px);
  color: var(--text-dim);
  line-height: 1.55;
  margin: 4px 0 0;
  max-width: 720px;
}
/* Rich filter bar — segmented tabs + scrollable genre chips */
.filter-bar-rich {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 28px;
}
.sort-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  align-self: flex-start;
}
.sort-tab {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.18s, color 0.18s;
}
.sort-tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.sort-tab.is-active {
  color: #fff;
  background: linear-gradient(135deg, #ff2a36, #b00710);
  box-shadow: 0 4px 14px rgba(229, 9, 20, 0.4);
}
.genre-chips-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 24px), transparent);
          mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 24px), transparent);
}
.genre-chips-wrap::-webkit-scrollbar { display: none; }
.genre-chips {
  display: inline-flex;
  gap: 8px;
  padding: 2px 4px;
  min-width: max-content;
}
.genre-chip {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}
.genre-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}
.genre-chip.is-active {
  background: #fff;
  border-color: #fff;
  color: #000;
  font-weight: 700;
}

/* Legacy (kept for any non-rich filter bars) */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}
.filter-bar select {
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  cursor: pointer;
}
.filter-bar select:focus { border-color: var(--accent); }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
}
.grid .card { width: 100%; }
.load-more {
  display: block;
  margin: 32px auto 0;
  padding: 14px 36px;
  background: var(--bg-3);
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
}
.load-more:hover { background: #2a2a36; }
.load-more:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============ Details page ============ */
.details {
  position: relative;
  min-height: 100vh;
  margin-top: calc(-1 * var(--nav-h));
}
.details-hero {
  position: relative;
  height: min(75vh, 700px);
  min-height: 460px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.details-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11,11,15,0.55) 0%, rgba(11,11,15,0.2) 40%, rgba(11,11,15,0.85) 80%, var(--bg) 100%);
}
.details-hero-content {
  position: absolute;
  bottom: 60px;
  left: 0; right: 0;
  padding: 0 64px;
  max-width: 900px;
  z-index: 2;
}
.details-hero-content h1 {
  font-size: clamp(32px, 5vw, 64px);
  font-weight: 900;
  margin: 0 0 12px;
  line-height: 1.05;
  text-shadow: 0 2px 20px rgba(0,0,0,0.6);
}
.details-tagline { font-size: 18px; font-style: italic; color: var(--text-dim); margin: 0 0 16px; }
.details-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 16px;
}
.details-meta .pill {
  padding: 4px 12px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}
.details-meta .rating-big {
  color: #ffc83d;
  font-weight: 700;
  font-size: 16px;
}
.details-overview {
  font-size: clamp(14px, 1.4vw, 17px);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
  margin: 0 0 24px;
  max-width: 720px;
}
.details-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.details-body { padding: 40px 64px; min-width: 0; }
.details-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 48px;
  margin-bottom: 48px;
}
.details-grid > * { min-width: 0; }
.info-list { display: grid; gap: 14px; font-size: 14px; }
.info-list dt { color: var(--text-muted); font-weight: 500; margin-bottom: 2px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.info-list dd { margin: 0; color: var(--text); }

/* Cast */
.cast-row {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 8px 0 16px;
}
.cast-row::-webkit-scrollbar { display: none; }
.cast-card { flex: 0 0 130px; text-align: center; }
.cast-card img {
  width: 130px; height: 130px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 8px;
  background: var(--bg-3);
}
.cast-card .name { font-size: 13px; font-weight: 600; margin: 4px 0 2px; }
.cast-card .role { font-size: 12px; color: var(--text-dim); }

/* Episodes */
.season-picker {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.season-picker select {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
}
.episodes { display: grid; gap: 12px; }
.episode {
  display: grid;
  grid-template-columns: 200px 1fr auto;
  gap: 16px;
  padding: 12px;
  background: var(--bg-2);
  border-radius: 10px;
  align-items: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.episode:hover { background: var(--bg-3); }
.episode:active { transform: scale(0.99); }
.episode-still {
  width: 200px;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  object-fit: cover;
  background: var(--bg-3);
}
.episode-info h4 { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.episode-info .num { color: var(--text-muted); font-weight: 500; margin-right: 6px; }
.episode-info p {
  margin: 0;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.episode-info .meta { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.episode-play {
  background: var(--accent);
  color: #fff;
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s;
}
.episode-play:hover { transform: scale(1.1); }

/* ============ Player modal ============ */
.player-modal {
  position: fixed;
  inset: 0;
  /* iOS Safari: the URL bar resizes the visual viewport, so `inset: 0` alone
     can leave the iframe overshooting and the player-bar hidden behind the
     dynamic toolbar. Pin height to the small viewport unit where supported. */
  height: 100vh;
  height: 100svh;
  width: 100vw;
  background: #000;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.25s ease;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.player-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  gap: 12px;
  border-bottom: 1px solid var(--border);
}
.player-title {
  font-size: 16px;
  font-weight: 600;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-controls { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.player-btn {
  padding: 8px 14px;
  background: rgba(255,255,255,0.1);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  transition: background 0.2s;
  white-space: nowrap;
}
.player-btn:hover { background: rgba(255,255,255,0.2); }
.player-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.player-select {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
  max-width: 160px;
}
.player-select option { background: #1a1a1a; color: #fff; }
.player-close {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(229, 9, 20, 0.85);
  border-radius: 50%;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  transition: background 0.2s, transform 0.15s;
}
.player-close:hover { background: var(--accent); transform: scale(1.05); }
.player-frame {
  flex: 1;
  position: relative;
  background: #000;
}
.player-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.player-error {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(140% 100% at 50% 0%, rgba(229, 9, 20, 0.18) 0%, rgba(0,0,0,0.85) 55%, rgba(0,0,0,0.95) 100%);
  z-index: 4;
}
.player-error.visible { display: flex; }
.player-error-card {
  max-width: 440px;
  text-align: center;
  background: rgba(20, 20, 26, 0.92);
  border: 1px solid rgba(229, 9, 20, 0.35);
  border-radius: 12px;
  padding: 28px 28px 24px;
  box-shadow: 0 30px 70px rgba(0,0,0,0.6);
}
.player-error-card h3 {
  font-size: 18px;
  margin: 0 0 8px;
  font-weight: 800;
}
.player-error-card p {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-dim);
  margin: 0 0 18px;
}
.player-error-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============ Setup modal ============ */
.setup-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.setup-card {
  width: 100%;
  max-width: 460px;
  background: linear-gradient(160deg, #1a1a24 0%, #0f0f15 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 28px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.setup-logo {
  font-size: 28px;
  font-weight: 900;
  background: linear-gradient(135deg, #ff2a36 0%, #b00710 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 24px;
}
.setup-card h2 { margin: 0 0 12px; font-size: 22px; font-weight: 700; }
.setup-card p { color: var(--text-dim); font-size: 14px; line-height: 1.5; margin: 0 0 20px; }
.setup-card a { color: var(--accent); }
.setup-card input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  margin-bottom: 14px;
  transition: border-color 0.2s, background 0.2s;
}
.setup-card input:focus { border-color: var(--accent); background: rgba(255,255,255,0.08); }
.setup-card .btn { width: 100%; padding: 14px; }
.setup-card small { display: block; margin-top: 14px; color: var(--text-muted); font-size: 12px; line-height: 1.5; }

/* ============ Loader ============ */
.loader {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  padding: 40px 0;
}
.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, var(--bg-2) 25%, var(--bg-3) 50%, var(--bg-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ============ Empty / error ============ */
.empty {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-dim);
}
.empty h3 { font-size: 22px; margin: 0 0 8px; color: var(--text); }
.empty p { margin: 0 0 16px; }

/* ============ Toast ============ */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(20, 20, 28, 0.97);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 1500;
  max-width: 90%;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============ Static pages (about, privacy, terms, contact) ============ */
.static-page {
  max-width: 760px;
  margin: 0 auto;
  padding: calc(var(--nav-h) + 24px) 24px 48px;
}
.static-hero {
  margin-bottom: 32px;
}
.static-hero h1 {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  margin: 0 0 12px;
  letter-spacing: -0.5px;
}
.static-lead {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-dim);
  margin: 0;
}
.static-body { display: grid; gap: 24px; }
.static-section h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text);
}
.static-section p {
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-dim);
}
.static-foot {
  margin: 40px 0 0;
}
@media (max-width: 480px) {
  .static-page { padding: calc(var(--nav-h) + 12px) 16px 32px; }
  .static-hero { margin-bottom: 24px; }
  .static-lead { font-size: 15px; }
  .static-section h2 { font-size: 16px; }
  .static-section p { font-size: 14px; }
}

/* ============ Sponsors ============ */
.sponsors-section .section-header { margin-bottom: 18px; }
.sponsors-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 0 64px;
}
.sponsors-grid-page {
  padding: 0;
  margin: 8px 0 8px;
}
.sponsor-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.sponsor-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}
.sponsor-media {
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
}
.sponsor-media img {
  max-width: 78%;
  max-height: 70%;
  object-fit: contain;
}
.sponsor-media-light {
  background: #ffffff;
}
.sponsor-media-light img {
  max-width: 82%;
  max-height: 64%;
}
.sponsor-media-empty {
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.02) 0 12px, rgba(255,255,255,0.04) 12px 24px),
    var(--bg-3);
}
.sponsor-placeholder-icon {
  font-size: 34px;
  opacity: 0.35;
  filter: grayscale(1);
}
.sponsor-media-cta {
  background: linear-gradient(135deg, rgba(229,9,20,0.18), rgba(255,42,54,0.06));
}
.sponsor-logo-text {
  font-size: clamp(15px, 1.6vw, 20px);
  font-weight: 800;
  letter-spacing: 0.3px;
  color: var(--text);
  text-transform: uppercase;
  border: 2px dashed rgba(255, 255, 255, 0.25);
  padding: 10px 18px;
  border-radius: 10px;
}
.sponsor-body {
  padding: 12px 14px;
  text-align: center;
}
.sponsor-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
}
.sponsor-card-cta .sponsor-name { color: var(--accent-2); }
.sponsor-card:hover .sponsor-name { color: var(--text); }

@media (max-width: 720px) {
  .sponsors-grid { padding: 0 16px; }
}
@media (max-width: 560px) {
  .sponsors-grid { grid-template-columns: 1fr; }
}

/* ============ Footer ============ */
.site-footer {
  border-top: 1px solid var(--border);
  background: #08080c;
  padding: 28px 64px;
  margin-top: 48px;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.footer-top {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}
.footer-brand { text-decoration: none; }
.footer-tagline {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 22px;
  font-size: 13px;
}
.footer-links a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.15s;
}
.footer-links a:hover { color: var(--text); }
.footer-copy {
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
@media (max-width: 820px) {
  .site-footer { padding: 24px 24px 28px; }
  .footer-top { flex-direction: column; gap: 6px; }
  .footer-links { gap: 14px 18px; }
}
@media (max-width: 480px) {
  .site-footer { padding: 22px 16px 24px; }
}

/* ============ Responsive ============ */
@media (max-width: 1100px) {
  .nav-inner { padding: 0 24px; gap: 20px; }
  .nav-links { gap: 18px; }
  .hero-content, .details-hero-content, .section-header, .row-wrap, .site-footer, .genre-pills-wrap { padding-left: 24px; padding-right: 24px; }
  .grid-page { padding-left: 24px; padding-right: 24px; padding-top: 0; }
  .details-body { padding: 32px 24px; }
  .details-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .grid-hero {
    margin-left: -24px;
    margin-right: -24px;
    padding: calc(var(--nav-h) + 36px) 24px 26px;
  }
}

@media (max-width: 820px) {
  :root { --nav-h: 60px; }
  .nav-links { display: none; }
  .nav-actions { margin-left: auto; }
  .grid-page { padding: 0 24px 48px; }
  .grid-hero {
    padding: calc(var(--nav-h) + 28px) 24px 22px;
    margin-bottom: 20px;
  }
  .grid-hero-glow { width: 160px; height: 160px; right: -30px; top: -30px; }
  .sort-tabs { width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .sort-tabs::-webkit-scrollbar { display: none; }
  .menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 22px;
    padding: 4px 0;
  }
  .menu-toggle span {
    display: block;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.25s, opacity 0.25s;
  }
  .menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-toggle.open span:nth-child(2) { opacity: 0; }
  .menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .bottom-nav { display: flex; }
  .app { padding-bottom: calc(var(--bottom-nav-h) + 24px); }
  .search-form.open, .search-form:focus-within { width: 200px; }
  .hero { height: min(90vh, 640px); min-height: 460px; }
  .hero-content { bottom: 80px; padding: 0 24px; }
  .hero-dots { left: 24px; bottom: 24px; }
  .details-hero-content { bottom: 40px; padding: 0 24px; }
  .episode { grid-template-columns: 130px 1fr; gap: 12px; padding: 10px; }
  .episode-still { width: 130px; }
  .episode-play { display: none; }
  .player-bar { padding: 10px 14px; }
  .player-controls { gap: 6px; }
  .player-btn { padding: 7px 10px; font-size: 12px; }
  .player-select { font-size: 12px; padding: 7px 8px; max-width: 110px; }
  .player-title { font-size: 14px; }
  .card { width: 130px; }
  .row.top10 .card { margin-left: 36px; }
  .card-rank { font-size: 78px; -webkit-text-stroke-width: 2px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
  .row-arrow { display: none; }
  .brand-text { font-size: 18px; letter-spacing: 1px; }
  /* Continue cards smaller on mobile */
  .continue-card { width: 240px; }
  .continue-play { width: 46px; height: 46px; font-size: 18px; }
  .continue-remove { opacity: 1; } /* always show on touch */
  /* Genre pills tighter */
  .genre-pill { padding: 7px 13px; font-size: 12px; }
  .genre-pills-wrap { padding-left: 16px; padding-right: 16px; }
  /* Hero rank chip a bit smaller */
  .hero-rank { font-size: 11px; gap: 8px; margin-bottom: 8px; }
  .hero-rank-num { font-size: 11px; padding: 3px 8px; }
  .hero-meta { gap: 8px; font-size: 13px; }
  .hero-genres { font-size: 12px; gap: 6px; }
  .btn-ghost { width: 42px; height: 42px; font-size: 18px; padding: 6px 10px; }
  .site-footer { padding: 24px 24px 32px; }
  .toast { bottom: calc(var(--bottom-nav-h) + 16px); }
}

@media (max-width: 480px) {
  .brand-text { font-size: 16px; letter-spacing: 0.6px; }
  .nav-inner { padding: 0 12px; gap: 8px; }
  .hero-content, .details-hero-content { padding: 0 16px; }
  .section-header, .row-wrap { padding-left: 16px; padding-right: 16px; }
  .genre-pills-wrap { padding: 0 12px; }
  .grid-page { padding: 0 16px 32px; }
  .grid-hero {
    margin-left: -16px;
    margin-right: -16px;
    padding: calc(var(--nav-h) + 22px) 16px 18px;
  }
  .grid-hero-eyebrow { font-size: 10px; letter-spacing: 1.6px; }
  .grid-hero-title { font-size: 30px; line-height: 1.05; }
  .grid-hero-sub { font-size: 13px; line-height: 1.5; margin-top: 2px; }
  .sort-tab { padding: 7px 13px; font-size: 12px; }
  .genre-chip { padding: 5px 12px; font-size: 12px; }
  .details-body { padding: 24px 16px; }
  .hero-actions { gap: 8px; }
  .hero-actions .btn, .details-actions .btn { padding: 10px 18px; font-size: 14px; }
  .hero-actions .btn-ghost { padding: 6px 10px; }
  .card { width: 120px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 8px; }
  .continue-card { width: 220px; }
  .episode { grid-template-columns: 100px 1fr; }
  .episode-still { width: 100px; }
  .player-controls .player-btn { display: none; }
  .player-bar { padding: 8px 10px; }
  .search-form.open, .search-form:focus-within { width: 150px; }
  .nav-actions { gap: 6px; }
  .hero-meta { font-size: 12px; gap: 6px; }
  .hero-meta .badge,
  .hero-meta .badge-mature,
  .hero-meta .badge-quality { font-size: 10px; padding: 2px 6px; }
  .genre-pill { padding: 6px 12px; font-size: 12px; }
  .genre-pill-icon { font-size: 13px; }
}


/* Touch devices: disable hover scale and show simplified always-on overlay */
@media (hover: none) {
  .card:hover { transform: none; box-shadow: none; }
  .card-overlay {
    opacity: 1;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,0.92) 100%);
  }
  .card-overlay-actions { display: none; }
  .card-overlay-genres { display: none; }
  .continue-card:hover { transform: none; box-shadow: 0 6px 18px rgba(0,0,0,0.4); }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
