
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #000000;
  --bg-card: #0a0a0a;
  --bg-hover: #141414;
  --surface-elevated: #111111;
  --text: #ffffff;
  --text-muted: #aaaaaa;
  --accent: #ffffff;
  --accent-hover: #e5e5e5;
  --accent-blue: #38bdf8;
  --accent-blue-hover: #7dd3fc;
  --accent-blue-dim: rgba(56,189,248,0.15);
  --accent-green: #2dd4aa;
  --accent-green-dim: rgba(45,212,170,0.14);
  --like-green: #4ade80;
  --accent-dim: rgba(255,255,255,0.1);
  --accent-glow: rgba(56,189,248,0.12);
  --star-yellow: #fbbf24;
  --border: #1a1a1a;
  --border-hover: #2a2a2a;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 12px 40px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 0 1px rgba(255,255,255,0.06), 0 8px 32px rgba(0,0,0,0.5);
  --focus-ring: 0 0 0 2px rgba(56,189,248,0.45);
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --nav-height: 64px;
  --bottom-nav-height: 64px;
  --player-float-width: 886px;
  --live-red: #ff3b3b;
}
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-top: var(--nav-height);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  overflow-x: clip;
  max-width: 100%;
}
body.home-hero { padding-top: 0; }
body.nav-open { overflow: hidden; }
body.has-bottom-nav { padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom)); }
body.has-bottom-nav footer { margin-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom)); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .media-card:hover, .btn-primary:hover { transform: none; }
  .live-badge.live { animation: none; }
  .live-dot { animation: none; }
}

/* Ads — collapsed until an ad actually loads (see ads-script.ts) */
.ad-slot {
  display: block;
  width: 100%;
  margin: 0 auto;
  overflow: hidden;
  background: transparent;
  border: none;
}
.ad-slot.ad-slot--visible { display: block; }
.ad-slot .ad-frame { width: 100%; margin: 0 auto; position: relative; }
.ad-slot iframe {
  border: 0; padding: 0; display: block; margin: 0 auto;
  overflow: hidden; background: transparent;
  width: 100%; max-width: 728px; min-height: 0; height: auto;
}
.ad-inline-wrap {
  max-width: 1440px;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-xl) 0;
}
.ad-footer-wrap {
  max-width: 1440px;
  margin: 0 auto;
  padding: var(--space-md) var(--space-xl);
}
.ad-slot-inline iframe,
.ad-slot-footer iframe { min-height: 90px; }

.page-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--space-sm);
  overflow-x: clip;
}
body.home-hero .page-shell {
  max-width: none;
  padding: 0;
}
.page-content { min-width: 0; overflow-x: clip; }

/* Top Nav */
nav.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: 0 max(var(--space-xl), env(safe-area-inset-right)) 0 max(var(--space-xl), env(safe-area-inset-left));
  height: var(--nav-height);
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: none;
  transition: transform 0.25s ease, background 0.25s ease,
              backdrop-filter 0.25s ease, border-color 0.25s ease;
}
nav.top-nav.is-scrolled {
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
}
nav.top-nav.is-hidden {
  transform: translateY(-100%);
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  nav.top-nav { transition: none; }
}
nav.top-nav .logo {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 1.15rem; font-weight: 700; letter-spacing: -0.03em; color: var(--text);
  flex-shrink: 0;
}
nav.top-nav .logo svg { color: var(--text); }
nav.top-nav .nav-links {
  display: flex; gap: 2px; align-items: center;
}
nav.top-nav .nav-links a {
  font-size: 0.8125rem; font-weight: 500; color: var(--text-muted);
  padding: 8px 14px; border-radius: var(--radius-sm); transition: color .15s, background .15s;
  position: relative; min-height: 44px; display: inline-flex; align-items: center;
  letter-spacing: 0.01em;
}
nav.top-nav .nav-links a:hover { color: var(--text); background: var(--accent-dim); }
nav.top-nav .nav-links a.active {
  color: var(--accent-blue); background: var(--accent-blue-dim);
}
.nav-live-link { gap: 8px !important; }
.live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--live-red); flex-shrink: 0;
  animation: live-dot-pulse 2.4s ease-in-out infinite;
}
@keyframes live-dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(255,59,59,0.45); }
  50% { opacity: 0.9; transform: scale(0.94); box-shadow: 0 0 0 4px rgba(255,59,59,0); }
}
.nav-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.nav-search-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0;
  border: none; border-radius: 50%;
  background: transparent; color: var(--text);
  cursor: pointer; transition: background .15s, color .15s;
}
.nav-search-btn:hover { background: rgba(255,255,255,0.08); color: var(--text); }

/* Search */
.search-form { margin: 0; }
.search-form--nav {
  flex: 1; min-width: 0; max-width: 300px;
}
.search-form--overlay { width: 100%; }
.search-overlay {
  position: fixed; inset: 0; z-index: 1400;
  display: flex; flex-direction: column; align-items: center;
  padding: clamp(48px, 12vh, 140px) var(--space-md) var(--space-md);
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
}
.search-overlay--visible { opacity: 1; pointer-events: auto; }
body.search-overlay-open { overflow: hidden; }
body.search-overlay-open .vidmove-global-player.is-mini {
  z-index: 100;
  pointer-events: none;
}
.search-overlay-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.search-overlay-close {
  position: fixed; top: max(14px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  z-index: 1402;
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0;
  border: none; border-radius: 50%;
  background: rgba(255,255,255,0.08); color: #fff;
  cursor: pointer; transition: background .15s;
}
.search-overlay-close:hover { background: rgba(255,255,255,0.14); }
.search-overlay-close:focus,
.search-overlay-close:focus-visible { outline: none; box-shadow: none; color: #fff; }
.search-overlay-shell {
  position: relative; z-index: 1401;
  width: 100%; max-width: 600px;
  max-height: min(620px, calc(100dvh - clamp(64px, 14vh, 160px)));
  display: flex; flex-direction: column;
  background: rgba(12,12,14,0.96);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.03);
  overflow: hidden;
  transform: translateY(-12px) scale(0.98);
  transition: transform .22s ease;
}
.search-overlay--visible .search-overlay-shell {
  transform: translateY(0) scale(1);
}
.search-overlay-bar {
  display: flex; align-items: center; gap: 12px;
  margin: 0; padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.search-overlay-bar-icon {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-muted); flex-shrink: 0;
}
.search-overlay-input {
  flex: 1; min-width: 0; width: 100%;
  border: none; background: transparent; outline: none;
  color: var(--text); font-size: 0.95rem; font-family: inherit;
  line-height: 1.4; padding: 4px 0;
}
.search-overlay-input::placeholder { color: #777; }
.search-overlay-input::-webkit-search-cancel-button { cursor: pointer; }
.search-overlay-input:focus,
.search-overlay-input:focus-visible { outline: none; box-shadow: none; }
.search-overlay-shell:focus-within { outline: none; box-shadow: 0 32px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.03); }
.search-overlay-body {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 6px;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.search-overlay-body::-webkit-scrollbar { width: 6px; }
.search-overlay-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.search-overlay-hint,
.search-overlay-empty,
.search-overlay-loading {
  padding: 36px 16px; text-align: center;
  font-size: 0.85rem; color: var(--text-muted);
}
.search-overlay-results {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column;
}
.search-overlay-item {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 12px; border-radius: 10px;
  transition: background .15s;
}
.search-overlay-item:hover { background: rgba(255,255,255,0.06); }
.search-overlay-thumb {
  flex-shrink: 0; width: 48px; aspect-ratio: 2/3;
  border-radius: 6px; overflow: hidden;
  background: var(--bg-card); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.search-overlay-thumb img { width: 100%; height: 100%; object-fit: cover; }
.search-overlay-thumb-placeholder {
  font-size: 0.72rem; font-weight: 700; color: var(--text-muted);
}
.search-overlay-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.search-overlay-title {
  font-size: 0.92rem; font-weight: 600; line-height: 1.3; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.search-overlay-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 0.72rem; font-weight: 500; color: var(--text-muted);
}
.search-overlay-meta .search-overlay-type { color: var(--text); font-weight: 600; }
.search-overlay-submeta {
  font-size: 0.68rem; font-weight: 500; color: #888;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.search-form--page {
  width: 100%; max-width: 640px;
  margin: 0 auto;
  padding: var(--space-md) var(--space-xl) var(--space-lg);
  box-sizing: border-box;
}
.search-form-field {
  display: flex; align-items: center; gap: 10px;
  height: 42px; padding: 0 14px;
  background: #111111;
  border: 1px solid #222222;
  border-radius: var(--radius);
  cursor: text;
  transition: border-color .2s, background .2s;
}
.search-form-field:focus-within {
  border-color: var(--border-hover);
  background: #141414;
  box-shadow: none;
}
.search-form-icon {
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); flex-shrink: 0;
}
.search-form-input {
  flex: 1; min-width: 0; width: 100%;
  border: none; background: transparent; outline: none;
  color: var(--text); font-size: 0.875rem; font-family: inherit;
  line-height: 1.4;
  box-shadow: none;
}
.search-form-input:focus,
.search-form-input:focus-visible {
  outline: none;
  box-shadow: none;
}
.search-form-input::placeholder { color: #777777; }
.search-form-input::-webkit-search-cancel-button { cursor: pointer; }
.search-form--page .search-form-field {
  height: 52px; padding: 0 18px; border-radius: calc(var(--radius) + 2px);
}
.search-form--page .search-form-input { font-size: 1rem; }

.nav-toggle {
  display: none; background: none; border: none; color: var(--text);
  cursor: pointer; padding: 10px; border-radius: var(--radius-sm);
  min-width: 44px; min-height: 44px; align-items: center; justify-content: center;
}
.nav-toggle:hover { background: rgba(255,255,255,0.06); }

.nav-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  z-index: 150; opacity: 0; transition: opacity .2s;
}
body.nav-open .nav-overlay { display: block; opacity: 1; }

/* Share popup */
.share-popup {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-md);
  opacity: 0; transition: opacity .2s ease;
  pointer-events: none;
}
.share-popup--visible { opacity: 1; pointer-events: auto; }
body.share-popup-open { overflow: hidden; }
.share-popup-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.share-popup-panel {
  position: relative; z-index: 1;
  width: 100%; max-width: 380px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 6px);
  padding: var(--space-lg);
  box-shadow: var(--shadow-glow);
  transform: scale(0.96) translateY(8px);
  transition: transform .2s ease;
}
.share-popup--visible .share-popup-panel {
  transform: scale(1) translateY(0);
}
.share-popup-close {
  position: absolute; right: 8px; top: 8px;
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; transition: color .15s, background .15s;
}
.share-popup-close:hover {
  color: var(--text); background: var(--accent-dim);
}
.share-popup-body {
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
}
.share-popup-icon {
  display: flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--accent-dim); color: var(--text);
  margin-bottom: var(--space-md);
}
.share-popup-title {
  font-size: 1.25rem; font-weight: 600; color: var(--text);
  letter-spacing: -0.02em;
}
.share-popup-text {
  margin-top: 12px; font-size: 0.875rem; line-height: 1.6;
  color: var(--text-muted);
}
.share-popup-dismiss {
  margin-top: var(--space-md); width: 100%;
  justify-content: center; text-transform: uppercase;
  letter-spacing: 0.04em; font-size: 0.8125rem;
}

