/* personastream.xyz */
:root {
  --bg: #00050D;
  --bg-elevated: #07111d;
  --bg-card: #101923;
  --bg-glass: rgba(0, 5, 13, 0.92);
  --text: #ffffff;
  --text-muted: #8197A4;
  --accent: #37F1A3;
  --accent-hover: #79B8F3;
  --accent-yellow: #FFD62C;
  --accent-blue: #79B8F3;
  --accent-blue-strong: #1A98FFCC;
  --ink: #33373D;
  --accent-glow: rgba(55, 241, 163, 0.28);
  --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;
}

/* Prevent horizontal scroll only - allow vertical */
html {
  overflow-x: hidden;
  overflow-y: auto;
  max-width: 100vw;
}

body {
  overflow-x: hidden;
  overflow-y: auto;
  max-width: 100vw;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

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;
  overflow-y: auto;
  min-height: calc(var(--vh, 1vh) * 100);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-x: none;
  max-width: 100vw;
  position: relative;
}

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);
  max-width: 100vw;
  overflow: visible;
}

.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;
  position: relative;
  z-index: 101;
  max-width: 100%;
  overflow: visible;
}

.nav-right {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  z-index: 102;
  pointer-events: auto;
}

.nav-links a,
.nav-links button,
.nav-dropdown-trigger,
.nav-search-toggle {
  position: relative;
  z-index: 103;
  pointer-events: auto;
  touch-action: manipulation;
}

.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: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 center;
  background-repeat: no-repeat;
  animation: heroKenBurns 22s ease-in-out infinite alternate;
  will-change: transform;
}

@media (max-width: 768px) {
  .hero-bg {
    background-position: 35% center;
  }
}

@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-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;
  max-height: calc(100vh - var(--nav-height) - 120px);
  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;
}

.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);
}

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;
}

/* Only on — provider section */
.provider-section {
  padding: 1.5rem 0 0.5rem;
}

.provider-header {
  margin-bottom: 1rem;
  /* no extra padding — .row-title already has var(--page-pad-x) built in */
}

.provider-header .row-title {
  margin-bottom: 0.75rem;
}

.provider-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0 var(--page-pad-x) 0.65rem;
  padding-right: max(4%, var(--safe-right));
  -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);
}

.provider-tab:hover {
  border-color: var(--accent);
}

.provider-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Movies / Series toggle — sits on its own row below provider tabs */
.provider-media-tabs {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
  padding: 0 var(--page-pad-x);
  padding-right: max(4%, var(--safe-right));
}

.provider-media-btn {
  padding: 0.3rem 0.85rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.provider-media-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.25);
}

.provider-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  width: 100%;
}

/* Provider cards — same size as regular row cards */
.provider-section .card {
  width: 185px;
  flex: 0 0 185px;
}

.provider-section .card-poster {
  width: 185px;
  height: 278px;
  object-fit: cover;
  border-radius: 8px;
}


.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-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;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.search-view-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.search-view-query {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.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) + 4rem);
  }

  .search-view-head {
    margin-bottom: 1rem;
  }

  .search-view-title {
    font-size: 1.25rem;
  }

  .search-view-query {
    font-size: 0.85rem;
  }

  .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: 120;
  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;
  z-index: 121;
  pointer-events: auto;
}

.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;
}

/* Sheet hidden by default via [hidden] attribute — JS removes it to show */
.mobile-browse-sheet {
  display: none; /* fallback for non-mobile */
}

.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;
  }
  
  /* Prevent horizontal scroll only - keep vertical scroll */
  html {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    max-width: 100vw;
  }
  
  body {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    max-width: 100vw;
  }

  .nav-inner {
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
    max-width: 100vw;
  }

  .nav-center {
    display: none;
  }

  /* Hide desktop navbar buttons on mobile - use mobile tab bar instead */
  .nav-search-toggle,
  #navSearchToggle,
  .nav-browse-pill,
  .nav-dropdown-trigger,
  #browseTrigger {
    display: none !important;
  }
  
  /* FORCE navbar and all children to be clickable */
  .navbar {
    pointer-events: auto !important;
    max-width: 100vw;
    overflow: visible;
    z-index: 100 !important;
  }
  
  .navbar *,
  .nav-inner,
  .nav-inner *,
  .nav-right,
  .nav-right *,
  .mobile-tab-bar,
  .mobile-tab-bar * {
    pointer-events: auto !important;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2) !important;
  }
  
  /* Specific mobile tab bar fixes with higher specificity */
  #mobileBrowseTab,
  #mobileSearchTab {
    pointer-events: auto !important;
    touch-action: manipulation !important;
    z-index: 150 !important;
    position: relative !important;
    cursor: pointer !important;
  }
  
  /* Remove any potential blocking elements */
  .nav-center,
  .nav-links {
    display: none !important;
  }

  .search-mobile-backdrop {
    position: fixed;
    inset: 0;
    z-index: 104;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
  }
  
  .search-mobile-backdrop[hidden] {
    display: none;
  }

  body.mobile-search-open .search-mobile-backdrop:not([hidden]) {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-browse-backdrop {
    display: block; /* override global display:none */
    position: fixed;
    inset: 0;
    z-index: 115;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
  }
  
  .mobile-browse-backdrop[hidden] {
    display: none;
  }

  body.mobile-browse-open .mobile-browse-backdrop:not([hidden]) {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-browse-sheet {
    display: block; /* override the global display:none */
    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;
    overflow-y: auto;
  }
  
  .mobile-browse-sheet[hidden] {
    display: none;
  }

  body.mobile-browse-open .mobile-browse-sheet:not([hidden]) {
    transform: translateY(0);
    pointer-events: auto;
  }

  body.mobile-browse-open {
    overflow-y: auto; /* Keep vertical scroll even when browse is open */
  }

  .mobile-tab-bar {
    display: flex !important;
    pointer-events: auto !important;
    z-index: 120 !important;
  }
  
  /* Ensure mobile tab bar items are always clickable */
  .mobile-tab-bar .tab-item {
    pointer-events: auto !important;
    touch-action: manipulation !important;
    z-index: 121 !important;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2) !important;
    position: relative !important;
  }

  .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 {
    overflow-y: auto; /* Keep vertical scroll even when search is open */
  }

  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) + 1.25rem) var(--page-pad-x) 1.5rem;
  }

  .settings-header h1 {
    font-size: 2rem;
  }

  .settings-action-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .settings-action-row .btn {
    width: 100%;
    min-height: 44px;
  }

  .settings-toggle-row {
    align-items: flex-start;
    gap: 1rem;
  }

  .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;
  }
}

