/* =====================================================
   KomikZone — "Obsidian" Design System
   Deep blue-black surfaces · violet-fuchsia accents
   · ambient glows · glass navigation · pill controls
   ===================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Surfaces — cool obsidian, not flat gray */
  --bg: #0a0a12;
  --bg2: #0e0e19;
  --bg3: #14141f;
  --bg4: #1a1a29;
  --bg5: #222234;
  --border: rgba(255, 255, 255, 0.06);
  --border2: rgba(255, 255, 255, 0.11);

  /* Accents */
  --purple: #8b5cf6;
  --purple2: #a78bfa;
  --pink: #d946ef;
  --blue: #38bdf8;
  --green: #34d399;
  --yellow: #fbbf24;
  --red: #f87171;
  --orange: #fb923c;

  --grad: linear-gradient(135deg, #7c5cff 0%, #a44df0 55%, #e04fd8 100%);
  --grad-soft: linear-gradient(135deg, rgba(124, 92, 255, .16), rgba(224, 79, 216, .12));

  /* Text */
  --txt: #eef0f8;
  --txt2: #9ba0b8;
  --txt3: #64687f;
  --white: #fff;

  /* Chrome metrics (JS depends on these) */
  --nav-h: 108px;
  --bnav-h: 60px;

  /* Radii */
  --r: 10px;
  --r2: 14px;
  --r3: 18px;
  --rf: 9999px;

  /* Elevation */
  --sh: 0 8px 32px rgba(0, 0, 0, .45);
  --sh2: 0 16px 48px rgba(0, 0, 0, .65);
  --t: .18s ease;
  --t2: .3s cubic-bezier(.4, 0, .2, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--txt);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Ambient depth glows — fixed layer behind all content */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(52rem 30rem at 12% -6%, rgba(124, 92, 255, .13), transparent 60%),
    radial-gradient(44rem 26rem at 96% 4%, rgba(224, 79, 216, .07), transparent 60%),
    radial-gradient(60rem 40rem at 50% 118%, rgba(56, 189, 248, .05), transparent 60%);
}

::selection {
  background: rgba(124, 92, 255, .45);
  color: #fff;
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: #2a2a3d;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--purple);
}

/* ============ NAVBAR ============ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10, 10, 18, .72);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border-bottom: 1px solid var(--border);
  transition: background var(--t2), box-shadow var(--t2);
}

.navbar.solid {
  background: rgba(9, 9, 16, .92);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .5), 0 1px 0 rgba(255, 255, 255, .04) inset;
}

.nav-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-logo {
  flex-shrink: 0;
  filter: drop-shadow(0 2px 10px rgba(139, 92, 246, .45));
}

.brand-name {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: .2px;
  background: linear-gradient(120deg, #b4a0ff 0%, #d67ef2 60%, #f0a0e8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Search — glass pill */
.nav-search {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, .045);
  border: 1px solid var(--border2);
  border-radius: var(--rf);
  padding: 0 14px;
  height: 40px;
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
}

.nav-search:focus-within {
  border-color: rgba(139, 92, 246, .65);
  background: rgba(255, 255, 255, .07);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, .14);
}

.nav-search svg {
  color: var(--txt3);
  flex-shrink: 0;
}

#q {
  flex: 1;
  background: none;
  border: none;
  color: var(--txt);
  font-family: inherit;
  font-size: .875rem;
  outline: none;
}

#q::placeholder {
  color: var(--txt3);
}

.nav-search kbd {
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--border2);
  border-radius: 5px;
  padding: 1px 6px;
  font-family: inherit;
  font-size: .65rem;
  color: var(--txt3);
  flex-shrink: 0;
}

/* Search dropdown */
.search-drop {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  background: rgba(18, 18, 30, .96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border2);
  border-radius: var(--r2);
  box-shadow: var(--sh2);
  display: none;
  z-index: 2000;
  overflow: hidden;
  max-height: 440px;
  overflow-y: auto;
}

.search-drop.open {
  display: block;
  animation: fadeUp .22s ease;
}

.sd-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background var(--t);
}

.sd-row:last-child {
  border-bottom: none;
}

.sd-row:hover {
  background: rgba(124, 92, 255, .1);
}

.sd-img {
  width: 38px;
  height: 52px;
  object-fit: cover;
  border-radius: 7px;
  flex-shrink: 0;
  background: var(--bg5);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .5);
}

.sd-name {
  font-size: .82rem;
  font-weight: 600;
  color: var(--txt);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sd-sub {
  font-size: .7rem;
  color: var(--txt3);
  text-transform: uppercase;
  letter-spacing: .4px;
}

.sd-sc {
  font-size: .72rem;
  font-weight: 700;
  color: var(--yellow);
  white-space: nowrap;
}

/* Nav actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--txt2);
  border-radius: 2px;
}

/* Nav tabs — pill segmented row */
.nav-tabs {
  max-width: 960px;
  margin: 0 auto;
  padding: 6px 1.25rem 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-tabs::-webkit-scrollbar {
  display: none;
}

.ntab {
  padding: 6px 15px;
  color: var(--txt2);
  text-decoration: none;
  font-size: .78rem;
  font-weight: 600;
  border-radius: var(--rf);
  border: 1px solid transparent;
  transition: all var(--t);
  white-space: nowrap;
  cursor: pointer;
}

.ntab:hover {
  color: var(--txt);
  background: rgba(255, 255, 255, .05);
}

.ntab.active {
  color: var(--white);
  background: var(--grad);
  box-shadow: 0 4px 16px rgba(124, 92, 255, .35);
}

/* Mobile menu */
.mmenu {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  background: rgba(10, 10, 18, .97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border2);
  z-index: 990;
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: .75rem;
  animation: fadeUp .22s ease;
}

.mmenu.open {
  display: flex;
}

.mlink {
  padding: 12px 16px;
  border-radius: var(--r);
  color: var(--txt2);
  text-decoration: none;
  font-weight: 600;
  font-size: .9rem;
  transition: all var(--t);
  cursor: pointer;
}

.mlink:hover,
.mlink.active {
  color: var(--white);
  background: var(--grad-soft);
  border: 1px solid rgba(139, 92, 246, .25);
}

/* Notice bar */
.notice-bar {
  margin-top: var(--nav-h);
  background: linear-gradient(90deg, rgba(124, 92, 255, .14), rgba(224, 79, 216, .08));
  border-bottom: 1px solid rgba(124, 92, 255, .22);
  padding: 7px 1.25rem;
  font-size: .79rem;
  color: #c9c9dd;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.notice-label {
  color: #ff8fa8;
  font-weight: 800;
  background: rgba(248, 113, 113, .12);
  border: 1px solid rgba(248, 113, 113, .3);
  border-radius: 6px;
  padding: 1px 8px;
  font-size: .66rem;
  letter-spacing: .5px;
  text-transform: uppercase;
  flex-shrink: 0;
  white-space: nowrap;
}

.notice-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notice-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--txt3);
  cursor: pointer;
  font-size: .9rem;
  transition: color var(--t);
  padding: 2px 5px;
  line-height: 1;
}

