/* ===========================================================================
   Giao diện công khai — theme phim
   ===========================================================================

   Nền xanh đen sâu, một màu nhấn ngọc (teal), bo góc 12px, khung nội dung
   1200px. Không framework, không build step, không font tải ngoài: CSP của
   site là `style-src 'self'`, nên chữ dùng bộ font hệ thống.

   JS (film.js) chỉ bám vào thuộc tính data-* và một vài class trạng thái
   (is-active, is-current, has-controls, is-playing, is-idle, is-muted,
   is-ended, has-error). Các class đó được giữ nguyên tên ở đây.
   =========================================================================== */

:root {
    --ph-bg:          #060913;
    --ph-bg-soft:     #0b1020;
    --ph-bg-card:     #0f1628;
    --ph-bg-hover:    #152036;
    --ph-bg-input:    #121a2e;
    --ph-bg-footer:   #0f1629;

    --ph-line:        rgba(148, 163, 184, .13);
    --ph-line-strong: rgba(148, 163, 184, .24);

    --ph-text:        #f8fafc;
    --ph-text-2:      #cbd5e1;
    --ph-text-dim:    #94a3b8;
    --ph-text-faint:  #64748b;

    --ph-accent:      #14b8a6;
    --ph-accent-2:    #2dd4bf;
    --ph-accent-deep: #0f766e;
    --ph-accent-soft: rgba(20, 184, 166, .16);
    --ph-accent-line: rgba(45, 212, 191, .38);
    --ph-star:        #facc15;
    --ph-hot:         #f43f5e;

    --ph-radius:      12px;
    --ph-radius-sm:   8px;
    --ph-radius-pill: 999px;
    --ph-container:   1200px;
    --ph-gutter:      20px;
    --ph-header-h:    64px;

    --ph-shadow:      0 12px 32px rgba(0, 0, 0, .45);
    --ph-ease:        .2s ease;

    --ph-font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
               "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
}

/* ------------------------------------------------------------------ reset */

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

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

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

img, svg, video, iframe { display: block; max-width: 100%; }
img { height: auto; }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 { margin: 0; color: var(--ph-text); line-height: 1.25; font-weight: 700; }
p { margin: 0; }

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }

:focus-visible { outline: 2px solid var(--ph-accent-2); outline-offset: 2px; border-radius: 4px; }

[hidden] { display: none !important; }

.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: 12px; top: -60px; z-index: 100;
    padding: 10px 16px; border-radius: var(--ph-radius-sm);
    background: var(--ph-accent); color: #04211d; font-weight: 700;
}
.ph-skip:focus { top: 12px; }

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

.ph-main { display: block; min-height: 60vh; padding-bottom: 56px; }

.ph-mt-sm { margin-top: 8px; }
.ph-mt-md { margin-top: 16px; }
.ph-mt-lg { margin-top: 24px; }

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

.ph-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(6, 9, 19, .86);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid var(--ph-line);
}

.ph-header-inner {
    display: flex; align-items: center; gap: 32px;
    height: calc(var(--ph-header-h) - 1px);
    max-width: calc(var(--ph-container) + var(--ph-gutter) * 2);
    margin-inline: auto;
    padding-inline: var(--ph-gutter);
}

.ph-brand {
    flex: none; display: inline-flex; align-items: center; gap: 9px;
    color: var(--ph-accent-2);
}
.ph-brand-logo { width: auto; height: 32px; }
.ph-brand-mark { flex: none; width: 34px; height: 34px; }
.ph-brand-name {
    font-size: 20px; font-weight: 800; letter-spacing: -.01em;
    background: linear-gradient(90deg, #5eead4, #14b8a6 70%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
}

.ph-nav {
    display: flex; align-items: center; gap: 20px;
    min-width: 0; flex: 1 1 auto;
}

.ph-nav-link {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 8px 0;
    background: none; border: 0;
    color: var(--ph-text); font-size: 16px; font-weight: 500;
    white-space: nowrap;
    transition: color var(--ph-ease);
}
.ph-nav-link:hover,
.ph-nav-link.is-active { color: var(--ph-accent-2); }

.ph-more { position: relative; }
.ph-more-toggle svg { transition: transform var(--ph-ease); }
.ph-more-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.ph-more-menu {
    position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%);
    min-width: 220px; max-height: min(70vh, 460px); overflow-y: auto;
    display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
    padding: 8px; border-radius: var(--ph-radius);
    background: var(--ph-bg-card); border: 1px solid var(--ph-line-strong);
    box-shadow: var(--ph-shadow);
}
.ph-more-menu a {
    padding: 8px 12px; border-radius: var(--ph-radius-sm);
    color: var(--ph-text-2); font-size: 14px; font-weight: 500; white-space: nowrap;
}
.ph-more-menu a:hover { background: var(--ph-bg-hover); color: var(--ph-accent-2); }

.ph-header-tools { flex: none; display: flex; align-items: center; gap: 14px; margin-left: auto; }