/* ── Mood Page Styles (Reezli Style) ── */
.page-mood {
  padding-bottom: calc(var(--tab-bar-height) + var(--safe-bottom) + 1rem);
}

.mood-page {
  min-height: 100vh;
}

/* Mood Index Header - Simple like Reezli */
.mood-index-header {
  padding: calc(var(--nav-height) + var(--safe-top) + 2rem) var(--page-pad-x) 3rem;
  text-align: center;
  background: var(--bg);
  position: relative;
}

.mood-index-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.mood-index-lead {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin: 0;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Mood Grid - Reezli Style */
.mood-picker-wrap {
  padding: 2rem var(--page-pad-x);
  max-width: 800px;
  margin: 0 auto;
}

.mood-grid-reezli {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mood-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: white;
  font-weight: 600;
  transition: transform var(--transition), box-shadow var(--transition);
  overflow: hidden;
  min-height: 70px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.mood-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.mood-card:active {
  transform: translateY(0);
}

.mood-card-emoji {
  font-size: 1.8rem;
  flex-shrink: 0;
  width: 40px;
  text-align: center;
}

.mood-card-content {
  flex: 1;
}

.mood-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.2rem;
  color: white;
}

.mood-card-desc {
  font-size: 0.85rem;
  margin: 0;
  opacity: 0.8;
  color: white;
}

/* Mood Hero (for specific mood pages) - Simple */
.mood-hero {
  position: relative;
  background: var(--bg-card);
}

.mood-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.3;
}

.mood-hero-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.mood-hero-actions .btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

/* Mood Results Content */
.mood-results-content {
  padding: 0 var(--page-pad-x);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .mood-index-header {
    padding: calc(var(--nav-height) + var(--safe-top) + 1.5rem) var(--page-pad-x) 2rem;
  }
  
  .mood-index-title {
    font-size: 2rem;
  }
  
  .mood-index-lead {
    font-size: 1rem;
  }
  
  .mood-picker-wrap {
    padding: 1.5rem var(--page-pad-x);
  }
  
  .mood-card {
    padding: 1rem 1.25rem;
    min-height: 60px;
  }
  
  .mood-card-emoji {
    font-size: 1.5rem;
    width: 35px;
  }
  
  .mood-card-title {
    font-size: 0.95rem;
  }
  
  .mood-card-desc {
    font-size: 0.8rem;
  }
  
  .mood-hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  
  .mood-hero-actions .btn {
    justify-content: center;
  }
}

/* Remove complex provider/filter styles */

/* ── Browse Page Styles ── */
.page-browse {
  padding-bottom: calc(var(--tab-bar-height) + var(--safe-bottom) + 1rem);
}

.browse-page {
  min-height: 100vh;
}

.browse-hero {
  position: relative;
  min-height: 40vh;
  display: flex;
  align-items: flex-end;
  padding: 0 var(--page-pad-x) 3rem;
  margin-bottom: 2rem;
  overflow: hidden;
}

.browse-hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  background-size: cover;
  background-position: center;
}

.browse-hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 5, 13, 0.3) 0%,
    rgba(0, 5, 13, 0.7) 70%,
    rgba(0, 5, 13, 0.95) 100%
  );
}

.browse-hero-content {
  position: relative;
  z-index: 2;
  max-width: 100%;
}

.browse-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.browse-breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
}

.browse-breadcrumb a:hover {
  color: var(--text);
}

.browse-hero-title {
  font-size: 3rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--text);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.browse-hero-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin: 0;
  max-width: 600px;
}