.notice-close:hover {
  color: var(--txt);
}

.notice-bar.gone {
  display: none;
}

/* ============ MAIN ============ */
#main {
  max-width: 1200px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: 1rem;
}

@media (max-width: 768px) {
  #main {
    padding-bottom: calc(var(--bnav-h) + .75rem);
  }
}

.pg {
  display: none;
  animation: fadeUp .3s cubic-bezier(.4, 0, .2, 1);
}

.pg.active {
  display: block;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

/* ============ FEATURED SLIDER ============ */
.featured {
  position: relative;
  overflow: hidden;
  height: 490px;
  background: var(--bg2);
  user-select: none;
}

.featured::after {
  /* fade slider bottom into page background */
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 60px;
  background: linear-gradient(0deg, var(--bg), transparent);
  z-index: 4;
  pointer-events: none;
}

.feat-slides {
  display: flex;
  height: 100%;
  transition: transform .55s cubic-bezier(.25, .46, .45, .94);
}

.feat-slide {
  flex: 0 0 100%;
  height: 100%;
  position: relative;
  cursor: pointer;
  opacity: .35;
  transition: opacity .55s ease;
}

.feat-slide.active {
  opacity: 1;
}

.feat-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  filter: brightness(.34) saturate(1.15);
}

.feat-slide.active .feat-bg {
  animation: kenburns 9s ease-out forwards;
}

@keyframes kenburns {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}

.feat-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(10, 10, 18, .96) 20%, rgba(10, 10, 18, .5) 45%, transparent 72%),
    linear-gradient(0deg, rgba(10, 10, 18, 1) 0%, rgba(10, 10, 18, .3) 34%, transparent 55%);
  pointer-events: none;
}

.feat-body {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 1280px;
  margin: 0 auto;
  padding: 2.5rem 1.75rem 2.5rem;
  display: flex;
  gap: 1.4rem;
  align-items: flex-end;
  z-index: 3;
}

.feat-cover {
  width: 132px;
  height: 190px;
  border-radius: var(--r2);
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 20px 55px rgba(0, 0, 0, .85), 0 0 40px rgba(124, 92, 255, .14);
  border: 1px solid rgba(255, 255, 255, .16);
  background: var(--bg4);
  opacity: 0;
  transition: opacity .5s ease;
}

.feat-cover.ld {
  opacity: 1;
}

.feat-info {
  flex: 1;
  min-width: 0;
}

.feat-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.tag {
  padding: 3px 9px;
  border-radius: 6px;
  font-size: .63rem;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.t-manga {
  background: rgba(124, 92, 255, .22);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, .35);
}

.t-manhwa {
  background: rgba(224, 79, 216, .18);
  color: #f0abfc;
  border: 1px solid rgba(224, 79, 216, .32);
}

.t-manhua {
  background: rgba(56, 189, 248, .16);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, .3);
}

.t-novel {
  background: rgba(251, 191, 36, .14);
  color: #fcd34d;
  border: 1px solid rgba(251, 191, 36, .26);
}

.t-genre {
  background: rgba(255, 255, 255, .08);
  color: #b6b9cc;
  border: 1px solid rgba(255, 255, 255, .1);
}

.t-on {
  background: rgba(52, 211, 153, .14);
  color: #6ee7b7;
  border: 1px solid rgba(52, 211, 153, .28);
}

.t-end {
  background: rgba(255, 255, 255, .05);
  color: #8b8fa5;
  border: 1px solid rgba(255, 255, 255, .08);
}

.t-score {
  background: rgba(251, 191, 36, .13);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, .24);
}

.feat-title {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 900;
  color: var(--white);
  line-height: 1.12;
  letter-spacing: .2px;
  margin-bottom: 9px;
  text-shadow: 0 4px 24px rgba(0, 0, 0, .6);
}

.feat-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.feat-score {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .92rem;
  font-weight: 800;
  color: var(--yellow);
}

.feat-mi {
  font-size: .77rem;
  color: var(--txt2);
}

.feat-syn {
  font-size: .82rem;
  color: var(--txt2);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 540px;
  margin-bottom: 16px;
}

.feat-btns {
  display: flex;
  gap: 10px;
}

.btn-primary {
  padding: 10px 22px;
  border: none;
  border-radius: var(--rf);
  background: var(--grad);
  color: #fff;
  font-size: .84rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--t2);
  box-shadow: 0 6px 24px rgba(124, 92, 255, .45);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(124, 92, 255, .6);
}

.btn-primary:active {
  transform: translateY(0) scale(.97);
}

.btn-ghost {
  padding: 10px 18px;
  border-radius: var(--rf);
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .15);
  color: var(--txt);
  font-size: .84rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--t);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, .14);
  border-color: rgba(255, 255, 255, .25);
}

/* Slider controls */
.feat-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(10, 10, 18, .5);
  border: 1px solid rgba(255, 255, 255, .14);
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: all var(--t);
  z-index: 5;
}

.feat-arrow.left {
  left: 14px;
}

.feat-arrow.right {
  right: 14px;
}

.feat-arrow:hover {
  background: rgba(124, 92, 255, .85);
  border-color: rgba(139, 92, 246, .9);
  box-shadow: 0 4px 20px rgba(124, 92, 255, .5);
}

.feat-dots {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 5;
}

.fdot {
  width: 7px;
  height: 7px;
  border-radius: var(--rf);
  background: rgba(255, 255, 255, .3);
  border: none;
  cursor: pointer;
  transition: all var(--t2);
}

.fdot.on {
  background: linear-gradient(90deg, #a78bfa, #e879f9);
  width: 22px;
  box-shadow: 0 0 12px rgba(167, 139, 250, .7);
}

/* Genre quick-strip below hero */
.genre-strip {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.genre-strip::-webkit-scrollbar {
  display: none;
}

.genre-strip-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.75rem;
  display: flex;
  gap: 8px;
  width: max-content;
}

.gs-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  border-radius: var(--rf);
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--border);
  color: var(--txt2);
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--t);
}

.gs-chip:hover {
  border-color: rgba(139, 92, 246, .55);
  color: var(--txt);
  background: rgba(124, 92, 255, .12);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(124, 92, 255, .2);
}

/* ============ HOME LAYOUT ============ */
.home-layout {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 0 1.75rem;
  padding: 0 1.75rem;
  align-items: start;
}

.home-layout .home-blk {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}

.home-main,
.home-side {
  min-width: 0;
}

/* Sidebar */
.home-side {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding-top: 2rem;
  position: sticky;
  top: calc(var(--nav-h) + 12px);
}

.side-widget {
  background: linear-gradient(180deg, rgba(255, 255, 255, .025), transparent 40%), var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  padding: 1.1rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, .25);
}

.sw-head {
  font-family: 'Outfit', sans-serif;
  font-size: .95rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: .9rem;
  position: relative;
  padding-bottom: .6rem;
  letter-spacing: .2px;
}

