/* Fricomic — cinematic streaming-style design system (frimovi-inspired). */
@import url('https://fonts.googleapis.com/css2?family=Russo+One&display=swap');
:root {
  --bg: #05070a;
  --surface: #0c0f15;
  --surface-2: #141922;
  --elev: #1a2029;
  --border: #1f2731;
  --border-soft: #171d26;
  --text: #eef1f6;
  --muted: #8b93a1;
  --muted-2: #5c6472;
  --red: #e50914;
  --red-2: #ff3b46;
  --red-grad: linear-gradient(135deg, #ff2d3f, #e50914);
  --gold: #ffc531;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 10px 40px rgba(0, 0, 0, .55);
  --shadow-red: 0 8px 30px rgba(229, 9, 20, .35);
  --maxw: 1320px;
  --header-h: 64px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; height: auto; }
svg { display: block; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.text-muted { color: var(--muted); }
.text-sm { font-size: 13px; }
.p-4 { padding: 16px; }
::-webkit-scrollbar { height: 8px; width: 8px; }
::-webkit-scrollbar-thumb { background: var(--elev); border-radius: 8px; }

/* ---------------- Header ---------------- */
/* Fixed transparent header -> floating pill on scroll */
body { padding-top: var(--header-h); }
.site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 60; transition: padding .35s cubic-bezier(.4,0,.2,1); }
.header-inner {
  max-width: var(--maxw); margin: 0 auto; height: var(--header-h);
  display: flex; align-items: center; gap: 20px; padding: 0 24px;
  border: 1px solid transparent; border-radius: 0;
  transition: background .35s, backdrop-filter .35s, border-color .35s, border-radius .35s, box-shadow .35s, max-width .4s cubic-bezier(.4,0,.2,1), height .35s, padding .35s;
}
.site-header.scrolled { padding: 12px 16px; }
.site-header.scrolled .header-inner {
  max-width: 1160px; height: 56px; padding: 0 10px 0 24px;
  background: rgba(11,14,20,.72); backdrop-filter: blur(22px) saturate(1.6);
  border-color: rgba(255,255,255,.09); border-radius: 999px;
  box-shadow: 0 14px 40px rgba(0,0,0,.55);
}

/* Wordmark: "Sticker" treatment — white "Fri" + "comic" on a red tag (Russo One).
   Collapses to just "F" on scroll. .lrest keeps overflow:hidden for that collapse,
   so the sticker is kept flat (a drop-shadow would be clipped by that box). */
.brand { display: inline-flex; align-items: baseline; font-family: 'Russo One', system-ui, sans-serif; font-weight: 400; font-size: clamp(21px, 5.6vw, 24px); letter-spacing: 0; line-height: 1; white-space: nowrap; }
.brand .lf { color: #fff; }
.brand .lrest { display: inline-flex; align-items: baseline; overflow: hidden; max-width: 260px; opacity: 1; transition: max-width .45s cubic-bezier(.4,0,.2,1), opacity .3s ease; }
.brand .lri { color: #fff; }
.brand .lcomic { color: #fff; background: var(--red); font-weight: 400; letter-spacing: 0; margin-left: .14em; padding: .05em .22em; border-radius: .18em; }
.site-header.scrolled .brand .lrest { max-width: 0; opacity: 0; }
.footer-brand { font-size: 22px; }

.nav-menu { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav-menu a { padding: 9px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--muted); transition: .15s; }
@media (hover: hover) { .nav-menu a:hover { color: #fff; background: rgba(255,255,255,.07); } }
.nav-menu a.active { color: #fff; background: var(--red-grad); box-shadow: var(--shadow-red); }
.header-inner nav { flex: 1; display: flex; justify-content: center; }
.header-spacer { display: none; }

/* full-bleed heroes sit under the transparent header */
.hero, .detail-hero { margin-top: calc(-1 * var(--header-h)); }
.search-trigger { display: flex; align-items: center; gap: 9px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 9px 16px; color: var(--muted); cursor: pointer; font-size: 13px; min-width: 210px; transition: .15s; }
.search-trigger:hover { border-color: var(--red); color: var(--text); }
.search-trigger svg { width: 15px; height: 15px; fill: currentColor; }
.icon-btn { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.icon-btn svg { width: 18px; height: 18px; fill: currentColor; }
.hamburger { display: none; }

/* ---------------- Buttons ---------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 12px 22px; border-radius: 999px; font-weight: 700; font-size: 14px; cursor: pointer; border: 1px solid transparent; transition: .16s; white-space: nowrap; }
.btn svg { width: 17px; height: 17px; fill: currentColor; }
.btn-red { background: var(--red-grad); color: #fff; box-shadow: var(--shadow-red); }
.btn-red:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-ghost { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.14); color: var(--text); backdrop-filter: blur(6px); }
.btn-ghost:hover { background: rgba(255,255,255,.16); }

/* ---------------- Hero ---------------- */
.hero { position: relative; min-height: 62vh; max-height: 640px; display: flex; align-items: flex-end; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center 20%; transform: scale(1.05); }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(5,7,10,.95) 0%, rgba(5,7,10,.7) 40%, rgba(5,7,10,.25) 70%, rgba(5,7,10,.6) 100%), linear-gradient(0deg, var(--bg) 2%, transparent 45%); }
.hero-inner { position: relative; z-index: 2; padding: 60px 0 52px; max-width: 620px; margin-left: calc((100% - min(100%, var(--maxw))) / 2 + 24px); margin-right: auto; }
.hero-kicker { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--red-2); margin-bottom: 14px; }
.hero-kicker svg { width: 14px; height: 14px; fill: currentColor; }
.hero h1 { font-size: clamp(30px, 5vw, 54px); line-height: 1.02; margin: 0 0 16px; font-weight: 900; letter-spacing: -1.5px; }
.hero-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; padding: 5px 11px; border-radius: 8px; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.1); }
.chip.rating { color: var(--gold); }
.chip.rating svg { width: 12px; height: 12px; fill: var(--gold); }
.hero p { color: #cdd3dd; font-size: 15px; line-height: 1.6; margin: 0 0 24px; max-width: 560px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-dots { position: absolute; z-index: 3; bottom: 22px; right: 28px; display: flex; gap: 7px; }
.hero-dots span { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.3); }
.hero-dots span.on { width: 22px; border-radius: 5px; background: var(--red); }

/* ---------------- Browse / type hero (frimovi-movies style) ---------------- */
.list-hero { position: relative; overflow: hidden; margin-top: calc(-1 * var(--header-h)); min-height: 360px; display: flex; align-items: flex-end; }
.list-hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center 22%; transform: scale(1.06); }
.list-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--bg) 0%, rgba(5,7,10,.86) 42%, rgba(5,7,10,.45) 100%), linear-gradient(0deg, var(--bg) 2%, transparent 62%); }
.list-hero-inner { position: relative; z-index: 2; width: 100%; display: flex; align-items: flex-end; justify-content: space-between; gap: 34px; padding: 122px 0 36px; }
.list-hero-text { max-width: 560px; }
.list-hero-title { font-size: clamp(30px, 5vw, 52px); font-weight: 900; letter-spacing: -1.6px; line-height: 1.02; margin: 6px 0 12px; }
.list-hero-sub { color: #cdd3dd; font-size: 15.5px; line-height: 1.6; max-width: 520px; margin: 0; }
.list-hero-strip { display: flex; gap: 14px; flex: none; }
.list-hero-strip a { display: block; flex: none; }
.list-hero-strip img { width: 108px; height: 162px; object-fit: cover; border-radius: 11px; box-shadow: 0 18px 38px rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.09); transition: transform .25s; }
.list-hero-strip a:hover img { transform: translateY(-6px); }
.list-trending { margin-top: 10px; }
.list-trending .section-title { font-size: 20px; }

