/* Be Vietnam Pro — SIL Open Font License 1.1, xem assets/fonts/OFL.txt */
@font-face {
    font-family: "Be Vietnam Pro";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/be-vietnam-pro-400-vietnamese.woff2") format("woff2");
    unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
    font-family: "Be Vietnam Pro";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/be-vietnam-pro-400-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Be Vietnam Pro";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/be-vietnam-pro-400-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Be Vietnam Pro";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("../fonts/be-vietnam-pro-500-vietnamese.woff2") format("woff2");
    unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
    font-family: "Be Vietnam Pro";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("../fonts/be-vietnam-pro-500-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Be Vietnam Pro";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("../fonts/be-vietnam-pro-500-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Be Vietnam Pro";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/be-vietnam-pro-600-vietnamese.woff2") format("woff2");
    unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
    font-family: "Be Vietnam Pro";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/be-vietnam-pro-600-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Be Vietnam Pro";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/be-vietnam-pro-600-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Be Vietnam Pro";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/be-vietnam-pro-700-vietnamese.woff2") format("woff2");
    unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
    font-family: "Be Vietnam Pro";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/be-vietnam-pro-700-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Be Vietnam Pro";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/be-vietnam-pro-700-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ===========================================================================
   RoPhimAI — theme tối, poster dọc 3:4, màu nhấn hồng.

   Toàn bộ chữ trên trang đến từ view (lang(), Cấu hình, dữ liệu phim); file
   này chỉ quyết định trình bày. Font tự lưu ở assets/fonts (CSP của site chỉ
   cho phép tài nguyên cùng tên miền).
   ======================================================================== */

:root {
    --ph-bg: #131313;
    --ph-bg-soft: rgba(255, 255, 255, .06);
    --ph-surface: #272727;          /* chip, ô tìm kiếm, nút tập, chân trang */
    --ph-panel: #242424;            /* bảng thông tin trang phim / trang xem */
    --ph-bg-card: #1d1d1d;          /* khung poster khi ảnh chưa tải */
    --ph-bg-hover: #333333;

    --ph-text: #ffffff;
    --ph-text-dim: rgba(255, 255, 255, .72);
    --ph-text-faint: rgba(255, 255, 255, .48);
    --ph-text-mute: rgba(255, 255, 255, .32);

    --ph-accent: #f5315e;
    --ph-accent-hover: #ff4a73;
    --ph-gold: #f5b942;
    --ph-line: rgba(255, 255, 255, .08);

    --ph-radius: 8px;
    --ph-radius-card: 6px;
    --ph-radius-lg: 20px;

    --ph-container: 1336px;
    --ph-gutter: 24px;
    --ph-header-h: 68px;
    --ph-gap: 12px;
    --ph-section-gap: 96px;

    --ph-font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --ph-shadow: 0 18px 40px rgba(0, 0, 0, .55);
    --ph-ease: 200ms cubic-bezier(.4, 0, .2, 1);
}

/* ------------------------------------------------------------------ nền */

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--ph-header-h) + 12px); }

