/* ===========================================================
   Phim2 Flix — dark theme, card NGANG (landscape 16:9)
   Vanilla, không framework. Design tokens ở :root.
   =========================================================== */

:root {
  --bg:        #0b0d12;
  --bg-2:      #12151d;
  --surface:   #171b25;
  --surface-2: #1e2330;
  --line:      #262c3a;
  --text:      #e8ebf2;
  --muted:     #8b93a7;
  --accent:    #ff3d6e;   /* hồng-đỏ, hợp tube-site */
  --accent-2:  #ffb020;   /* vàng badge chất lượng */
  --radius:    12px;
  --radius-sm: 8px;
  --wrap:      1240px;
  --gap:       16px;
  --header-h:  60px;
  --shadow:    0 8px 30px rgba(0,0,0,.45);
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(12px, 3vw, 24px); }
.muted { color: var(--muted); }

/* View Transitions MPA (chuyển trang mượt) */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root) { animation: vt-out .14s ease both; }
  ::view-transition-new(root) { animation: vt-in .16s ease both; }
}
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }

/* ---------------- Header ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  height: var(--header-h);
  display: flex; align-items: center; gap: 18px;
}
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; letter-spacing: .3px; color: var(--text); min-width: 0; flex: 0 0 auto; }
.brand__mark { color: var(--accent); flex: 0 0 auto; }
.brand__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 44vw; }
.brand:hover { color: var(--text); }
.site-logo { height: 30px; width: auto; display: block; }
.site-footer .site-logo { height: 34px; }
@media (max-width: 460px) { .site-logo { height: 26px; } }

.site-nav { flex: 1; }
.nav-list { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; align-items: center; }
.nav-list > li { position: relative; }
.nav-list a { display: inline-flex; align-items: center; gap: 4px; padding: 8px 12px; border-radius: var(--radius-sm); color: var(--muted); font-weight: 600; font-size: 14px; }
.nav-list a:hover, .nav-list .current-menu-item > a, .nav-list .has-sub:hover > a { color: var(--text); background: var(--surface); }
.nav-list .caret { font-size: 10px; }

/* dropdown submenu */
.sub-menu {
  list-style: none; margin: 0; padding: 6px; position: absolute; top: calc(100% + 4px); left: 0;
  min-width: 320px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
  opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .18s, transform .18s, visibility .18s; z-index: 60;
}
.nav-list .has-sub:hover > .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.sub-menu a { display: block; padding: 8px 10px; font-size: 13px; white-space: nowrap; color: var(--muted); }
.sub-menu a:hover { color: var(--text); background: var(--surface); }

.search { position: relative; display: flex; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 4px 4px 14px; }
.search input { background: transparent; border: 0; outline: 0; color: var(--text); width: 200px; font-size: 14px; }
.search input::placeholder { color: var(--muted); }
.search button { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; cursor: pointer; flex: 0 0 auto; }
.search__drop {
  position: absolute; top: calc(100% + 8px); right: 0; width: min(420px, 86vw);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; z-index: 60;
}
.search__drop a { display: flex; gap: 10px; padding: 8px 12px; align-items: center; }
.search__drop a:hover { background: var(--surface); }
.search__drop img { width: 60px; height: 34px; object-fit: cover; border-radius: 6px; flex: 0 0 auto; }
.search__drop .sg-t { font-weight: 600; font-size: 14px; }
.search__drop .sg-o { color: var(--muted); font-size: 12px; }

.hamb { display: none; flex-direction: column; gap: 4px; width: 38px; height: 38px; border: 0; background: transparent; cursor: pointer; padding: 8px; flex: 0 0 auto; }
.hamb span { height: 2px; background: var(--text); border-radius: 2px; transition: .2s; }