@media (max-width: 980px) { .list-hero-strip img { width: 92px; height: 138px; } }
@media (max-width: 760px) {
  .list-hero { min-height: 316px; }
  .list-hero-inner { flex-direction: column-reverse; align-items: flex-start; gap: 16px; padding: 100px 0 24px; }
  .list-hero-strip { align-self: stretch; gap: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .list-hero-strip::-webkit-scrollbar { display: none; }
  .list-hero-strip img { width: 84px; height: 126px; }
}

/* ---------------- Section + horizontal rows ---------------- */
.section { margin: 40px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; gap: 16px; }
.section-title { font-size: 21px; font-weight: 800; letter-spacing: -.4px; display: flex; align-items: center; gap: 11px; }
.section-title::before { content: ""; width: 4px; height: 22px; background: var(--red-grad); border-radius: 3px; }
.section-sub { color: var(--muted); font-size: 13px; margin: 4px 0 0 15px; }
.see-all { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); font-weight: 600; }
.see-all:hover { color: var(--red-2); }
.see-all svg { width: 13px; height: 13px; fill: currentColor; }

.row-wrap { position: relative; }
.row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(184px, 1fr); gap: 18px; overflow-x: auto; scroll-snap-type: x proximity; padding: 4px 2px 8px; scrollbar-width: none; }
.row::-webkit-scrollbar { display: none; }
.row > * { scroll-snap-align: start; }
.row-nav { position: absolute; top: 0; bottom: 30px; width: 52px; display: none; align-items: center; justify-content: center; cursor: pointer; z-index: 4; border: 0; color: #fff; }
.row-nav svg { width: 26px; height: 26px; fill: currentColor; filter: drop-shadow(0 2px 6px rgba(0,0,0,.6)); }
.row-nav.prev { left: -14px; background: linear-gradient(90deg, var(--bg), transparent); }
.row-nav.next { right: -14px; background: linear-gradient(270deg, var(--bg), transparent); }
.row-wrap:hover .row-nav { display: flex; }
@media (hover: none) { .row-nav { display: none !important; } }

/* grid variant (list / search results) */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(184px, 1fr)); gap: 22px 18px; }

