/*
 * msm theme: black tube with orange accents (#ff9000) and store-style app banners. Mobile first: on phones the
 * nav lives in a slide-in menu (theme.js) and the header keeps the menu button, logo, search and language;
 * from 900px the nav bar is shown under the header. The app banners ("app banners" below) are rendered only
 * when ads.json popup.banners is set.
 */

:root {
  --bg: #000;
  --bg-alt: #1b1b1b;
  --bg-input: #0a0a0a;
  --fg: #fff;
  --fg-text: #b1b1b1;
  --fg-dim: #8a8a8a;
  --accent: #ff9000;
  --accent-dark: #e08000;
  --green: #4caf50;
  --red: #f44336;
  --border: #2a2a2a;
  --play: #01875f;
  --play-dark: #016e4d;
  --radius: 2px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg-text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.container { max-width: 1280px; margin: 0 auto; padding: 0 10px 12px; }

/* ---------- header: menu button, logo, search, language (one row from 340px) ---------- */
.site-top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-alt);
  color: var(--fg);
}
.site-header {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 8px 10px;
  border-bottom: 1px solid #000;
}
.nav-toggle {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-inline-start: -6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--fg);
  cursor: pointer;
}
.no-js .nav-toggle { display: none; }
.logo {
  flex: none;
  display: inline-flex;
  align-items: center;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--fg);
  white-space: nowrap;
  direction: ltr; /* a Latin brand: "Pep" + "per" must not swap places in RTL */
}
.logo:hover { color: var(--fg); }
.logo .l2 {
  margin-inline-start: 2px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--accent);
  color: #000;
  font-weight: 800;
}
.search { position: relative; flex: 1 1 auto; min-width: 0; display: flex; max-width: 460px; }
.search input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 10px;
  border: 1px solid #333;
  border-inline-end: 0;
  border-radius: 0;
  background: var(--bg-input);
  color: var(--fg);
  font-size: 16px; /* 16px keeps mobile browsers from zooming into the field */
  -webkit-appearance: none;
  appearance: none;
}
.search input::placeholder { color: #666; }
.search input:focus { border-color: var(--accent); outline: none; }
.search input::-webkit-search-cancel-button { display: none; }
.search-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: var(--accent);
  color: #000;
  cursor: pointer;
}
.search-btn:hover { background: var(--accent-dark); }

