/* ── Variables ── */
:root {
  --red: #a80020;
  --red-dark: #c4001f;
  --bg:       #f0f0f0;
  --white:    #fff;
  --text:     #222;
  --sub:      #555;
  --muted:   #585858;
  --border:   #e5e5e5;
  --shadow:   0 2px 10px rgba(0,0,0,.08);
  --radius:   4px;
  --nav-h:    50px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; border: none; outline: none; cursor: pointer; background: none; }
input  { font-family: inherit; border: none; outline: none; }
img    { display: block; max-width: 100%; }
svg    { display: inline-block; vertical-align: middle; flex-shrink: 0; }

/* ── Layout ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ══════════════════════════════════════
   HEADER
══════════════════════════════════════ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
}
.header-inner {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 0;
}
/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-right: 28px;
  font-size: 22px;
  font-weight: 900;
  color: var(--red);
  letter-spacing: -1px;
  flex-shrink: 0;
}
.site-logo .logo-sub {
  color: var(--text);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0;
  align-self: flex-end;
  margin-bottom: 5px;
}
/* Nav */
.site-nav { display: flex; align-items: center; flex: 1; }
.site-nav ul.menu { display: flex; align-items: center; list-style: none; margin: 0; padding: 0; }
.site-nav ul.menu > li.menu-item { position: relative; }
.site-nav ul.menu > li.menu-item > a {
  display: flex;
  align-items: center;
  height: var(--nav-h);
  padding: 0 13px;
  font-size: 15px;
  color: var(--sub);
  white-space: nowrap;
  transition: color .18s;
  border-bottom: 2px solid transparent;
}
.site-nav ul.menu > li.menu-item > a:hover { color: var(--text); }
.site-nav ul.menu > li.menu-item.current-menu-item > a { color: var(--red); font-weight: 600; border-bottom-color: var(--red); }
/* Chevron on parent items */
.site-nav ul.menu > li.menu-item-has-children > a::after {
  content: '';
  display: inline-block;
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  margin-left: 5px;
  opacity: .55;
  vertical-align: middle;
}
/* Desktop sub-menu toggle button — hidden on desktop */
.sub-menu-toggle { display: none; }
/* Desktop dropdown */
.site-nav ul.sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 170px;
  background: var(--white);
  border: 1px solid var(--border);
  border-top: 2px solid var(--red);
  border-radius: 0 0 4px 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
  z-index: 9999;
  list-style: none;
  padding: 4px 0;
}
.site-nav ul.menu > li.menu-item-has-children:hover > ul.sub-menu { display: block; }
.site-nav ul.sub-menu li.menu-item a {
  display: block;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--sub);
  white-space: nowrap;
  transition: color .15s, background .15s;
}
.site-nav ul.sub-menu li.menu-item a:hover { color: var(--red); background: #fff5f5; }
/* Search trigger icon */
.search-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--muted);
  flex-shrink: 0;
  transition: color .18s, background .18s;
}
.search-trigger:hover { color: var(--red); background: #f5f5f5; }

/* Search Modal */
.search-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,.55);
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
}
.search-modal.is-open { display: flex; }
.search-modal-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 620px;
  margin: 0 16px;
  animation: modalSlideIn .2s ease;
}
@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.search-modal-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  background: var(--white);
  border-radius: 8px;
  padding: 0 16px;
  height: 52px;
  box-shadow: 0 8px 30px rgba(0,0,0,.18);
}
.search-modal-form svg { color: var(--muted); flex-shrink: 0; }
.search-modal-form input {
  flex: 1;
  background: none;
  font-size: 16px;
  color: var(--text);
  height: 100%;
}
.search-modal-form input::placeholder { color: var(--muted); }
.search-modal-form button[type="submit"] {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red);
  flex-shrink: 0;
  transition: color .15s;
}
.search-modal-form button[type="submit"]:hover { color: var(--red-dark); }
.search-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #fff;
  background: var(--red);
  flex-shrink: 0;
  transition: background .18s;
}
.search-modal-close:hover { background: rgba(255,255,255,.28); }
/* User icon */
.header-user {
  display: flex;
  align-items: center;
  padding: 0 10px;
  height: var(--nav-h);
  color: var(--muted);
  flex-shrink: 0;
  transition: color .18s;
}
.header-user:hover { color: var(--red); }