body.ph {
    margin: 0;
    min-height: 100vh;
    background: var(--ph-bg);
    color: var(--ph-text);
    font-family: var(--ph-font);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* :where() giữ độ ưu tiên bằng 0: reset này không được thắng class của từng thành phần. */
:where(.ph) :where(h1, h2, h3, h4) { margin: 0; line-height: 1.25; font-weight: 600; }
:where(.ph) :where(p) { margin: 0; }
:where(.ph) :where(a) { color: inherit; text-decoration: none; }
:where(.ph) :where(img) { display: block; max-width: 100%; }
:where(.ph) :where(button) { font: inherit; color: inherit; }
.ph :focus-visible { outline: 2px solid var(--ph-accent); outline-offset: 2px; }

.ph-visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.ph-skip {
    position: absolute; left: -9999px; top: 0; z-index: 1000;
    padding: 10px 16px; border-radius: var(--ph-radius);
    background: var(--ph-accent); color: #fff; font-weight: 600;
}
.ph-skip:focus { left: 12px; top: 12px; }

.ph-mt-sm { margin-top: 10px; }
.ph-mt-md { margin-top: 18px; }
.ph-mt-lg { margin-top: 26px; }

.ph-container {
    width: 100%;
    max-width: calc(var(--ph-container) + var(--ph-gutter) * 2);
    margin-inline: auto;
    padding-inline: var(--ph-gutter);
}

/* Header nằm đè lên nội dung (position: fixed); trang không có hero cần chừa chỗ. */
.ph-main { display: block; padding-top: var(--ph-header-h); min-height: 60vh; }

/* ------------------------------------------------------------------ header */

.ph-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 900;
    min-height: var(--ph-header-h);
    background: linear-gradient(180deg, #151314 0%, rgba(21, 19, 20, .82) 70%, rgba(21, 19, 20, 0) 100%);
    transition: background var(--ph-ease);
}
.ph-header.is-scrolled { background: rgba(19, 19, 19, .96); box-shadow: 0 1px 0 var(--ph-line); }

.ph-header-inner {
    display: flex; align-items: center; gap: 28px;
    max-width: 1400px; height: var(--ph-header-h);
    margin-inline: auto; padding-inline: var(--ph-gutter);
}

.ph-brand { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.ph-brand-logo { width: 30px; height: 30px; object-fit: contain; border-radius: 8px; }
.ph-brand-mark {
    width: 30px; height: 30px; border-radius: 8px;
    background: linear-gradient(135deg, #ff5c7a, var(--ph-accent) 55%, #ff8a3d);
}
.ph-brand-name { font-size: 18px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }

.ph-nav {
    display: flex; align-items: center; gap: 22px;
    margin-left: 40px; min-width: 0;
}
.ph-nav-link {
    position: relative;
    font-size: 16px; font-weight: 600; white-space: nowrap;
    color: var(--ph-text);
    background: none; border: 0; padding: 0; cursor: pointer;
    transition: color var(--ph-ease);
}
.ph-nav-link:hover, .ph-nav-link.is-active { color: var(--ph-accent); }

.ph-more { position: relative; }
.ph-more-toggle { display: inline-flex; align-items: center; gap: 4px; }
.ph-more-menu {
    position: absolute; top: calc(100% + 14px); left: 50%; transform: translateX(-50%);
    min-width: 200px; max-height: 60vh; overflow-y: auto;
    padding: 8px; border-radius: 12px;
    background: var(--ph-surface); box-shadow: var(--ph-shadow);
    display: grid; gap: 2px;
}
.ph-more-menu[hidden] { display: none; }
.ph-more-menu a {
    padding: 9px 12px; border-radius: var(--ph-radius);
    font-size: 14px; color: var(--ph-text-dim);
}
.ph-more-menu a:hover { background: var(--ph-bg-hover); color: var(--ph-text); }

.ph-search {
    position: relative; display: flex; align-items: center;
    margin-left: auto; width: 272px; flex: none;
}
.ph-search-icon {
    position: absolute; left: 14px; color: var(--ph-text-dim); pointer-events: none;
    width: 16px; height: 16px;
}
.ph-search input {
    width: 100%; height: 44px; padding: 0 16px 0 40px;
    border-radius: 30px; border: 1px solid transparent;
    background: #2a2a2a; color: var(--ph-text);
    font: inherit; font-size: 14px;
    transition: border-color var(--ph-ease), background var(--ph-ease);
}
.ph-search input::placeholder { color: var(--ph-text-faint); }
.ph-search input:focus { outline: none; border-color: var(--ph-accent); background: #2e2e2e; }
.ph-search input::-webkit-search-cancel-button { filter: invert(1); }

/*
 * Bộ chuyển ngôn ngữ như bản mẫu: quả địa cầu + tên + mũi tên, hồng khi rê
 * hoặc đang mở; bảng xám bo 8px căn giữa dưới nút, chữ căn giữa, mục đang
 * chọn màu nhấn.
 */
.ph-lang { position: relative; flex: none; }
.ph-lang-toggle {
    display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 4px;
    border: 0; background: none; cursor: pointer;
    color: var(--ph-text); font: inherit; font-size: 14px; font-weight: 500; white-space: nowrap;
    transition: color var(--ph-ease);
}
.ph-lang-toggle:hover, .ph-lang-toggle[aria-expanded="true"] { color: var(--ph-accent); }
.ph-lang-caret { transition: transform var(--ph-ease); }
.ph-lang-toggle[aria-expanded="true"] .ph-lang-caret { transform: rotate(180deg); }
.ph-lang-menu {
    position: absolute; top: calc(100% + 8px); left: 50%; z-index: 950;
    width: 144px; margin-left: -72px; max-height: calc(100vh - 90px); overflow-y: auto;
    padding: 4px 0; border-radius: 8px; background: #282828;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
}
.ph-lang-menu[hidden] { display: none; }
.ph-lang-item {
    display: flex; align-items: center; justify-content: center; min-height: 36px; padding: 4px 10px;
    font-size: 14px; text-align: center; color: rgba(255, 255, 255, .68);
    transition: color var(--ph-ease);
}
.ph-lang-item:hover { color: #fff; }
.ph-lang-item.is-active { color: var(--ph-accent); }

.ph-burger {
    display: none; flex: none;
    width: 38px; height: 38px; border-radius: 999px;
    background: var(--ph-surface); border: 0; cursor: pointer;
    align-items: center; justify-content: center;
}
.ph-burger span, .ph-burger span::before, .ph-burger span::after {
    display: block; width: 16px; height: 2px; border-radius: 2px; background: #fff; content: "";
    transition: transform var(--ph-ease), opacity var(--ph-ease);
}
.ph-burger span { position: relative; }
.ph-burger span::before { position: absolute; top: -5px; left: 0; }
.ph-burger span::after { position: absolute; top: 5px; left: 0; }
.ph-burger[aria-expanded="true"] span { background: transparent; }
.ph-burger[aria-expanded="true"] span::before { transform: translateY(5px) rotate(45deg); }
.ph-burger[aria-expanded="true"] span::after { transform: translateY(-5px) rotate(-45deg); }

.ph-drawer {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
    max-height: calc(100vh - var(--ph-header-h)); overflow-y: auto;
    padding: 12px var(--ph-gutter) 20px;
    background: rgba(19, 19, 19, .98); border-top: 1px solid var(--ph-line);
}
.ph-drawer[hidden] { display: none; }
.ph-drawer a {
    padding: 11px 14px; border-radius: var(--ph-radius);
    background: var(--ph-surface); font-size: 14px; font-weight: 500;
}
.ph-drawer a:hover { background: var(--ph-bg-hover); }

/* ------------------------------------------------------------------ mục */

.ph-section { margin-top: var(--ph-section-gap); }
.ph-main > .ph-container:first-child > .ph-section:first-child { margin-top: 28px; }
/* Hàng phim đầu tiên nằm sát hero, trên nền sân khấu. */
.ph-hero + .ph-container + .ph-section, .ph-hero + .ph-section { margin-top: 42px; }

.ph-section-head {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
    margin-bottom: 16px;
}
.ph-section-head-filters { flex-wrap: wrap; align-items: center; }
.ph-section-title { font-size: 30px; font-weight: 500; line-height: 36px; letter-spacing: -.01em; }
.ph-section-more {
    flex: none; font-size: 14px; font-weight: 500; color: var(--ph-text-faint);
    transition: color var(--ph-ease);
}
a.ph-section-more:hover { color: var(--ph-accent); }

/* ------------------------------------------------------------------ nút, chip */

.ph-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }

.ph-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 0 26px; border-radius: 999px;
    border: 1px solid transparent; cursor: pointer;
    font-size: 15px; font-weight: 600; white-space: nowrap;
    transition: background var(--ph-ease), color var(--ph-ease), transform var(--ph-ease);
}
.ph-btn:active { transform: scale(.98); }
.ph-btn-primary, .ph-btn-play { background: var(--ph-accent); color: #fff; }
.ph-btn-primary:hover, .ph-btn-play:hover { background: var(--ph-accent-hover); color: #fff; }
.ph-btn-ghost { background: var(--ph-surface); color: var(--ph-text); }
.ph-btn-ghost:hover { background: var(--ph-bg-hover); }
.ph-btn-sm { min-height: 36px; padding: 0 16px; font-size: 13.5px; }

.ph-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ph-chip {
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 32px; padding: 0 14px; border-radius: var(--ph-radius);
    background: var(--ph-surface); color: var(--ph-text);
    font-size: 13px; font-weight: 500; white-space: nowrap;
    transition: background var(--ph-ease), color var(--ph-ease);
}
a.ph-chip:hover { background: var(--ph-bg-hover); }
.ph-chip-hot { background: var(--ph-accent); color: #fff; }

.ph-badge {
    display: inline-flex; align-items: center;
    padding: 2px 8px; border-radius: 6px;
    background: var(--ph-surface); color: var(--ph-text-dim);
    font-size: 12px; font-weight: 600;
}
.ph-badge-rating { background: rgba(245, 185, 66, .14); color: var(--ph-gold); }

.ph-meta {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px;
    color: var(--ph-text-dim); font-size: 14px;
}
.ph-meta-sep { color: var(--ph-text-mute); }

/* ------------------------------------------------------------------ hero */
/*
 * Poster xếp vòng cung (coverflow): tấm giữa lớn, hai tấm mỗi bên lùi dần ra
 * sau. film.js gán data-pos = -2…2 cho từng slide theo vị trí so với slide
 * đang chọn; slide xa hơn thì ẩn. Không có JS thì slide đầu vẫn hiện đúng chỗ
 * (data-pos="0" sẵn trong HTML).
 *
 * Phía sau là một sân khấu: rèm nhung vén hai bên (stage-bg.svg), phủ từ đỉnh
 * trang xuống qua hero và mờ dần vào nền ở hàng poster đầu tiên.
 */
.ph-main:has(> .ph-hero) { padding-top: 0; position: relative; overflow-x: clip; }
/* Nội dung sau hero nằm trên lớp nền sân khấu (nền rèm tràn xuống dưới hero). */
.ph-main:has(> .ph-hero) > :not(.ph-hero):not(.ph-visually-hidden) { position: relative; }
.ph-hero {
    position: relative;
    padding: 131px 0 2px;
    isolation: isolate;
}
.ph-hero::before {
    content: ""; position: absolute; z-index: -2;
    top: 0; left: 50%; transform: translateX(-50%);
    width: max(100vw, 1920px); height: 1300px;
    background: url("../img/stage-bg.svg") center top / 100% 100% no-repeat;
    pointer-events: none;
}
/* Ảnh nền mờ của phim đang chọn: chỉ còn là một quầng sáng nhẹ giữa sân khấu. */
.ph-hero-ambient {
    position: absolute; z-index: -1;
    top: 60px; left: 50%; width: 900px; height: 560px; margin-left: -450px;
    -webkit-mask-image: radial-gradient(closest-side, #000 20%, transparent 100%);
    mask-image: radial-gradient(closest-side, #000 20%, transparent 100%);
    pointer-events: none;
}
.ph-hero-bg {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; opacity: 0; filter: blur(40px) saturate(1.2);
    transition: opacity 600ms ease;
}
.ph-hero-bg.is-active { opacity: .28; }

/*
 * Sân khấu 3D: poster giữa nhô ra trước (translateZ) nên hiện đúng 325×430;
 * hai tấm cạnh xoay 26°, hai tấm ngoài xoay 32°, mép ngoài hướng về người xem.
 */
.ph-hero-stage { position: relative; height: 430px; perspective: 1100px; }
/* Quỹ đạo: vành elip ôm chân vòng poster, ba chấm trang trí ở chân vành (hero-orbit.svg). */
.ph-hero-stage::before {
    content: ""; position: absolute; z-index: 0;
    left: 50%; top: 399px; width: 1390px; height: 116px; margin-left: -695px;
    background: url("../img/hero-orbit.svg") center / 100% 100% no-repeat;
    pointer-events: none;
}
.ph-hero-slide {
    position: absolute; left: 50%; top: 10px;
    width: 310px; margin-left: -155px;
    opacity: 0; pointer-events: none;
    transform: translate3d(0, 0, -200px) scale(.8);
    transition: transform 500ms cubic-bezier(.23, 1, .32, 1), opacity 500ms ease, filter 500ms ease;
    will-change: transform;
}
.ph-hero-slide[data-pos="0"] { opacity: 1; pointer-events: auto; transform: translate3d(0, 0, 52px); z-index: 5; }
.ph-hero-slide[data-pos="-1"] { opacity: 1; pointer-events: auto; transform: translate3d(-237px, 0, -34px) scale(.95) rotateY(26deg); z-index: 4; filter: brightness(.75); }
.ph-hero-slide[data-pos="1"] { opacity: 1; pointer-events: auto; transform: translate3d(237px, 0, -34px) scale(.95) rotateY(-26deg); z-index: 4; filter: brightness(.75); }
.ph-hero-slide[data-pos="-2"] { opacity: 1; pointer-events: auto; transform: translate3d(-462px, 0, -92px) scale(.9) rotateY(32deg); z-index: 3; filter: brightness(.5); }
.ph-hero-slide[data-pos="2"] { opacity: 1; pointer-events: auto; transform: translate3d(462px, 0, -92px) scale(.9) rotateY(-32deg); z-index: 3; filter: brightness(.5); }
.ph-hero-slide[hidden] { display: block; }
.ph-hero-poster {
    display: block; position: relative;
    aspect-ratio: 310 / 410; border-radius: 20px; overflow: hidden;
    background: var(--ph-bg-card); box-shadow: 0 24px 50px rgba(0, 0, 0, .6);
}
.ph-hero-poster img { width: 100%; height: 100%; object-fit: cover; }
.ph-hero-poster .ph-card-empty { position: absolute; inset: 0; }
/* Tên phim dưới poster hai bên, nghiêng theo poster; poster giữa dùng tiêu đề trong .ph-hero-info. */
.ph-hero-slide-name {
    margin-top: 10px; text-align: center;
    font-size: 13px; font-weight: 500; color: var(--ph-text-dim);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ph-hero-slide[data-pos="0"] .ph-hero-slide-name { visibility: hidden; }

.ph-hero-arrow {
    position: absolute; top: 187px; z-index: 8;
    width: 56px; height: 56px; border-radius: 999px; border: 0;
    display: grid; place-items: center; cursor: pointer;
    background: rgba(0, 0, 0, .45); color: #fff;
    backdrop-filter: blur(8px);
    transition: background var(--ph-ease);
}
.ph-hero-arrow:hover { background: var(--ph-accent); }
.ph-hero-arrow-prev { left: max(var(--ph-gutter), calc(50% - 668px)); }
.ph-hero-arrow-next { right: max(var(--ph-gutter), calc(50% - 668px)); }

/*
 * Thông tin phim đang chọn nằm chồng lên poster giữa. Bình thường chỉ có tên
 * phim dưới poster; rê chuột vào poster thì khung tối ở nửa dưới hiện ra.
 */
.ph-hero-info {
    position: absolute; z-index: 6;
    top: 131px; left: 50%; width: 325px; height: 430px; margin-left: -162.5px;
    border-radius: 20px;
}
.ph-hero-info[hidden] { display: none; }
.ph-hero-cover { position: absolute; inset: 0; border-radius: inherit; }
.ph-hero-title {
    position: absolute; top: calc(100% + 12px); left: -60px; right: -60px;
    font-size: 20px; font-weight: 600; line-height: 28px; text-align: center;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    pointer-events: none;
}
.ph-hero-panel {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 18px 21px 20px;
    border-radius: 0 0 20px 20px;
    background: rgba(0, 0, 0, .58);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    text-align: left;
    opacity: 0; transform: translateY(10px);
    transition: opacity 300ms ease, transform 300ms ease;
    pointer-events: none;
}
.ph-hero-info:hover .ph-hero-panel, .ph-hero-info:focus-within .ph-hero-panel {
    opacity: 1; transform: none; pointer-events: auto;
}
.ph-hero-panel-name {
    font-size: 14px; font-weight: 600; line-height: 1.5; color: rgba(255, 255, 255, .95);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ph-hero-chips {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px;
    margin-top: 4px; font-size: 12px; color: rgba(255, 255, 255, .7);
}
.ph-hero-chips a:hover { color: var(--ph-accent); }
.ph-hero-hot { color: var(--ph-accent); font-weight: 600; }
.ph-hero-desc {
    margin-top: 5px; font-size: 12px; line-height: 1.55; color: rgba(255, 255, 255, .7);
    display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.ph-hero-panel-actions {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin-top: 12px;
}
.ph-hero-play {
    display: inline-flex; align-items: center; gap: 6px;
    height: 36px; padding: 0 30px; border-radius: 999px;
    background: linear-gradient(90deg, #f5315e 0%, #fe4f30 100%); color: #fff;
    font-size: 15px; font-weight: 600; white-space: nowrap;
    transition: filter var(--ph-ease);
}
.ph-hero-play:hover { filter: brightness(1.1); }
.ph-hero-share {
    display: grid; place-items: center; width: 36px; height: 36px;
    border: 0; border-radius: 999px; cursor: pointer;
    background: transparent; color: rgba(255, 255, 255, .85);
    transition: color var(--ph-ease), background var(--ph-ease);
}
.ph-hero-share:hover { color: #fff; background: rgba(255, 255, 255, .14); }
.ph-hero-share.is-done { color: #fff; background: var(--ph-accent); }
/* Chấm chọn slide, dưới tên phim. */
.ph-hero-dots {
    position: relative; display: flex; justify-content: center; align-items: center; gap: 8px;
    margin: 72px auto 0; max-width: 760px;
}
/* Máy tính: chuyển phim bằng mũi tên hoặc bấm poster bên cạnh; dãy chấm chỉ giữ chỗ (ẩn, không nhận Tab). */
@media (min-width: 769px) { .ph-hero-dots { visibility: hidden; } }
.ph-hero-dot {
    width: 8px; height: 8px; padding: 0; border-radius: 999px; border: 0; cursor: pointer;
    background: rgba(255, 255, 255, .45);
    transition: background var(--ph-ease), width var(--ph-ease);
}
.ph-hero-dot:hover { background: rgba(255, 255, 255, .6); }
.ph-hero-dot.is-active { width: 24px; background: var(--ph-accent); }

/* ------------------------------------------------------------------ hàng poster */

.ph-rail { position: relative; }
.ph-rail-track {
    display: grid; grid-auto-flow: column;
    grid-auto-columns: calc((100% - var(--ph-gap) * 5) / 6);
    gap: var(--ph-gap);
    overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scrollbar-width: none;
    padding-bottom: 4px;
}
.ph-rail-track::-webkit-scrollbar { display: none; }
.ph-rail-track > * { scroll-snap-align: start; }

.ph-rail-btn {
    position: absolute; z-index: 4;
    /* Khoảng giữa phần poster: poster chiếm ~3/4 chiều cao cả thẻ (poster + tên + dòng phụ). */
    top: 37%; transform: translateY(-50%);
    width: 40px; height: 40px; border-radius: 999px; border: 0; cursor: pointer;
    display: grid; place-items: center;
    background: #0b0b0b; color: #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, .5);
    transition: background var(--ph-ease);
}
.ph-rail-btn:hover { background: var(--ph-accent); }
.ph-rail-btn[hidden] { display: none; }
.ph-rail-prev { left: -20px; }
.ph-rail-next { right: -20px; }

/* ------------------------------------------------------------------ thẻ poster */

.ph-card { position: relative; min-width: 0; }
.ph-card-link { display: block; }
.ph-card-poster {
    position: relative; aspect-ratio: 3 / 4;
    border-radius: var(--ph-radius-card); overflow: hidden;
    background: linear-gradient(110deg, #1d1d1d 30%, #262626 50%, #1d1d1d 70%);
}
.ph-card-poster img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 420ms cubic-bezier(.33, .9, .3, 1);
}
/* Rê chuột: poster tối nhẹ ở chân để hai nút nổi rõ. */
.ph-card-poster::after {
    content: ""; position: absolute; inset: 0; z-index: 1;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, .7) 100%);
    opacity: 0; transition: opacity var(--ph-ease);
    pointer-events: none;
}
.ph-card:hover .ph-card-poster img { transform: scale(1.05); }
.ph-card:hover .ph-card-poster::after { opacity: 1; }

/* Nút xem + chia sẻ, đè lên chân poster (khối này cao đúng bằng poster). */
.ph-card-hover {
    position: absolute; top: 0; left: 0; right: 0; z-index: 3;
    aspect-ratio: 3 / 4;
    display: flex; align-items: flex-end; gap: 8px;
    padding: 0 10% 7%;
    opacity: 0; transform: translateY(6px);
    transition: opacity var(--ph-ease), transform var(--ph-ease);
    pointer-events: none;
}
.ph-card:hover .ph-card-hover, .ph-card-hover:focus-within { opacity: 1; transform: none; }
.ph-card:hover .ph-card-hover > * { pointer-events: auto; }
.ph-card-play {
    flex: 1 1 auto; min-width: 0;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 36px; padding: 0 12px; border-radius: 6px;
    background: linear-gradient(90deg, #f5315e 0%, #fe4f30 100%); color: #fff;
    font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden;
    transition: filter var(--ph-ease);
}
.ph-card-play:hover { filter: brightness(1.1); }
.ph-card-share {
    flex: none; display: grid; place-items: center;
    width: 48px; height: 36px; border-radius: 6px; border: 0; cursor: pointer;
    background: rgba(255, 255, 255, .22); color: #fff;
    backdrop-filter: blur(6px);
    transition: background var(--ph-ease);
}
.ph-card-share:hover { background: rgba(255, 255, 255, .34); }
.ph-card-share.is-done { background: var(--ph-accent); }
/* Máy cảm ứng không có rê chuột: bấm thẳng vào thẻ để mở phim. */
@media (hover: none) { .ph-card-hover { display: none; } }
@media (hover: none) and (min-width: 769px) { .ph-hero-panel { opacity: 1; transform: none; pointer-events: auto; } }

.ph-card-empty {
    display: grid; place-items: center; height: 100%; padding: 12px;
    text-align: center; font-size: 14px; font-weight: 600; color: var(--ph-text-dim);
    background: linear-gradient(160deg, #2a2a2a, #1a1a1a);
}

.ph-card-rank {
    position: absolute; left: 8px; bottom: 2px; z-index: 2;
    font-size: 54px; font-weight: 800; line-height: 1; letter-spacing: -.04em;
    color: transparent; -webkit-text-stroke: 2px rgba(255, 255, 255, .92);
    text-shadow: 0 4px 16px rgba(0, 0, 0, .6);
    pointer-events: none;
}

.ph-card-progress {
    position: absolute; left: 0; right: 0; bottom: 0; height: 3px; z-index: 2;
    background: rgba(255, 255, 255, .25);
}
.ph-card-progress > * { height: 100%; background: var(--ph-accent); }

.ph-card-title {
    margin-top: 10px;
    font-size: 16px; font-weight: 600; line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ph-card-sub {
    display: flex; flex-wrap: nowrap; align-items: center; gap: 0 6px;
    margin-top: 6px; font-size: 12px; line-height: 1.5; color: #a1a1a1;
    white-space: nowrap; overflow: hidden;
}
.ph-card-dot { font-size: 9px; opacity: .8; }
.ph-card-rating { color: var(--ph-gold); }
/* ------------------------------------------------------------------ lưới */

.ph-grid {
    display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 34px var(--ph-gap);
}

/* ------------------------------------------------- tab danh mục, bộ lọc */

.ph-tabs {
    display: flex; gap: 10px; margin: 0 0 26px;
    overflow-x: auto; scrollbar-width: none;
}
.ph-tabs::-webkit-scrollbar { display: none; }
.ph-tab {
    flex: none; display: inline-flex; align-items: center;
    height: 40px; padding: 0 20px; border-radius: var(--ph-radius);
    background: var(--ph-surface); color: var(--ph-text);
    font-size: 15px; font-weight: 500; white-space: nowrap;
    transition: background var(--ph-ease);
}
.ph-tab:hover { background: var(--ph-bg-hover); }
.ph-tab.is-active { background: var(--ph-accent); color: #fff; }

.ph-filterbar { display: flex; flex-wrap: wrap; gap: 10px; }
.ph-select {
    height: 40px; padding: 0 38px 0 16px; border-radius: var(--ph-radius);
    border: 1px solid transparent; appearance: none; cursor: pointer;
    background: var(--ph-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-opacity='.7' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 16px;
    color: var(--ph-text); font: inherit; font-size: 14px; font-weight: 500;
}
.ph-select:hover, .ph-select:focus { border-color: var(--ph-accent); outline: none; }
.ph-select option { background: var(--ph-surface); }

/* ---------------------------------------------------- bảng xếp hạng */

.ph-podium {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end; gap: 20px;
    max-width: 880px; margin: 8px auto 44px; padding: 0; list-style: none;
}
.ph-podium-item { display: flex; flex-direction: column; align-items: center; text-align: center; }
.ph-podium-1 { order: 2; }
.ph-podium-2 { order: 1; }
.ph-podium-3 { order: 3; }
.ph-podium-poster {
    position: relative; display: block; width: 80%;
    aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden;
    background: var(--ph-bg-card); box-shadow: var(--ph-shadow);
    --ph-medal: #c3c9d3;
    outline: 2px solid var(--ph-medal); outline-offset: -2px;
}
.ph-podium-1 .ph-podium-poster { width: 100%; --ph-medal: var(--ph-gold); }
.ph-podium-3 .ph-podium-poster { --ph-medal: #d08b53; }
.ph-podium-poster img { width: 100%; height: 100%; object-fit: cover; }
.ph-podium-rank {
    position: absolute; left: 10px; top: 10px;
    display: grid; place-items: center; width: 42px; height: 42px; border-radius: 999px;
    background: var(--ph-medal); color: #121212;
    font-size: 21px; font-weight: 800; line-height: 1;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .5);
}
.ph-podium-1 .ph-podium-rank { width: 52px; height: 52px; font-size: 26px; }
.ph-podium-body { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 14px; }
.ph-podium-title { font-size: 17px; font-weight: 600; }
.ph-podium-title a:hover { color: var(--ph-accent); }
.ph-podium-metric { color: var(--ph-text-faint); font-size: 13.5px; margin-bottom: 4px; }

.ph-ranklist { list-style: none; margin: 0; padding: 0; }
.ph-rankrow {
    display: grid; grid-template-columns: 64px 72px minmax(0, 1fr) auto auto;
    align-items: center; gap: 18px;
    padding: 14px 18px; border-radius: 14px;
    transition: background var(--ph-ease);
}
.ph-rankrow:nth-child(odd) { background: rgba(255, 255, 255, .025); }
.ph-rankrow:hover { background: var(--ph-panel); }
.ph-rankrow-rank {
    font-size: 36px; font-weight: 800; text-align: center; line-height: 1;
    color: transparent; -webkit-text-stroke: 1.5px rgba(255, 255, 255, .75);
}
.ph-rankrow-poster {
    display: block; width: 72px; aspect-ratio: 3 / 4;
    border-radius: var(--ph-radius-card); overflow: hidden; background: var(--ph-bg-card);
}
.ph-rankrow-poster img { width: 100%; height: 100%; object-fit: cover; }
.ph-rankrow-body { min-width: 0; }
.ph-rankrow-title { font-size: 17px; font-weight: 600; }
.ph-rankrow-title a:hover { color: var(--ph-accent); }
.ph-rankrow-meta {
    display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px;
    color: var(--ph-text-faint); font-size: 13px;
}
.ph-rankrow-meta a:hover { color: var(--ph-text); }
.ph-rankrow-summary {
    margin-top: 6px; color: var(--ph-text-dim); font-size: 14px;
    display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.ph-rankrow-metric { color: var(--ph-text-dim); font-size: 14px; font-weight: 600; white-space: nowrap; }
.ph-rankrow-play {
    display: grid; place-items: center; width: 40px; height: 40px; border-radius: 999px;
    background: var(--ph-surface); font-size: 13px;
    transition: background var(--ph-ease);
}
.ph-rankrow-play:hover { background: var(--ph-accent); }

/* ----------------------------------------------------------- trang phim */

.ph-detail { position: relative; isolation: isolate; padding-top: 28px; }
.ph-detail-bg {
    position: absolute; left: 0; right: 0; top: calc(var(--ph-header-h) * -1); z-index: -1;
    width: 100%; height: 520px; object-fit: cover;
    opacity: .28; filter: blur(30px) saturate(1.1); transform: scale(1.1);
    -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 30%, transparent 100%);
}
.ph-detail-inner {
    display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
    gap: 24px; align-items: start;
}
.ph-detail-poster {
    position: sticky; top: calc(var(--ph-header-h) + 16px);
    aspect-ratio: 3 / 4; border-radius: var(--ph-radius-lg); overflow: hidden;
    background: var(--ph-bg-card); box-shadow: var(--ph-shadow);
}
.ph-detail-poster img { width: 100%; height: 100%; object-fit: cover; }

.ph-panel {
    background: var(--ph-panel); border-radius: var(--ph-radius-lg);
    padding: 28px 30px 30px;
}
.ph-detail-title { font-size: 28px; font-weight: 700; letter-spacing: -.015em; }
.ph-detail-original { margin-top: 6px; color: var(--ph-text-faint); font-size: 15px; }
.ph-panel .ph-meta { margin-top: 14px; }
.ph-panel .ph-chips { margin-top: 16px; }

.ph-panel-block { margin-top: 26px; }
.ph-panel-heading { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.ph-panel .ph-prose { font-size: 14.5px; color: var(--ph-text-dim); }

.ph-facts { display: grid; gap: 8px; margin: 22px 0 0; }
.ph-fact { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; font-size: 14px; }
.ph-fact dt { color: var(--ph-text-faint); }
.ph-fact dd { margin: 0; color: var(--ph-text); }
.ph-fact a:hover { color: var(--ph-accent); }
/* Danh sách tên (đạo diễn, diễn viên): liên kết gạch chân mảnh, ngăn bằng dấu phẩy. */
.ph-fact dd a { border-bottom: 1px solid rgba(255, 255, 255, .18); transition: color var(--ph-ease), border-color var(--ph-ease); }
.ph-fact dd a:hover { border-bottom-color: var(--ph-accent); }
.ph-fact-names { line-height: 1.75; }

/* ------------------------------------------------------------ danh sách tập */

.ph-episodes {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 10px;
}
.ph-panel .ph-episodes { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.ph-episode {
    display: grid; place-items: center; height: 40px; border-radius: var(--ph-radius);
    background: var(--ph-surface); color: var(--ph-text);
    font-size: 14px; font-weight: 500;
    transition: background var(--ph-ease), color var(--ph-ease);
}
.ph-episode:hover { background: var(--ph-bg-hover); }
.ph-episode.is-current { background: var(--ph-accent); color: #fff; }

/* ----------------------------------------------------------- trang xem */

.ph-watch { padding-top: 24px; }
.ph-watch-layout {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
    gap: 24px; align-items: start;
}
.ph-player-shell { border-radius: var(--ph-radius-lg); overflow: hidden; background: #000; }

.ph-player {
    position: relative; width: 100%;
    aspect-ratio: 16 / 9; background: #000;
}
.ph-player iframe,
.ph-player video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.ph-player-empty {
    position: absolute; inset: 0; display: grid; place-items: center; padding: 20px;
    color: var(--ph-text-dim); text-align: center;
}

.ph-watch-title { font-size: 20px; font-weight: 700; }
.ph-watch-title a:hover { color: var(--ph-accent); }
.ph-watch-sub { margin-top: 6px; color: var(--ph-text-dim); font-size: 14px; }
.ph-watch-nav { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.ph-watch-bar { display: block; }

/* --------------------------------------------------- điều khiển trình phát */

.ph-player.has-controls video::-webkit-media-controls { display: none !important; }

.ph-player-bigplay {
    position: absolute; inset: 0; margin: auto;
    width: 68px; height: 68px; border-radius: 999px;
    display: grid; place-items: center;
    background: rgba(245, 49, 94, .88); border: 0;
    color: #fff; cursor: pointer; box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
    transition: background var(--ph-ease), transform var(--ph-ease), opacity var(--ph-ease);
}
.ph-player-bigplay:hover { background: var(--ph-accent); transform: scale(1.05); }
.ph-player-bigplay svg { width: 26px; height: 26px; margin-left: 3px; }
.ph-player.is-playing .ph-player-bigplay { opacity: 0; pointer-events: none; transform: scale(.85); }

.ph-player-bar {
    position: absolute; left: 0; right: 0; bottom: 0;
    display: flex; align-items: center; gap: 10px;
    padding: 24px 16px 12px;
    background: linear-gradient(to top, rgba(0, 0, 0, .85), rgba(0, 0, 0, 0));
    transition: opacity var(--ph-ease);
}
.ph-player.is-playing.is-idle .ph-player-bar,
.ph-player.is-playing.is-idle .ph-player-bigplay { opacity: 0; pointer-events: none; }
.ph-player.is-playing.is-idle { cursor: none; }

.ph-pbtn {
    flex: none; width: 30px; height: 30px; display: grid; place-items: center;
    background: none; border: 0; padding: 0; color: #fff; cursor: pointer;
    opacity: .9; transition: opacity var(--ph-ease);
}
.ph-pbtn:hover { opacity: 1; }
.ph-pbtn svg { width: 19px; height: 19px; }
.ph-pbtn .icon-pause, .ph-pbtn .icon-vol-off { display: none; }
.ph-player.is-playing [data-play] .icon-play { display: none; }
.ph-player.is-playing [data-play] .icon-pause { display: inline-flex; }
.ph-player.is-muted [data-volume] .icon-vol-on { display: none; }
.ph-player.is-muted [data-volume] .icon-vol-off { display: inline-flex; }
.ph-pbtn-speed { width: auto; min-width: 34px; padding-inline: 4px; font-size: 12.5px; font-weight: 700; }

.ph-player-time {
    flex: none; color: #fff; font-size: 12.5px; font-variant-numeric: tabular-nums;
    opacity: .9; min-width: 92px; text-align: center;
}
.ph-player-progress { flex: 1 1 auto; position: relative; height: 14px; cursor: pointer; display: flex; align-items: center; }
.ph-player-progress-track {
    position: relative; width: 100%; height: 4px; border-radius: 999px;
    background: rgba(255, 255, 255, .25); overflow: hidden;
}
.ph-player-progress-buffered { position: absolute; inset: 0; width: 0%; background: rgba(255, 255, 255, .3); }
.ph-player-progress-fill { position: absolute; inset: 0; width: 0%; background: var(--ph-accent); }
.ph-player-progress-handle {
    position: absolute; top: 50%; left: 0%; width: 12px; height: 12px; border-radius: 999px;
    background: var(--ph-accent); transform: translate(-50%, -50%);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, .25);
}
.ph-player-volume { flex: none; display: flex; align-items: center; gap: 6px; }
.ph-player-volume input[type="range"] { width: 70px; accent-color: var(--ph-accent); cursor: pointer; }

.ph-player-upnext, .ph-player-error {
    position: absolute; inset: 0; display: none;
    align-items: center; justify-content: center; padding: 20px;
    background: rgba(12, 12, 12, .9);
}
.ph-player.is-ended .ph-player-upnext { display: flex; }
.ph-player.has-error .ph-player-error { display: flex; }
.ph-player-upnext-card, .ph-player-error-card { text-align: center; max-width: 320px; }
.ph-player-upnext-label {
    color: var(--ph-text-dim); font-size: 12.5px; text-transform: uppercase;
    letter-spacing: .04em; margin: 0 0 6px;
}
.ph-player-upnext-title, .ph-player-error-title { color: #fff; font-size: 16px; font-weight: 600; margin: 0 0 12px; }
.ph-player-error-text { color: var(--ph-text-dim); font-size: 13.5px; margin: 0 0 16px; }
.ph-player-upnext-actions { display: flex; gap: 10px; justify-content: center; }
.ph-player-upnext-count {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; margin-left: 6px; border-radius: 999px;
    background: rgba(255, 255, 255, .18); font-size: 11px;
}

/* ------------------------------------------------------------- người */

.ph-people {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    gap: 24px 16px;
}
.ph-person { text-align: center; }
.ph-person-photo {
    display: grid; place-items: end center;
    width: 88px; height: 88px; margin: 0 auto 10px;
    border-radius: 50%; overflow: hidden;
    background: var(--ph-surface);
    transition: box-shadow var(--ph-ease);
}
.ph-person:hover .ph-person-photo { box-shadow: 0 0 0 2px var(--ph-accent); }
.ph-person-photo img { width: 100%; height: 100%; object-fit: cover; }
.ph-person-placeholder { width: 76%; height: 76%; color: var(--ph-text-mute); }
.ph-person-name { font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.ph-person:hover .ph-person-name { color: var(--ph-accent); }
.ph-person-role { margin-top: 2px; font-size: 12px; color: var(--ph-text-faint); }

.ph-person-head {
    display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 28px; align-items: center;
    padding: 28px 30px; border-radius: var(--ph-radius-lg); background: var(--ph-panel);
}
.ph-person-photo-lg { width: 180px; height: 180px; margin: 0; border-radius: var(--ph-radius-lg); }

/* --------------------------------------------------------- thể loại, chuyên mục */

.ph-genre-grid, .ph-cat-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.ph-genre-card, .ph-cat {
    display: inline-flex; align-items: center; gap: 10px;
    height: 44px; padding: 0 8px 0 20px; border-radius: var(--ph-radius);
    background: var(--ph-surface); font-size: 15px; font-weight: 500;
    transition: background var(--ph-ease);
}
.ph-genre-card:hover, .ph-cat:hover { background: var(--ph-accent); }
.ph-genre-card-count, .ph-cat-count {
    display: inline-grid; place-items: center; min-width: 30px; height: 28px; padding: 0 8px;
    border-radius: 6px; background: rgba(0, 0, 0, .28);
    font-size: 12.5px; font-weight: 600; color: var(--ph-text-dim);
}
.ph-genre-card:hover .ph-genre-card-count, .ph-cat:hover .ph-cat-count { color: #fff; }

/* ------------------------------------------------------- chip thể loại */
/* Hàng chip mọi thể loại trên trang thể loại: xuống dòng hết, không gập. */
.ph-genre-nav { position: relative; margin: -2px 0 28px; }
.ph-genre-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.ph-genre-chip {
    display: inline-flex; align-items: center; height: 40px; padding: 0 16px;
    border-radius: 6px; background: var(--ph-surface); color: var(--ph-text);
    font-size: 16px; font-weight: 500; white-space: nowrap;
    transition: background var(--ph-ease), color var(--ph-ease);
}
.ph-genre-chip:hover { background: var(--ph-bg-hover); }
.ph-genre-chip.is-active { background: var(--ph-accent); color: #fff; }
.ph-genre-more { display: none; }
@media (max-width: 768px) {
    .ph-genre-nav { margin-bottom: 20px; }
    .ph-genre-chips { gap: 8px; }
    .ph-genre-chip { height: 34px; padding: 0 12px; font-size: 14px; }
}

/* --------------------------------------------------------------- phân trang */

.ph-pagination {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
    margin-top: 44px;
}
.ph-page {
    display: inline-grid; place-items: center;
    min-width: 40px; height: 40px; padding: 0 14px; border-radius: var(--ph-radius);
    background: var(--ph-surface); color: var(--ph-text);
    font-size: 14px; font-weight: 500;
    transition: background var(--ph-ease);
}
a.ph-page:hover { background: var(--ph-bg-hover); }
.ph-page.is-current { background: var(--ph-accent); color: #fff; }
span.ph-page[aria-hidden="true"] { background: none; color: var(--ph-text-faint); }

/* ----------------------------------------------------------- đầu trang tĩnh */

.ph-pagehead { padding-top: 26px; }
.ph-crumbs {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    margin-bottom: 18px; font-size: 15px; color: var(--ph-text-dim);
}
.ph-crumbs a:hover { color: var(--ph-accent); }
.ph-crumbs [aria-current="page"] { color: var(--ph-text); }
.ph-crumb-sep { color: var(--ph-text-mute); font-size: 0; }
.ph-crumb-sep::before { content: "›"; font-size: 15px; }
.ph-pagehead-eyebrow { color: var(--ph-accent); font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.ph-pagehead-title { font-size: 30px; font-weight: 600; letter-spacing: -.015em; }
.ph-pagehead-lead { margin-top: 10px; max-width: 760px; color: var(--ph-text-dim); font-size: 15px; }

/* ----------------------------------------------------------- văn bản dài */

.ph-prose { color: var(--ph-text-dim); font-size: 15px; line-height: 1.75; }
.ph-prose > * + * { margin-top: 1em; }
.ph-prose h2, .ph-prose h3 { color: var(--ph-text); margin-top: 1.6em; }
.ph-prose h2 { font-size: 22px; }
.ph-prose h3 { font-size: 18px; }
.ph-prose a { color: var(--ph-accent); }
.ph-prose a:hover { text-decoration: underline; }
.ph-prose ul, .ph-prose ol { padding-left: 1.3em; }
.ph-prose img { border-radius: 12px; height: auto; }
.ph-prose blockquote {
    margin: 1.2em 0; padding: 12px 18px; border-left: 3px solid var(--ph-accent);
    background: var(--ph-panel); border-radius: 0 12px 12px 0;
}
.ph-prose-page {
    max-width: 880px; padding: 30px 34px; border-radius: var(--ph-radius-lg); background: var(--ph-panel);
}

/* ----------------------------------------------------------- blog */

.ph-post-grid {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px;
}
.ph-post {
    display: flex; flex-direction: column; overflow: hidden;
    border-radius: 16px; background: var(--ph-panel);
    transition: transform var(--ph-ease);
}
.ph-post:hover { transform: translateY(-3px); }
.ph-post-cover { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--ph-bg-card); }
.ph-post-cover img { width: 100%; height: 100%; object-fit: cover; }
.ph-post-body { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 22px; }
.ph-post-cat { color: var(--ph-accent); font-size: 12.5px; font-weight: 600; }
.ph-post-title { font-size: 18px; font-weight: 600; line-height: 1.4; }
.ph-post-title a:hover { color: var(--ph-accent); }
.ph-post-excerpt {
    color: var(--ph-text-dim); font-size: 14px;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.ph-post-meta { color: var(--ph-text-faint); font-size: 12.5px; }

.ph-article { max-width: 880px; margin: 28px auto 0; }
.ph-article-meta { color: var(--ph-text-faint); font-size: 14px; margin: 12px 0 16px; }
.ph-article-figure { margin: 22px 0; border-radius: var(--ph-radius-lg); overflow: hidden; }
.ph-article-figure img { width: 100%; height: auto; }
.ph-article-body { font-size: 16px; }

.ph-post-nav {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px;
    margin-top: 40px;
}
.ph-post-nav-link {
    display: flex; flex-direction: column; gap: 4px;
    padding: 16px 18px; border-radius: 14px; background: var(--ph-panel);
    transition: background var(--ph-ease);
}
.ph-post-nav-link:hover { background: var(--ph-surface); }
.ph-post-nav-next { text-align: right; grid-column: 2; }
.ph-post-nav-label { color: var(--ph-text-faint); font-size: 12.5px; }
.ph-post-nav-title { font-weight: 600; }

/* ----------------------------------------------------------- tìm kiếm, rỗng */

.ph-search-block { width: 100%; max-width: 520px; margin: 0 0 30px; }
.ph-search-block input { height: 48px; font-size: 15px; }

.ph-empty {
    display: grid; place-items: center; gap: 6px;
    padding: 64px 20px; border-radius: var(--ph-radius-lg);
    background: var(--ph-panel); text-align: center; color: var(--ph-text-dim);
}
.ph-empty-title { font-size: 16px; font-weight: 500; }

/* ---------------------------------------------------------------- footer */

.ph-footer { margin-top: 96px; padding: 36px 0 22px; background: var(--ph-surface); }
.ph-footer > .ph-container { max-width: calc(1260px + var(--ph-gutter) * 2); }
.ph-footer-top { display: flex; flex-wrap: wrap; gap: 36px; padding-bottom: 30px; }

.ph-footer-about { flex: 1 1 260px; max-width: 320px; }
.ph-footer-about .ph-brand { margin-bottom: 14px; }
.ph-footer-text { color: var(--ph-text-mute); font-size: 14px; line-height: 1.65; margin-bottom: 14px; }
.ph-footer-contact {
    display: grid; gap: 4px; margin-bottom: 16px;
    font-style: normal; color: var(--ph-text-mute); font-size: 14px;
}
.ph-footer-contact a:hover { color: var(--ph-text); }

.ph-social { display: flex; flex-wrap: wrap; gap: 8px; }
.ph-social a {
    display: grid; place-items: center; width: 30px; height: 30px; border-radius: 999px;
    background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .75);
    transition: background var(--ph-ease), color var(--ph-ease);
}
.ph-social a:hover { background: var(--ph-accent); color: #fff; }
.ph-social svg { width: 15px; height: 15px; }

.ph-footer-col { flex: 1 1 150px; min-width: 140px; }
.ph-footer-title { font-size: 20px; font-weight: 600; margin: 0 0 14px; }
.ph-footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ph-footer-col a { color: var(--ph-text-mute); font-size: 15px; transition: color var(--ph-ease); }
.ph-footer-col a:hover { color: var(--ph-text); }

/* Cột thể loại dài tự chia cột nhỏ — footer.php đặt is-cols-N / is-rows-N. */
.ph-footer-col.is-cols-2 { flex: 2 2 332px; }
.ph-footer-col.is-cols-3 { flex: 3 3 514px; }
.ph-footer-col.is-cols-2 ul,
.ph-footer-col.is-cols-3 ul { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); column-gap: 32px; }
.ph-footer-col.is-rows-4 ul { grid-template-rows: repeat(4, auto); }
.ph-footer-col.is-rows-5 ul { grid-template-rows: repeat(5, auto); }
.ph-footer-col.is-rows-6 ul { grid-template-rows: repeat(6, auto); }
.ph-footer-col.is-rows-7 ul { grid-template-rows: repeat(7, auto); }
.ph-footer-col.is-rows-8 ul { grid-template-rows: repeat(8, auto); }
.ph-footer-col.is-rows-9 ul { grid-template-rows: repeat(9, auto); }
.ph-footer-col.is-rows-10 ul { grid-template-rows: repeat(10, auto); }
.ph-footer-col.is-rows-11 ul { grid-template-rows: repeat(11, auto); }
.ph-footer-col.is-rows-12 ul { grid-template-rows: repeat(12, auto); }

.ph-footer-bottom {
    padding-top: 20px; border-top: 1px solid var(--ph-line);
    text-align: center; color: var(--ph-text-mute); font-size: 14px;
}

/* ---------------------------------------------------------------- lên đầu trang */

.ph-totop {
    position: fixed; right: 28px; bottom: 32px; z-index: 800;
    width: 48px; height: 48px; border-radius: 999px; border: 0; cursor: pointer;
    display: grid; place-items: center;
    background: rgba(245, 49, 94, .92); color: #fff;
    box-shadow: 0 10px 26px rgba(245, 49, 94, .35);
    opacity: 0; transform: translateY(12px); pointer-events: none;
    transition: opacity var(--ph-ease), transform var(--ph-ease), background var(--ph-ease);
}
.ph-totop.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.ph-totop:hover { background: var(--ph-accent); }

/* ---------------------------------------------------------------- trang lỗi */
/* Layout lỗi (views/layouts/error.php) chỉ nạp file này: không dựa vào CSDL. */

.error-main { min-height: 100vh; display: grid; place-items: center; padding: 24px var(--ph-gutter); }
.error-card {
    width: 100%; max-width: 520px; padding: 40px 32px;
    border-radius: var(--ph-radius-lg); background: var(--ph-panel);
    text-align: center; box-shadow: var(--ph-shadow);
}
.error-code {
    font-size: 72px; font-weight: 800; line-height: 1; letter-spacing: -.04em;
    background: linear-gradient(135deg, #ff5c7a, var(--ph-accent) 55%, #ff8a3d);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.error-title { margin-top: 16px; font-size: 24px; font-weight: 700; }
.error-text { margin-top: 10px; color: var(--ph-text-dim); font-size: 15px; }
.error-custom { margin-top: 12px; color: var(--ph-text-dim); text-align: left; }
.error-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 26px; }
.error-actions .button {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 44px; padding: 0 24px; border-radius: 999px;
    font-size: 15px; font-weight: 600;
    transition: background var(--ph-ease);
}
.error-actions .button-primary { background: var(--ph-accent); color: #fff; }
.error-actions .button-primary:hover { background: var(--ph-accent-hover); }
.error-actions .button-secondary { background: var(--ph-surface); color: var(--ph-text); }
.error-actions .button-secondary:hover { background: var(--ph-bg-hover); }

/* ================================================================ màn hình */

@media (max-width: 1360px) {
    .ph-rail-prev { left: -8px; }
    .ph-rail-next { right: -8px; }
}

@media (max-width: 1180px) {
    :root { --ph-section-gap: 80px; }
    .ph-nav { gap: 24px; margin-left: 8px; }
    .ph-nav-link { font-size: 15.5px; }
    .ph-search { width: 200px; }
    .ph-rail-track { grid-auto-columns: calc((100% - var(--ph-gap) * 4) / 5); }
    .ph-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .ph-watch-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 360px); }
    .ph-detail-inner { grid-template-columns: minmax(0, 320px) minmax(0, 1fr); }
    .ph-hero-slide[data-pos="-2"], .ph-hero-slide[data-pos="2"] { opacity: 0; pointer-events: none; }
    .ph-hero-stage::before { width: 1000px; margin-left: -500px; }
}

@media (max-width: 1024px) {
    .ph-nav { display: none; }
    .ph-burger { display: inline-flex; }
    .ph-search { margin-left: auto; }
    .ph-rail-track { grid-auto-columns: calc((100% - var(--ph-gap) * 3) / 4); }
    .ph-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .ph-watch-layout { grid-template-columns: 1fr; }
    .ph-post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ph-panel .ph-episodes { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
}

@media (max-width: 768px) {
    :root {
        --ph-gutter: 16px;
        --ph-header-h: 58px;
        --ph-section-gap: 40px;
        --ph-gap: 10px;
    }
    .ph-header-inner { gap: 12px; }
    .ph-brand-name { font-size: 16px; }
    .ph-brand-logo, .ph-brand-mark { width: 28px; height: 28px; }
    .ph-search { width: auto; flex: 1 1 auto; max-width: 260px; }
    .ph-search input { height: 36px; font-size: 13.5px; }
    /* Màn hẹp: chỉ còn quả địa cầu, bảng vẫn mở được. */
    .ph-lang-label, .ph-lang-caret { display: none; }
    .ph-lang-menu { left: auto; right: -8px; margin-left: 0; }

    .ph-section-title, .ph-pagehead-title { font-size: 22px; }
    .ph-section-head { margin-bottom: 14px; }

    /* Hero điện thoại: một poster tràn viền, tên phim và nút phát đè lên chân poster. */
    .ph-hero { padding: var(--ph-header-h) 0 0; }
    .ph-hero::before { width: 100%; height: 620px; background-size: cover; }
    .ph-hero-ambient, .ph-hero-stage::before { display: none; }
    .ph-hero-stage { height: auto; aspect-ratio: 3 / 4; perspective: none; }
    .ph-hero-slide-name { display: none; }
    .ph-hero-slide { left: 0; top: 0; width: 100%; height: 100%; margin-left: 0; transform: none !important; filter: none !important; }
    .ph-hero-slide:not([data-pos="0"]) { opacity: 0 !important; pointer-events: none !important; }
    .ph-hero-poster { height: 100%; aspect-ratio: auto; border-radius: 0; box-shadow: none; }
    .ph-hero-arrow { display: none; }
    .ph-hero-info { top: var(--ph-header-h); left: 0; width: 100%; height: auto; aspect-ratio: 3 / 4; margin-left: 0; border-radius: 0; }
    .ph-hero-title { display: none; }
    .ph-hero-panel {
        opacity: 1; transform: none; pointer-events: auto;
        padding: 60px var(--ph-gutter) 34px; border-radius: 0; text-align: center;
        background: linear-gradient(180deg, rgba(19, 19, 19, 0) 0%, rgba(19, 19, 19, .85) 45%, rgba(19, 19, 19, .96) 100%);
        -webkit-backdrop-filter: none; backdrop-filter: none;
    }
    .ph-hero-panel-name { font-size: 20px; }
    .ph-hero-chips { justify-content: center; }
    .ph-hero-desc { -webkit-line-clamp: 2; }
    .ph-hero-panel-actions { justify-content: center; }
    .ph-hero-play { height: 39px; font-size: 14px; }
    .ph-hero-dots { position: absolute; left: 0; right: 0; bottom: 12px; margin: 0; gap: 6px; z-index: 7; }
    .ph-hero-dot { width: 6px; height: 6px; }
    .ph-hero-dot.is-active { width: 18px; }

    .ph-rail-track { grid-auto-columns: calc((100% - var(--ph-gap) * 2) / 3.2); }
    .ph-rail-btn { display: none; }
    .ph-card-title { font-size: 13.5px; margin-top: 8px; }
    .ph-card-sub { font-size: 10.5px; margin-top: 4px; gap: 0 3px; letter-spacing: -.01em; }
    .ph-card-dot { font-size: 7px; }
    .ph-card-rank { font-size: 38px; }
    .ph-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px var(--ph-gap); }

    .ph-detail { padding-top: 16px; }
    .ph-detail-inner { grid-template-columns: 1fr; }
    .ph-detail-poster { position: relative; top: 0; width: min(62%, 260px); margin-inline: auto; border-radius: 16px; }
    .ph-panel { padding: 22px 18px 24px; border-radius: 16px; }
    .ph-detail-title { font-size: 22px; text-align: center; }
    .ph-detail-original { text-align: center; }
    .ph-detail .ph-meta, .ph-detail .ph-chips { justify-content: center; }
    .ph-detail .ph-actions { justify-content: center; }
    .ph-detail .ph-actions .ph-btn { flex: 1 1 auto; }
    .ph-fact { grid-template-columns: 90px minmax(0, 1fr); }

    .ph-watch { padding-top: 0; }
    .ph-watch > .ph-container { padding-inline: 0; }
    .ph-player-shell { border-radius: 0; }
    .ph-watch-layout .ph-panel { margin-inline: var(--ph-gutter); }
    .ph-watch-layout { gap: 16px; }
    .ph-player-volume input[type="range"] { display: none; }
    .ph-player-time { min-width: 74px; font-size: 11.5px; }
    .ph-player-bar { padding: 18px 8px 8px; gap: 6px; }

    .ph-people { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 18px 10px; }
    .ph-person-photo { width: 72px; height: 72px; }
    .ph-person-head { grid-template-columns: 1fr; text-align: center; justify-items: center; padding: 22px 18px; }
    .ph-person-photo-lg { width: 140px; height: 140px; }

    .ph-podium { gap: 10px; margin-bottom: 26px; }
    .ph-podium-poster { width: 88%; }
    .ph-podium-rank, .ph-podium-1 .ph-podium-rank { width: 30px; height: 30px; font-size: 15px; left: 6px; top: 6px; }
    .ph-podium-title { font-size: 13.5px; }
    .ph-podium-metric { font-size: 12px; }
    .ph-podium-body .ph-btn { display: none; }
    .ph-rankrow { grid-template-columns: 34px 54px minmax(0, 1fr); gap: 2px 12px; padding: 10px 8px; }
    .ph-rankrow-rank { font-size: 24px; grid-row: span 2; }
    .ph-rankrow-poster { width: 54px; grid-row: span 2; }
    .ph-rankrow-title { font-size: 15px; }
    .ph-rankrow-meta { flex-wrap: nowrap; overflow: hidden; white-space: nowrap; }
    .ph-rankrow-summary, .ph-rankrow-play { display: none; }
    .ph-rankrow-metric { grid-column: 3; justify-self: start; font-size: 12.5px; }

    .ph-tab { height: 36px; padding: 0 16px; font-size: 14px; }
    .ph-post-grid { grid-template-columns: 1fr; }
    .ph-post-nav { grid-template-columns: 1fr; }
    .ph-post-nav-next { grid-column: auto; }
    .ph-prose-page { padding: 22px 18px; }

    .ph-footer { margin-top: 64px; padding-top: 28px; }
    .ph-footer-top { gap: 26px; }
    .ph-footer-about { flex: 1 1 100%; max-width: none; }
    .ph-footer-col { flex: 1 1 40%; }
    .ph-footer-col.is-cols-2, .ph-footer-col.is-cols-3 { flex: 1 1 100%; }
    .ph-footer-col.is-cols-2 ul, .ph-footer-col.is-cols-3 ul {
        grid-auto-flow: row; grid-template-rows: none;
        grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px;
    }
    .ph-footer-title { font-size: 17px; margin-bottom: 10px; }
    .ph-footer-col a { font-size: 14px; }
    .ph-totop { right: 16px; bottom: 20px; width: 44px; height: 44px; }
}

@media (max-width: 420px) {
    .ph-header-inner { gap: 10px; }
    .ph-brand-name { font-size: 15px; }
    .ph-search input { padding-right: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
    .ph-rail-track { scroll-behavior: auto; }
}
