@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg: hsl(0 0% 4%);
  --bg-card: hsl(0 0% 8%);
  --bg-elevated: hsl(0 0% 10%);
  --bg-hover: hsl(0 0% 14%);
  --border: hsl(0 0% 100% / 0.08);
  --text: hsl(0 0% 98%);
  --text-muted: hsl(0 0% 63%);
  --accent: #00d4a8;
  --accent-hover: #33dcba;
  --accent-glow: rgba(0,212,168,0.3);
  --success: hsl(142 71% 45%);
  --danger: hsl(0 84% 60%);
  --radius: 16px;
  --radius-sm: 10px;
  --nav-h: 64px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* ── Nav ── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 max(24px, 4vw);
  background: linear-gradient(to bottom, rgba(0,0,0,.9) 0%, transparent 100%);
  transition: background .35s, backdrop-filter .35s;
}
.nav.scrolled {
  background: hsl(0 0% 4% / 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.nav-logo {
  height: 36px;
  width: auto;
  display: block;
  object-fit: contain;
}
.nav-links {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}
.nav-links a, .nav-links button {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: .875rem;
  font-weight: 500;
  transition: all .2s;
}
.nav-links a:hover, .nav-links button:hover {
  color: var(--text);
  background: hsl(0 0% 100% / 0.07);
}
.nav-links a.active, .nav-links button.active {
  color: var(--text);
  background: transparent;
  position: relative;
}
.nav-links a.active::after, .nav-links button.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 14px;
  right: 14px;
  height: 2px;
  border-radius: 999px;
  background: var(--accent);
}
.nav-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: hsl(0 0% 100% / 0.06);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  min-width: 220px;
  margin-left: auto;
  transition: border-color .2s, background .2s;
}
.nav-search:focus-within {
  border-color: hsl(24 95% 53% / 0.5);
  background: hsl(0 0% 100% / 0.08);
}
.nav-search input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  outline: none;
  font-size: .875rem;
  -webkit-appearance: none;
  appearance: none;
}
.nav-search svg { color: var(--text-muted); flex-shrink: 0; }

/* ── Page ── */
.page { padding-top: 0; }

/* ── Hero ── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  padding: 120px max(24px, 4vw) 72px;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 20%;
  transform: scale(1.05);
  transition: transform 8s ease-out, opacity .7s ease;
}
.hero:hover .hero-bg { transform: scale(1); }
.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, var(--bg) 8%, hsl(0 0% 4% / 0.4) 40%, transparent 70%),
    linear-gradient(to right, var(--bg) 0%, transparent 55%);
}
.hero-bg-next {
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}
.hero-bg-next.fade-in { opacity: 1; }

/* Hero slider navigation dots */
.hero-nav {
  position: absolute;
  bottom: 28px;
  right: max(28px, 4vw);
  display: flex;
  gap: 8px;
  z-index: 2;
}
.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.35);
  border: none;
  cursor: pointer;
  transition: background .3s, transform .3s;
  padding: 0;
}
.hero-dot.active {
  background: var(--accent);
  transform: scale(1.3);
}
.hero-dot:hover { background: rgba(255,255,255,.7); }