.sw-head::before {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 40px;
  height: 3px;
  border-radius: 3px;
  background: var(--grad);
  box-shadow: 0 2px 10px rgba(124, 92, 255, .5);
}

.sw-head::after {
  content: '';
  position: absolute;
  left: 44px;
  right: 0;
  bottom: calc(.6rem - 1px);
  height: 1px;
  background: var(--border);
}

/* Popular Series tabs — segmented control */
.wpop-tabs {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, .35);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 4px;
  margin-bottom: .6rem;
}

.wtab {
  flex: 1;
  padding: 6px 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--txt2);
  font-size: .74rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--t);
}

.wtab:hover {
  color: var(--txt);
}

.wtab.active {
  background: var(--grad);
  color: var(--white);
  box-shadow: 0 3px 12px rgba(124, 92, 255, .4);
}

/* Ranked list item */
.wpop-item {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 9px 6px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  border-radius: var(--r);
  transition: background var(--t), transform var(--t);
}

.wpop-item:last-child {
  border-bottom: none;
}

.wpop-item:hover {
  background: rgba(124, 92, 255, .07);
  transform: translateX(3px);
}

.wp-rank {
  width: 22px;
  flex-shrink: 0;
  text-align: center;
  font-family: 'Outfit', sans-serif;
  font-size: .85rem;
  font-weight: 800;
  color: var(--txt3);
}

.wp-rank.top {
  color: transparent;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 8px rgba(124, 92, 255, .5));
}

.wp-thumb {
  width: 44px;
  height: 58px;
  border-radius: 8px;
  flex-shrink: 0;
  overflow: hidden;
  background: linear-gradient(110deg, var(--bg3) 30%, var(--bg5) 45%, var(--bg3) 60%);
  background-size: 220% 100%;
  animation: kcshimmer 1.5s linear infinite;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .4);
}

.wp-thumb.loaded,
.wp-thumb.noimg {
  animation: none;
  background: var(--bg4);
}

.wp-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity .4s ease;
}

.wp-thumb.loaded img {
  opacity: 1;
}

.wp-info {
  flex: 1;
  min-width: 0;
}

.wp-title {
  font-size: .78rem;
  font-weight: 700;
  color: var(--txt);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wpop-item:hover .wp-title {
  color: var(--purple2);
}

.wp-genres {
  font-size: .64rem;
  color: var(--txt3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.wp-rating {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
}

.wp-bar {
  flex: 1;
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .07);
  overflow: hidden;
}

.wp-bar i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--grad);
  box-shadow: 0 0 8px rgba(124, 92, 255, .6);
}

.wp-score {
  font-size: .68rem;
  font-weight: 800;
  color: var(--yellow);
  flex-shrink: 0;
}

/* New Series list */
.ns-item {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 9px 6px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  border-radius: var(--r);
  transition: background var(--t), transform var(--t);
}

.ns-item:last-child {
  border-bottom: none;
}

.ns-item:hover {
  background: rgba(124, 92, 255, .07);
  transform: translateX(3px);
}

.ns-thumb {
  width: 44px;
  height: 58px;
  border-radius: 8px;
  flex-shrink: 0;
  overflow: hidden;
  background: linear-gradient(110deg, var(--bg3) 30%, var(--bg5) 45%, var(--bg3) 60%);
  background-size: 220% 100%;
  animation: kcshimmer 1.5s linear infinite;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .4);
}

.ns-thumb.loaded,
.ns-thumb.noimg {
  animation: none;
  background: var(--bg4);
}

.ns-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity .4s ease;
}

.ns-thumb.loaded img {
  opacity: 1;
}

.ns-info {
  flex: 1;
  min-width: 0;
}

.ns-title {
  font-size: .78rem;
  font-weight: 700;
  color: var(--txt);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ns-item:hover .ns-title {
  color: var(--purple2);
}

.ns-meta {
  font-size: .64rem;
  color: var(--txt3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* Sidebar genres */
.side-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.sg-link {
  padding: 5px 12px;
  border-radius: var(--rf);
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--border);
  color: var(--txt2);
  font-size: .7rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--t);
}

.sg-link:hover {
  border-color: rgba(139, 92, 246, .55);
  color: var(--txt);
  background: rgba(124, 92, 255, .12);
  transform: translateY(-1px);
}

/* Sidebar skeleton + empty */
.sw-skel {
  height: 58px;
  border-radius: var(--r);
  margin-bottom: 10px;
  background: linear-gradient(90deg, var(--bg3) 25%, var(--bg4) 50%, var(--bg3) 75%);
  background-size: 200% 100%;
  animation: swshimmer 1.4s infinite;
}

@keyframes swshimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.sw-empty {
  padding: 1rem 0;
  text-align: center;
  font-size: .74rem;
  color: var(--txt3);
}

/* Collapse sidebar to single column on smaller screens */
@media (max-width: 1024px) {
  .home-layout {
    grid-template-columns: minmax(0, 1fr);
    padding: 0;
  }

  .home-layout .home-blk {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .home-side {
    position: static;
    padding: 0 1rem 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
  }
}

/* minmax(0,…) agar track tidak melebar karena judul nowrap di dalam widget */
@media (max-width: 768px) {
  .home-side {
    grid-template-columns: minmax(0, 1fr);
  }
}

.home-blk {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.75rem;
}

/* Section headers */
.blk-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.1rem;
  position: relative;
}

.blk-head::before {
  content: '';
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 48px;
  height: 3px;
  border-radius: 3px;
  background: var(--grad);
  box-shadow: 0 2px 12px rgba(124, 92, 255, .6);
}

.blk-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: .2px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(52, 211, 153, .8);
  animation: blink 2s infinite;
  flex-shrink: 0;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: .4
  }
}

.blk-more {
  font-size: .76rem;
  font-weight: 700;
  color: var(--purple2);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--t);
  background: none;
  border: none;
  font-family: inherit;
}

.blk-more:hover {
  color: var(--white);
  text-shadow: 0 0 16px rgba(167, 139, 250, .7);
}

/* ============ REKOMENDASI SLIDER ============ */
.reko-filter {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: .9rem;
}

.reko-slider-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.reko-slider {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  flex: 1;
  overflow: hidden;
}

.reko-arrow {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--border2);
  color: var(--txt);
  font-size: 1.15rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all var(--t);
  flex-shrink: 0;
  z-index: 2;
}

.reko-arrow:hover {
  background: var(--purple);
  border-color: var(--purple);
  box-shadow: 0 4px 16px rgba(124, 92, 255, .45);
}

@media (max-width: 768px) {
  .reko-slider {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .reko-slider {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .reko-arrow {
    width: 28px;
    height: 28px;
    font-size: .9rem;
  }
}

/* ============ UPDATE TERBARU ============ */
.update-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.update-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: linear-gradient(180deg, rgba(255, 255, 255, .02), transparent 45%), var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 11px;
  cursor: pointer;
  transition: all var(--t2);
  position: relative;
  overflow: hidden;
}

.update-row::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--grad);
  transform: scaleY(0);
  transition: transform var(--t2);
}