.browse-content {
  padding: 0 var(--page-pad-x);
}

.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(229, 9, 20, 0.2);
  border-top: 3px solid var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@media (max-width: 768px) {
  .browse-hero {
    min-height: 30vh;
    padding: 0 var(--page-pad-x) 2rem;
    margin-bottom: 1.5rem;
  }
  
  .browse-hero-title {
    font-size: 2.2rem;
  }
  
  .browse-hero-desc {
    font-size: 1rem;
  }
}

/* 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;
}

/* SEO Content Section */
.seo-content {
  position: relative;
  z-index: 1;
  margin-top: 4rem;
  padding: 3rem var(--page-pad-x);
  padding-right: max(4%, var(--safe-right));
  background: linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.02) 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.seo-content-inner {
  max-width: 900px;
  margin: 0 auto;
}

.seo-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-align: center;
  letter-spacing: -0.02em;
}

.seo-text {
  color: var(--text-muted);
  line-height: 1.8;
  font-size: 0.95rem;
}

.seo-text p {
  margin-bottom: 1.25rem;
}

.seo-text p:last-child {
  margin-bottom: 0;
}

.seo-text strong {
  color: var(--text);
  font-weight: 600;
}

@media (max-width: 768px) {
  .seo-content {
    margin-top: 2rem;
    padding: 2rem var(--page-pad-x);
  }
  
  .seo-title {
    font-size: 1.5rem;
  }
  
  .seo-text {
    font-size: 0.9rem;
  }
}

.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) + 2rem) 4% 4rem;
  min-height: 100vh;
}

.settings-page-inner {
  max-width: 640px;
  margin: 0 auto;
}

.settings-header h1 {
  font-family: var(--font-display, 'Bebas Neue', sans-serif);
  font-size: 2.5rem;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

.settings-lead {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.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;
  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(59, 130, 246, 0.5);
  background: rgba(59, 130, 246, 0.1);
}

.settings-server-card input:focus-visible + .settings-server-card-body {
  outline: 2px solid rgba(59, 130, 246, 0.6);
  outline-offset: 2px;
}

.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-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;
  padding: 0.85rem 0;
  cursor: pointer;
}

.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, #37F1A3);
}

.settings-toggle-input:checked + .settings-toggle-switch::after {
  transform: translateX(20px);
}

.settings-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.settings-action-row:first-of-type {
  border-top: none;
  padding-top: 0;
}

.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.5rem 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.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-server-card-body {
    padding: 0.9rem;
  }

  .settings-about-list li {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
  }
}

/* TV details page */
.page-details {
  background: var(--bg);
}

.details-page {
  min-height: 100vh;
  padding-bottom: calc(var(--tab-bar-height) + var(--safe-bottom) + 1rem);
  max-width: 100vw;
  overflow-x: hidden;
  overflow-y: auto;
}

.details-hero {
  position: relative;
  min-height: 52vh;
  display: flex;
  align-items: flex-end;
  max-width: 100vw;
  overflow-x: hidden;
}

.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;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.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%;
  position: relative;
}

.details-seasons::before,
.details-seasons::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0.75rem;
  width: 20px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

.details-seasons::before {
  left: 0;
  background: linear-gradient(90deg, var(--bg) 0%, transparent 100%);
}

.details-seasons::after {
  right: 0;
  background: linear-gradient(270deg, var(--bg) 0%, transparent 100%);
}

.details-seasons-scroll:not([data-at-start]) .details-seasons::before {
  opacity: 1;
}

.details-seasons-scroll:not([data-at-end]) .details-seasons::after {
  opacity: 1;
}

.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;
  }
}

/* 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;
  }
}

/* personastream.xyz final polish */
[hidden] {
  display: none !important;
}

body {
  background:
    radial-gradient(circle at 12% 0%, rgba(55, 241, 163, 0.12), transparent 28rem),
    radial-gradient(circle at 92% 18%, rgba(121, 184, 243, 0.14), transparent 30rem),
    var(--bg);
}

.red,
.logo-stream {
  color: var(--accent);
}

.navbar.scrolled,
body.is-searching .navbar,
body.mobile-search-open .navbar {
  background: rgba(0, 5, 13, 0.94);
  border-bottom-color: rgba(255, 255, 255, 0.2);
}

.nav-browse-pill.nav-dropdown-trigger,
.nav-browse-pill {
  color: rgba(255, 255, 255, 0.66);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-browse-pill.nav-dropdown-trigger:hover,
.nav-dropdown.open .nav-browse-pill.nav-dropdown-trigger,
.nav-browse-pill:hover,
.nav-dropdown.open .nav-browse-pill {
  color: #00050D;
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 24px rgba(55, 241, 163, 0.22);
}

.nav-live-dot,
.card-progress-bar,
.mobile-tab-bar .tab-item.active::before {
  background: var(--accent);
}

.nav-dropdown-menu,
.mobile-browse-sheet,
.modal-panel,
.settings-section,
.card-search-horiz,
.episode-card {
  background: rgba(7, 17, 29, 0.96);
  border-color: rgba(255, 255, 255, 0.16);
}

.nav-dropdown-item.active,
.mobile-browse-options .nav-dropdown-item.active {
  background: rgba(55, 241, 163, 0.14);
}

.nav-dropdown-item.active strong,
.nav-dropdown-icon,
.legal-back a,
.episode-num,
.watch-episode-label {
  color: var(--accent);
}

.nav-dropdown-item.active .nav-dropdown-icon,
.settings-server-icon {
  background: rgba(55, 241, 163, 0.16);
  color: var(--accent);
}

.search-wrap {
  position: relative;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.24);
}

