/* stream.reezli.vc – Netflix-inspiriertes Layout */
:root {
  --bg: #0a0a0a;
  --bg-elevated: #141414;
  --bg-card: #1f1f1f;
  --bg-glass: rgba(20, 20, 20, 0.85);
  --text: #ffffff;
  --text-muted: #a3a3a3;
  --accent: #e50914;
  --accent-hover: #f40612;
  --accent-glow: rgba(229, 9, 20, 0.35);
  --radius: 6px;
  --radius-lg: 10px;
  --nav-height: 56px;
  --tab-bar-height: 64px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --page-pad-x: max(4%, var(--safe-left));
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.6);
  --vh: 1vh;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(229, 9, 20, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(30, 30, 80, 0.08), transparent);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
  min-height: calc(var(--vh, 1vh) * 100);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

body.has-tab-bar {
  padding-bottom: calc(var(--tab-bar-height) + var(--safe-bottom));
}

/* iOS / PWA standalone */
.is-standalone .navbar {
  padding-top: var(--safe-top);
  height: calc(var(--nav-height) + var(--safe-top));
}

.is-standalone body.has-tab-bar {
  padding-bottom: calc(var(--tab-bar-height) + var(--safe-bottom));
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: calc(var(--nav-height) + var(--safe-top));
  display: flex;
  align-items: center;
  padding: var(--safe-top) max(4%, var(--safe-right)) 0 max(4%, var(--safe-left));
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.85) 0%, transparent 100%);
  transition: background var(--transition);
}

.navbar.scrolled,
body.is-searching .navbar {
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
}

.nav-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  width: 100%;
  min-height: var(--nav-height);
  gap: 1rem 1.5rem;
}

.nav-center {
  display: flex;
  justify-content: center;
  min-width: 0;
}

.nav-inner-watch {
  grid-template-columns: 1fr auto;
}

.nav-inner-watch .back-link {
  justify-self: end;
}

.logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(1.25rem, 4vw, 1.85rem);
  letter-spacing: 0.03em;
  color: #fff;
  flex-shrink: 0;
  white-space: nowrap;
}

.logo-stream {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1.25rem;
}

.nav-links a {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.5);
  transition: color var(--transition);
}

@media (min-width: 768px) {
  .nav-links a {
    font-size: 0.68rem;
  }
}

.nav-links a[data-nav-continue][hidden],
.mobile-tab-bar .tab-item[data-nav-continue][hidden] {
  display: none !important;
}

.nav-links a:hover,
.nav-links a.active,
.nav-dropdown-trigger.active {
  color: var(--text);
}

.nav-dropdown-item.active {
  background: rgba(229, 9, 20, 0.15);
}

.nav-dropdown-item.active strong {
  color: var(--accent);
}

/* Browse dropdown */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.5rem 0.25rem;
  -webkit-tap-highlight-color: transparent;
}

.nav-browse-pill.nav-dropdown-trigger {
  gap: 0.55rem;
  padding: 0.45rem 1rem;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  transition:
    color 0.3s ease,
    border-color 0.3s ease,
    background 0.3s ease,
    box-shadow 0.3s ease;
}

.nav-browse-pill.nav-dropdown-trigger:hover,
.nav-dropdown.open .nav-browse-pill.nav-dropdown-trigger,
.nav-browse-pill.nav-dropdown-trigger.active {
  color: var(--accent);
  border-color: rgba(229, 9, 20, 0.5);
  background: rgba(229, 9, 20, 0.08);
  box-shadow: 0 0 20px rgba(229, 9, 20, 0.15);
}

.nav-server-dot {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3b82f6;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.45);
}

.nav-dropdown.open-on-active .nav-browse-pill.nav-dropdown-trigger.active,
#serverDropdown .nav-dropdown-trigger.active {
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.45);
  background: rgba(59, 130, 246, 0.1);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.12);
}

#serverDropdown .nav-dropdown-trigger.server-gp-active {
  color: #c4b5fd;
  border-color: rgba(139, 92, 246, 0.45);
  background: rgba(139, 92, 246, 0.12);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.15);
}

#serverDropdown .nav-dropdown-trigger.server-gp-active .nav-server-dot {
  background: #8b5cf6;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.5);
}

.nav-dropdown-menu-compact {
  min-width: 240px;
}

.nav-dropdown-choice {
  width: 100%;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.nav-links .nav-dropdown + .nav-dropdown {
  margin-left: 0.15rem;
}

.nav-live-dot {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(229, 9, 20, 0.7);
  animation: livePulse 1.8s ease-in-out infinite;
}

@keyframes livePulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(229, 9, 20, 0.65);
  }
  50% {
    opacity: 0.55;
    transform: scale(0.88);
    box-shadow: 0 0 0 6px rgba(229, 9, 20, 0);
  }
}

.nav-dropdown-trigger:hover,
.nav-dropdown.open .nav-dropdown-trigger:not(.nav-browse-pill) {
  color: var(--text);
}

.nav-chevron {
  transition: transform 0.2s ease;
}

.nav-dropdown.open .nav-chevron {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.65rem);
  left: 0;
  min-width: 260px;
  padding: 0.5rem;
  background: rgba(24, 24, 24, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  z-index: 120;
}

.nav-dropdown.open .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown.open .nav-dropdown-item,
.nav-dropdown:hover .nav-dropdown-item {
  animation: dropdownItemIn 0.35s ease backwards;
}

.nav-dropdown.open .nav-dropdown-item:nth-child(1),
.nav-dropdown:hover .nav-dropdown-item:nth-child(1) { animation-delay: 0.03s; }
.nav-dropdown.open .nav-dropdown-item:nth-child(2),
.nav-dropdown:hover .nav-dropdown-item:nth-child(2) { animation-delay: 0.06s; }
.nav-dropdown.open .nav-dropdown-item:nth-child(3),
.nav-dropdown:hover .nav-dropdown-item:nth-child(3) { animation-delay: 0.09s; }
.nav-dropdown.open .nav-dropdown-item:nth-child(4),
.nav-dropdown:hover .nav-dropdown-item:nth-child(4) { animation-delay: 0.12s; }

@keyframes dropdownItemIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (hover: hover) {
  .nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .nav-dropdown:hover .nav-chevron {
    transform: rotate(180deg);
  }
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius);
  color: var(--text);
  transition: background 0.15s;
}

.nav-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.nav-dropdown-item strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
}

.nav-dropdown-item small {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.nav-dropdown-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  font-size: 0.95rem;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}

.nav-dropdown-icon i {
  line-height: 1;
}

.nav-dropdown-item.active .nav-dropdown-icon {
  background: rgba(229, 9, 20, 0.2);
}

.row-highlight {
  animation: rowPulse 1.2s ease;
}

@keyframes rowPulse {
  0% { background: rgba(229, 9, 20, 0.15); }
  100% { background: transparent; }
}