.update-row:hover {
  background: var(--bg4);
  border-color: rgba(124, 92, 255, .35);
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .4), 0 0 0 1px rgba(124, 92, 255, .15);
}

.update-row:hover::before {
  transform: scaleY(1);
}

.up-thumb {
  width: 56px;
  height: 78px;
  border-radius: var(--r);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg5);
  box-shadow: 0 3px 12px rgba(0, 0, 0, .4);
}

.up-info {
  flex: 1;
  min-width: 0;
}

.up-title {
  font-size: .8rem;
  font-weight: 700;
  color: var(--txt);
  margin-bottom: 5px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.up-chapters {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.up-ch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .7rem;
}

.up-ch-num {
  color: var(--purple2);
  font-weight: 600;
}

.up-ch-time {
  color: var(--txt3);
}

.up-type-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: .58rem;
  font-weight: 700;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: .4px;
}

/* Skeleton for update list */
.skel-list {
  display: contents;
}

.skel-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 10px;
  animation: shimmer 1.6s ease infinite;
}

.skel-thumb {
  width: 54px;
  height: 76px;
  border-radius: var(--r);
  background: var(--bg4);
  flex-shrink: 0;
}

.skel-lines {
  flex: 1;
}

.skel-line {
  height: 11px;
  border-radius: 6px;
  background: var(--bg4);
  margin-bottom: 6px;
}

.skel-line.s {
  width: 70%;
}

.skel-line.xs {
  width: 45%;
}

@keyframes shimmer {

  0%,
  100% {
    opacity: .5
  }

  50% {
    opacity: .9
  }
}

/* ============ HISTORY ROW ============ */
.history-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}

.history-row::-webkit-scrollbar {
  display: none;
}

.hist-card {
  display: flex;
  gap: 10px;
  align-items: center;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 8px 12px 8px 8px;
  min-width: 220px;
  max-width: 260px;
  flex-shrink: 0;
  cursor: pointer;
  transition: all var(--t);
}

.hist-card:hover {
  border-color: rgba(139, 92, 246, .5);
  background: var(--bg4);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(124, 92, 255, .2);
}

.hist-img {
  width: 44px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg5);
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .4);
}

.hist-info {
  flex: 1;
  min-width: 0;
}

.hist-title {
  font-size: .78rem;
  font-weight: 700;
  color: var(--txt);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.hist-ch {
  font-size: .68rem;
  color: var(--purple2);
  font-weight: 600;
  margin-bottom: 2px;
}

.hist-time {
  font-size: .6rem;
  color: var(--txt3);
}

/* ============ TEXT PAGE ============ */
.text-page-content {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 1.75rem;
  color: var(--txt2);
  font-size: .95rem;
  line-height: 1.85;
}

.text-page-content h2 {
  color: var(--white);
  margin: 1.5rem 0 1rem;
  font-family: 'Outfit', sans-serif;
}

.text-page-content p {
  margin-bottom: 1rem;
}

.text-page-content ul {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.text-page-content li {
  margin-bottom: .5rem;
}

.text-page-content a {
  color: var(--purple2);
  text-decoration: none;
}

.text-page-content a:hover {
  text-decoration: underline;
}

/* ============ CARD GRID ============ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}

.card-grid.wide {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
}

.komik-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, .025), transparent 40%), var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--t2);
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.komik-card:hover {
  border-color: rgba(139, 92, 246, .55);
  transform: translateY(-5px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, .55), 0 0 24px rgba(124, 92, 255, .18);
}

.kc-thumb {
  position: relative;
  aspect-ratio: 2/3;
  overflow: hidden;
  /* shimmer placeholder terlihat sementara cover lazy-loading,
     jadi card tidak tampak "kosong" saat scroll cepat */
  background: linear-gradient(110deg, var(--bg3) 30%, var(--bg5) 45%, var(--bg3) 60%);
  background-size: 220% 100%;
  animation: kcshimmer 1.5s linear infinite;
}

.kc-thumb.loaded {
  animation: none;
  background: var(--bg4);
}

@keyframes kcshimmer {
  from { background-position: 120% 0; }
  to { background-position: -120% 0; }
}

.kc-thumb.noimg {
  animation: none;
  background: linear-gradient(145deg, #1c1733, #131c2e);
}

/* bottom scrim so type/score badges stay readable over artwork */
.kc-thumb::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 44px;
  background: linear-gradient(0deg, rgba(5, 5, 10, .72), transparent);
  z-index: 1;
  pointer-events: none;
}

.kc-thumb.noimg::after {
  content: '📖';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  opacity: .5;
}

.kc-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity .45s ease, transform var(--t2);
}

.kc-thumb.loaded .kc-img,
.kc-thumb.noimg .kc-img {
  opacity: 1;
}

.komik-card:hover .kc-img {
  transform: scale(1.07);
}

.kc-ov {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(5, 5, 12, .92) 100%);
  opacity: 0;
  transition: opacity var(--t2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.komik-card:hover .kc-ov {
  opacity: 1;
}

.kc-play {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(.5);
  transition: transform var(--t2);
  box-shadow: 0 4px 20px rgba(124, 92, 255, .55);
}

.komik-card:hover .kc-play {
  transform: scale(1);
}

.kc-type {
  position: absolute;
  bottom: 7px;
  left: 7px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: .6rem;
  font-weight: 800;
  letter-spacing: .4px;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .5);
  z-index: 2;
}

.kc-score {
  position: absolute;
  bottom: 7px;
  right: 7px;
  padding: 2px 8px;
  border-radius: var(--rf);
  background: rgba(5, 5, 12, .72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--yellow);
  font-size: .67rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 2px;
  z-index: 2;
}

.kc-status {
  position: absolute;
  top: 7px;
  right: 7px;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: .57rem;
  font-weight: 700;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.kc-body {
  padding: 9px 10px 11px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.kc-title {
  font-size: .78rem;
  font-weight: 600;
  color: var(--txt);
  line-height: 1.35;
  margin-bottom: 5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}

.kc-chapters {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: auto;
}

/* Baris chapter datar ala Shinigami: nomor kiri, waktu pendek kanan */
.kc-ch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: rgba(255, 255, 255, .04);
  padding: 5px 9px;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--t);
}

.kc-ch:hover {
  background: rgba(124, 92, 255, .16);
}

.kc-ch-num {
  flex: 1;
  min-width: 0;
  font-size: .66rem;
  font-weight: 600;
  color: var(--txt2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kc-ch:hover .kc-ch-num {
  color: var(--txt);
}

.kc-ch-time {
  flex-shrink: 0;
  font-size: .58rem;
  color: var(--txt3);
  font-weight: 500;
}

.kc-ch:hover .kc-ch-time {
  color: rgba(255, 255, 255, .85);
}

.kc-gtag {
  padding: 1px 6px;
  background: rgba(255, 255, 255, .05);
  border-radius: 5px;
  font-size: .62rem;
  color: var(--txt3);
  font-weight: 600;
}

/* No img */
.no-img {
  width: 100%;
  aspect-ratio: 2/3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg5), var(--bg4));
  color: var(--txt3);
  font-size: .7rem;
  gap: 5px;
}

