/* ==========================================================================
   Site stylesheet: one file, no framework. Dark, dense, mobile first.
   Sections: tokens, base, layout, header, navigation, chips, cards, grids,
   listing chrome (head, sort, pager), watch page, catalog pages, forms,
   footer, overlays (age gate, toast, banners), utilities.
   ========================================================================== */

/* --- Tokens ------------------------------------------------------------- */

:root {
    color-scheme: dark;

    --bg: #0b0c10;
    --bg-elev: #14161c;
    --bg-elev-2: #1c1f27;
    --bg-elev-3: #252935;
    --border: #2a2e3a;
    --border-strong: #3a3f4e;

    --text: #eceef3;
    --text-muted: #a3a9b8;
    --text-dim: #737a8c;

    --accent: #ff3d6e;
    --accent-hover: #ff5c86;
    --accent-soft: rgba(255, 61, 110, .14);
    --accent-contrast: #fff;
    --danger: #ff6b6b;
    --success: #34d399;

    --radius-lg: 14px;
    --radius: 10px;
    --radius-sm: 6px;
    --radius-pill: 999px;

    --container: 1440px;
    --gutter: 16px;
    --header-h: 60px;

    --shadow: 0 10px 30px rgba(0, 0, 0, .45);
    --ring: 0 0 0 3px rgba(255, 61, 110, .45);

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
            "Noto Sans", "Noto Sans Thai", "Leelawadee UI", "PingFang SC", "Microsoft YaHei",
            "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

@media (min-width: 768px) {
    :root { --gutter: 24px; }
}

/* --- Base --------------------------------------------------------------- */

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

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

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.55 var(--font);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Thai stacks vowels and tone marks above and below the line */
:lang(th) body { line-height: 1.75; }
/* CJK reads best without italics and with a little more air */
:lang(zh) body, :lang(ko) body { line-height: 1.65; }

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

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-hover); }

h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: .95rem; }
p { margin: 0 0 1em; }

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

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-sm); }

.icon { width: 1.15em; height: 1.15em; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon--fill { fill: currentColor; stroke: none; }

.skip-link {
    position: absolute; left: 12px; top: -48px; z-index: 100;
    padding: 10px 14px; border-radius: var(--radius-sm);
    background: var(--accent); color: var(--accent-contrast); font-weight: 600;
}
.skip-link:focus { top: 12px; color: var(--accent-contrast); }

/* --- Layout ------------------------------------------------------------- */

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }

.site-main { flex: 1; padding-block: 20px 48px; }

.section { margin-bottom: 36px; }
.section__head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin-bottom: 14px;
}
.section__title { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; }
.section__title .icon { color: var(--accent); }
.section__more {
    display: inline-flex; align-items: center; gap: 4px; flex: none;
    font-size: .85rem; font-weight: 600; color: var(--text-muted);
}
.section__more:hover { color: var(--accent-hover); }

/* Bootstrap-style grid, only what the account pages use */
.row { display: flex; flex-wrap: wrap; margin-inline: -8px; }
.row > [class*="col-"] { width: 100%; padding-inline: 8px; }
@media (min-width: 768px) { .row > .col-md-6 { width: 50%; } }
@media (min-width: 1024px) { .row > .col-lg-6 { width: 50%; } .row > .col-lg-12 { width: 100%; } }
@media (min-width: 1280px) { .row > .col-xl-6 { width: 50%; } }

/* --- Header ------------------------------------------------------------- */

.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(11, 12, 16, .92);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid var(--border);
}
.header-bar { display: flex; align-items: center; gap: 12px; height: var(--header-h); }

.logo { display: inline-flex; align-items: center; gap: 8px; flex: none; font-weight: 800; letter-spacing: -.02em; }
.logo:hover { color: var(--text); }
.logo__mark {
    display: grid; place-items: center; height: 30px; padding-inline: 8px;
    border-radius: 8px; background: var(--accent); color: var(--accent-contrast);
    font-size: .85rem; letter-spacing: .04em;
}
.logo__name { font-size: 1.05rem; }
.logo--joined { gap: 3px; }
@media (max-width: 479px) {
    .logo:not(.logo--joined) .logo__name { display: none; }
    .logo--joined .logo__name { font-size: .95rem; }
}