/* Hero Carousel */
.hero-carousel {
  position: relative; height: 520px; overflow: hidden;
  cursor: grab; touch-action: pan-y pinch-zoom;
  user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.hero-carousel.is-dragging { cursor: grabbing; }
.hero-carousel--bleed {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
  margin-top: calc(-1 * var(--nav-height));
  height: min(78vh, 720px);
}
.hero-viewport {
  position: relative; overflow: hidden; height: 100%; width: 100%; max-width: 100%;
}
.hero-slides {
  display: flex; height: 100%; width: 100%;
  will-change: transform;
  max-width: none;
}
.hero-carousel.is-dragging .hero-slides { transition: none !important; }
.hero-slide {
  flex: 0 0 100%; width: 100%; min-width: 100%;
  position: relative; display: flex; align-items: flex-end;
  padding: 0;
}
.hero-slide .hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-slide .hero-bg img {
  width: 100%; height: 100%; object-fit: cover; object-position: center 18%;
  pointer-events: none; -webkit-user-drag: none;
}
.hero-slide .hero-bg::after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(to top, var(--bg) 2%, rgba(0,0,0,0.55) 38%, rgba(0,0,0,0.15) 70%, rgba(0,0,0,0.45) 100%),
    linear-gradient(to right, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.35) 45%, transparent 75%);
  pointer-events: none;
}
.hero-slide .hero-content {
  position: relative; z-index: 1; max-width: 620px;
  padding: 0 var(--space-xl) clamp(48px, 9vh, 96px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.hero-slide--active .hero-content {
  opacity: 1; pointer-events: auto;
}
.hero-carousel.is-dragging .hero-slide .hero-content { pointer-events: none; }
.hero-pills { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.hero-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.2);
  color: #fff; font-size: 0.72rem; font-weight: 600;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.hero-pill--type { text-transform: uppercase; letter-spacing: 0.06em; }
.hero-pill--rating { color: var(--star-yellow); }
.hero-footer {
  position: absolute; bottom: 28px; right: var(--space-xl); z-index: 10;
  display: flex; align-items: center; gap: 16px;
  pointer-events: none;
}
.hero-footer .hero-dots,
.hero-footer .hero-nav-group,
.hero-footer .hero-nav-btn { pointer-events: auto; }
.hero-nav-group { display: flex; gap: 8px; }
.hero-nav-btn {
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(0,0,0,0.55); border: 1px solid rgba(255,255,255,0.25);
  color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: background .15s, border-color .15s;
}
.hero-nav-btn:hover { background: rgba(0,0,0,0.85); border-color: rgba(255,255,255,0.5); }
.hero-dots { display: flex; gap: 8px; }
.hero-dot {
  width: 8px; height: 8px; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.35); cursor: pointer; padding: 0;
  transition: background .2s, transform .2s;
}
.hero-dot--active { background: #fff; transform: scale(1.3); }

/* Overlay nav for hero pages — subtle gradient at top only */
body.home-hero nav.top-nav--overlay.is-at-top:not(.is-scrolled) {
  background: linear-gradient(to bottom, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.2) 60%, transparent 100%);
  backdrop-filter: none; -webkit-backdrop-filter: none;
  border-bottom: none;
}

/* Hero (legacy single) */
.hero {
  position: relative; height: 520px; overflow: hidden; display: flex; align-items: flex-end;
  padding: 48px var(--space-xl);
}
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
}
.hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.hero-bg::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, var(--bg) 0%, rgba(0,0,0,0.55) 45%, rgba(0,0,0,0.2) 100%);
}
.hero-content { position: relative; z-index: 1; max-width: 680px; }
.hero-badge {
  display: inline-block; padding: 4px 12px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.08); color: var(--text);
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 14px; border: 1px solid var(--border);
}
.hero-content h1 { font-size: 3rem; font-weight: 800; line-height: 1.05; margin-bottom: 12px; letter-spacing: -0.03em; }
.hero-content .meta { display: flex; gap: 14px; align-items: center; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 16px; flex-wrap: wrap; }
.hero-content .overview { font-size: 0.9rem; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 24px; line-height: 1.7; max-width: 560px; }
.hero-content .rating { color: #f5f5f5; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.hero-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 22px;
  border-radius: var(--radius-sm); font-weight: 600; font-size: 0.875rem; cursor: pointer;
  border: none; transition: all .15s; font-family: inherit; min-height: 44px;
  letter-spacing: 0.01em;
}
.btn-primary { background: var(--accent); color: #000; border-radius: 999px; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 20px rgba(255,255,255,0.15); }
.btn-ghost { background: rgba(0,0,0,0.45); color: var(--text); border: 1px solid rgba(255,255,255,0.25); border-radius: 999px; backdrop-filter: blur(8px); }
.btn-ghost:hover { background: var(--accent-dim); border-color: rgba(255,255,255,0.2); }

/* Section */
.section { padding: var(--space-xl); max-width: 1440px; margin: 0 auto; }
.section-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 18px; gap: 12px; }
.section-header h2 { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
.section-header a, .see-all-link {
  font-size: 0.8125rem; color: var(--text-muted); font-weight: 500; white-space: nowrap;
  transition: color .15s; display: inline-flex; align-items: center; gap: 4px;
}
.section-header a:hover, .see-all-link:hover { color: var(--accent-blue); }

/* Tab bar */
.tab-bar {
  display: flex; gap: 8px; flex: 1; overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.tab-bar::-webkit-scrollbar { display: none; }
.tab-pill {
  flex-shrink: 0; padding: 10px 18px; border-radius: 999px;
  font-size: 0.82rem; font-weight: 500; color: var(--text-muted);
  background: var(--bg-card); border: 1px solid var(--border);
  transition: all .2s; min-height: 44px; cursor: pointer; font-family: inherit;
}
.tab-pill:hover { color: var(--text); border-color: var(--border-hover); }
.tab-pill--active, .tab-pill.active {
  background: var(--accent-blue-dim); color: var(--accent-blue); border-color: rgba(56,189,248,0.35);
}
.browse-toolbar {
  display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap;
}
.tab-panel { display: none; }
.tab-panel.tab-panel--active { display: block; }

/* Genre filter */
.genre-filter {
  display: flex; gap: 8px; padding: 0 var(--space-xl) var(--space-md);
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.genre-filter::-webkit-scrollbar { display: none; }
.genre-pill {
  flex-shrink: 0; padding: 8px 16px; border-radius: 999px;
  font-size: 0.82rem; font-weight: 500; color: var(--text-muted);
  background: var(--bg-card); border: 1px solid var(--border);
  transition: all .2s; min-height: 44px; display: inline-flex; align-items: center;
}
.genre-pill:hover { color: var(--text); border-color: var(--border-hover); }
.genre-pill.active { background: var(--accent-dim); color: var(--text); border-color: var(--border-hover); }

.genre-pill.active { background: var(--accent-blue-dim); color: var(--accent-blue); border-color: rgba(56,189,248,0.35); }

/* Media Row */
.media-row-section { position: relative; }
.media-row-wrap { position: relative; }
.media-row {
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; padding: 4px 0;
  align-items: flex-start;
}
.media-row::-webkit-scrollbar { display: none; }
.media-row-item {
  flex: 0 0 140px; width: 140px; min-width: 140px; max-width: 140px;
  scroll-snap-align: start;
}
.media-row-item .media-card,
.media-row-item .continue-card { width: 100%; max-width: 100%; }
.media-row-item .poster { width: 100%; }
.media-row-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(0,0,0,0.75); border: 1px solid var(--border);
  color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s; opacity: 0;
}
.media-row-wrap:hover .media-row-nav { opacity: 1; }
.media-row-nav--prev { left: -8px; }
.media-row-nav--next { right: -8px; }
.media-row-nav:hover { background: rgba(0,0,0,0.95); }

/* Feed cards (mobile) */
.feed-list { display: flex; flex-direction: column; gap: 20px; }
.feed-card { display: block; }
.feed-card-thumb {
  position: relative; aspect-ratio: 16/9; border-radius: var(--radius);
  overflow: hidden; background: var(--bg-card); border: 1px solid var(--border);
}
.feed-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.feed-card-placeholder {
  display: flex; align-items: center; justify-content: center; height: 100%;
  color: var(--text-muted); opacity: 0.5;
}
.feed-card-ep-badge {
  position: absolute; bottom: 8px; right: 8px;
  padding: 4px 10px; border-radius: var(--radius-sm);
  font-size: 0.72rem; font-weight: 700; background: rgba(0,0,0,0.85); color: var(--text);
}
.feed-card-meta { display: flex; gap: 12px; padding: 12px 4px 0; align-items: flex-start; }
.feed-card-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: var(--surface-elevated); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; color: var(--text-muted);
}
.feed-card-info { flex: 1; min-width: 0; }
.feed-card-info h3 {
  font-size: 0.9rem; font-weight: 600; line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.feed-card-info p { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }

.show-mobile-only { display: none; }
.hide-mobile { display: block; }

/* Media Grid */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.media-grid--browse { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.media-card {
  background: transparent; border-radius: var(--radius); overflow: hidden;
  transition: transform .2s; cursor: pointer; display: block;
}
.media-card:hover { transform: translateY(-4px); }
.media-card--compact .card-body { padding: 8px 2px 10px; }
.media-card .poster { aspect-ratio: 2/3; background: var(--bg-card); position: relative; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--border); transition: border-color .15s, box-shadow .2s; }
.media-card:hover .poster { border-color: var(--border-hover); box-shadow: 0 0 0 1px var(--accent-glow), 0 8px 24px rgba(0,0,0,0.4); }
.media-card .poster img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.media-card:hover .poster img { transform: scale(1.04); }
.media-card .poster .placeholder {
  display: flex; align-items: center; justify-content: center; height: 100%;
  color: var(--text-muted); opacity: 0.5;
}
.media-card .poster-overlay {
  position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 50%);
  opacity: 0; transition: opacity .2s; display: flex; align-items: center; justify-content: center;
}
.media-card:hover .poster-overlay { opacity: 1; }
.media-card .poster-overlay .play-circle {
  width: 44px; height: 44px; border-radius: 50%; background: var(--accent);
  display: flex; align-items: center; justify-content: center; color: #000;
}
.media-card .rating-badge {
  position: absolute; top: 8px; right: 8px; padding: 3px 8px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 600; background: rgba(0,0,0,0.8);
  backdrop-filter: blur(4px); display: inline-flex; align-items: center; gap: 3px;
}
.rating-badge--star { color: var(--star-yellow) !important; }
.lang-pills {
  position: absolute; bottom: 8px; left: 8px; display: flex; gap: 4px; flex-wrap: wrap;
}
.lang-pill {
  padding: 2px 8px; border-radius: 999px; font-size: 0.65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
  background: rgba(0,0,0,0.85); color: var(--accent-blue);
  border: 1px solid rgba(56,189,248,0.35);
}
.lang-pill--dub { color: #a78bfa; border-color: rgba(167,139,250,0.35); }
.lang-pill--unavailable {
  color: var(--text-muted) !important;
  border-color: var(--border) !important;
  opacity: 0.45;
}
.feed-lang--unavailable { color: var(--text-muted); opacity: 0.45; }
.browse-empty {
  padding: 48px var(--space-md);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.browse-empty a { color: var(--accent-blue); }
.browse-empty a:hover { color: var(--accent-blue-hover); }

/* Browse + schedule layout */
.page-banner--compact {
  padding: var(--space-lg) var(--space-xl) var(--space-sm);
  border-bottom: none;
}
.browse-sort-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 var(--space-xl) var(--space-md);
  max-width: 1600px;
  margin: 0 auto;
}
.browse-sort-pill {
  display: inline-flex;
  align-items: center;
  padding: 11px 22px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  transition: background .15s, color .15s, border-color .15s;
}
.browse-sort-pill:hover { color: var(--text); border-color: var(--border-hover); }
.browse-sort-pill.active {
  background: #fff;
  color: #000;
  border-color: #fff;
}
.browse-with-schedule {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: var(--space-lg);
  max-width: 1600px;
  margin: 0 auto;
  padding: var(--space-md) var(--space-xl) var(--space-xl);
  align-items: start;
}
.browse-main { min-width: 0; }
.media-grid--with-schedule {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}
.anime-card-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.airing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-green);
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(45,212,170,0.55);
}