/* Hero content fade on slide */
.hero-content.slide-out { animation: heroOut .35s ease-in forwards; }
.hero-content.slide-in { animation: heroIn .55s ease-out forwards; }
@keyframes heroOut { to { opacity: 0; transform: translateY(-16px); } }
@keyframes heroIn { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
.hero-content {
  position: relative;
  z-index: 1;
  max-width: 640px;
  animation: heroIn .8s ease-out;
}
@keyframes heroIn {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: var(--accent);
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.hero h1 {
  font-size: clamp(2.25rem, 5.5vw, 4rem);
  font-weight: 800;
  line-height: 1.05;
  margin-bottom: 16px;
  letter-spacing: -0.03em;
}
.hero-meta {
  color: var(--text-muted);
  font-size: .875rem;
  margin-bottom: 16px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.hero-meta span { display: flex; align-items: center; gap: 4px; }
.hero-overview {
  color: hsl(0 0% 82%);
  margin-bottom: 28px;
  max-width: 540px;
  font-size: .9375rem;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: .9375rem;
  transition: all .25s;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 28px var(--accent-glow);
}
.btn-secondary {
  background: hsl(0 0% 100% / 0.12);
  color: var(--text);
  backdrop-filter: blur(8px);
}
.btn-secondary:hover { background: hsl(0 0% 100% / 0.2); }

/* ── Sections ── */
.section {
  padding: 40px max(24px, 4vw);
}
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}
.section-header h2 {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.section-sub {
  font-size: .875rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.section-link {
  font-size: .8125rem;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color .2s;
}
.section-link:hover { color: var(--accent); }

.fade-section {
  opacity: 0;
  transform: translateY(20px);
  animation: sectionIn .6s ease-out forwards;
}
@keyframes sectionIn {
  to { opacity: 1; transform: translateY(0); }
}

/* ── Rows ── */
.row-wrap {
  position: relative;
}
.row-wrap::before,
.row-wrap::after {
  content: '';
  position: absolute;
  top: 0; bottom: 8px;
  width: 48px;
  z-index: 3;
  pointer-events: none;
}
.row-wrap::before {
  left: 0;
  background: linear-gradient(to right, var(--bg), transparent);
}
.row-wrap::after {
  right: 0;
  background: linear-gradient(to left, var(--bg), transparent);
}
.row-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-60%);
  z-index: 4;
  width: 40px; height: 40px;
  background: hsl(0 0% 100% / 0.1);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text);
  opacity: 0;
  transition: opacity .2s, background .2s;
}
.row-wrap:hover .row-arrow { opacity: 1; }
.row-arrow:hover { background: hsl(0 0% 100% / 0.18); }
.row-arrow.left { left: 4px; }
.row-arrow.right { right: 4px; }

.row {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 4px 4px 12px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.row::-webkit-scrollbar { display: none; }
.row-empty {
  color: var(--text-muted);
  font-size: .875rem;
  padding: 24px 0;
}

/* ── Cards ── */
.card {
  flex: 0 0 155px;
  scroll-snap-align: start;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  transition: transform .3s cubic-bezier(.34,1.56,.64,1), box-shadow .3s;
  cursor: pointer;
}
.card-lg { flex: 0 0 180px; }
.card.fade-in {
  animation: cardIn .5s ease-out both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.card:hover {
  transform: scale(1.06) translateY(-4px);
  box-shadow: 0 16px 40px hsl(0 0% 0% / 0.55);
  z-index: 2;
}
.card-poster {
  position: relative;
  aspect-ratio: 2/3;
  overflow: hidden;
  background: var(--bg-elevated);
}
.card-poster.no-img { background: linear-gradient(135deg, var(--bg-elevated), var(--bg-hover)); }
.card-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s;
}
.card:hover .card-poster img { transform: scale(1.08); }
.card-rating {
  position: absolute;
  top: 8px; right: 8px;
  padding: 3px 8px;
  background: hsl(0 0% 0% / 0.75);
  backdrop-filter: blur(4px);
  border-radius: 6px;
  font-size: .6875rem;
  font-weight: 600;
}
.card-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: hsl(0 0% 0% / 0.45);
  opacity: 0;
  transition: opacity .25s;
}
.card-play svg {
  width: 44px; height: 44px;
  color: #fff;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.5));
}
.card:hover .card-play { opacity: 1; }

/* Continue Watching — barra de progreso */
.card-progress-wrap {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 4px; background: rgba(255,255,255,.15);
}
.card-progress-bar {
  height: 100%; background: var(--accent);
  border-radius: 0 2px 0 0; min-width: 4px;
  transition: width .3s ease;
}
.card-continue-badge {
  position: absolute; bottom: 10px; left: 8px;
  background: rgba(0,0,0,.75); color: #fff;
  font-size: .65rem; font-weight: 700;
  padding: 2px 6px; border-radius: 4px;
  backdrop-filter: blur(4px);
}

.card-info { padding: 10px 12px; }
.card-info h3 {
  font-size: .8125rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-info p { font-size: .75rem; color: var(--text-muted); margin-top: 2px; }

/* Skeleton shimmer */
.shimmer, .shimmer-line {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-hover) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
.card.skeleton .card-poster { aspect-ratio: 2/3; }
.shimmer-line { height: 12px; border-radius: 4px; margin: 8px 12px; width: 70%; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Vibe picker ── */
.vibe-section {
  background: linear-gradient(135deg, hsl(24 95% 53% / 0.08), hsl(280 60% 50% / 0.06));
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  margin: 0 max(24px, 4vw) 40px;
  padding: 32px;
}
.vibe-section h2 { font-size: 1.375rem; font-weight: 700; margin-bottom: 6px; }
.vibe-section > p { color: var(--text-muted); font-size: .875rem; margin-bottom: 24px; }
.vibe-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.vibe-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: hsl(0 0% 100% / 0.06);
  border: 1px solid var(--border);
  font-size: .875rem;
  font-weight: 500;
  transition: all .25s;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .vibe-section {
    margin: 0 12px 24px;
    padding: 20px 16px;
    border-radius: var(--radius);
  }
  .vibe-section h2 { font-size: 1.1rem; margin-bottom: 4px; }
  .vibe-section > p { font-size: .8rem; margin-bottom: 14px; }
  .vibe-grid {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 4px;
    scrollbar-width: none;
    margin: 0 -4px;
    padding: 0 4px 4px;
  }
  .vibe-grid::-webkit-scrollbar { display: none; }
  .vibe-btn { padding: 8px 14px; font-size: .8rem; gap: 6px; }
}
.vibe-btn:hover, .vibe-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--accent-glow);
}
.vibe-results { margin-top: 24px; }
.vibe-results .row { padding-top: 8px; }

/* ── Random pick ── */
.random-section {
  text-align: center;
  padding: 48px max(24px, 4vw);
  background: radial-gradient(ellipse at center, hsl(24 95% 53% / 0.06) 0%, transparent 70%);
}
.random-section h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; }
.random-section > p { color: var(--text-muted); margin-bottom: 28px; }
.random-tabs {
  display: inline-flex;
  gap: 4px;
  background: var(--bg-elevated);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 24px;
}
.random-tabs button {
  padding: 8px 20px;
  border-radius: 999px;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all .2s;
}
.random-tabs button.active {
  background: var(--accent);
  color: #fff;
}
.dice-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 36px;
  background: var(--accent);
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 8px 32px var(--accent-glow);
  transition: all .3s;
}
.dice-btn:hover { transform: scale(1.05); box-shadow: 0 12px 40px var(--accent-glow); }
.dice-btn.rolling { animation: diceRoll .6s ease-in-out; }
@keyframes diceRoll {
  0%, 100% { transform: rotate(0) scale(1); }
  25% { transform: rotate(-8deg) scale(1.05); }
  75% { transform: rotate(8deg) scale(1.05); }
}
.random-result {
  margin-top: 32px;
  display: none;
  justify-content: center;
}
.random-result.show { display: flex; }
.random-card {
  display: flex;
  gap: 24px;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  max-width: 480px;
  text-align: left;
  animation: cardIn .5s ease-out;
}
.random-card img {
  width: 100px;
  border-radius: var(--radius-sm);
  aspect-ratio: 2/3;
  object-fit: cover;
}
.random-card h3 { font-size: 1.125rem; font-weight: 700; margin-bottom: 8px; }
.random-card p { font-size: .8125rem; color: var(--text-muted); margin-bottom: 16px; }