.nav-right {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-search-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.nav-search-toggle:active {
  background: rgba(255, 255, 255, 0.15);
}

.search-mobile-backdrop {
  display: none;
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 0.35rem 0.85rem 0.35rem 0.65rem;
  min-width: 200px;
  max-width: 320px;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.search-wrap:focus-within {
  border-color: rgba(229, 9, 20, 0.6);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: rgba(255, 255, 255, 0.1);
}

.search-icon {
  flex-shrink: 0;
  color: var(--text-muted);
}

.search-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.9rem;
  padding: 0.4rem 0.25rem;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  outline: none;
}

.search-clear {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-clear[hidden] {
  display: none !important;
}

.search-clear:hover {
  background: rgba(255, 255, 255, 0.25);
}

.btn-sm {
  padding: 0.5rem 1rem;
  min-height: 36px;
  font-size: 0.85rem;
}

/* Hero */
.hero {
  position: relative;
  z-index: 1;
  min-height: 85vh;
  min-height: calc(var(--vh, 1vh) * 85);
  display: flex;
  align-items: flex-end;
  padding: 0 var(--page-pad-x) 8%;
  padding-right: max(4%, var(--safe-right));
  margin-bottom: -7rem;
  isolation: isolate;
}

.hero-bg,
.hero-gradient,
.hero-vignette {
  pointer-events: none;
}

.hero-bg {
  position: absolute;
  inset: 0;
  bottom: -5rem;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  animation: heroKenBurns 22s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes heroKenBurns {
  from { transform: scale(1); }
  to { transform: scale(1.06); }
}

.hero-gradient {
  position: absolute;
  inset: 0;
  bottom: -5rem;
  z-index: 1;
  background: linear-gradient(
    77deg,
    rgba(10, 10, 10, 0.97) 0%,
    rgba(10, 10, 10, 0.5) 50%,
    transparent 100%
  ),
  linear-gradient(
    0deg,
    var(--bg) 0%,
    var(--bg) 12%,
    rgba(10, 10, 10, 0.92) 32%,
    rgba(10, 10, 10, 0.55) 52%,
    transparent 78%
  ),
  linear-gradient(180deg, rgba(10, 10, 10, 0.5) 0%, transparent 38%);
}

.hero-vignette {
  position: absolute;
  inset: 0;
  bottom: -5rem;
  z-index: 1;
  box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

/* Fade hero into catalog (sits above TOP 10 row title area) */
.hero::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -7rem;
  height: 11rem;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(10, 10, 10, 0.35) 28%,
    rgba(10, 10, 10, 0.88) 58%,
    var(--bg) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 4;
  pointer-events: auto;
  max-width: 640px;
  padding-top: calc(var(--nav-height) + 2rem);
  opacity: 0;
  transform: translateY(16px);
}

.hero-content.is-loaded {
  animation: heroFadeIn 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes heroFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #fff;
  background: var(--accent);
  padding: 0.35rem 0.65rem;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}

.hero-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  line-height: 1;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
}

.hero-title.has-title-logo,
.details-title.has-title-logo,
.watch-info h1.has-title-logo,
.modal-body h2.has-title-logo {
  text-shadow: none;
}

.title-logo {
  display: block;
  max-height: 3rem;
  width: auto;
  max-width: min(78vw, 420px);
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.8));
}

@media (min-width: 769px) {
  .title-logo {
    max-height: 7rem;
    max-width: min(520px, 90%);
  }

  .watch-info .title-logo {
    max-height: 3.25rem;
    max-width: min(420px, 90%);
  }
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
  color: #46d369;
  margin-bottom: 1.5rem;
}

.hero-meta span.muted {
  color: var(--text-muted);
}

.hero-meta .fa-star,
.modal-meta .fa-star {
  margin-right: 0.2rem;
  font-size: 0.8em;
  color: #f5c518;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  min-height: 44px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.15s, background var(--transition), opacity var(--transition);
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .btn:hover {
    transform: scale(1.03);
  }
}

.btn:active {
  transform: scale(0.97);
  opacity: 0.9;
}

.btn-primary {
  background: var(--text);
  color: #000;
}

.btn-primary:hover {
  background: rgba(255, 255, 255, 0.85);
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-primary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.btn-secondary {
  background: rgba(109, 109, 110, 0.7);
  color: var(--text);
}

.btn-secondary:hover {
  background: rgba(109, 109, 110, 0.5);
}

/* Rows */
.row-section {
  padding: 2rem 0 1rem;
  position: relative;
  z-index: 2;
  overflow: visible;
}

#continue-watching {
  position: relative;
  z-index: 2;
}

#catalogRows {
  position: relative;
  z-index: 2;
  background: transparent;
}

.row-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
  padding: 0 var(--page-pad-x);
  padding-right: max(4%, var(--safe-right));
  letter-spacing: -0.02em;
  position: relative;
  display: inline-block;
  width: 100%;
}

.row-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  margin-top: 0.5rem;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

.row-section + .row-section {
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 2.25rem;
}

.row-slider {
  position: relative;
  z-index: 1;
  padding: 0.25rem 0 0;
  margin: 0 var(--page-pad-x);
  margin-right: max(4%, var(--safe-right));
}

.row-track-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  margin: 0 0.25rem;
  padding: 1.35rem 0 1rem;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.row-track-scroll::-webkit-scrollbar {
  display: none;
}

.row-track {
  display: flex;
  gap: 0.65rem;
  overflow: visible;
  padding: 0;
  scroll-snap-type: x proximity;
}

.row-nav {
  position: absolute;
  top: 50%;
  z-index: 6;
  transform: translateY(-50%);
  width: 44px;
  height: 72px;
  border: none;
  border-radius: var(--radius);
  background: rgba(20, 20, 20, 0.75);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.row-slider:hover .row-nav,
.row-slider.can-scroll-left .row-nav-prev:not([hidden]),
.row-slider.can-scroll-right .row-nav-next:not([hidden]) {
  opacity: 1;
}

.row-nav:hover {
  background: rgba(40, 40, 40, 0.95);
  transform: translateY(-50%) scale(1.05);
}

.row-nav:active {
  transform: translateY(-50%) scale(0.96);
}

.row-nav-prev {
  left: 0;
  background: linear-gradient(90deg, rgba(10, 10, 10, 0.95) 40%, transparent);
}

.row-nav-next {
  right: 0;
  background: linear-gradient(270deg, rgba(10, 10, 10, 0.95) 40%, transparent);
}

@media (max-width: 768px) {
  .row-nav {
    width: 36px;
    height: 60px;
    opacity: 0.85;
  }

  .row-slider .row-nav {
    opacity: 0.9;
  }
}

/* Cards */
.card {
  flex: 0 0 auto;
  width: clamp(140px, 18vw, 220px);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  scroll-snap-align: start;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transform-origin: center bottom;
}

@media (hover: hover) {
  .card:hover {
    transform: scale(1.06);
    z-index: 20;
    border-color: rgba(229, 9, 20, 0.35);
    box-shadow:
      0 12px 32px rgba(0, 0, 0, 0.65),
      0 0 24px var(--accent-glow);
  }
}

.card:active {
  transform: scale(0.96);
}

.card-poster {
  aspect-ratio: 2/3;
  width: 100%;
  object-fit: cover;
  background: var(--bg-card);
}

.card-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2rem 0.75rem 0.75rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.95));
  opacity: 0;
  transition: opacity var(--transition);
}

.card:hover .card-info {
  opacity: 1;
}

.card-title {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-progress {
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  margin-top: 0.5rem;
  overflow: hidden;
}

.card-progress-bar {
  height: 100%;
  background: var(--accent);
}

.card-badge-ep {
  top: auto;
  bottom: 0.35rem;
  left: 0.35rem;
  right: auto;
  background: rgba(0, 0, 0, 0.75);
  font-size: 0.7rem;
  letter-spacing: 0.02em;
}

.card-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--accent);
  padding: 0.2rem 0.4rem;
  border-radius: 2px;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}

.modal-panel {
  position: relative;
  background: var(--bg-elevated);
  border-radius: 8px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-card);
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--bg);
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.modal-hero {
  height: 280px;
  background-size: cover;
  background-position: center;
}

.modal-body {
  padding: 1.5rem 2rem 2rem;
}

.modal-body h2 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.modal-meta {
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.modal-body p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* Watch page */
.page-watch {
  background: #000;
}

.navbar-watch {
  display: none;
  background: rgba(0, 0, 0, 0.9);
}

.page-watch #navbar {
  background: rgba(0, 0, 0, 0.9);
}

.page-watch #navbar.scrolled,
body.page-watch.is-searching #navbar {
  background: rgba(10, 10, 10, 0.96);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  font-weight: 500;
  color: var(--text-muted);
}

.back-link:hover {
  color: var(--text);
}

.watch-main {
  padding-top: var(--nav-height);
  min-height: 100vh;
}

.player-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  min-height: 220px;
  background: #000;
  overflow: hidden;
}

.page-watch .player-wrap {
  max-height: min(80vh, calc(100vh - var(--nav-height) - 160px));
}