.lang-switch { position: relative; flex: none; margin-inline-start: auto; }
.lang-switch__btn {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 44px;
  padding: 0 10px;
  border: 1px solid #333;
  background: var(--bg-input);
  color: var(--fg);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  user-select: none;
}
.lang-switch__btn::-webkit-details-marker { display: none; }
.lang-switch__btn::after {
  content: "";
  width: 0;
  height: 0;
  border-inline: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.7;
}
.lang-switch[open] .lang-switch__btn { border-color: var(--accent); color: var(--accent); }
.lang-switch__menu {
  position: absolute;
  top: calc(100% + 4px);
  inset-inline-end: 0;
  z-index: 30;
  width: min(300px, calc(100vw - 20px));
  max-height: min(70vh, 420px);
  overflow: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 8px;
  background: var(--bg-alt);
  border: 1px solid #333;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}
.lang-switch__item {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  font-size: 14px;
  color: var(--fg);
  overflow-wrap: anywhere;
}
.lang-switch__item:hover,
.lang-switch__item:focus-visible { background: rgba(255, 144, 0, 0.12); color: var(--accent); outline: none; }
.lang-switch__item.is-active { background: rgba(255, 144, 0, 0.2); color: var(--accent); font-weight: 700; }

/* nav bar: phones use the menu instead, unless scripts are off (then it scrolls sideways under the header) */
.site-nav {
  display: none;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 10px;
  border-bottom: 1px solid #000;
}
.no-js .site-nav { display: flex; overflow-x: auto; scrollbar-width: none; }
.site-nav a {
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-bottom: 2px solid transparent;
  color: var(--fg);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
}
.site-nav a:hover { color: var(--accent); }
.site-nav a.is-active { color: var(--accent); border-bottom-color: var(--accent); }
@media (max-width: 339px) {
  .site-header { flex-wrap: wrap; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
}
@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .site-nav { display: flex; }
  .logo { font-size: 22px; }
  .search { margin-inline-start: 12px; }
}

/* ---------- phone menu (theme.js): slides in from the line start ---------- */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.7);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  inset-inline-start: 0;
  z-index: 201;
  width: 85vw;
  max-width: 320px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px 0 30px;
  background: var(--bg-alt);
  color: var(--fg);
  transform: translateX(-100%);
  transition: transform 0.25s ease;
}
[dir="rtl"] .sidebar { transform: translateX(100%); }
.sidebar[hidden], .sidebar-overlay[hidden] { display: none; }
.menu-open .sidebar { transform: none; }
.menu-open .sidebar-overlay { opacity: 1; }
.menu-open body { overflow: hidden; }
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 10px 16px;
  padding-inline: 16px 8px;
  border-bottom: 1px solid #000;
}
.sidebar-header .logo { font-size: 20px; }
.sidebar-close {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: #aaa;
  font: 400 30px/1 Arial, Helvetica, sans-serif;
  cursor: pointer;
}
.sidebar-close:hover { color: var(--fg); }
.sidebar-nav { padding: 6px 0; border-bottom: 1px solid #000; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 0 18px;
  color: var(--fg);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.sidebar-nav a:hover, .sidebar-nav a.is-active { background: rgba(255, 144, 0, 0.1); color: var(--accent); }
.sidebar-section-title {
  padding: 14px 18px 4px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.sidebar-cats a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  color: var(--fg-text);
  font-size: 14px;
  text-transform: capitalize;
}
.sidebar-cats a:hover { background: rgba(255, 144, 0, 0.08); color: var(--accent); }
.sidebar-cats .sidebar-all { color: var(--accent); font-weight: 700; text-transform: none; }

/* ---------- headings, breadcrumbs, page head ---------- */
h1 { font-size: 20px; margin: 16px 0 10px; color: var(--fg); overflow-wrap: anywhere; }
h2 { font-size: 17px; margin: 20px 0 10px; color: var(--fg); }
.section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 12px 0 8px;
  padding-inline-start: 8px;
  border-inline-start: 3px solid var(--accent);
  border-bottom: 1px solid var(--border);
  color: var(--fg);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.6px;
  line-height: 1.3;
  text-transform: uppercase;
}
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 6px;
  padding: 8px 0 2px;
  font-size: 12px;
  color: var(--fg-dim);
}
.breadcrumb a { display: inline-flex; align-items: center; min-height: 32px; color: var(--accent); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: #444; }
.page-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.page-head-img {
  flex: none;
  width: 64px;
  border-inline-start: 4px solid var(--accent);
}
.page-head h1 { margin: 0; font-size: 16px; letter-spacing: 0.5px; text-transform: uppercase; }
.page-head-meta { margin: 2px 0 0; color: var(--fg-dim); font-size: 12px; }

/* ---------- featured hero (home) ---------- */
.hero {
  position: relative;
  display: block;
  height: 170px;
  margin: 0 -10px 4px;
  overflow: hidden;
  color: var(--fg);
}
.hero:hover { color: var(--fg); }
.hero .hero-bg {
  position: absolute;
  inset: 0;
  aspect-ratio: auto;
  border-radius: 0;
  background: #111;
}
.hero .hero-bg img { filter: blur(4px) brightness(0.55); transform: scale(1.06); }
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.2));
}
[dir="rtl"] .hero::after { background: linear-gradient(to left, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.2)); }
.hero-content {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
}
.hero-play {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 2px solid rgba(255, 144, 0, 0.7);
  border-radius: 50%;
  background: rgba(255, 144, 0, 0.15);
  transition: background 0.2s, border-color 0.2s;
}
.hero-play svg { width: 22px; height: 22px; margin-inline-start: 3px; }
.hero:hover .hero-play { background: var(--accent); border-color: var(--accent); }
.hero-info { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.hero-label {
  padding: 2px 7px;
  border-radius: 2px;
  background: var(--accent);
  color: #000;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.hero-title {
  max-width: 100%;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.8);
  text-transform: capitalize;
  overflow-wrap: anywhere;
}
.hero-meta { color: rgba(255, 255, 255, 0.75); font-size: 13px; }