/* Skel card */
.skel-card {
  background: var(--bg3);
  border-radius: var(--r2);
  border: 1px solid var(--border);
  animation: shimmer 1.6s ease infinite;
  overflow: hidden;
}

.skel-img {
  aspect-ratio: 2/3;
  background: var(--bg4);
}

/* ============ PAGE HEADER ============ */
.pg-header {
  max-width: 960px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 1.25rem;
}

.pg-header h1 {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 900;
  color: var(--white);
  margin-bottom: .4rem;
  letter-spacing: .2px;
}

.pg-header p {
  font-size: .86rem;
  color: var(--txt3);
  margin-bottom: 1.15rem;
}

.filt-row {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: .75rem;
}

.filt {
  padding: 7px 17px;
  border-radius: var(--rf);
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--border);
  color: var(--txt2);
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--t);
}

.filt:hover {
  border-color: rgba(139, 92, 246, .55);
  color: var(--txt);
  background: rgba(124, 92, 255, .1);
}

.filt.active {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 16px rgba(124, 92, 255, .4);
}

.sort-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: .8rem;
  color: var(--txt3);
}

.sort-row select {
  background: var(--bg4);
  border: 1px solid var(--border2);
  border-radius: var(--r);
  color: var(--txt);
  padding: 6px 10px;
  font-family: inherit;
  font-size: .78rem;
  cursor: pointer;
  transition: border-color var(--t);
}

.sort-row select:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, .15);
}

/* ============ PAGINATION ============ */
.pager {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 2rem 1rem;
  max-width: 960px;
  margin: 0 auto;
}

.pg-btn {
  min-width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--border);
  color: var(--txt2);
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--t);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
}

.pg-btn:hover:not(:disabled):not(.on) {
  border-color: rgba(139, 92, 246, .55);
  color: var(--txt);
  background: rgba(124, 92, 255, .1);
  transform: translateY(-2px);
}

.pg-btn.on {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 18px rgba(124, 92, 255, .5);
}

.pg-arr {
  font-size: 1.05rem;
  padding: 0 13px;
}

.pg-btn:disabled {
  opacity: .3;
  cursor: not-allowed;
}

/* Pagination ellipsis */
.pg-dots {
  min-width: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--txt3);
  font-size: .82rem;
}

/* Detail page loading */
.detail-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 6rem 1rem;
  color: var(--txt3);
  font-size: .9rem;
}

/* Rank badge (top-3 accent) */
.kc-rank {
  position: absolute;
  top: 8px;
  left: 8px;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  border-radius: 8px;
  background: rgba(5, 5, 12, .75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  font-size: .75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  font-family: 'Outfit', sans-serif;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .5);
}

.kc-rank.top {
  background: var(--grad);
  box-shadow: 0 3px 14px rgba(124, 92, 255, .6);
}

/* Reader page: shimmer placeholder while image loads */
.r-page {
  position: relative;
  min-height: 200px;
  background: linear-gradient(100deg, var(--bg3) 40%, var(--bg4) 50%, var(--bg3) 60%);
  background-size: 200% 100%;
  animation: rpage-shimmer 1.4s ease infinite;
}

@keyframes rpage-shimmer {
  to { background-position: -200% 0; }
}

.r-page img.loaded {
  animation: none;
  min-height: 0;
}

.r-page-err {
  padding: 2rem;
  text-align: center;
  color: var(--txt3);
  font-size: .88rem;
}

.r-retry {
  color: var(--purple2);
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
}

.r-retry:hover {
  color: var(--txt);
}

/* ============ GENRE ============ */
.genre-grid {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.genre-tile {
  background: linear-gradient(180deg, rgba(255, 255, 255, .03), transparent 50%), var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 1.1rem .85rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--t2);
}

.genre-tile:hover {
  border-color: rgba(139, 92, 246, .55);
  background: var(--bg4);
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .4), 0 0 20px rgba(124, 92, 255, .15);
}

.gt-ico {
  font-size: 1.7rem;
  margin-bottom: 7px;
  display: block;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .4));
}

.gt-name {
  font-size: .76rem;
  font-weight: 700;
  color: var(--txt);
}

.genre-res-head {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 960px;
  margin: 1.5rem auto .75rem;
  padding: 0 1rem;
}

#genre-res-label {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--white);
}

.back-chip {
  padding: 7px 15px;
  border-radius: var(--rf);
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--border);
  color: var(--txt2);
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--t);
}

.back-chip:hover {
  border-color: rgba(139, 92, 246, .55);
  color: var(--txt);
  background: rgba(124, 92, 255, .1);
}

/* ============ DETAIL ============ */
.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 17px;
  border-radius: var(--rf);
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--border);
  color: var(--txt2);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  margin: 1.25rem 1.25rem 0;
  font-family: inherit;
  transition: all var(--t);
}

.detail-back:hover {
  border-color: rgba(139, 92, 246, .55);
  color: var(--txt);
  background: rgba(124, 92, 255, .1);
}

.d-hero {
  position: relative;
  min-height: 380px;
  display: flex;
  align-items: flex-end;
}

.d-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  filter: brightness(.22) blur(5px) saturate(1.2);
}

.d-fog {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, var(--bg) 0%, rgba(10, 10, 18, .4) 55%, transparent 100%),
    linear-gradient(90deg, rgba(10, 10, 18, .6), transparent 60%);
}

.d-wrap {
  position: relative;
  max-width: 960px;
  margin: 0 auto;
  padding: 2.75rem 1.25rem 1.75rem;
  display: flex;
  gap: 1.6rem;
  align-items: flex-end;
  width: 100%;
}

.d-cover {
  width: 148px;
  height: 208px;
  border-radius: var(--r2);
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 20px 55px rgba(0, 0, 0, .85), 0 0 44px rgba(124, 92, 255, .15);
  border: 1px solid rgba(255, 255, 255, .16);
}

.d-info {
  flex: 1;
  min-width: 0;
}

.d-title {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.45rem, 3.5vw, 2.3rem);
  font-weight: 900;
  color: var(--white);
  line-height: 1.14;
  letter-spacing: .2px;
  margin-bottom: 6px;
  text-shadow: 0 4px 24px rgba(0, 0, 0, .6);
}

.d-alt {
  font-size: .8rem;
  color: var(--txt3);
  margin-bottom: 12px;
}

.d-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.d-stats {
  display: flex;
  gap: 1.4rem;
  flex-wrap: wrap;
}

.d-stat {
  text-align: center;
  background: rgba(10, 10, 18, .5);
  border: 1px solid var(--border2);
  border-radius: var(--r2);
  padding: 10px 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.d-val {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--white);
}

.d-val.sc {
  color: var(--yellow);
}

.d-lbl-s {
  font-size: .62rem;
  color: var(--txt3);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: .6px;
}

