/* ── Reset & base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --accent:   #0099cc;   /* Mrpoo blue */
  --bg:       #141414;
  --bg-card:  #1a1a1a;
  --text:     #ffffff;
  --text-dim: #a3a3a3;
  --nav-h:    140px;
}

html { scroll-behavior: smooth; }

/* Hide scrollbar globally while keeping scroll functionality */
html::-webkit-scrollbar { display: none; }
html { -ms-overflow-style: none; scrollbar-width: none; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  overflow-x: hidden;
}

body:not(.player-body):not(.profiles-page) {
  animation: mm-page-fade 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; }

/* ── Navbar ───────────────────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 900;
  height: var(--nav-h);
  padding: 0 4%;
  display: flex;
  align-items: center;
  gap: 32px;
  background: transparent;
  transition: background 0.4s;
}
.navbar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: calc(var(--nav-h) + 80px);
  pointer-events: none;
  z-index: -1;
  background: linear-gradient(to bottom,
    rgba(0,0,0,0.92) 0%,
    rgba(0,0,0,0.78) 30%,
    rgba(0,0,0,0.45) 60%,
    rgba(0,0,0,0.18) 82%,
    rgba(0,0,0,0)    100%);
}
.navbar.scrolled { background: transparent; box-shadow: none; }
.navbar.scrolled::before { display: block; }

.navbar-logo .logo-img {
  height: 120px;
  width: auto;
  object-fit: contain;
}

.logo-text {
  font-size: 1.7rem;
  font-weight: 800;
  color: #38b6ff;
  letter-spacing: -0.5px;
}

/* ── Nav links — Netflix-style clean flat text ── */
.navbar-nav {
  display: flex;
  list-style: none;
  gap: 4px;
  flex: 1;
}

.navbar-nav a {
  position: relative;
  font-size: 18px;
  font-weight: 500;
  color: rgba(255,255,255,0.65);
  padding: 6px 14px;
  transition: color 0.15s;
  white-space: nowrap;
}

/* Red sliding underbar */
.navbar-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 14px;
  right: 14px;
  height: 3px;
  background: #4db8ff;
  border-radius: 999px;
  transform: scaleX(0);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: center;
}

.navbar-nav a:hover {
  color: rgba(255,255,255,0.9);
}

.navbar-nav a:hover::after,
.navbar-nav a.active::after {
  transform: scaleX(1);
}

.navbar-nav a.active {
  font-weight: 700;
  color: #ffffff;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: auto;
}

/* Search */
.search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  color: #fff;
  display: flex;
  align-items: center;
  padding: 8px;
  border-radius: 50%;
  background: transparent;
  transition: background 0.2s, color 0.2s;
}

.icon-btn:hover { background: rgba(255,255,255,0.12); }

.search-bar {
  display: none;
  align-items: center;
  background: rgba(18,18,18,0.88);
  border: 1.5px solid rgba(255,255,255,0.22);
  padding: 6px 14px;
  border-radius: 24px;
  position: relative;
  width: min(420px, calc(100vw - 132px));
  box-sizing: border-box;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.search-bar.open {
  display: flex;
  animation: searchExpand 0.2s cubic-bezier(0.25,0.46,0.45,0.94);
}

@keyframes searchExpand {
  from { opacity: 0; transform: scaleX(0.88); transform-origin: right; }
  to   { opacity: 1; transform: scaleX(1); }
}

.search-bar:focus-within {
  border-color: rgba(255,255,255,0.55);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.07);
}

.search-bar input {
  background: none;
  border: none;
  color: #fff;
  font-size: 14px;
  outline: none;
  width: 100%;
  min-width: 0;
}

.search-bar input::placeholder { color: rgba(255,255,255,0.42); }

/* Profile avatar button */
.profile-wrap {
  position: relative;
}

.profile-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 10px 4px 4px;
  border-radius: 24px;
  transition: background 0.2s;
}
.profile-btn:hover { background: rgba(255,255,255,0.1); }
.profile-btn[aria-expanded="true"] { background: rgba(255,255,255,0.12); }

.profile-avatar-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 2px solid transparent;
  transition: border-color 0.2s;
}
.profile-btn:hover .profile-avatar-img,
.profile-btn[aria-expanded="true"] .profile-avatar-img {
  border-color: rgba(255,255,255,0.5);
}
.profile-avatar-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-initials {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}
.profile-chevron { transition: transform 0.2s; flex-shrink: 0; }
.profile-btn[aria-expanded="true"] .profile-chevron { transform: rotate(180deg); }

/* Profile dropdown */
.profile-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 248px;
  background: rgba(16,16,16,0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.11);
  border-radius: 14px;
  padding: 8px 0;
  z-index: 1000;
  box-shadow: 0 20px 60px rgba(0,0,0,0.75), 0 0 0 0.5px rgba(255,255,255,0.04);
  animation: dropdownIn 0.18s cubic-bezier(0.25,0.46,0.45,0.94);
}

@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.profile-dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}
.profile-dropdown-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.18);
}
.profile-dropdown-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-dropdown-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}
.profile-dropdown-role {
  font-size: 11px;
  color: var(--accent);
  font-weight: 500;
  margin-top: 2px;
}
.profile-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin: 4px 0;
}
.profile-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 18px;
  font-size: 13px;
  color: rgba(255,255,255,0.78);
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-align: left;
  border-radius: 0;
}
.profile-dropdown-item:hover { background: rgba(255,255,255,0.09); color: #fff; }
.profile-upload-label { cursor: pointer; }
.profile-signout { color: #ff6b6b; }
.profile-signout:hover { background: rgba(255,107,107,0.1); color: #ff8585; }

/* ── Notification center ─────────────────────────────────────────────────── */
.notif-wrap { position: relative; }

.notif-btn {
  position: relative;
}
.notif-btn.has-unread svg {
  color: #fff;
  filter: drop-shadow(0 0 6px rgba(56,182,255,0.45));
}
.notif-btn[aria-expanded="true"] { background: rgba(255,255,255,0.12); }

.notif-badge {
  position: absolute;
  top: 2px;
  right: 0px;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 10px;
  background: linear-gradient(180deg, #38b6ff 0%, #1a8fff 100%);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  border: 2px solid #0a0a0a;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5), 0 0 8px rgba(56,182,255,0.45);
}
.notif-badge[hidden] { display: none; }

.notif-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 360px;
  max-width: calc(100vw - 24px);
  background: rgba(16,16,16,0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.11);
  border-radius: 14px;
  z-index: 1000;
  box-shadow: 0 20px 60px rgba(0,0,0,0.75), 0 0 0 0.5px rgba(255,255,255,0.04);
  animation: dropdownIn 0.18s cubic-bezier(0.25,0.46,0.45,0.94);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
/* `display: flex` above overrides the UA `[hidden] { display: none }` rule, so
   force-hide the panel whenever the `hidden` attribute is present. */
.notif-dropdown[hidden] { display: none; }

.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.notif-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}
.notif-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: none;
  border: none;
  border-radius: 6px;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.notif-close:hover { background: rgba(255,255,255,0.08); color: #fff; }

.notif-list {
  max-height: 480px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.18) transparent;
}
.notif-list::-webkit-scrollbar { width: 6px; }
.notif-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 3px; }
.notif-list::-webkit-scrollbar-track { background: transparent; }

.notif-empty {
  padding: 30px 16px;
  text-align: center;
  font-size: 12.5px;
  color: rgba(255,255,255,0.45);
}

.notif-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.15s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: rgba(255,255,255,0.05); }
.notif-item:hover .notif-name { color: #fff; }

.notif-thumb {
  position: relative;
  width: 42px;
  height: 63px;
  border-radius: 5px;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.notif-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.notif-thumb-fallback {
  font-size: 16px;
  font-weight: 700;
  color: rgba(255,255,255,0.3);
}
.notif-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #38b6ff;
  box-shadow: 0 0 0 2px rgba(16,16,16,0.95), 0 0 6px rgba(56,182,255,0.6);
}

.notif-body {
  flex: 1;
  min-width: 0;
}
.notif-name {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s;
}
.notif-item.is-new .notif-name { color: #fff; }
.notif-meta {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  margin-top: 2px;
}
.notif-time {
  font-size: 10.5px;
  color: rgba(255,255,255,0.32);
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 480px) {
  .notif-dropdown {
    width: calc(100vw - 24px);
    right: -8px;
  }
}

/* ── Login page ───────────────────────────────────────────────────────────── */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #141414;
}

.login-bg {
  position: fixed;
  inset: -20px; /* overshoot edges to hide blur bleed */
  background:
    linear-gradient(to bottom, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.72) 100%),
    url('/images/the_netflix_login_background__canada__2024___by_logofeveryt_dh0w8qv-pre.jpg') center/cover no-repeat;
  z-index: 0;
  filter: blur(6px);
  -webkit-filter: blur(6px);
}
.login-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255,255,255,0.04) 0%,
    rgba(255,255,255,0.00) 50%,
    rgba(255,255,255,0.03) 100%
  );
  pointer-events: none;
}

.login-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 440px;
  padding: 20px;
}

.login-logo { margin-bottom: 28px; }
.login-logo img { height: 140px; display: block; }

