/* ==========================================================================
   DXP Tracker — modern design system
   Dark-first, fully responsive. Class names are shared with the templates.
   ========================================================================== */

/* ---------- design tokens ---------- */
:root, [data-theme="dark"] {
  --bg: #0a0c11;
  --bg2: #0e121a;
  --panel: #11151d;
  --panel2: #171c26;
  --panel3: #1e2430;
  --border: #222a39;
  --border2: #2d3647;
  --fg: #eef1f7;
  --muted: #94a0b5;
  --muted2: #69748a;
  --accent: #ff6a00;
  --accent2: #ff8c3a;
  --brand: #4f8cff;
  --ok: #2fce7d;
  --bad: #ff5a68;
  --warn: #f5b301;
  --radius: 16px;
  --radius-sm: 11px;
  --radius-lg: 22px;
  --shadow: 0 12px 34px rgba(0,0,0,.45);
  --shadow-lg: 0 28px 70px rgba(0,0,0,.55);
  --grad: linear-gradient(135deg, #ff6a00, #ff2d55);
  --ring: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
}
[data-theme="light"] {
  --bg: #f5f7fb;
  --bg2: #eef1f7;
  --panel: #ffffff;
  --panel2: #f2f4f9;
  --panel3: #e9edf5;
  --border: #e3e7f0;
  --border2: #d4dae6;
  --fg: #10131a;
  --muted: #5c6577;
  --muted2: #8a92a3;
  --accent: #cc5200;
  --accent2: #e06700;
  --brand: #2f7bff;
  --ok: #0b7a42;
  --bad: #c62834;
  --warn: #8a6100;
  --shadow: 0 10px 26px rgba(20,30,60,.10);
  --shadow-lg: 0 22px 54px rgba(20,30,60,.16);
  /* deeper gradient on light backgrounds: white button text keeps its contrast */
  --grad: linear-gradient(135deg, #e35d00, #d81a3f);
}

/* ---------- reset / base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  overflow-x: clip;
  background: radial-gradient(1200px 600px at 50% -10%, color-mix(in srgb, var(--panel2) 60%, transparent), transparent), var(--bg);
  color: var(--fg);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
a.text-white:hover, a.text-white:focus-visible { color: #fff; }
img, iframe, video { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; }
.hidden { display: none !important; }
.inline { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--muted); }
.s { color: var(--ok); }
.l { color: var(--bad); }
.bad { color: var(--bad); }
.ok { color: var(--ok); }
.err { color: var(--bad); font-weight: 600; }
.break-all { word-break: break-all; }
.zoomable { cursor: zoom-in; }
.reltype { color: var(--accent); font-weight: 700; }

h1 { font-size: clamp(22px, 3vw, 30px); margin: 4px 0 16px; font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted);
  margin: 30px 0 14px; display: flex; align-items: center; gap: 10px; font-weight: 800; }
h2::before { content: ""; width: 4px; height: 15px; border-radius: 3px; background: var(--grad); }
h3 { font-size: 17px; }

/* ---------- header: styled with Tailwind (see templates/layout.html) ---------- */

/* ---------- buttons ---------- */
button, .btn {
  font: inherit; font-weight: 650; color: #fff; cursor: pointer;
  /* inline-block (not inline): padding must not spill over the text above,
     and vertical margins from space-y-* have to apply to link-buttons. */
  display: inline-block;
  background: var(--grad); border: 0; border-radius: var(--radius-sm); padding: 10px 18px;
  transition: filter .15s, transform .1s, box-shadow .2s;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 22%, transparent);
}
button:hover, .btn:hover { filter: brightness(1.08); color: #fff; box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 30%, transparent); }
button:active { transform: translateY(1px); }
.btn-ghost { background: var(--panel2); color: var(--fg); border: 1px solid var(--border2); box-shadow: none; }
.btn-ghost:hover { color: var(--fg); background: var(--panel3); }
.iconbtn {
  background: var(--panel2); color: var(--fg); border: 1px solid var(--border);
  width: 38px; height: 38px; border-radius: 999px; display: inline-flex;
  align-items: center; justify-content: center; padding: 0; box-shadow: none;
}
.iconbtn:hover { border-color: var(--accent); color: var(--fg); }
.mini { padding: 6px 11px; font-size: 12px; border-radius: 9px; box-shadow: none; }
.mini.danger { background: linear-gradient(180deg, var(--bad), #c62b38); }
.mini.num { width: 70px; color: var(--fg); background: var(--panel2); border: 1px solid var(--border); }
.quickrow { display: flex; gap: 10px; padding: 12px 14px; }
.quickrow .btn { flex: 1; text-align: center; }

/* ---------- layout ---------- */
main { width: min(96%, 1640px); margin: 0 auto; padding: 24px 0 70px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 26px; align-items: start; }
.content { min-width: 0; }
.rightside { position: sticky; top: 78px; display: flex; flex-direction: column; gap: 14px; }

/* ---------- cards ---------- */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(16px, 2.5vw, 24px); box-shadow: var(--shadow); }
.badge { display: inline-block; background: var(--panel2); border: 1px solid var(--border); border-radius: 9px; padding: 3px 9px; font-size: 12px; font-weight: 600; }
.badge.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 55%, transparent); background: color-mix(in srgb, var(--ok) 12%, var(--panel2)); }
.badge.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 55%, transparent); background: color-mix(in srgb, var(--bad) 12%, var(--panel2)); }
.chip { background: var(--panel2); border: 1px solid var(--border); border-radius: 999px; padding: 7px 14px; font-size: 13px; color: var(--fg); transition: border-color .15s, color .15s, background .15s; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { border-color: transparent; color: #fff; background: var(--grad); box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 25%, transparent); }
.chip-sm { background: var(--panel2); border: 1px solid var(--border); border-radius: 9px; padding: 3px 9px; font-size: 12px; }
.chip-sm:hover { border-color: var(--accent); color: var(--accent); }
.cats { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 22px; }
.alert { display: block; padding: 12px 16px; border-radius: var(--radius-sm); margin: 12px 0; border: 1px solid var(--border); background: var(--panel2); }
.alert.bad { color: var(--bad); border-color: var(--bad); }
.alert.ok { color: var(--ok); border-color: var(--ok); }
.empty { grid-column: 1/-1; text-align: center; color: var(--muted); padding: 48px 20px; border: 1px dashed var(--border2); border-radius: var(--radius); }

/* ---------- stats & grids ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 18px 0; }
.stats > div { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 15px 17px; }
.stats span { color: var(--muted); font-size: 12px; }
.stats b { display: block; font-size: clamp(18px, 2vw, 23px); margin-top: 4px; font-weight: 800; letter-spacing: -.01em; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }

/* ---------- torrent/card grids ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 20px; }
.tcard { position: relative; display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden; background: var(--panel); border: 1px solid var(--border); transition: transform .18s ease, border-color .18s, box-shadow .18s; }
.tcard:hover { transform: translateY(-4px); border-color: var(--border2); box-shadow: var(--shadow); }
.tcover { position: relative; aspect-ratio: 2/3; border-radius: 0; overflow: hidden; background: var(--panel2); display: flex; align-items: center; justify-content: center; }
.tcover img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s cubic-bezier(.2,.6,.2,1); }
.tcard:hover .tcover img { transform: scale(1.06); }
.tcover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,.72)); }
.tnoimg { color: var(--muted); font-weight: 800; letter-spacing: .12em; opacity: .5; }
.tpeers { position: absolute; z-index: 2; left: 8px; top: 8px; display: flex; gap: 8px; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); color: #fff; border-radius: 999px; padding: 3px 9px; font-size: 12px; font-weight: 700; }
.tpeers .s { color: #5cf29a; } .tpeers .l { color: #ff8b95; }
.tadult { position: absolute; z-index: 2; right: 8px; top: 8px; background: var(--bad); color: #fff; border-radius: 8px; padding: 2px 7px; font-size: 11px; font-weight: 800; }
.tbody { padding: 11px 12px 14px; }
.ttitle { font-size: 13.5px; font-weight: 650; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.ttitle a { color: inherit; }
.tmeta { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-top: 6px; color: var(--muted); font-size: 12px; align-items: center; }
.tcat { color: var(--accent); font-weight: 600; }
.tsize { margin-left: auto; color: var(--fg); font-weight: 700; }
.ts { color: var(--muted); font-size: 12px; }
.is-adult .tcover img { filter: blur(16px); }
.tcard .tbody form { margin-top: 8px; }
.tcard .tbody .ttitle a { color: inherit; }

/* ---------- hero ---------- */
.hero { position: relative; display: block; border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 24px; min-height: 340px; border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(2px) brightness(.5); transform: scale(1.06); }
[data-theme="light"] .hero-bg { filter: blur(2px) brightness(.8); }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(6,8,12,.96) 25%, rgba(6,8,12,.45) 70%, transparent); }
[data-theme="light"] .hero::after { background: linear-gradient(90deg, rgba(245,247,251,.97) 25%, rgba(245,247,251,.5) 70%, transparent); }
.hero-in { position: relative; z-index: 2; display: flex; align-items: center; gap: 28px; padding: clamp(20px, 3vw, 30px); }
.hero-poster { width: 200px; border-radius: 14px; box-shadow: var(--shadow-lg); flex: none; }
.hero-txt h1 { font-size: clamp(24px, 3.4vw, 42px); margin: 10px 0; max-width: 760px; }
.hero-badge { display: inline-block; background: var(--grad); color: #fff; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; border-radius: 999px; padding: 5px 13px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: 14px; }

/* ---------- popular rail ---------- */
.rail { position: relative; }
.railin { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; scrollbar-width: none; }
.railin::-webkit-scrollbar { display: none; }
.pcard { flex: 0 0 190px; scroll-snap-align: start; }
.pcover { position: relative; aspect-ratio: 2/3; border-radius: var(--radius); overflow: hidden; background: var(--panel2); box-shadow: var(--shadow); }
.pcover img { width: 100%; height: 100%; object-fit: cover; }
.pcover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,.8)); }
.ppeers { position: absolute; z-index: 2; left: 8px; bottom: 8px; display: flex; gap: 8px; background: rgba(0,0,0,.6); border-radius: 999px; padding: 2px 8px; font-size: 12px; }
.ppeers .s { color: #5cf29a; } .ppeers .l { color: #ff8b95; }
.pname { font-size: 13px; font-weight: 600; margin-top: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.railbtn { position: absolute; top: 38%; z-index: 3; width: 42px; height: 42px; border-radius: 999px; background: color-mix(in srgb, var(--bg) 70%, transparent); border: 1px solid var(--border); color: var(--fg); font-size: 20px; line-height: 1; backdrop-filter: blur(6px); }
.railbtn.left { left: 4px; } .railbtn.right { right: 4px; }
.railbtn:hover { background: var(--accent); color: #fff; border-color: transparent; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 12px 15px; border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); background: var(--panel2); font-weight: 700; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.tors th, .tors td { white-space: nowrap; }
.ftable { table-layout: fixed; }
.ftable .ft-name { width: auto; }
.ftable .ft-author { width: 180px; }
.ftable .ft-num { width: 110px; }
.ftable .ft-date { width: 190px; }
.ftable th.num, .ftable td.num { text-align: center; font-variant-numeric: tabular-nums; }
.ftable td { overflow-wrap: anywhere; }
.files { border: 0; border-radius: 0; }
.subs { border: 0; border-radius: 0; }

/* ---------- pagination / pager ---------- */
.pagination { display: flex; gap: 6px; flex-wrap: wrap; margin: 20px 0; }
.pagination .pg { min-width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; background: var(--panel2); border: 1px solid var(--border); border-radius: 11px; padding: 0 12px; font-weight: 600; }
.pagination .pg:hover { border-color: var(--accent); }
.pagination .pg.active { background: var(--grad); color: #fff; border-color: transparent; }
.pagination .pg.gap { border: 0; background: none; color: var(--muted); min-width: 20px; }
.pager { display: flex; gap: 10px; margin-top: 22px; }
.pager a { background: var(--panel2); border: 1px solid var(--border); border-radius: 999px; padding: 8px 18px; }

/* ---------- torrent detail ---------- */
.meta { display: flex; flex-wrap: wrap; gap: 10px 18px; color: var(--muted); margin: 12px 0 20px; align-items: center; }
.meta b { color: var(--fg); }
.poster { float: right; width: 230px; margin: 0 0 16px 22px; border-radius: var(--radius); box-shadow: var(--shadow); }
.text { background: var(--panel2); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; white-space: pre-wrap; overflow-wrap: anywhere; }
.descr { line-height: 1.55; }
.descr br { content: ""; display: block; line-height: .4; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.shots img { width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--border); display: block; transition: transform .25s; }
.shots img:hover { transform: scale(1.02); }
.acc { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); margin: 16px 0; overflow: hidden; }
.acc > summary { cursor: pointer; padding: 15px 18px; font-weight: 700; list-style: none; }
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary::before { content: "▸ "; color: var(--accent); }
.acc[open] > summary::before { content: "▾ "; }
.acc[open] > summary { border-bottom: 1px solid var(--border); }
.acc table { border: 0; border-radius: 0; }
.acc p, .acc table { margin: 0; }
.acc > p { padding: 14px 18px; }
.player { width: 100%; aspect-ratio: 16/9; border: 1px solid var(--border); border-radius: var(--radius); background: #000; display: block; }
.ptabs { display: flex; gap: 8px; margin: 8px 0 14px; }
.ptab { background: var(--panel2); color: var(--fg); border: 1px solid var(--border); box-shadow: none; }
.ptab.active { background: var(--grad); color: #fff; }
.ppane { margin-bottom: 8px; }

/* webtor player */
.webtor-el { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 21/9; min-height: 460px; max-height: 80vh; background: #000; position: relative; overflow: hidden; border-radius: var(--radius); }
.webtor-el::before { content: ""; position: absolute; inset: 0; z-index: 0; background-image: inherit; background-size: cover !important; background-position: center !important; filter: blur(30px) brightness(.35); transform: scale(1.1); }
.webtor-el::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(ellipse at center, transparent 35%, rgba(0,0,0,.55) 100%); }
.webtor-el > div, .webtor-el iframe { position: relative; z-index: 2; height: 100% !important; width: auto !important; aspect-ratio: 16/9; max-width: 100%; border: 0; object-fit: contain; background: transparent; }
.webtor-open { margin: 10px 0 0; }
.webtor-files { padding: 10px 0; }
.webtor-files select { background: var(--panel2); border: 1px solid var(--border); color: var(--fg); border-radius: 9px; padding: 9px 11px; max-width: 100%; }
.webtor-video { width: 100%; }

/* adult gate */
.adultwrap { position: relative; }
.adult-gate { display: none; }
.adultwrap.gate > :not(.adult-gate) { filter: blur(14px); pointer-events: none; }
.adultwrap.gate .adult-gate { display: flex; position: absolute; inset: 0; align-items: center; justify-content: center; z-index: 30; }
html.adult-ok .adultwrap.gate > :not(.adult-gate) { filter: none; pointer-events: auto; }
html.adult-ok .adultwrap.gate .adult-gate { display: none; }
.adult-modal { background: var(--panel); border: 1px solid var(--bad); border-radius: var(--radius-lg); padding: 28px; max-width: 420px; text-align: center; box-shadow: var(--shadow-lg); }
.adult-18 { font-size: 48px; font-weight: 900; color: var(--bad); line-height: 1; }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 94vw; max-height: 92vh; border-radius: 12px; }
.lbclose { position: fixed; top: 16px; right: 20px; width: 44px; height: 44px; border-radius: 999px; font-size: 18px; background: rgba(255,255,255,.15); }

/* ---------- comments ---------- */
.comments { display: flex; flex-direction: column; gap: 14px; }
.thanks { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 22px; }
.thanks a { text-decoration: none; }
.comment { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: grid; grid-template-columns: 60px 1fr; gap: 14px; }
.comment.closed { opacity: .6; border-style: dashed; }
.cavatar { width: 60px; height: 60px; border-radius: 15px; overflow: hidden; border: 1px solid var(--border); background: var(--panel2); display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 800; color: var(--accent); position: relative; }
.cavatar img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 640px) { .comment { grid-template-columns: 44px 1fr; gap: 10px; } .cavatar { width: 44px; height: 44px; border-radius: 12px; font-size: 15px; } }
.cvote-inline { display: inline-flex; align-items: center; gap: 0; padding: 1px; border: 1px solid var(--border); border-radius: 999px; background: var(--panel2); }
.cvote-inline form { display: contents; margin: 0; }
.cvote-inline .vbtn { width: 30px; height: 26px; border: 0; background: transparent; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; }
.cvote-inline .vbtn .ri { width: 14px; height: 14px; }
.cvote-inline .vbtn:hover { background: var(--panel3); }
.cvote-inline .vscore { min-width: 22px; padding: 0 4px; text-align: center; font-size: 12px; line-height: 1; }
.vbtn { background: var(--panel2); color: var(--muted); border: 1px solid var(--border); width: 38px; height: 30px; border-radius: 9px; font-weight: 800; box-shadow: none; }
.vbtn.on { color: var(--ok); border-color: var(--ok); }
.vbtn.on.down { color: var(--bad); border-color: var(--bad); }
.vscore { font-weight: 800; font-variant-numeric: tabular-nums; }
.cmeta { margin-bottom: 6px; display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.cactions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.cedit > summary { cursor: pointer; }
.bb-toolbar { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0; }
.bb-toolbar button { min-width: 30px; height: 28px; padding: 0 7px; border-radius: 7px; border: 1px solid var(--border); background: var(--panel2); color: var(--fg); font-size: 12px; font-weight: 700; cursor: pointer; }
.bb-toolbar button:hover { border-color: var(--accent); }
.bb-toolbar .bb-color { font-size: 15px; }
.bb-toolbar .ri { width: 14px; height: 14px; }
.cedit .bb-toolbar { margin: 6px 0 4px; }
.cform { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.cform textarea { width: 100%; background: var(--panel2); border: 1px solid var(--border); color: var(--fg); border-radius: var(--radius-sm); padding: 12px; resize: vertical; }
.cform button { align-self: flex-start; }
.reply-btn { background: var(--panel2); color: var(--fg); border: 1px solid var(--border2); }

/* ---------- sidebar blocks ---------- */
.tblock { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.tb-head { padding: 12px 15px; font-weight: 800; font-size: 13px; background: var(--panel2); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.tb-right { margin-left: auto; font-weight: 500; font-size: 12px; color: var(--muted); }
.tb-pad { padding: 12px 15px; }
.tb-pad.muted { color: var(--muted); font-size: 12.5px; }
.tb-links { padding: 0 15px 13px; font-size: 12px; }
.tb-links a { color: var(--accent); }
.paybtn { display: block; border-radius: var(--radius-sm); padding: 11px 15px; font-weight: 700; color: #fff; margin-bottom: 9px; box-shadow: none; }
.paybtn.purple { background: linear-gradient(135deg,#8a5cf6,#5b3df0); }
.paybtn.yellow { background: linear-gradient(135deg,#ffd21e,#f5a623); color:#3a2c00; }

/* «Поддержать сервер»: zero/near-deadline balance turns the whole card into a
   red pulsing alarm; the inner plate stays a calm red tint. */
@keyframes fundPulse { 0%,100% { box-shadow: var(--shadow), 0 0 0 0 rgba(220,38,38,.55); } 50% { box-shadow: var(--shadow), 0 0 0 8px rgba(220,38,38,0); } }
.fund-alarm {
  border: 1px solid color-mix(in srgb, var(--bad) 40%, transparent);
  background: color-mix(in srgb, var(--bad) 10%, transparent);
  border-radius: 10px;
  padding: 10px;
}
.fund-alarm-block {
  border-color: var(--bad);
  background: color-mix(in srgb, var(--bad) 6%, var(--panel));
  animation: fundPulse 1.6s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) { .fund-alarm-block { animation: none; } }
.stats2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); }
.stats2 > div { background: var(--panel); padding: 11px 13px; text-align: center; }
.stats2 b { display: block; font-size: 16px; }
.stats2 span { color: var(--muted); font-size: 11px; }
.statlist, .toplist, .forumlist { list-style: none; margin: 0; padding: 12px 15px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.statlist li { display: flex; justify-content: space-between; }
.statlist span { color: var(--muted); }
.statlist b { font-variant-numeric: tabular-nums; }
.toplist li { display: flex; justify-content: space-between; gap: 8px; }
.toplist li a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toplist li span { color: var(--muted); flex: none; }
.forumlist li a { font-weight: 600; }
.fp-meta { color: var(--muted); font-size: 11.5px; line-height: 1.35; margin-top: 3px; }
/* Vote-for-tracker banner + poster comments (ported from the legacy stdfoot). */
.vote-block { padding: 0; overflow: hidden; }
.vote-block a { display: block; }
.vote-block img { display: block; width: 100%; height: auto; }
.subtitle-btn { background: linear-gradient(135deg,#2563eb,#7c3aed); box-shadow: 0 6px 18px rgba(59,130,246,.35); }
.subtitle-btn:hover { filter: brightness(1.1); }
/* Series release schedule (season groups, like the legacy block). */
.season-next { margin: 0 0 10px; font-size: 14px; }
.season-schedule { display: flex; flex-direction: column; gap: 12px; max-height: 460px; overflow-y: auto; padding-right: 4px; }
.season-block { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--panel); }
.season-block > header { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--panel2); border-bottom: 1px solid var(--border); }
.season-title { margin-right: auto; font-weight: 800; font-size: 14px; }
.season-block ul { list-style: none; margin: 0; padding: 0; }
.season-block li { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
.season-block li:last-child { border-bottom: 0; }
.epnum { width: 24px; height: 24px; flex: none; border-radius: 999px; display: flex; align-items: center; justify-content: center; background: var(--panel2); border: 1px solid var(--border); font-weight: 700; font-size: 12px; }
.season-block li.upcoming .epnum { background: var(--accent); border-color: transparent; color: #fff; }
.epname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.epdate { color: var(--muted); font-variant-numeric: tabular-nums; }
.epstate { color: var(--ok); font-weight: 700; }
.season-block li.upcoming .epstate { color: var(--accent); }
/* Forum avatars. */
.topic-avatar { width: 60px; height: 60px; flex: none; border-radius: 15px; overflow: hidden; border: 1px solid var(--border); background: var(--panel2); display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 800; color: var(--accent); position: relative; }
.topic-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.forum-avatar { width: 60px; height: 60px; flex: none; border-radius: 15px; overflow: hidden; border: 1px solid var(--border); background: var(--panel2); display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 800; color: var(--accent); position: relative; }
.forum-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
/* Sidebar likes rating */
.side-likes { display: flex; flex-direction: column; gap: 10px; }
.side-like-col h4 { margin: 0 0 4px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.side-like-row { display: flex; align-items: center; gap: 7px; padding: 4px 0; color: var(--fg); text-decoration: none; min-width: 0; border-top: 1px solid var(--border); }
.side-like-col .side-like-row:first-of-type { border-top: 0; }
.side-like-row:hover .side-like-name { color: var(--accent); }
.side-like-thumb { width: 22px; height: 32px; flex: none; border-radius: 4px; overflow: hidden; background: var(--panel2); }
.side-like-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.side-like-name { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; font-weight: 600; }
.side-like-count { flex: none; display: inline-flex; align-items: center; gap: 2px; color: var(--accent); font-size: 10.5px; font-weight: 800; }
.side-like-count .ri { width: 11px; height: 11px; }
.side-like-empty { font-size: 11px; padding: 4px 0; }
/* Live swarm members in the "Раздают и качают" block */
.live-peers { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin: 10px 0 4px; }
.live-peers-col { min-width: 0; }
.live-peers-col h4 { margin: 0 0 6px; display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.live-peers-col h4 .ri { width: 13px; height: 13px; }
.live-peers-list { display: flex; flex-wrap: wrap; gap: 5px; }
.live-peer { display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px; border: 1px solid var(--border); border-radius: 999px; background: var(--panel2); color: var(--fg); font-size: 12px; text-decoration: none; max-width: 100%; }
.live-peer:hover { border-color: var(--accent); color: var(--accent); }
.live-peer .lp-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.live-peer .ubadge { font-size: 9px; }
@media (max-width: 560px) { .live-peers { grid-template-columns: 1fr; gap: 10px; } }
/* Torrent card grid. The Tailwind bundle is precompiled, so an arbitrary
   grid-cols-[...] class from a template may not exist in it; keep the layout
   in plain CSS instead of relying on a generated utility. */
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
@media (max-width: 560px) { .tgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
/* Runeicons sprite (outline style, currentColor). */
.ri { width: 1em; height: 1em; flex: none; display: inline-block; vertical-align: -.14em; overflow: visible; fill: none; }
.ri use { pointer-events: none; }
.uhist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; max-height: 380px; overflow-y: auto; }
.uhist li { display: flex; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border); font-size: 13px; }
.uhist li:last-child { border-bottom: 0; padding-bottom: 0; }
.uhist-date { flex: none; min-width: 92px; color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.uhist-body { min-width: 0; overflow-wrap: anywhere; }
.uhist-note { margin-top: 2px; color: var(--muted); font-size: 11.5px; }
.coupon-hist { display: flex; flex-direction: column; gap: 7px; max-height: 380px; overflow-y: auto; }
.ch-row { border-bottom: 1px solid var(--border); padding-bottom: 6px; font-size: 13px; }
.ch-row:last-child { border-bottom: 0; padding-bottom: 0; }
.ch-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; overflow-wrap: anywhere; }
.ch-meta { margin-top: 2px; color: var(--muted); font-size: 11.5px; }
/* The global `button` rule paints the accent gradient. Tailwind's bg-* only
   sets background-color, so the gradient image would still show through on
   the user chip. Reset the whole background (shorthand clears the image) and
   use theme variables so it follows dark/light mode. */
.userchip { background: var(--panel2); color: var(--fg); border: 1px solid var(--border); box-shadow: none; }
.userchip:hover, .userchip:active { background: var(--panel3); color: var(--fg); filter: none; box-shadow: none; transform: none; }
.userchip-avatar { width: 28px; height: 28px; flex: none; border-radius: 9px; object-fit: cover; border: 1px solid var(--border); display: block; }
/* The initials stay under the picture; a broken/dead avatar removes itself and
   reveals them, so every user still has a readable placeholder. */
.userchip-avatar-wrap { position: relative; overflow: hidden; }
.userchip-avatar-wrap .userchip-avatar { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 0; }
.avatar-frame { position: relative; overflow: hidden; }
.avatar-frame > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.userchip-initial { width: 28px; height: 28px; flex: none; border-radius: 9px; border: 1px solid var(--border); background: var(--panel); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; color: var(--accent); }
.userchip-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.userchip-id { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; line-height: 1.15; }
.userchip--head .userchip-name { max-width: 150px; font-size: 13px; }
.userchip-class { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; font-weight: 600; color: var(--muted); }
.userchip--head .userchip-initial, .userchip--head .userchip-avatar { width: 30px; height: 30px; border-radius: 10px; }
.profile-avatar-preview { width: 80px; height: 80px; flex: none; overflow: hidden; border-radius: 20px; border: 1px solid var(--border); background: var(--panel2); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; color: var(--accent); position: relative; }
.profile-avatar-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
/* «Скоро выйдут» uses the same carousel geometry as «Популярное сейчас»:
   a clipped viewport and a 1rem gap between slides. Without the explicit
   overflow rule the track ran past the page edge (Tailwind's .overflow-hidden
   is not in the prebuilt bundle). */
.kp-slider { min-width: 0; }
.kp-slider [data-kp-viewport] { overflow: hidden; cursor: grab; }
.kp-slider [data-kp-viewport]:active { cursor: grabbing; }
.kp-slider [data-kp-track] { display: flex; gap: 1rem; }
.subgrid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 640px) { .subgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .subgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.subrow { position: relative; display: flex; align-items: flex-start; gap: 11px; padding: 10px 38px 10px 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); transition: border-color .15s, background .15s; }
.subrow:hover { border-color: var(--border2); background: color-mix(in srgb, var(--panel2) 55%, var(--panel)); }
.subrow-thumb { width: 40px; height: 56px; flex: 0 0 40px; overflow: hidden; border-radius: 6px; border: 1px solid var(--border); background: var(--panel2); }
.subrow-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.subrow-noimg { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; font-size: 9px; font-weight: 800; color: var(--muted); }
.subrow-body { min-width: 0; flex: 1; }
.subgrid-empty { grid-column: 1 / -1; padding: 40px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--border2); border-radius: 16px; }
/* Subtitle detail: a small cover, not a full torrent-style poster. */
.sub-detail-poster { width: 120px; flex: none; }
@media (max-width: 640px) { .sub-detail-poster { width: 96px; } }
/* Avatar character builder */
.avatar-builder { display: flex; gap: 18px; align-items: flex-start; margin-top: 12px; flex-wrap: wrap; }
.avatar-builder-preview { width: 180px; height: 190px; flex: none; border-radius: 26px; border: 1px solid var(--border); background: var(--panel2); box-shadow: var(--shadow); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.avatar-builder-preview svg { width: 100%; height: 100%; display: block; }
.avatar-builder-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.avatar-builder-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; flex: 1 1 320px; min-width: 0; }
.avatar-builder-controls label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 11px; }
.avatar-builder-controls select { width: 100%; background: var(--panel); color: var(--fg); border: 1px solid var(--border); border-radius: 8px; padding: 7px 8px; font: inherit; font-size: 12px; outline: none; }
.avatar-builder-controls select:focus { border-color: var(--accent); }
.avatar-builder-controls input[type="color"] { width: 100%; height: 34px; padding: 2px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); cursor: pointer; }
.avatar-builder-controls input[type="range"] { width: 100%; accent-color: var(--accent); margin: 9px 0; }
@media (max-width: 640px) { .avatar-builder-controls { grid-template-columns: 1fr 1fr; } .avatar-builder-preview { width: 140px; height: 150px; } }
/* Generated avatar picker: large thumbnails with readable labels. */
.avatar-presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 10px; }
@media (min-width: 640px) { .avatar-presets { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.avatar-presets label { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; cursor: pointer; }
.avatar-presets input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.avatar-presets img { width: 72px; height: 72px; border-radius: 18px; border: 1px solid var(--border); cursor: pointer; transition: transform .15s, box-shadow .15s; }
@media (min-width: 640px) { .avatar-presets img { width: 88px; height: 88px; } }
.avatar-presets img:hover { transform: scale(1.06); }
.avatar-presets span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11px; text-align: center; }
.avatar-presets input:checked + img { outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); }
.avatar-presets input:checked ~ span { color: var(--accent); font-weight: 700; }
.friend-likes { margin: -6px 0 14px; color: var(--muted); font-size: 12.5px; text-align: center; }
.friend-likes a { color: var(--accent); font-weight: 600; }
/* Home "likes" rating: two compact top-5 columns, day and week. */
.like-rank { border: 1px solid var(--border); border-radius: 16px; background: var(--panel); padding: 16px; box-shadow: var(--shadow); overflow: hidden; }
.like-rank-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.like-rank-head h2 { margin: 0; font-size: 18px; }
.like-rank-head span { color: var(--muted); font-size: 12px; }
.like-rank-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; min-width: 0; }
.like-col { min-width: 0; overflow: hidden; }
.like-col h3 { margin: 0 0 8px; color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.like-row { display: flex; align-items: center; gap: 9px; padding: 6px 0; border-top: 1px solid var(--border); color: var(--fg); text-decoration: none; min-width: 0; max-width: 100%; }
.like-row:first-of-type { border-top: 0; }
.like-row:hover .like-name { color: var(--accent); }
.like-num { width: 16px; flex: none; color: var(--muted); font-size: 11px; font-weight: 700; text-align: center; }
.like-thumb { width: 30px; height: 44px; flex: none; overflow: hidden; border-radius: 5px; background: var(--panel2); }
.like-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.like-name { min-width: 0; flex: 1 1 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 600; }
.like-count { flex: none; color: var(--accent); font-size: 11.5px; font-weight: 800; }
.like-empty { margin: 0; color: var(--muted); font-size: 12px; }
@media (max-width: 700px) { .like-rank-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; } }
/* Torrent cards: keep the poster bright; darken only on hover. */
.tcard-shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,0) 100%); transition: background .25s ease; }

/* "Вам может понравиться": tag-based recommendations on the release page. */
.rec-block { margin: 18px 0 8px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--panel); }
.rec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.rec-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 18px; }
.rec-head h2 .ri { color: var(--accent); }
.rec-count { color: var(--muted); font-size: 14px; font-weight: 600; }
.rec-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.rec-card { position: relative; display: block; aspect-ratio: 16/9; overflow: hidden; border-radius: 12px; background: var(--panel2); color: #fff; text-decoration: none; box-shadow: var(--shadow); }
.rec-card:hover { color: #fff; }
.rec-poster, .rec-poster img { position: absolute; inset: 0; width: 100%; height: 100%; }
.rec-poster img { display: block; object-fit: cover; transition: transform .4s cubic-bezier(.2,.6,.2,1); }
.rec-card:hover .rec-poster img { transform: scale(1.05); }
.rec-card.is-adult .rec-poster img { filter: blur(12px); transform: scale(1.08); }
.rec-noimg { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--muted); font-weight: 800; letter-spacing: .2em; }
.rec-shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.94) 0%, rgba(0,0,0,.58) 42%, rgba(0,0,0,.06) 78%); }
.rec-cat { position: absolute; top: 8px; right: 8px; z-index: 2; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 86%, #000); color: #fff; font-size: 10px; font-weight: 700; white-space: nowrap; }
.rec-body { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 10px 12px; }
.rec-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; font-weight: 700; line-height: 1.25; }
.rec-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.rec-tags span { padding: 1px 5px; border-radius: 5px; background: rgba(255,255,255,.14); color: #fff; font-size: 10px; }
.rec-meta { display: flex; align-items: center; gap: 10px; margin-top: 5px; font-size: 11px; font-weight: 700; }
.rec-meta .ri { width: 11px; height: 11px; }
.rec-meta .s { color: #5cf29a; }
.rec-meta .l { color: #ff8b95; }
.rec-meta .rec-size { margin-left: auto; color: #fff; font-weight: 600; }
.rec-more { display: flex; justify-content: center; margin-top: 12px; }
.rec-more .btn { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 700px) { .rec-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 480px) { .rec-grid { grid-template-columns: 1fr; } .rec-card { aspect-ratio: 16/10; } }
.group:hover .tcard-shade { background: linear-gradient(180deg, rgba(0,0,0,.08) 0%, rgba(0,0,0,.62) 100%); }
.lc-list { gap: 10px; max-height: 360px; overflow-y: auto; padding-right: 4px; }
.lc-item { display: flex; gap: 9px; align-items: flex-start; }
.lc-poster { width: 38px; height: 54px; flex: none; border-radius: 6px; overflow: hidden; background: var(--panel2); }
.lc-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lc-main { min-width: 0; flex: 1; }
.lc-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.25; }
.lc-text { color: var(--muted); font-size: 11.5px; line-height: 1.35; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.online-who { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 15px; }

/* Anonymous members list in the sidebar: collapses when the crowd is big. */
.side-spoiler > summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 15px 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  user-select: none;
}
.side-spoiler > summary::-webkit-details-marker { display: none; }
.side-spoiler > summary::after { content: " ▾"; font-size: 10px; opacity: .7; }
.side-spoiler[open] > summary::after { content: " ▴"; }
.side-spoiler[open] > summary { padding-bottom: 0; }

/* sidebar persons */
.side-persons { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 10px; padding: 12px 15px; }
.sp-item { display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; }
.sp-photo { width: 100%; aspect-ratio: 5/7; border-radius: 11px; overflow: hidden; background: var(--panel2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; }
.sp-photo img { width: 100%; height: 100%; object-fit: cover; }
.sp-init { font-size: 20px; font-weight: 800; color: var(--accent); }
.sp-name { font-size: 11px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ---------- persons catalogue ---------- */
.letters { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.letters .chip .muted { font-size: 11px; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px; }
.person-card { display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden; background: var(--panel); border: 1px solid var(--border); transition: transform .18s ease, border-color .18s, box-shadow .18s; }
.person-card:hover { transform: translateY(-4px); border-color: var(--border2); box-shadow: var(--shadow); }
.pcover2 { position: relative; aspect-ratio: 3/4; background: var(--panel2); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.pcover2 img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.person-card:hover .pcover2 img { transform: scale(1.05); }
.pinit { font-size: 34px; font-weight: 800; color: var(--accent); text-align: center; padding: 8px; }
.pbody { padding: 0; }
.person-card .pbody { padding: 11px 12px 13px; }
.pname2 { font-weight: 700; font-size: 13.5px; line-height: 1.25; }
.pen2 { font-size: 12px; margin-top: 3px; }
.pyears { font-size: 12px; margin-top: 3px; }
.personhead { display: flex; gap: 24px; align-items: flex-start; margin-bottom: 12px; }
.pphoto { width: 190px; aspect-ratio: 3/4; flex: none; border-radius: var(--radius); overflow: hidden; background: var(--panel2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; }
.pphoto img { width: 100%; height: 100%; object-fit: cover; }
.pphoto-ph { font-size: 40px; font-weight: 800; color: var(--accent); text-align: center; padding: 8px; }
.pinfo { min-width: 0; }
.pinfo h1 { margin: 0 0 8px; }
.profilehead { display: flex; gap: 22px; align-items: center; }
.pavatar { width: 124px; height: 124px; flex: none; border-radius: 18px; overflow: hidden; background: var(--panel2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; }
.pavatar img { width: 100%; height: 100%; object-fit: cover; }
.pavatar-ph { font-size: 44px; font-weight: 800; color: var(--accent); }

/* ---------- forum ---------- */
.posts { display: flex; flex-direction: column; gap: 16px; }
.post { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.pmeta { margin-bottom: 8px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.quote-link { font-size: 12px; }
.pactions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.topic-admin { display: flex; gap: 8px; margin: 0 0 18px; flex-wrap: wrap; }
.topic-admin form { margin: 0; }
.quote-btn, .reply-btn { background: var(--panel2); color: var(--fg); border: 1px solid var(--border2); }

/* ---------- bbcode ---------- */
.bbquote { border-left: 4px solid var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--panel2)); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 8px 0; padding: 12px 16px; color: var(--muted); }
.bbquote::before { content: "❝ "; color: var(--accent); font-weight: 800; }
.text blockquote, .descr blockquote { border-left: 4px solid var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--panel2)); border-radius: 0 12px 12px 0; margin: 8px 0; padding: 12px 16px; color: var(--muted); }
.bbspoiler { border: 1px dashed var(--border2); border-radius: var(--radius-sm); margin: 8px 0; padding: 10px 14px; }
.bbspoiler > summary { cursor: pointer; font-weight: 700; color: var(--accent); }
.bbspoiler-body { margin-top: 8px; }
.bb-editor { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-top: 8px; }
.bb-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; background: var(--panel2); border-bottom: 1px solid var(--border); align-items: center; }
.bb-toolbar button, .bb-templates button { background: var(--panel); color: var(--fg); border: 1px solid var(--border); border-radius: 9px; padding: 7px 11px; font-size: 13px; font-weight: 600; box-shadow: none; }
.bb-toolbar button:hover, .bb-templates button:hover { border-color: var(--accent); }
.bb-sep { width: 1px; height: 22px; background: var(--border); margin: 0 4px; }
.bb-templates { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; background: var(--panel); border-bottom: 1px solid var(--border); align-items: center; }
.bb-editor textarea { border: 0; border-radius: 0; margin: 0; width: 100%; background: var(--panel); min-height: 320px; color: var(--fg); padding: 12px; }
.bb-editor textarea:focus { outline: none; }
.bb-preview { padding: 15px; border-top: 1px solid var(--border); background: var(--panel2); }
.bbcode-tools, .tplbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.tplbar button { padding: 6px 11px; font-size: 12px; background: var(--panel2); color: var(--fg); border: 1px solid var(--border); box-shadow: none; }

/* ---------- forms ---------- */
.editform label, .login label { display: block; margin: 14px 0; color: var(--muted); font-size: 13px; }
.editform input, .editform select, .editform textarea, .login input {
  width: 100%; margin-top: 6px; background: var(--panel2); border: 1px solid var(--border);
  color: var(--fg); border-radius: var(--radius-sm); padding: 11px 13px; outline: none; font: inherit;
}
.editform input:focus, .editform textarea:focus, .login input:focus { border-color: var(--accent); box-shadow: var(--ring); }
.editform .chk { display: flex; align-items: center; gap: 8px; }
.editform .chk input { width: auto; margin: 0; }
.chkgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px 16px; }
.login { max-width: 400px; margin: 60px auto; }
.editor-label { color: var(--muted); font-size: 13px; margin: 12px 0; }
.kpsearch, .adminsearch { display: flex; gap: 8px; margin: 12px 0; }
.kpsearch input, .adminsearch input { flex: 1; background: var(--panel2); border: 1px solid var(--border); color: var(--fg); border-radius: var(--radius-sm); padding: 11px 13px; }
.kpresults { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.kpitem { display: flex; align-items: center; gap: 10px; text-align: left; background: var(--panel2); color: var(--fg); border: 1px solid var(--border); width: 100%; box-shadow: none; }
.kpitem img { width: 34px; height: 50px; object-fit: cover; border-radius: 6px; }
.kpblock, .kpsel { margin: 10px 0; }
.movieinfo { display: flex; gap: 14px; margin: 8px 0; }
.movieinfo .kpposter { width: 90px; border-radius: 8px; }
.persel { margin-left: auto; background: var(--panel2); color: var(--fg); border: 1px solid var(--border); border-radius: 999px; padding: 5px 11px; font-size: 12px; text-transform: none; letter-spacing: 0; }
.shopicon { display: flex; align-items: center; justify-content: center; font-size: 44px; line-height: 1; padding: 24px 0 8px; }

/* ---------- design picker ---------- */
.design-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.design-card { display: block; background: var(--panel); border: 2px solid var(--border); border-radius: var(--radius); padding: 15px; cursor: pointer; transition: border-color .15s; }
.design-card.selected { border-color: var(--accent); }
.design-card input { display: none; }
.design-name { font-weight: 700; margin-top: 11px; }
.design-note { font-size: 12px; }
.design-prev { background: var(--panel2); border: 1px solid var(--border); border-radius: 11px; padding: 11px; }
.dp-banner { height: 26px; border-radius: 6px; background: var(--border2); margin-bottom: 8px; }
.dp-row { display: flex; gap: 8px; }
.dp-poster { width: 34px; height: 50px; border-radius: 5px; background: var(--border2); }
.dp-lines { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.dp-lines span { height: 8px; border-radius: 4px; background: var(--border2); }
.dp-lines span.short { width: 60%; }
.dp-tabs { display: flex; gap: 6px; margin-top: 8px; }
.dp-tabs span { flex: 1; height: 12px; border-radius: 4px; background: var(--border2); }
.prev-poster .dp-banner { height: 44px; }
.prev-compact .dp-poster { display: none; }
.prev-compact .dp-banner { height: 14px; }

/* ---------- torrent layout variants ---------- */
.tp-hero { position: relative; border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 24px; border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.tp-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(3px) brightness(.45); transform: scale(1.06); }
.tp-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(6,8,12,.96) 22%, rgba(6,8,12,.45) 65%, transparent); }
[data-theme="light"] .tp-hero::after { background: linear-gradient(90deg, rgba(245,247,251,.97) 25%, rgba(245,247,251,.55) 70%, transparent); }
.tp-in { position: relative; z-index: 2; display: flex; gap: 30px; align-items: center; padding: clamp(20px, 3vw, 30px); }
.tp-poster { width: 220px; border-radius: 16px; box-shadow: var(--shadow-lg); flex: none; }
.tp-txt { min-width: 0; }
.tp-txt h1 { font-size: clamp(24px, 3.4vw, 40px); margin: 10px 0 14px; }
.tp-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.tc-head h1 { margin: 0 0 12px; }
.tc-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); margin-bottom: 14px; align-items: center; }

/* ---------- actions row ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; align-items: center; }
.actions > form { margin: 0; }

/* ---------- chat widget (home) ---------- */
.chatwidget { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 22px; box-shadow: var(--shadow); }
.cw-head { display: flex; justify-content: space-between; font-weight: 800; margin-bottom: 10px; }
.cw-head a { font-weight: 500; font-size: 13px; color: var(--accent); }
.cw-msgs { height: 180px; overflow: auto; display: flex; flex-direction: column; gap: 5px; background: var(--panel2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.cw-msg { font-size: 13px; overflow-wrap: anywhere; }
.cw-msg b { color: var(--accent); margin-right: 6px; }
.cw-msg img { max-width: 100%; border-radius: 6px; }
.cw-tools, .compose-tools { display: flex; gap: 4px; margin-top: 9px; flex-wrap: wrap; }
.cw-tools button, .compose-tools button { background: var(--panel2); color: var(--fg); border: 1px solid var(--border); border-radius: 9px; width: 34px; height: 32px; padding: 0; box-shadow: none; }
.cw-form, .compose { display: flex; gap: 8px; margin-top: 9px; }
.cw-form input, .compose input { flex: 1; background: var(--panel2); border: 1px solid var(--border); color: var(--fg); border-radius: var(--radius-sm); padding: 11px 13px; outline: none; }

/* ---------- full chat page ---------- */
.chatwrap { display: grid; grid-template-columns: 230px 1fr; gap: 16px; max-width: 1040px; margin: 18px auto; padding: 0 16px; height: calc(100vh - 120px); }
.rooms { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; overflow: auto; }
.roombtn { display: flex; justify-content: space-between; width: 100%; text-align: left; background: transparent; color: var(--fg); border: 0; border-radius: 10px; padding: 11px 13px; cursor: pointer; font-weight: 600; box-shadow: none; }
.roombtn:hover { background: var(--panel2); }
.roombtn.active { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.roombtn .on { color: var(--muted); font-weight: 500; font-size: 12px; }
.pane { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.pane h2 { margin: 0; padding: 13px 17px; border-bottom: 1px solid var(--border); background: var(--panel2); }
.msgs { flex: 1; overflow: auto; padding: 15px 17px; }
.msg { margin-bottom: 10px; }
.msg .who { font-weight: 700; margin-right: 8px; }
.msg .ts { color: var(--muted); font-size: 11px; margin-left: 8px; }
.msg .txt { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.admin .who { color: var(--warn); }
.mtool { background: transparent; border: 1px solid var(--border); color: var(--muted); border-radius: 6px; cursor: pointer; font-size: 12px; line-height: 1; padding: 2px 6px; box-shadow: none; }
.mtool:hover { color: var(--fg); border-color: var(--accent); }
.modtools { display: inline-flex; gap: 4px; margin-left: 8px; vertical-align: middle; }
.cw-tools, .compose-tools { position: relative; }
.emoji-pop { position: absolute; bottom: 42px; left: 12px; z-index: 30; display: none; grid-template-columns: repeat(8, 1fr); gap: 2px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 8px; box-shadow: var(--shadow); width: min(320px, 92vw); }
.emoji-pop.open { display: grid; }
.emoji-pop button { border: 0; background: transparent; font-size: 20px; height: 34px; padding: 0; box-shadow: none; }
.emoji-pop button:hover { background: var(--panel2); }
.cw-msgs .msg { font-size: 13px; margin-bottom: 6px; }
.cw-msgs .msg .who { color: var(--accent); }
.cw-msgs .msg .ts { font-size: 10px; }
.roomhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 16px 0 0; border-bottom: 1px solid var(--border); background: var(--panel2); }
.roomhead h2 { border-bottom: 0; padding: 13px 17px; }

/* ---------- load bar ---------- */
.loadbar { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; text-align: center; margin-bottom: 22px; }
.loadbar b { color: var(--fg); }

/* ---------- theme cards (sidebar "themeblock") ---------- */
.tb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; padding: 12px 15px; }
.tb-card .tb-cover { aspect-ratio: 2/3; border-radius: 10px; overflow: hidden; background: var(--panel2); display: flex; align-items: center; justify-content: center; }
.tb-card .tb-cover img { width: 100%; height: 100%; object-fit: cover; }
.tb-name { font-size: 12.5px; font-weight: 600; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tb-meta { font-size: 11.5px; margin-top: 3px; }

/* ---------- misc ---------- */
footer { text-align: center; color: var(--muted2); padding: 36px 16px; font-size: 12px; }
#toTop { position: fixed; right: 18px; bottom: 18px; z-index: 45; display: none; }
.beta-report { position: fixed; left: 16px; bottom: 16px; z-index: 45; display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel); color: var(--fg); font-size: 12.5px; font-weight: 700; box-shadow: var(--shadow); opacity: .9; }
.beta-report:hover { opacity: 1; border-color: var(--accent); color: var(--accent); }
.dot-unread { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.adminsearch { display: flex; gap: 8px; margin: 10px 0; }
.topic-admin.inline { display: inline-flex; }
.not { color: var(--muted); }

/* VIP / coupons */
.vipbadge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid var(--border); background: var(--panel2); letter-spacing: .2px; }
.vip-free { color:#1a7f37; border-color:#1a7f37; }
.vip-c1 { color:#2563eb; border-color:#2563eb; }
.vip-c3 { color:#7c3aed; border-color:#7c3aed; }
.vip-c5 { color:#b45309; border-color:#b45309; }
.vip-c10 { color:#be123c; border-color:#be123c; }
.vip-forever { color:#4338ca; border-color:#4338ca; }
.vip-super { color:#9333ea; border-color:#9333ea; background:rgba(147,51,234,.12); }
.vip-vip { color:#0e7490; border-color:#0e7490; }
.vipedit { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin: 14px 0; }
.vipedit legend { color: var(--muted); font-size: 12px; padding: 0 6px; }

/* ---------- page preloader ---------- */
.pageloader { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(3px); }
.pageloader[hidden] { display: none; }
.ploader-spin { width: 46px; height: 46px; border-radius: 50%; border: 4px solid var(--border2); border-top-color: var(--accent); animation: plspin .8s linear infinite; }
@keyframes plspin { to { transform: rotate(360deg); } }
.ploader-txt { color: var(--muted); font-weight: 600; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1020px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .rightside { position: static; max-height: none; overflow: visible; }
}

/* mobile header handled in layout.html (Tailwind + inline states) */

@media (max-width: 820px) {
  main { width: 94%; }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .meta { gap: 6px 12px; font-size: 13.5px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  main { width: 100%; padding: 16px 13px 54px; }
  .iconbtn { width: 34px; height: 34px; }
  h1 { font-size: 21px; }
  h2 { margin: 22px 0 12px; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 13px; }
  .pgrid { grid-template-columns: repeat(auto-fill, minmax(122px, 1fr)); gap: 12px; }
  .ttitle { font-size: 12.5px; }
  .actions { gap: 8px; }
  .actions .btn, .actions button { flex: 1 1 auto; text-align: center; }
  .card { padding: 16px; }
  .poster { float: none; width: 100%; max-width: 240px; margin: 0 auto 14px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stats b { font-size: 18px; }
  table { font-size: 13px; }
  th, td { padding: 9px 10px; }
  /* One column on phones: vote/avatar/body used to fight for a 34px track,
     which wrapped the comment text one character per line. */
  .comment { display: flex; flex-direction: column; gap: 9px; padding: 12px; margin-left: 0 !important; }
  .comment .cavatar { width: 44px; height: 44px; order: 1; }
  .comment .cbody { width: 100%; order: 2; }
  .vbtn { width: 30px; height: 26px; }
  .hero-poster { display: none; }
  .hero { min-height: 210px; }
  .hero-in { padding: 18px; gap: 14px; }
  .tp-poster { display: none; }
  .tp-in { padding: 18px; gap: 14px; }
  .loadbar { padding: 14px; font-size: 13px; }
  .webtor-el { aspect-ratio: 16/9; min-height: 220px; max-height: 60vh; }
  .bb-editor textarea { min-height: 200px; }
  .acc > summary { padding: 12px 14px; }
  .movieinfo { flex-direction: column; }
  .personhead { flex-direction: column; align-items: flex-start; }
  .pphoto { width: 130px; }
  .profilehead { flex-direction: column; align-items: flex-start; }
  .pavatar { width: 90px; height: 90px; }
  .chatwrap { grid-template-columns: 1fr; height: auto; margin: 12px auto; padding: 0 10px; gap: 10px; }
  .rooms { display: flex; gap: 6px; overflow-x: auto; padding: 8px; }
  .roombtn { width: auto; flex: none; white-space: nowrap; }
  .rooms .pane { height: auto; }
  footer { padding: 26px 14px; }
}

@media (max-width: 420px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .pgrid { grid-template-columns: repeat(2, 1fr); }
}

/* subtitles cards */
.subcover { position: relative; aspect-ratio: 16/9; background: linear-gradient(135deg,#1f2a44,#2a3550); display: flex; align-items: center; justify-content: center; }
.subtag { font-weight: 900; letter-spacing: .1em; color: var(--accent); border: 2px solid var(--accent); border-radius: 10px; padding: 6px 12px; font-size: 20px; }
/* ticket answer block */
.post.answer { background: color-mix(in srgb, var(--ok) 8%, var(--panel)); border-color: color-mix(in srgb, var(--ok) 40%, var(--border)); }
.cbody { min-width: 0; }

/* catalog header / sort */
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.pagehead h1 { margin: 0; }
.sortform { margin: 0; }
.pager-info { align-self: center; }

/* header categories strip */
/* header categories strip: styled with Tailwind (see layout.html) */

/* torrent hero */
.torrent-hero { display: grid; grid-template-columns: 240px 1fr; gap: 26px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow); margin-bottom: 6px; }
.th-poster { border-radius: var(--radius); overflow: hidden; background: var(--panel2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; aspect-ratio: 2/3; }
.th-poster img { width: 100%; height: 100%; object-fit: cover; }
.th-main { min-width: 0; }
.th-main h1 { margin: 8px 0 14px; }
.th-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.btn.on { background: var(--panel3); color: var(--accent); border-color: var(--accent); }
@media (max-width: 820px) { .torrent-hero { grid-template-columns: 1fr; gap: 16px; padding: 18px; } .th-poster { max-width: 220px; } }
/* drag-to-scroll strips (categories, popular rail) */
[data-dragscroll] { cursor: grab; }
[data-dragscroll].dragging { cursor: grabbing; scroll-behavior: auto; scroll-snap-type: none; user-select: none; -webkit-user-select: none; }
[data-dragscroll] img { -webkit-user-drag: none; user-select: none; }
/* --- image preloader (persons / cinema posters) --------------------------
   A Flutter-like shimmer skeleton: the poster box gets a soft gradient base
   and a moving highlight until the image is decoded, so a slow/dead image is
   visibly "loading" instead of just an empty gap. */
.imbox { position: relative; }
.imbox.im-load { overflow: hidden; background: var(--panel2); }
.imbox.im-load::after { content: ""; position: absolute; inset: 0; z-index: 0; background: linear-gradient(135deg, var(--panel2), color-mix(in srgb, var(--panel2) 72%, var(--accent))); pointer-events: none; }
.imbox.im-load::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(100deg, transparent 18%, rgba(255,255,255,.12) 38%, rgba(255,255,255,.34) 50%, rgba(255,255,255,.12) 62%, transparent 82%); background-size: 220% 100%; animation: imshimmer 1.15s linear infinite; pointer-events: none; }
.imbox.im-load > img { opacity: 0; }
.imbox.im-ok > img { opacity: 1; }
.imbox.im-err > img { display: none; }
.imbox > img { transition: opacity .2s; }
[data-theme="light"] .imbox.im-load::before { background: linear-gradient(100deg, transparent 18%, rgba(255,255,255,.35) 38%, rgba(255,255,255,.8) 50%, rgba(255,255,255,.35) 62%, transparent 82%); background-size: 220% 100%; }
@keyframes imshimmer { 0% { background-position: 180% 0; } 100% { background-position: -80% 0; } }

/* accordion body padding (person dossiers, etc.) */
.acc > .acc-body { padding: 0 18px 16px; }
.acc > .acc-body p { margin: 0 0 10px; }
.acc > .acc-body p:last-child { margin-bottom: 0; }

.userclass, .ubadge { display:inline-block; margin-left:6px; padding:0 7px; border:1px solid var(--border); border-radius:999px; background:var(--panel2); font-size:11px; font-weight:600; line-height:1.7; vertical-align:middle; white-space:nowrap; }
/* Class badges: a soft background derived from the class colour instead of the
   flat dark grey, so pale legacy colours stay readable. /admin/classes can set
   an explicit per-class background (inline style wins over this rule). */
/* Class badges: the class colour comes in as --ub (admin-managed), so the text,
   plate and border can be derived per theme instead of relying on a filter. */
.ubadge { color: var(--ub, var(--fg)); background: color-mix(in srgb, var(--ub, var(--accent)) 16%, var(--panel)); border-color: color-mix(in srgb, var(--ub, var(--accent)) 34%, var(--border)); }
/* an explicit per-class background still wins in the dark theme */
.ubadge[style*="--ub-bg"] { background: var(--ub-bg); border-color: var(--ub-bg); }
/* Light theme: legacy class colours are pale (silver, light red) and vanish on
   white, so darken the text and tint the plate over white instead. */
[data-theme="light"] .ubadge {
  color: color-mix(in srgb, var(--ub, var(--fg)) 45%, #000);
  background: color-mix(in srgb, var(--ub, var(--accent)) 14%, #fff);
  border-color: color-mix(in srgb, var(--ub, var(--accent)) 42%, #fff);
}
.thankschip { background: color-mix(in srgb, currentColor 15%, var(--panel)); border-color: color-mix(in srgb, currentColor 32%, var(--border)); }
.cardflags { position:absolute; left:8px; bottom:8px; z-index:10; display:flex; flex-direction:column; align-items:flex-start; gap:4px; }
.updbadge, .vajbadge { display:inline-flex; align-items:center; gap:4px; padding:2px 8px; border-radius:7px; color:#fff; font-size:10.5px; font-weight:700; line-height:1.6; box-shadow:0 2px 8px rgba(0,0,0,.3); }
.updbadge { background:#2563eb; }
/* amber needs dark text: white on #f59e0b is unreadable in both themes */
.vajbadge { background:#f59e0b; color:#2a1c00; }
/* class colours are set inline (admin-managed), so lighten-proof them for the
   light theme where pale colours (silver, light red) vanish on white */
[data-theme="light"] .chip-sm[style],
[data-theme="light"] .online li > span[style] { filter: brightness(.72); }

/* ---------- auth pages (login / signup / recover) ---------- */
/* Backdrop follows the legacy site: gray-900 canvas with the blue particle
   field (auth-particles.js). The theme switcher stays usable, so the light
   theme gets a plain light backdrop instead of a dark one. */
/* Auth pages deliberately use their own light palette even when the site is
   in dark mode: the sign-in/registration card should feel airy, not lost in
   the dark canvas. */
.authwrap {
  --bg: #eef3fb; --panel: #ffffff; --panel2: #f6f9fe; --fg: #111827;
  --muted: #5b6778; --border: #d9e3f0; --border2: #c8d4e5;
  --accent: #e8590c; --accent2: #ff7a1a; --ok: #0f9d70; --bad: #dc2626;
  position: relative; color: #111827;
  background:
    radial-gradient(circle at 15% 5%, #fff 0, rgba(255,255,255,0) 38%),
    radial-gradient(circle at 85% 95%, #e5f0ff 0, rgba(229,240,255,0) 42%),
    #eef3fb;
}
[data-theme="light"] .authwrap { background: #eef3fb; }
.authwrap #particles-js { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .35; }
.authwrap .authcard { position: relative; z-index: 1; background: rgba(255,255,255,.94); border-color: #d9e3f0; box-shadow: 0 26px 80px rgba(35,54,85,.16); color: #111827; }
.authwrap .text-fg, .authwrap h1, .authwrap h2 { color: #111827 !important; }
.authwrap .text-muted { color: #5b6778 !important; }
.authwrap .bg-panel2 { background: #f6f9fe !important; }
.authwrap .border-line { border-color: #d9e3f0 !important; }
.authwrap input { background: #f8fafc !important; color: #0f172a !important; border-color: #d7e0ec !important; }
.authwrap input::placeholder { color: #94a3b8; }
.authwrap .authlogo { filter: none; }
/* Signup captcha */
.captcha-row { display: flex; flex-direction: column; gap: 8px; }
.captcha-label { color: #5b6778; font-size: 13px; }
.captcha-flex { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.captcha-img { width: 180px; height: 60px; flex: none; border-radius: 10px; border: 1px solid #d7e0ec; background: #fff; object-fit: cover; }
.captcha-unavailable { display: flex; align-items: center; justify-content: center; color: #64748b; font-size: 12px; }
.captcha-refresh { border: 1px solid #d7e0ec; border-radius: 9px; background: #fff; color: #334155; padding: 10px 12px; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s; }
.captcha-refresh:hover { background: #f1f5fb; border-color: #b9c8dc; }
.captcha-refresh:disabled { opacity: .55; cursor: default; }

/* ---------- subtitle line editor ---------- */
.cue { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
.cue-head { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.cue-num { font-weight: 700; color: var(--fg); }
.cue-time { font-variant-numeric: tabular-nums; }
.cue-count { margin-left: auto; opacity: .8; }
.cue-revert { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 14px; padding: 0 4px; line-height: 1; }
.cue-revert:hover { color: var(--accent); }
.cue-text { width: 100%; resize: vertical; background: var(--panel2); color: var(--fg);
  border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; font: inherit; line-height: 1.45; }
.cue-text:focus { outline: none; border-color: var(--accent); }
.cue.dirty { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.cue.dirty .cue-num::after { content: " ?"; color: var(--accent); }
.cue.match .cue-text { box-shadow: inset 3px 0 0 var(--accent); }
.cue.flash { animation: cueflash .9s ease-out; }
@keyframes cueflash { from { background: color-mix(in srgb, var(--accent) 22%, var(--panel)); } to { background: var(--panel); } }
.hidden-row { display: none; }

/* ---------- Kinopoisk discovery cards (home sliders, /collections) ---------- */
.kp-sub { background: rgba(255,255,255,.15); }
.kp-sub:hover { background: rgba(255,255,255,.28); }
.kp-title { text-shadow: 0 1px 2px rgba(0,0,0,.95), 0 0 10px rgba(0,0,0,.8); -webkit-text-stroke: .35px rgba(0,0,0,.55); }
.kp-meta { text-shadow: 0 1px 2px rgba(0,0,0,.9); }

/* the editor toolbar sticks below the site header, whose height depends on
   how many nav rows wrap, so the offset is set from JS in subtitle-editor.js */
.subedit-bar { position: sticky; top: var(--subedit-top, 78px); z-index: 30; }

/* Admin dashboard: period tabs, activity chart and user infographics. */
.admin-period-tab { display:inline-flex; align-items:center; padding:6px 12px; border-radius:9px; font-size:12px; font-weight:700; color:var(--muted); text-decoration:none; }
.admin-period-tab:hover { color:var(--fg); background:var(--panel2); }
.admin-period-tab.on { background:var(--accent); color:#fff; }
.chart-legend { display:flex; flex-wrap:wrap; gap:6px 18px; margin-bottom:12px; font-size:12px; color:var(--muted); }
.chart-legend span { display:inline-flex; align-items:center; gap:6px; }
.chart-legend b { color:var(--fg); }
.chart-dot { width:9px; height:9px; border-radius:3px; display:inline-block; }
.dot-users { background:#5aa9ff; }
.dot-torrents { background:#3ddc84; }
.dot-comments { background:#ff8a3d; }
.chart-scroll { overflow-x:auto; padding-bottom:4px; }
.chart { display:flex; align-items:flex-end; gap:4px; min-height:170px; padding-top:8px; }
.chart-point { flex:1 1 22px; min-width:22px; display:flex; flex-direction:column; align-items:center; gap:4px; }
.chart-bars { height:150px; display:flex; align-items:flex-end; gap:2px; }
.chart-bar { width:5px; min-height:2px; border-radius:2px 2px 0 0; display:block; }
.bar-users { background:#5aa9ff; }
.bar-torrents { background:#3ddc84; }
.bar-comments { background:#ff8a3d; }
.chart-label { font-size:9px; line-height:1; color:var(--muted); white-space:nowrap; min-height:9px; }
.user-stats { display:flex; flex-direction:column; gap:7px; }
.user-stat-row { display:grid; grid-template-columns:minmax(100px,1.2fr) minmax(0,2fr) 38px; gap:8px; align-items:center; font-size:12px; }
.user-stat-name { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--muted); }
.user-stat-name .ubadge { font-size:10px; }
.user-stat-bar { height:8px; border-radius:999px; background:var(--panel2); overflow:hidden; }
.user-stat-bar > span { display:block; height:100%; min-width:2px; border-radius:999px; background:var(--accent); }
.user-stat-row b { text-align:right; color:var(--fg); }
@media (max-width:640px) { .chart-point { flex-basis:22px; } .user-stat-row { grid-template-columns:minmax(80px,1fr) minmax(0,1.5fr) 32px; } }