.page-watch-anime .player-wrap,
.player-wrap-megaplay {
  min-height: min(56.25vw, 480px);
}

.player-wrap-embed .player-iframe {
  border: none;
  background: #000;
}

.player-iframe,
.player-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.player-iframe {
  border: none;
}

.player-video {
  object-fit: contain;
  background: #000;
}

.player-video[hidden],
.player-iframe[hidden] {
  display: none;
}

.player-loading,
.player-error {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
  font-size: 0.95rem;
  z-index: 2;
  pointer-events: none;
}

.player-loading[hidden],
.player-error[hidden] {
  display: none !important;
}

.player-loading {
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.55);
}

.player-error {
  color: #fecaca;
  background: rgba(40, 10, 10, 0.85);
}

.player-external-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.85rem 4%;
  background: var(--bg-elevated);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.player-external-actions[hidden] {
  display: none !important;
}

.player-server-switch,
.player-lang-switch {
  padding: 0.75rem 4%;
  background: var(--bg-elevated);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.player-server-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.65rem 0.85rem;
}

.player-lang-switch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
}

.player-lang-switch-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.65rem 0.85rem;
}

.player-lang-hint {
  margin: 0;
  max-width: 36rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-muted);
  text-align: center;
}

.player-server-switch[hidden],
.player-lang-switch[hidden] {
  display: none !important;
}

.player-server-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.player-server-tabs,
.player-lang-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.player-server-tab,
.player-lang-tab {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.player-server-tab:hover,
.player-lang-tab:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
}

.player-server-tab.active,
.player-lang-tab.active {
  color: #fff;
  background: rgba(229, 9, 20, 0.35);
  border-color: rgba(229, 9, 20, 0.65);
}

.btn-open-voe {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  transition: background 0.2s, border-color 0.2s;
}

.btn-open-voe:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.35);
  color: #fff;
}

.page-watch.player-german-failed .player-wrap {
  min-height: 200px;
}

.watch-info {
  padding: 1.5rem 4%;
  max-width: 900px;
}

.watch-info h1 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.watch-info p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.watch-episode-label {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.watch-details-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.watch-details-link:hover {
  color: var(--text);
}

.watch-episodes {
  padding-bottom: calc(2rem + var(--safe-bottom));
}

.episode-card-current {
  border-color: var(--accent);
  background: rgba(229, 9, 20, 0.12);
  pointer-events: none;
}

.episode-card-current .episode-play-icon {
  opacity: 1;
  background: var(--accent);
}

.watch-resume-notice {
  margin-bottom: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  background: rgba(229, 9, 20, 0.12);
  border: 1px solid rgba(229, 9, 20, 0.35);
  color: var(--text);
  font-size: 0.875rem;
  line-height: 1.45;
}

/* TOP 10 row — same card/row layout as other rows; rank on poster only */
.row-top10 {
  padding-top: 4.5rem;
  margin-top: -1rem;
  background: transparent;
}

.row-top10 .row-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.75rem;
  letter-spacing: 0.04em;
  position: relative;
  z-index: 4;
  background: transparent;
}

.row-top10 .row-title::after {
  position: relative;
  z-index: 1;
}

.row-top10 .row-slider {
  position: relative;
  z-index: 4;
}

.card-rank {
  position: absolute;
  left: 0.65rem;
  bottom: 0.5rem;
  z-index: 3;
  margin: 0;
  padding: 0;
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2.25rem, 4vw, 3.75rem);
  line-height: 0.9;
  color: transparent;
  -webkit-text-stroke: 2px rgba(255, 255, 255, 0.45);
  text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.9);
  pointer-events: none;
  user-select: none;
}

.card-rank[data-rank="10"] {
  left: 0.45rem;
  font-size: clamp(1.85rem, 3.5vw, 3rem);
  letter-spacing: -0.04em;
}

.card-top10:hover .card-rank {
  -webkit-text-stroke-color: var(--text);
}

/* Setup banner */
.setup-banner {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  z-index: 99;
  background: #b81d24;
  color: #fff;
  padding: 0.75rem 4%;
  font-size: 0.9rem;
  text-align: center;
}

.setup-banner a {
  color: #fff;
  text-decoration: underline;
}

.setup-banner code {
  background: rgba(0, 0, 0, 0.25);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
}

body:has(.setup-banner:not([hidden])) .hero-content {
  padding-top: calc(var(--nav-height) + 3rem);
}

/* Main + search view */
.main-content {
  position: relative;
  z-index: 1;
}

body.is-searching .main-content {
  padding-top: calc(var(--nav-height) + var(--safe-top) + 0.5rem);
}

html.is-searching {
  overflow-y: auto !important;
  overflow-x: hidden;
  height: auto;
  min-height: 100%;
  scroll-behavior: auto;
  -webkit-overflow-scrolling: touch;
}

body.is-searching {
  overflow: visible !important;
  height: auto;
  min-height: 100%;
  touch-action: pan-y;
}

body.is-searching .site-footer {
  display: none;
}

body.is-searching .search-mobile-backdrop {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

body.is-searching #hero,
body.is-searching #continue-watching,
body.is-searching #catalogRows {
  display: none;
}

/* Browse category pages */
.page-browse {
  background: var(--bg);
}

.browse-page {
  padding-top: calc(var(--nav-height) + var(--safe-top));
  min-height: 100vh;
}

.browse-hero {
  position: relative;
  min-height: 38vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.browse-hero-bg {
  position: absolute;
  inset: 0;
  background: #111 center/cover no-repeat;
  transform: scale(1.05);
}

.browse-hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, var(--bg) 0%, rgba(10, 10, 10, 0.4) 45%, rgba(10, 10, 10, 0.75) 100%);
}

.browse-hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 2rem var(--page-pad-x) 2.5rem;
  padding-right: max(4%, var(--safe-right));
}

.browse-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.browse-breadcrumb a {
  color: var(--text-muted);
  transition: color var(--transition);
}

.browse-breadcrumb a:hover {
  color: var(--text);
}

.browse-hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 4rem);
  letter-spacing: 0.02em;
  line-height: 1;
  margin-bottom: 0.75rem;
}

.browse-hero-desc {
  max-width: 42rem;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.5;
}

.browse-content {
  padding: 0 0 5rem;
}

.browse-content .row-section:first-child {
  margin-top: 0;
}

/* Mood discovery */
/* Only on — same full-width row layout as other browse rows (ytvs.site) */
.only-on-section {
  padding-top: 2rem;
  padding-bottom: 0;
}

.only-on-section .only-on-title {
  margin-bottom: 0.75rem;
}

.only-on-controls {
  padding: 0 var(--page-pad-x);
  padding-right: max(4%, var(--safe-right));
  margin-bottom: 0.85rem;
}

.provider-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.65rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.provider-tabs::-webkit-scrollbar {
  display: none;
}

.provider-tab {
  flex: 0 0 auto;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.provider-tab:hover {
  border-color: var(--provider-color, var(--accent));
}

.provider-tab.active {
  background: var(--provider-color, var(--accent));
  border-color: var(--provider-color, var(--accent));
  color: #fff;
}

.provider-media-tabs {
  display: flex;
  gap: 0.5rem;
}

.provider-media-tab {
  padding: 0.4rem 1rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.provider-media-tab.active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
}

.only-on-loading,
.only-on-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 var(--page-pad-x) 1rem;
}

.only-on-row {
  /* Uses .row-slider from CatalogUI — full bleed like other rows */
}

.only-on-row .row-slider {
  margin-left: var(--page-pad-x);
  margin-right: max(4%, var(--safe-right));
}

.row-section.row-section-adult .row-title::after {
  content: '18+';
  margin-left: 0.5rem;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: rgba(229, 9, 20, 0.85);
  color: #fff;
  vertical-align: middle;
}

.browse-mood-banner {
  padding: 0 var(--page-pad-x) 1.5rem;
  padding-right: max(4%, var(--safe-right));
  max-width: 1100px;
  margin: 0 auto;
}

.browse-mood-banner-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(229, 9, 20, 0.18), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.browse-mood-banner-text h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
}