/* ── Collections ── */
.collection-card {
  flex: 0 0 280px;
  scroll-snap-align: start;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  aspect-ratio: 16/9;
  cursor: pointer;
  transition: transform .3s;
}
.collection-card:hover { transform: scale(1.04); }
.collection-card img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.collection-card .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, hsl(0 0% 0% / 0.85), transparent 60%);
  display: flex;
  align-items: flex-end;
  padding: 16px;
}
.collection-card h3 { font-size: 1rem; font-weight: 700; }

/* ── Search ── */
.search-results {
  position: fixed;
  top: calc(var(--nav-h) + 4px);
  right: max(24px, 4vw);
  width: min(380px, calc(100vw - 48px));
  max-height: 420px;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px hsl(0 0% 0% / 0.6);
  z-index: 200;
  display: none;
}
.search-results.open { display: block; }
.search-item {
  display: flex;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background .15s;
}
.search-item:hover { background: var(--bg-hover); }
.search-item img { width: 40px; height: 60px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }

/* ── Footer ── */
.footer {
  border-top: 1px solid var(--border);
  margin-top: 64px;
  padding: 48px max(24px, 4vw) 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto 40px;
}
.footer-brand p {
  color: var(--text-muted);
  font-size: .875rem;
  margin-top: 12px;
  max-width: 320px;
  line-height: 1.6;
}
.footer h4 {
  font-size: .8125rem;
  font-weight: 600;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
}
.footer ul { list-style: none; }
.footer li { margin-bottom: 10px; }
.footer a {
  font-size: .875rem;
  color: var(--text-muted);
  transition: color .2s;
}
.footer a:hover { color: var(--accent); }
.footer-bottom {
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .8125rem;
}

/* ── Sub pages ── */
/* Browse page — genre + network layout */
.browse-main { padding-top: var(--nav-h); }

.browse-header {
  padding: 32px max(24px, 4vw) 20px;
  border-bottom: 1px solid var(--border);
}
.browse-header h1 { font-size: 2rem; font-weight: 800; margin-bottom: 20px; letter-spacing: -0.03em; }

/* Pills unificadas: sorts + géneros en una sola fila con scroll */
.browse-pills-wrap {
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  margin-bottom: 4px;
}
.browse-pills-wrap::-webkit-scrollbar { display: none; }
.browse-pills {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  align-items: center;
}
.browse-pill {
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s;
  white-space: nowrap;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.browse-pill:hover { border-color: var(--accent); color: var(--text); }
.browse-pill.active { background: var(--accent); border-color: var(--accent); color: #000; font-weight: 700; }
.browse-pill-sep {
  color: var(--border);
  font-size: 1rem;
  flex-shrink: 0;
  pointer-events: none;
  user-select: none;
  padding: 0 2px;
}

/* Mantener compatibilidad con vistas que aún usen sort-btn/genre-pill */
.sort-btn { padding: 8px 18px; border-radius: 999px; background: var(--bg-card); border: 1px solid var(--border); color: var(--text-muted); font-size: .85rem; font-weight: 600; cursor: pointer; transition: all .18s; white-space: nowrap; flex-shrink: 0; }
.sort-btn:hover { border-color: var(--accent); color: var(--text); }
.sort-btn.active { background: var(--accent); border-color: var(--accent); color: #000; }
.genre-pill { padding: 7px 16px; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid var(--border); color: var(--text-muted); font-size: .8125rem; font-weight: 500; cursor: pointer; white-space: nowrap; transition: all .18s; flex-shrink: 0; }
.genre-pill:hover { border-color: var(--accent); color: var(--text); }
.genre-pill.active { background: rgba(0,212,168,.15); border-color: var(--accent); color: var(--accent); }

.browse-section-label {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--text-muted);
  padding: 24px max(24px,4vw) 12px;
}

.browse-results { padding: 28px max(24px, 4vw) 80px; }

.sub-page { padding: calc(var(--nav-h) + 32px) max(24px, 4vw) 48px; }
.sub-page h1 { font-size: 1.75rem; font-weight: 800; margin-bottom: 8px; }
.sub-page .subtitle { color: var(--text-muted); margin-bottom: 32px; }
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 16px;
}
.grid-cards .card { flex: unset; }
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
}
.empty-state svg { width: 48px; height: 48px; margin-bottom: 16px; opacity: .4; }

.import-box {
  max-width: 520px;
  margin-top: 24px;
}
.import-box textarea {
  width: 100%;
  min-height: 160px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 16px;
  font-family: monospace;
  font-size: .8125rem;
  resize: vertical;
}
.import-actions { display: flex; gap: 12px; margin-top: 12px; }

.browse-label {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin: 0 0 10px;
}
.browse-label:not(:first-of-type) { margin-top: 24px; }
.browse-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
#networkFilters .filter-btn[data-filter="network"] {
  border-color: hsl(24 95% 53% / 0.25);
}
.network-section .network-filters {
  margin-bottom: 20px;
}
.network-section .row-wrap {
  margin: 0 -4px;
}

.network-section {
  padding-left: 0 !important;
  padding-right: 0 !important;
}
.network-section .section-header {
  padding: 0 max(24px, 4vw);
}

.network-logos-wrap {
  position: relative;
  margin: 0;
}

.network-logos {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 14px;
  padding: 8px max(24px, 4vw) 28px;
}