.search-wrap:focus-within {
  border-color: var(--accent);
  background: rgba(0, 5, 13, 0.96);
  box-shadow: 0 0 0 3px rgba(55, 241, 163, 0.18);
}

.search-suggestions {
  position: absolute;
  top: calc(100% + 0.55rem);
  left: 0;
  right: 0;
  z-index: 140;
  padding: 0.6rem;
  border-radius: 12px;
  background: rgba(0, 5, 13, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
}

.search-suggestion-title {
  padding: 0.35rem 0.55rem 0.5rem;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search-suggestion-list {
  display: grid;
  gap: 0.25rem;
}

.search-suggestion-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.72rem 0.75rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.search-suggestion-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.hero-gradient {
  background:
    linear-gradient(77deg, rgba(0, 5, 13, 0.82) 0%, rgba(0, 5, 13, 0.28) 50%, transparent 100%),
    linear-gradient(0deg, var(--bg) 0%, rgba(0, 5, 13, 0.72) 16%, rgba(0, 5, 13, 0.1) 70%, transparent 100%);
}

.hero::after {
  background: linear-gradient(to bottom, transparent 0%, rgba(0, 5, 13, 0.46) 52%, var(--bg) 100%);
}

.hero-badge,
.card-badge,
.card-search-badge,
.details-season-tab.active,
.episode-play-icon i,
.ios-step-num {
  background: var(--accent);
  color: #00050D;
}

.btn-primary {
  background: var(--accent);
  color: #00050D;
}

.btn-primary:hover {
  background: #ffffff;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.btn-secondary:hover {
  background: rgba(121, 184, 243, 0.28);
}

.row-top10 {
  padding-top: 2rem;
  margin-top: 0;
}

.row-top10 .row-title {
  z-index: 6;
}

.row-title::after {
  background: linear-gradient(90deg, var(--accent), transparent);
}

.card {
  background: var(--bg-card);
}

@media (hover: hover) {
  .card:hover,
  .card-search-horiz:hover,
  .episode-card:hover {
    border-color: rgba(55, 241, 163, 0.48);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.6), 0 0 28px rgba(55, 241, 163, 0.14);
  }
}

.modal-actions,
.details-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.modal-actions .btn,
.details-actions .btn {
  min-width: 150px;
}

.search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem 0.75rem;
}

.card-search-horiz {
  display: block;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: var(--bg-card);
  color: inherit;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.card-search-poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 10px 10px 0 0;
  background: var(--bg-card);
}

.card-search-info {
  min-width: 0;
  padding: 0.68rem 0.72rem 0.78rem;
}

.card-search-title {
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 0.38rem;
}

.card-search-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-bottom: 0.4rem;
}

.card-search-badge {
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.badge-movie {
  background: var(--accent-blue);
}

.card-search-desc {
  display: none;
}

.page-details .search-wrap {
  width: min(320px, 32vw);
}

body.is-searching .main-content {
  padding-top: 0;
}

body.is-searching .search-view,
.search-view {
  padding-top: calc(var(--nav-height) + var(--safe-top) + 1.15rem);
}

.settings-player-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.06);
}

.settings-page-inner {
  max-width: 720px;
}

.settings-section {
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(7, 17, 29, 0.84);
}

