/* =====================================================================
   CineStream — front-end stylesheet (no build step required).
   Colours come from the [data-theme] palette on <html>; the admin picks the
   active theme in Admin → Themes. Text on artwork (billboard, cards) is
   always light so every palette stays readable.
   ===================================================================== */

:root {
  --bg: #141414;
  --bg-elev: #1b1b1b;
  --bg-card: #232323;
  --bg-hover: #2f2f2f;
  --border: #333;
  --text: #f5f5f1;
  --text-dim: #a3a3a3;
  --primary: #e50914;
  --primary-2: #b20710;
  --on-primary: #fff;
  --accent: #46d369;
  --success: #46d369;
  --warning: #f5c518;
  --danger: #e87c03;
  --radius: 6px;
  --header-h: 68px;
  --gutter: 4%;
  --shadow: 0 10px 34px rgba(0,0,0,.6);
  --header-solid: #141414;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; max-width: 100%; overflow-x: hidden; }
body { background: var(--bg); color: var(--text); font-family: "Helvetica Neue", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.5; -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; text-decoration: none; }
img, video, iframe { max-width: 100%; display: block; }
button { font: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { padding-inline: var(--gutter); }
.cs-main { flex: 1; padding-top: calc(var(--header-h) + 18px); }
.cs-main.has-hero { padding-top: 0; }

/* ---------------- Header ---------------- */
.cs-header { position: fixed; inset-block-start: 0; inset-inline: 0; z-index: 100; height: var(--header-h);
  display: flex; align-items: center; gap: 18px; padding-inline: var(--gutter); color: #fff;
  background: linear-gradient(180deg, rgba(0,0,0,.75) 10%, rgba(0,0,0,0)); transition: background-color .35s ease; }
.cs-header.solid { background: var(--header-solid); }
body:not(.hero-page) .cs-header { background: var(--header-solid); }
[data-mode="light"] .cs-header.solid, [data-mode="light"] body:not(.hero-page) .cs-header { color: var(--text); box-shadow: 0 1px 0 var(--border); }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 900; font-size: 27px; letter-spacing: -.8px;
  color: var(--primary); white-space: nowrap; min-width: 0; }
.brand .brand-logo { height: 34px; width: auto; max-width: 170px; object-fit: contain; }
.brand .logo-dot { display: none; }
.brand-name { overflow: hidden; text-overflow: ellipsis; }
.cs-nav { display: flex; align-items: center; gap: 18px; }
.cs-nav a { font-size: 14px; opacity: .85; white-space: nowrap; transition: opacity .2s; }
.cs-nav a:hover { opacity: 1; }
.cs-nav a.active { opacity: 1; font-weight: 700; }
.cs-spacer { flex: 1; }
.cs-tools { display: flex; align-items: center; gap: 14px; }
.icon-btn { background: none; border: 0; color: inherit; cursor: pointer; padding: 6px; display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; }
.icon-btn svg { width: 22px; height: 22px; }
/* Light / dark mode switch: shows the mode it switches to. */
[data-mode="dark"] .mode-toggle .i-moon, [data-mode="light"] .mode-toggle .i-sun { display: none; }
.menu-toggle { display: none; }

/* search */
.cs-search { position: relative; display: flex; align-items: center; }
.cs-search form { display: flex; align-items: center; border: 1px solid transparent; transition: all .25s ease; }
.cs-search input { width: 0; padding: 0; border: 0; background: transparent; color: #fff; outline: none; font-size: 14px; transition: width .25s ease, padding .25s ease; }
.cs-search.open form { background: rgba(0,0,0,.85); border-color: rgba(255,255,255,.85); }
.cs-search.open input { width: 230px; padding: 7px 6px; }
.suggest { position: absolute; inset-block-start: calc(100% + 6px); inset-inline-end: 0; width: 320px; max-width: 86vw; background: var(--bg-elev);
  color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: none; z-index: 120; }
.suggest.open { display: block; }
.suggest a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; }
.suggest a:hover, .suggest a.hl { background: var(--bg-hover); }
.suggest img { width: 72px; height: 40px; object-fit: cover; border-radius: 3px; background: #000; flex: 0 0 auto; }
.suggest b { display: block; font-size: 14px; line-height: 1.25; }
.suggest small { color: var(--text-dim); font-size: 12px; }
.suggest .all { justify-content: center; font-size: 13px; color: var(--text-dim); border-top: 1px solid var(--border); }

/* dropdowns (language, profile, mobile browse) */
.dd { position: relative; }
.dd-toggle { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; background: none; border: 0; color: inherit; font-size: 14px; padding: 4px; white-space: nowrap; }
.dd-toggle .caret { font-size: 10px; transition: transform .2s; }
.dd-menu { position: absolute; inset-block-start: calc(100% + 10px); inset-inline-end: 0; min-width: 210px; max-height: 70vh; overflow: auto;
  background: rgba(15,15,15,.96); color: #fff; border: 1px solid rgba(255,255,255,.15); border-radius: 4px; padding: 6px 0;
  box-shadow: var(--shadow); display: none; z-index: 130; }
.dd-menu.open { display: block; }
.dd-menu a, .dd-menu button { display: flex; gap: 10px; align-items: center; width: 100%; padding: 9px 16px; font-size: 14px; color: #ddd; background: none; border: 0; cursor: pointer; text-align: start; }
.dd-menu a:hover, .dd-menu button:hover { color: #fff; text-decoration: underline; }
.dd-menu a.on { color: #fff; font-weight: 700; }
.dd-menu hr { border: 0; border-top: 1px solid rgba(255,255,255,.15); margin: 6px 0; }
.dd-menu.grid { display: none; grid-template-columns: 1fr 1fr; width: 300px; }
.dd-menu.grid.open { display: grid; }
.avatar { width: 32px; height: 32px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; font-weight: 800; font-size: 15px; overflow: hidden; flex: 0 0 auto; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.premium-chip { font-size: 11px; font-weight: 800; letter-spacing: .5px; padding: 3px 7px; border-radius: 3px; background: var(--warning); color: #1b1300; text-transform: uppercase; }

/* ---------------- Buttons ---------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 22px; border-radius: 4px; border: 0;
  cursor: pointer; font-weight: 700; font-size: 16px; line-height: 1.3; background: var(--bg-hover); color: var(--text); transition: filter .15s, background-color .15s, opacity .15s; white-space: nowrap; }
.btn:hover { filter: brightness(1.12); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 22px; height: 22px; flex: 0 0 auto; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-play { background: #fff; color: #000; }
.btn-play:hover { background: rgba(255,255,255,.78); filter: none; }
.btn-glass { background: rgba(109,109,110,.7); color: #fff; }
.btn-glass:hover { background: rgba(109,109,110,.45); filter: none; }
.btn-ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.circle-btn { width: 40px; height: 40px; border-radius: 50%; border: 2px solid rgba(255,255,255,.55); background: rgba(42,42,42,.6); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; flex: 0 0 auto; transition: border-color .15s, background-color .15s; }
.circle-btn:hover { border-color: #fff; background: rgba(255,255,255,.12); }
.circle-btn svg { width: 20px; height: 20px; }
.circle-btn.on { border-color: #fff; background: rgba(255,255,255,.18); }
.circle-btn.play { background: #fff; color: #000; border-color: #fff; }
.circle-btn.play:hover { background: rgba(255,255,255,.8); }

/* ---------------- Billboard ---------------- */
.billboard { position: relative; height: 82vh; min-height: 480px; max-height: 860px; overflow: hidden; color: #fff; background: #000; margin-bottom: -6vw; }
.bb-slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .8s ease, visibility .8s; }
.bb-slide.active { opacity: 1; visibility: visible; }
.bb-media { position: absolute; inset: 0; }
.bb-media img, .bb-media video { width: 100%; height: 100%; object-fit: cover; }
.bb-media video { position: absolute; inset: 0; opacity: 0; transition: opacity .8s; }
.bb-media video.playing { opacity: 1; }
.bb-shade { position: absolute; inset: 0; background:
  linear-gradient(77deg, rgba(0,0,0,.78) 0%, rgba(0,0,0,.35) 45%, rgba(0,0,0,0) 70%),
  linear-gradient(180deg, rgba(0,0,0,0) 55%, color-mix(in srgb, var(--bg) 65%, transparent) 82%, var(--bg) 98%); }
[dir="rtl"] .bb-shade { background: linear-gradient(-77deg, rgba(0,0,0,.78) 0%, rgba(0,0,0,.35) 45%, rgba(0,0,0,0) 70%), linear-gradient(180deg, rgba(0,0,0,0) 55%, color-mix(in srgb, var(--bg) 65%, transparent) 82%, var(--bg) 98%); }
.bb-info { position: absolute; inset-inline-start: var(--gutter); inset-block-end: calc(6vw + 22%); width: min(40%, 620px); z-index: 2; }
.bb-kicker { font-size: 13px; font-weight: 800; letter-spacing: 3px; text-transform: uppercase; color: var(--primary); margin-bottom: 10px; display: flex; gap: 8px; align-items: center; }
.bb-title { font-size: clamp(30px, 4.4vw, 66px); line-height: 1.02; font-weight: 900; margin: 0 0 14px; text-shadow: 2px 2px 8px rgba(0,0,0,.45); letter-spacing: -1px; }
.bb-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 15px; margin-bottom: 12px; color: #e6e6e6; }
.bb-desc { font-size: clamp(14px, 1.25vw, 19px); text-shadow: 1px 1px 6px rgba(0,0,0,.5); margin: 0 0 20px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bb-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.bb-side { position: absolute; inset-inline-end: 0; inset-block-end: calc(6vw + 22%); z-index: 2; display: flex; align-items: center; gap: 12px; }
.bb-side .rating { background: rgba(51,51,51,.6); border-inline-start: 3px solid #dcdcdc; padding: 6px 30px 6px 12px; font-size: 15px; }
.bb-dots { position: absolute; inset-block-end: calc(6vw + 8%); inset-inline-start: var(--gutter); display: flex; gap: 6px; z-index: 3; }
.bb-dots button { width: 22px; height: 3px; border: 0; background: rgba(255,255,255,.35); cursor: pointer; padding: 0; }
.bb-dots button.active { background: #fff; }
.mat { display: inline-block; border: 1px solid rgba(255,255,255,.55); padding: 0 6px; font-size: 12px; line-height: 18px; border-radius: 2px; }
.qual { display: inline-block; border: 1px solid rgba(255,255,255,.4); padding: 0 5px; font-size: 10px; line-height: 15px; border-radius: 3px; font-weight: 700; }
.match { color: var(--accent); font-weight: 700; }
.badge-premium { display: inline-flex; align-items: center; gap: 4px; background: var(--warning); color: #1b1300; font-size: 11px; font-weight: 800; padding: 1px 6px; border-radius: 3px; text-transform: uppercase; letter-spacing: .4px; }
.badge-soon { display: inline-block; background: var(--primary); color: var(--on-primary); font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 3px; }

/* ---------------- Rows ---------------- */
.rows { position: relative; z-index: 4; padding-bottom: 30px; }
.cs-main:not(.has-hero) .rows { padding-top: 6px; }
.row { margin: 0 0 3vw; position: relative; }
.row-head { display: flex; align-items: baseline; gap: 12px; padding-inline: var(--gutter); margin: 0 0 10px; }
.row-head h2 { margin: 0; font-size: clamp(16px, 1.45vw, 22px); font-weight: 700; color: var(--text); }
.row-head a.more { font-size: 13px; color: var(--accent); font-weight: 700; opacity: 0; transform: translateX(-8px); transition: all .3s; white-space: nowrap; }
.row:hover .row-head a.more, .row-head a.more:focus { opacity: 1; transform: none; }
.row-track { position: relative; }
.row-scroller { display: flex; gap: .4vw; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding: 4px var(--gutter); scroll-padding-inline: var(--gutter); scrollbar-width: none; }
.row-scroller::-webkit-scrollbar { display: none; }
.row-scroller > * { scroll-snap-align: start; flex: 0 0 calc((100% - 5 * .4vw) / 6); min-width: 0; }
.row-arrow { position: absolute; inset-block: 4px; width: calc(var(--gutter) - 2px); z-index: 6; border: 0; color: #fff; cursor: pointer; font-size: 34px;
  background: rgba(20,20,20,.55); opacity: 0; transition: opacity .2s, background-color .2s; display: flex; align-items: center; justify-content: center; }
.row-arrow.prev { inset-inline-start: 0; border-start-end-radius: 4px; border-end-end-radius: 4px; }
.row-arrow.next { inset-inline-end: 0; border-start-start-radius: 4px; border-end-start-radius: 4px; }
.row-track:hover .row-arrow:not([hidden]) { opacity: 1; }
.row-arrow:hover { background: rgba(20,20,20,.8); }
[dir="rtl"] .row-arrow span { display: inline-block; transform: scaleX(-1); }
@media (hover: none) { .row-arrow { display: none; } }

/* card */
.tcard { position: relative; display: block; border-radius: 4px; overflow: hidden; background: var(--bg-card); aspect-ratio: 16 / 9; color: #fff; }
.tcard img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.tcard .tc-fallback { position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 10px; font-weight: 800; font-size: 15px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 60%, #000), #111); }
.tcard .tc-name { position: absolute; inset-inline: 0; inset-block-end: 0; padding: 18px 9px 7px; font-size: 13px; font-weight: 700; line-height: 1.2;
  background: linear-gradient(0deg, rgba(0,0,0,.85), transparent); text-shadow: 0 1px 3px rgba(0,0,0,.8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tcard .tc-flags { position: absolute; inset-block-start: 6px; inset-inline-start: 6px; display: flex; gap: 4px; }
.tcard .tc-ep { position: absolute; inset-block-start: 6px; inset-inline-end: 6px; background: rgba(0,0,0,.72); font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 3px; }
.tcard .tc-progress { position: absolute; inset-inline: 8px; inset-block-end: 6px; height: 3px; background: rgba(255,255,255,.35); }
.tcard .tc-progress span { display: block; height: 100%; background: var(--primary); }
.tcard.has-progress .tc-name { padding-bottom: 14px; }
.tcard .tc-remove { position: absolute; inset-block-start: 6px; inset-inline-end: 6px; width: 26px; height: 26px; border-radius: 50%; border: 1px solid rgba(255,255,255,.6);
  background: rgba(0,0,0,.7); color: #fff; cursor: pointer; font-size: 14px; line-height: 1; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .2s; z-index: 2; }
.tcard:hover .tc-remove, .tcard:focus-within .tc-remove { opacity: 1; }
@media (hover: none) { .tcard .tc-remove { opacity: .85; } }
.tcard:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
/* Hover: the picture zooms in and a play mark appears (mouse); a touch presses the card in. */
.tcard::after { content: ""; position: absolute; inset-block-start: 50%; inset-inline-start: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px;
  border-radius: 50%; border: 2px solid #fff; pointer-events: none; opacity: 0; transform: scale(.8); transition: opacity .2s, transform .2s;
  background: rgba(0,0,0,.55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M8 5.5v13a.8.8 0 0 0 1.2.7l10.4-6.5a.8.8 0 0 0 0-1.4L9.2 4.8A.8.8 0 0 0 8 5.5z'/%3E%3C/svg%3E") 55% 50% / 22px no-repeat; }
.tcard img, .tcard .tc-fallback { transition: transform .35s ease, filter .35s; }
@media (hover: hover) {
  .tcard { transition: box-shadow .25s; }
  .tcard:hover { box-shadow: 0 0 0 2px var(--primary), 0 8px 22px rgba(0,0,0,.45); }
  .tcard:hover img, .tcard:hover .tc-fallback { transform: scale(1.08); filter: brightness(.85); }
  .tcard:hover::after { opacity: 1; transform: none; }
}
.tcard:active img, .tcard:active .tc-fallback { transform: scale(.97); }
/* Phones: the silent preview of the card in the middle of the screen (cine.js). */
.tcard .tc-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s; pointer-events: none; background: #000; }
.tcard .tc-preview.on { opacity: 1; }

/* Top 10 */
.row-top10 .row-scroller > * { flex-basis: calc((100% - 4 * .4vw) / 5); }
.t10 { display: flex; align-items: stretch; height: 100%; aspect-ratio: 16 / 10.5; }
.t10 .num { flex: 0 0 48%; font-size: clamp(90px, 10.5vw, 190px); font-weight: 900; line-height: .82; letter-spacing: -10px; color: var(--bg);
  -webkit-text-stroke: 4px #595959; display: flex; align-items: flex-end; justify-content: flex-end; margin-inline-end: -4%; font-family: Impact, "Arial Black", sans-serif; }
.t10 .tcard { flex: 0 0 52%; aspect-ratio: auto; height: 100%; }
.t10 .tcard .tc-name { display: none; }

/* grid pages */
.grid-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; padding-inline: var(--gutter); margin: 6px 0 22px; }
.grid-head h1 { margin: 0; font-size: clamp(24px, 3vw, 38px); font-weight: 800; }
.grid-head p { flex-basis: 100%; margin: -6px 0 0; color: var(--text-dim); max-width: 760px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.select { background: var(--bg); color: var(--text); border: 1px solid var(--text-dim); padding: 6px 30px 6px 10px; font-size: 14px; border-radius: 2px; cursor: pointer; }
.chip { display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--text-dim); background: var(--bg-card); }
.chip.on, .chip:hover { color: var(--text); border-color: var(--text-dim); }
.title-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 3.2vw .5vw; padding-inline: var(--gutter); }
.row-wrap .row-scroller { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2vw .5vw; overflow: visible; }
.empty { padding: 60px var(--gutter); text-align: center; color: var(--text-dim); }
.empty h2 { color: var(--text); }

/* hover preview (desktop) */
.preview { position: absolute; z-index: 90; background: var(--bg-elev); color: var(--text); border-radius: 6px; overflow: hidden;
  box-shadow: 0 6px 28px rgba(0,0,0,.75); transform-origin: center top; transform: scale(.68); opacity: 0;
  transition: transform .26s ease, opacity .2s ease; }
.preview.show { transform: none; opacity: 1; }
.preview .pv-media { position: relative; aspect-ratio: 16 / 9; background: #000; cursor: pointer; }
.preview .pv-media img, .preview .pv-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.preview .pv-media .tc-name { position: absolute; inset-inline: 0; inset-block-end: 0; padding: 22px 12px 8px; font-weight: 800; color: #fff; background: linear-gradient(0deg, rgba(0,0,0,.85), transparent); }
.preview .pv-body { padding: 12px 14px 16px; }
.preview .pv-actions { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.preview .pv-actions .circle-btn { width: 36px; height: 36px; border-color: rgba(128,128,128,.7); }
[data-mode="light"] .preview .circle-btn:not(.play) { color: var(--text); background: transparent; border-color: var(--border); }
.preview .pv-actions .grow { flex: 1; }
.preview .pv-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; margin-bottom: 8px; }
.preview .pv-meta .mat, .preview .pv-meta .qual { border-color: var(--text-dim); color: var(--text-dim); }
.preview .pv-genres { font-size: 13px; color: var(--text); display: flex; flex-wrap: wrap; gap: 4px 8px; }
.preview .pv-genres span + span::before { content: "•"; color: var(--text-dim); margin-inline-end: 8px; }
.preview .pv-desc { font-size: 12.5px; color: var(--text-dim); margin: 8px 0 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------------- Title page ---------------- */
.title-hero { position: relative; min-height: 76vh; display: flex; align-items: flex-end; color: #fff; overflow: hidden; background: #000; }
.title-hero .bb-media img { opacity: .9; }
.title-hero .bb-shade { background: linear-gradient(77deg, rgba(0,0,0,.85) 0%, rgba(0,0,0,.45) 50%, rgba(0,0,0,.05) 80%), linear-gradient(180deg, rgba(0,0,0,.2) 0%, rgba(0,0,0,0) 40%, color-mix(in srgb, var(--bg) 70%, transparent) 80%, var(--bg) 97%); }
/* Light mode: the hero stays dark under its white text instead of fading to the light page. */
[data-mode="light"] .title-hero .bb-shade { background: linear-gradient(77deg, rgba(0,0,0,.85) 0%, rgba(0,0,0,.45) 50%, rgba(0,0,0,.05) 80%), linear-gradient(180deg, rgba(0,0,0,.2) 0%, rgba(0,0,0,0) 40%, rgba(0,0,0,.72) 82%, rgba(0,0,0,.9) 100%); }
.title-hero .th-body { position: relative; z-index: 2; width: 100%; padding: calc(var(--header-h) + 40px) var(--gutter) 34px; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 34px; align-items: end; }
.th-body h1 { font-size: clamp(30px, 4.6vw, 64px); line-height: 1.04; font-weight: 900; margin: 0 0 12px; letter-spacing: -1px; text-shadow: 2px 2px 8px rgba(0,0,0,.4); }
.th-tagline { font-size: 18px; font-style: italic; color: #ddd; margin: -4px 0 12px; }
.th-desc { font-size: 17px; max-width: 760px; color: #eee; margin: 12px 0 18px; }
.th-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 18px 0 6px; }
.th-resume { max-width: 360px; margin-top: 10px; display: flex; align-items: center; gap: 10px; font-size: 13px; color: #ccc; }
.th-resume .bar { flex: 1; height: 3px; background: rgba(255,255,255,.3); }
.th-resume .bar span { display: block; height: 100%; background: var(--primary); }
.th-side { font-size: 14px; color: #ccc; }
.th-side p { margin: 0 0 8px; }
.th-side span.k { color: #8c8c8c; }
.th-side a:hover { text-decoration: underline; }
.section { padding-inline: var(--gutter); margin: 34px 0; }
.section > h2, .section-head h2 { font-size: 24px; margin: 0 0 16px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.section-head h2 { margin: 0; }
.episodes { border-top: 1px solid var(--border); }
.ep { display: grid; grid-template-columns: 40px 190px minmax(0, 1fr); gap: 18px; align-items: center; padding: 18px 14px; border-bottom: 1px solid var(--border); border-radius: 4px; }
.ep:hover, .ep.current { background: var(--bg-card); }
.ep .ep-no { font-size: 24px; color: var(--text-dim); text-align: center; }
.ep .ep-thumb { position: relative; aspect-ratio: 16/9; border-radius: 4px; overflow: hidden; background: #000; }
.ep .ep-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ep .ep-thumb .play-ico { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .2s; background: rgba(0,0,0,.35); }
.ep:hover .play-ico { opacity: 1; }
.ep .ep-thumb .play-ico span { width: 42px; height: 42px; border-radius: 50%; border: 2px solid #fff; display: flex; align-items: center; justify-content: center; color: #fff; background: rgba(0,0,0,.5); }
.ep .ep-thumb .tc-progress { position: absolute; inset-inline: 0; inset-block-end: 0; height: 4px; background: rgba(255,255,255,.3); }
.ep .ep-thumb .tc-progress span { display: block; height: 100%; background: var(--primary); }
.ep h3 { margin: 0; font-size: 16px; display: flex; justify-content: space-between; gap: 10px; }
.ep h3 small { color: var(--text-dim); font-weight: 400; white-space: nowrap; }
.ep p { margin: 6px 0 0; color: var(--text-dim); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.similar-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.sim { background: var(--bg-card); border-radius: 6px; overflow: hidden; display: flex; flex-direction: column; }
.sim .tcard { border-radius: 0; }
.sim-body { padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.sim-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sim-top .meta { font-size: 13px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--text-dim); }
.sim-top .meta .mat { border-color: var(--text-dim); }
.sim p { margin: 0; font-size: 13px; color: var(--text-dim); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.sim .circle-btn { color: var(--text); background: transparent; border-color: var(--text-dim); width: 34px; height: 34px; }
.about-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 30px; font-size: 14px; color: var(--text); }
.about-grid .k { color: var(--text-dim); }

/* comments */
.comments { max-width: 860px; }
.comment { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.comment .body { min-width: 0; }
.comment b { font-size: 14px; }
.comment small { color: var(--text-dim); margin-inline-start: 6px; }
.comment p { margin: 4px 0 0; white-space: pre-line; overflow-wrap: anywhere; }

/* ---------------- Forms / cards ---------------- */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 22px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; font-weight: 600; }
.input { width: 100%; padding: 13px 14px; border-radius: 4px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 15px; outline: none; }
.input:focus { border-color: var(--text); }
textarea.input { resize: vertical; }
.check { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--text-dim); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.alert { padding: 12px 16px; border-radius: 4px; margin: 0 0 16px; font-size: 14px; font-weight: 600; }
.alert-success { background: color-mix(in srgb, var(--success) 18%, transparent); color: var(--text); border-inline-start: 4px solid var(--success); }
.alert-error { background: color-mix(in srgb, var(--danger) 22%, transparent); color: var(--text); border-inline-start: 4px solid var(--danger); }
.flash { position: relative; z-index: 5; margin: 0 var(--gutter) 18px; }
.cs-main.has-hero .flash { position: absolute; inset-block-start: calc(var(--header-h) + 8px); inset-inline: var(--gutter); margin: 0; z-index: 20; }
.muted { color: var(--text-dim); }
.page-narrow { max-width: 920px; margin-inline: auto; padding-inline: 16px; }
.prose { font-size: 16px; line-height: 1.7; }
.prose img { height: auto; }

/* auth */
.auth-bg { position: fixed; inset: 0; z-index: -1; background: #000 center / cover no-repeat; }
.auth-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.75), rgba(0,0,0,.45) 40%, rgba(0,0,0,.85)); }
.auth-box { width: 100%; max-width: 450px; margin: 4vh auto 60px; background: rgba(0,0,0,.76); color: #fff; border-radius: 6px; padding: 48px 56px 40px; }
.auth-box h1 { margin: 0 0 26px; font-size: 32px; }
.auth-box .input { background: rgba(22,22,22,.7); color: #fff; border-color: rgba(128,128,128,.7); }
.auth-box .input:focus { border-color: #fff; }
.auth-box label { color: #b3b3b3; }
.auth-box .muted, .auth-box .check { color: #b3b3b3; }
.auth-box a.link { color: #fff; font-weight: 600; }
.auth-box a.link:hover { text-decoration: underline; }
.auth-box .alert { color: #fff; }
.auth-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; font-size: 14px; }
.auth-box .divider { display: flex; align-items: center; gap: 10px; color: #8c8c8c; font-size: 13px; margin: 16px 0; }
.auth-box .divider::before, .auth-box .divider::after { content: ""; flex: 1; height: 1px; background: #333; }

/* account / premium */
.acc-grid { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 30px; align-items: start; }
.acc-nav { position: sticky; top: calc(var(--header-h) + 12px); display: flex; flex-direction: column; gap: 2px; }
.acc-nav a { padding: 10px 14px; border-radius: 4px; color: var(--text-dim); font-weight: 600; }
.acc-nav a:hover { background: var(--bg-card); color: var(--text); }
.acc-section { margin-bottom: 26px; scroll-margin-top: calc(var(--header-h) + 12px); }
.acc-section h2 { margin: 0 0 14px; font-size: 20px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: start; color: var(--text-dim); font-weight: 600; padding: 9px 8px; border-bottom: 1px solid var(--border); }
.table td { padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table-wrap { overflow-x: auto; }
.status { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--bg-hover); }
.status.completed { background: color-mix(in srgb, var(--success) 25%, transparent); }
.status.pending { background: color-mix(in srgb, var(--warning) 25%, transparent); }
.status.failed, .status.cancelled { background: color-mix(in srgb, var(--danger) 25%, transparent); }
.hist { display: flex; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.hist img { width: 110px; aspect-ratio: 16/9; object-fit: cover; border-radius: 4px; background: #000; flex: 0 0 auto; }
.hist .grow { flex: 1; min-width: 0; }
.hist .grow b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-bar { height: 3px; background: var(--bg-hover); margin-top: 6px; max-width: 220px; }
.mini-bar span { display: block; height: 100%; background: var(--primary); }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.plan { position: relative; background: var(--bg-card); border: 2px solid var(--border); border-radius: 10px; padding: 26px 22px; display: flex; flex-direction: column; gap: 10px; }
.plan.popular { border-color: var(--primary); }
.plan .pop { position: absolute; inset-block-start: -13px; inset-inline-start: 50%; transform: translateX(-50%); background: var(--primary); color: var(--on-primary); font-size: 12px; font-weight: 800; padding: 3px 12px; border-radius: 999px; white-space: nowrap; }
[dir="rtl"] .plan .pop { transform: translateX(50%); }
.plan h3 { margin: 0; font-size: 20px; }
.plan .price { font-size: 34px; font-weight: 900; }
.plan .price small { font-size: 14px; color: var(--text-dim); font-weight: 600; }
.plan ul { list-style: none; padding: 0; margin: 4px 0 10px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.plan li { display: flex; gap: 8px; font-size: 14px; }
.plan li::before { content: "✓"; color: var(--success); font-weight: 900; }
.perk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 24px 0 34px; }
.perk { background: var(--bg-card); border-radius: 8px; padding: 18px; }
.perk b { display: block; margin: 6px 0 4px; }
.perk .ico { font-size: 26px; }
.premium-hero { text-align: center; padding: 30px 16px 10px; }
.premium-hero h1 { font-size: clamp(30px, 4vw, 52px); margin: 0 0 10px; font-weight: 900; }
.premium-hero p { color: var(--text-dim); font-size: 18px; margin: 0 auto; max-width: 640px; }
.kv { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 10px 16px; font-size: 15px; }
.kv .k { color: var(--text-dim); }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--bg); border: 1px dashed var(--border); padding: 3px 8px; border-radius: 4px; font-weight: 700; overflow-wrap: anywhere; }

/* gate */
.gate { position: relative; min-height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; color: #fff; padding: 90px 20px 40px; }
.gate .bb-media img { filter: blur(3px) brightness(.45); transform: scale(1.05); }
.gate-box { position: relative; z-index: 2; max-width: 560px; }
.gate-box h1 { font-size: clamp(26px, 3.6vw, 42px); margin: 10px 0; }
.gate-box p { color: #ddd; font-size: 17px; }
.lock { width: 64px; height: 64px; border-radius: 50%; background: var(--warning); color: #1b1300; display: inline-flex; align-items: center; justify-content: center; font-size: 30px; }

/* ---------------- Ad zone ---------------- */
.ad-zone { margin: 10px var(--gutter) 30px; text-align: center; }
.ad-zone .ad-label { font-size: 10px; letter-spacing: 1px; color: var(--text-dim); text-transform: uppercase; margin-bottom: 5px; }
.ad-box { display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ad-box img { max-height: 250px; width: auto; margin: 0 auto; }
.title-grid .grid-ad { grid-column: 1 / -1; margin: 0; }
.custom-html-zone { margin: 12px var(--gutter); }

/* ---------------- Footer ---------------- */
.cs-footer { margin-top: 40px; padding: 40px var(--gutter) 30px; color: var(--text-dim); font-size: 13px; }
.cs-footer .ft-inner { max-width: 1000px; margin: 0 auto; }
.ft-social { display: flex; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.ft-social a { color: var(--text); font-weight: 700; font-size: 14px; }
.ft-links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 20px; margin-bottom: 22px; }
.ft-links a:hover { text-decoration: underline; }
.ft-bottom { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
.ft-lang { border: 1px solid var(--text-dim); color: var(--text); background: transparent; padding: 7px 10px; border-radius: 4px; font-size: 13px; }
.ft-lang option { background: var(--bg-elev); color: var(--text); }

/* ---------------- Toast / overlays ---------------- */
.toast-wrap { position: fixed; inset-block-end: 24px; inset-inline-start: 50%; transform: translateX(-50%); z-index: 400; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #fff; color: #111; border-radius: 4px; padding: 11px 18px; box-shadow: var(--shadow); font-weight: 700; font-size: 14px; animation: slidein .25s ease; transition: opacity .3s; max-width: 90vw; }
.toast.error { background: var(--danger); color: #fff; }
@keyframes slidein { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.age-gate { position: fixed; inset: 0; z-index: 500; background: rgba(0,0,0,.94); display: flex; align-items: center; justify-content: center; padding: 20px; color: #fff; }
.age-gate .box { max-width: 460px; text-align: center; }
.age-gate h2 { font-size: 28px; margin: 14px 0 8px; }
.age-gate p { color: #bbb; }
.age-gate .btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }
.age-gate .big18 { display: inline-flex; width: 74px; height: 74px; border-radius: 50%; border: 3px solid var(--primary); align-items: center; justify-content: center; font-size: 28px; font-weight: 900; }
.cookie-bar { position: fixed; inset-inline: 12px; inset-block-end: 12px; z-index: 450; max-width: 760px; margin: 0 auto; background: var(--bg-elev); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); padding: 14px 16px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.cookie-bar p { margin: 0; flex: 1 1 260px; color: var(--text-dim); }
.cookie-bar a { color: var(--text); text-decoration: underline; }
[hidden] { display: none !important; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1400px) {
  .row-scroller > * { flex-basis: calc((100% - 4 * .4vw) / 5); }
  .row-top10 .row-scroller > * { flex-basis: calc((100% - 3 * .4vw) / 4); }
  .title-grid, .row-wrap .row-scroller { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .row-scroller > * { flex-basis: calc((100% - 3 * .6vw) / 4); }
  .row-scroller { gap: .6vw; }
  .row-top10 .row-scroller > * { flex-basis: calc((100% - 2 * .6vw) / 3); }
  .title-grid, .row-wrap .row-scroller { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .similar-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bb-info { width: 55%; }
}
@media (max-width: 960px) {
  :root { --header-h: 58px; }
  .cs-nav { display: none; position: fixed; inset-block-start: var(--header-h); inset-inline: 0; flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(10,10,10,.97); border-top: 2px solid #e5e5e5; padding: 6px 0; max-height: calc(100vh - var(--header-h)); overflow: auto; z-index: 99; }
  .cs-nav.open { display: flex; }
  .cs-nav a { padding: 14px var(--gutter); font-size: 15px; color: #ccc; opacity: 1; text-align: center; }
  .cs-nav a.active { color: #fff; }
  .menu-toggle { display: inline-flex; }
  .brand { font-size: 22px; }
  .brand .brand-logo { height: 28px; max-width: 130px; }
  .title-hero .th-body { grid-template-columns: 1fr; gap: 10px; }
  .acc-grid { grid-template-columns: 1fr; }
  .acc-nav { position: static; flex-direction: row; overflow-x: auto; }
  .acc-nav a { white-space: nowrap; }
}
@media (max-width: 760px) {
  :root { --gutter: 16px; }
  .cs-header { gap: 10px; }
  .cs-tools { gap: 6px; }
  .cs-search.open { position: absolute; inset-inline: 10px; inset-block-start: 9px; z-index: 5; }
  .cs-search.open form { width: 100%; }
  .cs-search.open input { width: 100%; flex: 1; }
  .suggest { width: 100%; max-width: none; }
  .billboard { height: 76vh; min-height: 440px; margin-bottom: -40px; }
  .bb-info { width: auto; inset-inline-end: var(--gutter); inset-block-end: 90px; text-align: center; }
  .bb-shade { background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,0) 35%, rgba(0,0,0,.65) 70%, var(--bg) 100%) !important; }
  [data-mode="light"] .title-hero .bb-shade { background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,0) 35%, rgba(0,0,0,.72) 70%, rgba(0,0,0,.9) 100%) !important; }
  .bb-meta, .bb-actions, .bb-kicker { justify-content: center; }
  .bb-desc { -webkit-line-clamp: 2; }
  .bb-side { display: none; }
  .bb-dots { inset-inline-start: 50%; transform: translateX(-50%); inset-block-end: 62px; }
  [dir="rtl"] .bb-dots { transform: translateX(50%); }
  .btn { padding: 8px 16px; font-size: 15px; }
  .row-scroller { gap: 6px; }
  .row-scroller > * { flex-basis: 40%; }
  .row-top10 .row-scroller > * { flex-basis: 58%; }
  .row-head a.more { opacity: 1; transform: none; }
  .title-grid, .row-wrap .row-scroller { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 6px; }
  .similar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ep { grid-template-columns: 120px minmax(0, 1fr); gap: 12px; padding: 14px 6px; }
  .ep .ep-no { display: none; }
  .ep .ep-thumb .play-ico { opacity: 1; background: transparent; }
  .ep .ep-thumb .play-ico span { width: 32px; height: 32px; }
  .title-hero { min-height: 70vh; }
  .th-desc { font-size: 15px; }
  .ft-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-box { padding: 30px 20px; margin-top: 0; background: rgba(0,0,0,.82); }
  .about-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv .k { margin-top: 8px; }
  .hist img { width: 84px; }
}
@media (max-width: 480px) {
  .brand-name { display: none; }
  .brand .brand-logo ~ .brand-name { display: none; }
  .brand:not(:has(img)) .brand-name { display: inline; font-size: 20px; }
  .title-grid, .row-wrap .row-scroller { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row-scroller > * { flex-basis: 44%; }
  .similar-grid { grid-template-columns: 1fr 1fr; }
  .sim p { -webkit-line-clamp: 3; }
  .dd-toggle .lang-code { display: none; }
  .th-actions .btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* ---- Page links (‹ 1 2 3 ›) ---- */
.pager{display:flex;flex-wrap:wrap;gap:6px;align-items:center;}
.pager .pg{min-width:34px;height:34px;padding:0 10px;display:inline-flex;align-items:center;justify-content:center;border-radius:8px;
  border:1px solid var(--border);background:var(--bg-card);color:var(--text);font-size:14px;font-weight:600;text-decoration:none;line-height:1;}
.pager a.pg:hover{border-color:var(--primary);color:var(--primary);}
.pager .pg.on{background:var(--primary);border-color:var(--primary);color:var(--on-primary,#fff);}
.pager .pg.off{opacity:.4;}
.pager .pg.gap{border-color:transparent;background:none;}
.pager .pg-info{margin-inline-start:6px;color:var(--text-dim);font-size:13px;}