@media (max-width: 900px) {
  .network-logos { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 600px) {
  /* Horizontal scroll strip on mobile */
  .network-logos {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 10px;
    padding: 6px 16px 16px;
    scrollbar-width: none;
  }
  .network-logos::-webkit-scrollbar { display: none; }
  .network-logo-btn {
    flex: 0 0 120px;
    height: 64px;
    border-radius: 10px;
  }
  .network-logo-btn img { max-height: 30px; }
  .network-logo-btn[data-network="213"] img { max-height: 20px; }
  .network-logo-btn[data-network="3186"] img { max-height: 26px; }
  .network-logo-btn[data-network="49"]   img { max-height: 24px; }
  .network-logo-btn[data-network="2552"] img { max-height: 26px; }
  .network-logo-btn[data-network="453"]  img { max-height: 22px; }
  .network-logo-btn[data-network="2739"] img { max-height: 30px; }
  .network-logo-btn[data-network="1024"] img { max-height: 26px; }
}

.network-logo-btn {
  width: 100%;
  height: 86px;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f0f0f0 100%);
  border: 2px solid hsl(0 0% 100% / 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  box-shadow:
    0 1px 0 hsl(0 0% 100% / 0.08) inset,
    0 4px 16px hsl(0 0% 0% / 0.35),
    0 1px 3px hsl(0 0% 0% / 0.2);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.network-logo-btn:hover {
  transform: translateY(-3px);
  box-shadow:
    0 1px 0 hsl(0 0% 100% / 0.1) inset,
    0 10px 28px hsl(0 0% 0% / 0.45),
    0 2px 6px hsl(0 0% 0% / 0.25);
}
.network-logo-btn.active {
  transform: translateY(-3px) scale(1.03);
  border-color: var(--network-accent, var(--accent));
  box-shadow:
    0 0 0 2px hsl(0 0% 100% / 0.15),
    0 0 0 4px color-mix(in srgb, var(--network-accent, var(--accent)) 45%, transparent),
    0 12px 32px hsl(0 0% 0% / 0.5);
}

.network-logo-media {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 16px 20px;
}
.network-logo-btn img {
  display: block;
  max-width: 100%;
  max-height: 44px;
  width: auto;
  height: auto;
  object-fit: contain;
  pointer-events: none;
}
.network-logo-btn[data-network="213"] img { max-height: 28px; }
.network-logo-btn[data-network="3186"] img { max-height: 36px; }
.network-logo-btn[data-network="49"] img { max-height: 32px; }
.network-logo-btn[data-network="2552"] img { max-height: 36px; }
.network-logo-btn[data-network="453"] img { max-height: 30px; }
.network-logo-btn[data-network="2739"] img { max-height: 44px; }
.network-logo-btn[data-network="1024"] img { max-height: 38px; }
.network-logo-btn[data-network="4330"] img { max-height: 40px; }

.network-panel {
  margin-top: 4px;
  animation: sectionIn .4s ease-out forwards;
}
.network-panel-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
  color: var(--text);
}
.filter-btn {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: .8125rem;
  font-weight: 500;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  transition: all .2s;
}
.filter-btn.active, .filter-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── Watch page ── */
.watch-page { padding-top: var(--nav-h); min-height: 100vh; overflow-x: hidden; }

.player-wrap {
  position: relative;
  background: #000;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16/9;
  max-height: calc(100vh - var(--nav-h));
}

/* Watch page — YouTube theater + Paramount+ below */
.watch-below-player {
  padding: 6px max(16px, 3vw);
  border-bottom: 1px solid var(--border);
  background: #0a0a0a;
  overflow-x: auto;
}

.watch-info {
  display: grid;
  grid-template-columns: 1fr 380px;
  width: 100%;
  min-height: 60vh;
  overflow-x: hidden;
}

.watch-info-main {
  padding: 36px max(28px, 5vw) 80px;
  border-right: 1px solid var(--border);
  min-width: 0; /* grid item must shrink below content width */
  overflow-wrap: break-word;
  word-break: break-word;
}

.watch-info-side {
  padding: 36px 28px 80px;
  background: var(--bg-elevated, #111);
  overflow-y: auto;
  min-width: 0;
}

.watch-title { font-size: 1.75rem; font-weight: 800; margin-bottom: 12px; overflow-wrap: break-word; }
.watch-overview { font-size: .9375rem; color: hsl(0 0% 82%); line-height: 1.7; overflow-wrap: break-word; }

@media (max-width: 900px) {
  .watch-info { grid-template-columns: 1fr; }
  .watch-info-main { border-right: none; padding: 20px 16px 36px; }
  .watch-info-side { padding: 16px 16px 48px; }
  .watch-title { font-size: 1.35rem; }
}

@media (max-width: 600px) {
  .watch-title { font-size: 1.15rem; line-height: 1.3; }
  .watch-overview { font-size: .875rem; }
  .watch-section-label { margin: 12px 0 6px; }
  .watch-badges { gap: 6px; margin-bottom: 10px; }
  .watch-badge { font-size: .72rem; padding: 3px 8px; }
  .watch-below-player { padding: 6px 12px; }
  .server-selector { padding: 8px 0; }
  .server-pill { font-size: .8rem; padding: 6px 12px; }
  .cast-card { width: 72px; }
  .cast-card img { width: 72px; height: 96px; border-radius: 8px; }
  .cast-name { font-size: .68rem; }
  .cast-char { font-size: .62rem; }
  .watch-similar-section { padding: 20px 16px 48px; }
  .watch-similar-section .similar-grid,
  .similar-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .episode-list { max-height: 280px; }
  .season-select { width: 100%; font-size: .875rem; }
}

@media (max-width: 400px) {
  .nav-logo { height: 28px; }
  .nav-search { min-width: 0; padding: 6px 10px; }
  .watch-title { font-size: 1rem; }
  .watch-info-main { padding: 16px 12px 32px; }
}

/* Similar section — full width below the two-column grid */
.watch-similar-section {
  padding: 32px max(28px, 5vw) 80px;
  border-top: 1px solid var(--border);
}
.watch-similar-section .similar-grid {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

/* ── Hamburger button ── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  margin-left: 8px;
  flex-shrink: 0;
  border-radius: 8px;
  transition: background .2s;
}
.nav-hamburger:hover { background: hsl(0 0% 100% / 0.08); }
.nav-hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .3s, opacity .3s;
  transform-origin: center;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile drawer (top sheet) ── */
.nav-drawer {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  width: 100%;
  max-height: min(88vh, 640px);
  background: hsl(0 0% 8% / 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid hsl(0 0% 100% / 0.1);
  border-top: none;
  border-radius: 0 0 20px 20px;
  z-index: 301;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 0 calc(16px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  transform: translateY(-110%);
  transition: transform .32s cubic-bezier(.32, .72, 0, 1);
  box-shadow: 0 12px 48px hsl(0 0% 0% / 0.55);
  pointer-events: none;
}
.nav-drawer.open {
  transform: translateY(0);
  pointer-events: auto;
}

.nav-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 12px;
  flex-shrink: 0;
}
.nav-drawer-logo { height: 28px; width: auto; }
.nav-drawer-close {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 1rem;
  color: var(--text-muted);
  background: hsl(0 0% 100% / 0.06);
  transition: background .18s, color .18s;
}
.nav-drawer-close:hover {
  background: hsl(0 0% 100% / 0.1);
  color: var(--text);
}

.drawer-search {
  display: none;
  align-items: center;
  gap: 10px;
  margin: 0 14px 10px;
  padding: 12px 16px;
  background: hsl(0 0% 100% / 0.06);
  border: 1px solid hsl(0 0% 100% / 0.1);
  border-radius: 14px;
  flex-shrink: 0;
}
.drawer-search:focus-within {
  border-color: hsl(24 95% 53% / 0.45);
  background: hsl(0 0% 100% / 0.08);
}
.drawer-search input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  outline: none;
  font-size: .9375rem;
  -webkit-appearance: none;
  appearance: none;
}
.drawer-search svg { color: var(--text-muted); flex-shrink: 0; }

.drawer-search-results-wrap {
  flex-shrink: 0;
  padding: 0 14px;
  min-height: 0;
}
.search-results.drawer-search-results {
  position: static;
  width: 100%;
  max-height: min(240px, 32vh);
  margin: 0 0 8px;
  box-shadow: none;
  border-radius: 14px;
  border: 1px solid hsl(0 0% 100% / 0.08);
  background: hsl(0 0% 6% / 0.95);
}

.drawer-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 10px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-height: 0;
}

.drawer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 12px;
  font-size: .9375rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: background .18s, color .18s;
}
.drawer-link:hover,
.drawer-link.active {
  background: hsl(0 0% 100% / 0.08);
  color: var(--text);
}
.drawer-link.active { color: var(--accent); }
.drawer-link-icon {
  width: 28px;
  text-align: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}
.drawer-link-label { flex: 1; }
.drawer-link-arrow {
  color: hsl(0 0% 100% / 0.25);
  font-size: 1.1rem;
  line-height: 1;
}

.drawer-auth {
  flex-shrink: 0;
  padding: 12px 14px 4px;
  border-top: 1px solid hsl(0 0% 100% / 0.08);
  margin-top: 4px;
}
.drawer-auth-btn,
.drawer-auth .nav-auth-btn {
  width: 100%;
  padding: 14px 18px;
  font-size: .9375rem;
}
.drawer-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.drawer-user-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.drawer-user-name {
  font-weight: 600;
  font-size: .9375rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.nav-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

body.nav-drawer-open { overflow: hidden; }

@media (max-width: 960px) {
  .nav-search { display: none; }
  .nav-auth { display: none; }
  .nav-links { display: none; }
  .nav-hamburger { display: flex; margin-left: auto; }
  .drawer-search { display: flex; }
  .nav { gap: 12px; }
  .nav-brand { margin-right: auto; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero { min-height: 70vh; padding-bottom: 40px; }
  .row-arrow { display: none; }

  .browse-results,
  .sub-page {
    padding-left: 12px;
    padding-right: 12px;
  }

  .grid-cards,
  .similar-grid,
  .watch-similar-section .similar-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .grid-cards .card-info { padding: 6px 4px 8px; }
  .grid-cards .card-info h3 { font-size: .7rem; }
  .grid-cards .card-info p { font-size: .625rem; }
  .grid-cards .card-rating { font-size: .58rem; padding: 2px 5px; top: 4px; right: 4px; }

  /* Browse header más compacto en mobile */
  .browse-header { padding: 18px 14px 14px; }
  .browse-header h1 { font-size: 1.5rem; margin-bottom: 14px; }
}

@media (min-width: 961px) {
  .nav-drawer,
  .nav-overlay,
  .nav-hamburger { display: none !important; }
}

/* ── Mobile watch page ── */
@media (max-width: 640px) {
  .watch-title { font-size: 1.25rem; line-height: 1.3; margin-bottom: 10px; }
  .watch-overview { font-size: .875rem; }
  .watch-section-label { margin: 14px 0 6px; }
  .watch-badges { gap: 6px; margin-bottom: 10px; }
  .watch-badge { font-size: .72rem; padding: 3px 8px; }

  .watch-info-main { padding: 20px 16px 36px; }
  .watch-info-side  { padding: 16px 16px 40px; }

  .watch-below-player { padding: 8px 16px; overflow-x: auto; }
  .server-selector { padding: 10px 0; display: block; }
  .server-pill { font-size: .8rem; padding: 7px 14px; white-space: nowrap; }

  .cast-card { width: 72px; }
  .cast-card img { width: 72px; height: 96px; border-radius: 8px; }
  .cast-name { font-size: .68rem; }
  .cast-char { font-size: .62rem; }

  .watch-similar-section { padding: 24px 16px 48px; }
  .watch-similar-section .similar-grid,
  .similar-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }

  .episode-list { max-height: 300px; }
  .season-select { font-size: .875rem; width: 100%; }
}

@media (max-width: 400px) {
  .nav-logo { height: 28px; }
  .watch-title { font-size: 1.1rem; }
  .cast-card { width: 64px; }
  .cast-card img { width: 64px; height: 86px; }
}
.player-wrap video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
}

.player-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(0,0,0,.85);
  z-index: 10;
}
.spinner {
  width: 48px; height: 48px;
  border: 3px solid rgba(255,255,255,.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.player-controls {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  opacity: 0;
  transition: opacity .3s;
  z-index: 5;
  pointer-events: none;
}
/* Solo mostrar con hover en dispositivos con mouse real — en táctil lo maneja JS */
@media (hover: hover) and (pointer: fine) {
  .player-wrap:hover .player-controls { opacity: 1; pointer-events: auto; }
}
.player-wrap.controls-visible .player-controls { opacity: 1; pointer-events: auto; }

/* En fullscreen los controles se ocultan igual que normal — JS maneja la visibilidad */
.player-wrap.controls-sticky .player-controls {
  opacity: 1;
  pointer-events: none;
  z-index: 10;
}
.player-wrap.controls-sticky .controls-bar {
  pointer-events: auto;
}
/* fullscreen nativo: solo mostrar si JS agrega controls-visible */
.player-wrap:fullscreen .player-controls,
.player-wrap:-webkit-full-screen .player-controls,
.player-wrap.is-fullscreen .player-controls {
  pointer-events: none;
  z-index: 10;
}
.player-wrap:fullscreen .controls-bar,
.player-wrap:-webkit-full-screen .controls-bar,
.player-wrap.is-fullscreen .controls-bar {
  pointer-events: auto;
}

/* ── Botón cerrar player ── */
.player-close-btn {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(0,0,0,.65);
  border: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 22;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, background .15s;
  -webkit-tap-highlight-color: transparent;
}
.player-close-btn svg { width: 18px; height: 18px; stroke: #fff; }
.player-close-btn:hover { background: rgba(0,0,0,.85); }
.player-wrap.controls-visible .player-close-btn { opacity: 1; pointer-events: auto; }

.center-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 15;
  cursor: pointer;
  pointer-events: auto;
}

.controls-gradient {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 50%;
  background: linear-gradient(transparent, rgba(0,0,0,.85));
  pointer-events: none;
}

.controls-bar { position: relative; padding: 0 16px 12px; }

.progress-wrap {
  height: 20px;
  display: flex;
  align-items: center;
  cursor: pointer;
  margin-bottom: 4px;
}
.progress-bg {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,.2);
  border-radius: 2px;
  position: relative;
  transition: height .15s;
}
.progress-wrap:hover .progress-bg { height: 6px; }
.progress-buffer { height: 100%; background: rgba(255,255,255,.3); border-radius: 2px; width: 0; position: absolute; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 2px; width: 0; position: relative; z-index: 1; }
.progress-thumb {
  position: absolute;
  right: -6px; top: 50%;
  transform: translateY(-50%) scale(0);
  width: 12px; height: 12px;
  background: var(--accent);
  border-radius: 50%;
  transition: transform .15s;
}
.progress-wrap:hover .progress-thumb { transform: translateY(-50%) scale(1); }

.controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.controls-left, .controls-right { display: flex; align-items: center; gap: 4px; }

.ctrl-btn {
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  transition: background .15s;
  position: relative;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}
.ctrl-btn:hover { background: rgba(255,255,255,.12); }
.ctrl-btn.active { color: var(--accent); }
.ctrl-btn svg { width: 20px; height: 20px; }

.time-display { font-size: .8125rem; color: rgba(255,255,255,.8); font-variant-numeric: tabular-nums; min-width: 90px; }

.ctrl-label { display: none; }

/* ── Player menus (bottom sheets) ── */
.player-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.player-menu-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}
body.player-menu-open { overflow: hidden; }