/* ---------- grids and cards ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 8px; margin-bottom: 16px; }
.card { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.card-wrap { position: relative; min-width: 0; display: flex; flex-direction: column; }
.thumbwrap {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  background: #111;
  border-radius: var(--radius);
  overflow: hidden;
}
.thumbwrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease, filter 0.3s ease;
}
.card-title {
  color: var(--fg);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.15s ease;
}
.card-meta { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--fg-dim); }
.card-meta svg, .video-stats svg { flex: none; width: 13px; height: 13px; }
.views { display: inline-flex; align-items: center; gap: 4px; }
.rating { display: flex; align-items: center; gap: 6px; }
.rating-bar { flex: 1; height: 3px; border-radius: 2px; background: var(--red); overflow: hidden; }
.rating-bar span { display: block; height: 100%; background: var(--green); }
.rating-pct { min-width: 28px; color: var(--fg-dim); font-size: 10px; font-weight: 600; text-align: end; }
.play-hover {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.play-hover svg { width: 40px; height: 40px; color: rgba(255, 255, 255, 0.95); filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.7)); }
@media (hover: hover) {
  .card:hover .thumbwrap { outline: 2px solid var(--accent); outline-offset: -2px; }
  .card:hover .thumbwrap img { transform: scale(1.04); filter: brightness(0.85); }
  .card:hover .play-hover { opacity: 1; }
  .card:hover .card-title { color: var(--accent); }
}
.hd {
  position: absolute;
  top: 4px;
  inset-inline-start: 4px;
  padding: 1px 5px;
  border-radius: 2px;
  background: var(--accent);
  color: #000;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.dur {
  position: absolute;
  bottom: 4px;
  inset-inline-end: 4px;
  padding: 1px 5px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
/* watch-progress bar on history cards */
.prog { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); }

/* category tiles: a video card whose picture is the category's most popular video */
.cat-name { font-size: 14px; text-transform: capitalize; -webkit-line-clamp: 1; }
.cat-count {
  position: absolute;
  bottom: 4px;
  inset-inline-end: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}
.cat-count svg { width: 12px; height: 12px; opacity: 0.9; }