.d-body {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem;
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 1.6rem;
}

.d-synopsis h3 {
  font-family: 'Outfit', sans-serif;
  font-size: .98rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 11px;
}

.d-synopsis p {
  font-size: .86rem;
  color: var(--txt2);
  line-height: 1.85;
}

.d-genre-tags {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.d-gtag {
  padding: 5px 13px;
  border-radius: var(--rf);
  background: rgba(124, 92, 255, .12);
  border: 1px solid rgba(139, 92, 246, .3);
  color: var(--purple2);
  font-size: .72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t);
}

.d-gtag:hover {
  background: rgba(124, 92, 255, .25);
  border-color: rgba(139, 92, 246, .55);
  transform: translateY(-1px);
}

.d-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, .025), transparent 40%), var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 1.1rem;
  height: fit-content;
}

.d-card h3 {
  font-size: .88rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 11px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--border);
}

.d-row {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .04);
  align-items: flex-start;
}

.d-row:last-child {
  border-bottom: none;
}

.d-rl {
  font-size: .72rem;
  color: var(--txt3);
  font-weight: 500;
}

.d-rv {
  font-size: .72rem;
  color: var(--txt2);
  font-weight: 600;
  text-align: right;
  max-width: 58%;
}

/* ============ TOAST / BTT ============ */
.toast {
  position: fixed;
  bottom: calc(var(--bnav-h) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(70px);
  background: rgba(20, 20, 32, .96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border2);
  border-radius: var(--rf);
  padding: 10px 20px;
  font-size: .82rem;
  color: var(--txt);
  box-shadow: var(--sh2);
  z-index: 9999;
  pointer-events: none;
  transition: transform var(--t2);
}

.toast.on {
  transform: translateX(-50%) translateY(0);
}

.btt {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--grad);
  border: none;
  color: #fff;
  font-size: .95rem;
  cursor: pointer;
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  display: none;
  transition: all var(--t2);
  box-shadow: 0 6px 24px rgba(124, 92, 255, .5);
  align-items: center;
  justify-content: center;
}

.btt.show {
  opacity: 1;
  pointer-events: all;
}

.btt:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 32px rgba(124, 92, 255, .65);
}

@media (max-width: 768px) {
  .btt {
    display: flex;
    right: .75rem;
    bottom: calc(var(--bnav-h) + 10px);
  }
}

/* ============ TRAKTEER POPUP ============ */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(5, 5, 10, .75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t2);
}

.popup-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.popup-box {
  background: linear-gradient(180deg, #191927, #12121e);
  border: 1px solid var(--border2);
  border-radius: var(--r3);
  padding: 2.25rem 1.75rem 2rem;
  width: 90%;
  max-width: 350px;
  text-align: center;
  position: relative;
  transform: translateY(24px) scale(.97);
  transition: transform var(--t2);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .7), 0 0 60px rgba(124, 92, 255, .12);
}

.popup-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--grad);
}

.popup-overlay.show .popup-box {
  transform: translateY(0) scale(1);
}

.popup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: var(--txt3);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 5px;
  line-height: 1;
  transition: color var(--t);
}

.popup-close:hover {
  color: var(--txt);
}

.popup-icon {
  font-size: 3.2rem;
  margin-bottom: 12px;
  line-height: 1;
  filter: drop-shadow(0 6px 18px rgba(251, 146, 60, .35));
}

.popup-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.45rem;
  color: var(--white);
  margin-bottom: 9px;
  font-weight: 800;
}

.popup-desc {
  font-size: .86rem;
  color: var(--txt2);
  margin-bottom: 1.6rem;
  line-height: 1.6;
}

.popup-btn {
  display: inline-block;
  background: linear-gradient(135deg, #ff6b4a, #f43f5e);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  padding: 13px 26px;
  border-radius: var(--rf);
  font-size: .95rem;
  transition: all var(--t);
  box-shadow: 0 6px 24px rgba(244, 63, 94, .4);
}

.popup-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(244, 63, 94, .55);
}

/* ============ BOTTOM NAV (mobile only) ============ */
.bnav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bnav-h);
  background: rgba(10, 10, 18, .92);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border-top: 1px solid var(--border2);
  display: none;
  align-items: center;
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

@media (max-width: 768px) {
  .bnav {
    display: flex;
  }
}

.bnav-i {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 0 6px;
  color: var(--txt3);
  text-decoration: none;
  font-size: .57rem;
  font-weight: 600;
  transition: all var(--t);
  position: relative;
  cursor: pointer;
}

.bnav-i.active {
  color: var(--purple2);
  filter: drop-shadow(0 0 8px rgba(167, 139, 250, .6));
}

.bnav-i::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--grad);
  border-radius: 0 0 2px 2px;
  transition: width var(--t);
}

.bnav-i.active::before {
  width: 34px;
  box-shadow: 0 2px 10px rgba(124, 92, 255, .7);
}

/* ============ LOADING / EMPTY ============ */
.loader-box {
  display: flex;
  justify-content: center;
  padding: 3.5rem;
  grid-column: 1/-1;
}

.spin {
  width: 38px;
  height: 38px;
  border: 3px solid rgba(255, 255, 255, .1);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: rot .75s linear infinite;
  filter: drop-shadow(0 0 8px rgba(139, 92, 246, .4));
}

@keyframes rot {
  to {
    transform: rotate(360deg);
  }
}

.empty-box {
  text-align: center;
  padding: 3.5rem 1rem;
  grid-column: 1/-1;
}

.empty-box .ei {
  font-size: 2.8rem;
  margin-bottom: .7rem;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .4));
}

.empty-box .et {
  font-size: .95rem;
  font-weight: 700;
  color: var(--txt);
  margin-bottom: .35rem;
}

.empty-box .es {
  font-size: .82rem;
  color: var(--txt3);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 860px) {
  .d-body {
    grid-template-columns: 1fr;
  }

  .d-card {
    order: -1;
  }
}