.player-wrap:fullscreen .player-menu-backdrop,
.player-wrap:-webkit-full-screen .player-menu-backdrop,
.player-wrap.is-fullscreen .player-menu-backdrop {
  z-index: 25;
}
.player-wrap:fullscreen .menu-panel,
.player-wrap:-webkit-full-screen .menu-panel,
.player-wrap.is-fullscreen .menu-panel {
  z-index: 26;
}

.menu-panel {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 110%);
  width: min(480px, calc(100vw - 24px));
  max-height: min(78vh, 560px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: hsl(0 0% 8% / 0.98);
  backdrop-filter: blur(20px);
  border: 1px solid hsl(0 0% 100% / 0.1);
  border-radius: 18px 18px 0 0;
  padding: 0;
  z-index: 210;
  box-shadow: 0 -12px 48px hsl(0 0% 0% / 0.55);
  transition: transform .32s cubic-bezier(.32, .72, 0, 1);
  pointer-events: none;
}
.menu-panel.open {
  transform: translate(-50%, 0);
  pointer-events: auto;
}
.menu-panel.menu-sheet-wide { width: min(560px, calc(100vw - 16px)); }

.menu-sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: hsl(0 0% 100% / 0.22);
  margin: 10px auto 6px;
  flex-shrink: 0;
}
.menu-panel .menu-title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  padding: 4px 18px 10px;
  flex-shrink: 0;
}
.menu-sheet-body {
  overflow-y: auto;
  padding: 0 10px calc(16px + env(safe-area-inset-bottom, 0px));
  -webkit-overflow-scrolling: touch;
}