/* Estimated schedule panel */
.schedule-panel {
  position: sticky;
  top: calc(var(--nav-height) + var(--space-md));
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  max-height: calc(100dvh - var(--nav-height) - var(--space-xl));
  display: flex;
  flex-direction: column;
}
.schedule-panel-header {
  padding: 14px var(--space-md) 10px;
  border-bottom: 1px solid var(--border);
}
.schedule-panel-header h2 {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.schedule-day-tabs-wrap {
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}
.schedule-day-tabs {
  display: flex;
  gap: 6px;
  padding: 10px var(--space-md);
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
  cursor: grab;
  -webkit-overflow-scrolling: touch;
  user-select: none;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
}
.schedule-day-tabs.is-dragging {
  cursor: grabbing;
}
.schedule-day-tabs.is-dragging .schedule-day-tab {
  pointer-events: none;
}
.schedule-day-tabs::-webkit-scrollbar { display: none; }
.schedule-day-tab {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 52px;
  padding: 8px 10px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, color .15s;
}
.schedule-day-tab:hover { color: var(--text); background: var(--bg-hover); }
.schedule-day-tab.schedule-day-tab--today:not(.active) {
  box-shadow: inset 0 0 0 1px var(--border);
}
.schedule-day-tab.active {
  background: #fff;
  color: #000;
}
.schedule-day-name {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.schedule-day-date {
  font-size: 0.68rem;
  font-weight: 500;
  opacity: 0.85;
}
.schedule-lists {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.schedule-list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  max-height: min(520px, calc(100dvh - var(--nav-height) - 180px));
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.schedule-list::-webkit-scrollbar { width: 5px; }
.schedule-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.schedule-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px var(--space-md);
  color: inherit;
  transition: background .12s;
}
.schedule-item:hover { background: var(--bg-hover); }
.schedule-item--released .schedule-time,
.schedule-item--released .schedule-title {
  opacity: 0.55;
}
.schedule-item--released .schedule-ep {
  background: rgba(76, 175, 80, 0.15);
  border-color: rgba(76, 175, 80, 0.35);
  color: #7dd87d;
}
.schedule-time {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.schedule-title {
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.schedule-ep {
  flex-shrink: 0;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
}
.schedule-empty {
  padding: 28px var(--space-md);
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.media-card .type-badge {
  position: absolute; top: 8px; left: 8px; padding: 3px 8px; border-radius: 999px;
  font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(4px); color: var(--text-muted);
}
.media-card .card-body { padding: 10px 12px 12px; }
.media-card .card-body h3 { font-size: 0.85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-card .card-body .sub { font-size: 0.75rem; color: var(--text-muted); display: flex; justify-content: space-between; margin-top: 4px; }
.media-card .card-body .sub .rating { display: inline-flex; align-items: center; gap: 3px; }

/* Continue Watching card menu */
.continue-card { position: relative; display: flex; flex-direction: column; }
.continue-card .media-card-link { flex: 1; }
.continue-card .card-body .sub { min-height: 1.1em; }
.continue-card-actions { position: absolute; top: 6px; right: 6px; z-index: 6; }
.continue-card-menu {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0; border: none; border-radius: 50%;
  background: rgba(0,0,0,0.6); color: #fff; cursor: pointer;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  opacity: 0; transition: color .15s, background .15s, opacity .15s;
}
.continue-card:hover .continue-card-menu,
.continue-card-actions.open .continue-card-menu { opacity: 1; }
.continue-card-menu:hover { background: rgba(0,0,0,0.85); }
@media (hover: none) { .continue-card-menu { opacity: 1; } }
.continue-card-dropdown {
  display: none; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  min-width: 120px; z-index: 20; margin-top: 4px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.continue-card-dropdown.continue-card-dropdown--fixed {
  position: fixed; transform: none; margin-top: 0; z-index: 250;
}
.continue-card-actions.open .continue-card-dropdown { display: block; }
.continue-card-dropdown-item {
  display: block; width: 100%; padding: 10px 14px; border: none; background: transparent;
  color: var(--text); font-size: 0.8125rem; font-weight: 500; text-align: left;
  cursor: pointer; transition: background .15s;
}
.continue-card-dropdown-item:hover { background: var(--bg-hover); }
.continue-card-dropdown-item + .continue-card-dropdown-item { border-top: 1px solid var(--border); }
.continue-progress {
  position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: rgba(255,255,255,0.2);
}
.continue-progress-fill {
  height: 100%; background: var(--accent, #e50914);
  transition: width 0.3s ease;
}
.continue-card .poster { position: relative; }
.continue-watching-row .media-row-item {
  flex: 0 0 140px; width: 140px; min-width: 140px; max-width: 140px;
}

/* Bottom nav */
.bottom-nav {
  display: none;
  position: fixed;
  top: auto;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 300;
  height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
  padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: rgba(0,0,0,0.95);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--border);
  border-bottom: none;
  justify-content: space-around;
  align-items: center;
  box-sizing: border-box;
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 4px; min-width: 0; flex: 1; max-width: 72px;
  min-height: 44px; font-size: 0.6rem; font-weight: 500; color: var(--text-muted);
  transition: color .15s;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.bottom-nav a svg { opacity: 0.65; transition: opacity .15s; }
/* Hover only where hover really exists — no sticky blue taps on touch. */
@media (hover: hover) and (pointer: fine) {
  .bottom-nav a:hover { color: var(--text); }
  .bottom-nav a:hover svg { opacity: 1; }
}
.bottom-nav a.active { color: var(--text); }
.bottom-nav a.active svg { opacity: 1; }
/* Active tab indicator bar. */
.bottom-nav a.active::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 3px;
  border-radius: 999px;
  background: var(--text);
  pointer-events: none;
}

/* Page header banner */
.page-banner {
  padding: var(--space-lg) var(--space-xl) var(--space-md);
  border-bottom: 1px solid var(--border);
}
.page-banner h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
.page-banner p { font-size: 0.85rem; color: var(--text-muted); margin-top: 6px; }

/* Detail Page */
.detail-page { min-height: 100vh; }
.detail-header {
  position: relative; padding: var(--space-xl); display: flex; gap: var(--space-xl);
  min-height: 500px; align-items: flex-end;
}
.detail-header .bg {
  position: absolute; inset: 0; z-index: 0;
}
.detail-header .bg img { width: 100%; height: 100%; object-fit: cover; }
.detail-header .bg::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, var(--bg) 0%, rgba(0,0,0,0.6) 55%, transparent 100%);
}
.detail-header .poster-col { flex-shrink: 0; width: 260px; position: relative; z-index: 1; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.detail-header .poster-col img { aspect-ratio: 2/3; object-fit: cover; width: 100%; }
.detail-header .poster-col .placeholder {
  aspect-ratio: 2/3; background: var(--bg-hover); display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); opacity: 0.5;
}
.detail-header .info-col { position: relative; z-index: 1; flex: 1; padding-bottom: 16px; }
.detail-header .info-col h1 { font-size: 2.4rem; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }
.detail-header .info-col .tagline { font-size: 1rem; color: var(--text-muted); font-style: italic; margin: 6px 0 12px; }
.detail-header .info-col .meta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 16px; }
.detail-header .info-col .meta-row .badge { padding: 2px 10px; border-radius: 999px; background: var(--bg-card); border: 1px solid var(--border); font-size: 0.8rem; }
.detail-header .info-col .meta-row .rating { display: inline-flex; align-items: center; gap: 4px; }
.detail-header .info-col .genres { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.detail-header .info-col .genres a, .detail-header .info-col .genres span {
  padding: 4px 14px; border-radius: var(--radius-sm); background: var(--accent-dim);
  color: var(--text); font-size: 0.8rem; font-weight: 500; transition: background .15s;
  border: 1px solid var(--border);
}
.detail-header .info-col .genres a:hover { background: rgba(255,255,255,0.14); }
.detail-header .overview { font-size: 0.95rem; color: var(--text-muted); line-height: 1.7; max-width: 640px; }

.detail-body { padding: var(--space-xl); }
.cast-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.cast-card { background: var(--bg-card); border-radius: var(--radius-sm); overflow: hidden; text-align: center; }
.cast-card .avatar { width: 100%; aspect-ratio: 1; background: var(--bg-hover); overflow: hidden; }
.cast-card .avatar img { width: 100%; height: 100%; object-fit: cover; }
.cast-card .avatar .placeholder { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--text-muted); opacity: 0.5; }
.cast-card .info { padding: 8px 6px 10px; }
.cast-card .info strong { font-size: 0.78rem; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cast-card .info span { font-size: 0.7rem; color: var(--text-muted); }

/* Seasons */
.seasons-grid { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.season-card { background: var(--bg-card); border-radius: var(--radius-sm); padding: 14px 18px; border: 1px solid var(--border); cursor: pointer; transition: all .2s; min-width: 140px; display: block; }
.season-card:hover { border-color: var(--border-hover); background: var(--bg-hover); }
.season-card.active { border-color: var(--text-muted); background: var(--accent-dim); }
.season-card h4 { font-size: 0.85rem; }
.season-card span { font-size: 0.75rem; color: var(--text-muted); }

/* Episodes */
.episode-list { display: flex; flex-direction: column; gap: 8px; }
.episode-item { display: flex; gap: 14px; background: var(--bg-card); border-radius: var(--radius-sm); padding: 12px; border: 1px solid transparent; transition: all .2s; cursor: pointer; position: relative; }
.episode-item:hover { border-color: var(--border); background: var(--bg-hover); }
.episode-item .thumb { width: 160px; flex-shrink: 0; border-radius: 4px; overflow: hidden; background: var(--bg-hover); aspect-ratio: 16/9; position: relative; }
.episode-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.episode-item .thumb .ep-play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.4); opacity: 0; transition: opacity .2s;
}
.episode-item:hover .thumb .ep-play { opacity: 1; }
.episode-item .thumb .ep-play span {
  width: 36px; height: 36px; border-radius: 50%; background: var(--accent);
  display: flex; align-items: center; justify-content: center; color: #000;
}
.episode-item .ep-info { flex: 1; }
.episode-item .ep-info .ep-title { font-weight: 600; font-size: 0.9rem; }
.episode-item .ep-info .ep-meta { font-size: 0.78rem; color: var(--text-muted); margin: 2px 0 6px; }
.episode-item .ep-info .ep-overview { font-size: 0.82rem; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Watch Page */
.watch-page,
.live-watch-page {
  min-height: calc(100dvh - var(--nav-height));
  background: #000;
  padding: var(--space-md) var(--space-lg) var(--space-xl);
  box-sizing: border-box;
}
.watch-back-bar {
  display: flex; align-items: center; gap: 12px;
  max-width: var(--player-float-width);
  margin: 0 auto var(--space-sm);
  padding: 4px 0;
  background: transparent;
  border: none;
}
.watch-back-bar a {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.85rem; color: var(--text-muted); transition: color .2s;
  min-height: 44px;
}
.watch-back-bar a:hover { color: var(--text); }

/* Floating vertical player shell */
.player-float {
  width: 100%;
  max-width: var(--player-float-width);
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-glow);
  overflow: hidden;
}
.player-float-header {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px var(--space-md);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
.player-float-header .live-embed-label {
  flex: 1; min-width: 0;
  font-size: 0.8125rem; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.player-float .watch-container {
  position: relative; width: 100%; max-width: none;
  margin: 0; padding: 0;
}
.player-float .watch-player {
  width: 100%; aspect-ratio: 16 / 8.75;
  background: #000; border: none; border-radius: 0; overflow: hidden;
}
.player-float .watch-player .empty-state { height: 100%; min-height: 180px; padding: 24px; }
.player-float .watch-player iframe { width: 100%; height: 100%; border: none; }

.player-float .live-player-wrap {
  position: relative; width: 100%; max-width: none;
  padding-top: 0; aspect-ratio: 16 / 8.75;
  background: #000; border: none; border-radius: 0;
}
.player-float .live-player-wrap .live-embed-frame {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  border: none; background: #000;
}

.player-float .source-selector {
  display: flex; gap: 4px; padding: 10px var(--space-md); flex-wrap: wrap;
  background: var(--bg-card);
  border: none; border-top: 1px solid var(--border);
  max-width: none; width: 100%; margin: 0;
  border-radius: 0;
}
.player-float .watch-ep-nav {
  background: var(--bg-card);
  border: none; border-top: 1px solid var(--border);
}
.player-float .watch-ep-toolbar { padding: 10px var(--space-md); }
.player-float .watch-ep-strip { padding: 0 var(--space-md) var(--space-md); }
.player-float .watch-info {
  padding: var(--space-md);
  border-top: 1px solid var(--border);
}
.player-float .watch-info h2 { font-size: 1rem; margin-bottom: 4px; }
.player-float .watch-info p { font-size: 0.85rem; }
.player-float .live-watch-info {
  max-width: none; width: 100%;
  padding: var(--space-md);
  border-top: 1px solid var(--border);
}

.watch-container {
  position: relative; width: 100%; max-width: var(--player-float-width);
  margin: 0 auto; padding: var(--space-md) var(--space-lg) 0;
  box-sizing: border-box;
}
.watch-player {
  width: 100%; aspect-ratio: 16/9;
  background: #000; border-radius: var(--radius-sm);
  overflow: hidden; border: 1px solid var(--border);
}
.watch-player .empty-state { height: 100%; min-height: 200px; padding: 32px; }
.watch-player iframe { width: 100%; height: 100%; border: none; }
.watch-page .source-selector {
  max-width: var(--player-float-width);
  margin: 0 auto;
  width: 100%;
  padding-left: var(--space-lg);
  padding-right: var(--space-lg);
  box-sizing: border-box;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  border: 1px solid var(--border);
  border-top: none;
  margin-top: -1px;
}
.source-selector {
  display: flex; gap: 4px; padding: 12px var(--space-xl); flex-wrap: wrap;
  background: var(--bg-card); border-bottom: 1px solid var(--border);
}
.source-btn {
  padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: transparent; color: var(--text); font-size: 0.82rem; cursor: pointer;
  transition: all .2s; font-family: inherit; min-height: 44px;
}
.source-btn:hover { border-color: var(--border-hover); color: var(--text); background: var(--accent-dim); }
.source-btn.active { background: var(--accent); border-color: var(--accent); color: #000; font-weight: 600; }

/* Watch episode navigation */
.watch-ep-nav {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
.watch-ep-toolbar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px var(--space-xl);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.watch-ep-title {
  flex: 1; min-width: 0;
  font-size: 0.92rem; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.watch-ep-title span {
  color: var(--text-muted); font-weight: 400; font-size: 0.85rem; margin-left: 8px;
}
.watch-season-select {
  appearance: none;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 32px 8px 12px;
  min-height: 44px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23666666' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  min-width: 150px; max-width: 200px;
  transition: border-color .2s;
}
.watch-season-select:hover, .watch-season-select:focus {
  border-color: var(--border-hover); outline: none;
}
.watch-ep-nav-btn {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.82rem; color: var(--text-muted); font-family: inherit;
  padding: 8px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: transparent;
  min-height: 44px; cursor: pointer; transition: all .2s; white-space: nowrap;
  text-decoration: none;
}
.watch-ep-nav-btn:hover { color: var(--text); border-color: var(--border-hover); }
.watch-ep-nav-btn.disabled { opacity: 0.35; pointer-events: none; }

/* Thumbnail strip */
.watch-ep-strip {
  display: flex; gap: 10px;
  padding: var(--space-md) var(--space-xl);
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  scroll-behavior: smooth;
}
.watch-ep-strip::-webkit-scrollbar { height: 5px; }
.watch-ep-strip::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.watch-ep-card {
  flex-shrink: 0; width: 200px;
  border-radius: var(--radius-sm); overflow: hidden;
  border: 2px solid transparent; transition: all .2s;
  background: var(--bg-hover); display: block;
}
.watch-ep-card:hover { border-color: rgba(255,255,255,0.2); transform: translateY(-2px); }
.watch-ep-card.active { border-color: var(--text); }
.watch-ep-thumb {
  width: 100%; aspect-ratio: 16/9;
  background: var(--bg); position: relative; overflow: hidden;
}
.watch-ep-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.watch-ep-thumb-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: var(--bg); color: var(--text-muted); font-size: 0.72rem; opacity: 0.5;
}
.watch-ep-thumb-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.5); opacity: 0; transition: opacity .2s;
}
.watch-ep-card:hover .watch-ep-thumb-overlay,
.watch-ep-card.active .watch-ep-thumb-overlay { opacity: 1; }
.watch-ep-thumb-play {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); display: flex; align-items: center; justify-content: center;
  color: #000;
}
.watch-ep-card.active .watch-ep-thumb-play { background: var(--text); color: #000; }
.watch-ep-card-body { padding: 8px 10px 10px; }
.watch-ep-card-num {
  font-size: 0.7rem; color: var(--text-muted); font-weight: 500; margin-bottom: 2px;
}
.watch-ep-card.active .watch-ep-card-num { color: var(--text); }
.watch-ep-card-name {
  font-size: 0.82rem; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  display: block;
}
.watch-ep-card-meta { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }

.watch-info { padding: var(--space-lg) var(--space-xl); }
.watch-info h2 { font-size: 1.4rem; margin-bottom: 4px; letter-spacing: -0.01em; }
.watch-info p { color: var(--text-muted); font-size: 0.9rem; }

/* Live embed */
.live-page { padding-bottom: var(--space-xl); }
.live-page-header {
  padding: var(--space-lg) var(--space-xl) var(--space-md);
  border-bottom: 1px solid var(--border);
}
.live-page-title { display: flex; align-items: center; gap: 10px; }
.live-page-title h1 { font-size: inherit; font-weight: inherit; letter-spacing: inherit; margin: 0; }

.live-stream-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.live-stream-card {
  display: block; border-radius: var(--radius);
  background: var(--bg-card); border: 1px solid var(--border);
  overflow: hidden; transition: border-color .15s, transform .2s;
}
.live-stream-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.live-stream-poster {
  position: relative; aspect-ratio: 16/9; background: var(--bg-hover); overflow: hidden;
}
.live-stream-poster img { width: 100%; height: 100%; object-fit: cover; }
.live-stream-poster-placeholder {
  display: flex; align-items: center; justify-content: center; height: 100%;
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted);
}
.live-status-badge {
  position: absolute; top: 8px; left: 8px; padding: 3px 8px; border-radius: 999px;
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  background: rgba(0,0,0,0.8); backdrop-filter: blur(4px);
}
.live-status-badge.live { color: var(--live-red); }
.live-status-badge.upcoming { color: var(--text-muted); }
.live-viewers {
  position: absolute; bottom: 8px; right: 8px; padding: 3px 8px; border-radius: 999px;
  font-size: 0.68rem; font-weight: 600; background: rgba(0,0,0,0.8); color: var(--text-muted);
}
.live-stream-body { padding: 12px 14px 14px; }
.live-stream-body h3 {
  font-size: 0.875rem; font-weight: 600; line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.live-stream-league { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.live-stream-meta { font-size: 0.72rem; color: var(--text-muted); margin-top: 6px; }

.live-watch-page {
  display: flex; flex-direction: column;
  background: #000;
}
.live-back-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.8125rem; color: var(--text-muted); margin-right: 8px;
  transition: color .15s;
}
.live-back-link:hover { color: var(--text); }

.live-embed-page {
  display: flex; flex-direction: column;
  height: calc(100dvh - var(--nav-height));
  background: #000;
}
.live-embed-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px var(--space-xl);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.live-embed-label {
  font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.02em;
}
.live-embed-frame {
  flex: 1; width: 100%; border: none; background: #000;
}

/* Pagination */
.pagination {
  display: flex; justify-content: center; align-items: center; gap: 16px;
  padding: 0 var(--space-xl) var(--space-xl); flex-wrap: wrap;
}
.pagination-info { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }
.pagination-btn { min-width: 120px; justify-content: center; }
.pagination-btn-disabled { opacity: 0.35; pointer-events: none; }

/* Empty state */
.empty-state {
  text-align: center; padding: 64px var(--space-xl);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.empty-state-icon {
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--bg-card); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); margin-bottom: 8px;
}
.empty-state h3 { font-size: 1.25rem; font-weight: 700; }
.empty-state p { color: var(--text-muted); font-size: 0.9rem; max-width: 400px; }
.empty-state .btn { margin-top: 8px; }

/* Footer */
footer { text-align: center; padding: var(--space-lg) max(var(--space-lg), env(safe-area-inset-right)) calc(var(--space-lg) + env(safe-area-inset-bottom)) max(var(--space-lg), env(safe-area-inset-left)); color: var(--text-muted); font-size: 0.75rem; border-top: 1px solid var(--border); margin-top: 48px; letter-spacing: 0.02em; }

/* Touch devices: show play affordances without hover */
@media (hover: none) {
  .media-card .poster-overlay {
    opacity: 1;
    background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, transparent 55%);
  }
  .media-card .poster-overlay .play-circle { width: 40px; height: 40px; }
  .episode-item .thumb .ep-play { opacity: 1; }
  .watch-ep-card .watch-ep-thumb-overlay { opacity: 0.75; }
  .watch-ep-card.active .watch-ep-thumb-overlay { opacity: 1; }
  .media-card:hover { transform: none; }
  .live-stream-card:hover { transform: none; }
}

/* Responsive */
@media (max-width: 1024px) {
  .hero { height: 440px; }
  .hero-carousel { height: 440px; }
  .hero-carousel--bleed { height: min(68vh, 560px); }
  .hero-content h1, .hero-slide .hero-content h1 { font-size: 2.4rem; }
  .media-grid, .media-grid--browse { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .media-grid--with-schedule { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .browse-with-schedule { grid-template-columns: minmax(0, 1fr) 300px; }
  .media-row-nav { display: none; }
}
@media (max-width: 1200px) {
  .media-grid--with-schedule { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .browse-with-schedule { grid-template-columns: minmax(0, 1fr) 280px; }
}
@media (max-width: 768px) {
  body.has-bottom-nav .bottom-nav { display: flex; }
  nav.top-nav { padding: 0 max(var(--space-md), env(safe-area-inset-right)) 0 max(var(--space-md), env(safe-area-inset-left)); }
  .nav-toggle { display: none !important; }
  .nav-overlay { display: none !important; }
  nav.top-nav .nav-links { display: none !important; }
  nav.top-nav .logo { flex-shrink: 1; min-width: 0; font-size: 1rem; }
  .nav-actions { flex: 0 0 auto; max-width: none; width: auto; }
  .search-form--page { padding: var(--space-md); }

  .hero { height: min(72vh, 420px); padding: 0; }
  .hero-carousel { height: min(72vh, 420px); padding: 0; }
  .hero-carousel--bleed { height: min(70vh, 480px); }
  .hero-slide { padding: 0; align-items: flex-end; justify-content: center; }
  .hero-slide .hero-content { text-align: center; max-width: 100%; display: flex; flex-direction: column; align-items: center; padding: 0 var(--space-md) 64px; }
  .hero-slide .hero-content .hero-pills { justify-content: center; }
  .hero-slide .hero-content .overview { text-align: center; max-width: 100%; }
  .hero-slide .hero-content .hero-buttons { width: 100%; justify-content: center; }
  .hero-footer { left: 50%; right: auto; transform: translateX(-50%); bottom: 16px; }
  .hero-nav-group { display: none; }
  .hero-bg img { object-position: center 20%; }
  .hero-content h1, .hero-slide .hero-content h1 { font-size: 1.75rem; }
  .hero-content .overview, .hero-slide .hero-content .overview { -webkit-line-clamp: 2; margin-bottom: 16px; }
  .hero-buttons .btn, .hero-slide .hero-content .hero-buttons .btn { flex: 1; justify-content: center; min-width: 0; max-width: 160px; }

  .show-mobile-only { display: block; }
  .hide-mobile { display: none !important; }
  .browse-sort-bar { padding: 0 var(--space-md) var(--space-md); }
  .show-mobile-only .schedule-panel {
    margin: 0 var(--space-md) var(--space-md);
    position: static;
    max-height: none;
  }
  .show-mobile-only .schedule-list { max-height: 300px; }
  .media-row-item {
    flex: 0 0 120px; width: 120px; min-width: 120px; max-width: 120px;
  }
  .continue-watching-row .media-row-item {
    flex: 0 0 120px; width: 120px; min-width: 120px; max-width: 120px;
  }

  .section { padding: var(--space-md); }
  .section-header { flex-wrap: wrap; gap: 8px; }
  .section-header h2 { font-size: 1rem; }
  .genre-filter { padding: 0 var(--space-md) var(--space-md); }
  .media-grid { grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); gap: 10px; }
  .media-card .card-body { padding: 8px 4px 10px; }
  .media-card .card-body h3 { font-size: 0.8125rem; }

  .detail-header {
    flex-direction: column; align-items: center;
    padding: var(--space-md); min-height: auto; padding-top: var(--space-lg);
  }
  .detail-header .poster-col { width: 160px; }
  .detail-header .info-col h1 { font-size: 1.5rem; text-align: center; }
  .detail-header .info-col .meta-row, .detail-header .info-col .genres { justify-content: center; }
  .detail-header .overview { text-align: center; font-size: 0.875rem; }
  .detail-body { padding: var(--space-md); }
  .episode-item { flex-direction: column; gap: 10px; padding: 10px; }
  .episode-item .thumb { width: 100%; }
  .episode-item .ep-info .ep-overview { -webkit-line-clamp: 3; }

  .live-page-header { padding: var(--space-md); }
  .live-stream-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }

  .watch-page, .live-watch-page {
    padding: 0 0 env(safe-area-inset-bottom);
    min-height: calc(100dvh - var(--nav-height));
  }
  .watch-back-bar {
    max-width: none; margin: 0; padding: 4px var(--space-md);
  }
  .player-float {
    max-width: none; margin: 0;
    border: none; border-radius: 0; box-shadow: none;
  }
  .player-float-header {
    padding: 10px var(--space-md); gap: 6px;
  }
  .player-float .source-selector {
    padding: 8px var(--space-md); gap: 6px;
  }
  .source-btn { padding: 10px 14px; font-size: 0.78rem; flex: 1 1 auto; justify-content: center; min-width: 0; }
  .watch-ep-toolbar {
    padding: 12px var(--space-md); gap: 10px; align-items: stretch;
  }
  .watch-ep-title {
    flex-basis: 100%; white-space: normal; overflow: visible; text-overflow: unset;
    font-size: 0.875rem; line-height: 1.35;
  }
  .watch-ep-title span {
    display: block; margin-left: 0; margin-top: 4px; font-size: 0.8125rem;
  }
  .watch-season-select { flex: 1; min-width: 0; max-width: none; }
  .watch-ep-nav-btn { flex: 1; justify-content: center; }
  .watch-ep-strip {
    padding: var(--space-sm) var(--space-md) var(--space-md);
    gap: 8px; scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .watch-ep-card {
    width: 160px; scroll-snap-align: start;
  }
  .player-float .watch-info,
  .watch-info { padding: var(--space-md); }
  .watch-info h2 { font-size: 1.125rem; }

  .live-embed-bar { padding: 10px var(--space-md); flex-wrap: wrap; }
  .live-embed-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .pagination { gap: 10px; padding: 0 var(--space-md) var(--space-md); }
  .pagination-btn { min-width: auto; padding: 10px 16px; flex: 1; max-width: 140px; }

  .empty-state { padding: 48px var(--space-md); }
  .ad-inline-wrap, .ad-footer-wrap { padding-left: var(--space-md); padding-right: var(--space-md); }

  .share-popup { padding: var(--space-md); align-items: flex-end; }
  .share-popup-panel {
    max-width: none; border-bottom-left-radius: 0; border-bottom-right-radius: 0;
    padding-bottom: calc(var(--space-lg) + env(safe-area-inset-bottom));
  }
}
@media (max-width: 480px) {
  .hero { height: min(68vh, 360px); }
  .hero-content h1 { font-size: 1.5rem; }
  .media-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .detail-header .poster-col { width: 140px; }
  .detail-header .info-col h1 { font-size: 1.35rem; }
  .cast-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
  .seasons-grid { gap: 8px; }
  .season-card { min-width: 0; flex: 1 1 calc(50% - 4px); padding: 12px 14px; }
  .watch-ep-card { width: 140px; }
  .live-stream-grid { grid-template-columns: 1fr; }
  nav.top-nav .logo { font-size: 1rem; }
}

/* ============================================================
   HiAnime-style anime watch redesign
   ============================================================ */
.anime-watch,
.watch-shell { background: var(--bg); min-height: calc(100dvh - var(--nav-height)); }

.watch-breadcrumb {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  max-width: 1600px; margin: 0 auto;
  padding: var(--space-md) var(--space-lg) 0;
  font-size: 0.8rem; color: var(--text-muted);
}
.watch-breadcrumb a { color: var(--text-muted); transition: color .15s; }
.watch-breadcrumb a:hover { color: var(--accent-blue); }
.watch-breadcrumb .sep { opacity: 0.45; }
.watch-breadcrumb .current { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 280px; }

.watch-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: var(--space-lg);
  max-width: 1600px;
  margin: 0 auto;
  padding: var(--space-md) var(--space-lg) var(--space-xl);
  align-items: start;
}
.watch-main { min-width: 0; }
.watch-sidebar { min-width: 0; display: flex; flex-direction: column; gap: var(--space-lg); }

.anime-watch .watch-player,
.watch-shell .watch-player {
  width: 100%; aspect-ratio: 16/9; max-width: none;
  background: #000; border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--border);
}
.anime-watch .watch-player .empty-state,
.watch-shell .watch-player .empty-state { height: 100%; min-height: 200px; padding: 32px; }
.anime-watch .watch-player iframe,
.watch-shell .watch-player iframe { width: 100%; height: 100%; border: none; }

.anime-watch .source-selector,
.watch-shell .source-selector {
  display: flex; gap: 6px; flex-wrap: wrap;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); margin-top: var(--space-sm);
  padding: 10px var(--space-md); max-width: none; width: auto;
}

/* Action bar */
.watch-action-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin-top: var(--space-sm);
  padding: 10px var(--space-md);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.watch-action-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; min-height: 40px;
  border-radius: 999px; border: 1px solid var(--border);
  background: var(--bg-hover); color: var(--text);
  font-size: 0.8rem; font-weight: 500; font-family: inherit;
  cursor: pointer; transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap; text-decoration: none;
}
.watch-action-btn:hover { border-color: var(--border-hover); background: var(--surface-elevated); }
.watch-action-btn--lang.active { background: var(--accent-blue-dim); border-color: rgba(56,189,248,0.35); color: var(--accent-blue); }
.watch-action-btn--unavailable,
.watch-action-btn:disabled {
  color: var(--text-muted);
  border-color: var(--border);
  opacity: 0.45;
  cursor: not-allowed;
}
.watch-action-btn--unavailable:hover,
.watch-action-btn:disabled:hover {
  background: var(--bg-hover);
  border-color: var(--border);
}
.watch-action-spacer { flex: 1 1 0; min-width: 0; }

/* Stats row */
.watch-stats-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin-top: var(--space-md);
  font-size: 0.82rem; color: var(--text-muted);
}
.watch-stats-row .dot { opacity: 0.5; }
.watch-trending-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 999px;
  background: var(--accent-blue-dim); color: var(--accent-blue);
  font-weight: 600; font-size: 0.72rem;
}
.anime-watch .watch-info,
.watch-shell .watch-info { padding: var(--space-md) 0 0; border: none; }
.anime-watch .watch-info h2,
.watch-shell .watch-info h2 { font-size: 1.3rem; margin-bottom: 6px; letter-spacing: -0.01em; }
.anime-watch .watch-info .watch-info-sub,
.watch-shell .watch-info .watch-info-sub { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0; }
.anime-watch .watch-info p,
.watch-shell .watch-info p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.7; }