.main-nav { display: none; align-items: center; gap: 2px; margin-left: 8px; }
.main-nav__link {
    display: inline-flex; align-items: center; gap: 6px; height: 36px; padding-inline: 12px;
    border-radius: var(--radius-sm); color: var(--text-muted); font-weight: 600; font-size: .92rem;
}
.main-nav__link:hover, .main-nav__link[aria-current="page"] { color: var(--text); background: var(--bg-elev-2); }
@media (min-width: 1024px) { .main-nav { display: flex; } }

.header-search { position: relative; flex: 1; max-width: 460px; margin-left: auto; }
.header-search__form { display: flex; align-items: center; }
.header-search__input {
    width: 100%; height: 40px; padding: 0 44px 0 14px;
    border: 1px solid var(--border); border-radius: var(--radius-pill);
    background: var(--bg-elev-2); color: var(--text);
}
.header-search__input::placeholder { color: var(--text-dim); }
.header-search__input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.header-search__submit {
    position: absolute; right: 4px; display: grid; place-items: center;
    width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: var(--text-muted);
}
.header-search__submit:hover { color: var(--text); }

/* Below 768px the search box opens as a row under the bar */
@media (max-width: 767px) {
    .header-search {
        display: none; position: absolute; left: 0; right: 0; top: var(--header-h);
        max-width: none; margin: 0; padding: 10px var(--gutter);
        background: var(--bg-elev); border-bottom: 1px solid var(--border);
    }
    .search-open .header-search { display: block; }
}

.header-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
@media (min-width: 768px) { .header-actions { margin-left: 0; } }

.icon-btn {
    display: inline-grid; place-items: center; width: 40px; height: 40px;
    border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-muted);
}
.icon-btn:hover { color: var(--text); background: var(--bg-elev-2); }
.icon-btn .icon { width: 22px; height: 22px; }
.only-mobile { display: inline-grid; }
@media (min-width: 768px) { .only-mobile.search-toggle { display: none; } }
@media (min-width: 1024px) { .only-mobile.menu-toggle { display: none; } }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 40px; padding-inline: 16px; border: 1px solid transparent; border-radius: var(--radius-pill);
    font-weight: 700; font-size: .9rem; white-space: nowrap;
}
.btn--primary { background: var(--accent); color: var(--accent-contrast); }
.btn--primary:hover { background: var(--accent-hover); color: var(--accent-contrast); }
.btn--ghost { border-color: var(--border-strong); color: var(--text); background: transparent; }
.btn--ghost:hover { border-color: var(--text-muted); color: var(--text); }
.btn--sm { height: 34px; padding-inline: 12px; font-size: .85rem; }
.btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-hover); }
.btn[aria-pressed="true"] .icon { fill: currentColor; }