.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: .9375rem;
  text-align: left;
  transition: background .15s, border-color .15s;
  border: 1px solid transparent;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}
.menu-item:hover { background: hsl(0 0% 100% / 0.06); }
.menu-item:active { background: hsl(0 0% 100% / 0.1); }
.menu-item.active {
  color: var(--accent);
  background: hsl(166 100% 42% / 0.08);
  border-color: hsl(166 100% 42% / 0.22);
}
.menu-item:disabled {
  opacity: 0.45;
  pointer-events: none;
}
.menu-item .check {
  opacity: 0;
  font-size: .875rem;
  font-weight: 700;
  flex-shrink: 0;
}
.menu-item.active .check { opacity: 1; }

.menu-item-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.menu-item-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.menu-item-title {
  font-weight: 600;
  line-height: 1.25;
}
.menu-item-meta {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .02em;
}

.menu-item .status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.menu-item .status-dot.ok { background: var(--success); box-shadow: 0 0 0 3px hsl(142 76% 46% / 0.15); }
.menu-item .status-dot.fail { background: var(--danger); }
.menu-item .status-dot.loading { background: var(--accent); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .4; } }

.provider-group {
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid hsl(0 0% 100% / 0.06);
}
.provider-group:last-child { border-bottom: none; margin-bottom: 0; }
.provider-label {
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .01em;
  color: hsl(0 0% 100% / 0.88);
  padding: 6px 14px 8px;
}
.menu-item.server-item { margin-bottom: 6px; }
.menu-item.dub-item { margin-left: 8px; }