.browse-mood-banner-text p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Mood page (ytvs.site/mood) */
.page-mood {
  background: var(--bg);
}

.mood-page {
  min-height: 100vh;
  padding-bottom: calc(var(--tab-bar-height) + var(--safe-bottom) + 1rem);
}

.mood-index-header {
  padding: calc(var(--nav-height) + var(--safe-top) + 1.5rem) var(--page-pad-x) 1.25rem;
  padding-right: max(4%, var(--safe-right));
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.mood-breadcrumb {
  justify-content: center;
  margin-bottom: 1.25rem;
}

.mood-index-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 7vw, 2.75rem);
  line-height: 1.05;
  margin: 0 0 0.65rem;
}

.mood-index-lead {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin: 0;
  line-height: 1.5;
}

.mood-type-filter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1.35rem;
  max-width: 100%;
}

.mood-type-filter-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.mood-type-tabs {
  justify-content: center;
}

.page-mood-results .mood-type-filter {
  margin-top: 1rem;
  margin-bottom: 0.25rem;
}

.mood-picker-wrap {
  padding: 0 var(--page-pad-x) 2rem;
  padding-right: max(4%, var(--safe-right));
  max-width: 720px;
  margin: 0 auto;
}

.mood-grid-ytvs {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.mood-card-ytvs {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  min-height: auto;
  padding: 1rem 1.15rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  text-decoration: none;
  text-align: left;
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
}

.mood-card-ytvs:hover {
  transform: translateX(4px);
  border-color: var(--mood-accent, var(--accent));
  background: rgba(255, 255, 255, 0.07);
}

.mood-card-ytvs.active {
  border-color: var(--mood-accent, var(--accent));
  background: color-mix(in srgb, var(--mood-accent, var(--accent)) 14%, transparent);
}

.mood-card-ytvs .mood-card-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--mood-accent, var(--accent)) 20%, transparent);
  color: var(--mood-accent, var(--accent));
  font-size: 1.2rem;
}

.mood-card-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.mood-card-ytvs .mood-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
}

.mood-card-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Results page: show all moods in a grid (not a clipped horizontal strip) */
.mood-picker-results .mood-grid-ytvs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

@media (min-width: 520px) {
  .mood-picker-results .mood-grid-ytvs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .mood-picker-results .mood-grid-ytvs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.mood-picker-results .mood-card-ytvs {
  width: 100%;
  max-width: none;
  padding: 0.75rem 0.9rem;
  gap: 0.65rem;
}

.mood-picker-results .mood-card-ytvs .mood-card-icon {
  width: 40px;
  height: 40px;
  font-size: 1rem;
}

.mood-picker-results .mood-card-subtitle {
  display: block;
  font-size: 0.78rem;
  line-height: 1.3;
}

.mood-picker-results .mood-card-ytvs .mood-card-title {
  font-size: 0.92rem;
  white-space: normal;
}

.mood-picker-results {
  max-width: 900px;
}

.page-mood-results .mood-index-header {
  padding-bottom: 0.75rem;
}

.page-mood-results .mood-index-title {
  font-size: 1.5rem;
}

.mood-results-content {
  padding-top: 0;
}

.mood-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 1rem;
}

.mood-hero-actions[hidden] {
  display: none !important;
}

#moodShuffleBtn[hidden] {
  display: none !important;
}

.page-mood-index .mood-hero-actions,
.page-mood-index #moodShuffleBtn {
  display: none !important;
}

.mood-hero-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.page-mood-results .mood-picker-wrap {
  display: none;
}

#moodShuffleBtn.is-loading i {
  animation: moodShuffleSpin 0.65s linear infinite;
}

@keyframes moodShuffleSpin {
  to {
    transform: rotate(360deg);
  }
}

.mood-shuffling {
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.nav-dropdown.open-on-active .nav-dropdown-trigger {
  color: var(--text);
}

.search-view {
  padding: 1rem var(--page-pad-x) 2rem;
  padding-right: max(4%, var(--safe-right));
  min-height: 50vh;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.search-view-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.search-view-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.search-view-query {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.search-filters {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: 1rem 1.1rem;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  color-scheme: dark;
}

.search-filters[hidden] {
  display: none !important;
}

.search-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.search-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
}

.search-filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 140px;
}

.search-filter-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.search-filter-select {
  appearance: none;
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--text);
  color-scheme: dark;
  background-color: var(--bg-elevated);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23d4d4d4' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--transition), background-color var(--transition);
}

.search-filter-select:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background-color: #1a1a1a;
}

.search-filter-select:focus-visible {
  outline: none;
  border-color: rgba(229, 9, 20, 0.65);
  box-shadow: 0 0 0 2px rgba(229, 9, 20, 0.25);
}

.search-filter-select option {
  background: var(--bg-card);
  color: var(--text);
}

.search-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.search-filter-tab {
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.search-filter-tab:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.search-filter-tab:focus-visible {
  outline: none;
  border-color: rgba(229, 9, 20, 0.65);
  box-shadow: 0 0 0 2px rgba(229, 9, 20, 0.25);
}

.search-filter-tab.active {
  color: #fff;
  background: rgba(229, 9, 20, 0.35);
  border-color: rgba(229, 9, 20, 0.65);
}

.search-status {
  color: var(--text-muted);
  padding: 2rem 0;
  text-align: center;
}

.search-empty {
  font-size: 1rem;
}

.search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

/* Search cards — override row .card width */
.search-grid .card-search {
  flex: none;
  width: 100%;
  max-width: none;
  scroll-snap-align: unset;
}

.card-search {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 1rem;
  align-items: start;
  padding: 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  min-height: 140px;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.card-search .card-poster {
  width: 100px;
  height: 150px;
  border-radius: var(--radius);
  aspect-ratio: auto;
  object-fit: cover;
}

.card-search .card-info {
  display: none;
}

.card-search-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  padding-top: 0.25rem;
}

.card-search-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
}

.card-search-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

.card-search-meta .fa-star {
  color: #f5c518;
  font-size: 0.75em;
}

.card-search-type {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(229, 9, 20, 0.85);
  color: #fff;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
}

.card-search-overview {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (hover: hover) {
  .card-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    border-color: rgba(229, 9, 20, 0.3);
  }
}

/* Mobile search — 2-column poster grid */
@media (max-width: 768px) {
  .search-view {
    padding: 0.75rem var(--page-pad-x) calc(1.5rem + var(--tab-bar-height) + var(--safe-bottom));
    padding-right: max(4%, var(--safe-right));
  }

  body.is-searching .search-view {
    padding-top: calc(var(--nav-height) + var(--safe-top) + 3.25rem);
    min-height: auto;
  }

  body.is-searching .search-mobile-backdrop {
    display: none !important;
  }

  body.is-searching .main-content {
    position: relative;
    overflow: visible;
    min-height: auto;
  }

  .search-view-head {
    margin-bottom: 1rem;
  }

  .search-view-title {
    font-size: 1.25rem;
  }

  .search-view-query {
    font-size: 0.85rem;
  }

  .search-filters {
    padding: 0.85rem;
    margin-bottom: 1rem;
    gap: 0.85rem;
  }

  .search-filter-tab {
    padding: 0.4rem 0.7rem;
    font-size: 0.78rem;
  }

  .search-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem 0.5rem;
  }

  .search-grid .card-search {
    width: 100% !important;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    border-radius: var(--radius);
  }

  .card-search .card-poster {
    width: 100%;
    height: auto;
    aspect-ratio: 2 / 3;
    border-radius: var(--radius) var(--radius) 0 0;
  }

  .card-search-body {
    padding: 0.5rem 0.45rem 0.6rem;
    gap: 0.2rem;
    flex: 1;
  }

  .card-search-title {
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
  }

  .card-search-meta {
    font-size: 0.68rem;
    gap: 0.2rem 0.35rem;
  }

  .card-search-overview {
    display: none;
  }

  .card-search:active {
    transform: scale(0.97);
  }
}