.settings-section:last-child {
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.settings-section h2 {
  margin-top: 0;
}

.settings-toggle-label {
  min-width: 0;
}

.settings-toggle-label strong,
.settings-toggle-label small {
  display: block;
}

.settings-toggle-label small {
  margin-top: 0.25rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.settings-action-row {
  padding: 0;
  border-top: 0;
}

.settings-action-row .settings-hint {
  margin-bottom: 0;
}

.settings-about-list li {
  align-items: center;
}

.settings-about-list li span:last-child {
  text-align: right;
  word-break: break-word;
}

.settings-server-text small {
  display: block;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.details-page {
  min-height: 100vh;
  padding-bottom: calc(var(--tab-bar-height) + var(--safe-bottom) + 1rem);
}

.details-hero {
  position: relative;
  min-height: 58vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.details-hero-bg {
  position: absolute;
  inset: 0;
  background: #07111d center / cover no-repeat;
  transform: scale(1.04);
}

.details-hero-gradient {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(76deg, rgba(0, 5, 13, 0.76), rgba(0, 5, 13, 0.22) 54%, transparent),
    linear-gradient(0deg, var(--bg), rgba(0, 5, 13, 0.54) 38%, rgba(0, 5, 13, 0.06));
}

.details-hero-content {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  padding: calc(var(--nav-height) + var(--safe-top) + 2rem) var(--page-pad-x) 3rem;
}

.details-back {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-weight: 700;
}

.details-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2.7rem, 9vw, 5.3rem);
  line-height: 0.95;
  margin: 0.65rem 0;
}

.details-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.details-meta .fa-star,
.episode-meta .fa-star {
  color: var(--accent-yellow);
}

.details-overview {
  max-width: 680px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.details-episodes {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 0 var(--page-pad-x) 2rem;
}

.details-episodes-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.details-episodes-head h2 {
  font-size: 1.35rem;
}

.details-season-label,
.details-empty {
  color: var(--text-muted);
}

.details-seasons {
  display: flex;
  gap: 0.55rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  scrollbar-width: none;
}

.details-seasons::-webkit-scrollbar {
  display: none;
}

.details-season-tab {
  flex: 0 0 auto;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-weight: 800;
}

.details-season-tab small {
  font-size: 0.68rem;
  font-weight: 600;
}

.details-episode-list {
  display: grid;
  gap: 0.8rem;
}

.episode-card {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 1rem;
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.episode-card-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  background: var(--bg-card);
}

.episode-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.episode-play-icon {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 5, 13, 0.28);
}

.episode-play-icon i {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  padding-left: 0.12rem;
}

.episode-card-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
}

.episode-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem;
}

.episode-title {
  font-size: 1rem;
  line-height: 1.25;
}

.episode-meta {
  display: flex;
  gap: 0.7rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.episode-overview {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.trailer-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.trailer-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.86);
  backdrop-filter: blur(6px);
}

.trailer-modal-panel {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #00050D;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.72);
}

.trailer-modal-close {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: 1.45rem;
}

