/* Moviemania — dark poster-grid layout */
:root {
  --bg: #0b0b0e; --panel: #15151b; --panel2: #1d1d25; --line: #2a2a35;
  --text: #ececf1; --muted: #9b9bab; --accent: #ffb400; --accent2: #ff3d57; --ok: #2ecc71;
  --r: 10px; --font: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--font); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.sr, .skip { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; z-index: 99; top: 8px; left: 8px; width: auto; height: auto; clip: auto; background: var(--accent); color: #000; padding: 8px 12px; border-radius: 6px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* top links bar */
.toplinks { background: #050507; border-bottom: 1px solid var(--line); font-size: 13px; }
.toplinks .wrap { display: flex; gap: 18px; justify-content: flex-end; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
.toplinks a { color: var(--muted); }
.toplinks a:hover { color: var(--text); }

/* header: logo + search */
.head { background: var(--panel); border-bottom: 1px solid var(--line); }
.head .wrap { display: flex; align-items: center; gap: 20px; padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 28px; font-weight: 800; letter-spacing: .5px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand b { color: var(--accent); font-weight: 800; }
.search { flex: 1; min-width: 220px; max-width: 520px; margin-left: auto; display: flex; }
.search input { flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--line); border-right: 0; color: var(--text);
  font: inherit; font-size: 16px; padding: 10px 14px; border-radius: var(--r) 0 0 var(--r); }
.search input::placeholder { color: var(--muted); }
.search button { background: var(--accent); border: 0; padding: 0 16px; border-radius: 0 var(--r) var(--r) 0; cursor: pointer; font-size: 16px; touch-action: manipulation; }

/* category menu with dropdowns */
.catnav { background: linear-gradient(90deg, #1a1a22, #121218); border-bottom: 2px solid var(--accent); position: sticky; top: 0; z-index: 20; }
.catnav ul { list-style: none; margin: 0; padding: 0; }
#catmenu { display: flex; flex-wrap: wrap; }
#catmenu > li > a, .dd > button { display: block; padding: 12px 14px; color: var(--text); font: 600 14px var(--font); text-transform: uppercase; letter-spacing: .4px; background: none; border: 0; cursor: pointer; }
#catmenu > li > a:hover, .dd > button:hover, .dd.open > button { background: var(--accent); color: #000; text-decoration: none; }
.dd { position: relative; }
.dd ul { display: none; position: absolute; left: 0; top: 100%; min-width: 200px; background: var(--panel2); border: 1px solid var(--line); border-top: 2px solid var(--accent);
  max-height: 70vh; overflow: auto; overscroll-behavior: contain; columns: 2; column-gap: 0; padding: 6px 0; z-index: 30; }
.dd.open ul { display: block; }
@media (hover: hover) { .dd:hover ul { display: block; } }
.dd ul a { display: block; padding: 7px 14px; color: var(--text); font-size: 14px; break-inside: avoid; }
.dd ul a:hover { background: var(--line); text-decoration: none; }
.navtoggle { display: none; }

/* notice bar */
.notice { background: #13261a; border-bottom: 1px solid #1f4d2c; color: #bff0cf; font-size: 14px; text-align: center; }
.notice .wrap { padding-top: 9px; padding-bottom: 9px; }
.notice a { color: #fff; font-weight: 600; text-decoration: underline; }

/* category chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 6px; }
.chips a { background: var(--panel); border: 1px solid var(--line); color: var(--text); padding: 6px 12px; border-radius: 999px; font-size: 13px; }
.chips a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.chips small { color: var(--muted); font-variant-numeric: tabular-nums; }

/* section headings */
.sec { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; margin: 22px 0 14px; padding: 10px 14px;
  background: var(--panel); border-left: 4px solid var(--accent); border-radius: 0 var(--r) var(--r) 0; text-wrap: balance; }

/* poster grid */
.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.card figure { margin: 0; position: relative; border-radius: var(--r); overflow: hidden; background: var(--panel2); aspect-ratio: 2 / 3; }
.card figure a { display: block; height: 100%; }
.card img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.card .badge { position: absolute; top: 8px; left: 8px; background: var(--accent2); color: #fff; font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 4px; letter-spacing: .4px; }
.card .hover { position: absolute; inset: 0; display: grid; place-items: center; font-size: 38px; color: #fff; background: rgba(0,0,0,.45); opacity: 0; transition: opacity .2s ease; }
.card figure a:hover img, .card figure a:focus-visible img { transform: scale(1.05); }
.card figure a:hover .hover, .card figure a:focus-visible .hover { opacity: 1; }
.card figcaption { padding: 8px 2px 0; font-size: 13px; line-height: 1.4; }
.card figcaption a { color: var(--text); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card figcaption a:hover { color: var(--accent); text-decoration: none; }
.empty { color: var(--muted); }

/* pagination */
.pager { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 28px 0 10px; }
.pager a, .pager span { min-width: 40px; text-align: center; padding: 8px 12px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); color: var(--text); font-variant-numeric: tabular-nums; }
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager .cur { background: var(--accent); color: #000; font-weight: 800; border-color: var(--accent); }
.pager .gap { background: none; border: 0; }

/* movie page */
.movie { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin-top: 20px; }
.ptitle { font-size: 22px; line-height: 1.35; margin: 0 0 8px; text-wrap: balance; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; color: var(--muted); font-size: 13px; margin: 0 0 18px; }
.meta a { background: var(--panel2); border: 1px solid var(--line); padding: 2px 9px; border-radius: 999px; color: var(--text); }
.mhead { display: grid; grid-template-columns: 240px 1fr; gap: 22px; align-items: start; }
.mposter { border-radius: var(--r); width: 100%; height: auto; }
.mname { font-size: 24px; margin: 0 0 10px; color: var(--accent); }
.mname span { color: var(--muted); font-weight: 500; }
.info { list-style: none; margin: 0 0 16px; padding: 0; }
.info li { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.info b { color: var(--muted); font-weight: 600; margin-right: 4px; }
.watch { display: inline-block; background: var(--accent2); color: #fff; font-weight: 800; padding: 12px 22px; border-radius: var(--r); letter-spacing: .5px; }
.watch:hover { filter: brightness(1.1); text-decoration: none; }
.watch.off, .dl.off { opacity: .55; cursor: not-allowed; }
.bar { text-align: center; font-size: 18px; color: var(--accent); margin: 26px 0 12px; padding: 8px; background: var(--panel2); border-radius: 8px; }
.story { margin: 0; color: #d5d5de; }
.screens { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.screens img { border-radius: 8px; width: 100%; height: auto; }
.embed { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r); overflow: hidden; background: #000; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.soon { text-align: center; color: var(--muted); }
.dls { display: grid; gap: 10px; max-width: 560px; margin: 0 auto; }
.dl { display: block; text-align: center; padding: 12px; border-radius: var(--r); font-weight: 800; color: #000;
  background: linear-gradient(90deg, var(--accent), #ffd45c); }
.dl:hover { filter: brightness(1.08); text-decoration: none; }
.dl small { font-weight: 600; }
.related { margin-top: 10px; }

/* text pages */
.text { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 4px 20px 18px; margin-top: 20px; max-width: 820px; }
.text .sec { margin-left: -20px; }

/* footer */
.foot { margin-top: 40px; background: #050507; border-top: 2px solid var(--accent); color: var(--muted); font-size: 13px; text-align: center; }
.foot .wrap { padding-top: 20px; padding-bottom: 24px; }
.foot nav, .foot .social { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; margin-bottom: 10px; }
.foot a { color: var(--text); }

@media (max-width: 1024px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .navtoggle { display: block; width: 100%; text-align: left; background: none; border: 0; color: var(--text); font: 700 15px var(--font); padding: 12px 0; cursor: pointer; }
  #catmenu { display: none; flex-direction: column; padding-bottom: 8px; }
  #catmenu.show { display: flex; }
  .dd ul { position: static; columns: 2; max-height: none; border: 0; }
  .mhead { grid-template-columns: 1fr; }
  .mposter { max-width: 240px; margin: 0 auto; }
  .brand { font-size: 24px; }
  .search { max-width: none; flex-basis: 100%; }
  .toplinks .wrap { justify-content: center; gap: 12px; }
  .catnav { position: static; }
  .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
  .chips a { flex: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* watch + download pages */
.crumbs { font-size: 13px; color: var(--muted); margin: 16px 0 0; }
.crumbs a { color: var(--muted); }
.watchbox { margin-top: 6px; }
.player { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); }
.player video, .player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.servers { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 6px; }
.servers span { color: var(--muted); font-weight: 600; }
.srv { background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 9px 16px; font: 700 14px var(--font); cursor: pointer; touch-action: manipulation; }
.srv:hover { border-color: var(--accent); }
.srv.on { background: var(--accent); color: #000; border-color: var(--accent); }
.note { color: var(--muted); font-size: 13px; }
.watch { margin: 0 6px 8px 0; }
.watch.alt { background: var(--panel2); border: 1px solid var(--accent2); }
.dlbox { display: grid; grid-template-columns: 140px 1fr; gap: 20px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; margin-top: 16px; }
.dlbox img { border-radius: 8px; width: 140px; height: auto; }
.dlbox h1 { font-size: 20px; margin: 0 0 10px; text-wrap: balance; }
.gate { margin: 16px 0 8px; }
.wait { font-size: 16px; margin: 0; padding: 14px; background: var(--panel2); border-radius: var(--r); text-align: center; }
.wait b { color: var(--accent); font-variant-numeric: tabular-nums; }
.dl.big { font-size: 17px; padding: 15px; }
@media (max-width: 760px) { .dlbox { grid-template-columns: 1fr; } .dlbox img { margin: 0 auto; } }