.ph-search {
    position: relative; display: flex; align-items: center;
    width: 300px; height: 42px;
    border-radius: var(--ph-radius-pill);
    background: var(--ph-bg-input); border: 1px solid transparent;
    transition: border-color var(--ph-ease), background var(--ph-ease);
}
.ph-search:focus-within { border-color: var(--ph-accent-line); background: #141d33; }
.ph-search-icon { position: absolute; left: 14px; color: var(--ph-text-faint); pointer-events: none; }
.ph-search input {
    width: 100%; height: 100%;
    padding: 0 16px 0 38px;
    background: none; border: 0; outline: none;
    color: var(--ph-text-2); font-size: 14px;
}
.ph-search input::placeholder { color: var(--ph-text-faint); }
.ph-search-block { width: 100%; max-width: 560px; height: 46px; margin-bottom: 24px; border-color: var(--ph-line-strong); }
.ph-search-block input { font-size: 15px; }
.ph-search input::-webkit-search-cancel-button { filter: invert(.6); }

/*
 * Bộ chuyển ngôn ngữ như bản mẫu: chỉ quả địa cầu; bảng trắng bo 6px, chữ
 * tối căn giữa. Mục đang chọn mang màu nhấn của site.
 */
.ph-lang { position: relative; flex: none; }
.ph-lang-toggle {
    display: grid; place-items: center; width: 36px; height: 36px; padding: 0;
    border: 0; border-radius: 999px; background: none; cursor: pointer;
    color: var(--ph-text); transition: color 180ms ease;
}
.ph-lang-toggle:hover, .ph-lang-toggle[aria-expanded="true"] { color: var(--ph-accent-2); }
.ph-lang-menu {
    position: absolute; top: calc(100% + 6px); left: 50%; z-index: 120;
    width: 125px; margin-left: -62.5px; max-height: calc(100vh - 90px); overflow-y: auto;
    display: grid; gap: 12px; padding: 12px;
    border-radius: 6px; background: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
.ph-lang-menu[hidden] { display: none; }
.ph-lang-item {
    display: block; padding: 4px 8px; border-radius: 4px;
    font-size: 14px; line-height: 20px; text-align: center; color: #262626;
}
.ph-lang-item:hover { background: #f1f5f9; }
.ph-lang-item.is-active { color: var(--ph-accent); font-weight: 600; }
.ph-locale {
    padding: 3px 7px; border-radius: 6px;
    color: var(--ph-text-dim); font-size: 12px; font-weight: 700;
}
.ph-locale:hover { color: var(--ph-text); }
.ph-locale.is-active { color: var(--ph-accent-2); background: var(--ph-accent-soft); }

.ph-burger {
    display: none;
    width: 40px; height: 40px; padding: 0;
    border-radius: 10px; border: 1px solid var(--ph-line-strong);
    background: var(--ph-bg-input);
    place-items: center;
}
.ph-burger span,
.ph-burger span::before,
.ph-burger span::after {
    display: block; width: 18px; height: 2px; border-radius: 2px;
    background: var(--ph-text); transition: transform var(--ph-ease), background var(--ph-ease);
}
.ph-burger span { position: relative; }
.ph-burger span::before,
.ph-burger span::after { content: ""; position: absolute; left: 0; }
.ph-burger span::before { top: -6px; }
.ph-burger span::after { top: 6px; }
.ph-burger[aria-expanded="true"] span { background: transparent; }
.ph-burger[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.ph-burger[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }

.ph-drawer {
    border-top: 1px solid var(--ph-line);
    background: var(--ph-bg-soft);
    padding: 14px var(--ph-gutter) 20px;
    max-height: calc(100vh - var(--ph-header-h));
    overflow-y: auto;
}
.ph-drawer .ph-search-drawer { width: 100%; height: 42px; margin-bottom: 14px; }
.ph-drawer-links {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px;
}
.ph-drawer-links a {
    padding: 10px 12px; border-radius: var(--ph-radius-sm);
    color: var(--ph-text); font-size: 14.5px; font-weight: 600;
    background: rgba(255, 255, 255, .02);
}
.ph-drawer-links a:hover,
.ph-drawer-links a.is-active { color: var(--ph-accent-2); background: var(--ph-accent-soft); }
.ph-drawer-locales {
    display: flex; gap: 6px; margin-top: 14px; padding-top: 14px;
    border-top: 1px solid var(--ph-line);
}

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

.ph-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 48px; padding: 0 24px;
    border-radius: var(--ph-radius); border: 1px solid transparent;
    font-size: 16px; font-weight: 700; white-space: nowrap;
    transition: background var(--ph-ease), border-color var(--ph-ease), color var(--ph-ease), transform var(--ph-ease), box-shadow var(--ph-ease);
}
.ph-btn:active { transform: translateY(1px); }
.ph-btn-primary {
    background: var(--ph-accent); color: #fff;
    box-shadow: 0 8px 22px rgba(20, 184, 166, .28);
}
.ph-btn-primary:hover { background: var(--ph-accent-2); color: #042f2b; }
.ph-btn-play { height: 48px; padding: 0 24px; font-size: 17px; }
.ph-btn-ghost {
    background: rgba(255, 255, 255, .06); border-color: var(--ph-line-strong); color: var(--ph-text);
}
.ph-btn-ghost:hover { border-color: var(--ph-accent-line); color: var(--ph-accent-2); }
.ph-btn-sm { height: 38px; padding: 0 16px; font-size: 14px; border-radius: 10px; }

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

.ph-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

.ph-tag,
.ph-chip,
.ph-badge {
    display: inline-flex; align-items: center;
    height: 24px; padding: 0 8px;
    border-radius: 12px;
    background: var(--ph-accent-soft); border: 1px solid var(--ph-accent-line);
    color: var(--ph-accent-2); font-size: 14px; font-weight: 500; line-height: 1;
    white-space: nowrap;
}
.ph-tag-muted { background: rgba(148, 163, 184, .1); border-color: var(--ph-line-strong); color: var(--ph-text-dim); }
a.ph-chip:hover { background: var(--ph-accent); border-color: var(--ph-accent); color: #fff; }
.ph-chip-hot { background: rgba(244, 63, 94, .16); border-color: rgba(244, 63, 94, .45); color: #fda4af; }
.ph-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.ph-rating {
    display: inline-flex; align-items: center; gap: 4px;
    color: var(--ph-star); font-size: 13px; font-weight: 700;
}
.ph-rating-lg { font-size: 20px; gap: 5px; }

/* -------------------------------------------------------------- tiêu đề mục */

.ph-section { padding-top: 32px; }

.ph-section-head {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
    margin-bottom: 20px;
}
.ph-section-title { font-size: 24px; line-height: 32px; letter-spacing: -.01em; }
h1.ph-section-title { font-size: 30px; line-height: 36px; }
.ph-section-title a { display: inline-flex; align-items: center; gap: 6px; }
.ph-section-title a:hover { color: var(--ph-accent-2); }
.ph-section-more {
    flex: none; display: inline-flex; align-items: center; gap: 2px;
    color: var(--ph-accent-2); font-size: 14px; font-weight: 600;
}
.ph-section-more:hover { color: var(--ph-text); }

.ph-block { margin-top: 32px; }
.ph-block:first-child { margin-top: 0; }
.ph-block-title { font-size: 24px; line-height: 32px; margin-bottom: 16px; }

/* ---------------------------------------------------------------- hero */

.ph-hero {
    position: relative; isolation: isolate; overflow: hidden;
    display: grid; grid-template-columns: minmax(0, 1fr);
    padding: 32px 0 36px;
}
.ph-hero::after {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background:
        linear-gradient(90deg, rgba(6, 9, 19, .96) 0%, rgba(6, 9, 19, .78) 40%, rgba(6, 9, 19, .55) 100%),
        linear-gradient(0deg, var(--ph-bg) 0%, rgba(6, 9, 19, 0) 38%);
}
.ph-hero-bg {
    position: absolute; inset: -40px; z-index: -2;
    width: calc(100% + 80px); height: calc(100% + 80px); max-width: none;
    object-fit: cover;
    filter: blur(22px) saturate(1.2);
    opacity: .75;
}

.ph-hero-heading {
    margin-bottom: 24px;
    text-align: center; font-size: 30px; line-height: 36px; letter-spacing: -.01em;
}

/*
 * Chuyển slide kiểu hoà dần: mọi slide nằm chồng trong CÙNG một ô lưới, slide
 * đang ẩn vẫn được dựng (chỉ trong suốt) thay vì display:none — nên slide cũ
 * mờ đi trong lúc slide mới hiện lên, không có nhịp nền trống ở giữa, và khối
 * hero giữ nguyên chiều cao (bằng slide cao nhất) khi chuyển.
 *
 * film.js vẫn chỉ bật/tắt thuộc tính `hidden`; selector dưới đây đủ mạnh để
 * thắng luật chung [hidden] { display: none !important }. `visibility` được
 * trễ theo opacity, nên liên kết của slide ẩn không nhận được Tab hay chuột.
 */
.ph-hero > .ph-container { grid-row: 1; }
.ph-hero-slide {
    grid-row: 2; grid-column: 1;
    opacity: 1; visibility: visible;
    transition: opacity .7s ease, visibility 0s linear 0s;
}
.ph-hero-slide[hidden] {
    display: block !important;
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity .7s ease, visibility 0s linear .7s;
}
.ph-hero-slide .ph-hero-inner { transition: transform .7s cubic-bezier(.2, .7, .2, 1); }
.ph-hero-slide[hidden] .ph-hero-inner { transform: translateY(12px); }
.ph-hero-slide .ph-hero-bg { transition: transform 1.2s ease; }
.ph-hero-slide[hidden] .ph-hero-bg { transform: scale(1.04); }

.ph-hero-inner {
    display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px;
    align-items: stretch;
    min-height: 0;
}

.ph-hero-poster {
    position: relative; display: block; overflow: hidden;
    aspect-ratio: 3 / 4; border-radius: var(--ph-radius);
    background: var(--ph-bg-card);
    box-shadow: var(--ph-shadow);
}
.ph-hero-poster img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.ph-hero-poster:hover img { transform: scale(1.04); }

.ph-hero-body { display: flex; flex-direction: column; min-width: 0; padding: 16px 0 0; }
.ph-hero-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.ph-hero-title { font-size: 24px; line-height: 32px; letter-spacing: -.01em; }
.ph-hero-title a:hover { color: var(--ph-accent-2); }
.ph-hero-desc {
    margin-top: 12px; max-width: 976px;
    color: var(--ph-text-2); font-size: 16px; line-height: 24px;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.ph-hero-body .ph-actions { margin-top: auto; padding-top: 22px; }

.ph-hero-foot {
    position: absolute; left: 0; right: 0; bottom: 36px; z-index: 2;
    pointer-events: none;
}
.ph-hero-picker {
    display: flex; align-items: center; gap: 8px;
    width: min(460px, 44%); margin-left: auto;
    pointer-events: auto;
}
.ph-hero-picker-track {
    display: flex; gap: 8px; flex: 1 1 auto; min-width: 0;
    overflow-x: auto; scroll-snap-type: x mandatory;
    padding: 4px 2px; scrollbar-width: none;
}
.ph-hero-picker-track::-webkit-scrollbar { display: none; }
.ph-hero-thumb {
    flex: none; width: 56px; aspect-ratio: 7 / 10; padding: 0; overflow: hidden;
    border-radius: 8px; border: 2px solid transparent;
    background: var(--ph-bg-card); opacity: .55;
    scroll-snap-align: start;
    transition: opacity var(--ph-ease), border-color var(--ph-ease), transform var(--ph-ease);
}
.ph-hero-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ph-hero-thumb:hover { opacity: .9; }
.ph-hero-thumb.is-active { opacity: 1; border-color: var(--ph-accent-2); transform: translateY(-2px); }
.ph-hero-thumb .ph-card-empty { font-size: 8px; padding: 2px; }
.ph-hero-picker-next {
    flex: none; width: 34px; height: 34px; padding: 0;
    display: grid; place-items: center;
    border-radius: 50%; border: 1px solid var(--ph-line-strong);
    background: rgba(15, 22, 40, .8); color: var(--ph-text);
}
.ph-hero-picker-next:hover { background: var(--ph-accent); border-color: var(--ph-accent); }

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

.ph-card { min-width: 0; }
.ph-card-link { display: block; }

.ph-card-poster {
    position: relative; overflow: hidden;
    aspect-ratio: 3 / 4;
    border-radius: var(--ph-radius);
    background: var(--ph-bg-card);
}
.ph-card-poster img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .45s ease, filter .45s ease;
}
.ph-card-poster::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, .45) 0%, rgba(0, 0, 0, 0) 26%, rgba(0, 0, 0, 0) 70%, rgba(0, 0, 0, .35) 100%);
    pointer-events: none;
}
.ph-card-link:hover .ph-card-poster img { transform: scale(1.06); filter: brightness(.8); }

.ph-card-empty {
    position: absolute; inset: 0;
    display: grid; place-items: center; padding: 12px;
    background: linear-gradient(160deg, #13223a, #0b1224);
    color: var(--ph-text-dim); font-size: 13px; font-weight: 600; text-align: center;
}

.ph-card-badges {
    position: absolute; top: 8px; left: 8px; right: 8px; z-index: 2;
    display: flex; align-items: flex-start; justify-content: space-between; gap: 6px;
}
.ph-card-badge-rating {
    display: inline-flex; align-items: center; gap: 3px;
    color: var(--ph-star); font-size: 14px; font-weight: 700;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .8);
}
.ph-card-badge {
    padding: 3px 7px; border-radius: 6px;
    background: rgba(6, 9, 19, .72); color: var(--ph-text);
    font-size: 11px; font-weight: 700; line-height: 1.2; white-space: nowrap;
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}

.ph-card-play {
    position: absolute; left: 50%; top: 50%; z-index: 2;
    width: 48px; height: 48px; margin: -24px 0 0 -24px;
    display: grid; place-items: center;
    border-radius: 50%; background: var(--ph-accent); color: #fff;
    box-shadow: 0 6px 20px rgba(20, 184, 166, .45);
    opacity: 0; transform: scale(.7);
    transition: opacity var(--ph-ease), transform var(--ph-ease);
}
.ph-card-play svg { margin-left: 2px; }
.ph-card-link:hover .ph-card-play { opacity: 1; transform: scale(1); }

.ph-card-rank {
    position: absolute; left: 6px; bottom: -6px; z-index: 2;
    font-size: 64px; font-weight: 900; line-height: 1; font-style: italic;
    color: var(--ph-bg);
    -webkit-text-stroke: 2px var(--ph-accent-2);
    text-shadow: 0 4px 16px rgba(0, 0, 0, .6);
}

.ph-card-progress {
    position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 2;
    height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .25); overflow: hidden;
}
.ph-card-progress span { display: block; height: 100%; background: var(--ph-accent-2); }

.ph-card-title {
    margin-top: 8px;
    color: var(--ph-text-2); font-size: 16px; font-weight: 700; line-height: 20px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    transition: color var(--ph-ease);
}
.ph-card-link:hover .ph-card-title { color: var(--ph-accent-2); }
.ph-card-sub { margin-top: 14px; }

/* ------------------------------------------------------------- hàng cuộn */

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

.ph-rail-btn {
    position: absolute; top: 34%; z-index: 5;
    width: 42px; height: 42px; padding: 0;
    display: grid; place-items: center;
    border-radius: 50%; border: 1px solid var(--ph-line-strong);
    background: rgba(15, 22, 40, .92); color: var(--ph-text);
    box-shadow: var(--ph-shadow);
    transition: background var(--ph-ease), border-color var(--ph-ease);
}
.ph-rail-btn:hover { background: var(--ph-accent); border-color: var(--ph-accent); }
.ph-rail-prev { left: -20px; }
.ph-rail-next { right: -20px; }

/* ---------------------------------------------- danh sách gọn (trang chủ) */

.ph-list {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}
.ph-list-item { display: flex; gap: 14px; min-width: 0; }
.ph-list-poster {
    position: relative; flex: none; width: 96px; aspect-ratio: 3 / 4;
    border-radius: 8px; overflow: hidden; background: var(--ph-bg-card);
}
.ph-list-poster img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.ph-list-item:hover .ph-list-poster img { transform: scale(1.06); }
.ph-list-body { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.ph-list-title {
    font-size: 18px; line-height: 24px; font-weight: 700;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ph-list-title a:hover { color: var(--ph-accent-2); }
.ph-list-desc {
    color: var(--ph-text-2); font-size: 14px; line-height: 20px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---------------------------------------------- ô thể loại (trang chủ) */

.ph-gpanels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

.ph-gpanel {
    min-width: 0; overflow: hidden;
    border-radius: var(--ph-radius);
    background: var(--ph-bg-card); border: 1px solid var(--ph-line);
}
.ph-gpanel-head {
    position: relative; isolation: isolate; overflow: hidden;
    display: flex; align-items: center; gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--ph-line);
}
.ph-gpanel-cover {
    position: absolute; inset: 0; z-index: -2;
    width: 100%; height: 100%; object-fit: cover; object-position: center 30%;
    opacity: .35; filter: saturate(1.1);
}
.ph-gpanel-head::after {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(90deg, rgba(15, 22, 40, .95) 0%, rgba(15, 22, 40, .7) 55%, rgba(15, 22, 40, .45) 100%);
}
.ph-gpanel-icon {
    flex: none; width: 42px; height: 42px;
    display: grid; place-items: center;
    border-radius: 10px; background: var(--ph-accent); color: #fff;
}
.ph-gpanel-name { min-width: 0; flex: 1 1 auto; }
.ph-gpanel-name h3 { font-size: 18px; line-height: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-gpanel-name h3 a:hover { color: var(--ph-accent-2); }
.ph-gpanel-name p { color: var(--ph-text-dim); font-size: 12.5px; margin-top: 2px; }
.ph-gpanel-more {
    flex: none; display: inline-flex; align-items: center; gap: 4px;
    color: var(--ph-accent-2); font-size: 13px; font-weight: 700;
}
.ph-gpanel-more:hover { color: var(--ph-text); }

.ph-gpanel-track {
    display: grid; grid-auto-flow: column;
    grid-auto-columns: calc((100% - 3 * 12px) / 4);
    gap: 12px; padding: 16px;
    overflow-x: auto; scroll-snap-type: x mandatory;
    scrollbar-width: thin; scrollbar-color: var(--ph-line-strong) transparent;
}
.ph-gpanel-film { min-width: 0; scroll-snap-align: start; }
.ph-gpanel-poster {
    position: relative; display: block; aspect-ratio: 3 / 4;
    border-radius: var(--ph-radius); overflow: hidden; background: var(--ph-bg-soft);
}
.ph-gpanel-poster img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.ph-gpanel-film:hover .ph-gpanel-poster img { transform: scale(1.06); }
.ph-gpanel-title {
    display: -webkit-box; margin-top: 8px;
    color: var(--ph-text-2); font-size: 13.5px; font-weight: 600; line-height: 1.35;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ph-gpanel-film:hover .ph-gpanel-title { color: var(--ph-accent-2); }

/* -------------------------------------------------- thẻ ngang (lưới trang) */

.ph-wgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }

.ph-wcard {
    display: flex; min-width: 0; overflow: hidden;
    border-radius: var(--ph-radius);
    background: rgba(255, 255, 255, .05);
    transition: background var(--ph-ease), transform var(--ph-ease);
}
.ph-wcard:hover { background: rgba(255, 255, 255, .08); }

.ph-wcard-poster {
    position: relative; flex: none; width: 160px; min-height: 212px;
    background: var(--ph-bg-soft); overflow: hidden;
}
.ph-wcard-poster img {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
    transition: transform .45s ease;
}
.ph-wcard:hover .ph-wcard-poster img { transform: scale(1.06); }
.ph-wcard-poster .ph-card-badge-rating { position: absolute; top: 8px; left: 8px; z-index: 2; }
.ph-wcard-poster::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, 0) 30%);
}
.ph-wcard-rank {
    position: absolute; right: 8px; bottom: 4px; z-index: 2;
    font-size: 44px; font-weight: 900; font-style: italic; line-height: 1;
    color: var(--ph-bg); -webkit-text-stroke: 2px var(--ph-accent-2);
}

.ph-wcard-body {
    min-width: 0; flex: 1 1 auto;
    display: flex; flex-direction: column; align-items: flex-start;
    padding: 16px;
}
.ph-wcard-title {
    max-width: 100%; margin-top: 12px;
    font-size: 20px; line-height: 28px; font-weight: 700;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ph-wcard-title a:hover { color: var(--ph-accent-2); }
.ph-wcard-desc {
    margin-top: 12px;
    color: var(--ph-text-2); font-size: 16px; line-height: 20px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ph-wcard-btn { margin-top: auto; }
.ph-wcard-desc + .ph-wcard-btn,
.ph-wcard-title + .ph-wcard-btn { margin-top: 20px; }
.ph-wcard-btn { height: 44px; font-size: 16px; font-weight: 600; border-radius: var(--ph-radius); }

/* ------------------------------------------------------- lưới poster */

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

/* ------------------------------------------------ thanh lọc (tất cả phim) */

.ph-section-head-filters { flex-wrap: wrap; align-items: center; }
.ph-filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ph-select {
    height: 38px; padding: 0 36px 0 14px;
    border-radius: var(--ph-radius-pill);
    background: var(--ph-bg-input) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232dd4bf' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 14px;
    border: 1px solid var(--ph-accent-line);
    color: var(--ph-accent-2); font-size: 13.5px; font-weight: 600;
    -webkit-appearance: none; appearance: none; cursor: pointer;
}
.ph-select:hover,
.ph-select:focus { border-color: var(--ph-accent-2); outline: none; }
.ph-select option { background: var(--ph-bg-card); color: var(--ph-text); }

/* ------------------------------------------------------ tab danh mục */

.ph-tabs {
    display: flex; gap: 8px; margin: -4px 0 22px;
    overflow-x: auto; scrollbar-width: none; padding-bottom: 2px;
}
.ph-tabs::-webkit-scrollbar { display: none; }
.ph-tab {
    flex: none; display: inline-flex; align-items: center;
    height: 34px; padding: 0 16px;
    border-radius: var(--ph-radius-pill);
    background: var(--ph-accent-soft); border: 1px solid var(--ph-accent-line);
    color: var(--ph-accent-2); font-size: 13.5px; font-weight: 600;
    transition: background var(--ph-ease), color var(--ph-ease);
}
.ph-tab:hover { background: rgba(20, 184, 166, .28); }
.ph-tab.is-active { background: var(--ph-accent); border-color: var(--ph-accent); color: #fff; }

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

.ph-pagination {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
    margin-top: 34px;
}
.ph-page {
    min-width: 40px; height: 40px; padding: 0 12px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 8px;
    background: var(--ph-bg-card); border: 1px solid var(--ph-accent-line);
    color: var(--ph-accent-2); font-size: 16px; font-weight: 500;
    transition: background var(--ph-ease), color var(--ph-ease);
}
a.ph-page:hover { background: var(--ph-accent-soft); color: var(--ph-text); }
.ph-page.is-current { background: var(--ph-accent); border-color: var(--ph-accent); color: #fff; }

/* -------------------------------------------------------------- trống */

.ph-empty {
    margin: 12px 0; padding: 48px 20px;
    border-radius: var(--ph-radius); border: 1px dashed var(--ph-line-strong);
    background: var(--ph-bg-soft);
    text-align: center; color: var(--ph-text-dim);
}
.ph-empty-title { color: var(--ph-text-2); font-size: 16px; font-weight: 600; }

/* --------------------------------------------------------- breadcrumb */

.ph-crumbs {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px;
    margin-bottom: 20px;
    color: var(--ph-text-2); font-size: 14px; line-height: 20px;
}
.ph-crumbs a:hover { color: var(--ph-accent-2); }
.ph-crumbs [aria-current] { color: var(--ph-text-dim); }
.ph-crumb-sep { color: var(--ph-text-faint); }

/* -------------------------------------------------------- chi tiết phim */

.ph-detail {
    position: relative; isolation: isolate; overflow: hidden;
    padding: 26px 0 34px;
}
.ph-detail::after {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background:
        linear-gradient(90deg, rgba(6, 9, 19, .97) 0%, rgba(6, 9, 19, .8) 45%, rgba(6, 9, 19, .6) 100%),
        linear-gradient(0deg, var(--ph-bg) 0%, rgba(6, 9, 19, 0) 50%);
}
.ph-detail-bg {
    position: absolute; inset: -40px; z-index: -2;
    width: calc(100% + 80px); height: calc(100% + 80px); max-width: none;
    object-fit: cover; filter: blur(24px) saturate(1.2); opacity: .7;
}

.ph-detail-inner {
    display: grid; grid-template-columns: 224px minmax(0, 1fr); gap: 32px; align-items: start;
}
.ph-detail-poster {
    position: relative; overflow: hidden;
    aspect-ratio: 224 / 288; border-radius: var(--ph-radius);
    background: var(--ph-bg-card); box-shadow: var(--ph-shadow);
}
.ph-detail-poster img { width: 100%; height: 100%; object-fit: cover; }

.ph-detail-body { min-width: 0; }
.ph-detail-title { margin-top: 16px; font-size: 36px; line-height: 40px; letter-spacing: -.015em; }
.ph-detail-body > .ph-detail-title:first-child { margin-top: 0; }
.ph-detail-original { margin-top: 4px; color: var(--ph-text-dim); font-size: 15px; }
.ph-detail-desc {
    margin-top: 12px; max-width: 944px;
    color: var(--ph-text-2); font-size: 16px; line-height: 24px;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

.ph-meta {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
    margin-top: 14px;
    color: var(--ph-text-2); font-size: 14px;
}
.ph-meta-sep { color: var(--ph-text-faint); }
.ph-badge { margin-left: 4px; }
.ph-badge-rating { color: var(--ph-star); }

.ph-layout {
    display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 48px;
    padding-top: 32px;
}
.ph-layout.is-single { grid-template-columns: minmax(0, 1fr); }
.ph-layout-main { min-width: 0; }
.ph-layout-side { min-width: 0; }

.ph-episodes {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px;
}
.ph-episode {
    display: flex; align-items: center; justify-content: center;
    height: 40px; padding: 0 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .05); border: 1px solid transparent;
    color: var(--ph-text-2); font-size: 16px; font-weight: 400;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    transition: background var(--ph-ease), border-color var(--ph-ease), color var(--ph-ease);
}
.ph-episode:hover { background: var(--ph-bg-hover); border-color: var(--ph-accent-line); color: var(--ph-accent-2); }
.ph-episode.is-current { background: var(--ph-accent-soft); border-color: var(--ph-accent); color: var(--ph-accent-2); }

.ph-facts {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px;
    margin: 28px 0 0; padding: 16px 18px;
    border-radius: var(--ph-radius); background: var(--ph-bg-card); border: 1px solid var(--ph-line);
}
.ph-fact dt { color: var(--ph-text-faint); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.ph-fact dd { margin: 3px 0 0; color: var(--ph-text); font-weight: 600; }
.ph-fact dd a { color: var(--ph-accent-2); }
.ph-fact dd a:hover { text-decoration: underline; }

/* ---------------------------------------------------- cột danh sách phim */

.ph-side-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ph-side .ph-block-title { font-size: 20px; line-height: 28px; }
.ph-side-item { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ph-side-poster {
    position: relative; flex: none; width: 64px; aspect-ratio: 64 / 84;
    border-radius: 8px; overflow: hidden; background: var(--ph-bg-card);
}
.ph-side-poster img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.ph-side-item:hover .ph-side-poster img { transform: scale(1.08); }
.ph-side-body { min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.ph-side-title {
    color: var(--ph-text-2); font-size: 16px; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ph-side-title a:hover { color: var(--ph-accent-2); }

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

.ph-watch { padding-top: 22px; }

.ph-watch-grid {
    display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 48px; align-items: start;
}

.ph-player-shell {
    min-width: 0; overflow: hidden;
    border-radius: var(--ph-radius); background: #000;
    box-shadow: var(--ph-shadow);
}

.ph-watch-panel {
    display: flex; flex-direction: column; gap: 12px; min-width: 0;
    max-height: 640px; overflow-y: auto; padding-right: 6px;
    scrollbar-width: thin; scrollbar-color: var(--ph-line-strong) transparent;
}
.ph-watch-title { font-size: 24px; line-height: 32px; }
.ph-watch-title a:hover { color: var(--ph-accent-2); }
.ph-watch-sub { color: var(--ph-text-dim); font-size: 14px; font-weight: 600; }
.ph-watch-desc {
    color: var(--ph-text-2); font-size: 13.5px;
    display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.ph-watch-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.ph-watch-panel .ph-block-title { margin: 8px 0 2px; font-size: 24px; }
.ph-episodes-panel { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Khung trình phát và bộ điều khiển tuỳ biến — class do film.js gắn. */

.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;
}

/* Tập chưa có nguồn: vẫn là một khung 16:9, nhưng có lời nhắn thay vì màn đen. */
.ph-player-empty {
    position: absolute; inset: 0;
    display: grid; place-items: center; padding: 20px;
    color: var(--ph-text-dim); text-align: center;
}

/*
 * JS chỉ thêm `has-controls` khi đã dựng xong bộ điều khiển riêng; nếu JS không
 * chạy, `controls` gốc của <video> vẫn còn — CSS không ẩn nó trước lúc đó.
 */
.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: 50%;
    display: grid; place-items: center;
    background: var(--ph-accent); border: 0;
    color: #fff; cursor: pointer;
    box-shadow: 0 10px 30px rgba(20, 184, 166, .45);
    transition: background var(--ph-ease), transform var(--ph-ease), opacity var(--ph-ease);
}
.ph-player-bigplay:hover { background: var(--ph-accent-2); transform: scale(1.06); }
.ph-player-bigplay svg { width: 28px; height: 28px; margin-left: 4px; }
.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: 26px 14px 10px;
    background: linear-gradient(to top, rgba(0, 0, 0, .85), rgba(0, 0, 0, 0));
    opacity: 1; 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: 32px; height: 32px; display: grid; place-items: center;
    background: none; border: 0; padding: 0; border-radius: 8px; color: #fff; cursor: pointer;
    opacity: .9; transition: opacity var(--ph-ease), color var(--ph-ease);
}
.ph-pbtn:hover { opacity: 1; color: var(--ph-accent-2); }
.ph-pbtn svg { width: 19px; height: 19px; }

/* Mỗi nút play/tắt-tiếng chứa 2 icon; JS chỉ đổi class, CSS quyết định icon nào hiện. */
.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; }

/* Nút tốc độ là chữ, cần bề rộng tối thiểu để các nút bên cạnh không nhảy. */
.ph-pbtn-speed { width: auto; min-width: 36px; 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: 16px; cursor: pointer;
    display: flex; align-items: center;
}
.ph-player-progress-track {
    position: relative; width: 100%; height: 4px; border-radius: 4px;
    background: rgba(255, 255, 255, .22); overflow: hidden;
    transition: height var(--ph-ease);
}
.ph-player-progress:hover .ph-player-progress-track { height: 6px; }
.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-2); }
.ph-player-progress-handle {
    position: absolute; top: 50%; left: 0%; width: 13px; height: 13px; border-radius: 50%;
    background: var(--ph-accent-2); transform: translate(-50%, -50%);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, .3);
}

.ph-player-volume { flex: none; display: flex; align-items: center; gap: 6px; }
.ph-player-volume input[type="range"] { width: 72px; accent-color: var(--ph-accent-2); cursor: pointer; }

.ph-player-upnext,
.ph-player-error {
    position: absolute; inset: 0;
    display: none; align-items: center; justify-content: center; padding: 20px;
    background: rgba(6, 9, 19, .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 {
    max-width: 340px; padding: 22px 24px; text-align: center;
    border-radius: var(--ph-radius); background: var(--ph-bg-card); border: 1px solid var(--ph-line-strong);
}
.ph-player-upnext-label {
    margin: 0 0 6px; color: var(--ph-accent-2);
    font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
}
.ph-player-upnext-title,
.ph-player-error-title { margin: 0 0 14px; color: #fff; font-size: 17px; font-weight: 700; }
.ph-player-error-title { margin-bottom: 6px; }
.ph-player-error-text { margin: 0 0 16px; color: var(--ph-text-dim); font-size: 13.5px; }
.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: 20px; height: 20px; margin-left: 4px; border-radius: 50%;
    background: rgba(255, 255, 255, .22); font-size: 11px;
}

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

.ph-people {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 20px 14px;
}
.ph-person { display: block; text-align: center; min-width: 0; }
.ph-person-photo {
    display: grid; place-items: end center;
    width: 78px; height: 78px; margin: 0 auto 10px;
    border-radius: 50%; overflow: hidden;
    background: var(--ph-bg-card); border: 2px solid var(--ph-line-strong);
    transition: border-color var(--ph-ease);
}
.ph-person:hover .ph-person-photo { border-color: var(--ph-accent-2); }
.ph-person-photo img { width: 100%; height: 100%; object-fit: cover; }
.ph-person-placeholder { width: 78%; height: 78%; color: var(--ph-text-faint); }
.ph-person-name {
    color: var(--ph-text); font-size: 13.5px; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ph-person:hover .ph-person-name { color: var(--ph-accent-2); }
.ph-person-role { margin-top: 2px; color: var(--ph-text-faint); font-size: 12px; }

.ph-person-head { align-items: center; }
.ph-person-photo-lg { width: 160px; height: 160px; margin: 0; border-width: 3px; }

/* ------------------------------------------------------ lưới thể loại */

.ph-genre-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px;
}
.ph-genre-card {
    position: relative; overflow: hidden;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 18px;
    border-radius: var(--ph-radius);
    background: linear-gradient(135deg, var(--ph-bg-card) 0%, #0e1d2c 100%);
    border: 1px solid var(--ph-line);
    transition: border-color var(--ph-ease), transform var(--ph-ease);
}
.ph-genre-card::before {
    content: ""; flex: none; width: 38px; height: 38px; border-radius: 10px;
    background: var(--ph-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M10 8.5v7l6-3.5z' fill='white'/%3E%3C/svg%3E") no-repeat center / 22px;
}
.ph-genre-card:hover { border-color: var(--ph-accent-line); transform: translateY(-2px); }
.ph-genre-card-name {
    flex: 1 1 auto; min-width: 0;
    color: var(--ph-text); font-size: 16px; font-weight: 700;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ph-genre-card:hover .ph-genre-card-name { color: var(--ph-accent-2); }
.ph-genre-card-count {
    flex: none; padding: 3px 10px; border-radius: var(--ph-radius-pill);
    background: var(--ph-accent-soft); border: 1px solid var(--ph-accent-line);
    color: var(--ph-accent-2); font-size: 12.5px; font-weight: 700;
}

/* -------------------------------------------- bảng xếp hạng (danh mục) */

.ph-podium {
    list-style: none; margin: 0 0 22px; padding: 0;
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px;
}
.ph-podium-item {
    display: flex; gap: 16px; min-width: 0; padding: 14px;
    border-radius: var(--ph-radius);
    background: var(--ph-bg-card); border: 1px solid var(--ph-line);
}
.ph-podium-1 { border-color: rgba(250, 204, 21, .45); background: linear-gradient(135deg, rgba(250, 204, 21, .08), var(--ph-bg-card) 60%); }
.ph-podium-poster {
    position: relative; flex: none; width: 104px; aspect-ratio: 2 / 3;
    border-radius: 10px; overflow: hidden; background: var(--ph-bg-soft);
}
.ph-podium-poster img { width: 100%; height: 100%; object-fit: cover; }
.ph-podium-rank {
    position: absolute; left: 6px; bottom: 0;
    font-size: 48px; font-weight: 900; font-style: italic; line-height: 1;
    color: var(--ph-bg); -webkit-text-stroke: 2px var(--ph-accent-2);
}
.ph-podium-1 .ph-podium-rank { -webkit-text-stroke-color: var(--ph-star); }
.ph-podium-body { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.ph-podium-title {
    font-size: 17px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ph-podium-title a:hover { color: var(--ph-accent-2); }
.ph-podium-metric { color: var(--ph-star); font-size: 13.5px; font-weight: 700; }
.ph-podium-body .ph-btn { margin-top: auto; }

.ph-ranklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ph-rankrow {
    display: grid; grid-template-columns: 44px 64px minmax(0, 1fr) auto 42px;
    align-items: center; gap: 16px;
    padding: 10px 14px;
    border-radius: var(--ph-radius);
    background: var(--ph-bg-card); border: 1px solid var(--ph-line);
    transition: border-color var(--ph-ease);
}
.ph-rankrow:hover { border-color: var(--ph-accent-line); }
.ph-rankrow-rank {
    text-align: center; font-size: 26px; font-weight: 900; font-style: italic;
    color: var(--ph-bg); -webkit-text-stroke: 1.5px var(--ph-accent-2);
}
.ph-rankrow-poster { display: block; aspect-ratio: 2 / 3; border-radius: 8px; overflow: hidden; background: var(--ph-bg-soft); }
.ph-rankrow-poster img { width: 100%; height: 100%; object-fit: cover; }
.ph-rankrow-body { min-width: 0; }
.ph-rankrow-title { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-rankrow-title a:hover { color: var(--ph-accent-2); }
.ph-rankrow-meta {
    display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px;
    color: var(--ph-text-dim); font-size: 13px;
}
.ph-rankrow-meta a { color: var(--ph-accent-2); }
.ph-rankrow-summary {
    margin-top: 4px; color: var(--ph-text-2); font-size: 13px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ph-rankrow-metric { color: var(--ph-star); font-size: 13.5px; font-weight: 700; white-space: nowrap; }
.ph-rankrow-play {
    width: 40px; height: 40px; display: grid; place-items: center;
    border-radius: 50%; background: var(--ph-accent); color: #fff; font-size: 14px;
    transition: background var(--ph-ease);
}
.ph-rankrow-play:hover { background: var(--ph-accent-2); color: #042f2b; }

/* --------------------------------------------- đầu trang nội dung (blog) */

.ph-pagehead {
    position: relative; overflow: hidden;
    padding: 30px 0 32px;
    border-bottom: 1px solid var(--ph-line);
    background:
        radial-gradient(700px 240px at 15% 0%, rgba(20, 184, 166, .16), transparent 70%),
        radial-gradient(600px 220px at 90% 10%, rgba(45, 212, 191, .08), transparent 70%),
        var(--ph-bg);
}
.ph-pagehead-eyebrow {
    display: inline-flex; margin-bottom: 10px;
    padding: 3px 10px; border-radius: var(--ph-radius-sm);
    background: var(--ph-accent-soft); border: 1px solid var(--ph-accent-line);
    color: var(--ph-accent-2); font-size: 12.5px; font-weight: 700;
}
.ph-pagehead-title { font-size: 32px; letter-spacing: -.015em; max-width: 900px; }
.ph-pagehead-lead { margin-top: 10px; max-width: 760px; color: var(--ph-text-dim); font-size: 15.5px; }

/* ------------------------------------------------------------ bài viết */

.ph-post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }

.ph-post {
    display: flex; flex-direction: column; min-width: 0; overflow: hidden;
    border-radius: var(--ph-radius);
    background: var(--ph-bg-card); border: 1px solid var(--ph-line);
    transition: border-color var(--ph-ease), transform var(--ph-ease);
}
.ph-post:hover { border-color: var(--ph-accent-line); transform: translateY(-2px); }
.ph-post-cover {
    position: relative; display: grid; place-items: center;
    aspect-ratio: 16 / 9; overflow: hidden; background: var(--ph-bg-soft); color: rgba(255, 255, 255, .7);
}
.ph-post-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.ph-post:hover .ph-post-cover img { transform: scale(1.05); }
.ph-cover-0 { background: linear-gradient(135deg, #0f766e, #0b1224); }
.ph-cover-1 { background: linear-gradient(135deg, #155e75, #0b1224); }
.ph-cover-2 { background: linear-gradient(135deg, #134e4a, #1e1b4b); }
.ph-cover-3 { background: linear-gradient(135deg, #0e7490, #111827); }
.ph-post-body { display: flex; flex-direction: column; gap: 8px; flex: 1 1 auto; padding: 16px 18px 18px; }
.ph-post-cat {
    align-self: flex-start;
    padding: 2px 9px; border-radius: var(--ph-radius-sm);
    background: var(--ph-accent-soft); border: 1px solid var(--ph-accent-line);
    color: var(--ph-accent-2); font-size: 12px; font-weight: 700;
}
.ph-post-title {
    font-size: 17px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ph-post-title a:hover { color: var(--ph-accent-2); }
.ph-post-excerpt {
    color: var(--ph-text-2); font-size: 13.5px;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.ph-post-meta {
    display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px;
    color: var(--ph-text-faint); font-size: 12.5px;
}

.ph-article { max-width: 820px; margin: 0 auto; padding-top: 28px; }
.ph-article-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; color: var(--ph-text-dim); font-size: 13.5px; }
.ph-article .ph-chips { margin-bottom: 20px; }
.ph-article-figure { margin: 0 0 26px; border-radius: var(--ph-radius); overflow: hidden; background: var(--ph-bg-card); }
.ph-article-figure img { width: 100%; }

.ph-post-nav {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px;
    max-width: 820px; margin: 36px auto 0;
}
.ph-post-nav-link {
    display: flex; flex-direction: column; gap: 4px; padding: 16px 18px;
    border-radius: var(--ph-radius); background: var(--ph-bg-card); border: 1px solid var(--ph-line);
    transition: border-color var(--ph-ease);
}
.ph-post-nav-link:hover { border-color: var(--ph-accent-line); }
.ph-post-nav-next { grid-column: 2; text-align: right; }
.ph-post-nav-label { color: var(--ph-accent-2); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.ph-post-nav-title { color: var(--ph-text); font-weight: 600; }

.ph-cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.ph-cat {
    display: flex; flex-direction: column; gap: 4px; padding: 18px;
    border-radius: var(--ph-radius); background: var(--ph-bg-card); border: 1px solid var(--ph-line);
    transition: border-color var(--ph-ease), transform var(--ph-ease);
}
.ph-cat:hover { border-color: var(--ph-accent-line); transform: translateY(-2px); }
.ph-cat-name { color: var(--ph-text); font-size: 16px; font-weight: 700; }
.ph-cat:hover .ph-cat-name { color: var(--ph-accent-2); }
.ph-cat-count { color: var(--ph-text-dim); font-size: 13px; }

/* ------------------------------------------------------ nội dung soạn thảo */

.ph-prose { color: var(--ph-text-2); font-size: 15px; line-height: 1.75; }
.ph-prose > * + * { margin-top: 1em; }
.ph-prose h2 { font-size: 24px; margin-top: 1.6em; }
.ph-prose h3 { font-size: 19px; margin-top: 1.4em; }
.ph-prose h4 { font-size: 16.5px; margin-top: 1.2em; }
.ph-prose a { color: var(--ph-accent-2); text-decoration: underline; text-underline-offset: 3px; }
.ph-prose strong { color: var(--ph-text); }
.ph-prose ul, .ph-prose ol { padding-left: 1.3em; }
.ph-prose li + li { margin-top: .35em; }
.ph-prose img { border-radius: var(--ph-radius); }
.ph-prose blockquote {
    margin-inline: 0; padding: 12px 18px;
    border-left: 3px solid var(--ph-accent); border-radius: 0 var(--ph-radius-sm) var(--ph-radius-sm) 0;
    background: var(--ph-bg-card); color: var(--ph-text);
}
.ph-prose table { width: 100%; border-collapse: collapse; font-size: 14px; display: block; overflow-x: auto; }
.ph-prose th, .ph-prose td { padding: 9px 12px; border: 1px solid var(--ph-line-strong); text-align: left; }
.ph-prose th { background: var(--ph-bg-card); color: var(--ph-text); }
.ph-prose code { padding: 2px 6px; border-radius: 5px; background: var(--ph-bg-card); font-size: .9em; }
.ph-prose pre { padding: 14px; border-radius: var(--ph-radius-sm); background: var(--ph-bg-card); overflow-x: auto; }
.ph-prose pre code { padding: 0; background: none; }
.ph-prose details {
    padding: 12px 16px; border-radius: 10px;
    background: var(--ph-bg-card); border: 1px solid var(--ph-line);
}
.ph-prose summary { color: var(--ph-text); font-weight: 700; cursor: pointer; }
.ph-prose-page { max-width: 860px; }

.ph-about .ph-prose { max-width: 900px; }
.ph-about .ph-prose h2:first-child { margin-top: 0; }

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

.ph-footer {
    margin-top: 24px;
    background: var(--ph-bg-footer);
    border-top: 1px solid var(--ph-line);
    color: var(--ph-text-2);
}
.ph-footer-top {
    display: flex; flex-wrap: wrap; gap: 36px 48px;
    padding: 44px 0 36px;
}
.ph-footer-about { flex: 1 1 280px; max-width: 380px; }
.ph-footer-about .ph-brand { margin-bottom: 16px; }
.ph-footer-text { color: var(--ph-text-2); font-size: 14px; line-height: 1.7; }
.ph-footer-contact {
    display: flex; flex-direction: column; gap: 4px; margin-top: 14px;
    font-style: normal; font-size: 13.5px; color: var(--ph-text-dim);
}
.ph-footer-contact a:hover { color: var(--ph-accent-2); }

.ph-social { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.ph-social a {
    width: 40px; height: 40px; display: grid; place-items: center;
    border-radius: 50%; background: rgba(255, 255, 255, .05); color: var(--ph-text-2);
    transition: background var(--ph-ease), color var(--ph-ease);
}
.ph-social a:hover { background: var(--ph-accent); color: #fff; }

.ph-footer-col { flex: 0 1 auto; min-width: 140px; }
.ph-footer-title { margin-bottom: 12px; color: var(--ph-text); font-size: 18px; line-height: 32px; font-weight: 700; }
.ph-footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.ph-footer-col.is-cols-2 ul { grid-template-columns: repeat(2, minmax(110px, auto)); column-gap: 28px; }
.ph-footer-col.is-cols-3 ul { grid-template-columns: repeat(3, minmax(110px, auto)); column-gap: 28px; }
.ph-footer-col a { color: var(--ph-text-2); font-size: 14px; font-weight: 500; transition: color var(--ph-ease); }
.ph-footer-col a:hover { color: var(--ph-accent-2); }

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

/* -------------------------------------------------------------- trang lỗi */

.error-body {
    margin: 0; min-height: 100vh;
    display: grid; place-items: center;
    background:
        radial-gradient(700px 360px at 50% 0%, rgba(20, 184, 166, .16), transparent 70%),
        var(--ph-bg);
}
.error-main { width: 100%; padding: 40px var(--ph-gutter); }
.error-card {
    max-width: 560px; margin: 0 auto; padding: 36px 30px;
    border-radius: 16px; background: var(--ph-bg-card); border: 1px solid var(--ph-line);
    text-align: center; box-shadow: var(--ph-shadow);
}
.error-code {
    font-size: 88px; font-weight: 900; line-height: 1; letter-spacing: -.03em;
    background: linear-gradient(180deg, #5eead4, #0f766e);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.error-title { margin-top: 12px; font-size: 24px; }
.error-text { margin-top: 10px; color: var(--ph-text-dim); }
.error-custom { margin-top: 14px; text-align: left; color: var(--ph-text-2); }
.error-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 24px; }
.error-actions .button {
    display: inline-flex; align-items: center; height: 42px; padding: 0 20px;
    border-radius: 10px; font-weight: 700; font-size: 14.5px;
    border: 1px solid var(--ph-line-strong); color: var(--ph-text);
    transition: background var(--ph-ease), border-color var(--ph-ease), color var(--ph-ease);
}
.error-actions .button-primary { background: var(--ph-accent); border-color: var(--ph-accent); color: #fff; }
.error-actions .button-primary:hover { background: var(--ph-accent-2); color: #042f2b; }
.error-actions .button-secondary:hover { border-color: var(--ph-accent-line); color: var(--ph-accent-2); }
.error-debug {
    margin-top: 26px; padding: 16px; text-align: left;
    border-radius: 10px; background: #0a0f1c; border: 1px solid rgba(244, 63, 94, .35);
}
.error-debug-title { color: #fda4af; font-size: 15px; }
.error-debug-message { margin-top: 6px; color: var(--ph-text); font-size: 14px; }
.error-debug-origin { margin-top: 4px; color: var(--ph-text-dim); font-size: 12.5px; word-break: break-all; }
.error-debug-trace { margin: 10px 0 0; max-height: 280px; overflow: auto; color: var(--ph-text-dim); font-size: 12px; white-space: pre-wrap; }

/* ============================================================ responsive */

@media (max-width: 1180px) {
    .ph-header-inner { gap: 20px; }
    .ph-nav { gap: 14px; }
    .ph-nav-link { font-size: 15px; }
    .ph-search { width: 220px; }
    .ph-rail-track { grid-auto-columns: calc((100% - 4 * 16px) / 5); gap: 16px; }
    .ph-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .ph-rail-prev { left: -8px; }
    .ph-rail-next { right: -8px; }
}

@media (max-width: 1024px) {
    .ph-nav { display: none; }
    .ph-burger { display: grid; }
    .ph-header-tools { margin-left: auto; }

    .ph-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ph-rail-track { grid-auto-columns: calc((100% - 3 * 16px) / 4); }
    .ph-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .ph-post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ph-podium { grid-template-columns: 1fr; }

    .ph-layout,
    .ph-watch-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
    .ph-watch-panel { max-height: none; overflow: visible; padding-right: 0; }
    .ph-layout-side .ph-side-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; }

    .ph-hero-foot { position: static; grid-row: 3; margin-top: 22px; }
    .ph-hero-picker { width: 100%; }
}

@media (max-width: 860px) {
    .ph-wgrid,
    .ph-gpanels { grid-template-columns: minmax(0, 1fr); }
    .ph-rankrow { grid-template-columns: 34px 56px minmax(0, 1fr) 40px; gap: 12px; }
    .ph-rankrow-metric { display: none; }
}

@media (max-width: 720px) {
    :root { --ph-gutter: 16px; --ph-header-h: 58px; }
    body { font-size: 14.5px; }

    .ph-header-tools .ph-search,
    .ph-header-tools .ph-lang { display: none; }
    .ph-brand-name { font-size: 18px; }
    .ph-brand-mark { width: 30px; height: 30px; }

    .ph-section { padding-top: 30px; }
    .ph-section-title { font-size: 20px; }
    .ph-block-title { font-size: 19px; }

    .ph-hero { padding: 20px 0 24px; }
    .ph-hero-heading { font-size: 21px; margin-bottom: 18px; }
    .ph-hero-inner { grid-template-columns: 112px minmax(0, 1fr); gap: 16px; min-height: 0; }
    .ph-hero-title { font-size: 19px; line-height: 25px; }
    .ph-hero-chips { margin-bottom: 10px; }
    .ph-hero-desc { font-size: 14px; line-height: 21px; -webkit-line-clamp: 3; }
    .ph-hero-body .ph-actions { padding-top: 14px; }
    .ph-btn-play { height: 42px; padding: 0 18px; font-size: 15px; }
    .ph-hero-foot { margin-top: 16px; }
    .ph-hero-thumb { width: 44px; }

    .ph-rail-track { grid-auto-columns: calc((100% - 2 * 12px) / 3); gap: 12px; }
    .ph-rail-btn { display: none; }
    .ph-card-title { font-size: 13.5px; margin-top: 8px; }
    .ph-card-rank { font-size: 46px; }
    .ph-card-play { display: none; }

    .ph-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 12px; }
    .ph-list { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .ph-list-poster { width: 70px; }
    .ph-list-title { font-size: 15px; }

    .ph-gpanel-track { grid-auto-columns: calc((100% - 2 * 10px) / 3.2); gap: 10px; padding: 12px; }
    .ph-gpanel-head { padding: 12px; }
    .ph-gpanel-icon { width: 38px; height: 38px; }

    .ph-wcard-poster { width: 112px; min-height: 164px; }
    .ph-wcard-body { padding: 12px 14px; }
    .ph-wcard-title { font-size: 17px; line-height: 24px; margin-top: 10px; }
    .ph-wcard-desc { font-size: 13.5px; line-height: 19px; margin-top: 6px; }
    .ph-wcard-btn { height: 38px; font-size: 14px; }
    .ph-wcard-desc + .ph-wcard-btn { margin-top: 12px; }
    .ph-hero-body { padding-top: 0; }
    .ph-list-poster { aspect-ratio: 3 / 4; }
    .ph-list-title { font-size: 16px; line-height: 22px; }
    .ph-list-desc { font-size: 13px; line-height: 19px; }
    .ph-card-title { font-size: 14px; line-height: 19px; }
    .ph-card-sub { margin-top: 10px; }
    h1.ph-section-title { font-size: 23px; line-height: 30px; }
    .ph-block-title { font-size: 20px; line-height: 28px; }
    .ph-side .ph-block-title { font-size: 19px; }
    .ph-episode { font-size: 14px; }
    .ph-tag, .ph-chip, .ph-badge { font-size: 12.5px; }

    .ph-detail { padding: 18px 0 24px; }
    .ph-detail-inner { grid-template-columns: 116px minmax(0, 1fr); gap: 16px; }
    .ph-detail-title { font-size: 22px; line-height: 28px; margin-top: 10px; }
    .ph-detail-desc { font-size: 14px; line-height: 21px; }
    .ph-meta { font-size: 13px; }
    .ph-detail .ph-actions { margin-top: 16px; }
    .ph-detail .ph-btn { height: 42px; padding: 0 18px; font-size: 15px; }
    .ph-layout { padding-top: 22px; }
    .ph-layout-side .ph-side-list { grid-template-columns: minmax(0, 1fr); }

    .ph-episodes { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
    .ph-episodes-panel { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
    .ph-episode { height: 38px; font-size: 13px; }

    .ph-watch { padding-top: 16px; }
    .ph-player-shell { margin-inline: calc(var(--ph-gutter) * -1); border-radius: 0; }
    .ph-watch-title { font-size: 19px; line-height: 26px; }
    .ph-watch-panel .ph-block-title { font-size: 19px; line-height: 26px; }
    .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: 4px; }
    .ph-player-bigplay { width: 56px; height: 56px; }

    .ph-pagehead { padding: 22px 0 24px; }
    .ph-pagehead-title { font-size: 24px; }
    .ph-post-grid { grid-template-columns: minmax(0, 1fr); }
    .ph-post-nav { grid-template-columns: minmax(0, 1fr); }
    .ph-post-nav-next { grid-column: auto; }

    .ph-person-head { grid-template-columns: 96px minmax(0, 1fr) !important; }
    .ph-person-photo-lg { width: 96px; height: 96px; }
    .ph-people { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }

    .ph-podium-poster { width: 84px; }
    .ph-rankrow { grid-template-columns: 28px 50px minmax(0, 1fr); padding: 10px; }
    .ph-rankrow-play { display: none; }
    .ph-rankrow-summary { display: none; }

    .ph-footer-top { gap: 28px 24px; padding: 34px 0 26px; }
    .ph-footer-about { flex-basis: 100%; max-width: none; }
    .ph-footer-col { flex: 1 1 140px; }
    .ph-footer-col.is-cols-2,
    .ph-footer-col.is-cols-3 { flex-basis: 100%; }
    .ph-footer-col.is-cols-2 ul,
    .ph-footer-col.is-cols-3 ul { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; }

    .error-code { font-size: 68px; }
}

@media (max-width: 420px) {
    .ph-hero-inner { grid-template-columns: 96px minmax(0, 1fr); gap: 14px; }
    .ph-hero-desc { -webkit-line-clamp: 2; }
    .ph-rail-track { grid-auto-columns: calc((100% - 12px) / 2.4); }
    .ph-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ph-wcard-poster { width: 100px; min-height: 150px; }
    .ph-wcard-desc { -webkit-line-clamp: 2; }
    .ph-detail-inner { grid-template-columns: 100px minmax(0, 1fr); }
    .ph-drawer-links { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Poster trong các lưới hai cột không được nới cột ra theo kích thước ảnh gốc
   (grid item mặc định có min-width: auto). */
.ph-hero-poster,
.ph-detail-poster,
.ph-hero-body,
.ph-detail-body { min-width: 0; width: 100%; }

/* ------------------------------------------- trang thể loại: lọc + lưới */

.ph-browse { padding-top: 28px; }
.ph-browse-title { font-size: 36px; line-height: 44px; letter-spacing: -.015em; }
.ph-accent { color: var(--ph-accent-2); }
.ph-browse-lead { margin-top: 12px; max-width: 1200px; color: var(--ph-text-2); font-size: 14px; line-height: 24px; }

.ph-browse-layout {
    display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start;
    margin-top: 24px;
}
.ph-browse-main { min-width: 0; }

.ph-filter {
    position: sticky; top: calc(var(--ph-header-h) + 8px);
    max-height: calc(100vh - var(--ph-header-h) - 16px); overflow-y: auto;
    padding: 16px 8px;
    border-radius: var(--ph-radius);
    background: rgba(255, 255, 255, .05);
    scrollbar-width: thin; scrollbar-color: var(--ph-line-strong) transparent;
}
.ph-filter-label { margin-bottom: 12px; padding: 0 16px; color: var(--ph-text-2); font-size: 14px; font-weight: 500; }
.ph-filter-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.ph-filter-item {
    display: flex; align-items: center; gap: 8px;
    height: 36px; padding: 0 16px;
    border-radius: var(--ph-radius-pill);
    color: var(--ph-text-2); font-size: 14px; font-weight: 500;
    transition: background var(--ph-ease), color var(--ph-ease);
}
.ph-filter-item:hover,
.ph-filter-item.is-active { background: var(--ph-accent-soft); color: var(--ph-accent-2); }
.ph-filter-item.is-active { font-weight: 700; }
.ph-genre-icon { flex: none; }
.ph-filter-name { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-filter-count { margin-left: auto; font-size: 12px; font-weight: 400; opacity: .9; }

.ph-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 12px; }
.ph-grid-4 .ph-card-sub { margin-top: 12px; flex-wrap: nowrap; overflow: hidden; }
.ph-grid-4 .ph-card-sub .ph-tag { flex: none; }
.ph-grid-4 .ph-tag { background: rgba(20, 184, 166, .14); border-color: transparent; font-size: 12px; }
.ph-grid-4 .ph-card-title { color: var(--ph-text); font-size: 14px; line-height: 20px; }

/* ------------------------------------ chi tiết phim: khối thông tin */

.ph-detail-inner { align-items: stretch; }
.ph-detail-poster { align-self: start; }
.ph-detail-body { display: flex; flex-direction: column; align-items: flex-start; }
.ph-detail-body > .ph-actions { margin-top: auto; padding-top: 20px; }
.ph-rating-max { margin-left: 2px; color: var(--ph-text-dim); font-size: 13px; font-weight: 500; }

.ph-credits { display: grid; gap: 6px; margin: 14px 0 0; max-width: 944px; font-size: 14px; line-height: 22px; }
.ph-credit { display: flex; gap: 10px; min-width: 0; }
.ph-credit dt { flex: none; min-width: 78px; color: var(--ph-text-dim); font-weight: 500; }
/* Hiện đủ mọi diễn viên — không cắt dòng, danh sách tự xuống hàng. */
.ph-credit dd { margin: 0; min-width: 0; color: var(--ph-text); }
/* Mỗi tên nằm trọn trên một dòng — không bẻ "Jeon Jong-seo" làm đôi. */
.ph-credit dd a { white-space: nowrap; }
.ph-credit dd a { color: var(--ph-text); font-weight: 600; transition: color var(--ph-ease); }
.ph-credit dd a:hover { color: var(--ph-accent-2); }
.ph-credit-sep { color: var(--ph-text-dim); }

@media (max-width: 1024px) {
    .ph-browse-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .ph-filter {
        position: static; max-height: none; overflow: visible;
        padding: 0; background: none; border-radius: 0;
    }
    .ph-filter-label { display: none; }
    .ph-filter-list {
        display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px;
        scrollbar-width: none;
    }
    .ph-filter-list::-webkit-scrollbar { display: none; }
    .ph-filter-item {
        flex: none; height: 34px; padding: 0 14px;
        background: var(--ph-accent-soft); border: 1px solid var(--ph-accent-line); color: var(--ph-accent-2);
    }
    .ph-filter-item.is-active { background: var(--ph-accent); border-color: var(--ph-accent); color: #fff; }
    .ph-filter-count { margin-left: 2px; opacity: .75; }
    .ph-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
    .ph-browse { padding-top: 20px; }
    .ph-browse-title { font-size: 24px; line-height: 32px; }
    .ph-browse-lead { font-size: 13.5px; line-height: 21px; }
    .ph-grid-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 12px; }
    .ph-credits { font-size: 13px; line-height: 20px; margin-top: 10px; }
    .ph-credit dt { min-width: 64px; }
    .ph-detail-body > .ph-actions { padding-top: 14px; }
    .ph-rating-max { font-size: 12px; }
}

@media (max-width: 480px) {
    .ph-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ------------------------- chi tiết phim: lưới "Xem nhiều nhất" (5 cột) */

.ph-grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 20px 10px; }
.ph-grid-5 .ph-card-title { color: var(--ph-text); font-size: 14px; line-height: 20px; }
.ph-grid-5 .ph-card-sub { margin-top: 10px; flex-wrap: nowrap; overflow: hidden; }
.ph-grid-5 .ph-card-sub .ph-tag { flex: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
/* Thẻ ở lưới này chỉ ~120px: một nhãn, như mẫu — nhãn thứ hai sẽ bị cắt dở chữ. */
.ph-grid-5 .ph-card-sub .ph-tag:nth-child(n+2) { display: none; }
.ph-grid-5 .ph-card-badge { font-size: 10.5px; }

@media (max-width: 720px) {
    .ph-grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 10px; }
}
@media (max-width: 420px) {
    .ph-grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Nhãn thể loại trên thẻ của rail: một dòng, tối đa hai nhãn. */
.ph-rail .ph-card-sub.ph-tags { flex-wrap: nowrap; overflow: hidden; }
.ph-rail .ph-card-sub .ph-tag { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; }
.ph-rail .ph-card-sub .ph-tag:nth-child(n+3) { display: none; }