/* Episode sidebar panel */
.ep-sidebar-panel {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
}
.ep-sidebar-header {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 14px var(--space-md);
  border-bottom: 1px solid var(--border);
}
.ep-sidebar-heading { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ep-sidebar-header h3 {
  font-size: 0.92rem; font-weight: 600; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ep-sidebar-subtitle {
  font-size: 0.72rem; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ep-sidebar-collapse {
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--bg-hover); border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer; transition: color .15s, border-color .15s, transform .2s;
}
.ep-sidebar-collapse:hover { color: var(--text); border-color: var(--border-hover); }
.ep-sidebar-collapse svg { transform: rotate(180deg); transition: transform .2s; }
.ep-sidebar-panel.collapsed .ep-sidebar-collapse svg { transform: rotate(0deg); }
.ep-sidebar-panel.collapsed .ep-sidebar-toolbar,
.ep-sidebar-panel.collapsed .ep-sidebar-list,
.ep-sidebar-panel.collapsed .next-ep-banner { display: none; }

.ep-sidebar-toolbar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px var(--space-md);
  border-bottom: 1px solid var(--border);
}
.ep-sidebar-search { flex: 1; min-width: 0; }
.ep-sidebar-controls { display: flex; gap: 6px; flex-shrink: 0; }
.ep-control-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  background: var(--bg-hover); border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer; transition: color .15s, border-color .15s, background .15s;
}
.ep-control-btn:hover { color: var(--text); border-color: var(--border-hover); }
.ep-control-btn.active { color: var(--accent-blue); border-color: rgba(56,189,248,0.35); background: var(--accent-blue-dim); }
.ep-sidebar-search input {
  width: 100%; height: 38px; padding: 0 12px;
  background: var(--bg-hover); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: 0.82rem; font-family: inherit; outline: none;
  transition: border-color .15s;
}
.ep-sidebar-search input:focus { border-color: var(--border-hover); }
.ep-sidebar-search input::placeholder { color: #777; }
.ep-sidebar-list {
  display: flex; flex-direction: column;
  max-height: 540px; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.ep-sidebar-list::-webkit-scrollbar { width: 6px; }
.ep-sidebar-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.ep-sidebar-item {
  display: flex; gap: 10px; align-items: center;
  padding: 8px var(--space-md);
  border-left: 3px solid transparent;
  transition: background .15s, border-color .15s;
  cursor: pointer;
}
.ep-sidebar-item + .ep-sidebar-item { border-top: 1px solid var(--border); }
.ep-sidebar-item:hover { background: var(--bg-hover); }
.ep-sidebar-item.active {
  background: var(--accent-green-dim);
  border-left-color: var(--accent-green);
}
.ep-sidebar-item.hidden { display: none; }
.ep-sidebar-thumb {
  position: relative; flex-shrink: 0;
  width: 104px; aspect-ratio: 16/9;
  border-radius: var(--radius-sm); overflow: hidden;
  background: var(--bg-hover);
}
.ep-sidebar-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ep-sidebar-thumb-placeholder {
  display: flex; align-items: center; justify-content: center;
  height: 100%; font-size: 0.7rem; color: var(--text-muted); opacity: 0.6;
}
.ep-sidebar-thumb-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.45); opacity: 0; transition: opacity .15s; color: #fff;
}
.ep-sidebar-item:hover .ep-sidebar-thumb-overlay,
.ep-sidebar-item.active .ep-sidebar-thumb-overlay { opacity: 1; }
.ep-sidebar-num {
  position: absolute; bottom: 4px; left: 4px;
  padding: 1px 6px; border-radius: 4px;
  background: rgba(0,0,0,0.82); font-size: 0.66rem; font-weight: 700; color: #fff;
}
.ep-sidebar-info { flex: 1; min-width: 0; }
.ep-sidebar-title {
  font-size: 0.82rem; font-weight: 500; line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.ep-sidebar-item.active .ep-sidebar-title { color: var(--accent-green); }
.ep-sidebar-meta { font-size: 0.7rem; color: var(--text-muted); margin-top: 3px; }
.ep-sidebar-empty {
  padding: 24px var(--space-md); text-align: center;
  font-size: 0.82rem; color: var(--text-muted);
}

/* Next airing banner */
.next-ep-banner {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px var(--space-md);
  border-top: 1px solid var(--border);
  background: var(--accent-green-dim);
  color: var(--accent-green); font-size: 0.8rem; font-weight: 500;
}
.next-ep-banner svg { flex-shrink: 0; }

/* Related (More like this) */
.related-section > h3 { font-size: 1rem; font-weight: 600; margin-bottom: 12px; }
.related-list { display: flex; flex-direction: column; gap: 10px; }
.related-card {
  display: flex; gap: 10px; align-items: center;
  padding: 8px; border-radius: var(--radius-sm);
  background: var(--bg-card); border: 1px solid var(--border);
  transition: border-color .15s, background .15s;
}
.related-card:hover { border-color: var(--border-hover); background: var(--bg-hover); }
.related-card-poster {
  flex-shrink: 0; width: 54px; aspect-ratio: 2/3;
  border-radius: 6px; overflow: hidden; background: var(--bg-hover);
}
.related-card-poster img { width: 100%; height: 100%; object-fit: cover; }
.related-card-poster .placeholder {
  display: flex; align-items: center; justify-content: center;
  height: 100%; color: var(--text-muted); opacity: 0.5;
}
.related-card-info { flex: 1; min-width: 0; }
.related-badge {
  display: inline-block; font-size: 0.6rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--accent-blue); margin-bottom: 3px;
}
.related-card-title {
  font-size: 0.82rem; font-weight: 500; line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.related-card-meta {
  font-size: 0.66rem; color: var(--text-muted); margin-top: 4px;
  text-transform: uppercase; letter-spacing: 0.05em;
}

/* Compact (text-only) episode list */
.ep-sidebar-list.compact .ep-sidebar-thumb { display: none; }
.ep-sidebar-list.compact .ep-sidebar-item { padding-top: 10px; padding-bottom: 10px; }

/* Next airing banner accent */
.next-ep-when { font-weight: 700; }

/* Series identity block in the action bar */
.watch-identity { display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 260px; }
.watch-identity-avatar {
  flex-shrink: 0; width: 38px; height: 38px; border-radius: 50%;
  overflow: hidden; background: var(--bg-hover); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; color: var(--text-muted);
}
.watch-identity-avatar img { width: 100%; height: 100%; object-fit: cover; }
.watch-identity-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.watch-identity-name {
  font-size: 0.82rem; font-weight: 600; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.watch-identity-users {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.7rem; color: var(--text-muted);
}

/* Combined views / date / trending + description card */
.watch-meta-card {
  margin-top: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.watch-meta-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px;
  font-size: 0.82rem; color: var(--text-muted);
}
.watch-meta-views { color: var(--text); font-weight: 600; }
.watch-meta-date { color: var(--text-muted); }
.watch-score-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 999px;
  background: var(--bg-hover); color: var(--text); font-weight: 600; font-size: 0.72rem;
}
.watch-meta-desc { margin-top: 10px; color: var(--text-muted); font-size: 0.88rem; line-height: 1.7; }

/* Single-column variant (movies / no sidebar) */
.watch-layout--single { grid-template-columns: minmax(0, 980px); justify-content: center; }

@media (max-width: 1024px) {
  .watch-layout { grid-template-columns: 1fr; }
  .watch-layout--single { grid-template-columns: 1fr; }
  .ep-sidebar-list { max-height: 460px; }
}
@media (max-width: 768px) {
  .anime-watch { min-height: 0; }
  .watch-breadcrumb { padding: var(--space-sm) var(--space-md) 0; }
  .watch-layout { padding: var(--space-sm) var(--space-md) var(--space-xl); gap: var(--space-md); }
  .watch-action-bar, .anime-watch .source-selector { padding: 8px var(--space-sm); }
  .watch-action-btn { padding: 8px 12px; font-size: 0.78rem; }
  .watch-action-spacer { display: none; }
  .ep-sidebar-list { max-height: 420px; }
}

/* Global persistent player (survives soft in-site navigation) */
.vidmove-global-player {
  position: fixed; z-index: 1200;
  background: #000;
  overflow: hidden;
  display: flex; flex-direction: column;
}
.vidmove-global-player.is-hidden { display: none !important; }
.vidmove-global-player.is-inline {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: none;
}
.vidmove-global-player.is-inline .vidmove-global-overlay { display: none !important; }
.vidmove-global-player.is-inline .vidmove-global-frame { border-radius: var(--radius); }

/* Mini player — clean rounded video with floating corner controls */
.vidmove-global-player.is-mini {
  right: 20px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  width: min(340px, calc(100dvw - 40px));
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  background: #000;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow:
    0 20px 50px rgba(0,0,0,0.55),
    0 0 0 1px rgba(0,0,0,0.35);
  transition: box-shadow .2s ease;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}
body.mini-player-dragging {
  user-select: none !important;
  -webkit-user-select: none !important;
  cursor: grabbing !important;
}
body.mini-player-dragging * {
  user-select: none !important;
  -webkit-user-select: none !important;
}
.vidmove-global-player.is-mini.is-custom-pos {
  right: auto;
  bottom: auto;
}
.vidmove-global-player.is-mini:hover:not(.is-dragging) {
  box-shadow:
    0 24px 56px rgba(0,0,0,0.6),
    0 0 0 1px rgba(255,255,255,0.14);
}
.vidmove-global-player.is-mini.is-dragging {
  transition: none !important;
  cursor: grabbing;
  will-change: left, top;
  box-shadow:
    0 28px 60px rgba(0,0,0,0.65),
    0 0 0 1px rgba(255,255,255,0.16);
}
.vidmove-global-player.is-mini.is-dragging .vidmove-global-crop iframe {
  pointer-events: none;
}
.vidmove-global-player.is-mini.is-dragging .vidmove-global-overlay::before {
  opacity: 0 !important;
}
body.has-bottom-nav .vidmove-global-player.is-mini {
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}

.vidmove-global-frame {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  background: #000;
  overflow: hidden;
}
.vidmove-global-player.is-mini .vidmove-global-frame { border-radius: 14px; }

.vidmove-global-drag-zone {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 2;
  cursor: grab;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.vidmove-global-player.is-mini .vidmove-global-drag-zone { display: block; }
.vidmove-global-player.is-dragging .vidmove-global-drag-zone { cursor: grabbing; }

.vidmove-global-crop {
  position: relative; z-index: 1;
  width: 100%; height: 100%;
  overflow: hidden;
  background: #000;
}
.vidmove-global-crop iframe {
  width: 100%; height: 100%;
  border: none; display: block;
}

/* Floating corner controls (mini mode only) */
.vidmove-global-overlay { display: none; }
.vidmove-global-player.is-mini .vidmove-global-overlay {
  display: block;
  position: absolute; inset: 0; z-index: 3;
  pointer-events: none;
}
.vidmove-global-player.is-mini .vidmove-global-overlay::before {
  content: '';
  position: absolute; left: 0; right: 0; top: 0; height: 46px;
  background: linear-gradient(180deg, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0) 100%);
  opacity: 0; transition: opacity .18s ease;
  pointer-events: none;
}
.vidmove-global-player.is-mini:hover .vidmove-global-overlay::before,
.vidmove-global-player.is-mini:focus-within .vidmove-global-overlay::before { opacity: 1; }

.vidmove-global-icon {
  position: absolute; top: 8px;
  z-index: 5;
  pointer-events: auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0;
  border: none; border-radius: 50%;
  background: rgba(0,0,0,0.5);
  color: rgba(255,255,255,0.95);
  cursor: pointer;
  opacity: 0;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: opacity .18s ease, background .15s, transform .12s;
}
.vidmove-global-icon--expand { left: 8px; }
.vidmove-global-icon--close { right: 8px; }
.vidmove-global-player.is-mini:hover .vidmove-global-icon,
.vidmove-global-player.is-mini:focus-within .vidmove-global-icon { opacity: 1; }
.vidmove-global-icon:hover {
  background: rgba(0,0,0,0.78);
  transform: scale(1.08);
}
.vidmove-global-icon:active { transform: scale(0.95); }

.vidmove-global-title { display: none; }

.vidmove-global-player.is-inline .vidmove-global-frame { aspect-ratio: auto; }

.watch-player-slot { background: #000; min-height: 200px; aspect-ratio: 16/9; }
@media (max-width: 768px) {
  .vidmove-global-player.is-mini {
    right: 16px;
    width: min(280px, calc(100dvw - 32px));
    border-radius: 12px;
  }
  .vidmove-global-player.is-mini .vidmove-global-frame { border-radius: 12px; }
  .vidmove-global-player.is-mini .vidmove-global-icon { opacity: 1; }
}



/* Side rails (skyscraper-ish). Fixed in the viewport margins, vertically
   centered, low z-index so they never cover nav/player/popups. Gated by
   viewport width so they can't overlap content on smaller screens. */
.ad-rail {
  display: none;
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 160px;
  max-height: min(600px, calc(100dvh - 160px));
  overflow: hidden;
  z-index: 60;
}
.ad-rail--left { left: 12px; }
.ad-rail--right { right: 12px; }
/* Watch pages are narrow (player ~886px), so margins fit rails much sooner. */
@media (min-width: 1250px) {
  body.is-watch > .ad-rail { display: block; }
}
/* Full-width pages need very wide viewports before rails clear the content. */
@media (min-width: 1824px) {
  body > .ad-rail { display: block; }
}


/* Expanded banners: inline units may serve up to 970px billboards.
   Still strictly in-flow (no positioning), so they can never overlap
   the hero carousel or any other element — they push content instead. */
.ad-slot-inline iframe { max-width: 970px; }


/* Home rail layout: rails live in the content grid BELOW the hero (never over
   it) and stick while scrolling, ending where the content ends at the footer.
   Single column below the rail breakpoint; 3-column grid above it. */
.rail-layout { display: block; }
@media (min-width: 1824px) {
  .rail-layout {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr) 160px;
    column-gap: 24px;
    padding: 0 12px;
    align-items: start;
  }
  .rail-layout > .rail-layout-main { grid-column: 2; }
  .rail-layout > .ad-rail {
    display: block;
    position: sticky;
    top: calc(var(--nav-height) + 16px);
    transform: none;
    left: auto;
    right: auto;
    width: 160px;
    max-height: calc(100dvh - var(--nav-height) - 32px);
    overflow: hidden;
  }
}


/* Share toast (visible copy feedback for #action-share). */
.share-toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bottom-nav-height, 64px) + 24px);
  transform: translateX(-50%) translateY(8px);
  background: #161616;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: 999px;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  white-space: nowrap;
  max-width: calc(100vw - 32px);
  overflow: hidden;
  text-overflow: ellipsis;
}
.share-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}


/* Interactive chrome must never start text selection or long-press menus.
   An accidental selection eats the next tap (it just clears the selection),
   which feels exactly like "clicks stopped working". */
nav.top-nav,
nav.bottom-nav,
.bottom-nav a,
button,
.tab-pill,
.genre-pill,
.source-btn,
.watch-action-btn,
.media-row-nav,
.hero-nav-btn,
.hero-dot,
.ep-sidebar-collapse,
.watch-season-select {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}


/* Genre pills: grab affordance for mouse drag-scroll. While dragging,
   kill text selection so a scroll never becomes a highlight. */
.genre-filter { cursor: grab; }
.genre-filter.is-dragging { cursor: grabbing; }
.genre-filter.is-dragging,
.genre-filter.is-dragging a {
  -webkit-user-select: none;
  user-select: none;
}