.trailer-modal-title {
  padding: 0.85rem 3.2rem 0.65rem 1rem;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trailer-modal-player {
  position: relative;
  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) {
  body.mobile-search-open .search-mobile-backdrop:not([hidden]) {
    background: rgba(0, 5, 13, 0.84);
  }

  .nav-right .search-wrap {
    top: calc(var(--safe-top) + 0.65rem);
    left: max(0.7rem, var(--safe-left));
    right: max(0.7rem, var(--safe-right));
    padding: 0.72rem 0.9rem;
    background: #00050D;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.66);
  }

  .search-suggestions {
    position: fixed;
    top: calc(var(--safe-top) + 4.5rem);
    left: max(0.7rem, var(--safe-left));
    right: max(0.7rem, var(--safe-right));
  }

  .hero {
    min-height: calc(var(--vh, 1vh) * 72);
    padding-bottom: 2.4rem;
    margin-bottom: 0;
    overflow: hidden;
  }

  .hero-bg {
    bottom: 0;
    background-image: var(--hero-poster) !important;
    background-position: center 16%;
    animation: none;
    transform: none;
  }

  .hero-gradient,
  .hero-vignette {
    bottom: 0;
  }

  .hero::after {
    bottom: 0;
    height: 8rem;
  }

  .hero-content {
    padding-top: calc(var(--nav-height) + var(--safe-top) + 1.5rem);
  }

  .hero-title {
    font-size: clamp(2rem, 12vw, 3.15rem);
    max-width: 88%;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .row-top10 {
    padding-top: 0.85rem;
  }

  .row-top10 .row-title {
    margin-top: 0;
  }

  .settings-action-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .settings-action-row .btn {
    width: 100%;
    justify-content: center;
    min-height: 40px;
  }

  .search-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
  }

  .card-search-horiz {
    display: block;
    padding: 0;
  }

  .card-search-poster {
    width: 100%;
  }

  .card-search-desc {
    display: none;
  }

  .page-details .search-wrap {
    width: auto;
  }

  .details-hero {
    min-height: calc(var(--vh, 1vh) * 62);
  }

  .details-hero-bg {
    background-position: 35% center;
  }

  .details-hero-content {
    padding: calc(var(--nav-height) + var(--safe-top) + 1rem) var(--page-pad-x) 2rem;
  }

  .details-overview {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .details-actions,
  .modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .details-actions .btn,
  .modal-actions .btn {
    min-width: 0;
    width: 100%;
  }

  .episode-card {
    grid-template-columns: 118px 1fr;
    gap: 0.65rem;
    padding: 0.6rem;
  }

  .episode-overview {
    -webkit-line-clamp: 2;
    font-size: 0.78rem;
  }
}

@media (max-width: 430px) {
  .hero {
    min-height: calc(var(--vh, 1vh) * 74);
  }

  .hero-bg {
    background-position: center 9%;
  }

  .episode-card {
    grid-template-columns: 1fr;
  }

  .episode-card-thumb {
    aspect-ratio: 16 / 9;
  }
}

/* Search history + smoother settings pass */
.search-suggestion-list {
  gap: 0.35rem;
}

.search-suggestion-row {
  display: grid;
  grid-template-columns: 1fr 34px;
  align-items: center;
  gap: 0.25rem;
  border-radius: 10px;
}

.search-suggestion-row:hover {
  background: rgba(255, 255, 255, 0.07);
}

.search-suggestion-row .search-suggestion-item {
  min-width: 0;
  background: transparent;
}

.search-suggestion-row .search-suggestion-item:hover {
  background: transparent;
}

.search-suggestion-delete {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: rgba(255, 255, 255, 0.48);
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease;
}

.search-suggestion-delete:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.page-settings {
  background:
    radial-gradient(circle at 50% -12rem, rgba(55, 241, 163, 0.08), transparent 35rem),
    var(--bg);
}

.settings-page-inner {
  max-width: 680px;
}

.settings-header {
  margin-bottom: 2.1rem;
}

.settings-lead {
  margin-bottom: 0;
}

.settings-section {
  margin-bottom: 0;
  padding: 1.35rem 0;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  background: transparent;
}

.settings-section:last-child,
.settings-section.settings-section-muted {
  border-bottom: 0;
}

.settings-section h2 {
  margin-bottom: 0.65rem;
}

.settings-player-row {
  padding: 0.95rem 1rem;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.045);
  border-radius: 10px;
}

.settings-toggle-row {
  padding: 0.35rem 0;
}

.settings-action-row {
  padding: 0.2rem 0 0;
}

.settings-section-muted {
  opacity: 1;
}

.settings-about-list li {
  padding: 0.45rem 0;
}

.card-poster,
.card-search-poster,
.episode-card-thumb img,
.modal-hero,
.details-hero-bg,
.hero-bg {
  image-rendering: auto;
}

@media (max-width: 768px) {
  .settings-page {
    padding-left: max(1rem, var(--safe-left));
    padding-right: max(1rem, var(--safe-right));
  }

  .settings-section {
    padding: 1.15rem 0;
  }

  .settings-player-row {
    padding: 0.85rem;
  }

  .search-suggestion-row {
    grid-template-columns: 1fr 38px;
  }

  .search-suggestion-delete {
    width: 36px;
    height: 36px;
  }
}

/* Watch page final layout */
body.watch-wrap {
  min-height: 100vh;
  background: #000;
  overflow-x: hidden;
}

.watch-wrap .back-btn {
  position: fixed;
  top: max(0.75rem, var(--safe-top));
  left: max(0.75rem, var(--safe-left));
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 40px;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  background: rgba(0, 5, 13, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  font-weight: 800;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.watch-wrap .back-btn:hover {
  background: rgba(55, 241, 163, 0.18);
  border-color: rgba(55, 241, 163, 0.45);
}

.watch-wrap .player-wrap,
.watch-wrap .watch-player-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: none;
  min-height: 0;
  background: #000;
  overflow: hidden;
}

.watch-wrap #player,
.watch-wrap .player-iframe {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

/* Mobile fullscreen auto-rotate */
@media (max-width: 768px) {
  .watch-wrap .player-wrap:fullscreen,
  .watch-wrap .watch-player-wrap:fullscreen {
    width: 100vw;
    height: 100vh;
  }
  
  .watch-wrap .player-wrap:fullscreen #player,
  .watch-wrap .watch-player-wrap:fullscreen .player-iframe {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
}

/* Video player controls optimization for mobile */
@media (max-width: 768px) {
  .watch-wrap .player-wrap iframe,
  .watch-wrap .watch-player-wrap iframe {
    /* Ensure iframe scales properly on mobile */
    max-width: 100%;
    max-height: 100%;
  }
  
  /* Optimize embedded player controls for mobile */
  .watch-wrap .player-wrap,
  .watch-wrap .watch-player-wrap {
    /* Allow iframe to handle its own controls scaling */
    contain: layout style;
  }
}

/* Fullscreen orientation lock for mobile */
@media (max-width: 768px) and (orientation: portrait) {
  .watch-wrap .player-wrap:fullscreen,
  .watch-wrap .watch-player-wrap:fullscreen {
    /* Suggest landscape orientation when fullscreen */
    transform: rotate(90deg);
    transform-origin: center center;
    width: 100vh;
    height: 100vw;
    position: fixed;
    top: 0;
    left: 0;
  }
}

/* Ensure video player iframe scales controls properly on mobile */
@media (max-width: 768px) {
  .player-wrap,
  .watch-player-wrap {
    /* Add viewport meta equivalent for iframe content */
    isolation: isolate;
  }
  
  .player-iframe,
  #player {
    /* Ensure iframe respects mobile viewport */
    width: 100% !important;
    height: 100% !important;
    min-width: 100%;
    min-height: 100%;
  }
}

/* Mobile video controls optimization - target embedded player */
@media (max-width: 768px) {
  /* Help embedded player (Vidking) scale its controls */
  .watch-wrap .player-wrap,
  .watch-wrap .watch-player-wrap {
    font-size: 14px; /* Base font size for iframe to inherit */
  }
  
  /* Ensure fullscreen works properly */
  .watch-wrap .player-wrap:fullscreen iframe,
  .watch-wrap .watch-player-wrap:fullscreen iframe {
    width: 100vw !important;
    height: 100vh !important;
  }
}

.watch-wrap .watch-info {
  max-width: 980px;
  padding: 1.5rem var(--page-pad-x) 2.5rem;
  color: var(--text);
}

.watch-wrap .watch-title {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  line-height: 1.15;
  margin-bottom: 0.45rem;
}

.watch-wrap .watch-ep,
.watch-wrap .watch-desc {
  color: var(--text-muted);
}

.watch-wrap .watch-desc {
  max-width: 760px;
  line-height: 1.6;
}

@media (min-width: 1200px) {
  .watch-wrap .player-wrap,
  .watch-wrap .watch-player-wrap {
    height: min(72vh, calc(100vh - 10rem));
    aspect-ratio: auto;
  }
}

@media (max-width: 768px) {
  .watch-wrap .back-btn {
    top: max(0.55rem, var(--safe-top));
    left: max(0.55rem, var(--safe-left));
    min-height: 36px;
    padding: 0.42rem 0.65rem;
    font-size: 0.9rem;
  }

  .watch-wrap .player-wrap,
  .watch-wrap .watch-player-wrap {
    margin-top: 0;
    aspect-ratio: 16 / 9;
  }

  .watch-wrap .watch-info {
    padding: 1rem var(--page-pad-x) calc(1.5rem + var(--safe-bottom));
  }
}

/* PWA install UI */
.pwa-install-fab {
  position: fixed;
  right: max(1rem, var(--safe-right));
  bottom: max(1rem, var(--safe-bottom));
  z-index: 96;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.68rem 1rem;
  border: 1px solid rgba(55, 241, 163, 0.32);
  border-radius: 999px;
  background: rgba(0, 5, 13, 0.88);
  color: #fff;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.42), 0 0 24px rgba(55, 241, 163, 0.16);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor: pointer;
}

.pwa-install-fab i {
  color: var(--accent);
}

.pwa-install-fab[hidden],
.is-standalone .pwa-install-fab {
  display: none !important;
}

.has-tab-bar .pwa-install-fab {
  bottom: calc(var(--tab-bar-height) + var(--safe-bottom) + 12px);
}

.pwa-install-prompt {
  position: fixed;
  inset: 0;
  z-index: 299;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.pwa-install-prompt[hidden] {
  display: none !important;
}

.pwa-install-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.pwa-install-card {
  position: relative;
  z-index: 1;
  width: min(418px, 100%);
  padding: 1.55rem 1.2rem 1.25rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(180deg, rgba(28, 28, 28, 0.98), rgba(13, 13, 13, 0.98));
  color: #fff;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.72);
}

.pwa-install-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 1.35rem;
  font-weight: 800;
  cursor: pointer;
}

.pwa-install-preview {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.pwa-install-preview img {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5);
}

.pwa-install-card h3 {
  margin: 0 0 0.5rem;
  text-align: center;
  font-size: 1.45rem;
  line-height: 1.2;
}

.pwa-install-sub {
  margin: 0 0 1.2rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.64);
  line-height: 1.45;
}

.pwa-install-benefits {
  display: grid;
  gap: 0.72rem;
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}

.pwa-install-benefits li {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
}

.pwa-install-benefits i {
  width: 1.05rem;
  color: var(--accent);
  text-align: center;
}

.pwa-install-actions {
  display: grid;
  gap: 0.55rem;
}

.pwa-install-actions .btn {
  width: 100%;
  min-height: 44px;
}

.pwa-install-actions .btn-primary {
  background: #fff;
  color: #000;
}

.pwa-install-actions .btn-secondary {
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
}

.pwa-install-hint {
  margin: 0.85rem 0 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.84rem;
  line-height: 1.45;
}

.pwa-install-hint.is-visible {
  color: #fff;
}

@media (max-width: 768px) {
  .pwa-install-fab {
    display: inline-flex !important;
    bottom: calc(var(--tab-bar-height) + var(--safe-bottom) + 12px);
    right: max(0.8rem, var(--safe-right));
    min-height: 42px;
    padding: 0.6rem 0.85rem;
  }

  .pwa-install-card {
    width: min(418px, calc(100vw - 1rem));
  }
}

/* Mobile install guide */
body.mobile-install-open {
  overflow: hidden;
}

.mobile-install-prompt {
  position: fixed;
  inset: 0;
  z-index: 310;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  padding-bottom: calc(var(--tab-bar-height) + var(--safe-bottom) + 3.25rem);
}

.mobile-install-prompt[hidden] {
  display: none !important;
}

.mobile-install-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.mobile-install-card {
  position: relative;
  z-index: 1;
  width: min(420px, calc(100vw - 1.2rem));
  max-height: min(82vh, 720px);
  overflow-y: auto;
  padding: 1.65rem 1.25rem 1.25rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(180deg, rgba(27, 27, 27, 0.98), rgba(13, 13, 13, 0.98));
  color: #fff;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.74);
}

.mobile-install-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.mobile-install-preview {
  display: flex;
  justify-content: center;
  margin: 0.2rem 0 1.25rem;
}

.mobile-install-preview img {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
}

.mobile-install-card h3 {
  margin: 0 0 0.65rem;
  text-align: center;
  font-size: clamp(1.65rem, 7vw, 2.6rem);
  line-height: 1.12;
}

.mobile-install-sub {
  margin: 0 auto 1.65rem;
  max-width: 34rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.62);
  font-size: clamp(1rem, 4.2vw, 1.45rem);
  line-height: 1.35;
}

.mobile-install-steps {
  display: grid;
  gap: 1.15rem;
  margin: 0 0 1.55rem;
  padding: 0;
  list-style: none;
}

.mobile-install-steps li {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 0.85rem;
  align-items: start;
  font-size: clamp(1rem, 4.4vw, 1.32rem);
  line-height: 1.35;
}

.mobile-step-num {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #d82d2d;
  color: #fff;
  font-weight: 900;
}

.mobile-install-steps strong {
  color: #fff;
}

.mobile-install-steps small {
  display: block;
  margin-top: 0.2rem;
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.82em;
}

.mobile-share-icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin: 0 0.2rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.16);
  vertical-align: middle;
}