/* ══════════════════════════════════════
   SECTION HEADER
══════════════════════════════════════ */
.section-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
}
.section-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 18px;
  background: var(--red);
  border-radius: 2px;
}
.section-more {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 13px;
  color: var(--muted);
  transition: color .18s;
}
.section-more:hover { color: var(--red); }
.section-more svg   { color: var(--muted); }
.section-more:hover svg { color: var(--red); }

/* ══════════════════════════════════════
   CONTENT SECTION WRAPPER
══════════════════════════════════════ */
.content-section { padding: 22px 0 4px; }

/* ══════════════════════════════════════
   CARD GRID
══════════════════════════════════════ */
.card-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }

/* ══════════════════════════════════════
   CARD  (used as <a class="card">)
══════════════════════════════════════ */
.card {
  display: block;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  color: inherit;
  transition: box-shadow .2s, transform .2s;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

/* Poster area */
.card-poster {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #ddd;
}
.poster-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
/* Badge (episode count / quality) */
.card-badge {
  position: absolute;
  top: 0;
  left: 0;
  background: rgba(0,0,0,.62);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 0 0 var(--radius) 0;
  max-width: 85%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 2;
}
.card-badge.red { background: var(--red); }
/* Play overlay */
.card-play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.32);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s;
  z-index: 3;
}
.card:hover .card-play-overlay { opacity: 1; }
.card-play-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  border: 2px solid rgba(255,255,255,.8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
/* Card text */
.card-info   { padding: 7px 8px 9px; }
.card-title  { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px; }
.card-meta   { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ══════════════════════════════════════
   DETAIL PAGE
══════════════════════════════════════ */
.detail-page { padding: 24px 0 48px; }

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 20px;
  flex-wrap: wrap;
  padding: 9px 12px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.breadcrumb a {
  color: var(--sub);
  font-weight: 500;
  white-space: nowrap;
  transition: color .15s;
}
.breadcrumb a:hover { color: var(--red); }
.breadcrumb .sep {
  color: var(--muted);
  font-size: 13px;
  flex-shrink: 0;
  user-select: none;
}
.breadcrumb > span:last-child {
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  /* max-width: 260px; */
}

/* Detail hero */
.detail-hero {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 28px;
  margin-bottom: 32px;
}
.detail-poster {
  width: 200px;
  aspect-ratio: 2/3;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}
.detail-poster .poster-bg { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.65); font-size: 15px; font-weight: 600; text-align: center; padding: 12px; }
.detail-info { min-width: 0; }
.detail-title    { font-size: 26px; font-weight: 800; line-height: 1.25; margin-bottom: 4px; }
.detail-title-en { font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.detail-rating   { display: inline-flex; align-items: center; gap: 5px; font-size: 28px; font-weight: 700; color: #f5a623; margin-bottom: 12px; }
.detail-rating small { font-size: 14px; color: var(--muted); font-weight: 400; }
.detail-rating svg   { width: 18px; height: 18px; }

/* Tags */
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tag {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 20px;
  font-size: 12px;
  background: #f5f5f5;
  color: var(--sub);
  border: 1px solid var(--border);
}
.tag.red { background: #fff0f0; color: var(--red); border-color: #ffd0d0; }

/* Meta rows */
.meta-rows { margin-bottom: 14px; }
.meta-row { display: flex; gap: 10px; font-size: 14px; padding: 5px 0; border-bottom: 1px solid #f5f5f5; }
.meta-label { color: var(--muted); flex-shrink: 0; width: 110px; }
.meta-val   { color: var(--sub); }

/* Synopsis */
.synopsis { font-size: 15px; color: var(--sub); line-height: 1.75; }

/* Action buttons */
.detail-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s, border-color .18s, color .18s;
  white-space: nowrap;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-outline { background: var(--white); color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--red); color: var(--red); }
.btn-fav-active { background: var(--white); color: var(--red); border: 1px solid var(--red); }

/* ══════════════════════════════════════
   EPISODE SECTION (detail pages)
══════════════════════════════════════ */
.ep-section { margin-bottom: 32px; }
.ep-section-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}
.ep-section-title {
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ep-section-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 16px;
  background: var(--red);
  border-radius: 2px;
}
/* Numbered episode buttons */
.ep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  gap: 8px;
}
.ep-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  border-radius: var(--radius);
  font-size: 14px;
  background: #f5f5f5;
  color: var(--sub);
  border: 1px solid var(--border);
  transition: background .15s, color .15s, border-color .15s;
}
.ep-btn:hover  { background: #fff0f0; color: var(--red); border-color: #ffd0d0; }
.ep-btn.active { background: var(--red); color: #fff; border-color: var(--red); }
/* Season selector */
.season-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.season-label { font-size: 13px; color: var(--muted); }
.season-btn {
  padding: 5px 18px;
  border-radius: 20px;
  font-size: 13px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--sub);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.season-btn:hover { border-color: var(--red); color: var(--red); }
.season-btn.active { background: var(--red); color: #fff; border-color: var(--red); }

/* Quality selector */
.quality-section { margin-bottom: 28px; }
.quality-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.quality-label { font-size: 12px; color: var(--muted); width: 48px; flex-shrink: 0; }
.quality-btn {
  padding: 4px 14px;
  border-radius: var(--radius);
  font-size: 12px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--sub);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.quality-btn:hover  { border-color: var(--red); color: var(--red); }
.quality-btn.active { background: var(--red); color: #fff; border-color: var(--red); }

/* ══════════════════════════════════════
   EPISODE PLAYER PAGE
══════════════════════════════════════ */
.player-page { background: #111; min-height: 100vh; }

/* Video player */
.player-wrap   { background: #000; }
.player-screen {
  width: 100%;
  aspect-ratio: 16/9;
  max-height: 70vh;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.player-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: rgba(255,255,255,.35);
  text-align: center;
}
.player-placeholder p { font-size: 14px; }

/* Controls bar */
.player-controls {
  background: #1c1c1c;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,.65);
}
.player-controls button { color: rgba(255,255,255,.65); display: flex; align-items: center; padding: 4px; }
.player-controls button:hover { color: #fff; }
.progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,.18);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}
.progress-fill {
  width: 28%;
  height: 100%;
  background: var(--red);
  border-radius: 2px;
  pointer-events: none;
}
.player-time { font-size: 12px; white-space: nowrap; color: rgba(255,255,255,.6); }

/* Info bar */
.player-info-bar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.info-bar-title    { font-size: 15px; font-weight: 700; }
.info-bar-ep-label { font-size: 12px; color: var(--muted); margin-top: 2px; }
.nav-btns          { display: flex; gap: 8px; flex-shrink: 0; }
.nav-btn {
  padding: 6px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  border: 1px solid var(--border);
  background: var(--white);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s, color .15s;
}
.nav-btn:hover    { border-color: var(--red); color: var(--red); }
.nav-btn:disabled { opacity: .38; cursor: not-allowed; }

/* Below-player content */
.below-player { background: var(--bg); }
.player-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 0;
}

/* Quick ep grid inside player page */
.quick-ep-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 14px;
}
.show-desc-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
}
.show-desc-title { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.show-desc-meta  { font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.show-desc-body  { font-size: 13px; color: var(--sub); line-height: 1.7; }

/* Sidebar episode list */
.ep-sidebar {
  background: var(--white);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - var(--nav-h) - 56px - 50px);
  overflow: hidden;
}
.ep-sidebar-title {
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  background: #fafafa;
  flex-shrink: 0;
}
.ep-sidebar-list { overflow-y: auto; flex: 1; }
.ep-sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 13px;
  border-bottom: 1px solid #f5f5f5;
  color: var(--text);
  transition: background .15s;
}
.ep-sidebar-item:hover  { background: #fff8f8; color: var(--red); }
.ep-sidebar-item.active { background: #fff0f0; color: var(--red); font-weight: 600; }
.ep-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  color: var(--sub);
}
.ep-sidebar-item.active .ep-num { background: var(--red); color: #fff; }
.ep-sidebar-item .ep-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ep-sidebar-item .ep-dur  { font-size: 11px; color: var(--muted); flex-shrink: 0; }

/* ══════════════════════════════════════
   WP-STYLE PAGE TITLE BAR (shared)
══════════════════════════════════════ */
.wp-page-title-bar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 28px 0 24px;
  margin-bottom: 40px;
}
.wp-page-title-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.wp-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.wp-breadcrumb a { color: var(--sub); transition: color .15s; }
.wp-breadcrumb a:hover { color: var(--red); }
.wp-breadcrumb .sep { color: #ccc; user-select: none; }
.wp-breadcrumb .current { color: var(--text); font-weight: 500; }
.wp-page-title-bar h1 {
  font-size: 30px;
  font-weight: 900;
  color: var(--text);
  line-height: 1.2;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.wp-title-count { font-size: 14px; color: var(--muted); font-weight: 400; }

/* ══════════════════════════════════════
   LISTING PAGE
══════════════════════════════════════ */
.listing-page    { padding: 0 0 48px; }

/* Category tabs (nav links, not filters) */
.cat-tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.cat-tab {
  display: block;
  padding: 10px 22px;
  font-size: 14px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .18s;
  white-space: nowrap;
}
.cat-tab:hover  { color: var(--text); }
.cat-tab.active { color: var(--red); font-weight: 700; border-bottom-color: var(--red); }
.listing-grid   { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }

/* ══════════════════════════════════════
   PAGINATION
══════════════════════════════════════ */
.pagination { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 36px; }
.page-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: var(--radius);
  font-size: 13px;
  background: var(--white);
  color: var(--text);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}
.page-btn:hover  { border-color: var(--red); color: var(--red); }
.page-btn.active { background: var(--red); color: #fff; border-color: var(--red); }
.page-btn:disabled { opacity: .38; cursor: not-allowed; }
.page-ellipsis { padding: 0 4px; color: var(--muted); }

/* ══════════════════════════════════════
   RELATED SECTION
══════════════════════════════════════ */
.related-section { padding-top: 8px; }

/* ══════════════════════════════════════
   FOOTER
══════════════════════════════════════ */
.site-footer {
  background: #2a2a2a;
  color: #b6b6b6;
  font-size: 13px;
  text-align: center;
  padding: 22px 16px;
  margin-top: 36px;
  line-height: 2.2;
}
.site-footer a:hover { color: rgba(255,255,255,.8); }
.footer-links { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; margin-bottom: 6px; }
.footer-links a { color: #b6b6b6; transition: color .18s; }

/* ══════════════════════════════════════
   HAMBURGER TOGGLE (hidden on desktop)
══════════════════════════════════════ */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  color: var(--text);
  flex-shrink: 0;
  margin-left: auto;
  transition: color .18s;
}
.nav-toggle:hover { color: var(--red); }

/* ══════════════════════════════════════
   EPISODE PAGE — NEW LAYOUT
══════════════════════════════════════ */
.ep-page-wrap { background: var(--bg); padding-bottom: 48px; }

/* 2-column page grid */
.ep-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  padding: 20px 0 0;
  align-items: start;
}

/* ── Main column ── */
.ep-main { min-width: 0; display: flex; flex-direction: column; gap: 12px; }

/* Episode header block */
.header-block {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.h1-title {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 8px;
}
.meta-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: var(--sub);
  background: #f5f5f5;
  border-radius: 20px;
  padding: 3px 10px;
}
.meta-badge svg { color: var(--muted); }
.description {
  font-size: 16px;
  color: var(--sub);
  line-height: 1.75;
  border-top: 1px solid #f5f5f5;
  padding-top: 10px;
  margin-top: 4px;
}

/* Video player */
.video-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0a0a0a;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}
.video-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}
.video-wrap .play-btn-vw {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.video-wrap .play-btn-vw:hover {
  transform: translate(-50%, -50%) scale(1.1);
  opacity: 0.9;
}
/* Coming Soon player placeholder */
.video-wrap--soon {
  cursor: default;
}
.coming-soon-player {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(135deg, #0d0d0d 0%, #1a1a2e 100%);
}
.coming-soon-player svg {
  opacity: 0.35;
  animation: cs-pulse 2.4s ease-in-out infinite;
}
@keyframes cs-pulse {
  0%, 100% { opacity: 0.25; transform: scale(1); }
  50%       { opacity: 0.55; transform: scale(1.08); }
}
.coming-soon-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  opacity: 0.85;
}
.coming-soon-sub {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.45);
  text-align: center;
  padding: 0 1.5rem;
}

.video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: linear-gradient(160deg, #0f0f1a 0%, #1a0a0a 100%);
  color: rgba(255,255,255,.5);
}
.episode-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.episode-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: var(--white);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: border-color .15s, color .15s, transform .15s;
}
.episode-nav-link:hover {
  border-color: var(--red);
  color: var(--red);
  transform: translateY(-1px);
}
.episode-nav-link strong {
  font-size: 15px;
  font-weight: 700;
}
.episode-nav-link span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
}
@media (max-width: 640px) {
  .episode-nav { grid-template-columns: 1fr; }
}
.video-placeholder p { font-size: 14px; letter-spacing: .3px; }
.play-big {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(232,0,45,.15);
  border: 3px solid rgba(232,0,45,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(232,0,45,.9);
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .15s;
}
.play-big:hover {
  background: rgba(232,0,45,.35);
  border-color: #e8002d;
  color: #fff;
  transform: scale(1.08);
}
.play-big svg { margin-left: 4px; }

/* Server selection */
.server-section, .detail-section {
  background: var(--white);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.server-section-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 10px;
}
.server-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.server-btn {
  padding: 7px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--sub);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.server-btn:hover  { border-color: var(--red); color: var(--red); }
.server-btn.active { background: var(--red); color: #fff; border-color: var(--red); }
.download-section { margin-top: 0; border-top: 1px solid var(--border, #eee); border-radius: 0 0 var(--radius) var(--radius); }
.download-btn { text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.download-btn:hover { border-color: var(--red); color: var(--red); }

/* Episode list */
.ep-list-section {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
}
.ep-list-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: #fafafa;
}
.ep-list-hd-title {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ep-list-hd-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 16px;
  background: var(--red);
  border-radius: 2px;
}
.ep-list-count { font-size: 12px; color: var(--muted); font-weight: 400; }
.ep-list-box {
  display: grid;
  grid-template-columns: 1fr;
}
.ep-entry {
  display: block;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--sub);
  border-bottom: 1px solid #f5f5f5;
  transition: background .12s, color .12s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ep-entry:hover  { background: #fff8f8; color: var(--red); }
.ep-entry.active { background: #fff0f0; color: var(--red); font-weight: 600; }

/* ── Sidebar ── */
.aside {
  position: sticky;
  top: calc(var(--nav-h) + 12px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.aside-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
}
.aside-title {
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  background: #fafafa;
  display: flex;
  align-items: center;
  gap: 8px;
}
.aside-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 16px;
  background: var(--red);
  border-radius: 2px;
}

/* Ongoing series mini cards */
.aside-item {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #f5f5f5;
  color: inherit;
  transition: background .12s;
  align-items: flex-start;
}
.aside-item:last-child { border-bottom: none; }
.aside-item:hover { background: #fff8f8; }
.aside-thumb {
  width: 52px;
  height: 74px;
  border-radius: 3px;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}
.aside-thumb .poster-bg { position: absolute; inset: 0; }
.aside-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 2px;
}
.aside-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.aside-item:hover .aside-title { color: var(--red); }
.aside-badge {
  display: inline-block;
  font-size: 11px;
  background: #fff0f0;
  color: var(--red);
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid #ffd0d0;
  width: fit-content;
}
.aside-meta { font-size: 12px; color: var(--muted); }

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 1024px) {
  .card-grid, .listing-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 900px) {
  .ep-layout { grid-template-columns: 1fr; }
  .aside { position: static; }
  .ep-list-box { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  /* Responsive nav */
  .nav-toggle { display: flex; margin-left: 0; }
  .search-trigger { margin-left: auto; }
  .site-nav {
    display: none;
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--white);
    border-top: 1px solid var(--border);
    box-shadow: 0 8px 32px rgba(0,0,0,.15);
    z-index: 9999;
    max-height: calc(100vh - var(--nav-h));
    overflow-y: auto;
  }
  .site-nav.open { display: flex; }
  /* ul.menu stacks vertically */
  .site-nav ul.menu { flex-direction: column; width: 100%; padding: 4px 0; }
  .site-nav ul.menu > li.menu-item { width: 100%; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; align-items: center; }
  .site-nav ul.menu > li.menu-item:last-child { border-bottom: none; }
  .site-nav ul.menu > li.menu-item > a {
    flex: 1;
    height: 48px;
    padding: 0 20px;
    border-bottom: none !important;
    border-top: none !important;
    border-left: 3px solid transparent;
    font-size: 14px;
  }
  .site-nav ul.menu > li.menu-item > a::after { display: none; }
  .site-nav ul.menu > li.menu-item.current-menu-item > a { border-left-color: var(--red); background: #fff5f5; }
  /* Sub-menu toggle button */
  .sub-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    color: var(--muted);
    border-left: 1px solid var(--border);
    transition: color .18s, transform .2s;
    flex-shrink: 0;
  }
  .sub-menu-toggle:hover { color: var(--red); }
  .sub-menu-toggle.open { transform: rotate(180deg); color: var(--red); }
  /* Sub-menu panel */
  .site-nav ul.sub-menu {
    display: none;
    position: static;
    width: 100%;
    background: var(--bg);
    border-top: 1px solid var(--border);
    box-shadow: none;
    border-radius: 0;
    border-left: none;
    border-right: none;
    padding: 4px 0;
    min-width: 0;
  }
  .site-nav ul.sub-menu.open { display: block; }
  .site-nav ul.sub-menu li.menu-item a {
    padding: 11px 20px 11px 36px;
    font-size: 13px;
    border-left: 3px solid transparent;
  }
  .site-nav ul.sub-menu li.menu-item a:hover { border-left-color: var(--red); background: #fff5f5; }
  .search-modal { padding-top: 60px; }
  .header-user   { display: none; }
  /* Breadcrumb */
  .breadcrumb { font-size: 12px; padding: 7px 10px; gap: 3px; }
  /*.breadcrumb > span:last-child { max-width: 160px; }*/
  /* Cards */
  .card-grid, .listing-grid { grid-template-columns: repeat(3, 1fr); }
  /* Detail */
  .detail-hero { grid-template-columns: 140px 1fr; gap: 14px; }
  .detail-poster { width: 140px; }
  .detail-title { font-size: 18px; }
}
@media (max-width: 540px) {
  .breadcrumb { font-size: 11px; padding: 6px 8px; }
  /*.breadcrumb > span:last-child { max-width: 110px; }*/
  .card-grid, .listing-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-hero { grid-template-columns: 1fr; }
  .detail-poster { width: 220px; margin: 0 auto; }
  .h1-title { font-size: 20px; }
  .play-big { width: 64px; height: 64px; }
}

/* ── Share Block ── */
.share-block {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.share-heading {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--sub);
  margin-bottom: 10px;
}
.share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #fff;
  transition: transform .15s ease, filter .15s ease;
  flex-shrink: 0;
}
.share-btn:hover {
  transform: scale(1.12);
  filter: brightness(1.15);
}
.share-btn--facebook  { background: #1877f2; }
.share-btn--twitter   { background: #1da1f2; }
.share-btn--whatsapp  { background: #25d366; }
.share-btn--telegram  { background: #229ed9; }
.share-btn--pinterest { background: #e60023; }
.share-btn--reddit    { background: #ff4500; }
.heading-1 {  border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.card-poster img { width: auto; height: auto; }
/* ── A–Z page ── */
.az-page {
  padding: 0 0 56px;
}

/* Alphabet jump bar */
.az-jumpbar {
  position: sticky;
  top: var(--nav-h);
  z-index: 100;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  margin-bottom: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.az-jumpbar a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 4px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 700;
  color: var(--sub);
  transition: background .14s, color .14s;
}

.az-jumpbar a:hover {
  background: #fff0f0;
  color: var(--red);
}

.az-jumpbar a.empty {
  color: #ccc;
  pointer-events: none;
}

.az-jumpbar a.has-items {
  color: var(--text);
}

.az-jumpbar .jump-sep {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: auto 6px;
  flex-shrink: 0;
}

/* Letter section */
.az-section {
  margin-bottom: 28px;
  scroll-margin-top: calc(var(--nav-h) + 58px);
}

.az-letter-hd {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 10px;
}

.az-letter {
  font-size: 22px;
  font-weight: 900;
  color: var(--red);
  line-height: 1;
  width: 28px;
  flex-shrink: 0;
}

.az-letter-count {
  font-size: 12px;
  color: var(--muted);
}

/* Drama list inside a section */
.az-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.az-item {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--white);
  padding: 8px 12px;
  color: inherit;
  transition: background .12s;
  min-width: 0;
  gap: 8px;
}

.az-item:hover {
  background: #fff8f8;
}

.az-item:hover .az-item-title {
  color: var(--red);
}

.az-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  transition: color .12s;
}

/* Responsive */
@media (max-width: 900px) {
  .az-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 540px) {
  .az-list {
    grid-template-columns: 1fr;
  }

  .az-jumpbar {
    gap: 1px;
  }

  .az-jumpbar a {
    min-width: 26px;
    height: 26px;
    font-size: 12px;
  }
}
.error-404-wrap {
  min-height: calc(100vh - 50px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 16px;
  background: var(--bg);
}

.error-404-inner {
  max-width: 680px;
  width: 100%;
  text-align: center;
}

.error-404-screen {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 220px;
  height: 140px;
  background: #1a1a1a;
  border-radius: 10px;
  margin: 0 auto 32px;
  box-shadow: 0 0 0 6px #2a2a2a, 0 0 0 8px #111, 0 20px 60px rgba(0, 0, 0, .3);
}

.error-404-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 10px;
  background: repeating-linear-gradient(0deg,
      transparent,
      transparent 2px,
      rgba(0, 0, 0, .07) 2px,
      rgba(0, 0, 0, .07) 4px);
  pointer-events: none;
  z-index: 2;
}

.error-404-screen::after {
  content: '';
  position: absolute;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 14px;
  background: #2a2a2a;
  border-radius: 0 0 4px 4px;
}

.error-404-num {
  font-size: 72px;
  font-weight: 900;
  letter-spacing: -4px;
  color: var(--red);
  line-height: 1;
  text-shadow: 0 0 30px rgba(168, 0, 32, .5);
  animation: flicker 4s infinite;
  position: relative;
  z-index: 1;
}

@keyframes flicker {

  0%,
  93%,
  95%,
  97%,
  100% {
    opacity: 1;
  }

  94%,
  96% {
    opacity: .4;
  }
}

.error-404-stand {
  width: 30px;
  height: 28px;
  background: #2a2a2a;
  margin: 0 auto 40px;
  border-radius: 0 0 4px 4px;
  clip-path: polygon(30% 0, 70% 0, 100% 100%, 0% 100%);
}

.error-404-heading {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: -.5px;
}

.error-404-sub {
  font-size: 15px;
  color: var(--sub);
  margin-bottom: 36px;
  line-height: 1.6;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.error-404-search {
  display: flex;
  align-items: center;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 40px;
  padding: 6px 6px 6px 20px;
  max-width: 440px;
  margin: 0 auto 36px;
  box-shadow: var(--shadow);
  transition: border-color .2s;
}

.error-404-search:focus-within {
  border-color: var(--red);
}

.error-404-search input[type="search"] {
  flex: 1;
  font-size: 15px;
  color: var(--text);
  background: transparent;
  min-width: 0;
}

.error-404-search input[type="search"]::placeholder {
  color: var(--muted);
}

.error-404-search input[type="search"]::-webkit-search-cancel-button {
  display: none;
}

.error-404-search button[type="submit"] {
  background: var(--red);
  color: #fff;
  border-radius: 40px;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
  transition: background .18s, transform .15s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.error-404-search button[type="submit"]:hover {
  background: var(--red-dark);
  transform: scale(1.03);
}

.error-404-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.error-404-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  transition: background .18s, color .18s, transform .15s;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text);
}

.error-404-btn:hover {
  border-color: var(--red);
  color: var(--red);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(168, 0, 32, .1);
}

.error-404-btn.primary {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

.error-404-btn.primary:hover {
  background: var(--red-dark);
  color: #fff;
  border-color: var(--red-dark);
}