@media (max-width: 380px) {
  .search-grid {
    gap: 0.5rem 0.4rem;
  }

  .card-search-title {
    font-size: 0.72rem;
  }
}

/* Mobile bottom tab bar */
.mobile-tab-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 110;
  height: calc(var(--tab-bar-height) + var(--safe-bottom));
  padding: 0 max(var(--safe-left), var(--safe-right));
  padding-bottom: var(--safe-bottom);
  background: rgba(10, 10, 10, 0.96);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.45);
}

.mobile-tab-bar .tab-item {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  min-height: var(--tab-bar-height);
  padding: 0.4rem 0.2rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.62rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
}

.mobile-tab-bar .tab-item svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.mobile-tab-bar .tab-item span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-tab-bar .tab-item.active {
  color: var(--text);
}

.mobile-tab-bar .tab-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: var(--accent);
}

.mobile-tab-bar .tab-item.active svg {
  stroke: var(--accent);
}

.is-standalone .mobile-tab-bar {
  background: rgba(10, 10, 10, 0.98);
}

/* Mobile browse picker (bottom sheet) */
.mobile-browse-backdrop {
  display: none;
}

.mobile-browse-sheet {
  display: none;
}

.mobile-browse-sheet-handle {
  width: 36px;
  height: 4px;
  margin: 0.35rem auto 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.mobile-browse-sheet-title {
  margin: 0 1.25rem 0.75rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.mobile-browse-options {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0 0.75rem;
}

.mobile-browse-options .nav-dropdown-item {
  padding: 0.85rem 1rem;
}

.mobile-browse-options .nav-dropdown-item.active {
  background: rgba(229, 9, 20, 0.12);
  outline: 1px solid rgba(229, 9, 20, 0.35);
}

.mobile-browse-cancel {
  display: block;
  width: calc(100% - 1.5rem);
  margin: 0.85rem 0.75rem calc(0.75rem + var(--safe-bottom));
  padding: 0.85rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

/* Responsive – tablet & phone */
@media (max-width: 1024px) {
  .hero {
    min-height: calc(var(--vh, 1vh) * 75);
    padding: 0 var(--page-pad-x) 5rem;
    margin-bottom: -3rem;
  }

  .hero-content {
    max-width: 100%;
    padding-top: calc(var(--nav-height) + var(--safe-top) + 1rem);
  }

  .hero-actions {
    width: 100%;
  }

  .hero-actions .btn {
    flex: 1;
    min-width: 0;
  }
}

@media (max-width: 768px) {
  :root {
    --nav-height: 52px;
    --tab-bar-height: 56px;
  }

  .nav-inner {
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
  }

  .nav-center {
    display: none;
  }

  .nav-search-toggle {
    display: flex;
  }

  .search-mobile-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 104;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
  }

  body.mobile-search-open .search-mobile-backdrop:not([hidden]) {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-browse-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 115;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
  }

  body.mobile-browse-open .mobile-browse-backdrop:not([hidden]) {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-browse-sheet {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 116;
    max-height: min(78vh, 520px);
    padding-top: 0.35rem;
    background: rgba(18, 18, 18, 0.98);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.25rem 1.25rem 0 0;
    box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
    pointer-events: none;
  }

  body.mobile-browse-open .mobile-browse-sheet:not([hidden]) {
    transform: translateY(0);
    pointer-events: auto;
  }

  .mobile-browse-sheet[hidden] {
    display: none !important;
  }

  body.mobile-browse-open {
    overflow: hidden;
  }

  .mobile-tab-bar {
    display: flex;
  }

  .search-input {
    font-size: 16px;
  }

  .nav-right .search-wrap {
    position: fixed;
    top: calc(var(--nav-height) + var(--safe-top) + 0.5rem);
    left: max(0.75rem, var(--safe-left));
    right: max(0.75rem, var(--safe-right));
    max-width: none;
    min-width: 0;
    width: auto;
    z-index: 105;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px) scale(0.98);
    transition: opacity 0.22s ease, transform 0.22s ease;
    padding: 0.5rem 1rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  }

  .nav-right .search-wrap.open,
  body.is-searching .nav-right .search-wrap {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }

  body.mobile-search-open:not(.is-searching) {
    overflow: hidden;
  }

  body.mobile-search-open .navbar {
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }

  .hero {
    min-height: calc(var(--vh, 1vh) * 68);
    padding-bottom: 3.5rem;
  }

  .hero-desc {
    -webkit-line-clamp: 2;
    font-size: 0.95rem;
  }

  .hero-meta {
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
  }

  .card {
    width: 110px;
  }

  .card-info {
    opacity: 1;
    padding: 1.5rem 0.5rem 0.5rem;
  }

  .card-rank {
    left: 0.5rem;
    bottom: 0.4rem;
    font-size: clamp(2rem, 9vw, 2.75rem);
  }

  .card-rank[data-rank="10"] {
    left: 0.35rem;
    font-size: clamp(1.65rem, 7.5vw, 2.25rem);
  }

  .modal {
    padding: 0;
    align-items: flex-end;
  }

  .modal-panel {
    max-height: 92vh;
    max-height: calc(var(--vh, 1vh) * 92);
    border-radius: 12px 12px 0 0;
    padding-bottom: var(--safe-bottom);
  }

  .modal-hero {
    height: 200px;
  }

  .modal-body {
    padding: 1.25rem 1.25rem 1.5rem;
  }

  .modal-close {
    top: max(1rem, var(--safe-top));
    right: max(1rem, var(--safe-right));
    width: 44px;
    height: 44px;
  }

  .setup-banner {
    font-size: 0.8rem;
    padding: 0.6rem 4%;
    top: calc(var(--nav-height) + var(--safe-top));
  }
}

@media (max-width: 380px) {
  .card {
    width: 100px;
  }

  .hero-actions .btn {
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
  }

  .mobile-tab-bar .tab-item {
    padding: 0.45rem 0.1rem;
  }

  .mobile-tab-bar .tab-item span {
    font-size: 0.58rem;
  }
}

@media (max-width: 400px) {
  .mobile-tab-bar .tab-item span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .mobile-tab-bar .tab-item {
    gap: 0;
    padding: 0.5rem 0.15rem;
  }
}

/* Watch page – mobile fullscreen player */
@media (max-width: 768px) {
  .page-watch #navbar {
    display: none !important;
  }

  .page-watch .navbar-watch {
    display: flex;
    padding-top: var(--safe-top);
    height: calc(var(--nav-height) + var(--safe-top));
  }

  .page-watch .watch-main {
    padding-top: calc(var(--nav-height) + var(--safe-top));
    min-height: calc(var(--vh, 1vh) * 100);
  }

  .page-watch .player-wrap {
    aspect-ratio: 16/9;
    max-height: none;
    width: 100%;
  }

  .page-watch.is-standalone .player-wrap,
  .page-watch .is-standalone .player-wrap {
    min-height: calc(var(--vh, 1vh) * 56);
  }

  .page-watch .watch-info {
    padding: 1rem var(--page-pad-x) calc(1.5rem + var(--safe-bottom));
  }

  .page-watch .player-external-actions {
    padding: 0.75rem var(--page-pad-x);
  }

  .page-watch .btn-open-voe {
    width: 100%;
    justify-content: center;
    min-height: 48px;
  }

  .page-watch.has-tab-bar .watch-episodes {
    padding-bottom: 0.5rem;
  }

  .settings-page {
    padding: calc(var(--nav-height) + var(--safe-top) + 1rem) var(--page-pad-x) 1.5rem;
  }

  .settings-header h1 {
    font-size: 2rem;
  }

  .browse-hero-content {
    padding: 1.5rem var(--page-pad-x) 2rem;
  }

  .browse-hero-content h1 {
    font-size: clamp(1.75rem, 8vw, 2.25rem);
  }

  .content-row {
    padding-left: var(--page-pad-x);
    padding-right: var(--page-pad-x);
  }

  .row-title {
    font-size: 1.05rem;
  }
}

@media (hover: none) {
  .card:hover {
    transform: none;
  }

  .card-top10:hover .card-rank {
    -webkit-text-stroke-color: rgba(255, 255, 255, 0.35);
  }
}

/* Landscape phone */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding-top: calc(var(--nav-height) + var(--safe-top));
    padding-bottom: 2rem;
  }

  .hero-content {
    padding-top: 0.5rem;
  }

  .hero-desc {
    -webkit-line-clamp: 1;
  }
}