.login-card {
  width: 100%;
  background: rgba(0,0,0,0.78);
  border-radius: 10px;
  padding: 48px 44px 40px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

.login-title { font-size: 2rem; font-weight: 700; margin-bottom: 28px; color: #fff; }

.login-error {
  background: rgba(56,182,255,0.15);
  border: 1px solid rgba(56,182,255,0.4);
  color: #ff6b6b;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 0.88rem;
  margin-bottom: 20px;
}

.login-form { display: flex; flex-direction: column; gap: 20px; }

.login-field { position: relative; }

.login-field input {
  width: 100%;
  background: #333;
  border: none;
  border-bottom: 2px solid #555;
  border-radius: 4px 4px 0 0;
  color: #fff;
  font-size: 1rem;
  padding: 24px 14px 8px;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}
.login-field input:focus { border-bottom-color: var(--accent); }

.login-field label {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  color: #aaa;
  font-size: 1rem;
  pointer-events: none;
  transition: top 0.15s, font-size 0.15s, color 0.15s;
}
.login-field input:focus + label,
.login-field input:not(:placeholder-shown) + label {
  top: 10px;
  font-size: 0.72rem;
  color: var(--accent);
  transform: none;
}

.login-btn {
  margin-top: 8px;
  background: #38b6ff;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  padding: 14px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}
.login-btn:hover { background: #c40812; }

@media (max-width: 500px) {
  .login-card { padding: 32px 24px 28px; }
}

/* ── Profile select ("Who's watching?") ─────────────────────────────────── */
.profiles-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a0a;
}

.profiles-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px 60px;
  width: 100%;
}

.profiles-heading {
  font-size: 3.4rem;
  font-weight: 400;
  color: #fff;
  margin: 28px 0 48px;
  letter-spacing: 0.01em;
}

.profiles-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  justify-content: center;
  max-width: 900px;
}

.profile-card-form { display: contents; }

.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: #808080;
  transition: color 0.15s;
}
.profile-card:hover { color: #fff; }

.profile-card-avatar {
  width: 140px;
  height: 140px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  border: 3px solid transparent;
  transition: border-color 0.15s;
  background: #333;
  display: flex;
  align-items: center;
  justify-content: center;
}
.profile-card:hover .profile-card-avatar {
  border-color: #fff;
}

.profile-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-card-initials {
  display: none;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #0099cc 0%, #005f80 100%);
}

.profile-card-name {
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  transition: color 0.15s;
}

/* ── Manage-mode profile item (card + delete button together) ─────────── */
.profile-manage-item {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}

.profile-card--edit {
  text-decoration: none;
  color: #808080;
}
.profile-card--edit:hover { color: #fff; }

.profile-edit-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
  border-radius: 6px;
}
.profile-card--edit:hover .profile-edit-overlay { opacity: 1; }

.profile-delete-form { display: contents; }

.profile-delete-btn {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #38b6ff;
  color: #fff;
  border: none;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background 0.15s, transform 0.15s;
  line-height: 1;
}
.profile-delete-btn:hover { background: #ff2d3a; transform: scale(1.1); }

/* ── Add-profile card ─────────────────────────────────────────────────── */
.profile-card--add {
  text-decoration: none;
  color: #808080;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.profile-card--add:hover { color: #fff; }

.profile-card-avatar--add {
  background: rgba(255,255,255,0.08) !important;
  border: 3px dashed rgba(255,255,255,0.25) !important;
  transition: border-color 0.15s, background 0.15s;
  color: rgba(255,255,255,0.4);
}
.profile-card--add:hover .profile-card-avatar--add {
  border-color: #fff !important;
  background: rgba(255,255,255,0.15) !important;
  color: #fff;
}

/* ── "Manage Profiles" / "Done" button below the grid ────────────────── */
.profiles-actions {
  margin-top: 40px;
}
.profiles-manage-btn {
  display: inline-block;
  padding: 9px 28px;
  border: 2px solid rgba(255,255,255,0.5);
  color: rgba(255,255,255,0.7);
  background: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.profiles-manage-btn:hover {
  border-color: #fff;
  color: #fff;
}

/* ── Empty-state on profiles page ────────────────────────────────────── */
.profiles-empty {
  color: #808080;
  font-size: 1rem;
}
.profiles-empty a {
  color: var(--accent, #4db8ff);
  text-decoration: underline;
}

/* ── Profile add/edit form ────────────────────────────────────────────── */
.profile-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  width: 100%;
  max-width: 360px;
}

.profile-form-avatar {
  cursor: pointer;
}

.profile-form-avatar-preview {
  width: 140px;
  height: 140px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  background: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid rgba(255,255,255,0.2);
  transition: border-color 0.15s;
}
.profile-form-avatar:hover .profile-form-avatar-preview {
  border-color: #fff;
}
.profile-form-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.profile-form-avatar-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  opacity: 0;
  transition: opacity 0.15s;
}
.profile-form-avatar:hover .profile-form-avatar-overlay { opacity: 1; }

.profile-form-field {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-form-label {
  color: rgba(255,255,255,0.55);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-form-input {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  color: #fff;
  font-size: 1.1rem;
  padding: 12px 16px;
  width: 100%;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s;
}
.profile-form-input:focus {
  border-color: var(--accent, #4db8ff);
}
.profile-form-input::placeholder { color: rgba(255,255,255,0.25); }

.profile-form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

.profile-form-save {
  background: #fff;
  color: #000;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 700;
  padding: 11px 32px;
  cursor: pointer;
  transition: background 0.15s;
}
.profile-form-save:hover { background: #e0e0e0; }

.profile-form-cancel {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 11px 8px;
}
.profile-form-cancel:hover { color: #fff; }

.profile-form-delete-wrap { display: contents; }

.profile-form-delete {
  background: none;
  color: #38b6ff;
  border: 2px solid #38b6ff;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 9px 18px;
  cursor: pointer;
  margin-left: auto;
  transition: background 0.15s, color 0.15s;
}
.profile-form-delete:hover {
  background: #38b6ff;
  color: #fff;
}

@media (max-width: 600px) {
  .profiles-heading { font-size: 2.2rem; }
  .profile-card-avatar { width: 100px; height: 100px; }
  .profiles-grid { gap: 18px; }
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  height: 100vh;
  min-height: 520px;
  display: flex;
  align-items: flex-end;
  padding-bottom: 120px;
  overflow: hidden;
}

/* ── Hero slide layers ───────────────────────────────────────────────────── */
.hero-slides {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  opacity: 0;
  transition: opacity 1.4s ease;
}
.hero-slide.active { opacity: 1; }

/* Two-layer vignette matching Netflix */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to right, rgba(0,0,0,0.7) 0%, transparent 60%);
}

.hero-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, #141414 0%, rgba(20,20,20,0.6) 40%, transparent 80%);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 0 4%;
  max-width: 680px;
}

/* Content text fade on slide change */
.hero-title,
.hero-desc {
  transition: opacity 0.3s ease;
}
.hero-content-fade {
  opacity: 0 !important;
}

.hero-title {
  font-size: clamp(2rem, 4.5vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  text-shadow: 2px 2px 8px rgba(0,0,0,0.6);
  margin-bottom: 18px;
}

.hero-desc {
  font-size: 1.1rem;
  line-height: 1.6;
  color: #ddd;
  margin-bottom: 26px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Slide indicator dots */
.hero-dots {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}
.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.3s, transform 0.3s;
}
.hero-dot.active {
  background: #fff;
  transform: scale(1.3);
}

/* Play button */
.btn-play {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: #000;
  font-size: 1rem;
  font-weight: 700;
  padding: 10px 30px;
  border-radius: 4px;
  transition: background 0.2s;
}

.btn-play:hover { background: rgba(255,255,255,0.78); }

/* More Info button */
.btn-info {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(109,109,110,0.65);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  padding: 10px 30px;
  border-radius: 4px;
  transition: background 0.2s;
}

.btn-info:hover { background: rgba(109,109,110,0.4); }

/* ── Content rows ─────────────────────────────────────────────────────────── */
.content {
  padding-bottom: 60px;
  /* negative margin pulls rows up over the hero fade */
  margin-top: -80px;
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.content-section {
  padding: 0 4% 24px;
  position: relative;
}

.row-title {
  font-size: 1.28rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 14px;
  letter-spacing: 0.01em;
}

.row-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 10px 0 14px;
  scrollbar-width: none;
  mask-image: linear-gradient(to right, transparent 0, black 28px, black calc(100% - 28px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0, black 28px, black calc(100% - 28px), transparent 100%);
  scroll-behavior: auto;
}

.row-scroll-loop {
  overflow-x: hidden;
}

.row-scroll::-webkit-scrollbar { display: none; }

/* ── Card ─────────────────────────────────────────────────────────────────── */
.card {
  position: relative;
  flex-shrink: 0;
  width: 170px;
  border-radius: 6px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  transform-origin: center bottom;
}

.card:hover {
  transform: scale(1.16) translateY(-4px);
  z-index: 20;
  box-shadow: 0 10px 30px rgba(0,0,0,0.8);
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--bg-card);
}

.card-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  height: auto;
  /* Skeleton shimmer while image loads */
  background: #1a1a1a;
  overflow: hidden;
}

.card-img-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.06) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
  z-index: 0;
  pointer-events: none;
}

.card-img-wrap.img-loaded::before {
  display: none;
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

/* Player animations */
@keyframes vp-shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}

@keyframes vp-dot-pulse {
  0%, 100% { box-shadow: 0 0 10px rgba(56,182,255,0.8), 0 2px 6px rgba(0,0,0,0.5); }
  50%       { box-shadow: 0 0 18px rgba(56,182,255,1),   0 0 30px rgba(56,182,255,0.5); }
}

.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: transparent;
  /* Start invisible, fade in when loaded */
  opacity: 0;
  transition: opacity 0.4s ease;
  position: relative;
  z-index: 1;
}

.card-img-wrap img.img-loaded {
  opacity: 1;
}

.card-img-fallback {
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(31,41,55,0.95) 0%, rgba(17,24,39,0.98) 100%);
  border: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.28);
  user-select: none;
}

