/*
Theme Name: Chill Movie
Description: Theme phim giao diện tối kiểu PhimMoi: ưu tiên mobile, menu ngăn kéo, slider phim HOT, thẻ poster, trang phim có chấm sao, thích, bình luận + Facebook. Nhẹ, không jQuery, chuẩn SEO. Dùng cùng plugin NguonC Crawler.
Version: 3.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: chill-movie
*/

:root {
  --bg: #0e1117;
  --panel: #151a23;
  --panel-2: #1c2330;
  --line: #252d3b;
  --text: #e8ebf2;
  --muted: #8b96a9;
  --accent: #ff5a36;
  --accent-dark: color-mix(in srgb, var(--accent) 80%, #000);
  --radius: 10px;
  --max: 1200px;
  --side: 300px;
  --hd: 56px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
body.nav-open { overflow: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .5em; }
p { margin: 0 0 .8em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 14px; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { display: inline-block; vertical-align: -3px; flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ============ Header ============ */
.site-header { position: sticky; top: 0; z-index: 80; background: rgba(14, 17, 23, .96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.hd { display: flex; align-items: center; gap: 14px; height: var(--hd); }
.icon-btn { display: none; align-items: center; justify-content: center; width: 42px; height: 42px; border: 0; background: transparent; border-radius: 50%; cursor: pointer; }
.icon-btn:active { background: var(--panel-2); }
.logo { flex: none; display: flex; align-items: center; min-width: 0; }
.logo img { max-height: 36px; width: auto; }
.logo-t { font-size: 22px; font-weight: 800; letter-spacing: -.3px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo-t::first-letter { color: var(--accent); }

.mainnav { flex: 1 1 auto; min-width: 0; }
.nav-head { display: none; }
.menu { display: flex; align-items: center; gap: 2px; flex-wrap: nowrap; }
.menu > li { position: relative; }
.menu > li > a { display: flex; align-items: center; gap: 4px; height: var(--hd); padding: 0 11px; font-weight: 600; font-size: 14px; color: #cdd3df; white-space: nowrap; }
.menu > li:hover > a, .menu > li.on > a { color: #fff; }
.menu > li.on > a { box-shadow: inset 0 -3px 0 var(--accent); }
.caret { border: 4px solid transparent; border-top-color: currentColor; margin-top: 4px; }
.dd-menu {
  display: none; position: absolute; top: 100%; left: 0; z-index: 90; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius); padding: 10px; box-shadow: 0 14px 30px rgba(0, 0, 0, .5); gap: 2px;
  grid-template-columns: repeat(4, 130px); max-height: 70vh; overflow: auto;
}
.dd-menu.cols-3 { grid-template-columns: repeat(3, 130px); }
.dd:hover > .dd-menu, .dd.open > .dd-menu { display: grid; }
.dd-menu a { padding: 7px 10px; border-radius: 6px; font-size: 13px; color: #cdd3df; }
.dd-menu a:hover { background: var(--accent); color: #fff; }

.search { position: relative; flex: 0 1 300px; display: flex; margin-left: auto; }
.search input {
  width: 100%; height: 38px; padding: 0 42px 0 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel); color: var(--text); font-size: 14px; outline: none;
}
.search input::placeholder { color: #6f7a8d; }
.search input:focus { border-color: var(--accent); }
.search input::-webkit-search-cancel-button { display: none; }
.search > button { position: absolute; right: 2px; top: 2px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.search > button:hover { color: var(--accent); }
.live {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; min-width: 320px; z-index: 100; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 14px 30px rgba(0, 0, 0, .55); overflow: hidden;
}
.live a { display: flex; gap: 10px; padding: 8px 10px; align-items: center; border-bottom: 1px solid var(--line); }
.live a:hover, .live a.sel { background: #232c3b; color: #fff; }
.live img { width: 38px; height: 54px; object-fit: cover; border-radius: 4px; flex: none; background: var(--line); }
.live .lt { min-width: 0; display: flex; flex-direction: column; }
.live .lt b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live .lt i { font-style: normal; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live a.all { justify-content: center; color: var(--accent); font-weight: 600; border: 0; }
.live .none { padding: 14px; color: var(--muted); text-align: center; }

.chips { display: none; border-top: 1px solid var(--line); }
.chips-in { display: flex; gap: 8px; overflow-x: auto; padding-top: 8px; padding-bottom: 8px; scrollbar-width: none; }
.chips-in::-webkit-scrollbar { display: none; }
.chips a { flex: none; padding: 5px 13px; border-radius: 999px; background: var(--panel-2); color: #cdd3df; font-size: 13px; font-weight: 600; white-space: nowrap; }
.chips a.on { background: var(--accent); color: #fff; }
.scrim { position: fixed; inset: 0; z-index: 95; background: rgba(0, 0, 0, .6); }

/* ============ Bố cục ============ */
#main { min-height: 60vh; padding-bottom: 28px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) var(--side); gap: 20px; align-items: start; }
.main-col { min-width: 0; }
.home-h1 { margin: 14px 0 0; font-size: 16px; color: var(--muted); font-weight: 600; }
.notice-bar { margin: 12px 0; padding: 10px 14px; background: var(--panel); border-left: 3px solid var(--accent); border-radius: 6px; }
.banner { margin: 12px auto; text-align: center; overflow: hidden; }
.box { margin: 18px 0; }
.box-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.box-head h1, .box-head h2 { margin: 0; font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.box-head h1::before, .box-head h2::before { content: ""; width: 4px; height: 18px; border-radius: 2px; background: var(--accent); }
.box-hot .box-head h2 svg { color: var(--accent); }
.more { font-size: 13px; color: var(--muted); }
.more:hover { color: var(--accent); }
.lead, .empty { color: var(--muted); }
.empty { padding: 24px 0; text-align: center; }

.crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 14px 0 4px; font-size: 13px; color: var(--muted); }
.crumbs .home { display: inline-flex; }
.crumbs .sep { opacity: .5; }
.crumbs .cur { color: var(--text); }

/* ============ Hero slider ============ */
.hero { position: relative; margin: 14px 0 6px; border-radius: 14px; overflow: hidden; background: var(--panel); }
.hero-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; scroll-behavior: smooth; }
.hero-track::-webkit-scrollbar { display: none; }
.slide { position: relative; flex: 0 0 100%; scroll-snap-align: start; aspect-ratio: 21 / 9; min-height: 300px; }
.slide-img, .slide-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slide::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(14,17,23,.96) 0%, rgba(14,17,23,.75) 32%, rgba(14,17,23,.05) 70%), linear-gradient(0deg, rgba(14,17,23,.85), transparent 45%); pointer-events: none; }
.slide-body { position: absolute; z-index: 2; left: 0; bottom: 0; top: 0; width: min(560px, 58%); padding: 26px 34px 40px; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; }
.hot-tag { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 4px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .5px; }
.slide h2 { margin: 4px 0 0; font-size: 30px; font-weight: 800; letter-spacing: -.3px; }
.slide h2 a:hover { color: #fff; }
.slide-orig { margin: 0; color: #b9c1d0; font-size: 14px; }
.slide-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 0; }
.slide-meta span { padding: 1px 9px; border: 1px solid rgba(255,255,255,.3); border-radius: 4px; font-size: 12px; background: rgba(0,0,0,.25); }
.slide-meta .imdb { display: inline-flex; align-items: center; gap: 3px; background: #f5c518; border-color: #f5c518; color: #111; font-weight: 800; }
.slide .btn { align-self: flex-start; }
.slide-genres { margin: 0; color: #b9c1d0; font-size: 13px; }
.slide-desc { margin: 2px 0 8px; color: #cfd5e1; font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero-dots { position: absolute; z-index: 3; right: 20px; bottom: 14px; display: flex; gap: 6px; }
.hero-dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%; background: rgba(255,255,255,.35); cursor: pointer; transition: width .2s; }
.hero-dots button.on { width: 22px; border-radius: 4px; background: var(--accent); }
.hero-btn { position: absolute; z-index: 3; top: 50%; transform: translateY(-50%); width: 40px; height: 56px; border: 0; background: rgba(0,0,0,.4); color: #fff; cursor: pointer; opacity: 0; transition: opacity .2s; }
.hero:hover .hero-btn { opacity: 1; }
.hero-btn.prev { left: 0; border-radius: 0 10px 10px 0; }
.hero-btn.next { right: 0; border-radius: 10px 0 0 10px; }

/* ============ Lưới thẻ phim ============ */
.grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px 12px; }
.card-link { display: block; }
.card-img { position: relative; aspect-ratio: 2 / 3; border-radius: var(--radius); overflow: hidden; background: var(--panel-2); }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.card:hover .card-img img { transform: scale(1.06); }
.card-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0,0,0,.7), transparent 40%); pointer-events: none; }
.badge { position: absolute; z-index: 2; max-width: calc(100% - 12px); padding: 1px 7px; border-radius: 4px; font-size: 11px; font-weight: 700; line-height: 1.6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge-q { top: 6px; left: 6px; background: rgba(0,0,0,.65); color: #fff; }
.badge-hot { top: 6px; right: 6px; display: inline-flex; align-items: center; gap: 2px; background: var(--accent); color: #fff; }
.badge-ep { left: 6px; bottom: 6px; background: var(--accent); color: #fff; }
.card-play { position: absolute; z-index: 2; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; opacity: 0; transition: opacity .2s; background: rgba(0,0,0,.3); }
.card:hover .card-play { opacity: 1; }
.card-t { margin: 8px 0 0; font-size: 13.5px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-o { margin: 1px 0 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card:hover .card-t { color: var(--accent); }

.rail-wrap { position: relative; }
.rail { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; padding-bottom: 2px; }
.rail::-webkit-scrollbar { display: none; }
.card-rail { flex: 0 0 calc((100% - 12px * 5) / 6); scroll-snap-align: start; }
.rail-btn { position: absolute; z-index: 3; top: calc(50% - 40px); width: 34px; height: 56px; border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; opacity: 0; transition: opacity .2s; }
.rail-wrap:hover .rail-btn { opacity: 1; }
.rail-btn.prev { left: 0; border-radius: 0 8px 8px 0; }
.rail-btn.next { right: 0; border-radius: 8px 0 0 8px; }

/* ============ Cột phải ============ */
.sidebar .box { margin-top: 18px; }
.rank li a { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.rk { flex: none; width: 26px; height: 26px; border-radius: 6px; background: var(--panel-2); color: var(--muted); font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.rank li:nth-child(-n+3) .rk { background: var(--accent); color: #fff; }
.rk-t { min-width: 0; display: flex; flex-direction: column; }
.rk-t b { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk-t i { font-style: normal; font-size: 12px; color: var(--muted); }

/* ============ Nút ============ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 18px; border: 1px solid var(--accent); border-radius: 999px; background: var(--accent); color: #fff; font-weight: 700; cursor: pointer; transition: filter .15s; }
.btn:hover { color: #fff; filter: brightness(1.1); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { color: var(--text); border-color: var(--accent); filter: none; }
.btn-lg { padding: 11px 24px; font-size: 15px; }

/* ============ Trang phim ============ */
.main-col.is-info { display: flex; flex-direction: column; }
.main-col.is-info > .info { order: -1; margin-top: 12px; }
.backdrop { position: absolute; left: 0; right: 0; top: var(--hd); height: 420px; background-size: cover; background-position: center top; opacity: .22; filter: blur(14px); pointer-events: none; mask-image: linear-gradient(#000, transparent); -webkit-mask-image: linear-gradient(#000, transparent); }
.single-movie .container { position: relative; }
.watch { margin-top: 12px; }
.player-box { background: #000; border-radius: var(--radius); overflow: hidden; }
.watch-title { margin: 0; padding: 10px 14px; font-size: 15px; background: var(--panel); }
.player { position: relative; aspect-ratio: 16 / 9; background: #000 center/cover no-repeat; }
.player iframe, .player video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.player-start { position: absolute; inset: 0; width: 100%; border: 0; cursor: pointer; background: rgba(0,0,0,.35); }
.player-start::before { content: ""; position: absolute; left: 50%; top: 50%; width: 72px; height: 72px; margin: -36px 0 0 -36px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 10px rgba(255,255,255,.15); }
.player-start::after { content: ""; position: absolute; left: 50%; top: 50%; margin: -12px 0 0 -7px; border: 12px solid transparent; border-left: 20px solid #fff; border-right: 0; }
.player-tools { display: flex; gap: 8px; margin: 10px 0 0; }
.player-tools:empty { display: none; }
.player-tools button { padding: 5px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); cursor: pointer; }
.player-tools button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.ep-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; }

.eps { margin: 14px 0; padding: 14px; background: var(--panel); border-radius: var(--radius); }
.sv-box { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.sv-label { font-weight: 700; color: var(--accent); }
.sv-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.sv { padding: 5px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel-2); cursor: pointer; font-weight: 600; }
.sv.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.sv-note { margin: 0 0 8px; font-size: 12.5px; color: var(--muted); }
.eps.tabs-on .ep-group { display: none; }
.eps.tabs-on .ep-group.on { display: block; }
.ep-group h3 { font-size: 13px; color: var(--muted); font-weight: 600; }
.ep-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; max-height: 260px; overflow: auto; padding-right: 2px; }
.ep-list a { padding: 7px 4px; text-align: center; border-radius: 8px; background: var(--panel-2); font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-list a:hover { background: var(--accent); color: #fff; }
.ep-list a.on { background: var(--accent); color: #fff; }

.info { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; padding: 18px; background: var(--panel); border-radius: 14px; }
.info-poster { border-radius: var(--radius); overflow: hidden; align-self: start; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.info-poster img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; }
.movie-name { margin: 0; font-size: 26px; font-weight: 800; }
.orig { margin: 2px 0 10px; color: var(--muted); }
.meta { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; margin: 0 0 14px; font-size: 13.5px; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; }
.meta dd a { color: var(--accent); }
.rate { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.stars { display: flex; gap: 2px; }
.star { padding: 2px; border: 0; background: transparent; color: #3a4456; cursor: pointer; transition: transform .1s, color .1s; }
.star.on, .stars:hover .star:hover, .stars:hover .star:hover ~ .star.on { color: #f5c518; }
.stars:hover .star { color: #f5c518; }
.stars:hover .star:hover ~ .star { color: #3a4456; }
.star:active { transform: scale(1.2); }
.score b { font-size: 24px; color: #f5c518; }
.score span { color: var(--muted); }
.score small { display: block; font-size: 12px; color: var(--muted); line-height: 1.2; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.js-like.on { border-color: var(--accent); color: var(--accent); }
.js-like.on svg { color: var(--accent); }
.views { color: var(--muted); font-size: 13px; margin-left: 4px; }
.desc { grid-column: 1 / -1; padding-top: 14px; border-top: 1px solid var(--line); color: #cfd5e1; }
.desc p:last-child { margin-bottom: 0; }

.sticky-bar { display: none; }

/* ============ Bình luận ============ */
.tabs-h { gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 14px; justify-content: flex-start; }
.tab { padding: 10px 16px; border: 0; background: transparent; color: var(--muted); font-weight: 700; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 6px; }
.tab.on { color: #fff; border-bottom-color: var(--accent); }
.tab-pane { display: none; }
.tab-pane.on { display: block; }
.cmt-list { margin-bottom: 18px; }
.cmt { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cmt .children { flex: 0 0 100%; padding-left: 20px; }
.cmt-av img { width: 44px; height: 44px; border-radius: 50%; }
.cmt-body { flex: 1; min-width: 0; }
.cmt-head { display: flex; gap: 10px; align-items: baseline; }
.cmt-head time { color: var(--muted); font-size: 12px; }
.cmt-text p { margin: 2px 0 4px; overflow-wrap: anywhere; }
.cmt-wait { color: #f5c518; font-size: 12px; margin: 0; }
.cmt-reply a { font-size: 12.5px; color: var(--muted); }
.comment-reply-title { font-size: 16px; }
.comments textarea, .comments input[type=text], .comments input[type=email] { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--text); font: inherit; }
.comments textarea:focus { outline: none; border-color: var(--accent); }
.must-login { padding: 14px; background: var(--panel); border-radius: var(--radius); }
.must-login a { color: var(--accent); font-weight: 700; }
.comments .cf-turnstile { margin: 10px 0; }
.fb-comments, .fb-comments span, .fb-comments iframe { width: 100% !important; }
.nav-links, .pagination .nav-links { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 20px; }
.page-numbers { min-width: 36px; padding: 6px 10px; text-align: center; border-radius: 8px; background: var(--panel); }
.page-numbers.current, .page-numbers:hover { background: var(--accent); color: #fff; }

/* ============ Footer ============ */
.site-footer { margin-top: 20px; padding: 24px 0; background: var(--panel); border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.flinks { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 10px; }
.fabout { margin-bottom: 10px; }
.fcopy { margin: 0; }
.page-title { margin-top: 0; }
.entry .desc { grid-column: auto; border: 0; padding: 0; }

/* ============ Tablet ============ */
@media (max-width: 1100px) {
  :root { --side: 260px; }
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .card-rail { flex-basis: calc((100% - 12px * 4) / 5); }
  .menu > li > a { padding: 0 8px; font-size: 13px; }
  .search { flex-basis: 220px; }
}

/* ============ Mobile ============ */
@media (max-width: 900px) {
  :root { --hd: 54px; }
  .icon-btn { display: inline-flex; }
  .hd { gap: 4px; padding-left: 6px; padding-right: 6px; }
  .logo { flex: 1; justify-content: center; }
  .burger { order: -1; }
  .s-toggle { order: 3; }

  /* menu thành ngăn kéo bên trái */
  .mainnav { position: fixed; z-index: 100; top: 0; bottom: 0; left: 0; width: min(82vw, 320px); flex: none; background: var(--panel); transform: translateX(-102%); transition: transform .25s ease; overflow-y: auto; padding-bottom: 30px; box-shadow: 8px 0 30px rgba(0,0,0,.5); }
  .mainnav.open { transform: none; }
  .nav-head { display: flex; align-items: center; justify-content: space-between; height: var(--hd); padding: 0 8px 0 18px; font-weight: 800; font-size: 16px; border-bottom: 1px solid var(--line); }
  .nav-close { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; border: 0; background: transparent; cursor: pointer; }
  .menu { display: block; padding: 6px 0; }
  .menu > li > a { height: 46px; padding: 0 18px; font-size: 15px; justify-content: space-between; }
  .menu > li.on > a { box-shadow: none; color: var(--accent); background: var(--panel-2); }
  .dd-menu { position: static; display: none; grid-template-columns: repeat(2, 1fr) !important; max-height: none; border: 0; box-shadow: none; background: #10151d; border-radius: 0; padding: 8px 12px; }
  .dd:hover > .dd-menu { display: none; }
  .dd.open > .dd-menu { display: grid; }
  .dd-menu a { padding: 10px; }

  /* tìm kiếm: thanh trượt xuống dưới header */
  .search { display: none; position: absolute; left: 0; right: 0; top: 100%; flex: none; margin: 0; padding: 8px 12px; background: var(--bg); border-bottom: 1px solid var(--line); }
  .search.open { display: flex; }
  .search input { height: 42px; font-size: 16px; } /* 16px để iOS không tự zoom */
  .search > button { right: 14px; top: 10px; }
  .live { left: 12px; right: 12px; min-width: 0; top: calc(100% - 4px); max-height: 65vh; overflow: auto; }
  .chips { display: block; }

  .slide { aspect-ratio: 16 / 10; min-height: 0; }
  .slide::after { background: linear-gradient(0deg, rgba(14,17,23,.97) 8%, rgba(14,17,23,.55) 50%, rgba(14,17,23,.1)); }
  .slide-body { width: 100%; padding: 14px 16px 30px; justify-content: flex-end; gap: 4px; }
  .slide h2 { font-size: 20px; }
  .slide-desc, .slide-genres { display: none; }
  .slide .btn { align-self: flex-start; padding: 6px 16px; font-size: 13px; margin-top: 4px; }
  .hero { margin-left: -14px; margin-right: -14px; border-radius: 0; }
  .hero-btn { display: none; }
  .hero-dots { right: 50%; transform: translateX(50%); bottom: 10px; }

  .layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 8px; }
  .card-rail { flex-basis: 31%; }
  .rail-btn { display: none; }
  .rail { margin-right: -14px; padding-right: 14px; }
  .card-t { font-size: 12.5px; }
  .box-head h1, .box-head h2 { font-size: 16px; }

  .info { grid-template-columns: 110px minmax(0, 1fr); gap: 12px; padding: 12px; }
  .movie-name { font-size: 19px; }
  .meta { font-size: 12.5px; }
  .meta dt, .meta dd { margin: 0; }
  .btn-lg { padding: 10px 18px; }
  .eps { padding: 10px; }
  .ep-list { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); max-height: 220px; }
  .watch .player-box { margin-left: -14px; margin-right: -14px; border-radius: 0; }

  .sticky-bar { display: flex; position: fixed; z-index: 70; left: 0; right: 0; bottom: 0; gap: 8px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: rgba(14,17,23,.97); border-top: 1px solid var(--line); }
  .sticky-bar .btn { flex: 1; }
  .single-movie #main { padding-bottom: 70px; }
  .cmt .children { padding-left: 8px; }
}

@media (max-width: 560px) {
  .info { grid-template-columns: minmax(0, 1fr); }
  .info-poster { width: 130px; margin: 0 auto; }
  .movie-name, .orig { text-align: center; }
  .rate { justify-content: center; }
  .actions { justify-content: center; }
  .actions .btn { flex: 1 1 auto; }
  .views { flex: 0 0 100%; text-align: center; margin: 0; }
  .actions .btn-lg:not(.js-like) { display: none; } /* đã có thanh "Xem phim" cố định phía dưới */
  .meta { grid-template-columns: 1fr; }
  .meta dt { margin-top: 6px; font-size: 12px; }
}
@media (max-width: 380px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-rail { flex-basis: 42%; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