@media (max-width: 768px) {
  :root {
    --nav-h: 56px;
  }

  /* Navbar */
  .nav-tabs {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .nav-search kbd {
    display: none;
  }

  #q {
    width: 100%;
  }

  .nav-wrap {
    gap: 8px;
    padding: 0 .85rem;
  }

  /* Featured slider */
  .featured {
    height: 350px;
  }

  .feat-body {
    padding: 1rem 1rem 1.75rem;
    gap: .8rem;
  }

  .feat-title {
    font-size: 1.12rem;
  }

  .feat-syn {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    font-size: .74rem;
    margin-bottom: 9px;
  }

  .feat-cover {
    width: 86px;
    height: 120px;
    border-width: 1px;
  }

  .feat-tags .tag {
    font-size: .56rem;
    padding: 1px 7px;
  }

  .feat-btns .btn-primary {
    padding: 8px 15px;
    font-size: .76rem;
  }

  .feat-arrow {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }

  .genre-strip-inner {
    padding: 0 .85rem;
  }

  /* Update grid */
  .update-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
  }

  /* Card grids */
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 9px;
  }

  .card-grid.wide {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    padding: 0 .85rem;
  }

  .kc-title {
    font-size: .72rem;
  }

  /* Genre grid */
  .genre-grid {
    padding: 0 .85rem;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 8px;
  }

  .genre-tile {
    padding: .8rem .5rem;
  }

  /* Detail */
  .d-wrap {
    flex-direction: column;
    gap: .8rem;
    padding: 1.5rem .9rem 1rem;
  }

  .d-cover {
    width: 104px;
    height: 146px;
  }

  .d-body {
    padding: 1rem .9rem;
  }

  .d-title {
    font-size: 1.35rem;
  }

  /* Home blocks */
  .home-blk {
    padding: 1.5rem .85rem;
  }

  .home-side {
    padding: 0 .85rem 1.5rem;
    grid-template-columns: minmax(0, 1fr);
  }

  .home-layout .home-blk {
    padding-left: .85rem;
    padding-right: .85rem;
  }

  .pg-header {
    padding: 1.5rem .85rem 1rem;
  }

  /* Sort row */
  .sort-row {
    gap: 6px;
  }

  .sort-row select {
    font-size: .75rem;
    padding: 5px 9px;
  }

  /* Filter */
  .filt {
    padding: 6px 13px;
    font-size: .74rem;
  }

  .filt-row {
    gap: 5px;
  }

  .toast {
    bottom: calc(var(--bnav-h) + 10px);
  }
}

@media (max-width: 480px) {
  :root {
    --nav-h: 56px;
  }

  /* Featured */
  .featured {
    height: 265px;
  }

  .feat-body {
    padding: .8rem;
    gap: .55rem;
  }

  .feat-title {
    font-size: .98rem;
    margin-bottom: 5px;
  }

  .feat-tags {
    display: none;
  }

  .feat-btns .btn-primary {
    padding: 7px 14px;
    font-size: .75rem;
  }

  .feat-cover {
    width: 70px;
    height: 98px;
  }

  .feat-arrow {
    width: 27px;
    height: 27px;
    font-size: .9rem;
  }

  .feat-dots {
    bottom: 9px;
  }

  .fdot {
    width: 5px;
    height: 5px;
  }

  .fdot.on {
    width: 15px;
  }

  /* Cards - 3 per row on small mobile */
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
  }

  .card-grid.wide {
    grid-template-columns: repeat(3, 1fr);
    padding: 0 .7rem;
    gap: 7px;
  }

  .kc-body {
    padding: 7px 8px 9px;
  }

  .kc-title {
    font-size: .67rem;
    -webkit-line-clamp: 2;
  }

  .kc-vol {
    font-size: .6rem;
  }

  /* Baris chapter: lebih ringkas agar "Chapter 123" + waktu tetap muat.
     Kata "Chapter" disingkat "Ch." supaya nomor tidak terpotong. */
  .kc-ch {
    padding: 4px 7px;
    gap: 4px;
    border-radius: 6px;
  }

  .kc-ch-num {
    font-size: .6rem;
  }

  .kc-ch-word {
    display: none;
  }

  .kc-ch-num:has(.kc-ch-word)::before {
    content: 'Ch.';
    margin-right: 2px;
  }

  .kc-ch-time {
    font-size: .53rem;
  }

  /* Update rows */
  .up-thumb {
    width: 48px;
    height: 66px;
  }

  .up-title {
    font-size: .75rem;
  }

  .up-ch {
    font-size: .66rem;
  }

  /* Home blocks */
  .home-blk {
    padding: 1.2rem .7rem;
  }

  .blk-title {
    font-size: .97rem;
  }

  .blk-more {
    font-size: .7rem;
  }

  /* Genre */
  .genre-grid {
    grid-template-columns: repeat(3, 1fr);
    padding: 0 .7rem;
    gap: 7px;
  }

  .genre-tile {
    padding: .7rem .4rem;
  }

  .gt-ico {
    font-size: 1.35rem;
    margin-bottom: 4px;
  }

  .gt-name {
    font-size: .65rem;
  }

  .genre-icon {
    font-size: 1.5rem;
  }

  .genre-name {
    font-size: .65rem;
  }

  /* Navbar search */
  .nav-wrap {
    padding: 0 .7rem;
    height: 52px;
  }

  .brand-name {
    font-size: 1.02rem;
  }

  .brand-logo {
    width: 26px;
    height: 26px;
  }

  .nav-search {
    height: 35px;
    padding: 0 11px;
    gap: 6px;
  }

  #q {
    font-size: .8rem;
  }

  /* Notice bar */
  .notice-bar {
    font-size: .72rem;
    padding: 6px .8rem;
    gap: 5px;
  }

  /* Chapter list */
  .ch-item {
    padding: 8px 10px;
    gap: 8px;
  }

  .ch-num {
    font-size: .78rem;
    min-width: 60px;
  }

  .ch-date {
    font-size: .62rem;
  }

  .ch-read-btn {
    padding: 4px 8px;
    font-size: .65rem;
  }

  .ch-title-txt {
    display: none;
  }

  /* Pagination */
  .pager {
    gap: 4px;
    padding: 1.5rem .7rem;
  }

  .pg-btn {
    min-width: 32px;
    height: 32px;
    font-size: .75rem;
    padding: 0 7px;
    border-radius: 10px;
  }

  /* Sort/filter rows */
  .filt-row {
    gap: 5px;
    flex-wrap: wrap;
  }

  .filt {
    padding: 5px 11px;
    font-size: .7rem;
  }

  .sort-row {
    flex-wrap: wrap;
  }

  /* Detail page */
  .d-wrap {
    padding: 1.25rem .7rem .9rem;
  }

  .d-cover {
    width: 90px;
    height: 127px;
  }

  .d-title {
    font-size: 1.12rem;
  }

  .d-alt {
    font-size: .72rem;
  }

  .d-body {
    padding: .9rem .7rem;
  }

  .d-synopsis p {
    font-size: .8rem;
    line-height: 1.7;
  }

  .detail-back {
    margin: .8rem .7rem 0;
    font-size: .75rem;
    padding: 6px 13px;
  }

  /* Bottom nav */
  .bnav-i {
    font-size: .52rem;
    gap: 2px;
  }

  .bnav-i svg {
    width: 19px;
    height: 19px;
  }

  /* Page header */
  .pg-header {
    padding: 1.1rem .7rem .85rem;
  }

  .pg-header h1 {
    font-size: 1.35rem;
  }

  .pg-header p {
    font-size: .77rem;
  }

  /* Reader */
  .reader-bar {
    padding: 0 .5rem;
    gap: 4px;
    height: 46px;
  }

  .r-title {
    font-size: .65rem;
  }

  .r-btn {
    padding: 4px 7px;
    font-size: .65rem;
  }

  .r-back {
    padding: 5px 10px;
    font-size: .7rem;
  }

  .reader-nav {
    padding: .75rem .7rem;
  }

  .rnav-btn {
    font-size: .75rem;
    padding: 9px 10px;
  }
}

