/* bsubflix: dark cinema theme. Layout: sticky header, wide poster grids, one accent for actions. */

/* Theme tokens. Light is the default (set on <html> before first paint); dark is applied with <html data-theme="dark"> */
:root {
  --bg: #0A0D14;
  --bg-glow-1: rgba(255, 107, 44, .10);
  --bg-glow-2: rgba(0, 128, 0, .12);
  --surface: #121722;
  --surface-2: #1A2130;
  --line: #242C3D;
  --fg: #EEF1F7;
  --fg-soft: #C7CEDC;
  --muted: #98A2B5;
  --accent: #FF6B2C;
  --accent-2: #FF9A3C;
  --accent-fg: #1B0A02;
  --teal: #008000;
  --gold: #F5C451;
  --ok: #3DDC97;
  --warn: #F5B84B;
  --bad: #FF6B6B;
  --header-bg: rgba(10, 13, 20, .86);
  --shadow: 0 14px 40px rgba(0, 0, 0, .5);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, .6);
  --overlay: rgba(5, 7, 12, .72);
  --badge-bg: rgba(8, 10, 16, .86);
  --placeholder: #6A7489;
  --pricebar-bg: linear-gradient(90deg, #14291a, #2b1f18);
  --info-bg: #12304A; --success-bg: #11382A; --warning-bg: #4A3410;
  --ok-bg: #0f2a21; --ok-line: #1d5a43; --ok-fg: #bff3da;
  --err-bg: #331818; --err-line: #6b2b2b; --err-fg: #ffd0d0;
  --warn-bg: #33280f; --warn-line: #6b5420; --warn-fg: #ffe3a6;
  --tag-bg: #0F2F14; --tag-line: #1E6B22;
  --sel-bg: #2a1a10; --sel-fg: #ffd9c7;
  --newmsg-bg: #17150e;
  --dl-1: #008000; --dl-2: #008000; --dl-fg: #FFFFFF; --dl-glow: rgba(0, 128, 0, .6);
  --dl-ico-bg: rgba(255, 255, 255, .2); --dl-sep: rgba(255, 255, 255, .4);
  --radius: 12px;
  --font-display: "Outfit", "Segoe UI", system-ui, sans-serif;
  --font-body: "DM Sans", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #F6F4EF;
  --bg-glow-1: rgba(255, 107, 44, .10);
  --bg-glow-2: rgba(0, 128, 0, .08);
  --surface: #FFFFFF;
  --surface-2: #F0EDE6;
  --line: #E1DCD1;
  --fg: #171A23;
  --fg-soft: #3D4456;
  --muted: #667085;
  --accent: #E8510F;
  --accent-2: #FF7A2E;
  --accent-fg: #FFFFFF;
  --teal: #008000;
  --gold: #B97A05;
  --ok: #0E8F5C;
  --warn: #B26A00;
  --bad: #D93636;
  --header-bg: rgba(255, 255, 255, .82);
  --shadow: 0 14px 40px rgba(40, 30, 10, .14);
  --shadow-lg: 0 30px 80px rgba(40, 30, 10, .25);
  --overlay: rgba(30, 24, 12, .45);
  --badge-bg: rgba(255, 255, 255, .92);
  --placeholder: #9AA1B2;
  --pricebar-bg: linear-gradient(90deg, #E3F4E3, #FDEBDD);
  --info-bg: #DCEBFB; --success-bg: #D8F3E6; --warning-bg: #FCEBC8;
  --ok-bg: #DDF5EA; --ok-line: #9ADBBD; --ok-fg: #0B5A3B;
  --err-bg: #FDE4E4; --err-line: #F0A8A8; --err-fg: #8A1F1F;
  --warn-bg: #FFF1D2; --warn-line: #EBC77A; --warn-fg: #7A4A00;
  --tag-bg: #DDF2DD; --tag-line: #8CCB8C;
  --sel-bg: #FFE9DC; --sel-fg: #8A3208;
  --newmsg-bg: #FFF6DE;
  --dl-1: #008000; --dl-2: #008000; --dl-fg: #FFFFFF; --dl-glow: rgba(0, 128, 0, .5);
  --dl-ico-bg: rgba(255, 255, 255, .2); --dl-sep: rgba(255, 255, 255, .4);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--fg);
  background: radial-gradient(900px 480px at 12% -8%, var(--bg-glow-1), transparent 60%), radial-gradient(800px 460px at 92% -4%, var(--bg-glow-2), transparent 60%), var(--bg);
  background-attachment: fixed;
  font-family: var(--font-body); font-size: 16px; line-height: 1.55;
  min-height: 100vh; display: flex; flex-direction: column;
  transition: background-color .25s, color .25s;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0; text-wrap: balance; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 6px; }
