/* FilmyZillam — app.css. Mobile-first, no framework, no JS, system fonts. */
:root {
  --bg: #f5f3fb; --surface: #ffffff; --surface-2: #efeaf9; --text: #1c1830; --muted: #625d7e; --border: #e3ddf1;
  --brand: #6d28d9; --brand-soft: #ede5ff;
  --accent: #f59e0b; --accent-2: #fbbf24; --accent-ink: #241400;
  --radius: 14px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(28, 24, 48, .06), 0 8px 24px -12px rgba(28, 24, 48, .2);
  --hdr: linear-gradient(120deg, #2e1065 0%, #5b21b6 50%, #a21caf 100%);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0b19; --surface: #171328; --surface-2: #221c3a; --text: #ece8fb; --muted: #a8a2c6; --border: #2c2547;
    --brand: #a78bfa; --brand-soft: #2b2152;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--brand); }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 10; background: var(--accent); color: var(--accent-ink);
  padding: 8px 12px; border-radius: 8px; font-weight: 700; }
.skip:focus { left: 8px; }
.mt { margin-top: 16px; }

/* ---------- header ---------- */
.hdr { background: var(--hdr); color: #fff; position: sticky; top: 0; z-index: 5; box-shadow: 0 2px 14px rgba(20, 6, 50, .3); }
.hdr-in { max-width: 1180px; margin: 0 auto; padding: 10px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.logo { display: inline-flex; align-items: center; gap: 9px; color: #fff; text-decoration: none; font-weight: 800;
  font-size: 21px; letter-spacing: -.02em; }
.logo svg { flex: none; }
.wm b { color: var(--accent-2); font-weight: 800; }
.search { display: flex; flex: 1 1 260px; min-width: 0; max-width: 560px; margin-left: auto; }
.search input { flex: 1; min-width: 0; border: 0; border-radius: 10px 0 0 10px; padding: 10px 13px;
  font: inherit; font-size: 15px; background: #fff; color: #1c1830; }
.search button { border: 0; border-radius: 0 10px 10px 0; background: var(--accent); color: var(--accent-ink);
  font: inherit; font-weight: 800; padding: 0 16px; cursor: pointer; }
.search button:hover { background: var(--accent-2); }

/* ---------- section chips ---------- */
.sections { background: var(--surface); border-bottom: 1px solid var(--border); }
.notice { margin: 0; padding: 8px 16px; text-align: center; background: var(--brand-soft); color: var(--text); font-size: .92rem; font-weight: 600; overflow-wrap: anywhere; }
.notice a { color: inherit; }
.sections-in { max-width: 1180px; margin: 0 auto; display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px; scrollbar-width: none; }
.sections-in::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; padding: 7px 13px; border-radius: 999px;
  background: var(--surface-2); color: var(--text); font-size: 13.5px; font-weight: 550; text-decoration: none; }
a.chip:hover { background: var(--brand); color: #fff; }
.chip .cnt { font-size: 11.5px; opacity: .65; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sub-chips { margin: 0 0 18px; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 16px; }

/* ---------- headings ---------- */
.intro { background: var(--surface); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.intro h1 { font-size: 21px; letter-spacing: -.015em; }
.intro p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.sec-h { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin: 24px 0 12px; }
.sec-h h1, .sec-h h2 { font-size: 19px; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
.sec-h h1::before, .sec-h h2::before { content: ""; flex: none; width: 5px; height: 20px; border-radius: 3px;
  background: linear-gradient(#7c3aed, #db2777); }
.sec-h .meta { color: var(--muted); font-size: 13px; }
.panel .sec-h:first-child { margin-top: 0; }
.crumbs { font-size: 13px; color: var(--muted); margin: 2px 0 12px; overflow-wrap: anywhere; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--brand); text-decoration: underline; }
.crumbs span[aria-hidden] { margin: 0 6px; opacity: .6; }

/* ---------- poster grid ---------- */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 10px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 14px; } }
@media (min-width: 980px) { .grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.card a { display: block; color: inherit; text-decoration: none; }
.poster { position: relative; display: block; aspect-ratio: 2 / 3; border-radius: var(--radius-sm); overflow: hidden;
  background: var(--surface-2); box-shadow: var(--shadow); transition: transform .15s ease; }
.card a:hover .poster { transform: translateY(-3px); }
.poster img { width: 100%; height: 100%; object-fit: cover; }
.ph { position: absolute; inset: 0; display: grid; place-items: center; font-size: 34px; font-weight: 800; color: var(--brand);
  background: linear-gradient(135deg, var(--brand-soft), var(--surface-2)); }
.badges { position: absolute; left: 6px; bottom: 6px; display: flex; gap: 4px; flex-wrap: wrap; }
.badge { font-size: 10.5px; font-weight: 800; line-height: 1; padding: 4px 6px; border-radius: 6px;
  background: rgba(14, 10, 30, .8); color: #fff; letter-spacing: .02em; }
.new { position: absolute; right: 6px; top: 6px; font-size: 10.5px; font-weight: 800; padding: 4px 7px; border-radius: 6px;
  background: var(--accent); color: var(--accent-ink); }
.card .title { font-size: 13.5px; font-weight: 650; line-height: 1.3; margin-top: 8px; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .sub { margin: 3px 0 0; font-size: 12px; color: var(--muted); }

/* ---------- panels ---------- */
.panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.empty { color: var(--muted); text-align: center; padding: 28px 12px; }

/* ---------- movie ---------- */
.movie { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .movie { grid-template-columns: 230px 1fr; align-items: start; padding: 20px; } }
.movie > .poster { width: 62%; max-width: 230px; margin: 0 auto; }
@media (min-width: 760px) { .movie > .poster { width: 100%; } }
.movie h1 { font-size: 23px; letter-spacing: -.015em; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 9px 16px; margin: 14px 0 0; font-size: 14.5px; }
.facts dt { color: var(--muted); font-weight: 550; }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.tag { display: inline-block; padding: 2px 9px; margin: 0 5px 5px 0; border-radius: 7px; background: var(--brand-soft);
  color: var(--text); font-size: 13px; text-decoration: none; }
.tag:hover { background: var(--brand); color: #fff; }
.jump { margin: 16px 0 0; }
.prose { font-size: 15px; }
.prose p { margin: 0 0 10px; }
.prose p:last-child { margin-bottom: 0; }
.lbl { font-weight: 750; }

/* ---------- download options ---------- */
.dl-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; }
.dl-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--surface-2); font-weight: 700; font-size: 13.5px; color: var(--muted); }
.q { background: var(--brand); color: #fff; border-radius: 7px; padding: 3px 9px; font-size: 12.5px; font-weight: 800; }
.dl-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--border); }
.dl-head + .dl-row { border-top: 0; }
.dl-info { flex: 1; min-width: 0; }
.dl-name { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.dl-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--accent); color: var(--accent-ink);
  font-weight: 800; border-radius: 10px; padding: 10px 15px; text-decoration: none; white-space: nowrap; border: 0; font-size: 14px; }
.btn:hover { background: var(--accent-2); }
.btn-lg { width: 100%; padding: 16px 22px; font-size: 17px; border-radius: 12px; }
.btn-alt { background: #16a34a; color: #fff; }
.btn-alt:hover { background: #15803d; }

/* ---------- download page ---------- */
.dl-card { display: grid; gap: 14px; }
.dl-card h1 { font-size: 20px; overflow-wrap: anywhere; }
.mini { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; padding: 10px; border-radius: 12px; background: var(--surface-2); }
.mini .poster { width: 54px; flex: none; border-radius: 8px; box-shadow: none; }
.mini .ph { font-size: 20px; }
.mini strong { display: block; font-size: 14.5px; }
.mini .hint { font-size: 12.5px; color: var(--muted); }
.note { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; font-size: 13.5px; color: var(--muted); margin: 0; }
.ok { color: #16a34a; font-weight: 750; }
.list { list-style: none; margin: 0; padding: 0; }
.list li + li { border-top: 1px solid var(--border); }
.list a { display: flex; justify-content: space-between; gap: 12px; padding: 11px 2px; text-decoration: none; color: var(--text); font-size: 14px; }
.list a:hover { color: var(--brand); }
.list .r { color: var(--muted); white-space: nowrap; font-size: 13px; }

/* ---------- pagination ---------- */
.pager { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 26px 0 6px; }
.pager a, .pager span { min-width: 40px; height: 40px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; font-weight: 650; font-size: 14px; }
.pager a:hover { border-color: var(--brand); color: var(--brand); }
.pager .cur { background: var(--brand); border-color: transparent; color: #fff; }
.pager .gap { background: none; border: 0; min-width: 20px; padding: 0; }

/* ---------- error ---------- */
.error { text-align: center; padding: 48px 16px; }
.error .code { font-size: 64px; font-weight: 900; letter-spacing: -.04em; line-height: 1; color: var(--brand); }
.error h1 { font-size: 22px; margin-top: 10px; }
.error p { color: var(--muted); }

/* ---------- footer ---------- */
.ftr { margin-top: 36px; border-top: 1px solid var(--border); background: var(--surface); }
.ftr-in { max-width: 1180px; margin: 0 auto; padding: 22px 16px; display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center;
  justify-content: space-between; color: var(--muted); font-size: 13px; }
.ftr nav { display: flex; gap: 16px; }
.ftr a { color: var(--muted); text-decoration: none; }
.ftr a:hover { color: var(--brand); }