/* iOS Add to Home Screen prompt */
body.ios-install-open {
  overflow: hidden;
}

.ios-install-prompt {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 1rem calc(var(--tab-bar-height) + var(--safe-bottom) + 1rem);
}

.ios-install-prompt[hidden] {
  display: none !important;
}

.ios-install-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.ios-install-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  max-height: 85vh;
  overflow-y: auto;
  background: linear-gradient(160deg, #1a1a1a 0%, #0d0d0d 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 1.5rem 1.25rem 1.25rem;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
  animation: iosSlideUp 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  z-index: 1;
}

@keyframes iosSlideUp {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ios-install-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.ios-install-preview {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.ios-install-preview img {
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.ios-install-card h3 {
  text-align: center;
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.ios-install-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  line-height: 1.45;
}

.ios-install-steps {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.ios-install-steps li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.95rem;
  line-height: 1.4;
}

.ios-step-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ios-step-text strong {
  color: var(--text);
}

.ios-share-icon {
  display: inline-flex;
  vertical-align: middle;
  margin: 0 0.15rem;
  padding: 0.15rem;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 6px;
}

.ios-safari-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.ios-install-note {
  font-size: 0.8rem;
  color: #f5a623;
  text-align: center;
  margin-bottom: 1rem;
  padding: 0.5rem;
  background: rgba(245, 166, 35, 0.1);
  border-radius: var(--radius);
}

.ios-install-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ios-install-actions .btn {
  width: 100%;
}

.ios-install-pointer {
  position: fixed;
  bottom: calc(var(--safe-bottom) + 8px);
  left: 50%;
  transform: translateX(-50%);
  color: var(--accent);
  z-index: 301;
  animation: iosBounce 1.2s ease infinite;
  pointer-events: none;
  display: none;
}

.ios-install-prompt:not([hidden]) .ios-install-pointer {
  display: block;
}

@keyframes iosBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

.ios-install-fab {
  position: fixed;
  bottom: calc(var(--tab-bar-height) + var(--safe-bottom) + 12px);
  right: max(1rem, var(--safe-right));
  z-index: 95;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  box-shadow: 0 4px 20px var(--accent-glow);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ios-install-fab[hidden] {
  display: none !important;
}

body:not(.has-tab-bar) .ios-install-fab {
  bottom: calc(var(--safe-bottom) + 12px);
}

.is-standalone .ios-install-prompt,
.is-standalone .ios-install-fab {
  display: none !important;
}

@media (min-width: 769px) {
  .ios-install-prompt {
    align-items: center;
    padding-bottom: 2rem;
  }

  .ios-install-pointer {
    display: none !important;
  }

  .ios-install-fab {
    bottom: 1.5rem;
  }
}

@media (min-width: 1024px) and (hover: hover) {
  .is-ios .ios-install-fab {
    display: none !important;
  }
}

/* Chromium desktop PWA install (separate from iOS) */
body.pwa-install-open {
  overflow: hidden;
}

.pwa-install-prompt {
  position: fixed;
  inset: 0;
  z-index: 299;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.pwa-install-prompt[hidden] {
  display: none !important;
}

.pwa-install-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.pwa-install-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(160deg, #1a1a1a 0%, #0d0d0d 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 1.5rem 1.25rem 1.25rem;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
  animation: iosSlideUp 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  z-index: 1;
}

.pwa-install-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.pwa-install-preview {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.pwa-install-preview img {
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.pwa-install-card h3 {
  text-align: center;
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.pwa-install-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.1rem;
  line-height: 1.45;
}

.pwa-install-benefits {
  list-style: none;
  margin: 0 0 1.15rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.pwa-install-benefits li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.pwa-install-benefits i {
  width: 1.25rem;
  color: var(--accent);
  text-align: center;
}

.pwa-install-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.pwa-install-actions .btn {
  width: 100%;
}

.pwa-install-actions .btn-primary i {
  margin-right: 0.35rem;
}

.pwa-install-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.4;
  margin: 0;
}

.pwa-install-hint-menu {
  color: #f5a623;
  padding: 0.5rem;
  background: rgba(245, 166, 35, 0.1);
  border-radius: var(--radius);
  margin-top: 0.5rem;
}

.pwa-install-actions .btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pwa-install-fab {
  position: fixed;
  bottom: 1.5rem;
  right: max(1rem, var(--safe-right));
  z-index: 96;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  box-shadow: 0 4px 20px var(--accent-glow);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.pwa-install-fab[hidden] {
  display: none !important;
}

.is-standalone .pwa-install-prompt,
.is-standalone .pwa-install-fab {
  display: none !important;
}

.is-ios .pwa-install-prompt,
.is-ios .pwa-install-fab {
  display: none !important;
}

.has-tab-bar .pwa-install-fab {
  bottom: calc(var(--tab-bar-height) + var(--safe-bottom) + 12px);
}

@media (max-width: 768px) {
  .pwa-install-fab {
    display: none !important;
  }
}

/* Site footer */
.site-footer {
  margin-top: 3rem;
  padding: 2rem var(--page-pad-x) calc(2rem + var(--safe-bottom));
  padding-right: max(4%, var(--safe-right));
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.85) 40%);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
}

.has-tab-bar .site-footer {
  padding-bottom: calc(5.5rem + var(--safe-bottom));
}

.site-footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.site-footer-credit {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0;
}

.site-footer-credit .footer-heart {
  margin-left: 0.15rem;
}

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.25rem;
}

.site-footer-links a {
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

.site-footer-links a:hover {
  color: var(--text);
}

.site-footer-copy {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.35);
  margin: 0;
}

.site-footer-compact {
  margin-top: 0;
  padding: 1.25rem var(--page-pad-x) calc(1.25rem + var(--safe-bottom));
  background: #000;
}

/* Legal pages */
.page-legal {
  background: var(--bg);
}

.legal-page {
  padding: calc(var(--nav-height) + var(--safe-top) + 2rem) var(--page-pad-x) 2rem;
  padding-right: max(4%, var(--safe-right));
  min-height: 60vh;
}

.legal-page-inner {
  max-width: 720px;
  margin: 0 auto;
}

.legal-page h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 2.75rem);
  letter-spacing: 0.02em;
  margin-bottom: 0.5rem;
}

.legal-updated {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.legal-page h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.75rem 0 0.65rem;
  color: var(--text);
}

.legal-page p,
.legal-page li {
  color: var(--text-muted);
  line-height: 1.65;
  font-size: 0.95rem;
}

.legal-page ul {
  margin: 0.5rem 0 1rem;
  padding-left: 1.25rem;
}

.legal-page li {
  margin-bottom: 0.35rem;
}

.legal-page strong {
  color: var(--text);
  font-weight: 600;
}

.legal-back {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.legal-back a {
  color: var(--accent);
  font-weight: 500;
  font-size: 0.95rem;
}

.legal-back a:hover {
  text-decoration: underline;
}

.has-tab-bar .legal-page {
  padding-bottom: calc(6rem + var(--safe-bottom));
}

/* Settings page */
.page-settings {
  background: var(--bg);
}

.settings-page {
  padding: calc(var(--nav-height) + var(--safe-top) + 1.25rem) var(--page-pad-x) 4rem;
  padding-right: max(4%, var(--safe-right));
  min-height: 100vh;
}

.settings-page-inner {
  max-width: 720px;
  margin: 0 auto;
}

.settings-header h1 {
  font-family: var(--font-display, 'Bebas Neue', sans-serif);
  font-size: clamp(2rem, 8vw, 2.5rem);
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

.settings-lead {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

.settings-tabs-wrap {
  position: sticky;
  top: calc(var(--nav-height) + var(--safe-top));
  z-index: 20;
  margin: 0 calc(-1 * var(--page-pad-x)) 1.25rem;
  padding: 0.65rem var(--page-pad-x);
  padding-right: max(4%, var(--safe-right));
  background: linear-gradient(var(--bg) 70%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.settings-tabs {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}

.settings-tabs::-webkit-scrollbar {
  display: none;
}

.settings-tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.95rem;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.settings-tab i {
  font-size: 0.9rem;
  opacity: 0.85;
}

.settings-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

.settings-tab.active {
  color: #fff;
  background: rgba(229, 9, 20, 0.28);
  border-color: rgba(229, 9, 20, 0.65);
}

.settings-tab:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(229, 9, 20, 0.35);
}

.settings-panels {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.settings-panel {
  display: none;
  flex-direction: column;
  gap: 0.85rem;
  animation: settingsPanelIn 0.22s ease;
}

.settings-panel.active {
  display: flex;
}

@keyframes settingsPanelIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.settings-card {
  padding: 1.1rem 1.15rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--bg-card);
}

.settings-card-muted {
  background: rgba(255, 255, 255, 0.03);
}

.settings-card-head {
  margin-bottom: 1rem;
}

.settings-card-head h2 {
  font-size: 1.05rem;
  margin: 0 0 0.35rem;
}

.settings-card .settings-hint {
  margin: 0;
}

.settings-section {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-section:last-child {
  border-bottom: none;
}

.settings-section h2 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.settings-hint {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.45;
  margin: 0.25rem 0 1rem;
}

.settings-server-grid {
  display: grid;
  gap: 0.75rem;
}

.settings-server-card {
  display: block;
  cursor: pointer;
}

.settings-server-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.settings-server-card-body {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  transition: border-color 0.2s, background 0.2s;
}

.settings-server-card input:checked + .settings-server-card-body {
  border-color: rgba(229, 9, 20, 0.55);
  background: rgba(229, 9, 20, 0.12);
}

.settings-server-card input:focus-visible + .settings-server-card-body {
  outline: 2px solid rgba(229, 9, 20, 0.45);
  outline-offset: 2px;
}

.settings-server-card:has(input[value="germanproviders"]:checked) .settings-server-card-body {
  border-color: rgba(139, 92, 246, 0.5);
  background: rgba(139, 92, 246, 0.12);
}

.settings-server-icon {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
}

.settings-server-icon-gp {
  background: rgba(139, 92, 246, 0.18);
  color: #c4b5fd;
}

.settings-server-text strong {
  display: block;
  margin-bottom: 0.2rem;
}

.settings-server-text small {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
}

.settings-toggle-row-inset {
  padding-top: 0.15rem;
}

.settings-toggle-label {
  flex: 1;
  min-width: 0;
}

.settings-toggle-label strong {
  display: block;
  margin-bottom: 0.2rem;
}

.settings-toggle-label small {
  display: block;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.settings-toggle-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.settings-toggle-switch {
  flex-shrink: 0;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  position: relative;
  transition: background 0.2s;
}

.settings-toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}

.settings-toggle-input:checked + .settings-toggle-switch {
  background: var(--accent, #e50914);
}

.settings-toggle-input:checked + .settings-toggle-switch::after {
  transform: translateX(20px);
}

.settings-anime-audio {
  padding: 0;
}

.settings-anime-audio-head strong {
  display: block;
  margin-bottom: 0.25rem;
}

.settings-anime-audio-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.settings-segmented {
  padding: 0.25rem;
  border-radius: var(--radius-lg);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-segmented .settings-anime-audio-option {
  border: none;
  background: transparent;
  border-radius: calc(var(--radius-lg) - 2px);
  min-height: 44px;
}

.settings-segmented .settings-anime-audio-option:has(input:checked) {
  background: rgba(229, 9, 20, 0.28);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.25);
}

.settings-anime-audio-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.65rem 0.85rem;
  min-height: 44px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: center;
}

.settings-anime-audio-option:has(input:checked) {
  border-color: rgba(229, 9, 20, 0.65);
  background: rgba(229, 9, 20, 0.2);
}

.settings-anime-audio-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.settings-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.settings-action-copy {
  flex: 1;
  min-width: 0;
}

.settings-action-copy .settings-hint {
  margin-bottom: 0;
}

.settings-action-btn {
  flex-shrink: 0;
  min-height: 44px;
}

.settings-status {
  margin-top: 0.75rem;
  font-size: 0.88rem;
  color: #86efac;
}

.settings-status-error {
  color: #fecaca;
}

.settings-section-muted {
  opacity: 0.9;
}

.settings-about-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.settings-about-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.settings-about-list li:first-child {
  border-top: none;
  padding-top: 0;
}

.settings-about-list a {
  color: #93c5fd;
}

.has-tab-bar .settings-page {
  padding-bottom: calc(var(--tab-bar-height) + var(--safe-bottom) + 2rem);
}

@media (max-width: 768px) {
  .has-tab-bar .settings-page {
    padding-bottom: calc(var(--tab-bar-height) + var(--safe-bottom) + 1.5rem);
  }

  .settings-header {
    margin-bottom: 0.15rem;
  }

  .settings-lead {
    margin-bottom: 1rem;
    font-size: 0.9rem;
  }

  .settings-tabs-wrap {
    position: static;
    margin: 0 0 1rem;
    padding: 0;
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .settings-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    overflow: visible;
    padding-bottom: 0;
  }

  .settings-tab {
    flex-direction: column;
    justify-content: center;
    gap: 0.35rem;
    width: 100%;
    min-height: 56px;
    padding: 0.65rem 0.5rem;
    border-radius: var(--radius-lg);
    white-space: normal;
    text-align: center;
    font-size: 0.78rem;
    touch-action: manipulation;
  }

  .settings-tab i {
    font-size: 1rem;
  }

  .settings-tab span {
    font-size: 0.78rem;
    line-height: 1.2;
  }

  .settings-card {
    padding: 1rem;
    border-radius: var(--radius-lg);
  }

  .settings-card-head {
    margin-bottom: 0.85rem;
  }

  .settings-card-head h2 {
    font-size: 1rem;
  }

  .settings-hint {
    font-size: 0.84rem;
  }

  .settings-server-grid {
    gap: 0.5rem;
  }

  .settings-server-card-body {
    align-items: center;
    padding: 0.85rem 0.9rem;
    gap: 0.75rem;
    min-height: 56px;
  }

  .settings-server-card-body::after {
    content: '';
    flex-shrink: 0;
    width: 1.35rem;
    height: 1.35rem;
    margin-left: auto;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.22);
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  }

  .settings-server-card input:checked + .settings-server-card-body::after {
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: inset 0 0 0 3px var(--bg-card);
  }

  .settings-server-icon {
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 8px;
    font-size: 0.85rem;
  }

  .settings-server-text {
    flex: 1;
    min-width: 0;
  }

  .settings-server-text strong {
    font-size: 0.95rem;
    margin-bottom: 0.15rem;
  }

  .settings-server-text small {
    font-size: 0.78rem;
    line-height: 1.35;
    display: block;
  }

  .settings-toggle-row {
    align-items: center;
    min-height: 52px;
    gap: 0.85rem;
  }

  .settings-toggle-label small {
    font-size: 0.8rem;
  }

  .settings-toggle-switch {
    width: 52px;
    height: 32px;
  }

  .settings-toggle-switch::after {
    width: 26px;
    height: 26px;
  }

  .settings-toggle-input:checked + .settings-toggle-switch::after {
    transform: translateX(20px);
  }

  .settings-segmented {
    margin-top: 0.65rem;
  }

  .settings-anime-audio-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
    margin-top: 0;
  }

  .settings-anime-audio-option {
    min-height: 48px;
    padding: 0.7rem 0.45rem;
    font-size: 0.82rem;
  }

  .settings-action-row-mobile {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }

  .settings-action-btn {
    width: 100%;
  }

  .settings-status {
    font-size: 0.82rem;
    margin-top: 0.65rem;
  }
}

@media (min-width: 640px) {
  .settings-tabs {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .settings-tab {
    flex: 1 1 auto;
    justify-content: center;
    min-width: 7.5rem;
  }
}

/* TV details page */
.page-details {
  background: var(--bg);
}

.details-page {
  min-height: 100vh;
  padding-bottom: calc(var(--tab-bar-height) + var(--safe-bottom) + 1rem);
}

.details-hero {
  position: relative;
  min-height: 52vh;
  display: flex;
  align-items: flex-end;
}

.details-hero-bg {
  position: absolute;
  inset: 0;
  background: #111 center/cover no-repeat;
}

.details-hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, var(--bg) 0%, rgba(10, 10, 10, 0.35) 45%, rgba(10, 10, 10, 0.85) 100%);
}

.details-hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: calc(var(--nav-height) + var(--safe-top) + 1rem) var(--page-pad-x) 2rem;
  padding-right: max(4%, var(--safe-right));
  max-width: 900px;
}

.details-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  transition: color var(--transition);
}

.details-back:hover {
  color: var(--text);
}

.details-title {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 8vw, 3.5rem);
  line-height: 1;
  letter-spacing: 0.02em;
  margin-bottom: 0.65rem;
}

.details-meta {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.details-meta .fa-star {
  color: #f5c518;
}

.details-overview {
  color: var(--text-muted);
  line-height: 1.55;
  max-width: 52rem;
  margin-bottom: 1.25rem;
}

.details-tagline {
  font-size: 1.05rem;
  font-style: italic;
  color: rgba(255, 255, 255, 0.75);
  margin: -0.35rem 0 0.65rem;
  max-width: 40rem;
}

.details-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.details-genre-pill {
  display: inline-block;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.88);
}

.details-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 0.85rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.details-fact {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.details-fact::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.85;
}

.details-fact:first-child::before {
  display: none;
}

.details-actions,
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.details-actions .btn,
.modal-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* Trailer modal (YouTube iframe via TMDB) */
.trailer-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  padding-top: max(1rem, var(--safe-top));
  padding-bottom: max(1rem, var(--safe-bottom));
}

.trailer-modal[hidden] {
  display: none !important;
}

.trailer-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(6px);
}