/* Dropdowns are <details>: they work without script, and site.js closes them on outside clicks */
.dropdown { position: relative; }
.dropdown > summary { list-style: none; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown__toggle {
    display: inline-flex; align-items: center; gap: 6px; height: 40px; padding-inline: 10px;
    border-radius: var(--radius-sm); color: var(--text-muted); font-weight: 600; font-size: .9rem; cursor: pointer;
}
.dropdown__toggle:hover, .dropdown[open] > .dropdown__toggle { color: var(--text); background: var(--bg-elev-2); }
.dropdown__toggle .icon { width: 20px; height: 20px; }
.dropdown__label { display: none; }
@media (min-width: 1280px) { .dropdown__label { display: inline; } }
.dropdown__menu {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 190px;
    padding: 6px; margin: 0; list-style: none;
    background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.dropdown__menu a, .dropdown__menu button {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px;
    border: 0; border-radius: var(--radius-sm); background: none; text-align: left; color: var(--text-muted); font-size: .92rem;
}
.dropdown__menu a:hover, .dropdown__menu button:hover { background: var(--bg-elev-2); color: var(--text); }
.dropdown__menu [aria-current="true"] { color: var(--accent-hover); font-weight: 700; }
.dropdown__code { margin-left: auto; color: var(--text-dim); font-size: .75rem; text-transform: uppercase; }
.dropdown__menu hr { margin: 6px 4px; border: 0; border-top: 1px solid var(--border); }

/* Genre mega menu in the desktop nav */
.dropdown--genres .dropdown__menu {
    left: 0; right: auto; width: min(560px, 90vw);
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px;
}

/* --- Off-canvas menu (below 1024px) ------------------------------------ */

.drawer {
    position: fixed; inset: 0; z-index: 70; visibility: hidden;
}
.drawer__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); opacity: 0; transition: opacity .2s; }
.drawer__panel {
    position: absolute; top: 0; bottom: 0; left: 0; width: min(320px, 86vw);
    display: flex; flex-direction: column; gap: 18px; padding: 16px 16px 32px; overflow-y: auto;
    background: var(--bg-elev); border-right: 1px solid var(--border);
    transform: translateX(-100%); transition: transform .22s ease;
}
.nav-open { overflow: hidden; }
.nav-open .drawer { visibility: visible; }
.nav-open .drawer__backdrop { opacity: 1; }
.nav-open .drawer__panel { transform: none; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; }
.drawer__title { margin-bottom: 8px; color: var(--text-dim); font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.drawer__links { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.drawer__links a {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px;
    border-radius: var(--radius-sm); color: var(--text-muted); font-weight: 600;
}
.drawer__links a:hover, .drawer__links a[aria-current] { background: var(--bg-elev-2); color: var(--text); }

/* --- Genre bar ---------------------------------------------------------- */

.genre-bar { border-bottom: 1px solid var(--border); background: var(--bg); }
.genre-bar__list {
    display: flex; gap: 8px; margin: 0; padding: 10px 0; list-style: none;
    overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.genre-bar__list::-webkit-scrollbar { display: none; }

/* --- Chips -------------------------------------------------------------- */

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chip {
    display: inline-flex; align-items: center; gap: 6px; flex: none;
    height: 32px; padding-inline: 12px; border: 1px solid var(--border); border-radius: var(--radius-pill);
    background: var(--bg-elev-2); color: var(--text-muted); font-size: .85rem; font-weight: 600; white-space: nowrap;
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip[aria-current="page"], .chip--active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-hover); }
.chip__count { color: var(--text-dim); font-weight: 500; font-size: .78rem; }
.chip .avatar { width: 22px; height: 22px; margin-left: -6px; font-size: .6rem; }

/* --- Movie card --------------------------------------------------------- */

.movie-grid {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px;
    margin: 0; padding: 0; list-style: none;
}
@media (min-width: 640px) { .movie-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 16px; } }
@media (min-width: 1024px) { .movie-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .movie-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

.movie-card { position: relative; min-width: 0; }
.movie-card__thumb {
    position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden;
    border-radius: var(--radius); background: var(--bg-elev-2);
}
.movie-card__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.movie-card__thumb::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, .55), transparent 45%);
    opacity: .9; transition: opacity .2s;
}
.movie-card__play {
    position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; opacity: 0; transition: opacity .2s;
}
.movie-card__play span {
    display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
    background: rgba(255, 61, 110, .92); color: #fff; box-shadow: var(--shadow);
}
.movie-card__play .icon { width: 20px; height: 20px; margin-left: 3px; }
.movie-card:hover .movie-card__thumb img { transform: scale(1.05); }
.movie-card:hover .movie-card__play { opacity: 1; }

.badge {
    position: absolute; z-index: 1; display: inline-flex; align-items: center; gap: 4px;
    height: 22px; padding-inline: 7px; border-radius: 5px;
    background: rgba(0, 0, 0, .78); color: #fff; font-size: .74rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.badge--duration { right: 8px; bottom: 8px; }
.badge--code { left: 8px; top: 8px; background: var(--accent); }

.movie-card__title {
    margin-top: 9px; font-size: .92rem; font-weight: 600; line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.movie-card__title a:hover { color: var(--accent-hover); }
.movie-card__meta {
    display: flex; align-items: center; gap: 12px; margin-top: 5px;
    color: var(--text-dim); font-size: .78rem; font-variant-numeric: tabular-nums;
}
.movie-card__meta span { display: inline-flex; align-items: center; gap: 4px; }
.movie-card__meta .icon { width: 14px; height: 14px; }

/* --- Listing chrome ----------------------------------------------------- */

.breadcrumbs {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 12px; padding: 0; list-style: none;
    color: var(--text-dim); font-size: .82rem;
}
.breadcrumbs li { display: inline-flex; align-items: center; gap: 6px; }
.breadcrumbs li + li::before { content: "/"; color: var(--border-strong); }
.breadcrumbs a:hover { color: var(--text); }
.breadcrumbs [aria-current] { color: var(--text-muted); }

.page-head { margin-bottom: 22px; }
.page-head__row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; }
.page-head__title { display: flex; align-items: center; gap: 12px; }
.page-head__count { color: var(--text-dim); font-size: .9rem; font-weight: 500; }
.page-head__desc { max-width: 820px; margin: 10px 0 0; color: var(--text-muted); font-size: .93rem; }

.sort-bar { display: inline-flex; padding: 3px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--bg-elev); }
.sort-bar a {
    display: inline-flex; align-items: center; height: 32px; padding-inline: 14px;
    border-radius: var(--radius-pill); color: var(--text-muted); font-size: .84rem; font-weight: 600; white-space: nowrap;
}
.sort-bar a:hover { color: var(--text); }
.sort-bar a[aria-current="true"] { background: var(--bg-elev-3); color: var(--text); }
@media (max-width: 479px) { .sort-bar { max-width: 100%; overflow-x: auto; } }

.pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 34px 0 0; padding: 0; list-style: none; }
.pager a, .pager span {
    display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding-inline: 10px;
    border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elev);
    color: var(--text-muted); font-weight: 600; font-variant-numeric: tabular-nums;
}
.pager a:hover { border-color: var(--border-strong); color: var(--text); }
.pager [aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.pager .pager__gap { border-color: transparent; background: none; }

.search-box { display: flex; gap: 8px; max-width: 520px; margin-top: 14px; }
.search-box input {
    flex: 1; height: 42px; padding-inline: 14px; border: 1px solid var(--border); border-radius: var(--radius-pill);
    background: var(--bg-elev-2);
}
.search-box input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.search-box--page { max-width: 640px; margin: 0 0 22px; }
.search-box--page input { height: 46px; font-size: 1rem; }

.search-matches { display: grid; gap: 14px; margin: 0 0 24px; padding: 16px; border-radius: var(--radius); background: var(--bg-elev); border: 1px solid var(--border); }
.search-matches__title { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; color: var(--text-muted); font-size: .8rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.search-matches__title .icon { width: 16px; height: 16px; }

.empty {
    display: grid; justify-items: center; gap: 10px; padding: 56px 16px; text-align: center;
    border: 1px dashed var(--border); border-radius: var(--radius-lg); color: var(--text-muted);
}
.empty .icon { width: 40px; height: 40px; color: var(--text-dim); }

/* --- Watch page --------------------------------------------------------- */

.watch { display: grid; gap: 22px; }
@media (min-width: 1200px) { .watch { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; } }

.player {
    position: relative; aspect-ratio: 16 / 9; overflow: hidden;
    border-radius: var(--radius-lg); background: #000;
}
.player > div, .player .jwplayer { position: absolute !important; inset: 0; width: 100% !important; height: 100% !important; }
.player__poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .45; }
.player__state {
    position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px;
    padding: 16px; text-align: center; color: var(--text-muted);
}
.player__state .icon { width: 44px; height: 44px; }
.player-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.watch-info { margin-top: 18px; }
.watch-info__title { font-size: 1.35rem; }
@media (min-width: 768px) { .watch-info__title { font-size: 1.6rem; } }
.watch-info__bar {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
    margin-top: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--border);
}
.stats { display: flex; flex-wrap: wrap; gap: 16px; margin: 0; padding: 0; list-style: none; color: var(--text-muted); font-size: .88rem; }
.stats li { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.stats .icon { width: 16px; height: 16px; color: var(--text-dim); }

.facts { display: grid; gap: 14px; margin: 18px 0 0; }
.facts__row { display: grid; gap: 8px; }
@media (min-width: 640px) { .facts__row { grid-template-columns: 110px minmax(0, 1fr); align-items: start; } }
.facts dt { padding-top: 6px; color: var(--text-dim); font-size: .82rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.facts dd { margin: 0; }

.description {
    margin-top: 18px; padding: 16px 18px; border-radius: var(--radius);
    background: var(--bg-elev); border: 1px solid var(--border); color: var(--text-muted); font-size: .93rem;
}
.description p:last-child { margin-bottom: 0; }
.watch-info__actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Comments: flat, newest first */
.comments { margin-top: 28px; }
.section__count {
    display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding-inline: 7px;
    border-radius: var(--radius-pill); background: var(--bg-elev-3); color: var(--text-muted);
    font-size: .78rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.comment-form {
    display: grid; gap: 10px; padding: 12px; border-radius: var(--radius);
    background: var(--bg-elev); border: 1px solid var(--border);
}
.comment-form textarea {
    width: 100%; min-height: 84px; padding: 10px 12px; resize: vertical;
    border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elev-2); color: var(--text);
}
.comment-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.comment-form__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.comment-form__hint { flex: 1 1 220px; color: var(--text-dim); font-size: .8rem; }
.comment-form__counter { color: var(--text-dim); font-size: .78rem; font-variant-numeric: tabular-nums; }
.comment-form__counter.is-over { color: var(--danger); }
.comments__signin {
    display: flex; align-items: center; gap: 10px; margin: 0; padding: 14px 16px; border-radius: var(--radius);
    background: var(--bg-elev); border: 1px dashed var(--border-strong); color: var(--text-muted);
}
.comments__signin a { color: var(--accent-hover); font-weight: 700; }
.comment-list { display: grid; gap: 4px; margin: 14px 0 0; padding: 0; list-style: none; }
.comment {
    display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; padding: 12px 4px;
    border-bottom: 1px solid var(--border);
}
.comment:target, .comment.is-new { animation: comment-flash 2.4s ease-out; }
@keyframes comment-flash { from { background: var(--accent-soft); } to { background: transparent; } }
.comment .comment__avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; font-size: .85rem; }
.comment__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.comment__author { font-size: .92rem; }
.comment__time { color: var(--text-dim); font-size: .78rem; }
.comment__text { margin: 4px 0 0; color: var(--text); font-size: .93rem; white-space: pre-line; overflow-wrap: anywhere; }
.comment__actions { display: flex; align-items: center; gap: 4px; margin-top: 6px; margin-left: -8px; }
.comment__action {
    display: inline-flex; align-items: center; gap: 6px; height: 30px; padding-inline: 8px; border: 0;
    border-radius: var(--radius-pill); background: transparent; color: var(--text-dim); font-size: .8rem; font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.comment__action:hover { background: var(--bg-elev-2); color: var(--text); }
.comment__action[aria-pressed="true"] { color: var(--accent-hover); }
.comment__action[aria-pressed="true"] .icon { fill: currentColor; }
.comment__action--delete { margin-left: auto; }
.comment__action--delete:hover { color: var(--danger); }
.comment__action:disabled { opacity: .5; }
.comments__empty { margin: 14px 0 0; color: var(--text-dim); font-size: .9rem; }
.comments__more { width: 100%; margin-top: 14px; }

/* Related movies: one list, a grid under the player until the side column has room for it */
.watch__aside .section__head { margin-bottom: 12px; }
@media (min-width: 1200px) {
    .watch__aside { position: sticky; top: calc(var(--header-h) + 16px); }
    .watch__aside .related-list { grid-template-columns: 1fr; gap: 12px; }
    .watch__aside .movie-card { display: grid; grid-template-columns: 152px minmax(0, 1fr); column-gap: 12px; align-content: start; }
    .watch__aside .movie-card__thumb { grid-row: span 2; border-radius: var(--radius-sm); }
    .watch__aside .movie-card__meta { margin-top: 4px; }
    .watch__aside .movie-card__play span { width: 34px; height: 34px; }
    .watch__aside .movie-card__title { margin-top: 0; font-size: .86rem; }
}

/* --- Catalog pages ------------------------------------------------------ */

.genre-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.genre-card {
    position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden;
    border-radius: var(--radius); border: 1px solid var(--border);
    background: linear-gradient(135deg, hsl(var(--hue, 340) 55% 26%), var(--bg-elev-2) 75%);
}
.genre-card img { width: 100%; height: 100%; object-fit: cover; opacity: .55; transition: transform .35s, opacity .2s; }
.genre-card__body {
    position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px;
    padding: 12px 14px; background: linear-gradient(to top, rgba(0, 0, 0, .85), rgba(0, 0, 0, .1) 70%);
}
.genre-card__name { margin: 0; font-size: 1.02rem; font-weight: 800; color: #fff; }
.genre-card__count { color: rgba(255, 255, 255, .7); font-size: .8rem; }
.genre-card:hover img { transform: scale(1.06); opacity: .7; }
.genre-card:hover { color: var(--text); border-color: var(--border-strong); }
@media (max-width: 480px) {
    .genre-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .genre-card__body { padding: 10px; }
    .genre-card__name { font-size: .92rem; }
}

.actor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.actor-card {
    display: grid; justify-items: center; gap: 8px; padding: 18px 10px 14px; height: 100%;
    border-radius: var(--radius); background: var(--bg-elev); border: 1px solid var(--border); text-align: center;
}
.actor-card:hover { color: var(--text); border-color: var(--border-strong); background: var(--bg-elev-2); }
.actor-card__name { font-size: .9rem; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.actor-card__count { color: var(--text-dim); font-size: .78rem; }

.avatar {
    --hue: 340;
    display: grid; place-items: center; flex: none; width: 64px; height: 64px; border-radius: 50%;
    background: linear-gradient(135deg, hsl(var(--hue) 70% 52%), hsl(calc(var(--hue) + 40) 70% 38%));
    color: #fff; font-weight: 800; font-size: 1.15rem; letter-spacing: .02em; text-shadow: 0 1px 2px rgba(0, 0, 0, .3);
}
.avatar--lg { width: 88px; height: 88px; font-size: 1.6rem; }

.profile-head { display: flex; align-items: center; gap: 18px; }
.profile-head__alt { margin-top: 4px; color: var(--text-dim); font-size: .95rem; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }

/* --- Forms (account pages keep their sign__ markup) -------------------- */

.sign { display: flex; justify-content: center; padding-block: 24px 8px; }
.sign__content { display: flex; justify-content: center; width: 100%; }
.sign__form {
    display: flex; flex-direction: column; align-items: stretch; gap: 14px; width: 100%; max-width: 420px;
    padding: 28px 24px; border-radius: var(--radius-lg); background: var(--bg-elev); border: 1px solid var(--border);
}
.sign__form--full { max-width: none; }
.sign__logo { display: flex; justify-content: center; margin-bottom: 6px; }
.sign__title { margin-bottom: 6px; font-size: 1.15rem; }
.sign__group { display: grid; gap: 6px; }
.sign__group--checkbox { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: .9rem; }
.sign__group--checkbox input { width: 18px; height: 18px; accent-color: var(--accent); }
.sign__label { color: var(--text-muted); font-size: .85rem; font-weight: 600; }
.sign__input {
    width: 100%; height: 44px; padding-inline: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--bg-elev-2); color: var(--text);
}
.sign__input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.sign__input[disabled], .sign__input[readonly] { color: var(--text-dim); }
.sign__btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 44px;
    border: 0; border-radius: var(--radius-sm); background: var(--accent); color: var(--accent-contrast); font-weight: 700;
}
.sign__btn:hover { background: var(--accent-hover); }
.sign__btn--small { width: auto; padding-inline: 22px; }
.sign__delimiter {
    display: flex; align-items: center; gap: 12px; color: var(--text-dim); font-size: .82rem;
}
.sign__delimiter::before, .sign__delimiter::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.sign__social button, .sign__social .gl {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 44px;
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: transparent; color: var(--text); font-weight: 600;
}
.sign__social button:hover { border-color: var(--text-muted); }
.sign__text { color: var(--text-muted); font-size: .9rem; text-align: center; }
.sign__text a { color: var(--accent-hover); font-weight: 600; }
.text-danger { color: var(--danger); font-size: .82rem; }
.text-danger ul { margin: 0; padding-left: 18px; }
.text-white { color: var(--text); }
.text-center { text-align: center; }
.w-100 { width: 100%; }
.mt-0 { margin-top: 0 !important; }
.mt-2 { margin-top: .5rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.fw-normal { font-weight: 400; }

/* The profile page's own section markup */
.section__wrap { display: grid; gap: 8px; }
.section__title--head { font-size: 1.5rem; }
.section__text { color: var(--text-muted); }
.content .sign__form { margin-bottom: 16px; }
.alert {
    position: relative; margin-bottom: 14px; padding: 12px 44px 12px 14px; border-radius: var(--radius-sm);
    border: 1px solid rgba(52, 211, 153, .4); background: rgba(52, 211, 153, .1); color: var(--success);
}
.btn-close {
    position: absolute; right: 8px; top: 8px; width: 28px; height: 28px; border: 0; border-radius: 50%;
    background: transparent; color: inherit;
}
.btn-close::before { content: "×"; font-size: 1.3rem; line-height: 28px; }
.fade:not(.show) { opacity: 0; }

/* --- Contact / error ---------------------------------------------------- */

.prose { max-width: 760px; color: var(--text-muted); }
.prose h2 { margin: 26px 0 10px; color: var(--text); }
.contact-cards { display: grid; gap: 14px; margin-top: 18px; }
@media (min-width: 640px) { .contact-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.contact-card {
    display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: var(--radius);
    background: var(--bg-elev); border: 1px solid var(--border);
}
.contact-card:hover { color: var(--text); border-color: var(--border-strong); }
.contact-card .icon { width: 28px; height: 28px; color: var(--accent); }
.contact-card strong { display: block; }
.contact-card span { color: var(--text-dim); font-size: .88rem; overflow-wrap: anywhere; }
.contact-aside .contact-cards { grid-template-columns: 1fr; margin-top: 12px; }

.contact-layout { display: grid; gap: 28px; margin-top: 18px; }
@media (min-width: 1024px) { .contact-layout { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; } }
.contact-aside__title { font-size: 1rem; color: var(--text); }
.contact-aside .prose h2 { font-size: 1rem; }
.contact-aside .prose p { font-size: .9rem; }

.form-card {
    display: grid; gap: 16px; padding: 22px 18px; border-radius: var(--radius-lg);
    background: var(--bg-elev); border: 1px solid var(--border);
}
@media (min-width: 640px) { .form-card { padding: 26px 24px; } }
.form-card__title { font-size: 1.1rem; }
.form-card__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.form-card__foot .field__hint { flex: 1 1 240px; margin: 0; }
.form-grid { display: grid; gap: 14px; }
@media (min-width: 640px) { .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.field { display: grid; gap: 6px; align-content: start; }
.field--full { grid-column: 1 / -1; }
.field__label { color: var(--text-muted); font-size: .85rem; font-weight: 600; }
.field__input {
    width: 100%; min-height: 44px; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--bg-elev-2); color: var(--text);
}
textarea.field__input { resize: vertical; }
select.field__input { appearance: none; padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.field__input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.field__input.input-validation-error { border-color: var(--danger); }
.field__hint { color: var(--text-dim); font-size: .8rem; }
.field__error { color: var(--danger); font-size: .82rem; }
.field__error:empty { display: none; }

.notice {
    display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; padding: 12px 14px; border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong); background: var(--bg-elev-2);
}
.notice p, .notice ul { margin: 0; }
.notice ul { padding-left: 18px; }
.notice .icon { margin-top: 2px; }
.notice--success { border-color: rgba(52, 211, 153, .4); background: rgba(52, 211, 153, .1); color: var(--success); }
.notice--error { border-color: rgba(255, 107, 107, .45); background: rgba(255, 107, 107, .1); color: var(--danger); margin-bottom: 0; }
.validation-summary-valid { display: none; }

/* The bots-only field: out of sight, out of the tab order */
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Legal pages: long text, so a narrower measure and visible links */
.legal .prose { max-width: 780px; line-height: 1.7; }
.legal .prose h2 { font-size: 1.1rem; }
.legal .prose ul { margin: 0 0 1em; padding-left: 22px; }
.legal .prose li { margin: 6px 0; }
.legal .prose a, .contact-aside .prose a { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }
.legal__updated { margin: 6px 0 0; color: var(--text-dim); font-size: .85rem; }
.legal__related {
    display: flex; flex-wrap: wrap; gap: 8px 18px; max-width: 780px; margin-top: 32px; padding-top: 16px;
    border-top: 1px solid var(--border); font-size: .88rem;
}
.legal__related a { color: var(--text-muted); }
.legal__related a:hover { color: var(--text); }
.sign__text--legal { margin: 0; font-size: .8rem; color: var(--text-dim); }

.error-page { display: grid; justify-items: center; gap: 12px; padding: 70px 16px; text-align: center; }
.error-page__code { font-size: 5rem; font-weight: 900; line-height: 1; color: var(--accent); }

/* --- Footer ------------------------------------------------------------- */

.site-footer { margin-top: auto; border-top: 1px solid var(--border); background: var(--bg-elev); color: var(--text-muted); font-size: .9rem; }
.footer-grid { display: grid; gap: 28px; padding-block: 36px 26px; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer-grid h2 { margin-bottom: 12px; color: var(--text); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }
.footer-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin: 0; padding: 0; list-style: none; }
.footer-links a:hover, .footer-links [aria-current] { color: var(--text); }
.footer-about p { max-width: 420px; }
.footer-bottom {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
    padding-block: 18px; border-top: 1px solid var(--border); color: var(--text-dim); font-size: .8rem;
}
.age-badge {
    display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
    border: 2px solid var(--accent); color: var(--accent); font-weight: 800; font-size: .78rem; flex: none;
}
.footer-note { display: flex; align-items: center; gap: 10px; }
.footer-legal { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.footer-legal a { color: var(--text-muted); }
.footer-legal a:hover { color: var(--text); }

/* --- Overlays ----------------------------------------------------------- */

.age-gate {
    width: min(440px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--border); border-radius: var(--radius-lg);
    background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow);
}
.age-gate::backdrop { background: rgba(5, 6, 9, .92); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.age-gate__body { display: grid; justify-items: center; gap: 14px; padding: 30px 26px 26px; text-align: center; }
.age-gate__body .age-badge { width: 64px; height: 64px; font-size: 1.3rem; border-width: 3px; }
.age-gate__body p { margin: 0; color: var(--text-muted); font-size: .92rem; }
.age-gate__actions { display: grid; gap: 10px; width: 100%; margin-top: 6px; }
.age-gate__actions .btn { width: 100%; height: 46px; }

.toast {
    position: fixed; left: 50%; bottom: 24px; z-index: 90; max-width: calc(100vw - 32px);
    padding: 12px 18px; border-radius: var(--radius); background: var(--bg-elev-3); border: 1px solid var(--border-strong);
    box-shadow: var(--shadow); font-size: .9rem; font-weight: 600;
    transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }

.suggest {
    position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 60; overflow: hidden;
    margin: 0; padding: 6px; list-style: none;
    background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.suggest[hidden] { display: none; }
.suggest a {
    display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 10px; align-items: center;
    padding: 6px; border-radius: var(--radius-sm); font-size: .86rem;
}
.suggest a:hover, .suggest a[aria-selected="true"] { background: var(--bg-elev-2); color: var(--text); }
.suggest img { width: 72px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; background: var(--bg-elev-2); }
.suggest span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.suggest__all { display: block !important; padding: 9px 6px !important; text-align: center; color: var(--accent-hover); font-weight: 700; }

.banner-slot { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-block: 14px; }
.banner-slot img { max-height: 120px; width: auto; border-radius: var(--radius-sm); }
.banner-text { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin-block: 10px; font-size: .88rem; font-weight: 700; }
.banner-text a { color: var(--accent-hover); }
.catfish {
    position: fixed; left: 50%; bottom: 0; z-index: 40; transform: translateX(-50%);
    width: min(728px, 100vw); padding: 6px; background: var(--bg-elev); border: 1px solid var(--border); border-bottom: 0;
    border-radius: var(--radius) var(--radius) 0 0; box-shadow: var(--shadow);
}
.catfish img { width: 100%; height: auto; max-height: 90px; object-fit: contain; }
.catfish__close {
    position: absolute; right: 6px; top: -30px; display: grid; place-items: center; width: 28px; height: 28px;
    border: 0; border-radius: 50%; background: var(--bg-elev-3); color: var(--text);
}
.popup-banner { width: min(520px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--radius-lg); background: transparent; }
.popup-banner::backdrop { background: rgba(0, 0, 0, .75); }
.popup-banner img { width: 100%; border-radius: var(--radius-lg); }
.popup-banner__close {
    position: absolute; right: 8px; top: 8px; display: grid; place-items: center; width: 32px; height: 32px;
    border: 0; border-radius: 50%; background: rgba(0, 0, 0, .7); color: #fff;
}

/* --- Utilities ---------------------------------------------------------- */

.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;
}
.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
.error-page .search-box { width: 100%; justify-self: center; }