/* card preview clip (app.js): fades in over the static thumb once it actually plays */
.thumbwrap .pv {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.thumbwrap .pv.on { opacity: 1; }

/* download button on cards (promo.js download dialog); the HD badge keeps the other corner */
.card-dl {
  position: absolute;
  top: 4px;
  inset-inline-end: 4px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  cursor: pointer;
}
.card-dl svg { width: 16px; height: 16px; }
.card-dl::before { content: ""; position: absolute; inset: -6px; } /* 44px touch target around the small button */

/* sort bar, pagination, "more" link */
.sortbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.sortbar a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: var(--radius);
  background: var(--border);
  color: var(--fg-text);
  font-size: 13px;
  font-weight: 700;
}
.sortbar a:hover { color: var(--accent); }
.sortbar a.active { background: var(--accent); color: #000; }
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 20px 0; }
.pagination a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  border-radius: var(--radius);
  background: var(--bg-alt);
  color: var(--fg);
  font-size: 14px;
  font-weight: 700;
}
.pagination a:hover { color: var(--accent); }
.pagination a.active { background: var(--accent); color: #000; }
.more { margin: 8px 0 20px; text-align: center; }
.more-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.4px;
}
.more-link:hover { background: var(--accent); color: #000; }
.empty, .notfound { color: var(--fg-dim); padding: 24px 0; overflow-wrap: anywhere; }
.notfound a { color: var(--accent); }

/* ---------- video page ---------- */
.video-page { padding-top: 4px; }
.video-title { margin: 6px 0 10px; font-size: 16px; line-height: 1.3; }
.player { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.player video { width: 100%; height: 100%; display: block; }
.quality {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  padding: 2px 6px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 12px;
}
.video-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.video-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0; color: var(--fg-dim); font-size: 12px; }
.video-stats span { display: inline-flex; align-items: center; gap: 5px; }
.video-hd {
  padding: 0 5px;
  border-radius: 2px;
  background: var(--accent);
  color: #000;
  font-size: 10px;
  font-weight: 800;
}
.video-rating { display: flex; align-items: center; gap: 10px; }
.video-rating .rating-bar { height: 5px; }
.video-rating .rating-pct { color: var(--fg); font-size: 13px; font-weight: 700; }
.video-tags { padding: 12px 0; }
.video-tags-label {
  margin-bottom: 8px;
  color: var(--fg-dim);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--radius);
  background: var(--border);
  color: var(--fg-text);
  font-size: 13px;
}
.tag:hover { background: var(--accent); color: #000; }

/* end screen over the finished player (app.js): next related video + countdown */
.endscreen {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.88);
  color: #fff;
}
.es-next { display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 44px; color: #fff; text-decoration: none; }
.es-thumb { flex: 0 0 40%; max-width: 280px; aspect-ratio: 16 / 9; background: #222; overflow: hidden; }
.es-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.es-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.es-label { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--accent); }
.es-title {
  font-size: 14px;
  line-height: 1.3;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.es-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; }
.es-count { font-size: 13px; color: rgba(255, 255, 255, 0.8); }
.es-cancel {
  min-width: 44px;
  min-height: 44px;
  padding: 0 16px;
  font: inherit;
  color: #fff;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.5);
  cursor: pointer;
}
.es-cancel:hover { border-color: #fff; }

/* player failure (app.js): localized message over the player instead of a dead <video> */
.player-error {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  text-align: center;
  background: rgba(0, 0, 0, 0.88);
  color: #fff;
}
.pe-text { margin: 0; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.pe-retry {
  min-width: 44px;
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  background: var(--accent);
  color: #000;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

/* video lock (app.js): offer overlay after popup.videoLockSec seconds watched; click opens /go */
.video-lock {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border: 0;
  font: inherit;
  text-align: center;
  background: rgba(0, 0, 0, 0.9);
  color: #fff;
  cursor: pointer;
}
.video-lock[hidden] { display: none; }
.vl-card { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 320px; }
.vl-title { font-size: 18px; font-weight: 700; line-height: 1.3; }
.vl-sub { font-size: 14px; line-height: 1.4; opacity: 0.85; }
.vl-cta {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 24px;
  background: var(--accent);
  color: #000;
  font-weight: 700;
}

/* search suggestions (app.js) */
.suggest {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 70;
  background: var(--bg-alt);
  border: 1px solid #333;
  /* max-height is set by app.js to the visible area below the sticky header */
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.suggest a {
  display: block;
  min-height: 44px;
  padding: 12px;
  color: var(--fg);
  font-size: 14px;
  line-height: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.suggest a.active, .suggest a:hover { background: var(--accent); color: #000; }

/* network ad zones (ads.json; absent when not configured) */
.ad-card { align-items: center; justify-content: center; min-height: 90px; overflow: hidden; }
.ad-underplayer { display: flex; justify-content: center; margin: 10px 0; }
.ad-sticky {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  justify-content: center;
  padding: 4px;
  background: #000;
  border-top: 1px solid #333;
}
body.has-ad-sticky { padding-bottom: 60px; }

/* download banner under the player (promo.js), when the app banner is off */
.download-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin: 10px 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.download-banner-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.download-banner-text strong { color: var(--fg); font-size: 14px; }
.download-banner-text small { font-size: 12px; color: var(--fg-dim); }
.download-banner-cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  background: var(--accent);
  color: #000;
  font-weight: 700;
  font-size: 13px;
}

/* promo modal (promo.js): on-load / Back / download offer dialogs → /go */
.promo-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.85);
}
.promo-overlay.is-open { display: flex; }
.promo-card {
  position: relative;
  width: 100%;
  max-width: 360px;
  padding: 28px 24px 24px;
  text-align: center;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  animation: promoIn 0.28s ease;
}
@keyframes promoIn {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}
.promo-close {
  position: absolute;
  top: 8px;
  inset-inline-end: 10px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--fg-dim);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.promo-icon { display: flex; justify-content: center; margin: 0 auto 14px; color: var(--accent); }
.promo-title { margin: 0 0 14px; color: var(--fg); font-size: 20px; font-weight: 700; line-height: 1.3; }
.promo-features { list-style: none; margin: 0 0 14px; padding: 0; text-align: start; }
.promo-features li { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; color: var(--fg-text); font-size: 14px; line-height: 1.35; }
.promo-features li::before { content: "\2713"; flex-shrink: 0; color: var(--green); font-weight: 700; }
.promo-rating { margin: 0 0 18px; color: var(--fg-dim); font-size: 13px; }
.promo-rating:not([hidden])::before { content: "\2605\2605\2605\2605\2605"; margin-inline-end: 8px; letter-spacing: 1px; color: #f5a623; }
.promo-cta {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 12px 20px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #000;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
}

/* ---------- footer, legal pages ---------- */
.site-footer {
  margin-top: 24px;
  padding: 18px 10px;
  background: var(--bg-alt);
  border-top: 1px solid #000;
  text-align: center;
}
.footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 6px; }
.footer-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 8px;
  color: var(--fg-dim);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.footer-nav a:hover { color: var(--fg); }
.footer-copy { margin: 4px 0 0; color: #555; font-size: 12px; }
.footer-copy a { color: var(--accent); }
.legal { max-width: 720px; margin: 0 auto; overflow-wrap: anywhere; }
.legal h1 { font-size: 1.35rem; line-height: 1.3; margin: 16px 0; }
.legal h2 { font-size: 1.05rem; line-height: 1.3; margin: 24px 0 8px; }
.legal p, .legal li { margin: 0 0 12px; }
.legal ul { margin: 0 0 12px; padding-inline-start: 1.2em; }
.legal a { color: var(--accent); text-decoration: underline; }

/* ---------- app banners (ads.json popup.banners, partials/app-banner.ejs, public/banners.js) ----------
   Store-style promos of the offer's app with the Play install green. The title takes the full text width and
   the localized button shares the row under it with the rating; the grid card scales with its own width
   (container units) so it never spills out of its 16:9 box on narrow phones. */
.bn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--fg);
  -webkit-tap-highlight-color: transparent;
}
.bn:hover { color: var(--fg); }
/* the letter stays as the tile when the image fails (onerror removes it): never a broken-image icon */
.bn-icon {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 11px;
  overflow: hidden;
  background: var(--accent);
  color: #000;
  font: 700 22px/1 Arial, Helvetica, sans-serif;
}
.bn-icon img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bn-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.bn-title {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bn-sub {
  color: #aaa;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bn-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
.bn-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-width: 0; }
.bn-ad {
  display: inline-block;
  flex: none;
  padding: 0 4px;
  border: 1px solid #555;
  border-radius: 2px;
  color: #999;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.3px;
  line-height: 13px;
  white-space: nowrap;
}
.card-title .bn-ad, .card-meta .bn-ad { margin-inline-end: 5px; vertical-align: 1px; }
/* partial stars: the gold layer is clipped to the rating (--bn-fill), from the line start (right in RTL) */
.bn-rating { display: inline-flex; align-items: center; gap: 5px; color: #ddd; font-size: 12px; font-weight: 700; line-height: 1; white-space: nowrap; }
.bn-stars { position: relative; display: inline-block; letter-spacing: 1px; color: #555; }
.bn-stars::before { content: "\2605\2605\2605\2605\2605"; }
.bn-stars::after {
  content: "\2605\2605\2605\2605\2605";
  position: absolute;
  top: 0;
  inset-inline-start: 0;
  width: var(--bn-fill, 100%);
  overflow: hidden;
  white-space: nowrap;
  color: #f5a623;
}
.bn-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 6px;
  background: var(--play);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
.bn-btn svg { flex: none; width: 16px; height: 16px; }
.bn:hover .bn-btn, .bn:active .bn-btn { background: var(--play-dark); }

/* bar under the header; the second line of copy only where there is room for it */
.bn-wrap { max-width: 1280px; margin: 0 auto; padding: 8px 10px 4px; }
.bn-top {
  padding: 10px 12px;
  border: 1px solid #2d2640;
  border-radius: 8px;
  background: linear-gradient(135deg, #231d2e, #15121c);
}
.bn-top .bn-sub { display: none; }
/* wide screens: the button moves to the end of the banner, centred against the text like a leaderboard */
@media (min-width: 600px) {
  .bn-top .bn-sub { display: -webkit-box; }
  .bn-top .bn-body, .bn-under .bn-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 16px;
    row-gap: 4px;
  }
  .bn-top .bn-row, .bn-under .bn-row { display: contents; }
  .bn-top .bn-body > :not(.bn-row), .bn-under .bn-body > :not(.bn-row), .bn-top .bn-meta, .bn-under .bn-meta { grid-column: 1; }
  .bn-top .bn-btn, .bn-under .bn-btn { grid-column: 2; grid-row: 1 / span 3; align-self: center; min-height: 40px; padding: 0 22px; }
}

/* card inside a grid: same cell as a video card */
.bn-card { flex-direction: column; align-items: stretch; gap: 4px; container-type: inline-size; }
.bn-card-media {
  aspect-ratio: 16 / 9;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  gap: 3.5cqw;
  padding: 7px;
  padding: 4.5cqw;
  border-radius: var(--radius);
  background: linear-gradient(160deg, #2a2240, #161322);
  overflow: hidden;
}
@media (hover: hover) {
  .bn-card:hover .bn-card-media { outline: 2px solid var(--accent); outline-offset: -2px; }
}
.bn-card-head { display: flex; align-items: center; gap: 8px; gap: 4.5cqw; min-width: 0; }
.bn-card .bn-icon {
  width: 40px;
  height: 40px;
  width: min(26cqw, 56px);
  height: min(26cqw, 56px);
  border-radius: 22%;
  font-size: 18px;
  font-size: min(12cqw, 26px);
}
.bn-card-id { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; gap: 1.8cqw; }
.bn-card-name {
  color: #fff;
  font-size: 12px;
  font-size: clamp(10px, 7.6cqw, 15px);
  line-height: 1.2;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bn-card .bn-rating { font-size: 10px; font-size: clamp(9px, 6.4cqw, 13px); gap: 1.8cqw; }
.bn-card .bn-stars { letter-spacing: 0; }
.bn-card .bn-btn {
  min-height: 0;
  height: 26px;
  height: clamp(22px, 15.5cqw, 36px);
  padding: 0 8px;
  gap: 4px;
  border-radius: 4px;
  font-size: 12px;
  font-size: clamp(11px, 7cqw, 15px);
}
.bn-card .bn-btn svg { width: 14px; height: 14px; width: clamp(12px, 8cqw, 17px); height: clamp(12px, 8cqw, 17px); }

/* strip over a paused player (banners.js): at the top, so the native seek bar and fullscreen button of the
   paused player stay free; below the quality menu when hls.js adds one, under the lock/end/error overlays */
.bn-play {
  position: absolute;
  inset-inline: 8px;
  top: 8px;
  z-index: 4;
  gap: 8px;
  padding: 6px;
  padding-inline-start: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(20, 16, 30, 0.92);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.bn-play[hidden] { display: none; }
.player:has(.quality) .bn-play { top: 40px; }
.bn-play .bn-icon { width: 36px; height: 36px; border-radius: 9px; font-size: 16px; }
.bn-play .bn-body { gap: 3px; }
.bn-play .bn-title { font-size: 13px; }
.bn-play .bn-btn { min-height: 34px; padding: 0 12px; }

/* banner under the player */
.bn-under {
  margin: 12px 0 4px;
  padding: 12px;
  border: 1px solid var(--border);
  border-inline-start: 3px solid var(--play);
  border-radius: 6px;
  background: var(--bg-alt);
}

/* banner at the top of the phone menu */
.bn-side { margin: 12px 14px 4px; padding: 10px; border-radius: 8px; background: #242424; }
.bn-side .bn-icon { width: 42px; height: 42px; border-radius: 10px; font-size: 19px; }

/* fixed bar at the bottom of phone screens; the close button is its own target, never the offer.
   banners.js keeps the page's bottom padding equal to the bar's real height (font scaling included). */
.bn-sticky {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 150;
  display: flex;
  align-items: stretch;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  border-top: 1px solid var(--border);
  background: #141414;
  box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.5);
}
.bn-sticky[hidden] { display: none; }
.bn-sticky .bn { flex: 1; padding: 7px 0; padding-inline-start: 10px; }
.bn-sticky .bn-icon { width: 44px; height: 44px; border-radius: 10px; font-size: 20px; }
.bn-sticky .bn-body { gap: 2px; }
.bn-sticky .bn-title { font-size: 13.5px; -webkit-line-clamp: 1; }
.bn-sticky .bn-row { margin-top: 0; }
.bn-sticky .bn-btn { min-height: 32px; }
.bn-x {
  flex: none;
  width: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: none;
  color: #888;
  font: 400 26px/1 Arial, Helvetica, sans-serif;
  cursor: pointer;
}
.bn-x:hover { color: #fff; }
body.has-bn-sticky { padding-bottom: 76px; }

/* ---------- wider screens ---------- */
@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 10px; }
  .hero { height: 220px; }
  .hero-content { padding: 0 24px; gap: 18px; }
  .hero-play { width: 56px; height: 56px; }
  .hero-title { font-size: 26px; }
  .video-title { font-size: 18px; }
  .video-info { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
  .video-rating { min-width: 200px; }
  .page-head-img { width: 80px; }
  .page-head h1 { font-size: 20px; }
}
@media (min-width: 768px) {
  .ad-sticky, .bn-sticky { display: none; }
  body.has-ad-sticky, body.has-bn-sticky { padding-bottom: 0; }
  .endscreen { padding: 24px; gap: 16px; }
  .es-title { font-size: 18px; }
}
@media (min-width: 900px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hero { height: 280px; margin: 0 0 8px; }
  .hero-content { padding: 0 40px; gap: 30px; }
  .hero-play { width: 70px; height: 70px; border-width: 3px; }
  .hero-play svg { width: 32px; height: 32px; }
  .hero-title { font-size: 32px; }
  .section-heading { font-size: 14px; padding-top: 16px; padding-bottom: 12px; border-inline-start-width: 4px; }
  .video-page { max-width: 960px; }
  .video-title { font-size: 20px; }
}
@media (min-width: 1100px) {
  .cat-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