.trailer-modal-panel {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  background: #111;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65);
}

.trailer-modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.trailer-modal-title {
  font-size: 1rem;
  font-weight: 600;
  padding: 0.85rem 3rem 0.5rem 1rem;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trailer-modal-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.trailer-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

body.trailer-open {
  overflow: hidden;
}

@media (max-width: 768px) {
  .trailer-modal {
    align-items: center;
    justify-content: center;
    padding: max(1rem, var(--safe-top)) 0.75rem max(1rem, var(--safe-bottom));
  }

  .trailer-modal-panel {
    width: 100%;
    max-width: 100%;
    max-height: min(calc(var(--vh, 1vh) * 85), calc(100dvh - 2rem));
    border-radius: 12px;
  }
}

.details-episodes {
  position: relative;
  z-index: 2;
  padding: 0 var(--page-pad-x) 2rem;
  padding-right: max(4%, var(--safe-right));
  max-width: 1100px;
  margin: 0 auto;
}

.details-episodes-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
}

.details-episodes-head h2 {
  font-size: 1.35rem;
  font-weight: 700;
}

.details-season-label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.details-seasons-slider {
  position: relative;
  margin-bottom: 1.25rem;
  z-index: 2;
}

.details-seasons-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.details-seasons-scroll::-webkit-scrollbar {
  display: none;
}