.card-img-fallback-icon {
  width: 42px;
  height: 42px;
}

/* Card video preview on hover */
.card-video-wrap {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}
.card-video-wrap.visible { opacity: 1; }

.card-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-video-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.6s ease;
  z-index: 1;
  pointer-events: none;
}
.card-video-preview.visible { opacity: 1; }

/* Transparent full-card link */
.card-link {
  position: absolute;
  inset: 0;
  z-index: 2;
}

/* Hover overlay */
.card-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.6) 70%, transparent 100%);
  padding: 10px 10px 8px;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card:hover .card-overlay { opacity: 1; }

.card-actions {
  display: flex;
  gap: 6px;
  margin-bottom: 4px;
}

.card-play-btn {
  width: 26px;
  height: 26px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 3;
  position: relative;
}

.card-play-btn:hover { background: rgba(255,255,255,0.78); }

.card-like-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #aaa;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s;
  z-index: 3;
  position: relative;
}

.card-like-btn:hover { border-color: #fff; }

.card-title {
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  font-size: 0.7rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Rating badge (e.g. PG-13, TV-MA) */
.card-rating-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,0.45);
  border-radius: 2px;
  padding: 0 4px;
  line-height: 1.5;
  color: rgba(255,255,255,0.8);
  vertical-align: middle;
  letter-spacing: 0.03em;
}

/* Resume % badge */
.card-resume-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(56,182,255,0.85);
  color: #fff;
  border-radius: 3px;
  padding: 0 6px;
  height: 22px;
  letter-spacing: 0.02em;
  z-index: 3;
  position: relative;
}

/* Overview snippet — shown in hover overlay */
.card-overview {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.75);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

/* Watch progress bar at bottom of card thumbnail */
.card-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255,255,255,0.18);
  z-index: 4;
}

.card-progress-fill {
  height: 100%;
  background: #38b6ff;
  border-radius: 0 2px 2px 0;
  min-width: 2px;
}

/* ── Browse page ──────────────────────────────────────────────────────────── */
.browse-page {
  padding-top: calc(var(--nav-h) + 24px);
  padding-bottom: 80px;
  min-height: 100vh;
  background: #141414;
}

.browse-title {
  font-size: 1.6rem;
  font-weight: 700;
  padding: 0 4% 18px;
  letter-spacing: 0.01em;
  color: #fff;
}

/* ── Browse grid — Netflix landscape cards ────────────────────────────────── */
.browse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px 10px;
  padding: 0 4%;
}

/* Force landscape (16:9) image wrappers in the browse grid */
.browse-grid .card {
  width: 100%;
  transform-origin: center center;
}

.browse-grid .card .card-img-wrap {
  height: auto;
  aspect-ratio: 2 / 3;
}

.browse-grid .card .card-img-wrap img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  /* preserve fade-in from base rule */
}

.browse-grid .card .card-img-fallback {
  aspect-ratio: 2 / 3;
  height: auto;
  font-size: 2.2rem;
}

/* Browse card hover — bigger pop with bottom info */
.browse-grid .card:hover {
  transform: scale(1.08) translateY(-6px);
  z-index: 20;
  box-shadow: 0 16px 40px rgba(0,0,0,0.85);
}

.browse-grid .card .card-overlay {
  padding: 14px 10px 10px;
}

.browse-grid .card .card-title {
  font-size: 0.85rem;
}

.browse-grid .card .card-meta {
  font-size: 0.72rem;
}

/* Hide overview on very small cards; show on browse grid */
.browse-grid .card .card-overview {
  display: -webkit-box;
  -webkit-line-clamp: 2;
}

/* Keep overview hidden on home-page row cards (too small) */
.card-row .card .card-overview {
  display: none;
}

/* ── A–Z filter bar ────────────────────────────────────────────────────────── */
.alpha-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 4% 18px;
  position: sticky;
  top: 60px;
  z-index: 50;
  background: linear-gradient(to bottom, rgba(10,10,10,0.95) 80%, transparent);
}

.alpha-btn {
  background: rgba(255,255,255,0.07);
  color: var(--text-dim);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  padding: 4px 11px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  letter-spacing: 0.04em;
}

.alpha-btn:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border-color: rgba(255,255,255,0.35);
}

.alpha-btn.active {
  background: var(--accent, #4db8ff);
  color: #000;
  border-color: var(--accent, #4db8ff);
}

.alpha-section {
  margin-bottom: 20px;
}

.alpha-heading {
  font-size: 1.1rem;
  font-weight: 700;
  color: rgba(255,255,255,0.55);
  padding: 6px 4% 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.empty-state {
  padding: 0 4%;
  color: var(--text-dim);
}

/* ── Player (fullscreen Netflix-style) ────────────────────────────────────── */
.player-body {
  background: #000;
  margin: 0;
  overflow: hidden;
}

.vp-root {
  position: fixed;
  inset: 0;
  background: #080808;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: none;
}
.vp-root:hover { cursor: default; }

.vp-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  opacity: 0;
  transform: scale(1.012);
  transition: opacity 0.42s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.vp-root.vp-ready .vp-video {
  opacity: 1;
  transform: scale(1);
}

/* ── Loading overlay ─────────────────────────────────────────────────────── */
.vp-loader {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: linear-gradient(to bottom, rgba(0,0,0,0.38), rgba(0,0,0,0.68));
  backdrop-filter: blur(2px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), backdrop-filter 0.45s ease;
}
.vp-loader.vp-loader-done {
  opacity: 0;
  transform: scale(1.02);
  backdrop-filter: blur(0px);
  pointer-events: none;
}
.vp-loader.vp-loader-recovering .vp-loader-ring {
  animation: vp-loader-spin 1.1s linear infinite;
}

.vp-loader-inner {
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vp-loader-ring {
  position: absolute;
  inset: 0;
  width: 140px;
  height: 140px;
  /* start arc from 12-o'clock */
  transform: rotate(-90deg);
}

/* circumference of r=54: 2π×54 ≈ 339.3 */
.vp-loader-track {
  fill: none;
  stroke: rgba(255,255,255,0.1);
  stroke-width: 6;
}

.vp-loader-arc {
  fill: none;
  stroke: #38b6ff;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 339.3;
  stroke-dashoffset: 339.3;   /* starts empty */
  transition: stroke-dashoffset 0.4s ease;
  filter: drop-shadow(0 0 6px rgba(56,182,255,0.8));
}

.vp-loader-pct {
  position: relative;
  z-index: 1;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
}

.vp-loader-title {
  font-size: 1rem;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.5px;
  max-width: 80vw;
  text-align: center;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

@keyframes vp-loader-spin {
  from { transform: rotate(-90deg); }
  to { transform: rotate(270deg); }
}

/* ── Controls overlay ─────────────────────────────────────────────────────── */
.vp-controls {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  opacity: 0;
  pointer-events: none;          /* don't steal clicks when invisible */
  transition: opacity 0.25s ease;
  z-index: 10;
  background:
    linear-gradient(to bottom,  rgba(0,0,0,0.75) 0%,   transparent 22%),
    linear-gradient(to top,     rgba(0,0,0,0.85) 0%,   transparent 35%);
}
.vp-controls.visible {
  opacity: 1;
  pointer-events: auto;          /* re-enable when visible */
}

/* ── Top bar ──────────────────────────────────────────────────────────────── */
.vp-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 0;
  transform: translateY(-10px);
  transition: transform 0.28s ease;
}
.vp-top-right { display: flex; gap: 8px; }

/* ── Icon button ──────────────────────────────────────────────────────────── */
.vp-icon-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.18s, transform 0.12s, box-shadow 0.18s;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  gap: 4px;
}
.vp-icon-btn:hover {
  background: rgba(255,255,255,0.12);
  transform: scale(1.08);
}
.vp-icon-btn:active {
  background: rgba(255,255,255,0.2);
  transform: scale(0.94);
}
.vp-icon-btn svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
}

/* ── Centre zone ──────────────────────────────────────────────────────────── */
.vp-center-zone {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.vp-tap-zone {
  flex: 1;
  height: 100%;
  background: none;
  border: none;
  cursor: pointer;
  /* pointer-events inherited from .vp-controls — enabled only when visible */
  -webkit-tap-highlight-color: transparent;
}
.vp-play-center {
  pointer-events: all;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1.5px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.vp-play-center:hover {
  background: rgba(56,182,255,0.25);
  border-color: rgba(56,182,255,0.5);
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(56,182,255,0.35), 0 4px 20px rgba(0,0,0,0.4);
}
.vp-play-center:active { transform: scale(0.95); }
.vp-play-center svg { width: 34px; height: 34px; fill: currentColor; }
/* initial icon states are set globally below */

/* ── Bottom bar ───────────────────────────────────────────────────────────── */
.vp-bottom {
  padding: 0 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transform: translateY(10px);
  transition: transform 0.28s ease;
}

.vp-controls.visible .vp-top,
.vp-controls.visible .vp-bottom {
  transform: translateY(0);
}

/* Progress row */
.vp-progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative; /* needed to anchor the thumbnail preview */
}

/* ── Scrub thumbnail preview ──────────────────────────────────────────────── */
.vp-thumb-preview {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 0;
  transform: translateX(-50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.7);
  border: 1.5px solid rgba(255,255,255,0.15);
  background: #000;
  z-index: 50;
}
.vp-thumb-preview.visible { opacity: 1; }

.vp-thumb-canvas {
  display: block;
  width: 192px;
  height: 108px;
}

.vp-thumb-time {
  display: block;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  padding: 4px 8px 5px;
  background: rgba(0,0,0,0.75);
  letter-spacing: 0.04em;
}
.vp-progress-bg {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.18);
  border-radius: 10px;
  position: relative;
  cursor: pointer;
  transition: height 0.1s ease;
}
/* Large invisible touch/click target — keeps visual bar thin */
.vp-progress-bg::before {
  content: '';
  position: absolute;
  top: -14px;
  bottom: -14px;
  left: 0;
  right: 0;
}
.vp-progress-bg:hover,
.vp-root.vp-scrubbing .vp-progress-bg { height: 6px; }
.vp-progress-buf {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: rgba(255,255,255,0.28);
  border-radius: 10px;
  width: 0;
  transition: width 0.4s ease;
}
.vp-progress-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, #1a7fc4 0%, #38b6ff 55%, #6dceff 100%);
  border-radius: 10px;
  width: 0;
  box-shadow: 0 0 8px rgba(56,182,255,0.7), 0 0 18px rgba(56,182,255,0.3);
  overflow: hidden;
}
.vp-progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.18) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: vp-shimmer 2.2s linear infinite;
}
.vp-progress-dot {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translate(-50%, -50%) scale(0.5);
  width: 16px;
  height: 16px;
  background: #fff;
  border: 2.5px solid #38b6ff;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 10px rgba(56,182,255,0.8), 0 2px 6px rgba(0,0,0,0.5);
}
.vp-progress-bg:hover .vp-progress-dot {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  animation: vp-dot-pulse 1.8s ease-in-out infinite;
}
/* While actively dragging: no pulse, just solid dot at exact position */
.vp-root.vp-scrubbing .vp-progress-dot {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  animation: none;
  transition: none;
}