.mobile-install-actions {
  display: grid;
  gap: 0.75rem;
}

.mobile-install-actions .btn {
  width: 100%;
  min-height: 58px;
  font-size: 1.12rem;
}

.mobile-install-actions .btn-primary {
  background: #fff;
  color: #000;
}

.mobile-install-actions .btn-secondary {
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
}

.mobile-install-pointer {
  position: fixed;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 1.3rem);
  z-index: 2;
  transform: translateX(-50%);
  color: #d82d2d;
  font-size: 2rem;
  animation: mobileInstallBounce 1.2s ease-in-out infinite;
}

@keyframes mobileInstallBounce {
  0%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(10px);
  }
}

@media (min-width: 769px) {
  .mobile-install-prompt {
    display: none !important;
  }
}

/* Watch page: keep the global navbar and give the player proper room */
.page-watch #navbar,
.page-watch #navbar.scrolled,
body.page-watch.is-searching #navbar {
  display: flex !important;
  background: rgba(0, 5, 13, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}

body.watch-wrap {
  background: #000;
}

.watch-wrap .back-btn,
.page-watch .navbar-watch {
  display: none !important;
}

.watch-wrap .watch-main {
  min-height: 100vh;
  padding-top: calc(var(--nav-height) + var(--safe-top));
  background: #000;
}