.quality-badge { display: inline-block; font-size: .65rem; font-weight: 600; background: rgba(255,255,255,.1); border-radius: 3px; padding: 1px 5px; margin-left: 6px; color: var(--text-muted); vertical-align: middle; }

/* ── SERVER SELECTOR (below player) ── */
.server-selector {
  padding: 0;
  position: relative;
  display: block;
  width: 100%;
  max-width: 720px;
}
.server-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  background: hsl(0 0% 100% / 0.05);
  border: 1px solid hsl(0 0% 100% / 0.1);
  border-radius: 14px;
  font-size: .9375rem;
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .15s;
  user-select: none;
  min-height: 56px;
}
.server-pill:hover,
.server-pill:active {
  background: hsl(0 0% 100% / 0.08);
  border-color: hsl(166 100% 42% / 0.25);
}
.server-pill-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.server-pill-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--accent);
}
.server-pill-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.server-pill-kicker {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
}
#serverPillLabel {
  font-weight: 700;
  font-size: .9375rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.server-pill-chevron {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform .2s;
}
.server-selector:has(.server-dropdown.open) .server-pill-chevron {
  transform: rotate(180deg);
}

.server-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: hsl(0 0% 8% / 0.98);
  border: 1px solid hsl(0 0% 100% / 0.1);
  border-radius: 14px;
  z-index: 50;
  overflow: hidden;
  display: none;
  box-shadow: 0 16px 40px hsl(0 0% 0% / 0.55);
  max-height: min(320px, 50vh);
  overflow-y: auto;
}
.server-dropdown.open { display: block; }
.server-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background .15s;
  font-size: .9375rem;
  min-height: 52px;
}
.server-opt:hover { background: hsl(0 0% 100% / 0.06); }
.server-opt.active { background: hsl(166 100% 42% / 0.08); color: var(--accent); }
.server-opt .opt-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-muted); flex-shrink: 0; }
.server-opt.active .opt-dot { background: var(--accent); }
.server-opt-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}
.server-opt-name { font-weight: 600; }
.server-opt-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.lang-tag { font-size: .62rem; font-weight: 700; padding: 2px 6px; border-radius: 4px; background: rgba(0,212,168,.18); color: var(--accent); letter-spacing: .05em; flex-shrink: 0; }