/* ---------------- Hero slider ---------------- */
.hero-slider { position: relative; margin-top: 20px; border-radius: var(--radius); overflow: hidden; cursor: grab; touch-action: pan-y; }
.hero-slider.is-grabbing { cursor: grabbing; user-select: none; }
.hero-slider.is-grabbing .hero__inner { pointer-events: none; }
/* cao hơn cho hoành tráng, cap để không quá khổ */
.hero-slider__track { position: relative; min-height: clamp(420px, 46vw, 600px); }
.hero {
  position: absolute; inset: 0; display: flex; align-items: flex-end;
  /* crop lên phía trên (18%) để không cắt mất đầu/mặt nhân vật */
  background: var(--hero-bg) center 18% / cover no-repeat, var(--surface);
  opacity: 0; visibility: hidden; transition: opacity .6s ease;
}
.hero.is-active { opacity: 1; visibility: visible; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(11,13,18,.96) 12%, rgba(11,13,18,.35) 60%, transparent); }
.hero__inner { position: relative; z-index: 2; padding: clamp(18px, 4vw, 44px); max-width: 680px; }
.hero__title {
  font-size: clamp(22px, 3.4vw, 36px); margin: 0 0 6px; font-weight: 800; line-height: 1.2;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hero__orig { color: var(--muted); margin: 0 0 12px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }

/* điều hướng slider */
.hero-slider__nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 44px; height: 44px; border-radius: 999px; border: 0; cursor: pointer;
  background: rgba(0,0,0,.4); color: #fff; font-size: 26px; line-height: 1;
  display: grid; place-items: center; opacity: 0; transition: opacity .2s, background .2s;
}
.hero-slider:hover .hero-slider__nav { opacity: 1; }
.hero-slider__nav:hover { background: var(--accent); }
.hero-slider__nav--prev { left: 12px; }
.hero-slider__nav--next { right: 12px; }
.hero-slider__dots { position: absolute; bottom: 16px; right: 20px; z-index: 3; display: flex; gap: 8px; }
.hero-slider__dot { width: 9px; height: 9px; padding: 0; border: 0; border-radius: 999px; background: rgba(255,255,255,.4); cursor: pointer; transition: width .25s, background .25s; }
.hero-slider__dot.is-active { width: 26px; background: var(--accent); }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 999px; font-weight: 700; cursor: pointer; border: 0; font-size: 15px; }
.btn--play { background: var(--accent); color: #fff; }
.btn--play:hover { color: #fff; filter: brightness(1.08); }
.btn--ghost { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.chip { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--muted); }
.chip--q { background: var(--accent-2); color: #211a00; border-color: transparent; }

/* ---------------- Section ---------------- */
.mv-section { margin-top: 34px; }
.mv-section__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.mv-section__title { font-size: 20px; font-weight: 800; margin: 0; position: relative; padding-left: 12px; }
.mv-section__title::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 4px; border-radius: 2px; background: var(--accent); }
.mv-section__more { color: var(--muted); font-weight: 600; font-size: 13px; }

/* ---------------- Top 10 (cuộn ngang, số lớn) ---------------- */
.top10-row {
  display: flex; gap: 6px; overflow-x: auto; padding: 6px 0 14px;
  scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.top10-row::-webkit-scrollbar { height: 8px; }
.top10-row::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
.top10-item { display: flex; align-items: flex-end; flex: 0 0 auto; scroll-snap-align: start; }
.top10-rank {
  font-size: clamp(70px, 11vw, 130px); font-weight: 900; line-height: .72; font-style: italic;
  color: var(--bg); -webkit-text-stroke: 3px var(--muted); text-stroke: 3px var(--muted);
  margin-right: -24px; margin-bottom: 34px; user-select: none; letter-spacing: -6px;
}
.top10-card { width: 230px; flex: 0 0 auto; }
.top10-card .mv-card__badge--ep { right: 8px; }
@media (max-width: 720px) {
  .top10-card { width: 170px; }
  .top10-rank { margin-right: -16px; margin-bottom: 26px; -webkit-text-stroke-width: 2px; }
}

/* ---------------- Grid card NGANG ---------------- */
.mv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: var(--gap);
}
.mv-card { background: transparent; }
.mv-card__thumb {
  position: relative; display: block; aspect-ratio: 16 / 9; border-radius: var(--radius-sm);
  overflow: hidden; background: var(--surface); box-shadow: 0 2px 10px rgba(0,0,0,.3);
}
.mv-card__img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease, opacity .3s; }
.mv-card:hover .mv-card__img { transform: scale(1.06); }
.mv-card__play {
  position: absolute; inset: 0; margin: auto; width: 44px; height: 44px; color: #fff;
  display: grid; place-items: center; opacity: 0; transition: opacity .2s;
  background: rgba(0,0,0,.35); border-radius: 999px; pointer-events: none;
}
.mv-card:hover .mv-card__play { opacity: 1; }
.mv-card__badge {
  position: absolute; top: 8px; font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 6px;
}
.mv-card__badge--q { left: 8px; background: var(--accent-2); color: #211a00; }
.mv-card__badge--ep { right: 8px; background: rgba(0,0,0,.7); color: #fff; }
.mv-card__views {
  position: absolute; bottom: 8px; left: 8px; display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; color: #fff; background: rgba(0,0,0,.6); padding: 2px 7px; border-radius: 6px;
}
.mv-card__meta { padding: 8px 2px 0; }
.mv-card__title { font-size: 14px; font-weight: 600; margin: 0; line-height: 1.35; }
.mv-card__title a { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.mv-card__orig { font-size: 12px; color: var(--muted); margin: 2px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------- Giới thiệu SEO trang chủ ---------------- */
.home-intro { margin: 34px 0 10px; padding: 22px 24px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); }
.home-intro__title { font-size: 18px; margin: 0 0 12px; }
.home-intro__body { color: #aeb6c4; line-height: 1.8; font-size: 14px; }
.home-intro__body p { margin: 0 0 12px; }
.home-intro__body strong { color: var(--text); font-weight: 700; }
.home-intro__body h2 { font-size: 17px; margin: 20px 0 8px; color: var(--text); }
.home-intro__body h3 { font-size: 15px; margin: 14px 0 6px; color: var(--text); }
.home-intro__body ul { margin: 8px 0 12px; padding-left: 20px; }
.home-intro__body li { margin: 4px 0; }
/* thu gọn / xem thêm */
.home-intro__body.is-clamped { max-height: 210px; overflow: hidden; position: relative; }
.home-intro__body.is-clamped::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 96px; background: linear-gradient(transparent, var(--bg-2)); pointer-events: none; }
.home-intro.is-open .home-intro__body.is-clamped { max-height: none; }
.home-intro.is-open .home-intro__body.is-clamped::after { display: none; }
.home-intro__toggle { display: inline-flex; align-items: center; margin-top: 14px; background: none; border: 1px solid var(--line); color: var(--accent); padding: 9px 20px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 13px; }
.home-intro__toggle:hover { border-color: var(--accent); background: var(--surface); }

/* ---------------- SEO desc + FAQ (AEO) ---------------- */
.movie__seo { color: #b8bfcc; line-height: 1.75; font-size: 14px; margin: 14px 0; }
.movie__faq { margin: 20px 0; }
.movie__faq h2 { font-size: 18px; margin: 0 0 12px; }
.faq-item { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); margin-bottom: 8px; overflow: hidden; }
.faq-item summary { cursor: pointer; padding: 12px 14px; font-weight: 600; font-size: 14px; list-style: none; position: relative; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 14px; color: var(--accent); font-size: 18px; }
.faq-item[open] summary::after { content: "–"; }
.faq-item p { margin: 0; padding: 0 14px 14px; color: var(--muted); line-height: 1.7; font-size: 14px; }

/* ---------------- Page / bài viết thường ---------------- */
.page-single { max-width: 860px; margin: 24px auto; }
.entry-content { line-height: 1.8; color: #cdd3e0; }
.entry-content h2, .entry-content h3 { color: var(--text); margin: 1.4em 0 .5em; }
.entry-content a { color: var(--accent); }
.entry-content img { border-radius: var(--radius-sm); height: auto; }
.brand--logo img { height: 40px; width: auto; display: block; }

/* ---------------- Page head + pagination ---------------- */
.page-head { margin: 24px 0 8px; }
.page-head__title { font-size: 24px; font-weight: 800; margin: 0; }
.page-head__desc { color: var(--muted); margin-top: 6px; }
.pagination { display: flex; justify-content: center; gap: 6px; margin: 32px 0; flex-wrap: wrap; }
.pagination .page-numbers {
  display: grid; place-items: center; min-width: 38px; height: 38px; padding: 0 10px;
  border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); color: var(--text); font-weight: 600;
}
.pagination .page-numbers.current { background: var(--accent); border-color: transparent; color: #fff; }
.pagination a.page-numbers:hover { border-color: var(--accent); color: var(--accent); }
.empty { padding: 40px 0; text-align: center; color: var(--muted); }

/* ---------------- Single: player + info ---------------- */
.single { margin-top: 20px; }
.player-box { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.player-box iframe, .player-box video, .player-box video-player { width: 100%; height: 100%; border: 0; display: block; }
.player-facade { position: absolute; inset: 0; cursor: pointer; background: var(--poster) center/cover no-repeat, #000; display: grid; place-items: center; }
.player-facade::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.25); }
.player-facade__play { position: relative; z-index: 2; background: transparent; border: 0; cursor: pointer; transition: transform .2s; }
.player-facade__play:hover { transform: scale(1.08); }
.player-facade__title { position: absolute; z-index: 2; bottom: 14px; left: 16px; right: 16px; font-weight: 700; font-size: clamp(15px,2.4vw,20px); text-shadow: 0 2px 8px rgba(0,0,0,.8); }
.player-msg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); text-align: center; padding: 20px; z-index: 3; }

.watch-bar { display: flex; align-items: center; gap: 14px; margin: 12px 0; }
.watch-bar__title { font-weight: 700; }

/* Nút chuyển server (render bởi app.js khi phim có >=2 nguồn) */
.server-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.server-tabs button {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; line-height: 1;
  border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line);
  color: var(--text); font-weight: 600; font-size: 13px; cursor: pointer;
}
.server-tabs button:hover { border-color: var(--accent); color: var(--accent); }
.server-tabs button.cur { background: var(--accent); border-color: transparent; color: #fff; }
.server-tabs button.cur:hover { color: #fff; }

.episodes { margin: 18px 0; }
.episodes__server { margin-bottom: 14px; }
.episodes__svname { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.episodes__list { display: flex; flex-wrap: wrap; gap: 8px; }
.ep { display: inline-flex; align-items: center; padding: 8px 14px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.ep:hover { border-color: var(--accent); color: var(--accent); }
.ep--active { background: var(--accent); border-color: transparent; color: #fff; }
.ep--active:hover { color: #fff; }

.movie { display: grid; grid-template-columns: 340px 1fr; gap: 26px; margin: 26px 0; }
.single--watch .movie { margin-top: 20px; }
.movie__poster { position: relative; }
.movie__img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); }
.movie__playbtn { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); }
.movie__title { font-size: clamp(22px,3vw,30px); font-weight: 800; margin: 0 0 4px; }
.movie__orig { color: var(--muted); margin: 0 0 14px; }
.movie__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.movie__facts { display: grid; gap: 8px; margin: 0 0 18px; }
.movie__facts > div { display: grid; grid-template-columns: 92px 1fr; gap: 10px; font-size: 14px; }
.movie__facts dt { color: var(--muted); }
.movie__facts dd { margin: 0; }
.movie__facts a { color: var(--text); }
.movie__facts a:hover { color: var(--accent); }
.movie__desc { color: #cdd3e0; line-height: 1.7; margin-bottom: 16px; }
.movie__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.movie__tags a { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.movie__tags a:hover { color: var(--accent); border-color: var(--accent); }

/* ---------------- Footer ---------------- */
.site-footer { margin-top: 50px; border-top: 1px solid var(--line); background: var(--bg-2); }
.site-footer__inner { display: grid; grid-template-columns: 1.9fr 1fr 1fr 1.4fr; gap: 30px; padding: 40px 0 26px; }
.site-footer h4 { font-size: 14px; margin: 0 0 14px; color: var(--text); }
.site-footer__desc { font-size: 13px; line-height: 1.75; margin: 12px 0 14px; max-width: 340px; }
.site-footer__adult { display: inline-block; font-size: 11px; font-weight: 700; color: var(--accent); border: 1px solid var(--accent); border-radius: 999px; padding: 3px 10px; }
.foot-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.foot-links a { font-size: 13px; color: var(--muted); }
.foot-links a:hover { color: var(--accent); }
.foot-tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.foot-tags a { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.foot-tags a:hover { color: var(--accent); border-color: var(--accent); }
.site-footer__bottom { padding: 18px 0 34px; border-top: 1px solid var(--line); }
.site-footer__legal { font-size: 12px; line-height: 1.7; margin-top: 6px; max-width: 940px; opacity: .8; }

/* ---------------- Cá nhân hoá / khám phá ---------------- */
/* header actions (random / danh sách / lịch sử) */
.header-actions { display: flex; gap: 4px; flex: 0 0 auto; }
.header-actions__btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-sm); color: var(--muted); }
.header-actions__btn:hover { color: var(--text); background: var(--surface); }

/* nút tim trên card */
.mv-card__fav {
  position: absolute; top: 8px; right: 8px; z-index: 3; width: 34px; height: 34px; padding: 0;
  display: grid; place-items: center; border: 0; border-radius: 999px; cursor: pointer;
  background: rgba(0,0,0,.5); color: #fff; opacity: 0; transition: opacity .2s, color .2s, transform .15s;
}
.mv-card:hover .mv-card__fav { opacity: 1; }
.mv-card__fav:hover { transform: scale(1.12); }
.mv-card__fav.is-on { opacity: 1; color: var(--accent); }
/* khi có badge ep góc phải, đẩy tim xuống chút */
.mv-card__badge--ep { top: 8px; right: 48px; }

/* hàng Xem tiếp */
.cw-card__x {
  position: absolute; top: 6px; right: 6px; z-index: 4; width: 26px; height: 26px; border: 0; border-radius: 999px;
  background: rgba(0,0,0,.6); color: #fff; font-size: 18px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .2s;
}
.cw-card:hover .cw-card__x { opacity: 1; }
.cw-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.25); }
.cw-progress > span { display: block; height: 100%; background: var(--accent); }

/* page-head có nút bên phải */
.page-head--row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* follow diễn viên + nút lưu on-state */
.js-follow.is-on, .js-fav-btn.is-on { background: var(--accent); border-color: transparent; color: #fff; }

/* thanh xem phim: actions bên phải */
.watch-bar__actions { margin-left: auto; display: flex; gap: 8px; }
.watch-bar__actions .btn { padding: 8px 14px; font-size: 13px; }

/* trang lọc */
.filter-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin: 8px 0 20px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.filter-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.filter-field select {
  min-width: 160px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text); font-size: 14px; cursor: pointer;
}
.filter-bar .btn { min-height: 42px; }

/* badge không che */
.mv-card__badge--unc { bottom: 8px; right: 8px; top: auto; background: var(--accent); color: #fff; }

/* trang A-Z studio */
.az-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 24px; position: sticky; top: var(--header-h); background: var(--bg); padding: 10px 0; z-index: 10; }
.az-nav a { display: grid; place-items: center; min-width: 34px; height: 34px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); font-weight: 700; font-size: 13px; }
.az-nav a:hover { border-color: var(--accent); color: var(--accent); }
.az-group { margin-bottom: 28px; scroll-margin-top: calc(var(--header-h) + 60px); }
.az-group__letter { font-size: 22px; font-weight: 800; margin: 0 0 12px; color: var(--accent); }
.az-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.az-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); }
.az-item:hover { border-color: var(--accent); }
.az-item__name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.az-item__count { flex: 0 0 auto; font-size: 12px; color: var(--muted); background: var(--surface-2); padding: 2px 8px; border-radius: 999px; }

/* ================= BIẾN THỂ B: tông XANH LÁ + SIDEBAR (69vnsex) ================= */
.ui-green {
  --bg: #0a0f0b; --bg-2: #0e150f; --surface: #131c15; --surface-2: #1a271c;
  --line: #23331f; --accent: #22c55e; --accent-2: #a3e635;
}
/* layout sidebar (desktop) */
.site-body { }
.ui-sidebar .site-body {
  display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 24px;
  max-width: 1460px; margin: 0 auto; padding: 20px clamp(12px, 3vw, 24px); align-items: start;
}
.ui-sidebar .site-content { min-width: 0; }
.ui-sidebar .site-content > .wrap { max-width: none; margin: 0; padding: 0; }
.site-sidebar {
  position: sticky; top: calc(var(--header-h) + 16px);
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; max-height: calc(100vh - var(--header-h) - 32px); overflow-y: auto; scrollbar-width: thin;
}
.sb-nav { display: flex; flex-direction: column; gap: 2px; }
.sb-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); color: var(--muted); font-weight: 600; font-size: 14px; }
.sb-nav a:hover { background: var(--surface); color: var(--accent); }
.sb-block { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.sb-title { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 0 0 10px; }
.sb-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.sb-tags a { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.sb-tags a:hover { color: var(--accent); border-color: var(--accent); }
.sb-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.sb-links a { font-size: 13px; color: var(--muted); }
.sb-links a:hover { color: var(--accent); }
@media (max-width: 980px) {
  .ui-sidebar .site-body { grid-template-columns: 1fr; padding: 0; max-width: none; }
  .site-sidebar { display: none; }
  .ui-sidebar .site-content > .wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(12px, 3vw, 24px); }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
  .movie { grid-template-columns: 1fr; }
  .movie__poster { max-width: 420px; }
  .site-footer__inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .site-header__inner { gap: 10px; }
  .hamb { display: flex; width: 44px; height: 44px; }
  .site-nav {
    position: fixed; inset: var(--header-h) 0 auto 0; background: var(--bg-2); border-bottom: 1px solid var(--line);
    transform: translateY(-120%); transition: transform .25s; padding: 10px; z-index: 40;
    max-height: calc(100vh - var(--header-h)); max-height: calc(100dvh - var(--header-h)); overflow-y: auto; -webkit-overflow-scrolling: touch;
  }
  .site-nav.open { transform: translateY(0); }
  .nav-list { flex-direction: column; align-items: stretch; }
  .nav-list > li { position: static; }
  .nav-list a { display: flex; align-items: center; min-height: 44px; }
  /* dropdown mobile: tĩnh, ẩn cho tới khi tap mở */
  .sub-menu {
    position: static; display: none; grid-template-columns: 1fr 1fr; min-width: 0;
    opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0;
    background: var(--surface); border-radius: var(--radius-sm); margin: 2px 0 6px; padding: 4px;
  }
  .has-sub.open > .sub-menu { display: grid; }
  .has-sub.open > a .caret { transform: rotate(180deg); }
  /* search chiếm phần còn lại của hàng (site-nav là position:fixed nên không tranh chỗ) */
  .search { flex: 1 1 auto; min-width: 0; }
  .search input { width: 100%; min-width: 0; }
  .search button { width: 44px; height: 44px; }
  /* touch target >= 44px */
  .pagination .page-numbers { min-width: 44px; height: 44px; }
  .ep { min-height: 44px; padding: 0 16px; }
  .episodes__list { gap: 10px; }
  .mv-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  /* hero slider mobile */
  .hero-slider__track { min-height: clamp(320px, 62vw, 440px); }
  .hero { background-position: center 12%; }
  .hero-slider__nav { opacity: 1; width: 40px; height: 40px; background: rgba(0,0,0,.5); }
  .hero-slider__dots { right: 50%; transform: translateX(50%); bottom: 12px; }
}
@media (max-width: 460px) {
  .search { padding-left: 10px; }
  .site-footer__inner { grid-template-columns: 1fr; }
}

/* Skeleton ảnh chống nhấp nháy */
.thumb, .mv-card__img, .movie__img { background: linear-gradient(110deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%); background-size: 200% 100%; }