/* ---------------- Poster card ---------------- */
.pcard { position: relative; }
.pcard-thumb { position: relative; aspect-ratio: 2 / 3; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); display: block; box-shadow: 0 4px 14px rgba(0,0,0,.4); transition: .2s; }
.pcard-thumb img { width: 100%; height: 100%; object-fit: cover; transition: .35s; }
.pcard:hover .pcard-thumb { transform: translateY(-4px); box-shadow: var(--shadow); outline: 2px solid var(--red); outline-offset: 0; }
.pcard:hover .pcard-thumb img { transform: scale(1.06); }
.pcard-badge { position: absolute; top: 8px; left: 8px; font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; padding: 3px 8px; border-radius: 6px; background: rgba(0,0,0,.7); backdrop-filter: blur(4px); }
.pcard-badge.manhwa { color: #52e39b; } .pcard-badge.manhua { color: #5ab0ff; } .pcard-badge.manga { color: var(--gold); } .pcard-badge.novel { color: #c58bff; } .pcard-badge.mangatoon { color: #ff8fb0; }
.pcard-rate { position: absolute; bottom: 8px; left: 8px; display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 800; padding: 4px 8px; border-radius: 6px; background: rgba(0,0,0,.78); color: var(--gold); }
.pcard-rate svg { width: 11px; height: 11px; fill: var(--gold); }
.pcard-play { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: .2s; }
.pcard-play span { width: 52px; height: 52px; border-radius: 50%; background: var(--red-grad); display: grid; place-items: center; box-shadow: var(--shadow-red); }
.pcard-play svg { width: 22px; height: 22px; fill: #fff; margin-left: 3px; }
.pcard:hover .pcard-play { opacity: 1; }
.pcard-title { margin-top: 9px; font-size: 13.5px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.pcard-meta { margin-top: 3px; font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.pcard-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted-2); }

/* ---------------- Top 10 (movy.sx style) ---------------- */
.top10-row { display: flex; gap: 16px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; scroll-snap-type: x proximity; }
.top10-row::-webkit-scrollbar { display: none; }
.top10-row > * { flex: 0 0 auto; scroll-snap-align: start; }
.top-badge { position: absolute; top: 10px; left: 10px; z-index: 4; background: var(--red); color: #fff; border-radius: 9px; padding: 4px 9px 5px; text-align: center; line-height: 1; box-shadow: 0 3px 12px rgba(0,0,0,.55); }
.top-badge small { display: block; font-size: 8px; font-weight: 800; letter-spacing: 1.3px; opacity: .92; }
.top-badge b { display: block; font-size: 16px; font-weight: 900; margin-top: 1px; }
.t10-feature { width: min(74vw, 580px); }
.t10-feature-card { position: relative; display: block; height: 300px; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); box-shadow: 0 8px 26px rgba(0,0,0,.45); }
.t10-feature-bg { position: absolute; inset: 0; background-size: cover; background-position: center; transition: transform .5s; }
.t10-feature-card:hover .t10-feature-bg { transform: scale(1.05); }
.t10-feature-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(5,7,10,.96) 0%, rgba(5,7,10,.55) 48%, rgba(5,7,10,.1) 100%), linear-gradient(0deg, rgba(5,7,10,.92), transparent 55%); }
.t10-feature-body { position: absolute; left: 26px; right: 26px; bottom: 24px; z-index: 2; }
.t10-feature-body h3 { font-size: 27px; font-weight: 900; letter-spacing: -.7px; margin: 0 0 8px; line-height: 1.05; }
.t10-feature-genres { color: var(--muted); font-size: 13px; margin-bottom: 15px; }
.t10-feature-btn { padding: 11px 22px; font-size: 13px; }
.t10-card { width: 200px; }
.t10-thumb { height: 300px; aspect-ratio: auto; }
.t10-card .pcard-title { margin-top: 10px; }
.rate-mini { display: inline-flex; align-items: center; gap: 3px; color: var(--gold); font-weight: 700; }
.rate-mini svg { width: 11px; height: 11px; fill: var(--gold); }