.vp-time-remain {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.9);
  white-space: nowrap;
  min-width: 100px;
  text-align: right;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

/* Control row */
.vp-control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.vp-ctrl-left,
.vp-ctrl-right {
  display: flex;
  align-items: center;
  gap: 4px;
}
.vp-skip-btn svg text { font-family: sans-serif; font-weight: 700; }

/* ── Volume group (mute btn + slider) ───────────────────────────────────────── */
.vp-vol-group {
  display: flex;
  align-items: center;
  gap: 0;
}

.vp-vol-slider {
  --vp-vol-pct: 100%;
  -webkit-appearance: none;
  appearance: none;
  width: 0;
  max-width: 80px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, #38b6ff var(--vp-vol-pct), rgba(255,255,255,0.3) var(--vp-vol-pct));
  outline: none;
  cursor: pointer;
  overflow: visible;
  opacity: 0;
  transition: width 0.2s ease, opacity 0.2s ease;
  pointer-events: none;
}

/* Expand when hovering the whole group */
.vp-vol-group:hover .vp-vol-slider,
.vp-vol-group:focus-within .vp-vol-slider {
  width: 72px;
  opacity: 1;
  pointer-events: auto;
  margin-left: 4px;
}

/* Thumb — WebKit */
.vp-vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.5);
  cursor: pointer;
  transition: transform 0.1s;
}
.vp-vol-slider::-webkit-slider-thumb:hover { transform: scale(1.25); }

/* Thumb — Firefox */
.vp-vol-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: none;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.5);
  cursor: pointer;
}

.vp-title-center {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  text-align: center;
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding: 0 12px;
}

/* hide pause icon & exit-fullscreen icon initially */
.vp-pause-icon { display: none; }
.vp-fs-exit    { display: none; }

/* (skip buttons removed) */
.vp-skip-label {
  display: none;
}
.vp-speed-label { font-size: 12px; font-weight: 700; letter-spacing: 0.02em; }

.vp-speed-popup {
  position: absolute;
  bottom: 90px;
  right: 60px;
  background: rgba(10,10,10,0.94);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 6px 0;
  display: flex;
  flex-direction: column;
  z-index: 20;
  min-width: 110px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.85), 0 0 0 0.5px rgba(255,255,255,0.04);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: vpPanelIn 0.18s cubic-bezier(0.25,0.46,0.45,0.94);
}
.vp-speed-popup[hidden] { display: none; }
.vp-speed-opt {
  background: none;
  border: none;
  color: rgba(255,255,255,0.72);
  font-size: 13px;
  padding: 10px 20px;
  cursor: pointer;
  text-align: center;
  transition: background 0.12s, color 0.12s;
  letter-spacing: 0.03em;
}
.vp-speed-opt:hover  { background: rgba(255,255,255,0.09); color: #fff; }
.vp-speed-opt.active { color: #38b6ff; font-weight: 700; }

/* ── Generic side panel (Quality / Audio / Diagnostics) ──────────────────── */
@keyframes vpPanelIn {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)     scale(1); }
}
.vp-panel {
  position: absolute;
  bottom: 90px;
  right: 16px;
  width: 300px;
  overflow: visible;
  background: rgba(10,10,10,0.94);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  z-index: 25;
  box-shadow: 0 20px 56px rgba(0,0,0,0.88), 0 0 0 0.5px rgba(255,255,255,0.04);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: vpPanelIn 0.18s cubic-bezier(0.25,0.46,0.45,0.94);
}
.vp-panel[hidden] { display: none; }

.vp-panel-header {
  padding: 13px 16px 11px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.38);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  gap: 8px;
}

.vp-panel-body {
  padding: 6px 0;
}

.vp-panel-loading {
  padding: 14px 16px;
  font-size: 13px;
  color: rgba(255,255,255,0.4);
}

.vp-panel-opt {
  display: flex;
  flex-direction: column;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: rgba(255,255,255,0.8);
  padding: 11px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  gap: 2px;
}
.vp-panel-opt:first-child { border-radius: 14px 14px 0 0; }
.vp-panel-opt:last-child  { border-radius: 0 0 14px 14px; }
.vp-panel-opt:hover  { background: rgba(255,255,255,0.09); color: #fff; }
.vp-panel-opt.active { color: #38b6ff; font-weight: 600; }
.vp-panel-opt.active::before {
  display: none;
}

.vp-audio-title { font-size: 13px; }
.vp-audio-meta  { font-size: 11px; color: rgba(255,255,255,0.4); font-weight: 400; }

/* Audio boost row */
.vp-audio-boost-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 12px;
}
.vp-boost-label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  min-width: 38px;
}
.vp-boost-slider {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.2);
  outline: none;
  cursor: pointer;
}
.vp-boost-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #38b6ff;
  cursor: pointer;
}
.vp-boost-slider::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #38b6ff;
  border: none;
  cursor: pointer;
}

/* Diagnostics panel */
.vp-diag-panel {
  width: 360px;
  bottom: 90px;
}
.vp-diag-table {
  width: 100%;
  border-collapse: collapse;
  padding: 0;
}
.vp-diag-table td {
  padding: 3.5px 14px;
  vertical-align: middle;
  line-height: 1.3;
}
.vp-diag-table td:first-child {
  color: rgba(255,255,255,0.32);
  width: 42%;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
}
.vp-diag-table td:last-child {
  color: rgba(255,255,255,0.88);
  font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
.vp-diag-table tr:nth-child(even) td { background: rgba(255,255,255,0.02); }
/* Section header rows */
.vp-diag-table tr.vp-diag-sep td {
  padding: 8px 14px 2px;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.18);
  background: none !important;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-family: inherit;
}
.vp-diag-table tr.vp-diag-sep:first-child td { border-top: none; padding-top: 4px; }
.vp-diag-panel .vp-panel-header {
  padding: 10px 14px 8px;
}
.vp-diag-panel .vp-panel-body {
  padding: 2px 0 6px;
}
/* Live indicator badge */
.vp-diag-live-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #3ddb6f;
  text-transform: uppercase;
  margin-left: auto;
}
.vp-diag-live-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3ddb6f;
  box-shadow: 0 0 6px #3ddb6f;
  animation: vpLivePulse 1.2s ease-in-out infinite;
}
@keyframes vpLivePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.75); }
}

/* ── Report issue panel ──────────────────────────────────────────────────── */
.vp-report-panel { width: 320px; }

.vp-report-subtitle {
  padding: 10px 16px 6px;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  margin: 0;
}

.vp-report-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 4px 16px 12px;
}