.details-seasons {
  display: flex;
  gap: 0.5rem;
  padding: 0 0.15rem 0.75rem;
  width: max-content;
  min-width: 100%;
}

.details-seasons-nav {
  position: absolute;
  top: 0;
  bottom: 0.75rem;
  z-index: 4;
  width: 40px;
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.details-seasons-nav-prev {
  left: 0;
  background: linear-gradient(90deg, rgba(10, 10, 10, 0.96) 35%, transparent);
  border-radius: var(--radius) 0 0 var(--radius);
}

.details-seasons-nav-next {
  right: 0;
  background: linear-gradient(270deg, rgba(10, 10, 10, 0.96) 35%, transparent);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.details-seasons-slider:hover .details-seasons-nav,
.details-seasons-slider.can-scroll-left .details-seasons-nav-prev:not([hidden]),
.details-seasons-slider.can-scroll-right .details-seasons-nav-next:not([hidden]) {
  opacity: 1;
}

.details-seasons-nav:hover {
  background: rgba(30, 30, 30, 0.95);
}

@media (max-width: 768px) {
  .details-seasons-nav {
    opacity: 0.92;
    width: 34px;
  }
}

.details-season-tab {
  flex: 0 0 auto;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.details-season-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.details-season-count {
  font-size: 0.65rem;
  font-weight: 500;
  opacity: 0.85;
}

.details-loading,
.details-empty {
  color: var(--text-muted);
  text-align: center;
  padding: 2rem 0;
}

.details-episode-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.episode-card {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 1rem;
  padding: 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  color: inherit;
  text-decoration: none;
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
}

.episode-card:hover {
  border-color: rgba(229, 9, 20, 0.35);
  background: rgba(255, 255, 255, 0.04);
}

.episode-card:active {
  transform: scale(0.99);
}

.episode-card-thumb {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--bg-card);
}

.episode-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.episode-play-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity var(--transition);
}

.episode-card:hover .episode-play-icon {
  opacity: 1;
}

.episode-play-icon i {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.9rem;
  padding-left: 0.15rem;
}

.episode-card-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  justify-content: center;
}

.episode-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
}

.episode-num {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
}

.episode-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
}

.episode-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

.episode-meta .fa-star {
  color: #f5c518;
}

.episode-overview {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 768px) {
  .details-hero {
    min-height: 46vh;
  }

  .details-overview {
    -webkit-line-clamp: 3;
  }

  .episode-card {
    grid-template-columns: 120px 1fr;
    gap: 0.65rem;
    padding: 0.6rem;
  }

  .episode-overview {
    -webkit-line-clamp: 2;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .episode-card {
    grid-template-columns: 1fr;
  }

  .episode-card-thumb {
    aspect-ratio: 16 / 9;
  }

  .episode-play-icon {
    opacity: 1;
  }
}

.details-cast,
.details-similar {
  position: relative;
  z-index: 2;
  padding: 0 var(--page-pad-x) 2.5rem;
  padding-right: max(4%, var(--safe-right));
  max-width: 1100px;
  margin: 0 auto;
}

.details-cast h2,
.details-similar h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.details-cast-scroll {
  display: flex;
  gap: 1rem;
}

.details-cast-slider.row-slider {
  margin: 0;
  padding: 0.25rem 0 0;
}

.details-cast-slider .row-track-scroll {
  padding: 0.35rem 0 0.75rem;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  .details-cast-slider .row-nav {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .details-cast-slider .row-nav {
    opacity: 0.9;
  }
}

.details-cast-member {
  flex: 0 0 auto;
  width: 96px;
  text-align: center;
}

.details-cast-photo {
  width: 88px;
  height: 88px;
  margin: 0 auto 0.55rem;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.08);
}

.details-cast-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.details-cast-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: rgba(255, 255, 255, 0.35);
  font-size: 1.5rem;
}

.details-cast-name {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 0.2rem;
}

.details-cast-role {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.details-similar-slider .row-slider {
  margin: 0;
}

.details-similar-slider .row-track-scroll {
  padding-bottom: 0.25rem;
}

@media (min-width: 769px) {
  .details-cast-member {
    width: 108px;
  }

  .details-cast-photo {
    width: 96px;
    height: 96px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .hero-bg {
    animation: none;
  }

  .nav-live-dot {
    animation: none;
    opacity: 1;
  }

  .hero-content {
    opacity: 1;
    transform: none;
  }
}