/* ---------------- Category circles ---------------- */
.cats { display: grid; grid-auto-flow: column; grid-auto-columns: max-content; gap: 20px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cat { display: flex; flex-direction: column; align-items: center; gap: 9px; width: 88px; }
.cat-img { width: 84px; height: 84px; border-radius: 50%; overflow: hidden; border: 2px solid var(--border); transition: .18s; background: var(--surface-2); position: relative; }
.cat-img img { width: 100%; height: 100%; object-fit: cover; opacity: .82; }
.cat-img::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 120%, rgba(229,9,20,.35), transparent 70%); }
.cat:hover .cat-img { border-color: var(--red); transform: translateY(-3px); }
.cat-label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.cat:hover .cat-label { color: var(--text); }

/* ---------------- Single manga ---------------- */
.detail-hero { position: relative; margin-bottom: 30px; }
.detail-bg { position: absolute; inset: 0; height: 480px; background-size: cover; background-position: center 20%; }
.detail-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--bg) 0%, rgba(5,7,10,.8) 40%, rgba(5,7,10,.5) 72%, rgba(5,7,10,.7) 100%), linear-gradient(0deg, var(--bg) 4%, rgba(5,7,10,.35) 42%, transparent 78%); }
.detail-inner { position: relative; z-index: 2; display: grid; grid-template-columns: 250px 1fr; gap: 40px; padding-top: 158px; padding-bottom: 6px; align-items: start; }
.detail-poster { position: relative; }
.detail-poster img { width: 100%; border-radius: 14px; box-shadow: 0 24px 55px rgba(0,0,0,.6); border: 1px solid rgba(255,255,255,.08); display: block; }
.poster-views { position: absolute; top: 10px; right: 10px; z-index: 2; display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; background: rgba(5,7,10,.72); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.14); border-radius: 999px; color: #fff; font-size: 12px; font-weight: 700; box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.poster-views svg { width: 13px; height: 13px; fill: var(--red-2); }
.detail-actions { display: flex; flex-direction: row; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.detail-actions .btn { width: auto; min-width: 148px; }
.detail-meta-sub { display: flex; flex-wrap: wrap; gap: 10px 30px; margin: 20px 0 2px; font-size: 13.5px; color: #b9bfcb; }
.detail-meta-sub .k { color: var(--muted); margin-right: 8px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; }
.detail-title { font-size: clamp(26px, 4vw, 40px); font-weight: 900; letter-spacing: -1px; margin: 0 0 6px; }
.detail-alt { color: var(--muted); font-size: 13.5px; margin-bottom: 14px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.detail-info { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 26px; margin: 18px 0; font-size: 14px; max-width: 560px; }
.detail-info .k { color: var(--muted); }
.genre-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.genre-tags a { font-size: 12.5px; font-weight: 600; padding: 6px 13px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; }
.genre-tags a:hover { border-color: var(--red); color: var(--red-2); }
.synopsis { color: #c8ccd6; font-size: 15px; line-height: 1.75; max-width: 820px; margin: 8px 0 2px; }
.synopsis p { margin: 0 0 10px; }

.chapter-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 20px; margin: 26px 0; }
.chapter-panel h3 { margin: 0 0 16px; font-size: 18px; display: flex; align-items: center; gap: 10px; }
.chapter-panel h3 svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.chapter-search { width: 100%; padding: 11px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; color: var(--text); margin-bottom: 12px; outline: none; }
.chapter-search:focus { border-color: var(--red); }
.chapter-pager { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.ch-page-btn { display: inline-flex; align-items: center; gap: 4px; padding: 9px 13px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.ch-page-btn:hover:not(:disabled) { border-color: var(--red); }
.ch-page-btn:disabled { opacity: .38; cursor: default; }
.ch-page-btn svg { width: 14px; height: 14px; fill: currentColor; }
.ch-page-select { flex: 1; min-width: 0; padding: 9px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-size: 13px; font-weight: 700; text-align: center; text-align-last: center; cursor: pointer; }
.ch-page-select:focus { border-color: var(--red); outline: none; }
.chapter-rows { display: flex; flex-direction: column; gap: 7px; max-height: 620px; overflow-y: auto; }
.chapter-rows a { display: flex; justify-content: space-between; align-items: center; padding: 12px 15px; background: var(--surface-2); border: 1px solid transparent; border-radius: 10px; font-size: 14px; font-weight: 500; transition: .13s; }
.chapter-rows a:hover { border-color: var(--red); color: var(--red-2); transform: translateX(3px); }
.chapter-rows .time { font-size: 11.5px; color: var(--muted); }

/* ---------------- Reader ---------------- */
.reader-bar { position: sticky; top: var(--header-h); z-index: 40; background: rgba(5,7,10,.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border-soft); padding: 11px 0; }
.reader-bar-inner { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.reader-bar select { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; font-size: 13px; max-width: 240px; font-weight: 600; }
.nav-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 15px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; font-weight: 600; font-size: 13px; line-height: 1; box-sizing: border-box; font-family: inherit; }
.nav-btn svg { width: 15px; height: 15px; fill: currentColor; }
.nav-btn.red { background: var(--red-grad); border-color: transparent; color: #fff; }
.nav-btn:hover { border-color: var(--red); }
.nav-btn.disabled { opacity: .4; pointer-events: none; }
/* current-chapter button: active (red) state, not muted */
.nav-btn.current-ch { background: rgba(229,9,20,.14); border-color: var(--red); color: var(--red-2); font-weight: 700; }
.nav-btn.current-ch svg { fill: var(--red-2); }
.nav-btn.current-ch:hover { background: rgba(229,9,20,.24); border-color: var(--red); }
.reader-title { text-align: center; padding: 24px 0 16px; font-size: 20px; font-weight: 800; letter-spacing: -.4px; }
.reader-images { max-width: 860px; margin: 0 auto; background: #000; }
.reader-images img { width: 100%; height: auto; display: block; }
.reader-tools { position: fixed; right: 20px; bottom: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 45; }
.reader-tools button { width: 46px; height: 46px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); cursor: pointer; box-shadow: var(--shadow); display: grid; place-items: center; }
.reader-tools button svg { width: 18px; height: 18px; fill: currentColor; }
.reader-tools button:hover { border-color: var(--red); color: var(--red-2); }

/* Reader: auto-hide the two top bars while reading (show on scroll up / at top) */
.page-reader .site-header, #reader-topbar { transition: transform .32s ease; }
body.reader-hidden .site-header { transform: translateY(-100%); }
body.reader-hidden #reader-topbar { transform: translateY(calc(-100% - var(--header-h))); }

/* Chapter picker modal (opens on the reader page, no redirect) */
.ch-modal { position: fixed; inset: 0; z-index: 110; display: none; }
.ch-modal.open { display: block; }
.ch-modal .modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.72); backdrop-filter: blur(6px); }
.ch-modal-panel { position: relative; max-width: 640px; margin: 7vh auto 0; padding: 0 16px; height: 82vh; display: flex; flex-direction: column; }
.ch-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 12px; font-size: 18px; font-weight: 800; }
.ch-jump { width: 100%; padding: 13px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; color: var(--text); font-size: 15px; outline: none; margin-bottom: 12px; box-shadow: var(--shadow); }
.ch-jump:focus { border-color: var(--red); }
.ch-modal-list { flex: 1; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 8px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); }
.ch-modal-list a { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; background: var(--surface-2); border: 1px solid transparent; border-radius: 10px; font-size: 14px; font-weight: 600; }
.ch-modal-list a:hover { border-color: var(--red); color: var(--red-2); }
.ch-modal-list a.current { background: var(--red-grad); color: #fff; border-color: transparent; }
.ch-modal-list a.current::after { content: "Reading"; font-size: 11px; font-weight: 700; opacity: .92; }

/* ---------------- Search modal (centered overlay) ---------------- */
.modal { position: fixed; inset: 0; z-index: 100; display: none; }
.modal.open { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.72); backdrop-filter: blur(6px); }
.modal-panel { position: relative; max-width: 700px; margin: 9vh auto 0; padding: 0 16px; }
.modal-search { display: flex; align-items: center; gap: 12px; padding: 0 8px 0 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); }
.modal-search:focus-within { border-color: var(--red); box-shadow: 0 0 0 3px rgba(229,9,20,.16), var(--shadow); }
.modal-search > svg { width: 19px; height: 19px; fill: var(--muted); flex: none; }
.modal-search input { flex: 1; padding: 16px 0; background: transparent; border: 0; color: var(--text); font-size: 16px; outline: none; }
.search-close { background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; cursor: pointer; flex: none; }
.search-close:hover { color: var(--text); border-color: var(--red); }
.search-close svg { width: 15px; height: 15px; fill: currentColor; }
.search-cats { display: flex; gap: 8px; margin: 13px 2px; overflow-x: auto; scrollbar-width: none; }
.search-cats::-webkit-scrollbar { display: none; }
.scat { padding: 8px 15px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: .14s; }
.scat:hover { color: var(--text); }
.scat.active { background: var(--red-grad); color: #fff; border-color: transparent; }
#searchModalContent { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; max-height: 56vh; overflow-y: auto; box-shadow: var(--shadow); }
#searchModalContent:empty { display: none; }
.trending-head { display: flex; align-items: center; gap: 8px; padding: 15px 16px 8px; font-size: 12px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--red-2); }
.trending-head svg { width: 14px; height: 14px; fill: var(--red-2); }
.search-results { list-style: none; margin: 0; padding: 6px; }
.search-item { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 11px; }
.search-item:hover { background: var(--surface-2); }
.search-item > img { width: 46px; height: 64px; object-fit: cover; border-radius: 7px; flex: none; }
.si-body { flex: 1; min-width: 0; }
.si-title { font-weight: 700; font-size: 15px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.si-meta { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.si-meta .r { color: var(--red-2); font-weight: 700; display: inline-flex; align-items: center; gap: 3px; }
.si-meta .r svg { width: 11px; height: 11px; fill: var(--gold); }
.si-chevron { color: var(--muted-2); flex: none; display: flex; }
.si-chevron svg { width: 18px; height: 18px; fill: currentColor; }

/* reading settings modal */
#chapter-options-modal { position: fixed; inset: 0; z-index: 100; display: none; }
#chapter-options-modal.open { display: block; }
#chapter-options-modal .op-panel { position: relative; max-width: 440px; margin: 12vh auto 0; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 22px; }
.op-panel label { display: block; font-size: 13px; margin: 12px 0 5px; color: var(--muted); }
.op-panel input, .op-panel select { width: 100%; padding: 10px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); border-radius: 9px; }
.op-panel input[type=checkbox] { width: auto; }

/* ---------------- List filters ---------------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px; margin-bottom: 22px; }
.filters input, .filters select { padding: 10px 13px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); border-radius: 10px; font-size: 14px; }
.filters input { flex: 1; min-width: 200px; }

/* ---------------- Footer ---------------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); margin-top: 60px; padding: 44px 0 100px; }
.footer-top { display: flex; justify-content: space-between; gap: 34px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); font-size: 13.5px; }
.footer-links a:hover { color: var(--red-2); }
.footer-note { color: var(--muted); font-size: 12.5px; margin-top: 16px; line-height: 1.7; }
.age-badge { display: inline-block; border: 1px solid var(--red); color: var(--red-2); border-radius: 6px; padding: 1px 7px; font-size: 11px; font-weight: 800; }

/* ---------------- Mobile bottom nav ---------------- */
.mobile-nav { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 70; background: rgba(5,7,10,.96); backdrop-filter: blur(12px); border-top: 1px solid var(--border); grid-template-columns: repeat(5, 1fr); }
.mobile-nav a { padding: 9px 0 8px; text-align: center; font-size: 10px; white-space: nowrap; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 3px; }
.mobile-nav a svg { width: 20px; height: 20px; fill: currentColor; }
.mobile-nav a.active { color: var(--red-2); }

/* ---------------- Pagination / load more ---------------- */
.load-more { display: block; margin: 30px auto; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1024px) { .detail-inner { grid-template-columns: 210px 1fr; gap: 30px; } }
@media (max-width: 760px) {
  .container { padding: 0 16px; }
  .nav-menu, .search-trigger span { display: none; }
  .hamburger { display: grid; }
  .mobile-nav { display: grid; }
  .hero { min-height: 56vh; }
  .hero-inner { padding: 40px 16px; max-width: 100%; margin-left: 0; margin-right: 0; text-align: center; }
  .hero-inner .hero-kicker, .hero-inner .hero-meta, .hero-inner .hero-actions { justify-content: center; }
  .hero-inner p { margin-left: auto; margin-right: auto; }
  .detail-hero .detail-bg { height: 340px; }
  .detail-inner { grid-template-columns: 1fr; padding-top: 118px; gap: 22px; }
  .detail-poster { max-width: 210px; margin: 0 auto; }
  .detail-info-col { text-align: center; }
  .detail-meta, .genre-tags, .detail-meta-sub { justify-content: center; }
  .synopsis { margin-left: auto; margin-right: auto; }
  .detail-actions { flex-direction: column; align-items: center; }
  .detail-actions .btn { width: 100%; min-width: 0; }
  .detail-info { grid-template-columns: 1fr; }
  .row { grid-auto-columns: minmax(150px, 1fr); gap: 13px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px 12px; }
  .t10-feature { width: 82vw; }
  .t10-feature-card { height: 220px; }
  .t10-feature-body h3 { font-size: 20px; }
  .t10-feature-body { left: 18px; right: 18px; bottom: 16px; }
  .t10-card { width: 148px; }
  .t10-thumb { height: 222px; }
  .modal-panel { margin-top: 6vh; padding: 0 12px; }
  .modal-search input { font-size: 16px; }
  #searchModalContent { max-height: 62vh; }
  .page-reader .reader-tools { display: none; }
  /* clean single-row reader bar on mobile */
  #reader-topbar { padding: 9px 0; }
  #reader-topbar #chapter-select { display: none; }
  .reader-bar-inner { flex-wrap: nowrap; gap: 8px; justify-content: space-between; }
  .reader-bar .nav-btn { padding: 9px 13px; font-size: 12.5px; white-space: nowrap; flex: 1; justify-content: center; max-width: 33%; }
  #open-chapters, #open-chapters-2 { flex: 1.6; max-width: 44%; }
  .reader-title { font-size: 16px; padding: 16px 0 12px; }
  .ch-modal-panel { margin-top: 4vh; height: 90vh; padding: 0 12px; }
  .nav-menu.open { display: flex; position: absolute; top: var(--header-h); left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 4px; background: var(--surface); padding: 14px 12px; border-bottom: 1px solid var(--border); box-shadow: 0 16px 40px rgba(0,0,0,.5); }
  .nav-menu.open li { width: 100%; }
  .nav-menu.open a { display: block; text-align: center; padding: 12px; }
}


/* Top-10 #1 feature: short synopsis under the genres (filled by app.js) */
.t10-feature-syn { color: var(--muted); font-size: 13.5px; line-height: 1.5; margin: 0 0 14px; max-width: 48ch; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-shadow: 0 1px 10px rgba(0,0,0,.55); }
.t10-feature-syn:empty { display: none; }
@media (max-width: 640px) { .t10-feature-syn { font-size: 12px; -webkit-line-clamp: 3; margin-bottom: 10px; } }