.vp-report-chip {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 20px;
  color: rgba(255,255,255,0.75);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.vp-report-chip:hover   { background: rgba(255,255,255,0.14); color: #fff; }
.vp-report-chip.selected {
  background: rgba(56,182,255,0.18);
  border-color: #38b6ff;
  color: #38b6ff;
  font-weight: 600;
}

.vp-report-note {
  display: block;
  width: calc(100% - 32px);
  margin: 0 16px 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  color: #fff;
  font-size: 13px;
  padding: 8px 10px;
  resize: vertical;
  min-height: 60px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.12s;
  box-sizing: border-box;
}
.vp-report-note:focus { border-color: rgba(56,182,255,0.5); }
.vp-report-note::placeholder { color: rgba(255,255,255,0.3); }

.vp-report-actions {
  display: flex;
  gap: 8px;
  padding: 0 16px 14px;
}
.vp-report-cancel,
.vp-report-submit {
  flex: 1;
  padding: 8px 0;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s, background 0.15s;
}
.vp-report-cancel {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.75);
}
.vp-report-cancel:hover { background: rgba(255,255,255,0.16); color: #fff; }
.vp-report-submit {
  background: #38b6ff;
  color: #000;
}
.vp-report-submit:hover   { opacity: 0.88; }
.vp-report-submit:disabled { opacity: 0.45; cursor: default; }

.vp-report-status {
  padding: 0 16px 10px;
  font-size: 12px;
  margin: 0;
  min-height: 18px;
}
.vp-report-status.ok    { color: #4cda8f; }
.vp-report-status.err   { color: #ff6b6b; }


.vp-quality-label {
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.04em;
}

/* ── Fullscreen — keep all controls fully visible ─────────────────────────── */
/* Chrome/Edge/Firefox reset some inherited styles when entering fullscreen.   */
/* We explicitly re-assert colour, size, and opacity for every button so       */
/* nothing shrinks or goes transparent.                                        */

.vp-root:fullscreen           .vp-icon-btn,
.vp-root:-webkit-full-screen  .vp-icon-btn,
.vp-root:-ms-fullscreen       .vp-icon-btn {
  color: #fff !important;
  background: none;
  min-width: 44px;
  min-height: 44px;
  opacity: 1 !important;
  border-radius: 8px;
}
.vp-root:fullscreen           .vp-icon-btn:hover,
.vp-root:-webkit-full-screen  .vp-icon-btn:hover,
.vp-root:-ms-fullscreen       .vp-icon-btn:hover {
  background: rgba(255,255,255,0.12) !important;
  transform: scale(1.08) !important;
}
.vp-root:fullscreen           .vp-icon-btn svg,
.vp-root:-webkit-full-screen  .vp-icon-btn svg,
.vp-root:-ms-fullscreen       .vp-icon-btn svg {
  fill: #fff !important;
  width: 28px !important;
  height: 28px !important;
  opacity: 1 !important;
  color: #fff !important;
}
/* Ensure the controls overlay itself stays on top */
.vp-root:fullscreen           .vp-controls,
.vp-root:-webkit-full-screen  .vp-controls,
.vp-root:-ms-fullscreen       .vp-controls {
  z-index: 2147483647;
}

/* Hide cursor when player is idle */
.vp-root.vp-cursor-hidden,
.vp-root.vp-cursor-hidden * {
  cursor: none !important;
}

/* ── Error page ───────────────────────────────────────────────────────────── */
.error-page {
  padding-top: calc(var(--nav-h) + 100px);
  padding-bottom: 60px;
  min-height: 100vh;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.error-page h1 {
  font-size: 4rem;
  font-weight: 700;
}

.error-page p {
  color: var(--text-dim);
  font-size: 1.1rem;
}
.err-retry-status {
  font-size: 0.9rem !important;
  color: rgba(255,255,255,0.45) !important;
  margin-top: 4px;
}

/* ── Reconnect / status toast ─────────────────────────────────────────── */
.mm-toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0) + 24px);
  transform: translateX(-50%) translateY(20px);
  background: rgba(15,15,15,0.96);
  color: #fff;
  padding: 10px 18px;
  border-radius: 24px;
  font-size: 0.88rem;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 8px 28px rgba(0,0,0,0.6);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  align-items: center;
  gap: 10px;
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  max-width: 90vw;
}
.mm-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.mm-toast .mm-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.25);
  border-top-color: #38b6ff;
  border-radius: 50%;
  animation: mm-spin 0.8s linear infinite;
}
.mm-toast.toast-error  { border-color: rgba(244,67,54,0.45); }
.mm-toast.toast-success { border-color: rgba(76,175,80,0.45); }
@keyframes mm-spin { to { transform: rotate(360deg); } }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.site-footer {
  padding: 40px 4% 24px;
}

.footer-inner {
  max-width: 1200px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}

.footer-links a {
  color: #777;
  font-size: 0.82rem;
  transition: color 0.2s;
}

.footer-links a:hover { color: #fff; }

.footer-copy {
  color: #555;
  font-size: 0.78rem;
}

/* ── Contact modal ────────────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open { display: flex; }

.modal {
  background: #1a1a1a;
  border-radius: 6px;
  padding: 36px 40px;
  width: 100%;
  max-width: 480px;
  position: relative;
}

.modal h2 {
  font-size: 1.4rem;
  margin-bottom: 24px;
}

.modal-close {
  position: absolute;
  top: 14px; right: 18px;
  font-size: 1.6rem;
  color: #aaa;
  transition: color 0.2s;
}

.modal-close:hover { color: #fff; }

#contactForm {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#contactForm input,
#contactForm textarea {
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  border-radius: 4px;
  color: #fff;
  font-size: 0.95rem;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}

#contactForm input:focus,
#contactForm textarea:focus {
  border-color: var(--accent);
}

#contactForm textarea {
  min-height: 120px;
  resize: vertical;
}

.btn-submit {
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  padding: 11px;
  border-radius: 4px;
  transition: background 0.2s;
}

.btn-submit:hover { background: #007aaa; }

.form-status {
  font-size: 0.85rem;
  min-height: 1.2em;
  color: var(--text-dim);
}

.form-status.success { color: #4caf50; }
.form-status.error   { color: #f44336; }

/* ── Info modal (Netflix-style) ──────────────────────────────────────────── */
.info-modal {
  max-width: 850px;
  width: 90vw;
  padding: 0;
  overflow: hidden;
  overflow-y: auto;
  max-height: 90vh;
  background: #181818;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.85);
}

/* Hero / backdrop */
.info-modal-hero {
  position: relative;
  width: 100%;
  height: 340px;
  background: #2a2a2a no-repeat center / cover;
  flex-shrink: 0;
}

.info-modal-hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0) 30%,
    rgba(24,24,24,0.8) 75%,
    #181818 100%
  );
}

.info-modal-hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0 32px 24px;
}

/* Close button */
.info-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
  width: 36px;
  height: 36px;
  background: rgba(20,20,20,0.7);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.info-modal-close:hover { background: rgba(255,255,255,0.2); }
.info-modal-close svg { width: 20px; height: 20px; fill: #fff; }

/* Title */
.info-modal-title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  text-shadow: 0 2px 8px rgba(0,0,0,0.7);
  margin-bottom: 14px;
}

/* Action buttons row */
.info-modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.info-modal-play-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: #000;
  font-weight: 700;
  font-size: 1rem;
  padding: 8px 22px;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.2s;
}
.info-modal-play-btn:hover { background: rgba(255,255,255,0.8); }
.info-modal-play-btn svg { fill: #000; flex-shrink: 0; }

.info-modal-circle-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.5);
  background: transparent;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.info-modal-circle-btn:hover {
  border-color: #fff;
  background: rgba(255,255,255,0.1);
}
.info-modal-circle-btn svg { width: 20px; height: 20px; fill: #fff; }

/* Active / toggled states */
#infoModalWatchlist.active {
  background: #fff;
  border-color: #fff;
}
#infoModalWatchlist.active svg { fill: #000; }

/* Watchlist active: show a checkmark instead of + */
#infoModalWatchlist.active svg path {
  d: path("M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z");
}

#infoModalLike.active {
  background: rgba(56,182,255,0.2);
  border-color: #38b6ff;
}
#infoModalLike.active svg { fill: #38b6ff; }

/* Body: two-column layout */
.info-modal-body {
  padding: 20px 32px 32px;
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

.info-modal-left {
  flex: 1 1 60%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.info-modal-right {
  flex: 0 0 32%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 2px;
}

/* Badges row */
.info-modal-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.88rem;
  color: #d4d4d4;
}

.info-modal-badge-rating {
  border: 1px solid rgba(255,255,255,0.4);
  padding: 1px 7px;
  border-radius: 3px;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.03em;
}

.info-modal-badge-dot {
  color: rgba(255,255,255,0.3);
  font-size: 0.45rem;
  margin: 0 1px;
  vertical-align: middle;
}

.info-modal-badge-hd {
  border: 1px solid rgba(255,255,255,0.4);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.05em;
}

/* Overview */
.info-modal-overview {
  font-size: 0.95rem;
  line-height: 1.65;
  color: #d4d4d4;
  max-height: 140px;
  overflow-y: auto;
}

/* Right column detail lines */
.info-modal-detail {
  font-size: 0.85rem;
  color: #999;
  line-height: 1.6;
}
.info-modal-detail strong {
  color: #fff;
  font-weight: 600;
}

.info-modal-play {
  align-self: flex-start;
  margin-top: 6px;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
/* Mobile/tablet rules consolidated at end of file */


/* Player entry — fade up from slightly zoomed */
@keyframes vp-entry {
  from { opacity: 0; transform: scale(1.06); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes mm-page-fade {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  body:not(.player-body):not(.profiles-page) {
    animation: none;
  }

  .vp-video,
  .vp-loader,
  .vp-controls,
  .vp-top,
  .vp-bottom {
    transition: none;
  }
}
/* ── Browse pagination ─────────────────────────────────────────────────────── */
.browse-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 32px 4% 48px;
}

.pg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 4px;
  color: rgba(255,255,255,0.75);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.pg-btn:hover:not(.pg-disabled):not(.pg-active) {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border-color: rgba(255,255,255,0.35);
}
.pg-btn.pg-active {
  background: var(--accent, #38b6ff);
  border-color: var(--accent, #38b6ff);
  color: #000;
  font-weight: 700;
  cursor: default;
}
.pg-btn.pg-disabled {
  opacity: 0.3;
  cursor: default;
}
.pg-ellipsis {
  color: rgba(255,255,255,0.35);
  font-size: 0.9rem;
  padding: 0 4px;
}

/* ── Header live-search dropdown ──────────────────────────────────────────── */
.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: auto;
  width: min(420px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  box-sizing: border-box;
  background: #141414;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 12px;
  list-style: none;
  margin: 0;
  padding: 8px;
  z-index: 1000;
  box-shadow: 0 16px 48px rgba(0,0,0,0.9);
  max-height: 400px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.search-dropdown::-webkit-scrollbar { display: none; }
.search-dropdown li { margin: 0; }
.sd-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 8px;
  border-radius: 8px;
  color: #fff;
  text-decoration: none;
  transition: background 0.12s;
  min-width: 0;
}
.sd-item:hover { background: rgba(255,255,255,0.08); }
.sd-thumb {
  width: 40px;
  height: 56px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
}
.sd-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.sd-thumb-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.35);
  background: linear-gradient(180deg, rgba(31,41,55,0.92) 0%, rgba(17,24,39,0.98) 100%);
}

/* ── Dynamic page backdrop ─────────────────────────────────────────────────── */
#page-backdrop-wrap {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
#page-backdrop-a,
#page-backdrop-b {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  transition: opacity 1.4s ease;
  pointer-events: none;
  will-change: opacity;
}
#page-backdrop-b { opacity: 0; }

#page-backdrop-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to bottom,
    rgba(10, 10, 10, 0.55) 0%,
    rgba(10, 10, 10, 0.72) 35%,
    rgba(15, 15, 15, 0.88) 65%,
    #141414 92%
  );
  pointer-events: none;
}