.watch-title { font-size: 1.75rem; font-weight: 800; margin-bottom: 12px; }
.watch-meta { display: flex; gap: 12px; flex-wrap: wrap; color: var(--text-muted); font-size: .8125rem; margin-bottom: 16px; }
.watch-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.watch-badge { padding: 4px 10px; border-radius: 4px; font-size: .78rem; font-weight: 500; background: rgba(255,255,255,.1); }
.watch-badge.green { background: rgba(0,212,168,.15); color: var(--accent); border: 1px solid rgba(0,212,168,.2); }
.watch-section-label { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); margin: 20px 0 8px; }
.watch-overview { font-size: .9375rem; color: hsl(0 0% 82%); line-height: 1.7; margin-bottom: 0; }
.genre-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.genre-tag { padding: 5px 12px; border-radius: 20px; font-size: .78rem; background: rgba(255,255,255,.07); border: 1px solid var(--border); }
.cast-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
.cast-row::-webkit-scrollbar { display: none; }
.cast-card { flex-shrink: 0; width: 90px; }
.cast-card img { width: 90px; height: 120px; border-radius: 10px; object-fit: cover; background: var(--bg-card); display: block; }
.cast-name { font-size: .75rem; font-weight: 600; margin-top: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cast-char { font-size: .68rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.similar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-top: 8px; }
.sim-card { border-radius: var(--radius-sm); overflow: hidden; cursor: pointer; transition: transform .2s; }
.sim-card:hover { transform: scale(1.03); }
.sim-card img { width: 100%; aspect-ratio: 2/3; object-fit: cover; background: var(--bg-card); display: block; }
.season-select { padding: 8px 12px; background: rgba(255,255,255,.07); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: .875rem; cursor: pointer; outline: none; margin-bottom: 14px; }
.season-select option { background: #1a1a1a; }

.episode-list { display: flex; flex-direction: column; gap: 4px; max-height: 400px; overflow-y: auto; }
.episode-item {
  display: flex;
  gap: 12px;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s;
}
.episode-item:hover { background: var(--bg-hover); }
.episode-item.active { background: rgba(0,212,168,.1); border: 1px solid rgba(0,212,168,.28); }
.episode-num { font-weight: 700; color: var(--accent); min-width: 24px; }
.episode-info h4 { font-size: .8125rem; font-weight: 600; }
.episode-info p { font-size: .75rem; color: var(--text-muted); }

.center-play-btn {
  width: 72px; height: 72px;
  background: rgba(0,212,168,.9);
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: transform .2s, background .2s;
  box-shadow: 0 4px 24px var(--accent-glow);
}
.center-play-btn:hover { transform: scale(1.08); background: var(--accent); }
.center-play-btn svg { width: 32px; height: 32px; margin-left: 4px; }

.subtitle-overlay {
  position: absolute;
  bottom: 72px;
  left: 0;
  right: 0;
  text-align: center;
  pointer-events: none;
  z-index: 6;
  padding: 0 5%;
}
.subtitle-overlay .sub-line {
  display: inline-block;
  max-width: 90%;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  padding: 6px 14px;
  border-radius: 4px;
  font-size: clamp(0.95rem, 2.2vw, 1.25rem);
  line-height: 1.45;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  white-space: pre-wrap;
}

.sync-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 8px 4px;
  flex-wrap: wrap;
}
.sync-btn {
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(255,255,255,.08);
  font-size: .75rem;
  font-weight: 600;
  transition: background .15s;
}
.sync-btn:hover { background: rgba(249,115,22,.25); color: var(--accent); }
.sync-offset-label {
  min-width: 52px;
  text-align: center;
  font-size: .8125rem;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.sync-hint {
  font-size: .6875rem;
  color: var(--text-muted);
  padding: 4px 12px 8px;
  line-height: 1.4;
}

/* ── Mobile player premium ── */
.player-wrap:fullscreen,
.player-wrap:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  aspect-ratio: unset;
  background: #000;
  overflow: visible;
}
.player-wrap:fullscreen video,
.player-wrap:-webkit-full-screen video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
body.player-fullscreen {
  overflow: hidden;
}
body.player-fullscreen .player-menu-backdrop {
  z-index: 600;
}
body.player-fullscreen .menu-panel {
  z-index: 610;
}
body.player-fullscreen .nav,
body.player-fullscreen .watch-below-player,
body.player-fullscreen .watch-info,
body.player-fullscreen .watch-similar-section {
  display: none;
}
body.player-fullscreen .watch-page {
  padding-top: 0;
}
body.player-fullscreen .player-wrap {
  position: fixed;
  inset: 0;
  z-index: 500;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  overflow: visible;
  aspect-ratio: unset;
}
body.player-fullscreen .player-wrap video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@media (max-width: 768px) {
  .player-wrap {
    aspect-ratio: 16/9;
    max-height: none;
  }

  .controls-bar {
    padding: 0 8px calc(8px + env(safe-area-inset-bottom, 0px));
  }

  .controls-row { gap: 4px; }
  .controls-left, .controls-right { gap: 2px; }

  .ctrl-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 10px;
  }
  .ctrl-btn svg { width: 22px; height: 22px; }

  .ctrl-btn-mobile-hide { display: none !important; }

  #btnCaptions,
  #btnServers {
    width: auto;
    min-width: 44px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: hsl(0 0% 100% / 0.08);
    border: 1px solid hsl(0 0% 100% / 0.08);
  }
  #btnCaptions.active,
  #btnServers.active,
  .ctrl-btn.active {
    background: hsl(166 100% 42% / 0.15);
    border-color: hsl(166 100% 42% / 0.35);
    color: var(--accent);
  }
  .ctrl-label {
    display: inline;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .02em;
    line-height: 1;
  }

  .time-display {
    font-size: .72rem;
    min-width: 0;
    padding: 0 2px;
  }

  .progress-wrap {
    height: 28px;
    margin-bottom: 2px;
  }
  .progress-bg { height: 5px; }

  .menu-panel {
    width: 100vw;
    max-width: 100vw;
    left: 0;
    transform: translateY(110%);
    border-radius: 20px 20px 0 0;
    border-left: none;
    border-right: none;
  }
  .menu-panel.open {
    transform: translateY(0);
    left: 0;
  }
  .menu-panel.menu-sheet-wide { width: 100vw; max-width: 100vw; }

  .watch-below-player {
    padding: 10px 12px 12px;
    background: linear-gradient(180deg, #0a0a0a 0%, #070707 100%);
    border-bottom-color: hsl(0 0% 100% / 0.06);
  }

  .server-dropdown {
    position: fixed;
    left: 12px;
    right: 12px;
    top: auto;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    max-height: min(420px, 55vh);
    border-radius: 16px;
    z-index: 180;
  }

  .sync-controls { gap: 6px; padding: 10px 8px 6px; }
  .sync-btn {
    min-height: 40px;
    min-width: 44px;
    padding: 8px 12px;
    font-size: .8125rem;
  }
}

@media (max-width: 480px) {
  .time-display { display: none; }
  #btnRewind, #btnForward { display: none; }
}

.hidden { display: none !important; }

/* ── Auth / Login ── */
.sf-login-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: hsl(0 0% 2% / 0.92);
  backdrop-filter: blur(12px);
}
.sf-login-overlay.hidden { display: none !important; }
.sf-login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: 0 24px 80px hsl(0 0% 0% / 0.5);
}
.sf-login-brand {
  font-weight: 800;
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--accent);
}
.sf-login-card h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.sf-login-sub {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 24px;
}
.sf-login-card label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.sf-login-card input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font: inherit;
}
.sf-login-card input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.sf-login-btn {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
  padding: 12px;
}
.sf-login-error {
  color: var(--danger);
  font-size: 0.8125rem;
  margin: 8px 0 0;
}
.sf-login-hint {
  margin-top: 20px;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}
.sf-login-hint code {
  font-size: 0.7rem;
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: 4px;
}
.sf-login-docs {
  display: block;
  text-align: center;
  margin-top: 12px;
  font-size: 0.8125rem;
  color: var(--accent);
}
.nav-auth {
  flex-shrink: 0;
  margin-left: 12px;
}
.nav-auth-btn {
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.8125rem;
}
.nav-auth-btn:hover { background: var(--accent-hover); }
.nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8125rem;
}
.nav-user-email {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
}
.nav-user-plan {
  text-transform: uppercase;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent-glow);
  color: var(--accent);
}
.nav-logout-btn {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-muted);
}
.nav-logout-btn:hover {
  border-color: var(--danger);
  color: var(--danger);
}