.wrap { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px)); }
main { flex: 1; padding-block: 24px 56px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }

/* site message and price strip */
.banner { padding: 10px 0; font-size: 15px; text-align: center; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.banner.info { background: var(--info-bg); }
.banner.success { background: var(--success-bg); }
.banner.warning { background: var(--warning-bg); }
.banner a { text-decoration: underline; text-underline-offset: 3px; margin-left: 8px; font-weight: 700; }
.pricebar { background: var(--pricebar-bg); border-bottom: 1px solid var(--line); padding: 9px 0; font-size: 15px; }
.pricebar .wrap { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: center; text-align: center; }
.pricebar b { color: var(--gold); }

/* header */
.header { position: sticky; top: 0; z-index: 30; background: var(--header-bg); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.header .wrap { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 24px; letter-spacing: .2px; }
.brand img { width: 36px; height: 36px; }
.nav-space { flex: 1; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); object-fit: cover; }
.menu { position: relative; }
.menu > button { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px 4px 4px; color: var(--fg); font: inherit; cursor: pointer; min-height: 42px; }
.menu-list { position: absolute; right: 0; top: 50px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-width: 190px; padding: 6px; display: none; box-shadow: var(--shadow); }
.menu.open .menu-list { display: block; }
.menu-list a, .menu-list button { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 8px; background: none; border: 0; color: var(--fg); font: inherit; cursor: pointer; }
.menu-list a:hover, .menu-list button:hover { background: var(--surface-2); }
.menu-name { display: none; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 640px) { .menu-name { display: inline; } }
.inapp { display: none; margin: 12px 0 0; padding: 12px 14px; border-radius: var(--radius); background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-fg); font-size: 14px; }
.inapp.show { display: block; }

/* buttons and form controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 700; cursor: pointer; background: var(--accent); color: var(--accent-fg); transition: filter .15s, transform .05s; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.teal { background: var(--teal); color: #fff; }
.btn.small { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--err-line); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.locked { background: var(--surface-2); color: var(--muted); border-color: var(--line); }
input, select, textarea { font: inherit; color: var(--fg); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px; width: 100%; }
textarea { min-height: 110px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--placeholder); }
label { display: block; font-weight: 500; font-size: 14px; margin-bottom: 6px; color: var(--muted); }
.field { margin-bottom: 18px; min-width: 0; }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }

/* search */
.search { position: relative; max-width: 720px; margin: 0 auto 28px; }
.search input { height: 52px; padding-left: 48px; border-radius: 999px; font-size: 17px; background: var(--surface); }
.search svg { position: absolute; left: 17px; top: 15px; width: 22px; height: 22px; color: var(--muted); pointer-events: none; }
.suggest { position: absolute; left: 0; right: 0; top: 60px; z-index: 20; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: none; box-shadow: var(--shadow); }
.suggest.open { display: block; }
.suggest a { display: flex; gap: 12px; align-items: center; padding: 8px 12px; }
.suggest a:hover, .suggest a.active { background: var(--surface-2); }
.suggest img { width: 42px; height: 63px; object-fit: cover; border-radius: 6px; background: var(--surface-2); flex: none; }
.suggest .t { font-weight: 700; }
.suggest .m { font-size: 13px; color: var(--muted); }
.suggest .none { padding: 16px; color: var(--muted); }