.sd-thumb-fallback svg {
  width: 18px;
  height: 18px;
}
.sd-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}
.sd-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sd-meta {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sd-see-all {
  display: block;
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.06);
  transition: background 0.12s, color 0.12s;
}
.sd-see-all:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sd-see-all strong { color: rgba(255,255,255,0.8); font-weight: 500; }

/* ── Search history rows ─────────────────────────────────────────────────── */
.sd-section-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px 4px;
  font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: rgba(255,255,255,0.45);
}
.sd-clear-all {
  background: none; border: 0; color: rgba(255,255,255,0.55);
  font-size: 0.72rem; cursor: pointer; padding: 2px 4px;
}
.sd-clear-all:hover { color: #fff; }

.sd-history-row {
  display: flex; align-items: center; gap: 6px;
  border-radius: 8px;
  transition: background 0.12s;
}
.sd-history-row:hover { background: rgba(255,255,255,0.06); }
.sd-history {
  display: flex; align-items: center; gap: 10px;
  flex: 1; min-width: 0;
  padding: 8px 10px;
  text-decoration: none; color: rgba(255,255,255,0.85);
  font-size: 0.92rem;
}
.sd-history-icon { width: 18px; height: 18px; color: rgba(255,255,255,0.5); flex: 0 0 18px; }
.sd-history-icon svg { width: 100%; height: 100%; }
.sd-history-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-history-remove {
  background: none; border: 0; padding: 6px; margin-right: 6px;
  cursor: pointer; color: rgba(255,255,255,0.4);
  border-radius: 4px;
}
.sd-history-remove:hover { color: #fff; background: rgba(255,255,255,0.08); }
.sd-history-remove svg { width: 14px; height: 14px; display: block; }
/* ── Request Media Modal ─────────────────────────────────────────────────── */
.rm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.rm-overlay[hidden] { display: none; }

.rm-dialog {
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  width: 100%;
  max-width: 680px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,0.9);
  overflow: hidden;
}

.rm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}

.rm-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.rm-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.15s;
}
.rm-close:hover { color: #fff; }

.rm-search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 20px 16px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  flex-shrink: 0;
}
.rm-search-wrap:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.14);
}
.rm-search-wrap:focus-within {
  background: rgba(56,182,255,0.06);
  border-color: rgba(56,182,255,0.55);
  box-shadow: 0 0 0 3px rgba(56,182,255,0.18);
}

.rm-search-icon {
  color: rgba(255,255,255,0.5);
  flex-shrink: 0;
  transition: color 0.18s ease;
}
.rm-search-wrap:focus-within .rm-search-icon { color: #38b6ff; }

.rm-search-input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.rm-search-input::placeholder { color: rgba(255,255,255,0.4); }
/* The input itself gets no focus ring — the wrap handles it. */
.rm-search-input:focus,
.rm-search-input:focus-visible { outline: none; box-shadow: none; }

.rm-status {
  padding: 14px 20px;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.45);
  text-align: center;
  flex-shrink: 0;
}
.rm-status.rm-error { color: #f44336; }
.rm-status.rm-sent  { color: #4caf50; }

.rm-scroll {
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex: 1;
}
.rm-scroll::-webkit-scrollbar { display: none; }

.rm-results {
  list-style: none;
  margin: 0;
  padding: 8px;
}

/* ── Popular YTS Downloads ─────────────────────────────────────────────── */
.rm-popular {
  padding: 16px 20px 4px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0) 100%);
  flex-shrink: 0;
}
.rm-popular[hidden] { display: none; }

.rm-popular-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.rm-popular-star {
  color: #ffc83d;
  filter: drop-shadow(0 0 6px rgba(255,200,61,0.45));
  flex-shrink: 0;
}
.rm-popular-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
}

.rm-popular-grid,
.rm-popular-loading {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
/* `display: grid` above overrides the UA `[hidden] { display: none }`, so
   the loading skeletons would otherwise stay visible AFTER the real grid
   loaded. Force-hide both grids when their `hidden` attr is set. */
.rm-popular-grid[hidden],
.rm-popular-loading[hidden] { display: none; }

/* Hard cap at 4 cards — never spill onto a second row. */
.rm-popular-grid > *:nth-child(n+5),
.rm-popular-loading > *:nth-child(n+5) { display: none; }

.rm-poster {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.2s ease;
}
.rm-poster:hover { transform: translateY(-3px); }
.rm-poster:hover .rm-poster-overlay { opacity: 1; }
.rm-poster:hover .rm-poster-img {
  border-color: rgba(56,182,255,0.55);
  box-shadow: 0 10px 28px rgba(0,0,0,0.7), 0 0 0 1px rgba(56,182,255,0.25);
}
.rm-poster:hover .rm-poster-title { color: #fff; }
.rm-poster:focus-visible .rm-poster-img {
  border-color: rgba(56,182,255,0.8);
  box-shadow: 0 0 0 2px rgba(56,182,255,0.45);
}

.rm-poster-img {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.rm-poster-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rm-poster-fallback {
  font-size: 1.6rem;
  font-weight: 700;
  color: rgba(255,255,255,0.3);
}

.rm-poster-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.65) 100%);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.rm-poster-overlay svg {
  background: rgba(229,9,20,0.95);
  border-radius: 50%;
  padding: 7px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.6);
}

.rm-poster-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255,255,255,0.88);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.15s;
}
.rm-poster-meta {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.4);
  font-variant-numeric: tabular-nums;
}

.rm-popular-skeleton {
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.09) 50%, rgba(255,255,255,0.04) 100%);
  background-size: 200% 100%;
  animation: rm-shimmer 1.4s linear infinite;
}
@keyframes rm-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* "Back to Popular" pill shown above a detail card from the popular grid */
.rm-back-row {
  list-style: none;
  padding: 6px 4px 2px;
  margin: 0;
}
.rm-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.rm-back-btn:hover {
  background: rgba(56,182,255,0.15);
  border-color: rgba(56,182,255,0.5);
  color: #38b6ff;
}

/* Narrower modal widths — keep one row of 4 by tightening gap + padding. */
@media (max-width: 560px) {
  .rm-popular { padding: 14px 14px 14px; }
  .rm-popular-grid,
  .rm-popular-loading { gap: 9px; }
  .rm-poster-title { font-size: 0.72rem; }
  .rm-poster-meta  { font-size: 0.65rem; }
}
@media (max-width: 380px) {
  .rm-popular { padding: 12px 12px 12px; }
  .rm-popular-grid,
  .rm-popular-loading { gap: 7px; }
  .rm-poster { gap: 6px; }
}

.rm-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 8px;
  border-radius: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.rm-item:last-child { border-bottom: none; }

.rm-cover {
  width: 72px;
  height: 106px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
}
.rm-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rm-cover-fallback { font-size: 1.1rem; font-weight: 700; color: rgba(255,255,255,0.3); }

.rm-info { flex: 1; min-width: 0; }
.rm-name { font-size: 0.92rem; font-weight: 700; color: #fff; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm-meta { font-size: 0.78rem; color: rgba(255,255,255,0.4); margin-bottom: 6px; }

.rm-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 7px;
}
.rm-genre {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.rm-summary {
  font-size: 0.79rem;
  color: rgba(255,255,255,0.45);
  line-height: 1.5;
  margin: 0 0 9px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rm-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.rm-play-wrap { display: flex; align-items: center; }

.rm-play-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 6px;
  background: #e50914;
  color: #fff;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
  flex-shrink: 0;
}
.rm-play-btn:hover { background: #ff1a24; transform: scale(1.03); }

/* "Trailer" button — sits next to Play / quality buttons in the detail card */
.rm-trailer-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.88);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}
.rm-trailer-btn:hover {
  background: rgba(56,182,255,0.18);
  border-color: rgba(56,182,255,0.6);
  color: #38b6ff;
  transform: scale(1.03);
}
.rm-trailer-btn svg { flex-shrink: 0; }

/* ── Trailer overlay (YouTube embed) ─────────────────────────────────────── */
.rm-trailer-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 10000; /* above the Request Media modal */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  animation: rmTrailerFade 0.18s ease;
}
.rm-trailer-overlay[hidden] { display: none; }