/* ==================== FOOTER ==================== */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg2);
  padding: 1.9rem 1.25rem 1.6rem;
  margin-top: .5rem;
}

@media (max-width: 768px) {
  .site-footer {
    display: none;
  }
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .85rem;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-link {
  font-size: .8rem;
  color: var(--txt3);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--t);
}

.footer-link:hover {
  color: var(--purple2);
}

.footer-copy {
  font-size: .75rem;
  color: var(--txt3);
  text-align: center;
}

.footer-copy strong {
  color: var(--txt2);
  font-weight: 600;
}

/* ==================== READER ==================== */
#pg-reader {
  background: #060609;
  min-height: 100vh;
  padding-bottom: 0;
}

/* Reader toolbar */
.reader-bar {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(7, 7, 11, .92);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--border);
  padding: 0 1.25rem;
  height: 54px;
}

.r-back {
  padding: 6px 15px;
  border-radius: var(--rf);
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--border);
  color: var(--txt2);
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--t);
  white-space: nowrap;
  flex-shrink: 0;
}

.r-back:hover {
  border-color: rgba(139, 92, 246, .55);
  color: var(--txt);
  background: rgba(124, 92, 255, .12);
}

.r-title {
  flex: 1;
  font-size: .82rem;
  font-weight: 600;
  color: var(--txt);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.r-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.r-btn {
  padding: 5px 12px;
  border-radius: var(--rf);
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--border);
  color: var(--txt2);
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--t);
  white-space: nowrap;
}

.r-btn:hover {
  border-color: rgba(139, 92, 246, .55);
  color: var(--txt);
  background: rgba(124, 92, 255, .12);
}

.r-btn.active {
  background: rgba(124, 92, 255, .2);
  border-color: rgba(139, 92, 246, .6);
  color: var(--purple2);
}

.r-btn:disabled {
  opacity: .3;
  cursor: not-allowed;
}

.r-ch-info {
  font-size: .75rem;
  color: var(--txt3);
  white-space: nowrap;
  padding: 0 4px;
}

/* Pages */
.reader-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.25rem 0 2rem;
  min-height: calc(100vh - 54px);
}

.reader-pages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
}

.r-page {
  width: 100%;
  max-width: 750px;
  display: block;
  margin: 0 auto;
  background: #0c0c12;
  transition: max-width var(--t2);
}

.r-page img {
  width: 100%;
  display: block;
}

.reader-pages.wide .r-page {
  max-width: 100%;
}

.reader-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 1rem;
  gap: 1rem;
  width: 100%;
}

.reader-loading p {
  font-size: .85rem;
  color: var(--txt3);
}

.reader-error {
  text-align: center;
  padding: 4rem 1rem;
}

.reader-error .ei {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

.reader-error h3 {
  font-size: 1.1rem;
  color: var(--txt);
  margin-bottom: .5rem;
}

.reader-error p {
  font-size: .85rem;
  color: var(--txt3);
  margin-bottom: 1.25rem;
}

/* Chapter nav at bottom */
.reader-nav {
  display: flex;
  justify-content: space-between;
  padding: 1.25rem 1.25rem;
  gap: 1rem;
  background: rgba(7, 7, 11, .95);
  border-top: 1px solid var(--border);
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
}

.rnav-btn {
  flex: 1;
  padding: 12px 16px;
  border-radius: var(--r2);
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--border);
  color: var(--txt2);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--t);
  text-align: center;
}

.rnav-btn:hover {
  border-color: rgba(139, 92, 246, .55);
  color: var(--txt);
  background: rgba(124, 92, 255, .12);
  transform: translateY(-2px);
}

.rnav-btn:disabled {
  opacity: .3;
  cursor: not-allowed;
  transform: none;
}

/* ==================== CHAPTER LIST (detail) ==================== */
.ch-section {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.25rem 2rem;
}

.ch-section h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: .9rem;
  padding-bottom: .65rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ch-lang-toggle {
  display: flex;
  gap: 5px;
}

.ch-lang-btn {
  padding: 4px 12px;
  border-radius: var(--rf);
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--border);
  color: var(--txt3);
  font-size: .7rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--t);
}

.ch-lang-btn.on {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
}

.ch-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ch-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 10px 14px;
  cursor: pointer;
  transition: all var(--t2);
}

.ch-item:hover {
  background: var(--bg4);
  border-color: rgba(139, 92, 246, .45);
  transform: translateX(4px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, .3), 0 0 16px rgba(124, 92, 255, .1);
}

.ch-num {
  font-size: .85rem;
  font-weight: 700;
  color: var(--purple2);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 72px;
}

.ch-title-txt {
  flex: 1;
  font-size: .78rem;
  color: var(--txt2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ch-lang-tag {
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(255, 255, 255, .05);
  font-size: .62rem;
  font-weight: 700;
  color: var(--txt3);
  flex-shrink: 0;
}

.ch-date {
  font-size: .68rem;
  color: var(--txt3);
  white-space: nowrap;
  flex-shrink: 0;
}

.ch-read-btn {
  padding: 5px 13px;
  border-radius: var(--rf);
  background: rgba(124, 92, 255, .14);
  border: 1px solid rgba(139, 92, 246, .3);
  color: var(--purple2);
  font-size: .72rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--t);
  flex-shrink: 0;
}

.ch-read-btn:hover {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 16px rgba(124, 92, 255, .45);
}

.ch-empty {
  text-align: center;
  padding: 2.5rem;
  color: var(--txt3);
  font-size: .85rem;
}

.ch-more-btn {
  width: 100%;
  padding: 11px;
  border-radius: var(--r2);
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--border);
  color: var(--txt2);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--t);
  margin-top: 5px;
}

.ch-more-btn:hover {
  border-color: rgba(139, 92, 246, .5);
  color: var(--txt);
  background: rgba(124, 92, 255, .1);
}

.hidden {
  display: none !important;
}

/* Chapter Range Tabs */
.ch-range-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 0 9px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 5px;
}

.ch-range-btn {
  padding: 5px 13px;
  border-radius: var(--rf);
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--border2);
  color: var(--txt2);
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--t);
}

.ch-range-btn:hover {
  border-color: rgba(139, 92, 246, .55);
  color: var(--txt);
  background: rgba(124, 92, 255, .1);
}

.ch-range-btn.active {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 3px 14px rgba(124, 92, 255, .45);
}

.md-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 6px;
  background: rgba(251, 146, 60, .12);
  border: 1px solid rgba(251, 146, 60, .25);
  color: #fb923c;
  font-size: .65rem;
  font-weight: 700;
}

@media (max-width: 600px) {
  .reader-bar {
    padding: 0 .6rem;
    gap: 5px;
  }

  .r-title {
    font-size: .7rem;
  }

  .r-btn {
    padding: 4px 8px;
    font-size: .68rem;
  }

  .ch-title-txt {
    display: none;
  }

  .reader-nav {
    padding: .85rem .8rem;
  }
}