/* hero, sections, grids */
.hero { text-align: center; padding: 10px 0 26px; }
.hero h1 { font-size: clamp(30px, 6vw, 52px); }
.hero p { color: var(--muted); max-width: 620px; margin: 12px auto 20px; font-size: 18px; }
.section { margin-top: 40px; }
.section > h2 { font-size: 26px; margin-bottom: 16px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 820px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px 16px; } }
@media (min-width: 1060px) { .grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.card { display: block; min-width: 0; }
.card .poster { position: relative; aspect-ratio: 2 / 3; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); transition: transform .18s, border-color .18s; }
.card:hover .poster { transform: translateY(-4px); border-color: var(--teal); }
.card img { width: 100%; height: 100%; object-fit: cover; }
.kind { position: absolute; right: 8px; top: 8px; font-size: 11px; font-weight: 800; letter-spacing: .02em; padding: 3px 8px; border-radius: 999px; color: var(--fg); background: var(--badge-bg); border: 1px solid var(--line); }
.kind.k-tv { background: #1d6fd6; border-color: #1d6fd6; color: #fff; }
.kind.k-web { background: #7b3fe4; border-color: #7b3fe4; color: #fff; }
.kind.k-movie { background: var(--badge-bg); }
.kind-chip { font-weight: 700; color: var(--teal); }
.rating { position: absolute; left: 8px; top: 8px; background: var(--badge-bg); color: var(--gold); font-weight: 700; font-size: 13px; padding: 3px 8px; border-radius: 999px; display: flex; gap: 4px; align-items: center; }
.card .name { margin-top: 10px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 14px; transition: border-color .15s, background .15s; min-width: 0; }
.tile:hover { border-color: var(--teal); background: var(--surface-2); }
.tile .n { font-family: var(--font-display); font-weight: 600; font-size: 20px; overflow-wrap: anywhere; }
.tile .c { color: var(--muted); font-size: 13px; }

.crumbs { display: flex; flex-wrap: wrap; gap: 6px 10px; color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.crumbs a:hover { color: var(--fg); text-decoration: underline; }
.crumbs span.sep { opacity: .5; }
.page-title { font-size: clamp(26px, 4.5vw, 38px); margin-bottom: 22px; }
.empty { padding: 48px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }

/* movie page */
.movie { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 820px) { .movie { grid-template-columns: 300px minmax(0, 1fr); gap: 40px; } }
.movie .poster-lg { aspect-ratio: 2 / 3; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); max-width: 300px; width: 100%; }
.movie .poster-lg img { width: 100%; height: 100%; object-fit: cover; }
.movie h1 { font-size: clamp(30px, 5vw, 46px); }
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 18px; }
.chip { padding: 5px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 18px; }
.tabs .chip { padding: 8px 16px; font-weight: 600; transition: border-color .15s, background .15s; }
.tabs .chip:hover { border-color: var(--teal); }
.tabs .chip.on { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.chip.imdb { color: var(--gold); font-weight: 700; border-color: var(--warn-line); }
.desc { color: var(--fg-soft); max-width: 70ch; font-size: 17px; line-height: 1.7; white-space: pre-line; }
.dl { margin-top: 28px; display: grid; gap: 22px; }
.dl h2 { font-size: 20px; margin-bottom: 10px; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; }
.star { display: flex; align-items: center; gap: 12px; margin-top: 26px; }
.star button { width: 52px; height: 52px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.star button svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.star button[aria-pressed="true"] { color: var(--gold); border-color: var(--warn-line); }
.star button[aria-pressed="true"] svg { fill: currentColor; }
.note { padding: 12px 14px; border-radius: 10px; font-size: 15px; margin-bottom: 18px; }
.note.ok { background: var(--ok-bg); border: 1px solid var(--ok-line); color: var(--ok-fg); }
.note.error { background: var(--err-bg); border: 1px solid var(--err-line); color: var(--err-fg); }
.note.warn { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-fg); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + env(safe-area-inset-bottom, 0px)); background: var(--surface-2); border: 1px solid var(--line); padding: 12px 18px; border-radius: 12px; z-index: 60; max-width: calc(100% - 32px); display: none; }
.toast.show { display: block; }

/* subscribe, account */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px; min-width: 0; }
.narrow { max-width: 720px; margin-inline: auto; }
.price { font-family: var(--font-display); font-size: clamp(44px, 9vw, 64px); font-weight: 700; color: var(--gold); line-height: 1; }
.price small { font-size: 18px; color: var(--muted); font-weight: 500; margin-left: 8px; }
.methods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 18px 0; }
@media (min-width: 560px) { .methods { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.method input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.method span { display: flex; align-items: center; justify-content: center; min-height: 52px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); font-weight: 700; cursor: pointer; text-align: center; padding: 8px; }
.method input:checked + span { border-color: var(--accent); background: var(--sel-bg); color: var(--sel-fg); }
.method input:focus-visible + span { outline: 3px solid var(--teal); outline-offset: 2px; }
.paybox { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 18px; display: none; }
.paybox.show { display: block; }
.paybox .num { font-family: var(--font-display); font-size: 26px; font-weight: 600; white-space: pre-line; overflow-wrap: anywhere; }
.steps { margin: 0 0 20px; padding-left: 20px; color: var(--fg-soft); }
.steps li { margin-bottom: 6px; }
.status { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: 14px; }
.status.pending { background: var(--warn-bg); color: var(--warn); }
.status.ok { background: var(--ok-bg); color: var(--ok); }
.contact { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; align-items: center; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 18px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* footer */
.footer { border-top: 1px solid var(--line); padding: 28px 0 calc(28px + env(safe-area-inset-bottom, 0px)); color: var(--muted); font-size: 14px; }
.footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; }
.footer a:hover { color: var(--fg); text-decoration: underline; }
.footer .links { display: flex; flex-wrap: wrap; gap: 8px 18px; }

/* admin */
.admin-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 24px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.admin-nav a { padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; font-weight: 500; }
.admin-nav a.on { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.stat b { display: block; font-family: var(--font-display); font-size: 34px; }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; white-space: nowrap; background: var(--surface); }
tr:last-child td { border-bottom: 0; }
td form { display: inline; }
.row { display: grid; gap: 0 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 700px) { .row.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } .row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.sect { margin-top: 30px; }
.sect > h2 { font-size: 22px; margin-bottom: 12px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: var(--surface-2); border: 1px solid var(--line); }
.badge.ok { color: var(--ok); } .badge.warn { color: var(--warn); } .badge.bad { color: var(--bad); }
.pick-list { display: grid; gap: 8px; }
.pick { display: grid; grid-template-columns: auto minmax(0, 1fr) 110px; gap: 12px; align-items: center; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.pick input[type=checkbox] { width: 20px; height: 20px; min-height: 0; }
.pick .nm { overflow-wrap: anywhere; font-weight: 500; }
.pick .sm { font-size: 13px; color: var(--muted); }
.pick input[type=text] { min-height: 36px; padding: 6px 10px; }

/* combo box */
.combo { position: relative; }
.combo .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.combo .tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px; border-radius: 999px; background: var(--tag-bg); border: 1px solid var(--tag-line); font-size: 14px; }
.combo .tag button { background: none; border: 0; color: inherit; font-size: 18px; line-height: 1; cursor: pointer; padding: 0 6px; }
.combo .list { position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; z-index: 25; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; max-height: 240px; overflow-y: auto; display: none; box-shadow: var(--shadow); }
.combo.open .list { display: block; }
.combo .opt { padding: 10px 14px; cursor: pointer; }
.combo .opt.active, .combo .opt:hover { background: var(--surface-2); }
.combo .opt.add { color: var(--teal); font-weight: 700; }
.combo .opt.empty { color: var(--muted); cursor: default; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* additions */
.method { color: var(--fg); margin: 0; font-size: 16px; position: relative; }
.btn small { font-weight: 500; opacity: .75; }
[data-gbtn] { min-height: 44px; display: flex; align-items: center; }
.crumbs span:last-child { color: var(--fg); }
.search input[type=search]::-webkit-search-cancel-button { filter: invert(.7); }
:root[data-theme="light"] .search input[type=search]::-webkit-search-cancel-button { filter: none; }

.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px; border-radius: 999px; background: var(--tag-bg); border: 1px solid var(--tag-line); font-size: 14px; overflow-wrap: anywhere; }
.tag button { background: none; border: 0; color: inherit; font-size: 18px; line-height: 1; cursor: pointer; padding: 0 6px; }
.tagrow { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 16px; }
.tbl-wrap + .tbl-wrap { margin-top: 12px; }
.thumb { width: 38px; height: 57px; object-fit: cover; border-radius: 6px; background: var(--surface-2); }
td .btn.small { white-space: nowrap; }
[hidden] { display: none !important; }

/* ---- payments: logos, invoice, report, popups, inbox ---- */
.method span { gap: 10px; }
.method span { flex-direction: column; gap: 8px; min-height: 92px; }
.method span em { font-style: normal; font-size: 14px; }
.method .plogo { display: flex; align-items: center; justify-content: center; width: 100%; height: 52px; padding: 8px 10px; background: #fff; border-radius: 8px; }
.method .plogo img { height: 100%; width: auto; max-width: 100%; object-fit: contain; display: block; }
.method input:checked + span { box-shadow: 0 0 0 2px var(--accent); }
.invoice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 10px; padding: 10px 14px; border: 1px dashed var(--line); border-radius: 10px; background: var(--surface-2); }
.invoice span { color: var(--muted); font-size: 14px; }
.invoice b { font-family: var(--font-display); font-size: 20px; letter-spacing: .02em; color: var(--gold); }
.warn-text { color: var(--warn); }
.shot-preview { margin-top: 12px; max-height: 340px; width: auto; max-width: 100%; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }

.icon-btn { position: relative; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: var(--fg); border: 1px solid var(--line); background: var(--surface); flex: none; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn .dot { position: absolute; top: 7px; right: 8px; width: 11px; height: 11px; border-radius: 50%; background: #FF3B4E; border: 2px solid var(--surface); }

dialog.modal { margin: auto; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--fg); padding: 28px 26px 24px; width: min(92vw, 420px); text-align: center; box-shadow: var(--shadow-lg); }
dialog.modal::backdrop { background: var(--overlay); backdrop-filter: blur(3px); }
dialog.modal h2 { font-size: 26px; margin: 10px 0 8px; }
dialog.modal p { color: var(--fg-soft); margin: 0 0 22px; }
dialog.modal .modal-ico { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto; font-size: 30px; font-weight: 700; }
dialog.modal.ok .modal-ico { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok-line); }
dialog.modal.bad .modal-ico { background: var(--err-bg); color: var(--bad); border: 1px solid var(--err-line); }
dialog.modal .btn { min-width: 120px; }
dialog.modal.msg .modal-ico { background: var(--err-bg); color: #FF3B4E; border: 1px solid var(--err-line); }
dialog.modal .msg-text { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 40vh; overflow-y: auto; text-align: left; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
dialog.modal .btns { justify-content: center; }
dialog.modal form { text-align: left; }
dialog.modal textarea { margin-bottom: 14px; }

body.terminated { overflow: hidden; }
body.terminated > :not(.term-overlay):not(script):not(dialog) { filter: blur(9px); pointer-events: none; user-select: none; }
.term-overlay { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; background: var(--overlay); overflow-y: auto; }
.term-card { background: var(--surface); border: 1px solid var(--err-line); border-radius: 18px; padding: 28px 26px; width: min(94vw, 480px); text-align: center; box-shadow: var(--shadow-lg); }
.term-card h2 { font-size: 26px; color: var(--bad); margin-bottom: 10px; }
.term-card p { color: var(--fg-soft); margin: 0; }
.term-card .contact { justify-content: center; }

.msgs { display: grid; gap: 12px; }
.msg { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.msg.new { border-color: var(--warn-line); background: var(--newmsg-bg); }
.msg-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.msg-head time { margin-left: auto; font-size: 13px; }
.msg p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }

/* ---- admin payments dashboard ---- */
.dash-tabs a .count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: #FF3B4E; color: #fff; font-size: 12px; font-weight: 700; text-align: center; }
.slider { display: grid; grid-auto-flow: column; grid-auto-columns: min(92%, 640px); gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.slide { scroll-snap-align: start; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; min-width: 0; }
.slide h2 { font-size: 22px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.slide h2 .total { font-size: 34px; color: var(--gold); }
.slide.bad h2 .total { color: var(--bad); }
.slide.ok h2 .total { color: var(--ok); }
.method-counts { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.method-counts .mc { padding: 4px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; }
.method-counts .mc b { margin-left: 4px; }
.filter { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 6px 0 12px; }
.filter label { margin: 0; }
.filter select { width: auto; min-width: 160px; }
.slide .tbl-wrap { max-height: 420px; overflow: auto; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.row-actions form { display: inline; }
.btn.ok { background: var(--ok); color: #05241a; }
.who { min-width: 160px; }
.who small { display: block; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.search-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.search-row input { flex: 1; min-width: 220px; }
.shot-admin { max-width: 100%; max-height: 70vh; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.split { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.count-dot { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: #FF3B4E; color: #fff; font-size: 12px; font-weight: 700; text-align: center; }

/* sign-up call to action for visitors */
.signup-cta { margin: 32px 0 8px; padding: 22px 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; background: var(--pricebar-bg); border: 1px solid var(--line); border-radius: var(--radius); }
.signup-cta h2 { font-size: 22px; margin: 0 0 4px; }
.signup-cta p { margin: 0; color: var(--muted); max-width: 520px; }
.signup-action { min-height: 44px; display: flex; align-items: center; }
.signup-cta.inline { margin: 18px 0 0; padding: 16px 18px; }
.signup-cta.inline h2 { font-size: 18px; }
.hero .signup-action { justify-content: center; }
.hero .signup-hero { display: flex; justify-content: center; min-height: 44px; margin-top: 6px; }


/* ---- theme switch ---- */
.theme-toggle { position: relative; width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--fg); cursor: pointer; overflow: hidden; transition: background .2s, border-color .2s, transform .2s; }
.theme-toggle:hover { border-color: var(--accent); transform: rotate(12deg); }
.theme-toggle svg { position: absolute; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .45s cubic-bezier(.4, 1.4, .5, 1), opacity .25s; }
.theme-toggle .i-sun { color: var(--gold); transform: rotate(-90deg) scale(.3); opacity: 0; }
.theme-toggle .i-moon { color: var(--teal); }
:root[data-theme="light"] .theme-toggle .i-sun { transform: none; opacity: 1; color: var(--accent); }
:root[data-theme="light"] .theme-toggle .i-moon { transform: rotate(90deg) scale(.3); opacity: 0; }

/* ---- polish: gradient accents, depth, motion ---- */
.brand { flex: none; white-space: nowrap; padding-right: 4px; background: linear-gradient(90deg, var(--fg), var(--accent-2)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.brand img { -webkit-text-fill-color: initial; filter: drop-shadow(0 4px 10px rgba(255, 107, 44, .35)); }
.btn { background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 6px 18px -6px rgba(255, 107, 44, .6); }
.btn:hover { filter: brightness(1.06); box-shadow: 0 10px 24px -6px rgba(255, 107, 44, .7); transform: translateY(-1px); }
.btn.ghost, .btn.locked, .btn.danger { background: transparent; box-shadow: none; }
.btn.locked { background: var(--surface-2); }
.btn.teal { background: var(--teal); box-shadow: none; }
:root[data-theme="light"] .btn.teal { color: #fff; }
.btn.ok { background: var(--ok); box-shadow: none; }
.tabs .chip.on, .admin-nav a.on { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.hero h1 { background: linear-gradient(100deg, var(--fg) 30%, var(--accent) 75%, var(--accent-2)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; letter-spacing: -.01em; }
.card .poster { box-shadow: 0 8px 24px -12px rgba(0, 0, 0, .55); }
.card:hover .poster { transform: translateY(-6px) scale(1.015); border-color: var(--accent); box-shadow: 0 18px 36px -14px rgba(255, 107, 44, .45); }
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.tile { transition: border-color .15s, background .15s, transform .18s, box-shadow .18s; }
.panel, .stat, .slide, .msg { box-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px -18px rgba(0, 0, 0, .45); }
:root[data-theme="light"] .panel, :root[data-theme="light"] .stat, :root[data-theme="light"] .slide, :root[data-theme="light"] .msg { box-shadow: 0 6px 24px -14px rgba(60, 45, 20, .22); }
.search input:focus, input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 107, 44, .22); }
.section > h2 { position: relative; padding-left: 14px; }
.section > h2::before { content: ""; position: absolute; left: 0; top: 14%; bottom: 14%; width: 4px; border-radius: 4px; background: linear-gradient(var(--accent), var(--accent-2)); }
dialog.modal[open] { animation: pop .28s cubic-bezier(.2, 1.2, .4, 1); }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.94); } to { opacity: 1; transform: none; } }
dialog.modal.ok.congrats { border-color: var(--ok-line); }
dialog.modal.ok.congrats .modal-ico { width: 72px; height: 72px; font-size: 36px; box-shadow: 0 0 0 8px rgba(61, 220, 151, .12); }
dialog.modal.ok.congrats h2 { color: var(--ok); }
.theme-toggle, .icon-btn, .menu > button, .menu-list, .panel, .tile, .chip, input, select, textarea { transition-property: background-color, border-color, color, transform, box-shadow; transition-duration: .2s; }
body, .header { transition: background-color .25s, color .25s, border-color .25s; }
::selection { background: var(--accent); color: #fff; }

/* small phones: keep the full logo text visible and the profile button round */
.menu { flex: none; }
.avatar { flex: none; }
@media (max-width: 420px) {
  .header .wrap { gap: 6px; }
  .brand { font-size: 19px; gap: 6px; padding-right: 0; }
  .brand img { width: 30px; height: 30px; }
  .theme-toggle, .icon-btn { width: 38px; height: 38px; }
  .menu > button { padding: 3px; min-height: 40px; }
  .avatar { width: 32px; height: 32px; }
}
@media (max-width: 350px) {
  .brand { font-size: 16.5px; gap: 5px; }
  .brand img { width: 26px; height: 26px; }
  .theme-toggle, .icon-btn { width: 34px; height: 34px; }
  .header .wrap { gap: 4px; }
}

/* ---- seasons and episodes (Series page) ---- */
.seasons { margin-top: 28px; }
.seasons > h2 { font-size: 22px; margin-bottom: 12px; }
.season-tabs { margin: 0 0 14px; }
.season-tabs .chip { font: inherit; font-weight: 600; color: var(--fg); cursor: pointer; }
.season-tabs .chip.on { color: var(--accent-fg); }
.season-h { font-size: 18px; margin: 0 0 10px; }
.ep-list { display: grid; gap: 8px; }
.ep { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.ep.open { border-color: var(--teal); box-shadow: var(--shadow); }
.ep-head { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 16px; background: none; border: 0; color: var(--fg); font: inherit; text-align: left; cursor: pointer; }
.ep-head:hover { background: var(--surface-2); }
.ep-no { font-family: var(--font-display); font-weight: 600; font-size: 18px; white-space: nowrap; }
.ep-meta { margin-left: auto; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.ep-q { padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); }
.ep-tag { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px 5px 7px; border-radius: 6px; font-size: 12px; font-weight: 700; background: #FFC41F; color: #1a1300; }
.ep-tag svg { flex: none; }
.ep-chev { flex: none; width: 18px; height: 18px; color: var(--muted); transition: transform .2s, color .2s; }
.ep.open .ep-chev { transform: rotate(180deg); color: var(--teal); }
.ep-body { padding: 16px; border-top: 1px solid var(--line); }
.ep-body .dl { margin-top: 0; }
.ep-body h3 { font-size: 16px; margin-bottom: 10px; }
/* Season tabs switch between seasons; episodes open one at a time (done in user.js). */
.season-pick { display: flex; align-items: center; gap: 12px; margin: 20px 0 6px; }
.season-lbl { color: var(--muted); font-size: 14px; flex: none; }
.season-nums { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.season-nums::-webkit-scrollbar { display: none; }
.snum { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); color: var(--fg); font: inherit; font-weight: 700; font-size: 17px; cursor: pointer; transition: background .15s, border-color .15s; }
.snum:hover { border-color: var(--red, var(--teal)); }
.snum.on { background: var(--red, var(--accent)); border-color: var(--red, var(--accent)); color: #fff; }
.season-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 16px 0 10px; }
.season-head .season-h { margin: 0; font-size: 20px; }
.ep-badge { flex: none; width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: var(--tag-bg); color: var(--red, var(--teal)); font-weight: 700; font-size: 13px; }
@media (max-width: 420px) { .ep-q { display: none; } .ep-head { padding: 10px 14px; } }

/* ---- admin: season / episode / quality boxes next to a video file ---- */
.pick { grid-template-columns: auto minmax(0, 1fr) auto; }
.pick-in { display: flex; gap: 6px; }
.pick-in input { min-height: 36px; padding: 6px 10px; }
.pick-in .q { width: 110px; }
.pick-in .n { width: 92px; }
#movieform:not(.is-series) .series-only, #movieform.is-series .movie-only { display: none !important; }
@media (max-width: 700px) { .is-series .pick { grid-template-columns: auto minmax(0, 1fr); } .is-series .pick-in { grid-column: 1 / -1; } }

/* admin: numbers that open the list behind them */
a.stat-link { display: block; color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
a.stat-link:hover, a.stat-link:focus-visible { border-color: var(--gold); transform: translateY(-2px); }
a.stat-link b { text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 6px; }
a.stat-link:hover b { text-decoration-color: currentColor; }
a.count-link { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; padding: 6px 4px; }
a.count-link:hover { color: var(--gold); }


/* ---- download buttons: bright green pill with an icon badge. One file shows only its size. ---- */
.btn.dlbtn { position: relative; overflow: hidden; gap: 12px; min-height: 54px; padding: 6px 24px 6px 6px; border-radius: 999px; font-weight: 800; }
.btn.dlbtn {
  color: var(--dl-fg); border-color: transparent;
  background: linear-gradient(135deg, var(--dl-1), var(--dl-2));
  box-shadow: 0 8px 22px -8px var(--dl-glow), inset 0 1px 0 rgba(255, 255, 255, .28);
}
.btn.dlbtn:hover { filter: brightness(1.05); transform: translateY(-2px); box-shadow: 0 14px 28px -8px var(--dl-glow), inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn.dlbtn:active { transform: translateY(0); }
.btn.dlbtn::after { content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; transform: skewX(-20deg); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .38), transparent); transition: left .55s ease; pointer-events: none; }
.btn.dlbtn:hover::after { left: 130%; }
.btn.dlbtn:focus-visible { outline: 3px solid var(--dl-1); outline-offset: 3px; border-radius: 999px; }
.dl-ico { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--dl-ico-bg); position: relative; }
.dl-ico svg { grid-area: 1 / 1; }
.dl-ico .i-ok { display: none; }
.btn.dlbtn:hover .i-down { animation: dl-bob .7s ease-in-out infinite; }
@keyframes dl-bob { 0%, 100% { transform: translateY(-1px); } 50% { transform: translateY(3px); } }
.dl-txt { display: inline-flex; align-items: baseline; gap: 10px; line-height: 1.1; }
.dl-q { font-family: var(--font-display); font-size: 18px; font-weight: 700; letter-spacing: .01em; }
.dl-size { font-size: 16px; font-weight: 700; }
.dl-q + .dl-size { padding-left: 10px; border-left: 1px solid var(--dl-sep); font-weight: 600; }
.btn.dlbtn:disabled { opacity: .7; filter: saturate(.7); }

/* locked (visitor or not subscribed yet): same green button, with a lock in the badge */
.btn.dlbtn.locked .dl-ico { background: var(--dl-ico-bg); }

/* already downloaded: the button changes colour (soft green, check mark) so you know you used it. Tap again to download again. */
.btn.dlbtn.done:not(.locked) { background: var(--ok-bg); color: var(--ok-fg); border-color: var(--ok-line); box-shadow: none; }
.btn.dlbtn.done:not(.locked)::after { display: none; }
.btn.dlbtn.done .dl-ico { background: #008000; color: #fff; }
.btn.dlbtn.done .i-down { display: none; }
.btn.dlbtn.done .i-ok { display: block; }
.btn.dlbtn.done:not(.locked):hover { background: var(--ok-bg); filter: brightness(1.08); box-shadow: 0 8px 20px -10px var(--dl-glow); }
.btn.dlbtn.done .dl-q + .dl-size { border-left-color: var(--ok-line); }
@media (max-width: 420px) { .btn.dlbtn { padding-right: 20px; } .dl-q { font-size: 17px; } }
@media (prefers-reduced-motion: reduce) { .btn.dlbtn::after { display: none; } .btn.dlbtn:hover .i-down { animation: none !important; } }

/* "Load more" under a long list */
.loadmore { display: flex; justify-content: center; padding: 22px 0 6px; }