@keyframes rmTrailerFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.rm-trailer-close {
  position: absolute;
  top: 14px;
  right: 18px;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  z-index: 10;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.15s, color 0.15s, transform 0.15s, border-color 0.15s;
}
.rm-trailer-close:hover {
  background: rgba(229,9,20,0.92);
  border-color: rgba(229,9,20,0.92);
  transform: scale(1.05);
}

/* Fill as much viewport as possible while honoring 16:9. The min() between
   100vw and 100vh*(16/9) is the standard letterbox-fit pattern — whichever
   axis is the bottleneck wins, no black bars beyond what the source itself
   requires. */
.rm-trailer-stage {
  width:  min(100vw, calc(100vh * 16 / 9));
  height: min(100vh, calc(100vw * 9 / 16));
  max-width: 100vw;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
}
.rm-trailer-frame {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  border-radius: 0;
  overflow: hidden;
}
.rm-trailer-frame iframe,
.rm-trailer-frame #rmTrailerPlayerMount,
.rm-trailer-frame #rmTrailerPlayerMount iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ════════════════════════════════════════════════════════════════════════
   Custom trailer player (YouTube-backed via IFrame Player API)
   Same visual language as the in-house .vp- player.
   ════════════════════════════════════════════════════════════════════════ */
.tp-root {
  position: absolute;
  inset: 0;
  background: #000;
  overflow: hidden;
  font-family: inherit;
  color: #fff;
}
.tp-video {
  position: absolute;
  inset: 0;
  background: #000;
}
.tp-video #rmTrailerPlayerMount,
.tp-video #rmTrailerPlayerMount iframe,
.tp-video #rmTrailerPlayer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}
/* Click-shield over the iframe — catches taps for play/pause without YT chrome */
.tp-shield {
  position: absolute;
  inset: 0;
  background: transparent;
  cursor: pointer;
  z-index: 1;
}

/* Center play/pause */
.tp-center-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.92);
  width: 76px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.55);
  border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  z-index: 3;
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: opacity 0.18s ease, transform 0.18s ease, background 0.15s ease;
}
.tp-center-btn svg { width: 32px; height: 32px; }
.tp-center-btn .tp-pause-icon { display: none; }
.tp-root.tp-playing .tp-center-btn .tp-play-icon  { display: none; }
.tp-root.tp-playing .tp-center-btn .tp-pause-icon { display: block; }
.tp-root.tp-show:not(.tp-playing) .tp-center-btn,
.tp-root.tp-show.tp-paused .tp-center-btn {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}
.tp-root.tp-show:hover .tp-center-btn { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.tp-center-btn:hover { background: rgba(0,0,0,0.75); border-color: rgba(255,255,255,0.4); }

/* Buffering spinner */
.tp-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2;
}
.tp-spinner[hidden] { display: none; }
.tp-spinner-ring {
  width: 52px;
  height: 52px;
  border: 3px solid rgba(255,255,255,0.18);
  border-top-color: #38b6ff;
  border-radius: 50%;
  animation: tpSpin 0.9s linear infinite;
}
@keyframes tpSpin { to { transform: rotate(360deg); } }

/* Top overlay bar — title slides down with the controls */
.tp-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 18px 80px 30px 22px; /* leave room for the close button top-right */
  background: linear-gradient(180deg, rgba(0,0,0,0.78) 0%, rgba(0,0,0,0.45) 60%, rgba(0,0,0,0) 100%);
  z-index: 4;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
.tp-root.tp-show .tp-top,
.tp-root:not(.tp-playing) .tp-top {
  opacity: 1;
  transform: translateY(0);
}
.tp-top-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 12px rgba(0,0,0,0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Bottom controls bar */
.tp-controls {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 18px 18px 12px;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.55) 40%, rgba(0,0,0,0.92) 100%);
  z-index: 4;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
.tp-root.tp-show .tp-controls,
.tp-root:not(.tp-playing) .tp-controls {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Progress bar */
.tp-progress-wrap {
  display: flex;
  align-items: center;
  padding: 8px 2px;          /* generous vertical padding around the bar */
  margin-bottom: 4px;
  cursor: pointer;
}
.tp-progress-bg {
  position: relative;
  width: 100%;
  height: 5px;               /* slightly thicker default */
  border-radius: 3px;
  background: rgba(255,255,255,0.22);
  transition: height 0.12s ease;
  cursor: pointer;
}
/* Invisible expander: extends the clickable area to ~24 px vertical without
   changing the bar's visual thickness. Clicks on the expander bubble to the
   parent and trigger the existing seek handler. */
.tp-progress-bg::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  bottom: -12px;
  background: transparent;
  z-index: 0;
}
.tp-progress-bg:hover,
.tp-progress-wrap:hover .tp-progress-bg,
.tp-root.tp-scrubbing .tp-progress-bg { height: 7px; }

.tp-progress-buf {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: rgba(255,255,255,0.32);
  border-radius: 3px;
  pointer-events: none;
}
.tp-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #38b6ff 0%, #1a8fff 100%);
  border-radius: 3px;
  box-shadow: 0 0 6px rgba(56,182,255,0.55);
  pointer-events: none;
}
.tp-progress-dot {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  /* Always visible (small) so users have a clear target; grows on hover/drag */
  transform: translate(-50%, -50%) scale(0.7);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  opacity: 0.95;
}
.tp-progress-wrap:hover .tp-progress-dot,
.tp-progress-bg:hover .tp-progress-dot,
.tp-root.tp-scrubbing .tp-progress-dot {
  transform: translate(-50%, -50%) scale(1.2);
  box-shadow: 0 2px 12px rgba(0,0,0,0.7), 0 0 0 4px rgba(56,182,255,0.18);
}

/* Control row */
.tp-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.tp-spacer { flex: 1; }
.tp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: rgba(255,255,255,0.92);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}
.tp-btn svg { width: 22px; height: 22px; flex-shrink: 0; }
.tp-btn:hover { background: rgba(255,255,255,0.13); color: #fff; }
.tp-btn:active { transform: scale(0.93); }

/* Play / pause icon toggle in the bottom button */
.tp-row .tp-pause-icon,
.tp-root.tp-playing .tp-row .tp-play-icon { display: none; }
.tp-root.tp-playing .tp-row .tp-pause-icon { display: block; }

/* Mute icon toggle */
.tp-row .tp-mute-icon { display: none; }
.tp-root.tp-muted .tp-row .tp-vol-icon  { display: none; }
.tp-root.tp-muted .tp-row .tp-mute-icon { display: block; }

/* Fullscreen icon toggle */
.tp-row .tp-fs-exit { display: none; }
.tp-root.tp-fs .tp-row .tp-fs-enter { display: none; }
.tp-root.tp-fs .tp-row .tp-fs-exit  { display: block; }

/* Volume slider */
.tp-volume-wrap {
  display: flex;
  align-items: center;
}
.tp-volume {
  -webkit-appearance: none;
  appearance: none;
  width: 0;
  height: 4px;
  background: rgba(255,255,255,0.25);
  border-radius: 2px;
  margin-left: 0;
  opacity: 0;
  outline: none;
  transition: width 0.2s ease, opacity 0.18s ease, margin-left 0.2s ease;
  cursor: pointer;
}
.tp-volume-wrap:hover .tp-volume,
.tp-volume:focus {
  width: 92px;
  margin-left: 8px;
  opacity: 1;
}
.tp-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.4);
}
.tp-volume::-moz-range-thumb {
  width: 12px; height: 12px;
  background: #fff; border-radius: 50%;
  border: none; cursor: pointer;
}

/* Time display */
.tp-time {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  padding: 0 8px;
  white-space: nowrap;
}

/* Subtle vignette / title overlay at top while controls are shown */
.tp-root.tp-show::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0) 25%);
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.2s ease;
}

/* When the iframe is hidden by the embed-blocked fallback, suppress the player UI */
.rm-trailer-frame:has(#rmTrailerBlocked:not([hidden])) .tp-root {
  visibility: hidden;
}

/* Mobile tweaks */
@media (max-width: 560px) {
  .tp-controls { padding: 14px 12px 10px; }
  .tp-btn { width: 34px; height: 34px; }
  .tp-time { font-size: 0.72rem; padding: 0 6px; }
  .tp-volume-wrap:hover .tp-volume,
  .tp-volume:focus { width: 70px; }
  .tp-center-btn { width: 64px; height: 64px; }
  .tp-center-btn svg { width: 26px; height: 26px; }
}

/* Embedded-playback-blocked fallback card */
.rm-trailer-blocked {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 28px;
  text-align: center;
  background: radial-gradient(circle at center, rgba(40,40,40,0.55) 0%, rgba(0,0,0,0.9) 100%);
}
.rm-trailer-blocked[hidden] { display: none; }
.rm-trailer-blocked > svg {
  color: #ff3030;
  filter: drop-shadow(0 4px 14px rgba(229,9,20,0.4));
  margin-bottom: 4px;
}
.rm-trailer-blocked-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}
.rm-trailer-blocked-msg {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.6);
  max-width: 420px;
  line-height: 1.45;
}
.rm-trailer-blocked-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 11px 22px;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  color: #fff;
  background: #e50914;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(229,9,20,0.4);
  transition: background 0.15s, transform 0.12s, box-shadow 0.15s;
}
.rm-trailer-blocked-btn:hover {
  background: #ff1a24;
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 10px 28px rgba(229,9,20,0.55);
}
.rm-trailer-blocked-btn svg { flex-shrink: 0; }