.watch-wrap .player-wrap,
.watch-wrap .watch-player-wrap {
  width: 100%;
  height: min(82vh, calc(100vh - var(--nav-height) - var(--safe-top) - 0.75rem));
  min-height: min(560px, calc(100vh - var(--nav-height) - var(--safe-top) - 0.75rem));
  aspect-ratio: auto;
  margin: 0;
  background: #000;
}

.watch-wrap .watch-info {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.25rem var(--page-pad-x) 2.25rem;
  background: transparent;
}

.watch-wrap .watch-title {
  font-size: clamp(1.45rem, 2.4vw, 2.25rem);
}

.watch-wrap .watch-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
  align-items: center;
  margin: 0.35rem 0 0.85rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.watch-wrap .watch-meta .fa-star {
  margin-right: 0.25rem;
  color: var(--accent-yellow);
}

@media (max-width: 768px) {
  .page-watch #navbar {
    display: flex !important;
  }

  .watch-wrap .watch-main {
    padding-top: calc(var(--nav-height) + var(--safe-top));
  }

  .watch-wrap .player-wrap,
  .watch-wrap .watch-player-wrap {
    height: auto;
    min-height: 0;
    aspect-ratio: 16 / 9;
  }

  .watch-wrap .watch-info {
    padding: 1rem var(--page-pad-x) calc(1.35rem + var(--safe-bottom));
  }
}

/* ── Global Popups (Adblock & Cookies) ── */
.sys-popup {
  position: fixed;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 9999;
  background: rgba(10, 15, 25, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.85rem 1.25rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 90vw;
  width: max-content;
}

.sys-popup.show {
  opacity: 1;
  pointer-events: auto;
}

.sys-popup.top {
  top: calc(1rem + var(--safe-top));
  transform: translateX(-50%) translateY(-20px);
}

.sys-popup.bottom {
  bottom: calc(1.5rem + var(--safe-bottom));
}

.sys-popup.show.top, .sys-popup.show.bottom {
  transform: translateX(-50%) translateY(0);
}

.sys-popup-icon {
  font-size: 1.25rem;
  color: var(--primary-red);
}

.sys-popup-text {
  font-size: 0.85rem;
  color: #d1d5db;
  line-height: 1.4;
}

.sys-popup-text strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
  color: #fff;
}

.sys-popup-btn {
  background: var(--primary-red);
  border: none;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.sys-popup-btn:hover {
  background: #ff2a2a;
}

@media (max-width: 480px) {
  .sys-popup {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }
  .sys-popup-btn {
    width: 100%;
  }
}