@media (max-width: 560px) {
  .rm-trailer-close { top: 10px; right: 12px; width: 36px; height: 36px; }
  .tp-top { padding: 14px 64px 22px 18px; }
  .tp-top-title { font-size: 0.92rem; }
}

.rm-qualities { display: flex; flex-wrap: wrap; gap: 6px; }

.rm-req-btn {
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.rm-req-btn:hover { background: rgba(56,182,255,0.2); border-color: #38b6ff; color: #38b6ff; }
.rm-req-btn:disabled { opacity: 0.4; cursor: default; }
.rm-req-btn.rm-sent  { background: rgba(76,175,80,0.15); border-color: #4caf50; color: #4caf50; }


/* ── Request Media Progress Bar ──────────────────────────────────────────── */
.rm-progress-wrap {
  padding: 12px 20px 16px;
  border-top: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
.rm-progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.81rem;
  color: rgba(255,255,255,0.55);
}
.rm-progress-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rm-cancel-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.35);
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
  transition: color 0.15s;
}
.rm-cancel-btn:hover {
  color: rgba(255,80,80,0.9);
}
.rm-progress-speed {
  font-size: 0.81rem;
  color: #38b6ff;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
.rm-progress-bar {
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.1);
  overflow: hidden;
}
.rm-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  background: linear-gradient(90deg, #1a8fff, #38b6ff);
  box-shadow: 0 0 8px rgba(56,182,255,0.55);
  transition: width 0.35s ease;
}
.rm-progress-fill.rm-progress-indeterminate {
  width: 35% !important;
  transition: none;
  animation: rm-indeterminate 1.4s ease-in-out infinite;
}
@keyframes rm-indeterminate {
  0%   { margin-left: -35%; }
  100% { margin-left: 100%; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   CROSS-BROWSER COMPATIBILITY + MOBILE OPTIMIZATIONS
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Universal vendor-prefix safety net ─────────────────────────────────── */
html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  /* Honor iPhone safe area on rotation */
  padding-top: env(safe-area-inset-top, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: none;
  /* iOS Safari fallback for vh */
  min-height: 100vh;
  min-height: 100dvh;
}
/* Prevent images flickering on Safari rotation */
img { -webkit-backface-visibility: hidden; backface-visibility: hidden; }

/* Buttons – consistent across browsers */
button, input, select, textarea {
  font-family: inherit;
  font-size: 100%;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration { -webkit-appearance: none; display: none; }
input::-ms-clear, input::-ms-reveal { display: none; }
:focus { outline: none; }
:focus-visible { outline: 2px solid rgba(56,182,255,0.7); outline-offset: 2px; }

/* All scroll containers – smooth momentum on iOS */
.row-scroll, .vp-panel, .rm-results, .search-dropdown, .info-modal-overview {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
/* Horizontal rows: snap on touch devices */
@media (hover: none) and (pointer: coarse) {
  .row-scroll {
    scroll-snap-type: x mandatory;
    -webkit-mask-image: none;
            mask-image: none;
    padding-left: 4%;
    padding-right: 4%;
  }
  .row-scroll > .card { scroll-snap-align: start; }
}

/* Backdrop-filter vendor prefixes everywhere it's used */
.vp-loader,
.vp-play-center,
.vp-panel,
.navbar.scrolled,
.search-dropdown,
.profile-dropdown,
.rm-overlay,
.rm-dialog {
  -webkit-backdrop-filter: blur(0);
}
.vp-loader      { -webkit-backdrop-filter: blur(2px); }
.vp-loader.vp-loader-done { -webkit-backdrop-filter: blur(0); }
.vp-play-center { -webkit-backdrop-filter: blur(6px); }
.vp-panel       { -webkit-backdrop-filter: blur(8px); }

/* Disable hover-grow card on touch devices (it's annoying) */
@media (hover: none) {
  .card:hover { transform: none; box-shadow: none; }
  .card { transition: opacity 0.2s; }
  .card:active { opacity: 0.8; }
  .navbar-nav a::after { display: none; }
}

/* ── Burger menu (visible on mobile) ────────────────────────────────────── */
.navbar-burger {
  display: none;
  width: 44px;
  height: 44px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  padding: 0;
  margin-right: 6px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  z-index: 1001;
}
.navbar-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.navbar-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navbar-burger.open span:nth-child(2) { opacity: 0; }
.navbar-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.navbar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 950;
  -webkit-backdrop-filter: blur(2px);
          backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.navbar-backdrop.visible { opacity: 1; }
.navbar-backdrop[hidden] { display: none; }

/* ── Phone (≤ 700px) ────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  :root { --nav-h: 64px; }
  .navbar { padding: 0 14px; gap: 10px; }
  .navbar-burger { display: flex; }
  .navbar-logo .logo-img { height: 44px; }
  .logo-text { font-size: 1.15rem; }

  /* Off-canvas menu */
  .navbar-nav {
    display: flex !important;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(78vw, 320px);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: calc(env(safe-area-inset-top, 0) + 70px) 0 24px;
    background: #0b0b0b;
    border-right: 1px solid rgba(255,255,255,0.06);
    z-index: 960;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 0 60px rgba(0,0,0,0.6);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .navbar-nav.open { transform: translateX(0); }
  .navbar-nav li { width: 100%; }
  .navbar-nav a {
    display: block;
    width: 100%;
    padding: 16px 24px;
    font-size: 1.05rem;
    color: rgba(255,255,255,0.85);
    border-bottom: 1px solid rgba(255,255,255,0.04);
  }
  .navbar-nav a.active { color: #38b6ff; }
  .navbar-nav a::after { display: none !important; }

  /* Search collapses to icon-only by default */
  .search-bar { display: none; }
  .search-bar.open {
    display: flex;
    position: fixed;
    top: calc(env(safe-area-inset-top, 0) + 64px);
    left: 8px;
    right: 8px;
    background: #141414;
    padding: 10px 12px;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.7);
    z-index: 1000;
  }
  .search-bar.open .search-dropdown {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0) + 116px);
    left: 8px;
    right: 8px;
    width: auto;
    max-width: none;
  }

  /* Hero scaled for phones */
  .hero { height: auto; min-height: 78vh; padding-bottom: 90px; }
  .hero-content { padding: 0 18px; }
  .hero-title { font-size: clamp(1.4rem, 6.5vw, 2.4rem); }
  .hero-desc { display: none; }
  .hero-buttons .btn-play,
  .hero-buttons .btn-info { padding: 9px 18px; font-size: 0.9rem; }

  /* Cards a touch smaller, snap-scrollable */
  .card { width: 134px; }
  .content-section { padding: 0 4% 16px; }
  .row-title { font-size: 1.05rem; margin-bottom: 8px; }
  .row-scroll { gap: 8px; padding: 6px 0 10px; }

  /* Modals fill the screen better on small devices */
  .rm-overlay { padding: 0; align-items: flex-end; }
  .rm-dialog {
    max-width: 100%;
    max-height: 92vh;
    border-radius: 14px 14px 0 0;
  }
  .info-modal { width: 96vw; max-height: 92vh; }
  .info-modal-hero { height: 220px; }
  .info-modal-title { font-size: 1.4rem; }
  .info-modal-body { flex-direction: column; gap: 16px; padding: 16px 20px 24px; }
  .info-modal-left, .info-modal-right { flex: unset; width: 100%; }
  .info-modal-hero-content { padding: 0 20px 18px; }

  /* Bigger tap targets on the player */
  .vp-icon-btn { padding: 12px; }
  .vp-icon-btn svg { width: 26px; height: 26px; }
  .vp-bottom { padding: 0 12px calc(env(safe-area-inset-bottom, 0) + 18px); }
  .vp-top    { padding: calc(env(safe-area-inset-top, 0) + 12px) 12px 0; }
  .vp-time-remain { min-width: 70px; font-size: 12px; }
  .vp-progress-bg { height: 7px; }
  .vp-progress-bg:hover { height: 9px; }
  .vp-vol-group .vp-vol-slider { display: none; } /* Native volume only on mobile */
  .vp-title-center { display: none; }
  .vp-panel { right: 8px; left: 8px; width: auto; max-height: 60vh; }
  .vp-speed-popup { right: 8px; bottom: 90px; }
  .vp-play-center { width: 64px; height: 64px; }
  .vp-play-center svg { width: 30px; height: 30px; }
}

/* ── Tablet (701–1024px) ───────────────────────────────────────────────── */
@media (min-width: 701px) and (max-width: 1024px) {
  .navbar { gap: 18px; }
  .navbar-logo .logo-img { height: 80px; }
  .navbar-nav a { font-size: 16px; padding: 6px 10px; }
  .hero { padding-bottom: 90px; }
  .card { width: 160px; }
}

/* ── Landscape phone — keep player usable ──────────────────────────────── */
@media (max-width: 900px) and (orientation: landscape) {
  .vp-top    { padding-top: max(env(safe-area-inset-top, 0), 8px); }
  .vp-bottom { padding-bottom: max(env(safe-area-inset-bottom, 0), 10px); }
  .vp-bottom { padding-left: max(env(safe-area-inset-left, 0), 16px);
               padding-right: max(env(safe-area-inset-right, 0), 16px); }
}

/* ── High-DPI (retina) crispening ──────────────────────────────────────── */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .card img, .hero-slide, .sd-thumb img { image-rendering: -webkit-optimize-contrast; }
}

/* ── Print / save-data ─────────────────────────────────────────────────── */
@media (prefers-reduced-data: reduce) {
  .hero-slide, #page-backdrop-a, #page-backdrop-b { background-image: none !important; }
}
